1var jO=Object.defineProperty;var KO=(t,e,n)=>e in t?jO(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var De=(t,e,n)=>(KO(t,typeof e!="symbol"?e+"":e,n),n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var Jn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ui(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function zi(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var ne={},Kh={};Kh.byteLength=GO;Kh.toByteArray=ZO;Kh.fromByteArray=QO;var ki=[],Mr=[],VO=typeof Uint8Array<"u"?Uint8Array:Array,bp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Oa=0,qO=bp.length;Oa<qO;++Oa)ki[Oa]=bp[Oa],Mr[bp.charCodeAt(Oa)]=Oa;Mr["-".charCodeAt(0)]=62;Mr["_".charCodeAt(0)]=63;function Nk(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("=");n===-1&&(n=e);var r=n===e?0:4-n%4;return[n,r]}function GO(t){var e=Nk(t),n=e[0],r=e[1];return(n+r)*3/4-r}function YO(t,e,n){return(e+n)*3/4-n}function ZO(t){var e,n=Nk(t),r=n[0],i=n[1],s=new VO(YO(t,r,i)),o=0,a=i>0?r-4:r,c;for(c=0;c<a;c+=4)e=Mr[t.charCodeAt(c)]<<18|Mr[t.charCodeAt(c+1)]<<12|Mr[t.charCodeAt(c+2)]<<6|Mr[t.charCodeAt(c+3)],s[o++]=e>>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=Mr[t.charCodeAt(c)]<<2|Mr[t.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=Mr[t.charCodeAt(c)]<<10|Mr[t.charCodeAt(c+1)]<<4|Mr[t.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function XO(t){return ki[t>>18&63]+ki[t>>12&63]+ki[t>>6&63]+ki[t&63]}function JO(t,e,n){for(var r,i=[],s=e;s<n;s+=3)r=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),i.push(XO(r));return i.join("")}function QO(t){for(var e,n=t.length,r=n%3,i=[],s=16383,o=0,a=n-r;o<a;o+=s)i.push(JO(t,o,o+s>a?a:o+s));return r===1?(e=t[n-1],i.push(ki[e>>2]+ki[e<<4&63]+"==")):r===2&&(e=(t[n-2]<<8)+t[n-1],i.push(ki[e>>10]+ki[e>>4&63]+ki[e<<2&63]+"=")),i.join("")}var Rm={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Rm.read=function(t,e,n,r,i){var s,o,a=i*8-r-1,c=(1<<a)-1,u=c>>1,l=-7,h=n?i-1:0,p=n?-1:1,g=t[e+h];for(h+=p,s=g&(1<<-l)-1,g>>=-l,l+=a;l>0;s=s*256+t[e+h],h+=p,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=r;l>0;o=o*256+t[e+h],h+=p,l-=8);if(s===0)s=1-u;else{if(s===c)return o?NaN:(g?-1:1)*(1/0);o=o+Math.pow(2,r),s=s-u}return(g?-1:1)*o*Math.pow(2,s-r)};Rm.write=function(t,e,n,r,i,s){var o,a,c,u=s*8-i-1,l=(1<<u)-1,h=l>>1,p=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=r?0:s-1,y=r?1:-1,w=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+h>=1?e+=p/c:e+=p*Math.pow(2,1-h),e*c>=2&&(o++,c/=2),o+h>
vendor: 4,363 bytes, lines 1-6
1=l?(a=0,o=l):o+h>=1?(a=(e*c-1)*Math.pow(2,i),o=o+h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[n+g]=a&255,g+=y,a/=256,i-=8);for(o=o<<i|a,u+=i;u>0;t[n+g]=o&255,g+=y,o/=256,u-=8);t[n+g-y]|=w*128};/*! 2 * The buffer module from node.js, for the browser. 3 * 4 * @author Feross Aboukhadijeh <https://feross.org> 5 * @license MIT 6 */(function(t){var e=Kh,n=Rm,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=a,t.SlowBuffer=C,t.INSPECT_MAX_BYTES=50;var i=2147483647;t.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=s(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&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.");function s(){try{var B=new Uint8Array(1),A={foo:function(){return 42}};return Object.setPrototypeOf(A,Uint8Array.prototype),Object.setPrototypeOf(B,A),B.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function o(B){if(B>i)throw new RangeError('The value "'+B+'" is invalid for option "size"');var A=new Uint8Array(B);return Object.setPrototypeOf(A,a.prototype),A}function a(B,A,R){if(typeof B=="number"){if(typeof A=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return h(B)}return c(B,A,R)}a.poolSize=8192;function c(B,A,R){if(typeof B=="string")return p(B,A);if(ArrayBuffer.isView(B))return y(B);if(B==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof B);if(q(B,ArrayBuffer)||B&&q(B.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(q(B,SharedArrayBuffer)||B&&q(B.buffer,SharedArrayBuffer)))return w(B,A,R);if(typeof B=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var U=B.valueOf&&B.valueOf();if(U!=null&&U!==B)return a.from(U,A,R);var j=k(B);if(j)return j;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof B[Symbol.toPrimitive]=="function")return a.from(B[Symbol.toPrimitive]("string"),A,R);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof B)}a.from=function(B,A,R){return c(B,A,R)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function u(B){if(typeof B!="number")throw new TypeError('"size" argument must be of type number');if(B<0)throw new RangeError('The value "'+B+'" is invalid for option "size"')}function l(B,A,R){return u(B),B<=0?o(B):A!==void 0?typeof R=="string"?o(B).fill(A,R):o(B).fill(A):o(B)}a.alloc=function(B,A,R){return l(B,A,R)};function h(B){return u(B),o(B<0?0:T(B)|0)}a.allocUnsafe=function(B){return h(B)},a.allocUnsafeSlow=function(B){return h(B)};function p(B,A){if((typeof A!="string"||A==="")&&(A="utf8"),!a.isEncoding(A))throw new TypeError("Unknown encoding: "+A);var R=O(B,A)|0,U=o(R),j=U.write(B,A);return j!==R&&(U=U.slice(0,j)),U}function g(B){for(var A=B.length<0?0:T(B.length)|0,R=o(A),U=0;U<A;U+=1)R[U]=B[U]&255;return R}function y(B){if(q(B,Uint8Array)){var A=new Uint8Array(B);return w(A.buffer,A.byteOffset,A.byteLength)}return g(B)}function w(B,A,R){if(A<0||B.byteLength<A)throw new RangeError('"offset" is outside of buffer bounds');if(B.byteLength<A+(R||0))throw new RangeError('"length" is outside of buffer bounds');var U;return A===void 0&&R===void 0?U=new Uint8Array(B):R===void 0?U=new Uint8Array(B,A):U=new Uint8Array(B,A,R),Object.setPrototypeOf(U,a.prototype),U}function k(B){if(a.isBuffer(B)){var A=T(B.length)|0,R=o(A);return R.length===0||B.copy(R,0,0,A),R}if(B.length!==void 0)return typeof B.length!="number"||Y(B.length)?o(0):g(B);if(B.type==="Buffer"&&Array.isArray(B.data))return g(B.data)}function T(B){if(B>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return B|0}function C(B){return+B!=B&&(B=0),a.alloc(+B)}a.isBuffer=function(A){return A!=null&&A._isBuffer===!0&&A!==a.prototype},a.compare=function(A,R){if(q(A,Uint8Array)&&(A=a.from(A,A.offset,A.byteLength)),q(
vendor: 4,081 bytes, line 6
6R,Uint8Array)&&(R=a.from(R,R.offset,R.byteLength)),!a.isBuffer(A)||!a.isBuffer(R))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(A===R)return 0;for(var U=A.length,j=R.length,V=0,Q=Math.min(U,j);V<Q;++V)if(A[V]!==R[V]){U=A[V],j=R[V];break}return U<j?-1:j<U?1:0},a.isEncoding=function(A){switch(String(A).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}},a.concat=function(A,R){if(!Array.isArray(A))throw new TypeError('"list" argument must be an Array of Buffers');if(A.length===0)return a.alloc(0);var U;if(R===void 0)for(R=0,U=0;U<A.length;++U)R+=A[U].length;var j=a.allocUnsafe(R),V=0;for(U=0;U<A.length;++U){var Q=A[U];if(q(Q,Uint8Array))V+Q.length>j.length?a.from(Q).copy(j,V):Uint8Array.prototype.set.call(j,Q,V);else if(a.isBuffer(Q))Q.copy(j,V);else throw new TypeError('"list" argument must be an Array of Buffers');V+=Q.length}return j};function O(B,A){if(a.isBuffer(B))return B.length;if(ArrayBuffer.isView(B)||q(B,ArrayBuffer))return B.byteLength;if(typeof B!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof B);var R=B.length,U=arguments.length>2&&arguments[2]===!0;if(!U&&R===0)return 0;for(var j=!1;;)switch(A){case"ascii":case"latin1":case"binary":return R;case"utf8":case"utf-8":return Re(B).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R*2;case"hex":return R>>>1;case"base64":return Ie(B).length;default:if(j)return U?-1:Re(B).length;A=(""+A).toLowerCase(),j=!0}}a.byteLength=O;function I(B,A,R){var U=!1;if((A===void 0||A<0)&&(A=0),A>this.length||((R===void 0||R>this.length)&&(R=this.length),R<=0)||(R>>>=0,A>>>=0,R<=A))return"";for(B||(B="utf8");;)switch(B){case"hex":return x(this,A,R);case"utf8":case"utf-8":return f(this,A,R);case"ascii":return b(this,A,R);case"latin1":case"binary":return E(this,A,R);case"base64":return m(this,A,R);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,A,R);default:if(U)throw new TypeError("Unknown encoding: "+B);B=(B+"").toLowerCase(),U=!0}}a.prototype._isBuffer=!0;function N(B,A,R){var U=B[A];B[A]=B[R],B[R]=U}a.prototype.swap16=function(){var A=this.length;if(A%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var R=0;R<A;R+=2)N(this,R,R+1);return this},a.prototype.swap32=function(){var A=this.length;if(A%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var R=0;R<A;R+=4)N(this,R,R+3),N(this,R+1,R+2);return this},a.prototype.swap64=function(){var A=this.length;if(A%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var R=0;R<A;R+=8)N(this,R,R+7),N(this,R+1,R+6),N(this,R+2,R+5),N(this,R+3,R+4);return this},a.prototype.toString=function(){var A=this.length;return A===0?"":arguments.length===0?f(this,0,A):I.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(A){if(!a.isBuffer(A))throw new TypeError("Argument must be a Buffer");return this===A?!0:a.compare(this,A)===0},a.prototype.inspect=function(){var A="",R=t.INSPECT_MAX_BYTES;return A=this.toString("hex",0,R).replace(/(.{2})/g,"$1 ").trim(),this.length>R&&(A+=" ... "),"<Buffer "+A+">"},r&&(a.prototype[r]=a.prototype.inspect),a.prototype.compare=function(A,R,U,j,V){if(q(A,Uint8Array)&&(A=a.from(A,A.offset,A.byteLength)),!a.isBuffer(A))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof A);if(R===void 0&&(R=0),U===void 0&&(U=A?A.length:0),j===void 0&&(j=0),V===void 0&&(V=this.length),R<0||U>A.length||j<0||V>this.length)throw new RangeError("out of range index");if(j>=V&&R>=U)return 0;if(j>=V)return-1;if(R>=U)return 1;if(R>>>=0,U>>>=0,j>>>=0,V>>>=0,this===A)return 0;for(var Q=V-j,re=U-R,ce=Math.min(Q,re),ye=this.slice(j,V),me=A.slice(R,U),ve=0;ve<ce;++ve)if(ye[ve]!==me[ve]){Q=ye[ve],re=me[ve];break}return Q<re?-1:re<Q?1:0};function F(B,A,R,U,j){if(B.length===0)return-1;
vendor: 3,513 bytes, line 6
6if(typeof R=="string"?(U=R,R=0):R>2147483647?R=2147483647:R<-2147483648&&(R=-2147483648),R=+R,Y(R)&&(R=j?0:B.length-1),R<0&&(R=B.length+R),R>=B.length){if(j)return-1;R=B.length-1}else if(R<0)if(j)R=0;else return-1;if(typeof A=="string"&&(A=a.from(A,U)),a.isBuffer(A))return A.length===0?-1:L(B,A,R,U,j);if(typeof A=="number")return A=A&255,typeof Uint8Array.prototype.indexOf=="function"?j?Uint8Array.prototype.indexOf.call(B,A,R):Uint8Array.prototype.lastIndexOf.call(B,A,R):L(B,[A],R,U,j);throw new TypeError("val must be string, number or Buffer")}function L(B,A,R,U,j){var V=1,Q=B.length,re=A.length;if(U!==void 0&&(U=String(U).toLowerCase(),U==="ucs2"||U==="ucs-2"||U==="utf16le"||U==="utf-16le")){if(B.length<2||A.length<2)return-1;V=2,Q/=2,re/=2,R/=2}function ce(Le,Ye){return V===1?Le[Ye]:Le.readUInt16BE(Ye*V)}var ye;if(j){var me=-1;for(ye=R;ye<Q;ye++)if(ce(B,ye)===ce(A,me===-1?0:ye-me)){if(me===-1&&(me=ye),ye-me+1===re)return me*V}else me!==-1&&(ye-=ye-me),me=-1}else for(R+re>Q&&(R=Q-re),ye=R;ye>=0;ye--){for(var ve=!0,qe=0;qe<re;qe++)if(ce(B,ye+qe)!==ce(A,qe)){ve=!1;break}if(ve)return ye}return-1}a.prototype.includes=function(A,R,U){return this.indexOf(A,R,U)!==-1},a.prototype.indexOf=function(A,R,U){return F(this,A,R,U,!0)},a.prototype.lastIndexOf=function(A,R,U){return F(this,A,R,U,!1)};function D(B,A,R,U){R=Number(R)||0;var j=B.length-R;U?(U=Number(U),U>j&&(U=j)):U=j;var V=A.length;U>V/2&&(U=V/2);for(var Q=0;Q<U;++Q){var re=parseInt(A.substr(Q*2,2),16);if(Y(re))return Q;B[R+Q]=re}return Q}function H(B,A,R,U){return W(Re(A,B.length-R),B,R,U)}function z(B,A,R,U){return W(_e(A),B,R,U)}function K(B,A,R,U){return W(Ie(A),B,R,U)}function _(B,A,R,U){return W(Xe(A,B.length-R),B,R,U)}a.prototype.write=function(A,R,U,j){if(R===void 0)j="utf8",U=this.length,R=0;else if(U===void 0&&typeof R=="string")j=R,U=this.length,R=0;else if(isFinite(R))R=R>>>0,isFinite(U)?(U=U>>>0,j===void 0&&(j="utf8")):(j=U,U=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var V=this.length-R;if((U===void 0||U>V)&&(U=V),A.length>0&&(U<0||R<0)||R>this.length)throw new RangeError("Attempt to write outside buffer bounds");j||(j="utf8");for(var Q=!1;;)switch(j){case"hex":return D(this,A,R,U);case"utf8":case"utf-8":return H(this,A,R,U);case"ascii":case"latin1":case"binary":return z(this,A,R,U);case"base64":return K(this,A,R,U);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,A,R,U);default:if(Q)throw new TypeError("Unknown encoding: "+j);j=(""+j).toLowerCase(),Q=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function m(B,A,R){return A===0&&R===B.length?e.fromByteArray(B):e.fromByteArray(B.slice(A,R))}function f(B,A,R){R=Math.min(B.length,R);for(var U=[],j=A;j<R;){var V=B[j],Q=null,re=V>239?4:V>223?3:V>191?2:1;if(j+re<=R){var ce,ye,me,ve;switch(re){case 1:V<128&&(Q=V);break;case 2:ce=B[j+1],(ce&192)===128&&(ve=(V&31)<<6|ce&63,ve>127&&(Q=ve));break;case 3:ce=B[j+1],ye=B[j+2],(ce&192)===128&&(ye&192)===128&&(ve=(V&15)<<12|(ce&63)<<6|ye&63,ve>2047&&(ve<55296||ve>57343)&&(Q=ve));break;case 4:ce=B[j+1],ye=B[j+2],me=B[j+3],(ce&192)===128&&(ye&192)===128&&(me&192)===128&&(ve=(V&15)<<18|(ce&63)<<12|(ye&63)<<6|me&63,ve>65535&&ve<1114112&&(Q=ve))}}Q===null?(Q=65533,re=1):Q>65535&&(Q-=65536,U.push(Q>>>10&1023|55296),Q=56320|Q&1023),U.push(Q),j+=re}return v(U)}var d=4096;function v(B){var A=B.length;if(A<=d)return String.fromCharCode.apply(String,B);for(var R="",U=0;U<A;
vendor: 7,230 bytes, line 6
6)R+=String.fromCharCode.apply(String,B.slice(U,U+=d));return R}function b(B,A,R){var U="";R=Math.min(B.length,R);for(var j=A;j<R;++j)U+=String.fromCharCode(B[j]&127);return U}function E(B,A,R){var U="";R=Math.min(B.length,R);for(var j=A;j<R;++j)U+=String.fromCharCode(B[j]);return U}function x(B,A,R){var U=B.length;(!A||A<0)&&(A=0),(!R||R<0||R>U)&&(R=U);for(var j="",V=A;V<R;++V)j+=te[B[V]];return j}function M(B,A,R){for(var U=B.slice(A,R),j="",V=0;V<U.length-1;V+=2)j+=String.fromCharCode(U[V]+U[V+1]*256);return j}a.prototype.slice=function(A,R){var U=this.length;A=~~A,R=R===void 0?U:~~R,A<0?(A+=U,A<0&&(A=0)):A>U&&(A=U),R<0?(R+=U,R<0&&(R=0)):R>U&&(R=U),R<A&&(R=A);var j=this.subarray(A,R);return Object.setPrototypeOf(j,a.prototype),j};function P(B,A,R){if(B%1!==0||B<0)throw new RangeError("offset is not uint");if(B+A>R)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(A,R,U){A=A>>>0,R=R>>>0,U||P(A,R,this.length);for(var j=this[A],V=1,Q=0;++Q<R&&(V*=256);)j+=this[A+Q]*V;return j},a.prototype.readUintBE=a.prototype.readUIntBE=function(A,R,U){A=A>>>0,R=R>>>0,U||P(A,R,this.length);for(var j=this[A+--R],V=1;R>0&&(V*=256);)j+=this[A+--R]*V;return j},a.prototype.readUint8=a.prototype.readUInt8=function(A,R){return A=A>>>0,R||P(A,1,this.length),this[A]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(A,R){return A=A>>>0,R||P(A,2,this.length),this[A]|this[A+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(A,R){return A=A>>>0,R||P(A,2,this.length),this[A]<<8|this[A+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(A,R){return A=A>>>0,R||P(A,4,this.length),(this[A]|this[A+1]<<8|this[A+2]<<16)+this[A+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(A,R){return A=A>>>0,R||P(A,4,this.length),this[A]*16777216+(this[A+1]<<16|this[A+2]<<8|this[A+3])},a.prototype.readIntLE=function(A,R,U){A=A>>>0,R=R>>>0,U||P(A,R,this.length);for(var j=this[A],V=1,Q=0;++Q<R&&(V*=256);)j+=this[A+Q]*V;return V*=128,j>=V&&(j-=Math.pow(2,8*R)),j},a.prototype.readIntBE=function(A,R,U){A=A>>>0,R=R>>>0,U||P(A,R,this.length);for(var j=R,V=1,Q=this[A+--j];j>0&&(V*=256);)Q+=this[A+--j]*V;return V*=128,Q>=V&&(Q-=Math.pow(2,8*R)),Q},a.prototype.readInt8=function(A,R){return A=A>>>0,R||P(A,1,this.length),this[A]&128?(255-this[A]+1)*-1:this[A]},a.prototype.readInt16LE=function(A,R){A=A>>>0,R||P(A,2,this.length);var U=this[A]|this[A+1]<<8;return U&32768?U|4294901760:U},a.prototype.readInt16BE=function(A,R){A=A>>>0,R||P(A,2,this.length);var U=this[A+1]|this[A]<<8;return U&32768?U|4294901760:U},a.prototype.readInt32LE=function(A,R){return A=A>>>0,R||P(A,4,this.length),this[A]|this[A+1]<<8|this[A+2]<<16|this[A+3]<<24},a.prototype.readInt32BE=function(A,R){return A=A>>>0,R||P(A,4,this.length),this[A]<<24|this[A+1]<<16|this[A+2]<<8|this[A+3]},a.prototype.readFloatLE=function(A,R){return A=A>>>0,R||P(A,4,this.length),n.read(this,A,!0,23,4)},a.prototype.readFloatBE=function(A,R){return A=A>>>0,R||P(A,4,this.length),n.read(this,A,!1,23,4)},a.prototype.readDoubleLE=function(A,R){return A=A>>>0,R||P(A,8,this.length),n.read(this,A,!0,52,8)},a.prototype.readDoubleBE=function(A,R){return A=A>>>0,R||P(A,8,this.length),n.read(this,A,!1,52,8)};function S(B,A,R,U,j,V){if(!a.isBuffer(B))throw new TypeError('"buffer" argument must be a Buffer instance');if(A>j||A<V)throw new RangeError('"value" argument is out of bounds');if(R+U>B.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(A,R,U,j){if(A=+A,R=R>>>0,U=U>>>0,!j){var V=Math.pow(2,8*U)-1;S(this,A,R,U,V,0)}var Q=1,re=0;for(this[R]=A&255;++re<U&&(Q*=256);)this[R+re]=A/Q&255;return R+U},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(A,R,U,j){if(A=+A,R=R>>>0,U=U>>>0,!j){var V=Math.pow(2,8*U)-1;S(this,A,R,U,V,0)}var Q=U-1,re=1;for(this[R+Q]=A&255;--Q>=0&&(re*=256);)this[R+Q]=A/re&255;return R+U},a.prototype.writeUint8=a.prototype.writeUInt8=function(A,R,U){return A=+A,R=R>>>0,U||S(this,A,R,1,255,0),this[R]=A&255,R+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(A,R,U){return A=+A,R=R>>>0,U||S(this,A,R,2,65535,0),this[R]=A&255,this[R+1]=A>>>8,R+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(A,R,U){return A=+A,R=R>>>0,U||S(this,A,R,2,65535,0),this[R]=A>>>8,this[R+1]=A&255,R+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(A,R,U){return A=+A,R=R>>>0,U||S(this,A,R,4,4294967295,0),this[R+3]=A>>>24,this[R+2]=A>>>16,this[R+1]=A>>>8,this[R]=A&255,R+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(A,R,U){return A=+A,R=R>>>0,U||S(this,A,R,4,4294967295,0),this[R]=A>>>24,this[R+1]=A>>>16,this[R+2]=A>>>8,this[R+3]=A&255,R+4},a.prototype.writeIntLE=function(A,R,U,j){if(A=+A,R=R>>>0,!j){var V=Math.pow(2,8*U-1);S(this,A,R,U,V-1,-V)}var Q=0,re=1,ce=0;for(this[R]=A&255;++Q<U&&(re*=256);)A<0&&ce===0&&this[R+Q-1]!==0&&(ce=1),this[R+Q]=(A/re>>0)-ce&255;return R+U},a.prototype.writeIntBE=function(A,R,U,j){if(A=+A,R=R>>>0,!j){var V=Math.pow(2,8*U-1);S(this,A,R,U,V-1,-V)}var Q=U-1,re=1,ce=0;for(this[R+Q]=A&255;--Q>=0&&(re*=256);)A<0&&ce===0&&this[R+Q+1]!==0&&(ce=1),this[R+Q]=(A/re>>0)-ce&255;return R+U},a.prototype.writeInt8=function(A,R,U){return A=+A,R=R>>>0,U||S(this,A,R,1,127,-128),A<0&&(A=255+A+1),this[R]=A&255,R+1},a.prototype.writeInt16LE=function(A,R,U){return A=+A,R=R>>>0,U||S(this,A,R,2,32767,-32768),this[R]=A&255,this[R+1]=A>>>8,R+2},a.prototype.writeInt16BE=function(A,R,U){return A=+A,R=R>>>0,U||S(this,A,R,2,32767,-32768),this[R]=A>>>8,this[R+1]=A&255,R+2},a.prototype.writeInt32LE=function(A,R,U){return A=+A,R=R>>>0,U||S(this,A,R,4,2147483647,-2147483648),this[R]=A&255,this[R+1]=A>>>8,this[R+2]=A>>>16,this[R+3]=A>>>24,R+4},a.prototype.writeInt32BE=function(A,R,U){return A=+A,R=R>>>0,U||S(this,A,R,4,2147483647,-2147483648),A<0&&(A=4294967295+A+1),this[R]=A>>>24,this[R+1]=A>>>16,this[R+2]=A>>>8,this[R+3]=A&255,R+4};function $(B,A,R,U,j,V){if(R+U>B.length)throw new RangeError("Index out of range");if(R<0)throw new RangeError("Index out of range")}function ie(B,A,R,U,j){return A=+A,R=R>>>0,j||$(B,A,R,4),n.write(B,A,R,U,23,4),R+4}a.prototype.writeFloatLE=function(A,R,U){return ie(this,A,R,!0,U)},a.prototype.writeFloatBE=function(A,R,U){return ie(this,A,R,!1,U)};function le(B,A,R,U,j){return A=+A,R=R>>>0,j||$(B,A,R,8),n.write(B,A,R,U,52,8),R+8}a.prototype.writeDoubleLE=function(A,R,U){return le(this,A,R,!0,U)},a.prototype.writeDoubleBE=function(A,R,U){return le(this,A,R,!1,U)},a.prototype.copy=function(A,R,U,j){if(!a.isBuffer(A))throw new TypeError("argument should be a Buffer");if(U||(U=0),!j&&j!==0&&(j=this.length),R>=A.length&&(R=A.length),R||(R=0),j>0&&j<U&&(j=U),j===U||A.length===0||this.length===0)return 0;if(R<0)throw new RangeError("targetStart out of bounds");if(U<0||U>=this.length)throw new RangeError("Index out of range");if(j<0)throw new RangeError("sourceEnd out of bounds");j>this.length&&(j=this.length),A.length-R<j-U&&(j=A.length-R+U);var V=j-U;return this===A&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(R,U,j):Uint8Array.prototype.set.call(A,this.subarray(U,j),R),V},a.prototype.fill=function(A,R,U,j){if(typeof A=="string"){if(typeof R=="str
6ing"?(j=R,R=0,U=this.length):typeof U=="string"&&(j=U,U=this.length),j!==void 0&&typeof j!="string")throw new TypeError("encoding must be a string");if(typeof j=="string"&&!a.isEncoding(j))throw new TypeError("Unknown encoding: "+j);if(A.length===1){var V=A.charCodeAt(0);(j==="utf8"&&V<128||j==="latin1")&&(A=V)}}else typeof A=="number"?A=A&255:typeof A=="boolean"&&(A=Number(A));if(R<0||this.length<R||this.length<U)throw new RangeError("Out of range index");if(U<=R)return this;R=R>>>0,U=U===void 0?this.length:U>>>0,A||(A=0);var Q;if(typeof A=="number")for(Q=R;Q<U;++Q)this[Q]=A;else{var re=a.isBuffer(A)?A:a.from(A,j),ce=re.length;if(ce===0)throw new TypeError('The value "'+A+'" is invalid for argument "value"');for(Q=0;Q<U-R;++Q)this[Q+R]=re[Q%ce]}return this};var se=/[^+/0-9A-Za-z-_]/g;function xe(B){if(B=B.split("=")[0],B=B.trim().replace(se,""),B.length<2)return"";for(;B.length%4!==0;)B=B+"=";return B}function Re(B,A){A=A||1/0;for(var R,U=B.length,j=null,V=[],Q=0;Q<U;++Q){if(R=B.charCodeAt(Q),R>55295&&R<57344){if(!j){if(R>56319){(A-=3)>-1&&V.push(239,191,189);continue}else if(Q+1===U){(A-=3)>-1&&V.push(239,191,189);continue}j=R;continue}if(R<56320){(A-=3)>-1&&V.push(239,191,189),j=R;continue}R=(j-55296<<10|R-56320)+65536}else j&&(A-=3)>-1&&V.push(239,191,189);if(j=null,R<128){if((A-=1)<0)break;V.push(R)}else if(R<2048){if((A-=2)<0)break;V.push(R>>6|192,R&63|128)}else if(R<65536){if((A-=3)<0)break;V.push(R>>12|224,R>>6&63|128,R&63|128)}else if(R<1114112){if((A-=4)<0)break;V.push(R>>18|240,R>>12&63|128,R>>6&63|128,R&63|128)}else throw new Error("Invalid code point")}return V}function _e(B){for(var A=[],R=0;R<B.length;++R)A.push(B.charCodeAt(R)&255);return A}function Xe(B,A){for(var R,U,j,V=[],Q=0;Q<B.length&&!((A-=2)<0);++Q)R=B.charCodeAt(Q),U=R>>8,j=R%256,V.push(j),V.push(U);return V}function Ie(B){return e.toByteArray(xe(B))}function W(B,A,R,U){for(var j=0;j<U&&!(j+R>=A.length||j>=B.length);++j)A[j+R]=B[j];return j}function q(B,A){return B instanceof A||B!=null&&B.constructor!=null&&B.constructor.name!=null&&B.constructor.name===A.name}function Y(B){return B!==B}var te=function(){for(var B="0123456789abcdef",A=new Array(256),R=0;R<16;++R)for(var U=R*16,j=0;j<16;++j)A[U+j]=B[R]+B[j];return A}()})(ne);var Gt={},vi,bi;function Ug(){throw new Error("setTimeout has not been defined")}function zg(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?vi=setTimeout:vi=Ug}catch{vi=Ug}try{typeof clearTimeout=="function"?bi=clearTimeout:bi=zg}catch{bi=zg}})();function Pk(t){if(vi===setTimeout)return setTimeout(t,0);if((vi===Ug||!vi)&&setTimeout)return vi=setTimeout,setTimeout(t,0);try{return vi(t,0)}catch{try{return vi.call(null,t,0)}catch{return vi.call(this,t,0)}}}function eI(t){if(bi===clearTimeout)return clearTimeout(t);if((bi===zg||!bi)&&clearTimeout)return bi=clearTimeout,clearTimeout(t);try{return bi(t)}catch{try{return bi.call(null,t)}catch{return bi.call(this,t)}}}var cs=[],Ka=!1,Uo,kf=-1;function tI(){!Ka||!Uo||(Ka=!1,Uo.length?cs=Uo.concat(cs):kf=-1,cs.length&&Mk())}function Mk(){if(!Ka){var t=Pk(tI);Ka=!0;for(var e=cs.length;e;){for(Uo=cs,cs=[];++kf<e;)Uo&&Uo[kf].run();kf=-1,e=cs.length}Uo=null,Ka=!1,eI(t)}}Gt.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];cs.push(new Lk(t,e)),cs.length===1&&!Ka&&Pk(Mk)};function Lk(t,e){this.fun=t,this.array=e}Lk.prototype.run=function(){this.fun.apply(null,this.array)};Gt.title="browser";Gt.browser=!0;Gt.env={};Gt.argv=[];Gt.version="";Gt.versions={};function ys(){}Gt.on=ys;Gt.addListener=ys;Gt.once=ys;Gt.off=ys;Gt.removeListener=ys;Gt.removeAllListeners=ys;Gt.emit=ys;Gt.prependListener=ys;Gt.prependOnceListener=ys;Gt.listeners=function(t){return[]};Gt.binding=function(t){throw new Error("process.binding is not supported")};Gt.cwd=function(){return"/"};Gt.chdir=function(t){throw new Error("process.chdir is not supported")};Gt.umask=function(){return 0};var nI=function(t){function e(){var r=this||self;return delete t.prototype.__magic__,r}if(typeof globalThis=="object")return globalThis;if(this)return e();t.defineProperty(t.prototype,"__magic__",{configurable:!0,get:e});var n=__magic__;return n}(Object),ia=nI;function Tm(t,e){const n=Object.create(null),r=t.split(",");for(let i=0;i<r.length;i++)n[r[i]]=!0;return e?i=>!!n[i.toLowerCase()]:i=>!!n[i]}const It={},Va=[],si=()=>{},rI=()=>!1,iI=/^on[^a-z]/,Vh=t=>iI.test(t),Om=t=>t.startsWith("onUpdate:"),yn=Object.assign,Im=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},sI=Object.prototype.hasOwnProperty,it=(t,e)=>sI.call(t,e),Ne=Array.isArray,qa=t=>qh(t)==="[object Map]",Bk=t=>qh(t)==="[object Set]",We=t=>typeof t=="function",qt=t=>typeof t=="string",Cm=t=>typeof t=="symbol",Pt=t=>t!==null&&typeof t=="object",Dk=t=>Pt(t)&&We(t.then)&&We(t.catch),$k=Object.prototype.toString,qh=t=>$k.call(t),oI=t=>qh(t).slice(8,-1),Fk=t=>qh(t)==="[object Object]",Nm=t=>qt(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Sf=Tm(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Gh=t=>{const e=Object.create(null);return n=>e[n]||(e[n]=t(n))},aI=/-(\w)/g,Bi=Gh(t=>t.replace(aI,(e,n)=>n?n.toUpperCase():"")),cI=/\B([A-Z])/g,ga=Gh(t=>t.replace(cI,"-$1").toLowerCase()),Yh=Gh(t=>t.charAt(0).toUpperCase()+t.slice(1)),wp=Gh(t=>t?`on${Yh(t)}`:""),Pu=(t,e)=>!Object.is(t,e),Ef=(t,e)=>{for(let n=0;n<t.length;n++)t[n](e)},eh=(t,e,n)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:n})},Hg=t=>{const e=parseFloat(t);return isNaN(e)?t:e},uI=t=>{const e=qt(t)?Number(t):NaN;return isNaN(e)?t:e};let H1;const Wg=()=>H1||(H1=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof ia<"u"?ia:{});function Ir(t){if(Ne(t)){const e={};for(let n=0;n<t.length;n++){const r=t[n],i=qt(r)?dI(r):Ir(r);if(i)for(const s in i)e[s]=i[s]}return e}else{if(qt(t))return t;if(Pt(t))return t}}const lI=/;(?![^(]*\))/g,fI=/:([^]+)/,hI=/\/\*[^]*?\*\//g;function dI(t){const e={};
vendor: 17,738 bytes, line 6
6return t.replace(hI,"").split(lI).forEach(n=>{if(n){const r=n.split(fI);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function Kt(t){let e="";if(qt(t))e=t;else if(Ne(t))for(let n=0;n<t.length;n++){const r=Kt(t[n]);r&&(e+=r+" ")}else if(Pt(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}function Dr(t){if(!t)return null;let{class:e,style:n}=t;return e&&!qt(e)&&(t.class=Kt(e)),n&&(t.style=Ir(n)),t}const pI="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",gI=Tm(pI);function Uk(t){return!!t||t===""}const Oe=t=>qt(t)?t:t==null?"":Ne(t)||Pt(t)&&(t.toString===$k||!We(t.toString))?JSON.stringify(t,zk,2):String(t),zk=(t,e)=>e&&e.__v_isRef?zk(t,e.value):qa(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[r,i])=>(n[`${r} =>`]=i,n),{})}:Bk(e)?{[`Set(${e.size})`]:[...e.values()]}:Pt(e)&&!Ne(e)&&!Fk(e)?String(e):e;let vr;class mI{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=vr,!e&&vr&&(this.index=(vr.scopes||(vr.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const n=vr;try{return vr=this,e()}finally{vr=n}}}on(){vr=this}off(){vr=this.parent}stop(e){if(this._active){let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.scopes)for(n=0,r=this.scopes.length;n<r;n++)this.scopes[n].stop(!0);if(!this.detached&&this.parent&&!e){const i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0,this._active=!1}}}function yI(t,e=vr){e&&e.active&&e.effects.push(t)}function Hk(){return vr}function vI(t){vr&&vr.cleanups.push(t)}const Pm=t=>{const e=new Set(t);return e.w=0,e.n=0,e},Wk=t=>(t.w&io)>0,jk=t=>(t.n&io)>0,bI=({deps:t})=>{if(t.length)for(let e=0;e<t.length;e++)t[e].w|=io},wI=t=>{const{deps:e}=t;if(e.length){let n=0;for(let r=0;r<e.length;r++){const i=e[r];Wk(i)&&!jk(i)?i.delete(t):e[n++]=i,i.w&=~io,i.n&=~io}e.length=n}},th=new WeakMap;let Qc=0,io=1;const jg=30;let ti;const Qo=Symbol(""),Kg=Symbol("");class Mm{constructor(e,n=null,r){this.fn=e,this.scheduler=n,this.active=!0,this.deps=[],this.parent=void 0,yI(this,r)}run(){if(!this.active)return this.fn();let e=ti,n=Ks;for(;e;){if(e===this)return;e=e.parent}try{return this.parent=ti,ti=this,Ks=!0,io=1<<++Qc,Qc<=jg?bI(this):W1(this),this.fn()}finally{Qc<=jg&&wI(this),io=1<<--Qc,ti=this.parent,Ks=n,this.parent=void 0,this.deferStop&&this.stop()}}stop(){ti===this?this.deferStop=!0:this.active&&(W1(this),this.onStop&&this.onStop(),this.active=!1)}}function W1(t){const{deps:e}=t;if(e.length){for(let n=0;n<e.length;n++)e[n].delete(t);e.length=0}}let Ks=!0;const Kk=[];function Ec(){Kk.push(Ks),Ks=!1}function Ac(){const t=Kk.pop();Ks=t===void 0?!0:t}function ur(t,e,n){if(Ks&&ti){let r=th.get(t);r||th.set(t,r=new Map);let i=r.get(n);i||r.set(n,i=Pm()),Vk(i)}}function Vk(t,e){let n=!1;Qc<=jg?jk(t)||(t.n|=io,n=!Wk(t)):n=!t.has(ti),n&&(t.add(ti),ti.deps.push(t))}function ps(t,e,n,r,i,s){const o=th.get(t);if(!o)return;let a=[];if(e==="clear")a=[...o.values()];else if(n==="length"&&Ne(t)){const c=Number(r);o.forEach((u,l)=>{(l==="length"||l>=c)&&a.push(u)})}else switch(n!==void 0&&a.push(o.get(n)),e){case"add":Ne(t)?Nm(n)&&a.push(o.get("length")):(a.push(o.get(Qo)),qa(t)&&a.push(o.get(Kg)));break;case"delete":Ne(t)||(a.push(o.get(Qo)),qa(t)&&a.push(o.get(Kg)));break;case"set":qa(t)&&a.push(o.get(Qo));break}if(a.length===1)a[0]&&Vg(a[0]);else{const c=[];for(const u of a)u&&c.push(...u);Vg(Pm(c))}}function Vg(t,e){const n=Ne(t)?t:[...t];for(const r of n)r.computed&&j1(r);for(const r of n)r.computed||j1(r)}function j1(t,e){(t!==ti||t.allowRecurse)&&(t.scheduler?t.scheduler():t.run())}function _I(t,e){var n;return(n=th.get(t))==null?void 0:n.get(e)}const kI=Tm("__proto__,__v_isRef,__isVue"),qk=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Cm)),SI=Lm(),EI=Lm(!1,!0),AI=Lm(!0),K1=xI();function xI(){const t={};return["includes","indexOf","lastIndexOf"].forEach(e=>{t[e]=function(...n){const r=Be(this);for(let s=0,o=this.length;s<o;s++)ur(r,"get",s+"");const i=r[e](...n);return i===-1||i===!1?r[e](...n.map(Be)):i}}),["push","pop","shift","unshift","splice"].forEach(e=>{t[e]=function(...n){Ec();const r=Be(this)[e].apply(this,n);return Ac(),r}}),t}function RI(t){const e=Be(this);return ur(e,"has",t),e.hasOwnProperty(t)}function Lm(t=!1,e=!1){return function(r,i,s){if(i==="__v_isReactive")return!t;if(i==="__v_isReadonly")return t;if(i==="__v_isShallow")return e;if(i==="__v_raw"&&s===(t?e?WI:Jk:e?Xk:Zk).get(r))return r;const o=Ne(r);if(!t){if(o&&it(K1,i))return Reflect.get(K1,i,s);if(i==="hasOwnProperty")return RI}const a=Reflect.get(r,i,s);return(Cm(i)?qk.has(i):kI(i))||(t||ur(r,"get",i),e)?a:Ln(a)?o&&Nm(i)?a:a.value:Pt(a)?t?Xh(a):vs(a):a}}const TI=Gk(),OI=Gk(!0);function Gk(t=!1){return function(n,r,i,s){let o=n[r];if(sc(o)&&Ln(o)&&!Ln(i))return!1;if(!t&&(!nh(i)&&!sc(i)&&(o=Be(o),i=Be(i)),!Ne(n)&&Ln(o)&&!Ln(i)))return o.value=i,!0;const a=Ne(n)&&Nm(r)?Number(r)<n.length:it(n,r),c=Reflect.set(n,r,i,s);return n===Be(s)&&(a?Pu(i,o)&&ps(n,"set",r,i):ps(n,"add",r,i)),c}}function II(t,e){const n=it(t,e);t[e];const r=Reflect.deleteProperty(t,e);return r&&n&&ps(t,"delete",e,void 0),r}function CI(t,e){const n=Reflect.has(t,e);return(!Cm(e)||!qk.has(e))&&ur(t,"has",e),n}function NI(t){return ur(t,"iterate",Ne(t)?"length":Qo),Reflect.ownKeys(t)}const Yk={get:SI,set:TI,deleteProperty:II,has:CI,ownKeys:NI},PI={get:AI,set(t,e){return!0},deleteProperty(t,e){return!0}},MI=yn({},Yk,{get:EI,set:OI}),Bm=t=>t,Zh=t=>Reflect.getPrototypeOf(t);function Bl(t,e,n=!1,r=!1){t=t.__v_raw;const i=Be(t),s=Be(e);n||(e!==s&&ur(i,"get",e),ur(i,"get",s));const{has:o}=Zh(i),a=r?Bm:n?Fm:Mu;if(o.call(i,e))return a(t.get(e));if(o.call(i,s))return a(t.get(s));t!==i&&t.get(e)}function Dl(t,e=!1){const n=this.__v_raw,r=Be(n),i=Be(t);return e||(t!==i&&ur(r,"has",t),ur(r,"has",i)),t===i?n.has(t):n.has(t)||n.has(i)}function $l(t,e=!1){return t=t.__v_raw,!e&&ur(Be(t),"iterate",Qo),Reflect.get(t,"size",t)}function V1(t){t=Be(t);const e=Be(this);return Zh(e).has.call(e,t)||(e.add(t),ps(e,"add",t,t)),this}function q1(t,e){e=Be(e);const n=Be(this),{has:r,get:i}=Zh(n);let s=r.call(n,t);s||(t=Be(t),s=r.call(n,t));const o=i.call(n,t);return n.set(t,e),s?Pu(e,o)&&ps(n,"set",t,e):ps(n,"add",t,e),this}function G1(t){const e=Be(this),{has:n,get:r}=Zh(e);let i=n.call(e,t);i||(t=Be(t),i=n.call(e,t)),r&&r.call(e,t);const s=e.delete(t);return i&&ps(e,"delete",t,void 0),s}function Y1(){const t=Be(this),e=t.size!==0,n=t.clear();return e&&ps(t,"clear",void 0,void 0),n}function Fl(t,e){return function(r,i){const s=this,o=s.__v_raw,a=Be(o),c=e?Bm:t?Fm:Mu;return!t&&ur(a,"iterate",Qo),o.forEach((u,l)=>r.call(i,c(u),c(l),s))}}function Ul(t,e,n){return function(...r){const i=this.__v_raw,s=Be(i),o=qa(s),a=t==="entries"||t===Symbol.iterator&&o,c=t==="keys"&&o,u=i[t](...r),l=n?Bm:e?Fm:Mu;return!e&&ur(s,"iterate",c?Kg:Qo),{next(){const{value:h,done:p}=u.next();return p?{value:h,done:p}:{value:a?[l(h[0]),l(h[1])]:l(h),done:p}},[Symbol.iterator](){return this}}}}function ks(t){return function(...e){return t==="delete"?!1:this}}function LI(){const t={get(s){return Bl(this,s)},get size(){return $l(this)},has:Dl,add:V1,set:q1,delete:G1,clear:Y1,forEach:Fl(!1,!1)},e={get(s){return Bl(this,s,!1,!0)},get size(){return $l(this)},has:Dl,add:V1,set:q1,delete:G1,clear:Y1,forEach:Fl(!1,!0)},n={get(s){return Bl(this,s,!0)},get size(){return $l(this,!0)},has(s){return Dl.call(this,s,!0)},add:ks("add"),set:ks("set"),delete:ks("delete"),clear:ks("clear"),forEach:Fl(!0,!1)},r={get(s){return Bl(this,s,!0,!0)},get size(){return $l(this,!0)},has(s){return Dl.call(this,s,!0)},add:ks("add"),set:ks("set"),delete:ks("delete"),clear:ks("clear"),forEach:Fl(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(s=>{t[s]=Ul(s,!1,!1),n[s]=Ul(s,!0,!1),e[s]=Ul(s,!1,!0),r[s]=Ul(s,!0,!0)}),[t,n,e,r]}const[BI,DI,$I,FI]=LI();function Dm(t,e){const n=e?t?FI:$I:t?DI:BI;return(r,i,s)=>i==="__v_isReactive"?!t:i==="__v_isReadonly"?t:i==="__v_raw"?r:Reflect.get(it(n,i)&&i in r?n:r,i,s)}const UI={get:Dm(!1,!1)},zI={get:Dm(!1,!0)},HI={get:Dm(!0,!1)},Zk=new WeakMap,Xk=new WeakMap,Jk=new WeakMap,WI=new WeakMap;function jI(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function KI(t){return t.__v_skip||!Object.isExtensible(t)?0:jI(oI(t))}function vs(t){return sc(t)?t:$m(t,!1,Yk,UI,Zk)}function VI(t){return $m(t,!1,MI,zI,Xk)}function Xh(t){return $m(t,!0,PI,HI,Jk)}function $m(t,e,n,r,i){if(!Pt(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const s=i.get(t);if(s)return s;const o=KI(t);if(o===0)return t;const a=new Proxy(t,o===2?r:n);return i.set(t,a),a}function Ga(t){return sc(t)?Ga(t.__v_raw):!!(t&&t.__v_isReactive)}function sc(t){return!!(t&&t.__v_isReadonly)}function nh(t){return!!(t&&t.__v_isShallow)}function Jh(t){return Ga(t)||sc(t)}function Be(t){const e=t&&t.__v_raw;return e?Be(e):t}function Qk(t){return eh(t,"__v_skip",!0),t}const Mu=t=>Pt(t)?vs(t):t,Fm=t=>Pt(t)?Xh(t):t;function eS(t){Ks&&ti&&(t=Be(t),Vk(t.dep||(t.dep=Pm())))}function tS(t,e){t=Be(t);const n=t.dep;n&&Vg(n)}function Ln(t){return!!(t&&t.__v_isRef===!0)}function ct(t){return nS(t,!1)}function ma(t){return nS(t,!0)}function nS(t,e){return Ln(t)?t:new qI(t,e)}class qI{constructor(e,n){this.__v_isShallow=n,this.dep=void 0,this.__v_isRef=!0,this._rawValue=n?e:Be(e),this._value=n?e:Mu(e)}get value(){return eS(this),this._value}set value(e){const n=this.__v_isShallow||nh(e)||sc(e);e=n?e:Be(e),Pu(e,this._rawValue)&&(this._rawValue=e,this._value=n?e:Mu(e),tS(this))}}function Um(t){return Ln(t)?t.value:t}const GI={get:(t,e,n)=>Um(Reflect.get(t,e,n)),set:(t,e,n,r)=>{const i=t[e];return Ln(i)&&!Ln(n)?(i.value=n,!0):Reflect.set(t,e,n,r)}};function rS(t){return Ga(t)?t:new Proxy(t,GI)}function Qh(t){const e=Ne(t)?new Array(t.length):{};for(const n in t)e[n]=ZI(t,n);return e}class YI{constructor(e,n,r){this._object=e,this._key=n,this._defaultValue=r,this.__v_isRef=!0}get value(){const e=this._object[this._key];return e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return _I(Be(this._object),this._key)}}function ZI(t,e,n){const r=t[e];return Ln(r)?r:new YI(t,e,n)}class XI{constructor(e,n,r,i){this._setter=n,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this._dirty=!0,this.effect=new Mm(e,()=>{this._dirty||(this._dirty=!0,tS(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!i,this.__v_isReadonly=r}get value(){const e=Be(this);return eS(e),(e._dirty||!e._cacheable)&&(e._dirty=!1,e._value=e.effect.run()),e._value}set value(e){this._setter(e)}}function JI(t,e,n=!1){let r,i;const s=We(t);return s?(r=t,i=si):(r=t.get,i=t.set),new XI(r,i,s||!i,n)}function Vs(t,e,n,r){let i;try{i=r?t(...r):t()}catch(s){ed(s,e,n)}return i}function Hr(t,e,n,r){if(We(t)){const s=Vs(t,e,n,r);return s&&Dk(s)&&s.catch(o=>{ed(o,e,n)}),s}const i=[];for(let s=0;s<t.length;s++)i.push(Hr(t[s],e,n,r));return i}function ed(t,e,n,r=!0){const i=e?e.vnode:null;if(e){let s=e.parent;const o=e.proxy,a=n;for(;s;){const u=s.ec;if(u){for(let l=0;l<u.length;l++)if(u[l](t,o,a)===!1)return}s=s.parent}const c=e.appContext.config.errorHandler;if(c){Vs(c,null,10,[t,o,a]);return}}QI(t,n,i,r)}function QI(t,e,n,r=!0){console.error(t)}let Lu=!1,qg=!1;const Kn=[];let Si=0;const Ya=[];let Ji=null,Po=0;const iS=Promise.resolve();let zm=null;function ho(t){const e=zm||iS;return t?e.then(this?t.bind(this):t):e}function eC(t){let e=Si+1,n=Kn.length;for(;e<n;){const r=e+n>>>1;Bu(Kn[r])<t?e=r+1:n=r}return e}function Hm(t){(!Kn.length||!Kn.includes(t,Lu&&t.allowRecurse?Si+1:Si))&&(t.id==null?Kn.push(t):Kn.splice(eC(t.id),0,t),sS())}function sS(){!Lu&&!qg&&(qg=!0,zm=iS.then(aS))}function tC(t){const e=Kn.indexOf(t);e>Si&&Kn.splice(e,1)}function nC(t){Ne(t)?Ya.push(...t):(!Ji||!Ji.includes(t,t.allowRecurse?Po+1:Po))&&Ya.push(t),sS()}function Z1(t,e=Lu?Si+1:0){for(;e<Kn.length;e++){const n=Kn[e];n&&n.pre&&(Kn.splice(e,1),e--,n())}}function oS(t){if(Ya.length){const e=[...new Set(Ya)];if(Ya.length=0,Ji){Ji.push(...e);return}for(Ji=e,Ji.sort((n,r)=>Bu(n)-Bu(r)),Po=0;Po<Ji.length;Po++)Ji[Po]();Ji=null,Po=0}}const Bu=t=>t.id==null?1/0:t.id,rC=(t,e)=>{const n=Bu(t)-Bu(e);if(n===0){if(t.pre&&!e.pre)return-1;if(e.pre&&!t.pre)return 1}return n};function aS(t){qg=!1,Lu=!0,Kn.sort(rC);const e=si;try{for(Si=0;Si<Kn.length;Si++){const n=Kn[Si];n&&n.active!==!1&&Vs(n,null,14)}}finally{Si=0,Kn.length=0,oS(),Lu=!1,zm=null,(Kn.length||Ya.length)&&aS()}}function iC(t,e,...n){if(t.isUnmounted)return;const r=t.vnode.props||It;let i=n;const s=e.startsWith("update:"),o=s&&e.slice(7);if(o&&o in r){const l=`${o==="modelValue"?"model":o}Modifiers`,{number:h,trim:p}=r[l]||It;p&&(i=n.map(g=>qt(g)?g.trim():g)),h&&(i=n.map(Hg))}let a,c=r[a=wp(e)]||r[a=wp(Bi(e))];!c&&s&&(c=r[a=wp(ga(e))]),c&&Hr(c,t,6,i);const u=r[a+"Once"];if(u){if(!t.emitted)t.emitted={};else if(t.emitted[a])return;t.emitted[a]=!0,Hr(u,t,6,i)}}function cS(t,e,n=!1){const r=e.emitsCache,i=r.get(t);if(i!==void 0)return i;const s=t.emits;let o={},a=!1;if(!We(t)){const c=u=>{const l=cS(u,e,!0);l&&(a=!0,yn(o,l))};!n&&e.mixins.length&&e.mixins.forEach(c),t.extends&&c(t.extends),t.mixins&&t.mixins.forEach(c)}return!s&&!a?(Pt(t)&&r.set(t,null),null):(Ne(s)?s.forEach(c=>o[c]=null):yn(o,s),Pt(t)&&r.set(t,o),o)}function td(t,e){return!t||!Vh(e)?!1:(e=e.slice(2).replace(/Once$/,""),it(t,e[0].toLowerCase()+e.slice(1))||it(t,ga(e))||it(t,e))}let Bn=null,nd=null;function rh(t){const e=Bn;return Bn=t,nd=t&&t.type.__scopeId||null,e}function ya(t){nd=t}function va(){nd=null}const sC=t=>Ii;function Ii(t,e=Bn,n){if(!e||t._n)return t;const r=(...i)=>{r._d&&uv(-1);const s=rh(e);let o;try{o=t(...i)}finally{rh(s),r._d&&uv(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function _p(t){const{type:e,vnode:n,proxy:r,withProxy:i,props:s,propsOptions:[o],slots:a,attrs:c,emit:u,render:l,renderCache:h,data:p,setupState:g,ctx:y,inheritAttrs:w}=t;let k,T;const C=rh(t);try{if(n.shapeFlag&4){const I=i||r;k=wi(l.call(I,I,h,s,g,p,y)),T=c}else{const I=e;k=wi(I.length>1?I(s,{attrs:c,slots:a,emit:u}):I(s,null)),T=e.props?c:oC(c)}}catch(I){pu.length=0,ed(I,t,1),k=Pe(Wr)}let O=k;if(T&&w!==!1){const I=Object.keys(T),{shapeFlag:N}=O;I.length&&N&7&&(o&&I.some(Om)&&(T=aC(T,o)),O=gs(O,T))}return n.dirs&&(O=gs(O),O.dirs=O.dirs?O.dirs.concat(n.dirs):n.dirs),n.transition&&(O.transition=n.transition),k=O,rh(C),k}const oC=t=>{let e;for(const n in t)(n==="class"||n==="style"||Vh(n))&&((e||(e={}))[n]=t[n]);return e},aC=(t,e)=>{const n={};for(const r in t)(!Om(r)||!(r.slice(9)in e))&&(n[r]=t[r]);return n};function cC(t,e,n){const{props:r,children:i,component:s}=t,{props:o,children:a,patchFlag:c}=e,u=s.emitsOptions;if(e.dirs||e.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?X1(r,o,u):!!o;if(c&8){const l=e.dynamicProps;for(let h=0;h<l.length;h++){const p=l[h];if(o[p]!==r[p]&&!td(u,p))return!0}}}else return(i||a)&&(!a||!a.$stable)?!0:r===o?!1:r?o?X1(r,o,u):!0:!!o;return!1}function X1(t,e,n){const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!0;for(let i=0;i<r.length;i++){const s=r[i];if(e[s]!==t[s]&&!td(n,s))return!0}return!1}function uC({vnode:t,parent:e},n){for(;e&&e.subTree===t;)(t=e.vnode).el=n,e=e.parent}const lC=t=>t.__isSuspense;function fC(t,e){e&&e.pendingBranch?Ne(t)?e.effects.push(...t):e.effects.push(t):nC(t)}function oi(t,e){return Wm(t,null,e)}const zl={};function ai(t,e,n){return Wm(t,e,n)}function Wm(t,e,{immediate:n,deep:r,flush:i,onTrack:s,onTrigger:o}=It){var a;const c=Hk()===((a=An)==null?void 0:a.scope)?An:null;let u,l=!1,h=!1;if(Ln(t)?(u=()=>t.value,l=nh(t)):Ga(t)?(u=()=>t,r=!0):Ne(t)?(h=!0,l=t.some(I=>Ga(I)||nh(I)),u=()=>t.map(I=>{if(Ln(I))return I.value;if(Ga(I))return zo(I);if(We(I))return Vs(I,c,2)})):We(t)?e?u=()=>Vs(t,c,2):u=()=>{if(!(c&&c.isUnmounted))return p&&p(),Hr(t,c,3,[g])}:u=si,e&&r){const I=u;u=()=>zo(I())}let p,g=I=>{p=C.onStop=()=>{Vs(I,c,4)}},y;if($u)if(g=si,e?n&&Hr(e,c,3,[u(),h?[]:void 0,g]):u(),i==="sync"){const I=aN();y=I.__watcherHandles||(I.__watcherHandles=[])}else return si;let w=h?new Array(t.length).fill(zl):zl;const k=()=>{if(C.active)if(e){const I=C.run();(r||l||(h?I.some((N,F)=>Pu(N,w[F])):Pu(I,w)))&&(p&&p(),Hr(e,c,3,[I,w===zl?void 0:h&&w[0]===zl?[]:w,g]),w=I)}else C.run()};k.allowRecurse=!!e;let T;i==="sync"?T=k:i==="post"?T=()=>nr(k,c&&c.suspense):(k.pre=!0,c&&(k.id=c.uid),T=()=>Hm(k));const C=new Mm(u,T);e?n?k():w=C.run():i==="post"?nr(C.run.bind(C),c&&c.suspense):C.run();const O=()=>{C.stop(),c&&c.scope&&Im(c.scope.effects,C)};return y&&y.push(O),O}function hC(t,e,n){const r=this.proxy,i=qt(t)?t.includes(".")?uS(r,t):()=>r[t]:t.bind(r,r);let s;We(e)?s=e:(s=e.handler,n=e);const o=An;ac(this);const a=Wm(i,s.bind(r),n);return o?ac(o):ea(),a}function uS(t,e){const n=e.split(".");return()=>{let r=t;for(let i=0;i<n.length&&r;i++)r=r[n[i]];return r}}function zo(t,e){if(!Pt(t)||t.__v_skip||(e=e||new Set,e.has(t)))return t;if(e.add(t),Ln(t))zo(t.value,e);else if(Ne(t))for(let n=0;n<t.length;n++)zo(t[n],e);else if(Bk(t)||qa(t))t.forEach(n=>{zo(n,e)});else if(Fk(t))for(const n in t)zo(t[n],e);return t}function kr(t,e){const n=Bn;if(n===null)return t;const r=ad(n)||n.proxy,i=t.dirs||(t.dirs=[]);for(let s=0;s<e.length;s++){let[o,a,c,u=It]=e[s];o&&(We(o)&&(o={mounted:o,updated:o}),o.deep&&zo(a),i.push({dir:o,instance:r,value:a,oldValue:void 0,arg:c,modifiers:u}))}return t}function vo(t,e,n,r){const i=t.dirs,s=e&&e.dirs;for(let o=0;o<i.length;o++){const a=i[o];s&&(a.oldValue=s[o].value);let c=a.dir[r];c&&(Ec(),Hr(c,n,8,[t.el,a,t,e]),Ac())}}function dC(){const t={isMounted:!1,isLeaving:!1,isUnmounting:!1,leav
6ingVNodes:new Map};return xc(()=>{t.isMounted=!0}),pS(()=>{t.isUnmounting=!0}),t}const Nr=[Function,Array],lS={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Nr,onEnter:Nr,onAfterEnter:Nr,onEnterCancelled:Nr,onBeforeLeave:Nr,onLeave:Nr,onAfterLeave:Nr,onLeaveCancelled:Nr,onBeforeAppear:Nr,onAppear:Nr,onAfterAppear:Nr,onAppearCancelled:Nr},pC={name:"BaseTransition",props:lS,setup(t,{slots:e}){const n=OS(),r=dC();let i;return()=>{const s=e.default&&hS(e.default(),!0);if(!s||!s.length)return;let o=s[0];if(s.length>1){for(const w of s)if(w.type!==Wr){o=w;break}}const a=Be(t),{mode:c}=a;if(r.isLeaving)return kp(o);const u=J1(o);if(!u)return kp(o);const l=Gg(u,a,r,n);Yg(u,l);const h=n.subTree,p=h&&J1(h);let g=!1;const{getTransitionKey:y}=u.type;if(y){const w=y();i===void 0?i=w:w!==i&&(i=w,g=!0)}if(p&&p.type!==Wr&&(!Mo(u,p)||g)){const w=Gg(p,a,r,n);if(Yg(p,w),c==="out-in")return r.isLeaving=!0,w.afterLeave=()=>{r.isLeaving=!1,n.update.active!==!1&&n.update()},kp(o);c==="in-out"&&u.type!==Wr&&(w.delayLeave=(k,T,C)=>{const O=fS(r,p);O[String(p.key)]=p,k._leaveCb=()=>{T(),k._leaveCb=void 0,delete l.delayedLeave},l.delayedLeave=C})}return o}}},gC=pC;function fS(t,e){const{leavingVNodes:n}=t;let r=n.get(e.type);return r||(r=Object.create(null),n.set(e.type,r)),r}function Gg(t,e,n,r){const{appear:i,mode:s,persisted:o=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:l,onBeforeLeave:h,onLeave:p,onAfterLeave:g,onLeaveCancelled:y,onBeforeAppear:w,onAppear:k,onAfterAppear:T,onAppearCancelled:C}=e,O=String(t.key),I=fS(n,t),N=(D,H)=>{D&&Hr(D,r,9,H)},F=(D,H)=>{const z=H[1];N(D,H),Ne(D)?D.every(K=>K.length<=1)&&z():D.length<=1&&z()},L={mode:s,persisted:o,beforeEnter(D){let H=a;if(!n.isMounted)if(i)H=w||a;else return;D._leaveCb&&D._leaveCb(!0);const z=I[O];z&&Mo(t,z)&&z.el._leaveCb&&z.el._leaveCb(),N(H,[D])},enter(D){let H=c,z=u,K=l;if(!n.isMounted)if(i)H=k||c,z=T||u,K=C||l;else return;let _=!1;const m=D._enterCb=f=>{_||(_=!0,f?N(K,[D]):N(z,[D]),L.delayedLeave&&L.delayedLeave(),D._enterCb=void 0)};H?F(H,[D,m]):m()},leave(D,H){const z=String(t.key);if(D._enterCb&&D._enterCb(!0),n.isUnmounting)return H();N(h,[D]);let K=!1;const _=D._leaveCb=m=>{K||(K=!0,H(),m?N(y,[D]):N(g,[D]),D._leaveCb=void 0,I[z]===t&&delete I[z])};I[z]=t,p?F(p,[D,_]):_()},clone(D){return Gg(D,e,n,r)}};return L}function kp(t){if(rd(t))return t=gs(t),t.children=null,t}function J1(t){return rd(t)?t.children?t.children[0]:void 0:t}function Yg(t,e){t.shapeFlag&6&&t.component?Yg(t.component.subTree,e):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function hS(t,e=!1,n){let r=[],i=0;for(let s=0;s<t.length;s++){let o=t[s];const a=n==null?o.key:String(n)+String(o.key!=null?o.key:s);o.type===Ct?(o.patchFlag&128&&i++,r=r.concat(hS(o.children,e,a))):(e||o.type!==Wr)&&r.push(a!=null?gs(o,{key:a}):o)}if(i>1)for(let s=0;s<r.length;s++)r[s].patchFlag=-2;return r}function dr(t,e){return We(t)?(()=>yn({name:t.name},e,{setup:t}))():t}const fu=t=>!!t.type.__asyncLoader,rd=t=>t.type.__isKeepAlive;function mC(t,e){dS(t,"a",e)}function yC(t,e){dS(t,"da",e)}function dS(t,e,n=An){const r=t.__wdc||(t.__wdc=()=>{let i=n;for(;i;){if(i.isDeactivated)return;i=i.parent}return t()});if(id(e,r,n),n){let i=n.parent;for(;i&&i.parent;)rd(i.parent.vnode)&&vC(r,e,n,i),i=i.parent}}function vC(t,e,n,r){const i=id(e,t,r,!0);pl(()=>{Im(r[e],i)},n)}function id(t,e,n=An,r=!1){if(n){const i=n[t]||(n[t]=[]),s=e.__weh||(e.__weh=(...o)=>{if(n.isUnmounted)return;Ec(),ac(n);const a=Hr(e,n,t,o);return ea(),Ac(),a});return r?i.unshift(s):i.push(s),s}}const bs=t=>(e,n=An)=>(!$u||t==="sp")&&id(t,(...r)=>e(...r),n),bC=bs("bm"),xc=bs("m"),wC=bs("bu"),_C=bs("u"),pS=bs("bum"),pl=bs("um"),kC=bs("sp"),SC=bs("rtg"),EC=bs("rtc");function AC(t,e=An){id("ec",t,e)}const gS="components",xC="directives";function mt(t,e){return mS(gS,t,!0,e)||t}const RC=Symbol.for("v-ndc");function jm(t){return mS(xC,t)}function mS(t,e,n=!0,r=!1){const i=Bn||An;if(i){const s=i.type;if(t===gS){const a=iN(s,!1);if(a&&(a===e||a===Bi(e)||a===Yh(Bi(e))))return s}const o=Q1(i[t]||s[t],e)||Q1(i.appContext[t],e);return!o&&r?s:o}}function Q1(t,e){return t&&(t[e]||t[Bi(e)]||t[Yh(Bi(e))])}function so(t,e,n,r){let i;const s=n&&n[r];if(Ne(t)||qt(t)){i=new Array(t.length);for(let o=0,a=t.length;o<a;o++)i[o]=e(t[o],o,void 0,s&&s[o])}else if(typeof t=="number"){i=new Array(t);for(let o=0;o<t;o++)i[o]=e(o+1,o,void 0,s&&s[o])}else if(Pt(t))if(t[Symbol.iterator])i=Array.from(t,(o,a)=>e(o,a,void 0,s&&s[a]));else{const o=Object.keys(t);i=new Array(o.length);for(let a=0,c=o.length;a<c;a++){const u=o[a];i[a]=e(t[u],u,a,s&&s[a])}}else i=[];return n&&(n[r]=i),i}function Gn(t,e,n={},r,i){if(Bn.isCE||Bn.parent&&fu(Bn.parent)&&Bn.parent.isCE)return e!=="default"&&(n.name=e),Pe("slot",n,r&&r()
vendor: 14,706 bytes, line 6
6);let s=t[e];s&&s._c&&(s._d=!1),he();const o=s&&yS(s(n)),a=gn(Ct,{key:n.key||o&&o.key||`_${e}`},o||(r?r():[]),o&&t._===1?64:-2);return!i&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),s&&s._c&&(s._d=!0),a}function yS(t){return t.some(e=>oc(e)?!(e.type===Wr||e.type===Ct&&!yS(e.children)):!0)?t:null}const Zg=t=>t?IS(t)?ad(t)||t.proxy:Zg(t.parent):null,hu=yn(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>Zg(t.parent),$root:t=>Zg(t.root),$emit:t=>t.emit,$options:t=>Km(t),$forceUpdate:t=>t.f||(t.f=()=>Hm(t.update)),$nextTick:t=>t.n||(t.n=ho.bind(t.proxy)),$watch:t=>hC.bind(t)}),Sp=(t,e)=>t!==It&&!t.__isScriptSetup&&it(t,e),TC={get({_:t},e){const{ctx:n,setupState:r,data:i,props:s,accessCache:o,type:a,appContext:c}=t;let u;if(e[0]!=="$"){const g=o[e];if(g!==void 0)switch(g){case 1:return r[e];case 2:return i[e];case 4:return n[e];case 3:return s[e]}else{if(Sp(r,e))return o[e]=1,r[e];if(i!==It&&it(i,e))return o[e]=2,i[e];if((u=t.propsOptions[0])&&it(u,e))return o[e]=3,s[e];if(n!==It&&it(n,e))return o[e]=4,n[e];Xg&&(o[e]=0)}}const l=hu[e];let h,p;if(l)return e==="$attrs"&&ur(t,"get",e),l(t);if((h=a.__cssModules)&&(h=h[e]))return h;if(n!==It&&it(n,e))return o[e]=4,n[e];if(p=c.config.globalProperties,it(p,e))return p[e]},set({_:t},e,n){const{data:r,setupState:i,ctx:s}=t;return Sp(i,e)?(i[e]=n,!0):r!==It&&it(r,e)?(r[e]=n,!0):it(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(s[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:r,appContext:i,propsOptions:s}},o){let a;return!!n[o]||t!==It&&it(t,o)||Sp(e,o)||(a=s[0])&&it(a,o)||it(r,o)||it(hu,o)||it(i.config.globalProperties,o)},defineProperty(t,e,n){return n.get!=null?t._.accessCache[e]=0:it(n,"value")&&this.set(t,e,n.value,null),Reflect.defineProperty(t,e,n)}};function ev(t){return Ne(t)?t.reduce((e,n)=>(e[n]=null,e),{}):t}let Xg=!0;function OC(t){const e=Km(t),n=t.proxy,r=t.ctx;Xg=!1,e.beforeCreate&&tv(e.beforeCreate,t,"bc");const{data:i,computed:s,methods:o,watch:a,provide:c,inject:u,created:l,beforeMount:h,mounted:p,beforeUpdate:g,updated:y,activated:w,deactivated:k,beforeDestroy:T,beforeUnmount:C,destroyed:O,unmounted:I,render:N,renderTracked:F,renderTriggered:L,errorCaptured:D,serverPrefetch:H,expose:z,inheritAttrs:K,components:_,directives:m,filters:f}=e;if(u&&IC(u,r,null),o)for(const b in o){const E=o[b];We(E)&&(r[b]=E.bind(n))}if(i){const b=i.call(n,n);Pt(b)&&(t.data=vs(b))}if(Xg=!0,s)for(const b in s){const E=s[b],x=We(E)?E.bind(n,n):We(E.get)?E.get.bind(n,n):si,M=!We(E)&&We(E.set)?E.set.bind(n):si,P=Ve({get:x,set:M});Object.defineProperty(r,b,{enumerable:!0,configurable:!0,get:()=>P.value,set:S=>P.value=S})}if(a)for(const b in a)vS(a[b],r,n,b);if(c){const b=We(c)?c.call(n):c;Reflect.ownKeys(b).forEach(E=>{BC(E,b[E])})}l&&tv(l,t,"c");function v(b,E){Ne(E)?E.forEach(x=>b(x.bind(n))):E&&b(E.bind(n))}if(v(bC,h),v(xc,p),v(wC,g),v(_C,y),v(mC,w),v(yC,k),v(AC,D),v(EC,F),v(SC,L),v(pS,C),v(pl,I),v(kC,H),Ne(z))if(z.length){const b=t.exposed||(t.exposed={});z.forEach(E=>{Object.defineProperty(b,E,{get:()=>n[E],set:x=>n[E]=x})})}else t.exposed||(t.exposed={});N&&t.render===si&&(t.render=N),K!=null&&(t.inheritAttrs=K),_&&(t.components=_),m&&(t.directives=m)}function IC(t,e,n=si){Ne(t)&&(t=Jg(t));for(const r in t){const i=t[r];let s;Pt(i)?"default"in i?s=Af(i.from||r,i.default,!0):s=Af(i.from||r):s=Af(i),Ln(s)?Object.defineProperty(e,r,{enumerable:!0,configurable:!0,get:()=>s.value,set:o=>s.value=o}):e[r]=s}}function tv(t,e,n){Hr(Ne(t)?t.map(r=>r.bind(e.proxy)):t.bind(e.proxy),e,n)}function vS(t,e,n,r){const i=r.includes(".")?uS(n,r):()=>n[r];if(qt(t)){const s=e[t];We(s)&&ai(i,s)}else if(We(t))ai(i,t.bind(n));else if(Pt(t))if(Ne(t))t.forEach(s=>vS(s,e,n,r));else{const s=We(t.handler)?t.handler.bind(n):e[t.handler];We(s)&&ai(i,s,t)}}function Km(t){const e=t.type,{mixins:n,extends:r}=e,{mixins:i,optionsCache:s,config:{optionMergeStrategies:o}}=t.appContext,a=s.get(e);let c;return a?c=a:!i.length&&!n&&!r?c=e:(c={},i.length&&i.forEach(u=>ih(c,u,o,!0)),ih(c,e,o)),Pt(e)&&s.set(e,c),c}function ih(t,e,n,r=!1){const{mixins:i,extends:s}=e;s&&ih(t,s,n,!0),i&&i.forEach(o=>ih(t,o,n,!0));for(const o in e)if(!(r&&o==="expose")){const a=CC[o]||n&&n[o];t[o]=a?a(t[o],e[o]):e[o]}return t}const CC={data:nv,props:rv,emits:rv,methods:eu,computed:eu,beforeCreate:qn,created:qn,beforeMount:qn,mounted:qn,beforeUpdate:qn,updated:qn,beforeDestroy:qn,beforeUnmount:qn,destroyed:qn,unmounted:qn,activated:qn,deactivated:qn,errorCaptured:qn,serverPrefetch:qn,components:eu,directives:eu,watch:PC,provide:nv,inject:NC};function nv(t,e){return e?t?function(){return yn(We(t)?t.call(this,this):t,We(e)?e.call(this,this):e)}:e:t}function NC(t,e){return eu(Jg(t),Jg(e))}function Jg(t){if(Ne(t)){const e={};for(let n=0;n<t.length;n++)e[t[n]]=t[n];return e}return t}function qn(t,e){return t?[...new Set([].concat(t,e))]:e}function eu(t,e){return t?yn(Object.create(null),t,e):e}function rv(t,e){return t?Ne(t)&&Ne(e)?[...new Set([...t,...e])]:yn(Object.create(null),ev(t),ev(e??{})):e}function PC(t,e){if(!t)return e;if(!e)return t;const n=yn(Object.create(null),t);for(const r in e)n[r]=qn(t[r],e[r]);return n}function bS(){return{app:null,config:{isNativeTag:rI,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let MC=0;function LC(t,e){return function(r,i=null){We(r)||(r=yn({},r)),i!=null&&!Pt(i)&&(i=null);const s=bS(),o=new Set;let a=!1;const c=s.app={_uid:MC++,_component:r,_props:i,_container:null,_context:s,_instance:null,version:NS,get config(){return s.config},set config(u){},use(u,...l){return o.has(u)||(u&&We(u.install)?(o.add(u),u.install(c,...l)):We(u)&&(o.add(u),u(c,...l))),c},mixin(u){return s.mixins.includes(u)||s.mixins.push(u),c},component(u,l){return l?(s.components[u]=l,c):s.components[u]},directive(u,l){return l?(s.directives[u]=l,c):s.directives[u]},mount(u,l,h){if(!a){const p=Pe(r,i);return p.appContext=s,l&&e?e(p,u):t(p,u,h),a=!0,c._container=u,u.__vue_app__=c,ad(p.component)||p.component.proxy}},unmount(){a&&(t(null,c._container),delete c._container.__vue_app__)},provide(u,l){return s.provides[u]=l,c},runWithContext(u){sh=c;try{return u()}finally{sh=null}}};return c}}let sh=null;function BC(t,e){if(An){let n=An.provides;const r=An.parent&&An.parent.provides;r===n&&(n=An.provides=Object.create(r)),n[t]=e}}function Af(t,e,n=!1){const r=An||Bn;if(r||sh){const i=r?r.parent==null?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:sh._context.provides;if(i&&t in i)return i[t];if(arguments.length>1)return n&&We(e)?e.call(r&&r.proxy):e}}function DC(t,e,n,r=!1){const i={},s={};eh(s,od,1),t.propsDefaults=Object.create(null),wS(t,e,i,s);for(const o in t.propsOptions[0])o in i||(i[o]=void 0);n?t.props=r?i:VI(i):t.type.props?t.props=i:t.props=s,t.attrs=s}function $C(t,e,n,r){const{props:i,attrs:s,vnode:{patchFlag:o}}=t,a=Be(i),[c]=t.propsOptions;let u=!1;if((r||o>0)&&!(o&16)){if(o&8){const l=t.vnode.dynamicProps;for(let h=0;h<l.length;h++){let p=l[h];if(td(t.emitsOptions,p))continue;const g=e[p];if(c)if(it(s,p))g!==s[p]&&(s[p]=g,u=!0);else{const y=Bi(p);i[y]=Qg(c,a,y,g,t,!1)}else g!==s[p]&&(s[p]=g,u=!0)}}}else{wS(t,e,i,s)&&(u=!0);let l;for(const h in a)(!e||!it(e,h)&&((l=ga(h))===h||!it(e,l)))&&(c?n&&(n[h]!==void 0||n[l]!==void 0)&&(i[h]=Qg(c,a,h,void 0,t,!0)):delete i[h]);if(s!==a)for(const h in s)(!e||!it(e,h))&&(delete s[h],u=!0)}u&&ps(t,"set","$attrs")}function wS(t,e,n,r){const[i,s]=t.propsOptions;let o=!1,a;if(e)for(let c in e){if(Sf(c))continue;const u=e[c];let l;i&&it(i,l=Bi(c))?!s||!s.includes(l)?n[l]=u:(a||(a={}))[l]=u:td(t.emitsOptions,c)||(!(c in r)||u!==r[c])&&(r[c]=u,o=!0)}if(s){const c=Be(n),u=a||It;for(let l=0;l<s.length;l++){const h=s[l];n[h]=Qg(i,c,h,u[h],t,!it(u,h))}}return o}function Qg(t,e,n,r,i,s){const o=t[n];if(o!=null){const a=it(o,"default");if(a&&r===void 0){const c=o.default;if(o.type!==Function&&!o.skipFactory&&We(c)){const{propsDefaults:u}=i;n in u?r=u[n]:(ac(i),r=u[n]=c.call(null,e),ea())}else r=c}o[0]&&(s&&!a?r=!1:o[1]&&(r===""||r===ga(n))&&(r=!0))}return r}function _S(t,e,n=!1){const r=e.propsCache,i=r.get(t);if(i)return i;const s=t.props,o={},a=[];let c=!1;if(!We(t)){const l=h=>{c=!0;const[p,g]=_S(h,e,!0);yn(o,p),g&&a.push(...g)};!n&&e.mixins.length&&e.mixins.forEach(l),t.extends&&l(t.extends),t.mixins&&t.mixins.forEach(l)}if(!s&&!c)return Pt(t)&&r.set(t,Va),Va;if(Ne(s))for(let l=0;l<s.length;l++){const h=Bi(s[l]);iv(h)&&(o[h]=It)}else if(s)for(const l in s){const h=Bi(l);if(iv(h)){const p=s[l],g=o[h]=Ne(p)||We(p)?{type:p}:yn({},p);if(g){const y=av(Boolean,g.type),w=av(String,g.type);g[0]=y>-1,g[1]=w<0||y<w,(y>-1||it(g,"default"))&&a.push(h)}}}const u=[o,a];return Pt(t)&&r.set(t,u),u}function iv(t){return t[0]!=="$"}function sv(t){const e=t&&t.toString().match(/^\s*(function|class) (\w+)/);return e?e[2]:t===null?"null":""}function ov(t,e){return sv(t)===sv(e)}function av(t,e){return Ne(e)?e.findIndex(n=>ov(n,t)):We(e)&&ov(e,t)?0:-1}const kS=t=>t[0]==="_"||t==="$stable",Vm=t=>Ne(t)?t.map(wi):[wi(t)],FC=(t,e,n)=>{if(e._n)return e;const r=Ii((...i)=>Vm(e(...i)),n);return r._c=!1,r},SS=(t,e,n)=>{const r=t._ctx;for(const i in t){if(kS(i))continue;const s=t[i];if(We(s))e[i]=FC(i,s,r);else if(s!=null){const o=Vm(s);e[i]=()=>o}}},ES=(t,e)=>{const n=Vm(e);t.slots.default=()=>n},UC=(t,e)=>{if(t.vnode.shapeFlag&32){const n=e._;n?(t.slots=Be(e),eh(e,"_",n)):SS(e,t.slots={})}else t.slots={},e&&ES(t,e);eh(t.slots,od,1)},zC=(t,e,n)=>{const{vnode:r,slots:i}=t;let s=!0,o=It;if(r.shapeFlag&32){const a=e._;a?n&&a===1?s=!1:(yn(i,e),!n&&a===1&&delete i._):(s=!e.$stable,SS(e,i)),o=e}else e&&(ES(t,e),o={default:1});if(s)for(const a in i)!kS(a)&&!(a in o)&&delete i[a]};function e0(t,e,n,r,i=!1){if(Ne(t)){t.forEach((p,g)=>e0(p,e&&(Ne(e)?e[g]:e),n,r,i));return}if(fu(r)&&!i)return;const s=r.shapeFlag&4?ad(r.component)||r.component.proxy:r.el,o=i?null:s,{i:a,r:c}=t,u=e&&e.r,l=a.refs===It?a.refs={}:a.refs,h=a.setupState;if(u!=null&&u!==c&&(qt(u)?(l[u]=null,it(h,u)&&(h[u]=null)):Ln(u)&&(u.value=null)),We(c))Vs(c,a,12,[o,l]);else{const p=qt(c),g=Ln(c);if(p||g){const y=()=>{if(t.f){const w=p?it(h,c)?h[c]:l[c]:c.value;i?Ne(w)&&Im(w,s):Ne(w)?w.includes(s)||w.push(s):p?(l[c]=[s],it(h,c)&&(h[c]=l[c])):(c.value=[s],t.k&&(l[t.k]=c.value))}else p?(l[c]=o,it(h,c)&&(h[c]=o)):g&&(c.value=o,t.k&&(l[t.k]=o))};o?(y.id=-1,nr(y,n)):y()}}}const nr=fC;function HC(t){return WC(t)}function WC(t,e){const n=Wg();n.__VUE__=!0;const{insert:r,remove:i,patchProp:s,createElement:o,createText:a,createComment:c,setText:u,setElementText:l,parentNode:h,nextSibling:p,setScopeId:g=si,insertStaticContent:y}=t,w=(W,q,Y,te=null,B=null,A=null,R=!1,U=null,j=!!q.dynamicChildren)=>{if(W===q)return;W&&!Mo(W,q)&&(te=xe(W),S(W,B,A,!0),W=null),q.patchFlag===-2&&(j=!1,q.dynamicChildren=null);const{type:V,ref:Q,shapeFlag:re}=q;switch(V){case sd:k(W,q,Y,te);break;case Wr:T(W,q,Y,te);break;case xf:W==null&&C(q,Y,te,R);break;case Ct:_(W,q,Y,te,B,A,R,U,j);break;default:re&1?N(W,q,Y,te,B,A,R,U,j):re&6?m(W,q,Y,te,B,A,R,U,j):(re&64||re&128)&&V.process(W,q,Y,te,B,A,R,U,j,_e)}Q!=null&&B&&e0(Q,W&&W.ref,A,q||W,!q)},k=(W,q,Y,te)=>{if(W==null)r(q.el=a(q.children),Y,te);else{const B=q.el=W.el;q.children!==W.children&&u(B,q.children)}},T=(W,q,Y,te)=>{W==null?r(q.el=c(q.children||""),Y,te):q.el=W.el},C=(W,q,Y,te)=>{[W.el,W.anchor]=y(W.children,q,Y,te,W.el,W.anchor)},O=({el:W,anchor:q},Y,te)=>{let B;for(;W&&W!==q;)B=p(W),r(W,Y,te),W=B;r(q,Y,te)},I=({el:W,anchor:q})=>{let Y;for(;W&&W!==q;)Y=p(W),i(W),W=Y;i(q)},N=(W,q,Y,te,B,A,R,U,j)=>{R=R||q.type==="svg",W==null?F(q,Y,te,B,A,R,U,j):H(W,q,B,A,R,U,j)},F=(W,q,Y,te,B,A,R,U)=>{let j,V;const{type:Q,props:re,shapeFlag:ce,transition:ye,dirs:me}=W;if(j=W.el=o(W.type,A,re&&re.is,re),ce&8?l(j,W.children):ce&16&&D(W.children,j,null,te,B,A&&Q!=="foreignObject",R,U),me&&vo(W,null,te,"created"),L(j,W,W.scopeId,R,te),re){for(const qe in re)qe!=="value"&&!Sf(qe)&&s(j,qe,null,re[qe],A,W.children,te,B,se);"value"in re&&s(j,"value",null,re.value),(V=re.onVnodeBeforeMount)&&di(V,te,W)}me&&vo(W,null,te,"beforeMount");const ve=(!B||B&&!B.pendingBranch)&&ye&&!ye.persisted;ve&&ye.beforeEnter(j),r(j,q,Y),((V=re&&re.onVnodeMounted)||ve||me)&&nr(()=>{V&&di(V,te,W),ve&&ye.enter(j),me&&vo(W,null,te,"mounted")},B)},L=(W,q,Y,te,B)=>{if(Y&&g(W,Y),te)for(let A=0;A<te.length;A++)g(W,te[A]);if(B){let A=B.subTree;if(q===A){const R=B.vnode;L(W,R,R.scopeId,R.slotScopeIds,B.parent)}}},D=(W,q,Y,te,B,A,R,U,j=0)=>{for(let V=j;V<W.length;V++){const Q=W[V]=U?Ms(W[V]):wi(W[V]);w(null,Q,q,Y,te,B,A,R,U)}},H=(W,q,Y,te,B,A,R)=>{const U=q.el=W.el;let{patchFlag:j,dynamicChildren:V,dirs:Q}=q;j|=W.patchFlag&16;const re=W.props||It,ce=q.props||It;let ye;Y&&bo(Y,!1),(ye=ce.onVnodeBeforeUpdate)&&di(ye,Y,q,W),Q&&vo(q,W,Y,"beforeUpdate"),Y&&bo(Y,!0);const me=B&&q.type!=="foreignObject";if(V?z(W.dynamicChildren,V,U,Y,te,me,A):R||E(W,q,U,null,Y,te,me,A,!1),j>0){if(j&16)K(U,q,re,ce,Y,te,B);else if(j&2&&re.class!==ce.class&&s(U,"class",null,ce.class,B),j&4&&s(U,"style",re.style,ce.style,B),j&8){const ve=q.dynamicProps;for(let qe=0;qe<ve.length;qe++){const Le=ve[qe],Ye=re[Le],Zr=ce[Le];(Zr!==Ye||Le==="value")&&s(U,Le,Ye,Zr,B,W.children,Y,te,se)}}j&1&&W.children!==q.children&&l(U,q.children)}else!R&&V==null&&K(U,q,re,ce,Y,te,B);((ye=ce.onVnodeUpdated)||Q)&&nr(()=>{ye&&di(ye,Y,q,W),Q&&vo(q,W,Y,"updated")},te)},z=(W,q,Y,te,B,A,R)=>{for(let U=0;U<q.length;U++){const j=W[U],V=q[U],Q=j.el&&(j.type===Ct||!Mo(j,V)||j.shapeFlag&70)?h(j.el):Y;w(j,V,Q,null,te,B,A,R,!0)}},K=(W,q,Y,te,B,A,R)=>{if(Y!==te){if(Y!==It)for(const U in Y)!Sf(U)&&!(U in te)&&s(W,U,Y[U],null,R,q.children,B,A,se);for(const U in te){if(Sf(U))continue;const j=te[U],V=Y[U];j!==V&&U!=="value"&&s(W,U,V,j,R,q.children,B,A,se)}"value"in te&&s(W,"value",Y.value,te.value)}},_=(W,q,Y,te,B,A,R,U,j)=>{const V=q.el=W?W.el:a(""),Q=q.anchor=W?W.anchor:a("");let{patchFlag:re,dynamicChildren:ce,slotScopeIds:ye}=q;ye&&(U=U?U.concat(ye):ye),W==null?(r(V,Y,te),r(Q,Y,te),D(q.children,Y,Q,B,A,R,U,j)):re>0&&re&64&&ce&&W.dynamicChildren?(z(W.dynamicChildren,ce,Y,B,A,R,U),(q.key!=null||B&&q===B.subTree)&&qm(W,q,!0)):E(W,q,Y,Q,B,A,R,U,j)},m=(W,q,Y,te,B,A,R,U,j)=>{q.slotScopeIds=U,W==null?q.shapeFlag&512?B.ctx.activate(q,Y,te,R,j):f(q,Y,te,B,A,R,j):d(W,q,j)},f=(W,q,Y,te,B,A,R)=>{const U=W.component=QC(W,te,B);if(rd(W)&&(U.ctx.renderer=_e),eN(U),U.asyncDep){if(B&&B.registerDep(U,v),!W.el){const j=U.subTree=Pe(Wr);T(null,j,q,Y)}return}v(U,W,q,Y,B,A,R)},d=(W,q,Y)=>{const te=q.component=W.component;if(cC(W,q,Y))if(te.asyncDep&&!te.asyncResolved){b(te,q,Y);return}
vendor: 7,555 bytes, line 6
6else te.next=q,tC(te.update),te.update();else q.el=W.el,te.vnode=q},v=(W,q,Y,te,B,A,R)=>{const U=()=>{if(W.isMounted){let{next:Q,bu:re,u:ce,parent:ye,vnode:me}=W,ve=Q,qe;bo(W,!1),Q?(Q.el=me.el,b(W,Q,R)):Q=me,re&&Ef(re),(qe=Q.props&&Q.props.onVnodeBeforeUpdate)&&di(qe,ye,Q,me),bo(W,!0);const Le=_p(W),Ye=W.subTree;W.subTree=Le,w(Ye,Le,h(Ye.el),xe(Ye),W,B,A),Q.el=Le.el,ve===null&&uC(W,Le.el),ce&&nr(ce,B),(qe=Q.props&&Q.props.onVnodeUpdated)&&nr(()=>di(qe,ye,Q,me),B)}else{let Q;const{el:re,props:ce}=q,{bm:ye,m:me,parent:ve}=W,qe=fu(q);if(bo(W,!1),ye&&Ef(ye),!qe&&(Q=ce&&ce.onVnodeBeforeMount)&&di(Q,ve,q),bo(W,!0),re&&Ie){const Le=()=>{W.subTree=_p(W),Ie(re,W.subTree,W,B,null)};qe?q.type.__asyncLoader().then(()=>!W.isUnmounted&&Le()):Le()}else{const Le=W.subTree=_p(W);w(null,Le,Y,te,W,B,A),q.el=Le.el}if(me&&nr(me,B),!qe&&(Q=ce&&ce.onVnodeMounted)){const Le=q;nr(()=>di(Q,ve,Le),B)}(q.shapeFlag&256||ve&&fu(ve.vnode)&&ve.vnode.shapeFlag&256)&&W.a&&nr(W.a,B),W.isMounted=!0,q=Y=te=null}},j=W.effect=new Mm(U,()=>Hm(V),W.scope),V=W.update=()=>j.run();V.id=W.uid,bo(W,!0),V()},b=(W,q,Y)=>{q.component=W;const te=W.vnode.props;W.vnode=q,W.next=null,$C(W,q.props,te,Y),zC(W,q.children,Y),Ec(),Z1(),Ac()},E=(W,q,Y,te,B,A,R,U,j=!1)=>{const V=W&&W.children,Q=W?W.shapeFlag:0,re=q.children,{patchFlag:ce,shapeFlag:ye}=q;if(ce>0){if(ce&128){M(V,re,Y,te,B,A,R,U,j);return}else if(ce&256){x(V,re,Y,te,B,A,R,U,j);return}}ye&8?(Q&16&&se(V,B,A),re!==V&&l(Y,re)):Q&16?ye&16?M(V,re,Y,te,B,A,R,U,j):se(V,B,A,!0):(Q&8&&l(Y,""),ye&16&&D(re,Y,te,B,A,R,U,j))},x=(W,q,Y,te,B,A,R,U,j)=>{W=W||Va,q=q||Va;const V=W.length,Q=q.length,re=Math.min(V,Q);let ce;for(ce=0;ce<re;ce++){const ye=q[ce]=j?Ms(q[ce]):wi(q[ce]);w(W[ce],ye,Y,null,B,A,R,U,j)}V>Q?se(W,B,A,!0,!1,re):D(q,Y,te,B,A,R,U,j,re)},M=(W,q,Y,te,B,A,R,U,j)=>{let V=0;const Q=q.length;let re=W.length-1,ce=Q-1;for(;V<=re&&V<=ce;){const ye=W[V],me=q[V]=j?Ms(q[V]):wi(q[V]);if(Mo(ye,me))w(ye,me,Y,null,B,A,R,U,j);else break;V++}for(;V<=re&&V<=ce;){const ye=W[re],me=q[ce]=j?Ms(q[ce]):wi(q[ce]);if(Mo(ye,me))w(ye,me,Y,null,B,A,R,U,j);else break;re--,ce--}if(V>re){if(V<=ce){const ye=ce+1,me=ye<Q?q[ye].el:te;for(;V<=ce;)w(null,q[V]=j?Ms(q[V]):wi(q[V]),Y,me,B,A,R,U,j),V++}}else if(V>ce)for(;V<=re;)S(W[V],B,A,!0),V++;else{const ye=V,me=V,ve=new Map;for(V=me;V<=ce;V++){const tt=q[V]=j?Ms(q[V]):wi(q[V]);tt.key!=null&&ve.set(tt.key,V)}let qe,Le=0;const Ye=ce-me+1;let Zr=!1,Rt=0;const _t=new Array(Ye);for(V=0;V<Ye;V++)_t[V]=0;for(V=ye;V<=re;V++){const tt=W[V];if(Le>=Ye){S(tt,B,A,!0);continue}let lt;if(tt.key!=null)lt=ve.get(tt.key);else for(qe=me;qe<=ce;qe++)if(_t[qe-me]===0&&Mo(tt,q[qe])){lt=qe;break}lt===void 0?S(tt,B,A,!0):(_t[lt-me]=V+1,lt>=Rt?Rt=lt:Zr=!0,w(tt,q[lt],Y,null,B,A,R,U,j),Le++)}const Fc=Zr?jC(_t):Va;for(qe=Fc.length-1,V=Ye-1;V>=0;V--){const tt=me+V,lt=q[tt],Uc=tt+1<Q?q[tt+1].el:te;_t[V]===0?w(null,lt,Y,Uc,B,A,R,U,j):Zr&&(qe<0||V!==Fc[qe]?P(lt,Y,Uc,2):qe--)}}},P=(W,q,Y,te,B=null)=>{const{el:A,type:R,transition:U,children:j,shapeFlag:V}=W;if(V&6){P(W.component.subTree,q,Y,te);return}if(V&128){W.suspense.move(q,Y,te);return}if(V&64){R.move(W,q,Y,_e);return}if(R===Ct){r(A,q,Y);for(let re=0;re<j.length;re++)P(j[re],q,Y,te);r(W.anchor,q,Y);return}if(R===xf){O(W,q,Y);return}if(te!==2&&V&1&&U)if(te===0)U.beforeEnter(A),r(A,q,Y),nr(()=>U.enter(A),B);else{const{leave:re,delayLeave:ce,afterLeave:ye}=U,me=()=>r(A,q,Y),ve=()=>{re(A,()=>{me(),ye&&ye()})};ce?ce(A,me,ve):ve()}else r(A,q,Y)},S=(W,q,Y,te=!1,B=!1)=>{const{type:A,props:R,ref:U,children:j,dynamicChildren:V,shapeFlag:Q,patchFlag:re,dirs:ce}=W;if(U!=null&&e0(U,null,Y,W,!0),Q&256){q.ctx.deactivate(W);return}const ye=Q&1&&ce,me=!fu(W);let ve;if(me&&(ve=R&&R.onVnodeBeforeUnmount)&&di(ve,q,W),Q&6)le(W.component,Y,te);else{if(Q&128){W.suspense.unmount(Y,te);return}ye&&vo(W,null,q,"beforeUnmount"),Q&64?W.type.remove(W,q,Y,B,_e,te):V&&(A!==Ct||re>0&&re&64)?se(V,q,Y,!1,!0):(A===Ct&&re&384||!B&&Q&16)&&se(j,q,Y),te&&$(W)}(me&&(ve=R&&R.onVnodeUnmounted)||ye)&&nr(()=>{ve&&di(ve,q,W),ye&&vo(W,null,q,"unmounted")},Y)},$=W=>{const{type:q,el:Y,anchor:te,transition:B}=W;if(q===Ct){ie(Y,te);return}if(q===xf){I(W);return}const A=()=>{i(Y),B&&!B.persisted&&B.afterLeave&&B.afterLeave()};if(W.shapeFlag&1&&B&&!B.persisted){const{leave:R,delayLeave:U}=B,j=()=>R(Y,A);U?U(W.el,A,j):j()}else A()},ie=(W,q)=>{let Y;for(;W!==q;)Y=p(W),i(W),W=Y;i(q)},le=(W,q,Y)=>{const{bum:te,scope:B,update:A,subTree:R,um:U}=W;te&&Ef(te),B.stop(),A&&(A.active=!1,S(R,W,q,Y)),U&&nr(U,q),nr(()=>{W.isUnmounted=!0},q),q&&q.pendingBranch&&!q.isUnmounted&&W.asyncDep&&!W.asyncResolved&&W.suspenseId===q.pendingId&&(q.deps--,q.deps===0&&q.resolve())},se=(W,q,Y,te=!1,B=!1,A=0)=>{for(let R=A;R<W.length;R++)S(W[R],q,Y,te,B)},xe=W=>W.shapeFlag&6?xe(W.component.subTree):W.shapeFlag&128?W.suspense.next():p(W.anchor||W.el),Re=(W,q,Y)=>{W==null?q._vnode&&S(q._vnode,null,null,!0):w(q._vnode||null,W,q,null,null,null,Y),Z1(),oS(),q._vnode=W},_e={p:w,um:S,m:P,r:$,mt:f,mc:D,pc:E,pbc:z,n:xe,o:t};let Xe,Ie;return e&&([Xe,Ie]=e(_e)),{render:Re,hydrate:Xe,createApp:LC(Re,Xe)}}function bo({effect:t,update:e},n){t.allowRecurse=e.allowRecurse=n}function qm(t,e,n=!1){const r=t.children,i=e.children;if(Ne(r)&&Ne(i))for(let s=0;s<r.length;s++){const o=r[s];let a=i[s];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[s]=Ms(i[s]),a.el=o.el),n||qm(o,a)),a.type===sd&&(a.el=o.el)}}function jC(t){const e=t.slice(),n=[0];let r,i,s,o,a;const c=t.length;for(r=0;r<c;r++){const u=t[r];if(u!==0){if(i=n[n.length-1],t[i]<u){e[r]=i,n.push(r);continue}for(s=0,o=n.length-1;s<o;)a=s+o>>1,t[n[a]]<u?s=a+1:o=a;u<t[n[s]]&&(s>0&&(e[r]=n[s-1]),n[s]=r)}}for(s=n.length,o=n[s-1];s-- >0;)n[s]=o,o=e[o];return n}const KC=t=>t.__isTeleport,du=t=>t&&(t.disabled||t.disabled===""),cv=t=>typeof SVGElement<"u"&&t instanceof SVGElement,t0=(t,e)=>{const n=t&&t.to;return qt(n)?e?e(n):null:n},VC={__isTeleport:!0,process(t,e,n,r,i,s,o,a,c,u){const{mc:l,pc:h,pbc:p,o:{insert:g,querySelector:y,createText:w,createComment:k}}=u,T=du(e.props);let{shapeFlag:C,children:O,dynamicChildren:I}=e;if(t==null){const N=e.el=w(""),F=e.anchor=w("");g(N,n,r),g(F,n,r);const L=e.target=t0(e.props,y),D=e.targetAnchor=w("");L&&(g(D,L),o=o||cv(L));const H=(z,K)=>{C&16&&l(O,z,K,i,s,o,a,c)};T?H(n,F):L&&H(L,D)}else{e.el=t.el;const N=e.anchor=t.anchor,F=e.target=t.target,L=e.targetAnchor=t.targetAnchor,D=du(t.props),H=D?n:F,z=D?N:L;if(o=o||cv(F),I?(p(t.dynamicChildren,I,H,i,s,o,a),qm(t,e,!0)):c||h(t,e,H,z,i,s,o,a,!1),T)D||Hl(e,n,N,u,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const K=e.target=t0(e.props,y);K&&Hl(e,K,null,u,0)}else D&&Hl(e,F,L,u,1)}AS(e)},remove(t,e,n,r,{um:i,o:{remove:s}},o){const{shapeFlag:a,children:c,anchor:u,targetAnchor:l,target:h,props:p}=t;if(h&&s(l),(o||!du(p))&&(s(u),a&16))for(let g=0;g<c.length;g++){const y=c[g];i(y,e,n,!0,!!y.dynamicChildren)}},move:Hl,hydrate:qC};function Hl(t,e,n,{o:{insert:r},m:i},s=2){s===0&&r(t.targetAnchor,e,n);const{el:o,anchor:a,shapeFlag:c,children:u,props:l}=t,h=s===2;if(h&&r(o,e,n),(!h||du(l))&&c&16)for(let p=0;p<u.length;p++)i(u[p],e,n,2);h&&r(a,e,n)}function qC(t,e,n,r,i,s,{o:{nextSibling:o,parentNode:a,querySelector:c}},u){const l=e.target=t0(e.props,c);if(l){const h=l._lpa||l.firstChild;if(e.shapeFlag&16)if(du(e.props))e.anchor=u(o(t),e,a(t),n,r,i,s),e.targetAnchor=h;else{e.anchor=o(t);let p=h;for(;p;)if(p=o(p),p&&p.nodeType===8&&p.data==="teleport anchor"){e.targetAnchor=p,l._lpa=e.targetAnchor&&o(e.targetAnchor);break}u(h,e,l,n,r,i,s)}AS(e)}return e.anchor&&o(e.anchor)}const GC=VC;function AS(t){const e=t.ctx;
vendor: 16,980 bytes, line 6
6if(e&&e.ut){let n=t.children[0].el;for(;n!==t.targetAnchor;)n.nodeType===1&&n.setAttribute("data-v-owner",e.uid),n=n.nextSibling;e.ut()}}const Ct=Symbol.for("v-fgt"),sd=Symbol.for("v-txt"),Wr=Symbol.for("v-cmt"),xf=Symbol.for("v-stc"),pu=[];let ri=null;function he(t=!1){pu.push(ri=t?null:[])}function YC(){pu.pop(),ri=pu[pu.length-1]||null}let Du=1;function uv(t){Du+=t}function xS(t){return t.dynamicChildren=Du>0?ri||Va:null,YC(),Du>0&&ri&&ri.push(t),t}function Ee(t,e,n,r,i,s){return xS(ee(t,e,n,r,i,s,!0))}function gn(t,e,n,r,i){return xS(Pe(t,e,n,r,i,!0))}function oc(t){return t?t.__v_isVNode===!0:!1}function Mo(t,e){return t.type===e.type&&t.key===e.key}const od="__vInternal",RS=({key:t})=>t??null,Rf=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?qt(t)||Ln(t)||We(t)?{i:Bn,r:t,k:e,f:!!n}:t:null);function ee(t,e=null,n=null,r=0,i=null,s=t===Ct?0:1,o=!1,a=!1){const c={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&RS(e),ref:e&&Rf(e),scopeId:nd,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Bn};return a?(Gm(c,n),s&128&&t.normalize(c)):n&&(c.shapeFlag|=qt(n)?8:16),Du>0&&!o&&ri&&(c.patchFlag>0||s&6)&&c.patchFlag!==32&&ri.push(c),c}const Pe=ZC;function ZC(t,e=null,n=null,r=0,i=null,s=!1){if((!t||t===RC)&&(t=Wr),oc(t)){const a=gs(t,e,!0);return n&&Gm(a,n),Du>0&&!s&&ri&&(a.shapeFlag&6?ri[ri.indexOf(t)]=a:ri.push(a)),a.patchFlag|=-2,a}if(sN(t)&&(t=t.__vccOpts),e){e=Sr(e);let{class:a,style:c}=e;a&&!qt(a)&&(e.class=Kt(a)),Pt(c)&&(Jh(c)&&!Ne(c)&&(c=yn({},c)),e.style=Ir(c))}const o=qt(t)?1:lC(t)?128:KC(t)?64:Pt(t)?4:We(t)?2:0;return ee(t,e,n,r,i,o,s,!0)}function Sr(t){return t?Jh(t)||od in t?yn({},t):t:null}function gs(t,e,n=!1){const{props:r,ref:i,patchFlag:s,children:o}=t,a=e?hi(r||{},e):r;return{__v_isVNode:!0,__v_skip:!0,type:t.type,props:a,key:a&&RS(a),ref:e&&e.ref?n&&i?Ne(i)?i.concat(Rf(e)):[i,Rf(e)]:Rf(e):i,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:o,target:t.target,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==Ct?s===-1?16:s|16:s,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:t.transition,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&gs(t.ssContent),ssFallback:t.ssFallback&&gs(t.ssFallback),el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce}}function Qr(t=" ",e=0){return Pe(sd,null,t,e)}function TS(t,e){const n=Pe(xf,null,t);return n.staticCount=e,n}function xt(t="",e=!1){return e?(he(),gn(Wr,null,t)):Pe(Wr,null,t)}function wi(t){return t==null||typeof t=="boolean"?Pe(Wr):Ne(t)?Pe(Ct,null,t.slice()):typeof t=="object"?Ms(t):Pe(sd,null,String(t))}function Ms(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:gs(t)}function Gm(t,e){let n=0;const{shapeFlag:r}=t;if(e==null)e=null;else if(Ne(e))n=16;else if(typeof e=="object")if(r&65){const i=e.default;i&&(i._c&&(i._d=!1),Gm(t,i()),i._c&&(i._d=!0));return}else{n=32;const i=e._;!i&&!(od in e)?e._ctx=Bn:i===3&&Bn&&(Bn.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else We(e)?(e={default:e,_ctx:Bn},n=32):(e=String(e),r&64?(n=16,e=[Qr(e)]):n=8);t.children=e,t.shapeFlag|=n}function hi(...t){const e={};for(let n=0;n<t.length;n++){const r=t[n];for(const i in r)if(i==="class")e.class!==r.class&&(e.class=Kt([e.class,r.class]));else if(i==="style")e.style=Ir([e.style,r.style]);else if(Vh(i)){const s=e[i],o=r[i];o&&s!==o&&!(Ne(s)&&s.includes(o))&&(e[i]=s?[].concat(s,o):o)}else i!==""&&(e[i]=r[i])}return e}function di(t,e,n,r=null){Hr(t,e,7,[n,r])}const XC=bS();let JC=0;function QC(t,e,n){const r=t.type,i=(e?e.appContext:t.appContext)||XC,s={uid:JC++,vnode:t,type:r,parent:e,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,scope:new mI(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(i.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:_S(r,i),emitsOptions:cS(r,i),emit:null,emitted:null,propsDefaults:It,inheritAttrs:r.inheritAttrs,ctx:It,data:It,props:It,attrs:It,slots:It,refs:It,setupState:It,setupContext:null,attrsProxy:null,slotsProxy:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return s.ctx={_:s},s.root=e?e.root:s,s.emit=iC.bind(null,s),t.ce&&t.ce(s),s}let An=null;const OS=()=>An||Bn;let Ym,Ia,lv="__VUE_INSTANCE_SETTERS__";(Ia=Wg()[lv])||(Ia=Wg()[lv]=[]),Ia.push(t=>An=t),Ym=t=>{Ia.length>1?Ia.forEach(e=>e(t)):Ia[0](t)};const ac=t=>{Ym(t),t.scope.on()},ea=()=>{An&&An.scope.off(),Ym(null)};function IS(t){return t.vnode.shapeFlag&4}let $u=!1;function eN(t,e=!1){$u=e;const{props:n,children:r}=t.vnode,i=IS(t);DC(t,n,i,e),UC(t,r);const s=i?tN(t,e):void 0;return $u=!1,s}function tN(t,e){const n=t.type;t.accessCache=Object.create(null),t.proxy=Qk(new Proxy(t.ctx,TC));const{setup:r}=n;if(r){const i=t.setupContext=r.length>1?rN(t):null;ac(t),Ec();const s=Vs(r,t,0,[t.props,i]);if(Ac(),ea(),Dk(s)){if(s.then(ea,ea),e)return s.then(o=>{fv(t,o,e)}).catch(o=>{ed(o,t,0)});t.asyncDep=s}else fv(t,s,e)}else CS(t,e)}function fv(t,e,n){We(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:Pt(e)&&(t.setupState=rS(e)),CS(t,n)}let hv;function CS(t,e,n){const r=t.type;if(!t.render){if(!e&&hv&&!r.render){const i=r.template||Km(t).template;if(i){const{isCustomElement:s,compilerOptions:o}=t.appContext.config,{delimiters:a,compilerOptions:c}=r,u=yn(yn({isCustomElement:s,delimiters:a},o),c);r.render=hv(i,u)}}t.render=r.render||si}ac(t),Ec(),OC(t),Ac(),ea()}function nN(t){return t.attrsProxy||(t.attrsProxy=new Proxy(t.attrs,{get(e,n){return ur(t,"get","$attrs"),e[n]}}))}function rN(t){const e=n=>{t.exposed=n||{}};return{get attrs(){return nN(t)},slots:t.slots,emit:t.emit,expose:e}}function ad(t){if(t.exposed)return t.exposeProxy||(t.exposeProxy=new Proxy(rS(Qk(t.exposed)),{get(e,n){if(n in e)return e[n];if(n in hu)return hu[n](t)},has(e,n){return n in e||n in hu}}))}function iN(t,e=!0){return We(t)?t.displayName||t.name:t.name||e&&t.__name}function sN(t){return We(t)&&"__vccOpts"in t}const Ve=(t,e)=>JI(t,e,$u);function ii(t,e,n){const r=arguments.length;return r===2?Pt(e)&&!Ne(e)?oc(e)?Pe(t,null,[e]):Pe(t,e):Pe(t,null,e):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&oc(n)&&(n=[n]),Pe(t,e,n))}const oN=Symbol.for("v-scx"),aN=()=>Af(oN),NS="3.3.4",cN="http://www.w3.org/2000/svg",Lo=typeof document<"u"?document:null,dv=Lo&&Lo.createElement("template"),uN={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n,r)=>{const i=e?Lo.createElementNS(cN,t):Lo.createElement(t,n?{is:n}:void 0);return t==="select"&&r&&r.multiple!=null&&i.setAttribute("multiple",r.multiple),i},createText:t=>Lo.createTextNode(t),createComment:t=>Lo.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>Lo.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,n,r,i,s){const o=n?n.previousSibling:e.lastChild;if(i&&(i===s||i.nextSibling))for(;e.insertBefore(i.cloneNode(!0),n),!(i===s||!(i=i.nextSibling)););else{dv.innerHTML=r?`<svg>${t}</svg>`:t;const a=dv.content;if(r){const c=a.firstChild;for(;c.firstChild;)a.appendChild(c.firstChild);a.removeChild(c)}e.insertBefore(a,n)}return[o?o.nextSibling:e.firstChild,n?n.previousSibling:e.lastChild]}};function lN(t,e,n){const r=t._vtc;r&&(e=(e?[e,...r]:[...r]).join(" ")),e==null?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}function fN(t,e,n){const r=t.style,i=qt(n);if(n&&!i){if(e&&!qt(e))for(const s in e)n[s]==null&&n0(r,s,"");for(const s in n)n0(r,s,n[s])}else{const s=r.display;i?e!==n&&(r.cssText=n):e&&t.removeAttribute("style"),"_vod"in t&&(r.display=s)}}const pv=/\s*!important$/;function n0(t,e,n){if(Ne(n))n.forEach(r=>n0(t,e,r));else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{const r=hN(t,e);pv.test(n)?t.setProperty(ga(r),n.replace(pv,""),"important"):t[r]=n}}const gv=["Webkit","Moz","ms"],Ep={};function hN(t,e){const n=Ep[e];if(n)return n;let r=Bi(e);if(r!=="filter"&&r in t)return Ep[e]=r;r=Yh(r);for(let i=0;i<gv.length;i++){const s=gv[i]+r;if(s in t)return Ep[e]=s}return e}const mv="http://www.w3.org/1999/xlink";function dN(t,e,n,r,i){if(r&&e.startsWith("xlink:"))n==null?t.removeAttributeNS(mv,e.slice(6,e.length)):t.setAttributeNS(mv,e,n);else{const s=gI(e);n==null||s&&!Uk(n)?t.removeAttribute(e):t.setAttribute(e,s?"":n)}}function pN(t,e,n,r,i,s,o){if(e==="innerHTML"||e==="textContent"){r&&o(r,i,s),t[e]=n??"";return}const a=t.tagName;if(e==="value"&&a!=="PROGRESS"&&!a.includes("-")){t._value=n;const u=a==="OPTION"?t.getAttribute("value"):t.value,l=n??"";u!==l&&(t.value=l),n==null&&t.removeAttribute(e);return}let c=!1;if(n===""||n==null){const u=typeof t[e];u==="boolean"?n=Uk(n):n==null&&u==="string"?(n="",c=!0):u==="number"&&(n=0,c=!0)}try{t[e]=n}catch{}c&&t.removeAttribute(e)}function La(t,e,n,r){t.addEventListener(e,n,r)}function gN(t,e,n,r){t.removeEventListener(e,n,r)}function mN(t,e,n,r,i=null){const s=t._vei||(t._vei={}),o=s[e];if(r&&o)o.value=r;else{const[a,c]=yN(e);if(r){const u=s[e]=wN(r,i);La(t,a,u,c)}else o&&(gN(t,a,o,c),s[e]=void 0)}}const yv=/(?:Once|Passive|Capture)$/;function yN(t){let e;if(yv.test(t)){e={};let r;for(;r=t.match(yv);)t=t.slice(0,t.length-r[0].length),e[r[0].toLowerCase()]=!0}return[t[2]===":"?t.slice(3):ga(t.slice(2)),e]}let Ap=0;const vN=Promise.resolve(),bN=()=>Ap||(vN.then(()=>Ap=0),Ap=Date.now());function wN(t,e){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;Hr(_N(r,n.value),e,5,[r])};return n.value=t,n.attached=bN(),n}function _N(t,e){if(Ne(e)){const n=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{n.call(t),t._stopped=!0},e.map(r=>i=>!i._stopped&&r&&r(i))}else return e}const vv=/^on[a-z]/,kN=(t,e,n,r,i=!1,s,o,a,c)=>{e==="class"?lN(t,r,i):e==="style"?fN(t,n,r):Vh(e)?Om(e)||mN(t,e,n,r,o):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):SN(t,e,r,i))?pN(t,e,r,s,o,a,c):(e==="true-value"?t._trueValue=r:e==="false-value"&&(t._falseValue=r),dN(t,e,r,i))};function SN(t,e,n,r){return r?!!(e==="innerHTML"||e==="textContent"||e in t&&vv.test(e)&&We(n)):e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA"||vv.test(e)&&qt(n)?!1:e in t}const Ss="transition",zc="animation",Zm=(t,{slots:e})=>ii(gC,EN(t),e);Zm.displayName="Transition";const PS={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String};Zm.props=yn({},lS,PS);const wo=(t,e=[])=>{Ne(t)?t.forEach(n=>n(...e)):t&&t(...e)},bv=t=>t?Ne(t)?t.some(e=>e.length>1):t.length>1:!1;function EN(t){const e={};for(const _ in t)_ in PS||(e[_]=t[_]);if(t.css===!1)return e;const{name:n="v",type:r,duration:i,enterFromClass:s=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:c=s,appearActiveClass:u=o,appearToClass:l=a,leaveFromClass:h=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:g=`${n}-leave-to`}=t,y=AN(i),w=y&&y[0],k=y&&y[1],{onBeforeEnter:T,onEnter:C,onEnterCancelled:O,onLeave:I,onLeaveCancelled:N,onBeforeAppear:F=T,onAppear:L=C,onAppearCancelled:D=O}=e,H=(_,m,f)=>{_o(_,m?l:a),_o(_,m?u:o),f&&f()},z=(_,m)=>{_._isLeaving=!1,_o(_,h),_o(_,g),_o(_,p),m&&m()},K=_=>(m,f)=>{const d=_?L:C,v=()=>H(m,_,f);wo(d,[m,v]),wv(()=>{_o(m,_?c:s),Es(m,_?l:a),bv(d)||_v(m,r,w,v)})};return yn(e,{onBeforeEnter(_){wo(T,[_]),Es(_,s),Es(_,o)},onBeforeAppear(_){wo(F,[_]),Es(_,c),Es(_,u)},onEnter:K(!1),onAppear:K(!0),onLeave(_,m){_._isLeaving=!0;const f=()=>z(_,m);Es(_,h),TN(),Es(_,p),wv(()=>{_._isLeaving&&(_o(_,h),Es(_,g),bv(I)||_v(_,r,k,f))}),wo(I,[_,f])},onEnterCancelled(_){H(_,!1),wo(O,[_])},onAppearCancelled(_){H(_,!0),wo(D,[_])},onLeaveCancelled(_){z(_),wo(N,[_])}})}function AN(t){if(t==null)return null;if(Pt(t))return[xp(t.enter),xp(t.leave)];{const e=xp(t);return[e,e]}}function xp(t){return uI(t)}function Es(t,e){e.split(/\s+/).forEach(n=>n&&t.classList.add(n)),(t._vtc||(t._vtc=new Set)).add(e)}function _o(t,e){e.split(/\s+/).forEach(r=>r&&t.classList.remove(r));const{_vtc:n}=t;n&&(n.delete(e),n.size||(t._vtc=void 0))}function wv(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let xN=0;function _v(t,e,n,r){const i=t._endId=++xN,s=()=>{i===t._endId&&r()};if(n)return setTimeout(s,n);const{type:o,timeout:a,propCount:c}=RN(t,e);if(!o)return r();const u=o+"end";let l=0;const h=()=>{t.removeEventListener(u,p),s()},p=g=>{g.target===t&&++l>=c&&h()};setTimeout(()=>{l<c&&h()},a+1),t.addEventListener(u,p)}function RN(t,e){const n=window.getComputedStyle(t),r=y=>(n[y]||"").split(", "),i=r(`${Ss}Delay`),s=r(`${Ss}Duration`),o=kv(i,s),a=r(`${zc}Delay`),c=r(`${zc}Duration`),u=kv(a,c);let l=null,h=0,p=0;e===Ss?o>0&&(l=Ss,h=o,p=s.length):e===zc?u>0&&(l=zc,h=u,p=c.length):(h=Math.max(o,u),l=h>0?o>u?Ss:zc:null,p=l?l===Ss?s.length:c.length:0);const g=l===Ss&&/\b(transform|all)(,|$)/.test(r(`${Ss}Property`).toString());return{type:l,timeout:h,propCount:p,hasTransform:g}}function kv(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max(...e.map((n,r)=>Sv(n)+Sv(t[r])))}function Sv(t){return Number(t.slice(0,-1).replace(",","."))*1e3}function TN(){return document.body.offsetHeight}const Ev=t=>{const e=t.props["onUpdate:modelValue"]||!1;return Ne(e)?n=>Ef(e,n):e};function ON(t){t.target.composing=!0}function Av(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const IN={created(t,{modifiers:{lazy:e,trim:n,number:r}},i){t._assign=Ev(i);const s=r||i.props&&i.props.type==="number";La(t,e?"change":"input",o=>{if(o.target.composing)return;let a=t.value;n&&(a=a.trim()),s&&(a=Hg(a)),t._assign(a)}),n&&La(t,"change",()=>{t.value=t.value.trim()}),e||(La(t,"compositionstart",ON),La(t,"compositionend",Av),La(t,"change",Av))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,modifiers:{lazy:n,trim:r,number:i}},s){if(t._assign=Ev(s),t.composing||document.activeElement===t&&t.type!=="range"&&(n||r&&t.value.trim()===e||(i||t.type==="number")&&Hg(t.value)===e))return;const o=e??"";t.value!==o&&(t.value=o)}},CN=["ctrl","shift","alt","meta"],NN={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>CN.some(n=>t[`${n}Key`]&&!e.includes(n))},PN=(t,e)=>(n,...r)=>{for(let i=0;i<e.length;i++){const s=NN[e[i]];if(s&&s(n,e))return}return t(n,...r)},MN={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},LN=(t,e)=>n=>{if(!("key"in n))return;const r=ga(n.key);if(e.some(i=>i===r||MN[i]===r))return t(n)},BN=yn({patchProp:kN},uN);let xv;function DN(){return xv||(xv=HC(BN))}const Xm=(...t)=>{const e=DN().createApp(...t),{mount:n}=e;return e.mount=r=>{const i=$N(r);if(!i)return;const s=e._component;!We(s)&&!s.render&&!s.template&&(s.template=i.innerHTML),i.innerHTML="";const o=n(i,!1,i instanceof SVGElement);return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),o},e};function $N(t){return qt(t)?document.querySelector(t):t}const wn=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},FN={data(){return{rightToggle:!1}},methods:{toggleIndicator(){this.rightToggle=!this.rightToggle,this.$emit("toggle",this.rightToggle)}}},UN={class:"toggle-wrapper-item w-600"},zN={class:"toggle-wrapper-item w-600"};function HN(t,e,n,r,i,s){return he(),Ee("div",{class:Kt(["toggle-wrapper",{active:i.rightToggle}]),onClick:e[0]||(e[0]=(...o)=>s.toggleIndicator&&s.toggleIndicator(...o))},[ee("p",UN,Oe(i.rightToggle?"Stake":""),1),ee("p",zN,Oe(i.rightToggle?"":"Unstake"),1),ee("div",{class:"indicator w-600",style:Ir({transform:i.rightToggle?"translateX(100%)":"none"})},Oe(i.rightToggle?"Unstake":"Stake"),5)],2)}const WN=wn(FN,[["render",HN],["__scopeId","data-v-99abb5b0"]]);var MS={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(Jn,function(){var n=1e3,r=6e4,i=36e5,s="millisecond",o="second",a="minute",c="hour",u="day",l="week",h="month",p="quarter",g="year",y="date",w="Invalid Date",k=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,T=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}
vendor: 5,431 bytes, line 6
6|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,C={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(m){var f=["th","st","nd","rd"],d=m%100;return"["+m+(f[(d-20)%10]||f[d]||f[0])+"]"}},O=function(m,f,d){var v=String(m);return!v||v.length>=f?m:""+Array(f+1-v.length).join(d)+m},I={s:O,z:function(m){var f=-m.utcOffset(),d=Math.abs(f),v=Math.floor(d/60),b=d%60;return(f<=0?"+":"-")+O(v,2,"0")+":"+O(b,2,"0")},m:function m(f,d){if(f.date()<d.date())return-m(d,f);var v=12*(d.year()-f.year())+(d.month()-f.month()),b=f.clone().add(v,h),E=d-b<0,x=f.clone().add(v+(E?-1:1),h);return+(-(v+(d-b)/(E?b-x:x-b))||0)},a:function(m){return m<0?Math.ceil(m)||0:Math.floor(m)},p:function(m){return{M:h,y:g,w:l,d:u,D:y,h:c,m:a,s:o,ms:s,Q:p}[m]||String(m||"").toLowerCase().replace(/s$/,"")},u:function(m){return m===void 0}},N="en",F={};F[N]=C;var L=function(m){return m instanceof K},D=function m(f,d,v){var b;if(!f)return N;if(typeof f=="string"){var E=f.toLowerCase();F[E]&&(b=E),d&&(F[E]=d,b=E);var x=f.split("-");if(!b&&x.length>1)return m(x[0])}else{var M=f.name;F[M]=f,b=M}return!v&&b&&(N=b),b||!v&&N},H=function(m,f){if(L(m))return m.clone();var d=typeof f=="object"?f:{};return d.date=m,d.args=arguments,new K(d)},z=I;z.l=D,z.i=L,z.w=function(m,f){return H(m,{locale:f.$L,utc:f.$u,x:f.$x,$offset:f.$offset})};var K=function(){function m(d){this.$L=D(d.locale,null,!0),this.parse(d)}var f=m.prototype;return f.parse=function(d){this.$d=function(v){var b=v.date,E=v.utc;if(b===null)return new Date(NaN);if(z.u(b))return new Date;if(b instanceof Date)return new Date(b);if(typeof b=="string"&&!/Z$/i.test(b)){var x=b.match(k);if(x){var M=x[2]-1||0,P=(x[7]||"0").substring(0,3);return E?new Date(Date.UTC(x[1],M,x[3]||1,x[4]||0,x[5]||0,x[6]||0,P)):new Date(x[1],M,x[3]||1,x[4]||0,x[5]||0,x[6]||0,P)}}return new Date(b)}(d),this.$x=d.x||{},this.init()},f.init=function(){var d=this.$d;this.$y=d.getFullYear(),this.$M=d.getMonth(),this.$D=d.getDate(),this.$W=d.getDay(),this.$H=d.getHours(),this.$m=d.getMinutes(),this.$s=d.getSeconds(),this.$ms=d.getMilliseconds()},f.$utils=function(){return z},f.isValid=function(){return this.$d.toString()!==w},f.isSame=function(d,v){var b=H(d);return this.startOf(v)<=b&&b<=this.endOf(v)},f.isAfter=function(d,v){return H(d)<this.startOf(v)},f.isBefore=function(d,v){return this.endOf(v)<H(d)},f.$g=function(d,v,b){return z.u(d)?this[v]:this.set(b,d)},f.unix=function(){return Math.floor(this.valueOf()/1e3)},f.valueOf=function(){return this.$d.getTime()},f.startOf=function(d,v){var b=this,E=!!z.u(v)||v,x=z.p(d),M=function(Re,_e){var Xe=z.w(b.$u?Date.UTC(b.$y,_e,Re):new Date(b.$y,_e,Re),b);return E?Xe:Xe.endOf(u)},P=function(Re,_e){return z.w(b.toDate()[Re].apply(b.toDate("s"),(E?[0,0,0,0]:[23,59,59,999]).slice(_e)),b)},S=this.$W,$=this.$M,ie=this.$D,le="set"+(this.$u?"UTC":"");switch(x){case g:return E?M(1,0):M(31,11);case h:return E?M(1,$):M(0,$+1);case l:var se=this.$locale().weekStart||0,xe=(S<se?S+7:S)-se;return M(E?ie-xe:ie+(6-xe),$);case u:case y:return P(le+"Hours",0);case c:return P(le+"Minutes",1);case a:return P(le+"Seconds",2);case o:return P(le+"Milliseconds",3);default:return this.clone()}},f.endOf=function(d){return this.startOf(d,!1)},f.$set=function(d,v){var b,E=z.p(d),x="set"+(this.$u?"UTC":""),M=(b={},b[u]=x+"Date",b[y]=x+"Date",b[h]=x+"Month",b[g]=x+"FullYear",b[c]=x+"Hours",b[a]=x+"Minutes",b[o]=x+"Seconds",b[s]=x+"Milliseconds",b)[E],P=E===u?this.$D+(v-this.$W):v;if(E===h||E===g){var S=this.clone().set(y,1);S.$d[M](P),S.init(),this.$d=S.set(y,Math.min(this.$D,S.daysInMonth())).$d}else M&&this.$d[M](P);return this.init(),this},f.set=function(d,v){return this.clone().$set(d,v)},f.get=function(d){return this[z.p(d)]()},f.add=function(d,v){var b,E=this;d=Number(d);var x=z.p(v),M=function($){var ie=H(E);return z.w(ie.date(ie.date()+Math.round($*d)),E)};if(x===h)return this.set(h,this.$M+d);if(x===g)return this.set(g,this.$y+d);if(x===u)return M(1);if(x===l)return M(7);var P=(b={},b[a]=r,b[c]=i,b[o]=n,b)[x]||1,S=this.$d.getTime()+d*P;return z.w(S,this)},f.subtract=function(d,v){return this.add(-1*d,v)},f.format=function(d){var v=this,b=this.$locale();if(!this.isValid())return b.invalidDate||w;var E=d||"YYYY-MM-DDTHH:mm:ssZ",x=z.z(this),M=this.$H,P=this.$m,S=this.$M,$=b.weekdays,ie=b.months,le=b.meridiem,se=function(_e,Xe,Ie,W){return _e&&(_e[Xe]||_e(v,E))||Ie[Xe].slice(0,W)},xe=function(_e){return z.s(M%12||12,_e,"0")},Re=le||function(_e,Xe,Ie){var W=_e<12?"AM":"PM";return Ie?W.toLowerCase():W};return E.replace(T,function(_e,Xe){return Xe||function(Ie){switch(Ie){case"YY":return String(v.$y).slice(-2);case"YYYY":return z.s(v.$y,4,"0");case"M":return S+1;case"MM":return z.s(S+1,2,"0");case"MMM":return se(b.monthsShort,S,ie,3);case"MMMM":return se(ie,S);case"D":return v.$D;case"DD":return z.s(v.$D,2,"0");case"d":return String(v.$W);case"dd":return se(b.weekdaysMin,v.$W,$,2);case"ddd":return se(b.weekdaysShort,v.$W,$,3);case"dddd":return $[v.$W];case"H":return String(M);case"HH":return z.s(M,2,"0");case"h":return xe(1);case"hh":return xe(2);case"a":return Re(M,P,!0);case"A":return Re(M,P,!1);case"m":return String(P);case"mm":return z.s(P,2,"0");case"s":return String(v.$s);case"ss":return z.s(v.$s,2,"0");case"SSS":return z.s(v.$ms,3,"0");case"Z":return x}return null}(_e)||x.replace(":","")})}
6,f.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},f.diff=function(d,v,b){var E,x=this,M=z.p(v),P=H(d),S=(P.utcOffset()-this.utcOffset())*r,$=this-P,ie=function(){return z.m(x,P)};switch(M){case g:E=ie()/12;break;case h:E=ie();break;case p:E=ie()/3;break;case l:E=($-S)/6048e5;break;case u:E=($-S)/864e5;break;case c:E=$/i;break;case a:E=$/r;break;case o:E=$/n;break;default:E=$}return b?E:z.a(E)},f.daysInMonth=function(){return this.endOf(h).$D},f.$locale=function(){return F[this.$L]},f.locale=function(d,v){if(!d)return this.$L;var b=this.clone(),E=D(d,v,!0);return E&&(b.$L=E),b},f.clone=function(){return z.w(this.$d,this)},f.toDate=function(){return new Date(this.valueOf())},f.toJSON=function(){return this.isValid()?this.toISOString():null},f.toISOString=function(){return this.$d.toISOString()},f.toString=function(){return this.$d.toUTCString()},m}(),_=K.prototype;return H.prototype=_,[["$ms",s],["$s",o],["$m",a],["$H",c],["$W",u],["$M",h],["$y",g],["$D",y]].forEach(function(m){_[m[1]]=function(f){return this.$g(f,m[0],m[1])}}),H.extend=function(m,f){return m.$i||(m(f,K,H),m.$i=!0),H},H.locale=D,H.isDayjs=L,H.unix=function(m){return H(1e3*m)},H.en=F[N],H.Ls=F,H.p={},H})})(MS);var jN=MS.exports;const ta=Ui(jN);var LS={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(Jn,function(){return function(n,r,i){n=n||{};var s=r.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function a(u,l,h,p){return s.fromToBase(u,l,h,p)}i.en.relativeTime=o,s.fromToBase=function(u,l,h,p,g){for(var y,w,k,T=h.$locale().relativeTime||o,C=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],O=C.length,I=0;I<O;I+=1){var N=C[I];N.d&&(y=p?i(u).diff(h,N.d,!0):h.diff(u,N.d,!0));var F=(n.rounding||Math.round)(Math.abs(y));if(k=y>0,F<=N.r||!N.r){F<=1&&I>0&&(N=C[I-1]);var L=T[N.l];g&&(F=g(""+F)),w=typeof L=="string"?L.replace("%d",F):L(F,l,N.l,k);break}}if(l)return w;var D=k?T.future:T.past;return typeof D=="function"?D(w):D.replace("%s",w)},s.to=function(u,l){return a(u,l,this,!0)},s.from=function(u,l){return a(u,l,this)};var c=function(u){return u.$u?i.utc():i()};s.toNow=function(u){return this.to(c(this),u)},s.fromNow=function(u){return this.from(c(this),u)}}})})(LS);var KN=LS.exports;const Jm=Ui(KN);ta.extend(Jm);const VN={props:["claim"],methods:{toggleExchangeRate(){this.invertExchangeRate=!this.invertExchangeRate}},data(){return{invertExchangeRate:!1}}},BS=t=>(ya("data-v-45d5ac24"),t=t(),va(),t),qN={class:"claim light-font"},GN={class:"claim-row date"},YN={class:"claim-row"},ZN={class:"row-content"},XN=["src"],JN=["href"],QN=BS(()=>ee("i",{class:"fa-solid fa-arrow-up-right-from-square"},null,-1)),eP=[QN],tP={class:"row-content"},nP={class:"claim-row"},rP={class:"row-content"},iP=["src"],sP=["href"],oP=BS(()=>ee("i",{class:"fa-solid fa-arrow-up-right-from-square"},null,-1)),aP=[oP];function cP(t,e,n,r,i,s){return he(),Ee("div",qN,[ee("div",GN,[ee("p",null,Oe(n.claim.unstakeDate),1)]),ee("div",YN,[ee("div",ZN,[ee("p",null,"ð¥ "+Oe(n.claim.receiptAmount),1),ee("img",{src:`/assets/${n.claim.receiptToken}.png`,alt:"",class:"mini-icon"},null,8,XN),ee("p",null,Oe(n.claim.receiptToken),1),ee("a",{href:`https://solscan.io/tx/${n.claim.unstakeTransaction}`},eP,8,JN)]),ee("div",tP,[ee("p",null,Oe(n.claim.fulfilled?"Fulfilled":"Pending"),1),ee("i",{class:Kt(["fa-solid",[n.claim.fulfilled?"fa-circle-check":"fa-hourglass-half"]])},null,2)])]),ee("div",nP,[ee("div",rP,[ee("p",null,"ð«´ "+Oe(n.claim.claimAmount),1),ee("img",{src:`/assets/${n.claim.stakeToken}.png`,alt:"",class:"mini-icon"},null,8,iP),ee("p",null,Oe(n.claim.stakeToken),1),n.claim.fulfilled?(he(),Ee("a",{key:0,href:`https://solscan.io/tx/${n.claim.fulfilledTransaction}`},aP,8,sP)):xt("",!0)]),ee("div",{class:"row-content shaded-font fs-11",onClick:e[0]||(e[0]=(...o)=>s.toggleExchangeRate&&s.toggleExchangeRate(...o))},[ee("p",null," 1 "+Oe(i.invertExchangeRate?n.claim.receiptToken:n.
6claim.stakeToken)+" = "+Oe(i.invertExchangeRate?n.claim.unstakeRate:n.claim.stakeRate)+" "+Oe(i.invertExchangeRate?n.claim.stakeToken:n.claim.receiptToken),1)])])])}const uP=wn(VN,[["render",cP],["__scopeId","data-v-45d5ac24"]]);ta.extend(Jm);const Rv=1e5,lP={props:["claims","pools"],components:{Claim:uP},mounted(){document.addEventListener("click",this.handleClickOutside)},beforeDestroy(){document.removeEventListener("click",this.handleClickOutside)},computed:{hasUnfulfilledClaim(){for(const t of this.claims)if(!t.fulfilled)return!0;return!1},formattedClaims(){return this.claims.sort((t,e)=>ta(e.claimedDate).diff(ta(t.claimedDate))).map(t=>{const{stakeToken:e,receiptToken:n,decimals:r}=this.pools[t.poolId],i=Object.assign({},t);return Object.assign(i,{stakeToken:e,claimAmount:this.precision(t.claimAmount/Math.pow(10,r),r),unstakeRate:this.precision(t.unstakeRate/Rv,6),stakeRate:this.precision(1/t.unstakeRate*Rv,6),receiptToken:n,receiptAmount:this.precision(t.receiptAmount/Math.pow(10,r),r),unstakeDate:ta(t.claimedDate).format("MMM DD, YYYY HH:mm A")}),i})}},data(){return{showClaims:!1}},methods:{precision(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n},toggleClaims(t){t.stopPropagation(),this.showClaims=!this.showClaims},handleClickOutside(t){var e;this.showClaims&&!((e=this.$refs.overlay)!=null&&e.contains(t.target))&&(this.showClaims=!1)}}},fP={class:"claim-container"},hP={key:0,class:"overlay",ref:"overlay"},dP={class:"claim-list fs-12"},pP={key:0,class:"alert"};function gP(t,e,n,r,i,s){const o=mt("Claim");return he(),Ee("div",fP,[ee("button",{onClick:e[0]||(e[0]=(...a)=>s.toggleClaims&&s.toggleClaims(...a)),class:"toggle-button"},"Claims"),Pe(Zm,{name:"slide"},{default:Ii(()=>[i.showClaims?(he(),Ee("div",hP,[ee("div",dP,[(he(!0),Ee(Ct,null,so(s.formattedClaims,a=>(he(),gn(o,{key:a.id,claim:a},null,8,["claim"]))),128))])],512)):xt("",!0)]),_:1}),s.hasUnfulfilledClaim?(he(),Ee("div",pP)):xt("",!0)])}const mP=wn(lP,[["render",gP],["__scopeId","data-v-f6f5838e"]]);const yP={data(){return{options:["Low","High","Turbo"],selected:"Low"}},methods:{select(t){this.selected===t?this.selected="None":this.selected=t,this.$emit("update:selected",this.selected)}}},vP=t=>(ya("data-v-6ddefa0b"),t=t(),va(),t),bP={class:"priority-switch"},wP=vP(()=>ee("p",{class:"title"},"Priority",-1)),_P={class:"button-container"},kP=["onClick"];function SP(t,e,n,r,i,s){return he(),Ee("div",bP,[wP,ee("div",_P,[(he(!0),Ee(Ct,null,so(i.options,o=>(he(),Ee("button",{key:o,class:Kt({active:i.selected===o}),onClick:a=>s.select(o)},Oe(o),11,kP))),128))])])}const EP=wn(yP,[["render",SP],["__scopeId","data-v-6ddefa0b"]]);const AP={},xP={class:"social-media-menu"},RP=TS('<a href="https://docs.synatra.xyz" target="_blank" class="icon-link" data-v-23204290><i class="fa-solid fa-book" data-v-23204290></i></a><a href="https://discord.gg/DKvknQqGzH" target="_blank" class="icon-link" data-v-23204290><i class="fa-brands fa-discord" data-v-23204290></i></a><a href="https://twitter.com/synatraxyz" target="_blank" class="icon-link" data-v-23204290><i class="fa-brands fa-x-twitter" data-v-23204290></i></a>',3),TP=[RP];function OP(t,e){return he(),Ee("div",xP,TP)}const IP=wn(AP,[["render",OP],["__scopeId","data-v-23204290"]]);const CP={props:["choices","sm"],data(){return{active:0}},methods:{toggleIndicator(){this.active=this.active?0:1,this.$emit("toggleSwitch",this.active)}}},NP={class:"toggle-wrapper-item"},PP=["src"],MP={key:1,class:""},LP=["src"];function BP(t,e,n,r,i,s){return he(),Ee("div",{class:Kt(["toggle-wrapper",{active:i.active,sm:!!n.sm}]),onClick:e[0]||(e[0]=(...o)=>s.toggleIndicator&&s.toggleIndicator(...o))},[(he(!0),Ee(Ct,null,so(n.choices,({id:o,name:a,logo:c})=>(he(),Ee("div",NP,[i.active!==o?(he(),Ee("img",{key:0,class:Kt(["logo grayscale",{"sm-logo":!!n.sm}]),src:c},null,10,PP)):xt("",!0),i.active!==o?(he(),Ee("p",MP,Oe(a),1)):xt("",!0)]))),256)),ee("div",{class:"indicator",style:Ir({transform:i.active?"translateX(100%)":"none"})},[ee("img",{class:Kt(["logo",{"sm-logo":!!n.sm}]),src:n.choices[i.active].logo},null,10,LP),ee("p",null,Oe(n.choices[i.active].name),1)],4)],2)}const Qm=wn(CP,[["render",BP],["__scopeId","data-v-d8226f3e"]]);const DP={props:["items"]},$P={class:"bar-item"},FP={class:"bar-info"},UP={class:"progress-bar"};function zP(t,e,n,r,i,s){return he(),Ee("div",null,[(he(!0),Ee(Ct,null,so(n.items,o=>(he(),Ee("div",$P,[ee("div",FP,[ee("span",null,Oe(o.name),1),ee("span",null,Oe(o.displayValue)+" ("+Oe(o.percent)+"%)",1)]),ee("div",UP,[ee("div",{class:Kt(["progress",{negative:o.percent<0}]),style:Ir(`width: ${Math.max(Math.abs(o.percent),1)}%`)},null,6)])]))),256))])}const HP=wn(DP,[["render",zP],["__scopeId","data-v-aebbb334"]]);ta.extend(Jm);const WP={props:["stats"],components:{ProgressBars:HP,TokenSwitch:Qm},mounted(){this.$nextTick(()=>{const t=this.$refs.tabs.querySelector(".active-tab");t&&this.setUnderlinePosition(t),window.addEventListener("resize",this.handleResize)})},beforeUnmount(){window.removeEventListener("resize",this.handleResize)},computed:{networth(){var n;const t=((n=this.stats.categories)==null?void 0:n["networth|stake"])||0,e=this.stats.categories.team||0;return this.formatValue(t+e,this.units)},apy(){return parseFloat((this.stats.apy/1e3).toFixed(2))},supply(){return this.stats.supply?this.formatValue(this.stats.supply):"???"},maxSupply(){if(!this.stats.maxSupply)return"???";
6const t=this.stats.maxSupply/Math.pow(10,this.stats.decimals);return this.formatValue(t)},backingPrice(){var n;if(!this.stats.currentSupply)return"???";const t=((n=this.stats.categories)==null?void 0:n["networth|stake"])||0,e=this.stats.currentSupply/Math.pow(10,this.stats.decimals);return this.formatValue(t/e,this.units,4)},team(){const t=this.stats.categories.team||0;return this.formatValue(t,this.units)},netValueLocked(){var e;const t=((e=this.stats.categories)==null?void 0:e["networth|stake"])||0;return this.formatValue(t,this.units)},lastUpdated(){var t;return ta(((t=this.stats)==null?void 0:t.timestamp)||0).format("MMM DD, YYYY HH:mm A")},solPrice(){var t,e,n;return((n=(e=(t=this.stats)==null?void 0:t.categories)==null?void 0:e.prices)==null?void 0:n.sol)||1},formattedSections(){const t=Object.entries(this.stats.categories||{}).map(([e,n])=>({slug:e,name:this.keyNameMap[e]||e,value:n,displayValue:this.formatValue(n,this.units),percent:this.valueToPercent(n)})).sort((e,n)=>n.value-e.value);return this.sections.map(e=>{const n=Object.assign({},e);return n.items=t.filter(r=>r.value===0?!1:r.slug.startsWith(e.slug)),n})}},data(){return{units:"usd",sections:[{tab:"Strategy",slug:"strategy",title:"Strategy Type",subtitle:"Each strategy type has a different risk profile. These items show spot exposure to each strategy.",format:"bar"},{tab:"Protocol",slug:"protocol",title:"Protocol Exposure",subtitle:"The location where spot assets are held.",format:"bar"},{tab:"Asset",slug:"asset",title:"Asset Exposure",subtitle:"Net long or short position of each asset class.",format:"bar"},{tab:"Futures",slug:"type",title:"Futures Positions",subtitle:"Total futures positions",format:"bar"},{tab:"Rewards",slug:"rewards",title:"Additional Rewards",subtitle:"Shows miscellanous rewards e.g, points or unvested tokens",format:"bar"}],activeTab:"strategy",underlineStyle:{left:"0px",width:"0px"},keyNameMap:{"asset|btc":"BTC","asset|eth":"ETH","asset|sol":"SOL","asset|stables":"Stables","asset|alts":"Alts","asset|perp-lp":"Perp LP","asset|nft":"NFTs","asset|memes":"Memecoins","strategy|cash-carry":"Cash and Carry","strategy|hedged-carry":"Hedged Carry","strategy|airdrop":"Airdrop Farming","strategy|lending":"Lending","strategy|nft-lending":"NFT Collateralized Lending","strategy|levered-staking":"Levered Staking","protocol|drift":"Drift","protocol|hyperliquid":"Hyperliquid","protocol|meteora":"Meteora","protocol|zeta":"Zeta","protocol|kamino":"Kamino","protocol|marginfi":"Marginfi","protocol|wallet":"Wallet","protocol|solend":"Solend","protocol|mango":"Mango","protocol|orca":"Orca","protocol|phoenix":"Phoenix","protocol|raydium":"Raydium","protocol|sharky":"Sharky","protocol|banx":"Banx","protocol|wallet":"Holdings","type|oi":"Open Interest","type|spot":"Spot"},tokenChoices:[{id:0,name:"USD",logo:"/assets/USDC.png"},{id:1,name:"SOL",logo:"/assets/SOL.png"}]}},methods:{selectTab(t,e){this.activeTab=t,this.setUnderlinePosition(e.target)},setUnderlinePosition(t){const e=this.$refs.tabs.getBoundingClientRect(),n=t.getBoundingClientRect();this.underlineStyle={left:`${n.left-e.left}px`,width:`${n.width}px`}},formatValue(t,e=null,n=2){let r=t;const i={minimumFractionDigits:n,maximumFractionDigits:n};return e==="sol"?(r/=this.stats.prices.sol,`${new Intl.NumberFormat("en-US",i).format(r)} â`):(e==="usd"&&Object.assign(i,{style:"currency",currency:"USD"}),new Intl.NumberFormat("en-US",i).format(r))},valueToPercent(t){var n;const e=((n=this.stats.categories)==null?void 0:n["networth|stake"])||0;return parseFloat((t/e*100).toFixed(2))},setUnits(t){t===0&&(this.units="usd"),t===1&&(this.units="sol")},handleResize(){const t=this.$refs.tabs.querySelector(".active-tab");t&&this.setUnderlinePosition(t)},close(){this.$emit("close")}}},DS=t=>(ya("data-v-e8c2d96c"),t=t(),va(),t),jP={class:"dashboard-container"},KP=DS(()=>ee("i",{class:"fa-solid fa-xmark"},null,-1)),VP=[KP],qP={class:"header"},GP={class:"header-left"},YP={class:"total-value-text"},ZP={class:"total-value"},XP={class:"header-right"},JP={key:0,class:"apy"},QP={class:"mid-section"},eM={class:"row-content"},tM={class:"content-value"},nM={class:"row-content"},rM={class:"content-value"},iM={class:"row-content"},sM={class:"content-value"},oM={class:"row-content"},aM={class:"content-value"},cM={class:"tabs",ref:"tabs"},uM=["onClick"],lM={class:"content-wrapper"},fM={class:"content",ref:"content"},hM={key:0,class:"section"},dM={class:"section-title"},pM={class:"section-subtitle"},gM={class:"bottom-info"},mM={class:"units-container"},yM=DS(()=>ee("span",null,Oe("Units"),-1)),vM={class:"last-updated"};function bM(t,e,n,r,i,s){const o=mt("ProgressBars"),a=mt("TokenSwitch"),c=jm("tooltip");return he(),Ee("div",jP,[ee("button",{onClick:e[0]||(e[0]=(...u)=>s.close&&s.close(...u)),class:"close-btn"},VP),ee("div",qP,[ee("div",GP,[kr((he(),Ee("p",YP,[Qr(" Total Value Locked ")])),[[c,"All spot and unrealized pnl in the fund including stakers and protocol holdings."]]),ee("p",ZP,Oe(s.networth),1
6)]),ee("div",XP,[s.apy?kr((he(),Ee("p",JP,[Qr(Oe(s.apy)+"% APY",1)])),[[c,"Computed since pool inception."]]):xt("",!0)])]),ee("div",QP,[ee("div",eM,[kr((he(),Ee("p",null,[Qr("Net Value Locked:")])),[[c,"Total value locked minus the protocol share"]]),ee("p",tM,Oe(s.netValueLocked),1)]),ee("div",nM,[kr((he(),Ee("p",null,[Qr(" Protocol Share: ")])),[[c,"Funds owned by the team. The added liquidity amplifies yield. 20% of losses incurred by the pool is absorbed by these funds."]]),ee("p",rM,Oe(s.team),1)]),ee("div",iM,[kr((he(),Ee("p",null,[Qr(Oe(n.stats.receiptToken)+" Supply:",1)])),[[c,"Total receipt tokens in circulation."]]),ee("p",sM,Oe(s.supply)+" / "+Oe(s.maxSupply),1)]),ee("div",oM,[kr((he(),Ee("p",null,[Qr(Oe(n.stats.receiptToken)+" Backing Price:",1)])),[[c,"Net value locked / supply"]]),ee("p",aM,Oe(s.backingPrice),1)])]),ee("div",cM,[(he(!0),Ee(Ct,null,so(i.sections,({tab:u,slug:l})=>(he(),Ee("div",{key:l,class:Kt(["tab",{"active-tab":i.activeTab===l}]),onClick:h=>s.selectTab(l,h),ref_for:!0,ref:`tab-${l}`},Oe(u),11,uM))),128)),ee("div",{class:"underline",style:Ir(i.underlineStyle)},null,4)],512),ee("div",lM,[ee("div",fM,[(he(!0),Ee(Ct,null,so(s.formattedSections,({slug:u,title:l,subtitle:h,format:p,items:g})=>(he(),Ee(Ct,null,[u===i.activeTab?(he(),Ee("div",hM,[ee("p",dM,Oe(l),1),ee("p",pM,Oe(h),1),p==="bar"?(he(),gn(o,{key:0,items:g},null,8,["items"])):xt("",!0)])):xt("",!0)],64))),256))],512)]),ee("div",gM,[ee("div",mM,[yM,Pe(a,{choices:i.tokenChoices,onToggleSwitch:s.setUnits,sm:!0},null,8,["choices","onToggleSwitch"])]),ee("p",vM,"Updated: "+Oe(s.lastUpdated),1)])])}const wM=wn(WP,[["render",bM],["__scopeId","data-v-e8c2d96c"]]);/*! 7 * @kurkle/color v0.3.2 8 * https://github.com/kurkle/color#readme 9 * (c) 2023 Jukka Kurkela 10 * Released under the MIT License 11 */function gl(t){return t+.5|0}const $s=(t,e,n)=>Math.max(Math.min(t,n),e);function tu(t){return $s(gl(t*2.55),0,255)}function qs(t){return $s(gl(t*255),0,255)}function es(t){return $s(gl(t/2.55)/100,0,1)}function Tv(t){return $s(gl(t*100),0,100)}const Pr={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},r0=[..."0123456789ABCDEF"],_M=t=>r0[t&15],kM=t=>r0[(t&240)>>4]+r0[t&15],Wl=t=>(t&240)>>4===(t&15),SM=t=>Wl(t.r)&&Wl(t.g)&&Wl(t.b)&&Wl(t.a);function EM(t){var e=t.length,n;return t[0]==="#"&&(e===4||e===5?n={r:255&Pr[t[1]]*17,g:255&Pr[t[2]]*17,b:255&Pr[t[3]]*17,a:e===5?Pr[t[4]]*17:255}:(e===7||e===9)&&(n={r:Pr[t[1]]<<4|Pr[t[2]],g:Pr[t[3]]<<4|Pr[t[4]],b:Pr[t[5]]<<4|Pr[t[6]],a:e===9?Pr[t[7]]<<4|Pr[t[8]]:255})),n}const AM=(t,e)=>t<255?e(t):"";function xM(t){var e=SM(t)?_M:kM;return t?"#"+e(t.r)+e(t.g)+e(t.b)+AM(t.a,e):void 0}const RM=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function $S(t,e,n){const r=e*Math.min(n,1-n),i=(s,o=(s+t/30)%12)=>n-r*Math.max(Math.min(o-3,9-o,1),-1);return[i(0),i(8),i(4)]}function TM(t,e,n){const r=(i,s=(i+t/60)%6)=>n-n*e*Math.max(Math.min(s,4-s,1),0);return[r(5),r(3),r(1)]}function OM(t,e,n){const r=$S(t,1,.5);let i;for(e+n>1&&(i=1/(e+n),e*=i,n*=i),i=0;i<3;i++)r[i]*=1-e-n,r[i]+=e;return r}function IM(t,e,n,r,i){return t===i?(e-n)/r+(e<n?6:0):e===i?(n-t)/r+2:(t-e)/r+4}function ey(t){const n=t.r/255,r=t.g/255,i=t.b/255,s=Math.max(n,r,i),o=Math.min(n,r,i),a=(s+o)/2;let c,u,l;return s!==o&&(l=s-o,u=a>.5?l/(2-s-o):l/(s+o),c=IM(n,r,i,l,s),c=c*60+.5),[c|0,u||0,a]}function ty(t,e,n,r){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,r)).map(qs)}function ny(t,e,n){return ty($S,t,e,n)}function CM(t,e,n){return ty(OM,t,e,n)}function NM(t,e,n){return ty(TM,t,e,n)}function FS(t){return(t%360+360)%360}function PM(t){const e=RM.exec(t);let n=255,r;if(!e)return;e[5]!==r&&(n=e[6]?tu(+e[5]):qs(+e[5]));const i=FS(+e[2]),s=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?r=CM(i,s,o):e[1]==="hsv"?r=NM(i,s,o):r=ny(i,s,o),{r:r[0],g:r[1],b:r[2],a:n}}function MM(t,e){var n=ey(t);n[0]=FS(n[0]+e),n=ny(n),t.r=n[0],t.g=n[1],t.b=n[2]}function LM(t){if(!t)return;const e=ey(t),n=e[0],r=Tv(e[1]),i=Tv(e[2]);return t.a<255?`hsla(${n}, ${r}%, ${i}%, ${es(t.a)})`:`hsl(${n}, ${r}%, ${i}%)`}const Ov={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Iv={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",K
vendor: 41,618 bytes, lines 11-21
11ocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function BM(){const t={},e=Object.keys(Iv),n=Object.keys(Ov);let r,i,s,o,a;for(r=0;r<e.length;r++){for(o=a=e[r],i=0;i<n.length;i++)s=n[i],a=a.replace(s,Ov[s]);s=parseInt(Iv[o],16),t[a]=[s>>16&255,s>>8&255,s&255]}return t}let jl;function DM(t){jl||(jl=BM(),jl.transparent=[0,0,0,0]);const e=jl[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const $M=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function FM(t){const e=$M.exec(t);let n=255,r,i,s;if(e){if(e[7]!==r){const o=+e[7];n=e[8]?tu(o):$s(o*255,0,255)}return r=+e[1],i=+e[3],s=+e[5],r=255&(e[2]?tu(r):$s(r,0,255)),i=255&(e[4]?tu(i):$s(i,0,255)),s=255&(e[6]?tu(s):$s(s,0,255)),{r,g:i,b:s,a:n}}}function UM(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${es(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const Rp=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,Ca=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function zM(t,e,n){const r=Ca(es(t.r)),i=Ca(es(t.g)),s=Ca(es(t.b));return{r:qs(Rp(r+n*(Ca(es(e.r))-r))),g:qs(Rp(i+n*(Ca(es(e.g))-i))),b:qs(Rp(s+n*(Ca(es(e.b))-s))),a:t.a+n*(e.a-t.a)}}function Kl(t,e,n){if(t){let r=ey(t);r[e]=Math.max(0,Math.min(r[e]+r[e]*n,e===0?360:1)),r=ny(r),t.r=r[0],t.g=r[1],t.b=r[2]}}function US(t,e){return t&&Object.assign(e||{},t)}function Cv(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=qs(t[3]))):(e=US(t,{r:0,g:0,b:0,a:1}),e.a=qs(e.a)),e}function HM(t){return t.charAt(0)==="r"?FM(t):PM(t)}class Fu{constructor(e){if(e instanceof Fu)return e;const n=typeof e;let r;n==="object"?r=Cv(e):n==="string"&&(r=EM(e)||DM(e)||HM(e)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var e=US(this._rgb);return e&&(e.a=es(e.a)),e}set rgb(e){this._rgb=Cv(e)}rgbString(){return this._valid?UM(this._rgb):void 0}hexString(){return this._valid?xM(this._rgb):void 0}hslString(){return this._valid?LM(this._rgb):void 0}mix(e,n){if(e){const r=this.rgb,i=e.rgb;let s;const o=n===s?.5:n,a=2*o-1,c=r.a-i.a,u=((a*c===-1?a:(a+c)/(1+a*c))+1)/2;s=1-u,r.r=255&u*r.r+s*i.r+.5,r.g=255&u*r.g+s*i.g+.5,r.b=255&u*r.b+s*i.b+.5,r.a=o*r.a+(1-o)*i.a,this.rgb=r}return this}interpolate(e,n){return e&&(this._rgb=zM(this._rgb,e._rgb,n)),this}clone(){return new Fu(this.rgb)}alpha(e){return this._rgb.a=qs(e),this}clearer(e){const n=this._rgb;return n.a*=1-e,this}greyscale(){const e=this._rgb,n=gl(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=n,this}opaquer(e){const n=this._rgb;return n.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Kl(this._rgb,2,e),this}darken(e){return Kl(this._rgb,2,-e),this}saturate(e){return Kl(this._rgb,1,e),this}desaturate(e){return Kl(this._rgb,1,-e),this}rotate(e){return MM(this._rgb,e),this}}/*! 12 * Chart.js v4.4.3 13 * https://www.chartjs.org 14 * (c) 2024 Chart.js Contributors 15 * Released under the MIT License 16 */function qi(){}const WM=(()=>{let t=0;return()=>t++})();function Nt(t){return t===null||typeof t>"u"}function Ft(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function ht(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function xn(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function mr(t,e){return xn(t)?t:e}function et(t,e){return typeof t>"u"?e:t}const jM=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function At(t,e,n){if(t&&typeof t.call=="function")return t.apply(n,e)}function yt(t,e,n,r){let i,s,o;if(Ft(t))if(s=t.length,r)for(i=s-1;i>=0;i--)e.call(n,t[i],i);else for(i=0;i<s;i++)e.call(n,t[i],i);else if(ht(t))for(o=Object.keys(t),s=o.length,i=0;i<s;i++)e.call(n,t[o[i]],o[i])}function oh(t,e){let n,r,i,s;if(!t||!e||t.length!==e.length)return!1;for(n=0,r=t.length;n<r;++n)if(i=t[n],s=e[n],i.datasetIndex!==s.datasetIndex||i.index!==s.index)return!1;return!0}function ah(t){if(Ft(t))return t.map(ah);if(ht(t)){const e=Object.create(null),n=Object.keys(t),r=n.length;let i=0;for(;i<r;++i)e[n[i]]=ah(t[n[i]]);return e}return t}function zS(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function KM(t,e,n,r){if(!zS(t))return;const i=e[t],s=n[t];ht(i)&&ht(s)?Uu(i,s,r):e[t]=ah(s)}function Uu(t,e,n){const r=Ft(e)?e:[e],i=r.length;if(!ht(t))return t;n=n||{};const s=n.merger||KM;let o;for(let a=0;a<i;++a){if(o=r[a],!ht(o))continue;const c=Object.keys(o);for(let u=0,l=c.length;u<l;++u)s(c[u],t,o,n)}return t}function gu(t,e){return Uu(t,e,{merger:VM})}function VM(t,e,n){if(!zS(t))return;const r=e[t],i=n[t];ht(r)&&ht(i)?gu(r,i):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=ah(i))}const Nv={"":t=>t,x:t=>t.x,y:t=>t.y};function qM(t){const e=t.split("."),n=[];let r="";for(const i of e)r+=i,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function GM(t){const e=qM(t);return n=>{for(const r of e){if(r==="")break;n=n&&n[r]}return n}}function ch(t,e){return(Nv[e]||(Nv[e]=GM(e)))(t)}function ry(t){return t.charAt(0).toUpperCase()+t.slice(1)}const uh=t=>typeof t<"u",oo=t=>typeof t=="function",Pv=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0};function YM(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const mn=Math.PI,jr=2*mn,ZM=jr+mn,lh=Number.POSITIVE_INFINITY,XM=mn/180,xr=mn/2,ko=mn/4,Mv=mn*2/3,Fs=Math.log10,cc=Math.sign;function mu(t,e,n){return Math.abs(t-e)<n}function Lv(t){const e=Math.round(t);t=mu(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(Fs(t))),r=t/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function JM(t){const e=[],n=Math.sqrt(t);let r;for(r=1;r<n;r++)t%r===0&&(e.push(r),e.push(t/r));return n===(n|0)&&e.push(n),e.sort((i,s)=>i-s).pop(),e}function zu(t){return!isNaN(parseFloat(t))&&isFinite(t)}function QM(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}function HS(t,e,n){let r,i,s;for(r=0,i=t.length;r<i;r++)s=t[r][n],isNaN(s)||(e.min=Math.min(e.min,s),e.max=Math.max(e.max,s))}function Us(t){return t*(mn/180)}function iy(t){return t*(180/mn)}function Bv(t){if(!xn(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function e3(t,e){const n=e.x-t.x,r=e.y-t.y,i=Math.sqrt(n*n+r*r);let s=Math.atan2(r,n);return s<-.5*mn&&(s+=jr),{angle:s,distance:i}}function i0(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function t3(t,e){return(t-e+ZM)%jr-mn}function Jr(t){return(t%jr+jr)%jr}function WS(t,e,n,r){const i=Jr(t),s=Jr(e),o=Jr(n),a=Jr(s-i),c=Jr(o-i),u=Jr(i-s),l=Jr(i-o);return i===s||i===o||r&&s===o||a>c&&u<l}function Fr(t,e,n){return Math.max(e,Math.min(n,t))}function n3(t){return Fr(t,-32768,32767)}function nu(t,e,n,r=1e-6){return t>=Math.min(e,n)-r&&t<=Math.max(e,n)+r}function sy(t,e,n){n=n||(o=>t[o]<e);let r=t.length-1,i=0,s;for(;r-i>1;)s=i+r>>1,n(s)?i=s:r=s;return{lo:i,hi:r}}const Ho=(t,e,n,r)=>sy(t,n,r?i=>{const s=t[i][e];return s<n||s===n&&t[i+1][e]===n}:i=>t[i][e]<n),r3=(t,e,n)=>sy(t,n,r=>t[r][e]>=n);function i3(t,e,n){let r=0,i=t.length;for(;r<i&&t[r]<e;)r++;for(;i>r&&t[i-1]>n;)i--;return r>0||i<t.length?t.slice(r,i):t}const jS=["push","pop","shift","splice","unshift"];function s3(t,e){if(t._chartjs){t._chartjs.listeners.push(e);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),jS.forEach(n=>{const r="_onData"+ry(n),i=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!1,value(...s){const o=i.apply(this,s);return t._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...s)}),o}})})}function Dv(t,e){const n=t._chartjs;if(!n)return;const r=n.listeners,i=r.indexOf(e);i!==-1&&r.splice(i,1),!(r.length>0)&&(jS.forEach(s=>{delete t[s]}),delete t._chartjs)}function o3(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const KS=function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame}();function VS(t,e){let n=[],r=!1;return function(...i){n=i,r||(r=!0,KS.call(window,()=>{r=!1,t.apply(e,n)}))}}function a3(t,e){let n;return function(...r){return e?(clearTimeout(n),n=setTimeout(t,e,r)):t.apply(this,r),e}}const oy=t=>t==="start"?"left":t==="end"?"right":"center",Wn=(t,e,n)=>t==="start"?e:t==="end"?n:(e+n)/2,c3=(t,e,n,r)=>t===(r?"left":"right")?n:t==="center"?(e+n)/2:e;function u3(t,e,n){const r=e.length;let i=0,s=r;if(t._sorted){const{iScale:o,_parsed:a}=t,c=o.axis,{min:u,max:l,minDefined:h,maxDefined:p}=o.getUserBounds();h&&(i=Fr(Math.min(Ho(a,c,u).lo,n?r:Ho(e,c,o.getPixelForValue(u)).lo),0,r-1)),p?s=Fr(Math.max(Ho(a,o.axis,l,!0).hi+1,n?0:Ho(e,c,o.getPixelForValue(l),!0).hi+1),i,r)-i:s=r-i}return{start:i,count:s}}function l3(t){const{xScale:e,yScale:n,_scaleRanges:r}=t,i={xmin:e.min,xmax:e.max,ymin:n.min,ymax:n.max};if(!r)return t._scaleRanges=i,!0;const s=r.xmin!==e.min||r.xmax!==e.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),s}const Vl=t=>t===0||t===1,$v=(t,e,n)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*jr/n)),Fv=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*jr/n)+1,yu={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*xr)+1,easeOutSine:t=>Math.sin(t*xr),easeInOutSine:t=>-.5*(Math.cos(mn*t)-1),easeInExpo:t=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>Vl(t)?t:t<.5?.5*Math.pow(2,10*(t*2-1)):.5*(-Math.pow(2,-10*(t*2-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Vl(t)?t:$v(t,.075,.3),easeOutElastic:t=>Vl(t)?t:Fv(t,.075,.3),easeInOutElastic(t){return Vl(t)?t:t<.5?.5*$v(t*2,.1125,.45):.5+.5*Fv(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:t=>1-yu.easeOutBounce(1-t),easeOutBounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:t=>t<.5?yu.easeInBounce(t*2)*.5:yu.easeOutBounce(t*2-1)*.5+.5};function ay(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Uv(t){return ay(t)?t:new Fu(t)}function Tp(t){return ay(t)?t:new Fu(t).saturate(.5).darken(.1).hexString()}const f3=["x","y","borderWidth","radius","tension"],h3=["color","borderColor","backgroundColor"];function d3(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),t.set("animations",{colors:{type:"color",properties:h3},numbers:{type:"number",properties:f3}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function p3(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const zv=new Map;function g3(t,e){e=e||{};const n=t+JSON.stringify(e);let r=zv.get(n);return r||(r=new Intl.NumberFormat(t,e),zv.set(n,r)),r}function cy(t,e,n){return g3(e,n).format(t)}const qS={values(t){return Ft(t)?t:""+t},numeric(t,e,n){if(t===0)return"0";const r=this.chart.options.locale;let i,s=t;if(n.length>1){const u=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(u<1e-4||u>1e15)&&(i="scientific"),s=m3(t,n)}const o=Fs(Math.abs(s)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),c={notation:i,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(c,this.options.ticks.format),cy(t,r,c)},logarithmic(t,e,n){if(t===0)return"0";const r=n[e].significand||t/Math.pow(10,Math.floor(Fs(t)));return[1,2,3,5,10,15].includes(r)||e>.8*n.length?qS.numeric.call(this,t,e,n):""}};function m3(t,e){let n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(n)>=1&&t!==Math.floor(t)&&(n=t-Math.floor(t)),n}var cd={formatters:qS};function y3(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,n)=>n.lineWidth,tickColor:(e,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:cd.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const sa=Object.create(null),s0=Object.create(null);function vu(t,e){if(!e)return t;const n=e.split(".");for(let r=0,i=n.length;r<i;++r){const s=n[r];t=t[s]||(t[s]=Object.create(null))}return t}function Op(t,e,n){return typeof e=="string"?Uu(vu(t,e),n):Uu(vu(t,""),e)}class v3{constructor(e,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,i)=>Tp(i.backgroundColor),this.hoverBorderColor=(r,i)=>Tp(i.borderColor),this.hoverColor=(r,i)=>Tp(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(n)}set(e,n){return Op(this,e,n)}get(e){return vu(this,e)}describe(e,n){return Op(s0,e,n)}override(e,n){return Op(sa,e,n)}route(e,n,r,i){const s=vu(this,e),o=vu(this,r),a="_"+n;Object.defineProperties(s,{[a]:{value:s[n],writable:!0},[n]:{enumerable:!0,get(){const c=this[a],u=o[i];return ht(c)?Object.assign({},u,c):et(c,u)},set(c){this[a]=c}}})}apply(e){e.forEach(n=>n(this))}}var Vt=new v3({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[d3,p3,y3]);function b3(t){return!t||Nt(t.size)||Nt(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function fh(t,e,n,r,i){let s=e[i];return s||(s=e[i]=t.measureText(i).width,n.push(i)),s>r&&(r=s),r}function w3(t,e,n,r){r=r||{};let i=r.data=r.data||{},s=r.garbageCollect=r.garbageCollect||[];r.font!==e&&(i=r.data={},s=r.garbageCollect=[],r.font=e),t.save(),t.font=e;let o=0;const a=n.length;let c,u,l,h,p;for(c=0;c<a;c++)if(h=n[c],h!=null&&!Ft(h))o=fh(t,i,s,o,h);else if(Ft(h))for(u=0,l=h.length;u<l;u++)p=h[u],p!=null&&!Ft(p)&&(o=fh(t,i,s,o,p));t.restore();const g=s.length/2;if(g>n.length){for(c=0;c<g;c++)delete i[s[c]];s.splice(0,g)}return o}function So(t,e,n){const r=t.currentDevicePixelRatio,i=n!==0?Math.max(n/2,.5):0;return Math.round((e-i)*r)/r+i}function Hv(t,e){!e&&!t||(e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function o0(t,e,n,r){GS(t,e,n,r,null)}function GS(t,e,n,r,i){let s,o,a,c,u,l,h,p;const g=e.pointStyle,y=e.rotation,w=e.radius;let k=(y||0)*XM;if(g&&typeof g=="object"&&(s=g.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){t.save(),t.translate(n,r),t.rotate(k),t.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),t.restore();return}if(!(isNaN(w)||w<=0)){switch(t.beginPath(),g){default:i?t.ellipse(n,r,i/2,w,0,0,jr):t.arc(n,r,w,0,jr),t.closePath();break;case"triangle":l=i?i/2:w,t.moveTo(n+Math.sin(k)*l,r-Math.cos(k)*w),k+=Mv,t.lineTo(n+Math.sin(k)*l,r-Math.cos(k)*w),k+=Mv,t.lineTo(n+Math.sin(k)*l,r-Math.cos(k)*w),t.closePath();break;case"rectRounded":u=w*.516,c=w-u,o=Math.cos(k+ko)*c,h=Math.cos(k+ko)*(i?i/2-u:c),a=Math.sin(k+ko)*c,p=Math.sin(k+ko)*(i?i/2-u:c),t.arc(n-h,r-a,u,k-mn,k-xr),t.arc(n+p,r-o,u,k-xr,k),t.arc(n+h,r+a,u,k,k+xr),t.arc(n-p,r+o,u,k+xr,k+mn),t.closePath();break;case"rect":if(!y){c=Math.SQRT1_2*w,l=i?i/2:c,t.rect(n-l,r-c,2*l,2*c);break}k+=ko;case"rectRot":h=Math.cos(k)*(i?i/2:w),o=Math.cos(k)*w,a=Math.sin(k)*w,p=Math.sin(k)*(i?i/2:w),t.moveTo(n-h,r-a),t.lineTo(n+p,r-o),t.lineTo(n+h,r+a),t.lineTo(n-p,r+o),t.closePath();break;case"crossRot":k+=ko;case"cross":h=Math.cos(k)*(i?i/2:w),o=Math.cos(k)*w,a=Math.sin(k)*w,p=Math.sin(k)*(i?i/2:w),t.moveTo(n-h,r-a),t.lineTo(n+h,r+a),t.moveTo(n+p,r-o),t.lineTo(n-p,r+o);break;case"star":h=Math.cos(k)*(i?i/2:w),o=Math.cos(k)*w,a=Math.sin(k)*w,p=Math.sin(k)*(i?i/2:w),t.moveTo(n-h,r-a),t.lineTo(n+h,r+a),t.moveTo(n+p,r-o),t.lineTo(n-p,r+o),k+=ko,h=Math.cos(k)*(i?i/2:w),o=Math.cos(k)*w,a=Math.sin(k)*w,p=Math.sin(k)*(i?i/2:w),t.moveTo(n-h,r-a),t.lineTo(n+h,r+a),t.moveTo(n+p,r-o),t.lineTo(n-p,r+o);break;case"line":o=i?i/2:Math.cos(k)*w,a=Math.sin(k)*w,t.moveTo(n-o,r-a),t.lineTo(n+o,r+a);break;case"dash":t.moveTo(n,r),t.lineTo(n+Math.cos(k)*(i?i/2:w),r+Math.sin(k)*w);break;case!1:t.closePath();break}t.fill(),e.borderWidth>0&&t.stroke()}}function us(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.x<e.right+n&&t.y>e.top-n&&t.y<e.bottom+n}function uy(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function ly(t){t.restore()}function _3(t,e,n,r,i){if(!e)return t.lineTo(n.x,n.y);if(i==="middle"){const s=(e.x+n.x)/2;t.lineTo(s,e.y),t.lineTo(s,n.y)}else i==="after"!=!!r?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y);t.lineTo(n.x,n.y)}function k3(t,e,n,r){if(!e)return t.lineTo(n.x,n.y);t.bezierCurveTo(r?e.cp1x:e.cp2x,r?e.cp1y:e.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function S3(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),Nt(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}function E3(t,e,n,r,i){if(i.strikethrough||i.underline){const s=t.measureText(r),o=e-s.actualBoundingBoxLeft,a=e+s.actualBoundingBoxRight,c=n-s.actualBoundingBoxAscent,u=n+s.actualBoundingBoxDescent,l=i.strikethrough?(c+u)/2:u;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=i.decorationWidth||2,t.moveTo(o,l),t.lineTo(a,l),t.stroke()}}function A3(t,e){const n=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=n}function oa(t,e,n,r,i,s={}){const o=Ft(e)?e:[e],a=s.strokeWidth>0&&s.strokeColor!=="";let c,u;for(t.save(),t.font=i.string,S3(t,s),c=0;c<o.length;++c)u=o[c],s.backdrop&&A3(t,s.backdrop),a&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),Nt(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(u,n,r,s.maxWidth)),t.fillText(u,n,r,s.maxWidth),E3(t,n,r,u,s),r+=Number(i.lineHeight);t.restore()}function hh(t,e){const{x:n,y:r,w:i,h:s,radius:o}=e;t.arc(n+o.topLeft,r+o.topLeft,o.topLeft,1.5*mn,mn,!0),t.lineTo(n,r+s-o.bottomLeft),t.arc(n+o.bottomLeft,r+s-o.bottomLeft,o.bottomLeft,mn,xr,!0),t.lineTo(n+i-o.bottomRight,r+s),t.arc(n+i-o.bottomRight,r+s-o.bottomRight,o.bottomRight,xr,0,!0),t.lineTo(n+i,r+o.topRight),t.arc(n+i-o.topRight,r+o.topRight,o.topRight,0,-xr,!0),t.lineTo(n+o.topLeft,r)}const x3=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,R3=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function T3(t,e){const n=(""+t).match(x3);if(!n||n[1]==="normal")return e*1.2;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100;break}return e*t}const O3=t=>+t||0;function YS(t,e){const n={},r=ht(e),i=r?Object.keys(e):e,s=ht(t)?r?o=>et(t[o],t[e[o]]):o=>t[o]:()=>t;for(const o of i)n[o]=O3(s(o));return n}function I3(t){return YS(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Za(t){return YS(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Vn(t){const e=I3(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function _n(t,e){t=t||{},e=e||Vt.font;let n=et(t.size,e.size);typeof n=="string"&&(n=parseInt(n,10));let r=et(t.style,e.style);r&&!(""+r).match(R3)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:et(t.family,e.family),lineHeight:T3(et(t.lineHeight,e.lineHeight),n),size:n,style:r,weight:et(t.weight,e.weight),string:""};return i.string=b3(i),i}function ql(t,e,n,r){let i=!0,s,o,a;for(s=0,o=t.length;s<o;++s)if(a=t[s],a!==void 0&&(e!==void 0&&typeof a=="function"&&(a=a(e),i=!1),n!==void 0&&Ft(a)&&(a=a[n%a.length],i=!1),a!==void 0))return r&&!i&&(r.cacheable=!1),a}function C3(t,e,n){const{min:r,max:i}=t,s=jM(e,(i-r)/2),o=(a,c)=>n&&a===0?0:a+c;return{min:o(r,-Math.abs(s)),max:o(i,s)}}function po(t,e){return Object.assign(Object.create(t),e)}function fy(t,e=[""],n,r,i=()=>t[0]){const s=n||t;typeof r>"u"&&(r=QS("_fallback",t));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:s,_fallback:r,_getTarget:i,override:a=>fy([a,...t],e,s,r)};return new Proxy(o,{deleteProperty(a,c){return delete a[c],delete a._keys,delete t[0][c],!0},get(a,c){return XS(a,c,()=>F3(c,e,t,a))},getOwnPropertyDescriptor(a,c){return Reflect.getOwnPropertyDescriptor(a._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(a,c){return jv(a).includes(c)},ownKeys(a){return jv(a)},set(a,c,u){const l=a._storage||(a._storage=i());return a[c]=l[c]=u,delete a._keys,!0}})}function uc(t,e,n,r){const i={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:ZS(t,r),setContext:s=>uc(t,s,n,r),override:s=>uc(t.override(s),e,n,r)};return new Proxy(i,{deleteProperty(s,o){return delete s[o],delete t[o],!0},get(s,o,a){return XS(s,o,()=>P3(s,o,a))},getOwnPropertyDescriptor(s,o){return s._descriptors.allKeys?Reflect.has(t,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,o)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(s,o){return Reflect.has(t,o)},ownKeys(){return Reflect.ownKeys(t)},set(s,o,a){return t[o]=a,delete s[o],!0}})}function ZS(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:r=e.indexable,_allKeys:i=e.allKeys}=t;return{allKeys:i,scriptable:n,indexable:r,isScriptable:oo(n)?n:()=>n,isIndexable:oo(r)?r:()=>r}}const N3=(t,e)=>t?t+ry(e):e,hy=(t,e)=>ht(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function XS(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e)||e==="constructor")return t[e];const r=n();return t[e]=r,r}function P3(t,e,n){const{_proxy:r,_context:i,_subProxy:s,_descriptors:o}=t;let a=r[e];return oo(a)&&o.isScriptable(e)&&(a=M3(e,a,t,n)),Ft(a)&&a.length&&(a=L3(e,a,t,o.isIndexable)),hy(e,a)&&(a=uc(a,i,s&&s[e],o)),a}function M3(t,e,n,r){const{_proxy:i,_context:s,_subProxy:o,_stack:a}=n;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let c=e(s,o||r);return a.delete(t),hy(t,c)&&(c=dy(i._scopes,i,t,c)),c}function L3(t,e,n,r){const{_proxy:i,_context:s,_subProxy:o,_descriptors:a}=n;if(typeof s.index<"u"&&r(t))return e[s.index%e.length];if(ht(e[0])){const c=e,u=i._scopes.filter(l=>l!==c);e=[];for(const l of c){const h=dy(u,i,t,l);e.push(uc(h,s,o&&o[t],a))}}return e}function JS(t,e,n){return oo(t)?t(e,n):t}const B3=(t,e)=>t===!0?e:typeof t=="string"?ch(e,t):void 0;function D3(t,e,n,r,i){for(const s of e){const o=B3(n,s);if(o){t.add(o);const a=JS(o._fallback,n,i);if(typeof a<"u"&&a!==n&&a!==r)return a}else if(o===!1&&typeof r<"u"&&n!==r)return null}return!1}function dy(t,e,n,r){const i=e._rootScopes,s=JS(e._fallback,n,r),o=[...t,...i],a=new Set;a.add(r);let c=Wv(a,o,n,s||n,r);return c===null||typeof s<"u"&&s!==n&&(c=Wv(a,o,s,c,r),c===null)?!1:fy(Array.from(a),[""],i,s,()=>$3(e,n,r))}function Wv(t,e,n,r,i){for(;n;)n=D3(t,e,n,r,i);return n}function $3(t,e,n){const r=t._getTarget();e in r||(r[e]={});const i=r[e];return Ft(i)&&ht(n)?n:i||{}}function F3(t,e,n,r){let i;for(const s of e)if(i=QS(N3(s,t),n),typeof i<"u")return hy(t,i)?dy(n,r,t,i):i}function QS(t,e){for(const n of e){if(!n)continue;const r=n[t];if(typeof r<"u")return r}}function jv(t){let e=t._keys;return e||(e=t._keys=U3(t._scopes)),e}function U3(t){const e=new Set;for(const n of t)for(const r of Object.keys(n).filter(i=>!i.startsWith("_")))e.add(r);return Array.from(e)}const z3=Number.EPSILON||1e-14,lc=(t,e)=>e<t.length&&!t[e].skip&&t[e],eE=t=>t==="x"?"y":"x";function H3(t,e,n,r){const i=t.skip?e:t,s=e,o=n.skip?e:n,a=i0(s,i),c=i0(o,s);let u=a/(a+c),l=c/(a+c);u=isNaN(u)?0:u,l=isNaN(l)?0:l;const h=r*u,p=r*l;return{previous:{x:s.x-h*(o.x-i.x),y:s.y-h*(o.y-i.y)},next:{x:s.x+p*(o.x-i.x),y:s.y+p*(o.y-i.y)}}}function W3(t,e,n){const r=t.length;let i,s,o,a,c,u=lc(t,0);for(let l=0;l<r-1;++l)if(c=u,u=lc(t,l+1),!(!c||!u)){if(mu(e[l],0,z3)){n[l]=n[l+1]=0;continue}i=n[l]/e[l],s=n[l+1]/e[l],a=Math.pow(i,2)+Math.pow(s,2),!(a<=9)&&(o=3/Math.sqrt(a),n[l]=i*o*e[l],n[l+1]=s*o*e[l])}}function j3(t,e,n="x"){const r=eE(n),i=t.length;let s,o,a,c=lc(t,0);for(let u=0;u<i;++u){if(o=a,a=c,c=lc(t,u+1),!a)continue;const l=a[n],h=a[r];o&&(s=(l-o[n])/3,a[`cp1${n}`]=l-s,a[`cp1${r}`]=h-s*e[u]),c&&(s=(c[n]-l)/3,a[`cp2${n}`]=l+s,a[`cp2${r}`]=h+s*e[u])}}function K3(t,e="x"){const n=eE(e),r=t.length,i=Array(r).fill(0),s=Array(r);let o,a,c,u=lc(t,0);for(o=0;o<r;++o)if(a=c,c=u,u=lc(t,o+1),!!c){if(u){const l=u[e]-c[e];i[o]=l!==0?(u[n]-c[n])/l:0}s[o]=a?u?cc(i[o-1])!==cc(i[o])?0:(i[o-1]+i[o])/2:i[o-1]:i[o]}W3(t,i,s),j3(t,s,e)}function Gl(t,e,n){return Math.max(Math.min(t,n),e)}function V3(t,e){let n,r,i,s,o,a=us(t[0],e);for(n=0,r=t.length;n<r;++n)o=s,s=a,a=n<r-1&&us(t[n+1],e),s&&(i=t[n],o&&(i.cp1x=Gl(i.cp1x,e.left,e.right),i.cp1y=Gl(i.cp1y,e.top,e.bottom)),a&&(i.cp2x=Gl(i.cp2x,e.left,e.right),i.cp2y=Gl(i.cp2y,e.top,e.bottom)))}function q3(t,e,n,r,i){let s,o,a,c;if(e.spanGaps&&(t=t.filter(u=>!u.skip)),e.cubicInterpolationMode==="monotone")K3(t,i);else{let u=r?t[t.length-1]:t[0];for(s=0,o=t.length;s<o;++s)a=t[s],c=H3(u,a,t[Math.min(s+1,o-(r?0:1))%o],e.tension),a.cp1x=c.previous.x,a.cp1y=c.previous.y,a.cp2x=c.next.x,a.cp2y=c.next.y,u=a}e.capBezierPoints&&V3(t,n)}function py(){return typeof window<"u"&&typeof document<"u"}function gy(t){let e=t.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function dh(t,e,n){let r;return typeof t=="string"?(r=parseInt(t,10),t.indexOf("%")!==-1&&(r=r/100*e.parentNode[n])):r=t,r}const ud=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function G3(t,e){return ud(t).getPropertyValue(e)}const Y3=["top","right","bottom","left"];function na(t,e,n){const r={};n=n?"-"+n:"";for(let i=0;i<4;i++){const s=Y3[i];r[s]=parseFloat(t[e+"-"+s+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const Z3=(t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot);function X3(t,e){const n=t.touches,r=n&&n.length?n[0]:t,{offsetX:i,offsetY:s}=r;let o=!1,a,c;if(Z3(i,s,t.target))a=i,c=s;else{const u=e.getBoundingClientRect();a=r.clientX-u.left,c=r.clientY-u.top,o=!0}return{x:a,y:c,box:o}}function Oo(t,e){if("native"in t)return t;const{canvas:n,currentDevicePixelRatio:r}=e,i=ud(n),s=i.boxSizing==="border-box",o=na(i,"padding"),a=na(i,"border","width"),{x:c,y:u,box:l}=X3(t,n),h=o.left+(l&&a.left),p=o.top+(l&&a.top);let{width:g,height:y}=e;return s&&(g-=o.width+a.width,y-=o.height+a.height),{x:Math.round((c-h)/g*n.width/r),y:Math.round((u-p)/y*n.height/r)}}function J3(t,e,n){let r,i;if(e===void 0||n===void 0){const s=t&&gy(t);if(!s)e=t.clientWidth,n=t.clientHeight;else{const o=s.getBoundingClientRect(),a=ud(s),c=na(a,"border","width"),u=na(a,"padding");e=o.width-u.width-c.width,n=o.height-u.height-c.height,r=dh(a.maxWidth,s,"clientWidth"),i=dh(a.maxHeight,s,"clientHeight")}}return{width:e,height:n,maxWidth:r||lh,maxHeight:i||lh}}const Yl=t=>Math.round(t*10)/10;function Q3(t,e,n,r){const i=ud(t),s=na(i,"margin"),o=dh(i.maxWidth,t,"clientWidth")||lh,a=dh(i.maxHeight,t,"clientHeight")||lh,c=J3(t,e,n);let{width:u,height:l}=c;if(i.boxSizing==="content-box"){const p=na(i,"border","width"),g=na(i,"padding");u-=g.width+p.width,l-=g.height+p.height}return u=Math.max(0,u-s.width),l=Math.max(0,r?u/r:l-s.height),u=Yl(Math.min(u,o,c.maxWidth)),l=Yl(Math.min(l,a,c.maxHeight)),u&&!l&&(l=Yl(u/2)),(e!==void 0||n!==void 0)&&r&&c.height&&l>c.height&&(l=c.height,u=Yl(Math.floor(l*r))),{width:u,height:l}}function Kv(t,e,n){const r=e||1,i=Math.floor(t.height*r),s=Math.floor(t.width*r);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const o=t.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${t.height}px`,o.style.width=`${t.width}px`),t.currentDevicePixelRatio!==r||o.height!==i||o.width!==s?(t.currentDevicePixelRatio=r,o.height=i,o.width=s,t.ctx.setTransform(r,0,0,r,0,0),!0):!1}const eL=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};py()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return t}();function Vv(t,e){const n=G3(t,e),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function Io(t,e,n,r){return{x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}}function tL(t,e,n,r){return{x:t.x+n*(e.x-t.x),y:r==="middle"?n<.5?t.y:e.y:r==="after"?n<1?t.y:e.y:n>0?e.y:t.y}}function nL(t,e,n,r){const i={x:t.cp2x,y:t.cp2y},s={x:e.cp1x,y:e.cp1y},o=Io(t,i,n),a=Io(i,s,n),c=Io(s,e,n),u=Io(o,a,n),l=Io(a,c,n);return Io(u,l,n)}const rL=function(t,e){return{x(n){return t+t+e-n},setWidth(n){e=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,r){return n-r},leftForLtr(n,r){return n-r}}},iL=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function Xa(t,e,n){return t?rL(e,n):iL()}function tE(t,e){let n,r;(e==="ltr"||e==="rtl")&&(n=t.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=r)}function nE(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function rE(t){return t==="angle"?{between:WS,compare:t3,normalize:Jr}:{between:nu,compare:(e,n)=>e-n,normalize:e=>e}}function qv({start:t,end:e,count:n,loop:r,style:i}){return{start:t%n,end:e%n,loop:r&&(e-t+1)%n===0,style:i}}function sL(t,e,n){const{property:r,start:i,end:s}=n,{between:o,normalize:a}=rE(r),c=e.length;let{start:u,end:l,loop:h}=t,p,g;if(h){for(u+=c,l+=c,p=0,g=c;p<g&&o(a(e[u%c][r]),i,s);++p)u--,l--;u%=c,l%=c}return l<u&&(l+=c),{start:u,end:l,loop:h,style:t.style}}function oL(t,e,n){if(!n)return[t];const{property:r,start:i,end:s}=n,o=e.length,{compare:a,between:c,normalize:u}=rE(r),{start:l,end:h,loop:p,style:g}=sL(t,e,n),y=[];let w=!1,k=null,T,C,O;const I=()=>c(i,O,T)&&a(i,O)!==0,N=()=>a(s,T)===0||c(s,O,T),F=()=>w||I(),L=()=>!w||N();for(let D=l,H=l;D<=h;++D)C=e[D%o],!C.skip&&(T=u(C[r]),T!==O&&(w=c(T,i,s),k===null&&F()&&(k=a(T,i)===0?D:H),k!==null&&L()&&(y.push(qv({start:k,end:D,loop:p,count:o,style:g})),k=null),H=D,O=T));return k!==null&&y.push(qv({start:k,end:h,loop:p,count:o,style:g})),y}function aL(t,e){const n=[],r=t.segments;for(let i=0;i<r.length;i++){const s=oL(r[i],t.points,e);s.length&&n.push(...s)}return n}function cL(t,e,n,r){let i=0,s=e-1;if(n&&!r)for(;i<e&&!t[i].skip;)i++;for(;i<e&&t[i].skip;)i++;for(i%=e,n&&(s+=i);s>i&&t[s%e].skip;)s--;return s%=e,{start:i,end:s}}function uL(t,e,n,r){const i=t.length,s=[];let o=e,a=t[e],c;for(c=e+1;c<=n;++c){const u=t[c%i];u.skip||u.stop?a.skip||(r=!1,s.push({start:e%i,end:(c-1)%i,loop:r}),e=o=u.stop?c:null):(o=c,a.skip&&(e=c)),a=u}return o!==null&&s.push({start:e%i,end:o%i,loop:r}),s}function lL(t,e){const n=t.points,r=t.options.spanGaps,i=n.length;if(!i)return[];const s=!!t._loop,{start:o,end:a}=cL(n,i,s,r);if(r===!0)return Gv(t,[{start:o,end:a,loop:s}],n,e);const c=a<o?a+i:a,u=!!t._fullLoop&&o===0&&a===i-1;return Gv(t,uL(n,o,c,u),n,e)}function Gv(t,e,n,r){return!r||!r.setContext||!n?e:fL(t,e,n,r)}function fL(t,e,n,r){const i=t._chart.getContext(),s=Yv(t.options),{_datasetIndex:o,options:{spanGaps:a}}=t,c=n.length,u=[];let l=s,h=e[0].start,p=h;function g(y,w,k,T){const C=a?-1:1;if(y!==w){for(y+=c;n[y%c].skip;)y-=C;for(;n[w%c].skip;)w+=C;y%c!==w%c&&(u.push({start:y%c,end:w%c,loop:k,style:T}),l=T,h=w%c)}}for(const y of e){h=a?h:y.start;let w=n[h%c],k;for(p=h+1;p<=y.end;p++){const T=n[p%c];k=Yv(r.setContext(po(i,{type:"segment",p0:w,p1:T,p0DataIndex:(p-1)%c,p1DataIndex:p%c,datasetIndex:o}))),hL(k,l)&&g(h,p-1,y.loop,l),w=T,l=k}h<p-1&&g(h,p-1,y.loop,l)}return u}function Yv(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function hL(t,e){if(!e)return!1;const n=[],r=function(i,s){return ay(s)?(n.includes(s)||n.push(s),n.indexOf(s)):s};return JSON.stringify(t,r)!==JSON.stringify(e,r)}/*! 17 * Chart.js v4.4.3 18 * https://www.chartjs.org 19 * (c) 2024 Chart.js Contributors 20 * Released under the MIT License 21 */class dL{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,n,r,i){const s=n.listeners[i],o=n.duration;s.forEach(a=>a({chart:e,initial:n.initial,numSteps:o,currentStep:Math.min(r-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=KS.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const s=r.items;let o=s.length-1,a=!1,c;for(;o>=0;--o)c=s[o],c._active?(c._total>r.duration&&(r.duration=c._total),c.tick(e),a=!0):(s[o]=s[s.length-1],s.pop());a&&(i.draw(),this._notify(i,r,e,"progress")),s.length||(r.running=!1,this._notify(i,r,e,"complete"),r.initial=!1),n+=s.length}),this._lastDate=e,n===0&&(this._running=!1)}_getAnims(e){const n=this._charts;let r=n.get(e);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(e,r)),r}listen(e,n,r){this._getAnims(e).listeners[n].push(r)}add(e,n){!n||!n.length||this._getAnims(e).items.push(...n)}has(e){return this._getAnims(e).items.length>0}start(e){const n=this._charts.get(e);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,i)=>Math.max(r,i._duration),0),this._refresh())}running(e){if(!this._running)return!1;const n=this._charts.get(e);return!(!n||!n.running||!n.items.length)}stop(e){const n=this._charts.get(e);if(!n||!n.items.length)return;const r=n.items;let i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(e,n,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var Yi=new dL;const Zv="transparent",pL={boolean(t,e,n){return n>.5?e:t},color(t,e,n){const r=Uv(t||Zv),i=r.valid&&Uv(e||Zv);return i&&i.valid?i.mix(r,n).hexString():e},number(t,e,n){return t+(e-t)*n}};class gL{constructor(e,n,r,i){const s=n[r];i=ql([e.to,i,s,e.from]);const o=ql([e.from,s,i]);this._active=!0,this._fn=e.fn||pL[e.type||typeof o],this._easing=yu[e.easing]||yu.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=n,this._prop=r,this._from=o,this._to=i,this._promises=void 0}active(){return this._active}update(e,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],s=r-this._start,o=this._duration-s;this._start=r,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=s,this._loop=!!e.loop,this._to=ql([e.to,n,i,e.from]),this._from=ql([e.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const n=e-this._start,r=this._duration,i=this._prop,s=this._from,o=this._loop,a=this._to;let c;if(this._active=s!==a&&(o||n<r),!this._active){this._target[i]=a,this._notify(!0);return}if(n<0){this._target[i]=s;return}c=n/r%2,c=o&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[i]=this._fn(s,a,c)}wait(){const e=this._promises||(this._promises=[]);return new Promise((n,r)=>{e.push({res:n,rej:r})})}_notify(e){const n=e?"res":"rej",r=this._promises||[];for(let i=0;i<r.length;i++)r[i][n]()}}class iE{constructor(e,n){this._chart=e,this._properties=new Map,this.configure(n)}configure(e){if(!ht(e))return;const n=Object.keys(Vt.animation),r=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!ht(s))return;const o={};for(const a of n)o[a]=s[a];(Ft(s.properties)&&s.properties||[i]).forEach(a=>{(a===i||!r.has(a))&&r.set(a,o)})})}_animateOptions(e,n){const r=n.options,i=yL(e,r);if(!i)return[];const s=this._createAnimations(i,r);return r.$shared&&mL(e.options.$animations,r).then(()=>{e.options=r},()=>{}),s}_createAnimations(e,n){const r=this._properties,i=[],s=e.$animations||(e.$animations={}),o=Object.keys(n),a=Date.now();let c;for(c=o.length-1;c>=0;--c){const u=o[c];if(u.charAt(0)==="$")continue;if(u==="options"){i.push(...this._animateOptions(e,n));continue}const l=n[u];let h=s[u];const p=r.get(u);if(h)if(p&&h.active()){h.update(p,l,a);continue}else h.cancel();if(!p||!p.duration){e[u]=l;continue}s[u]=h=new gL(p,e,u,l),i.push(h)}return i}update(e,n){if(this._properties.size===0){Object.assign(e,n);return}const r=this._createAnimations(e,n);if(r.length)return Yi.add(this._chart,r),!0}}function mL(t,e){const n=[],r=Object.keys(e);for(let i=0;i<r.length;i++){const s=t[r[i]];s&&s.active()&&n.push(s.wait())}return Promise.all(n)}function yL(t,e){if(!e)return;let n=t.options;if(!n){t.options=e;return}return n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function Xv(t,e){const n=t&&t.options||{},r=n.reverse,i=n.min===void 0?e:0,s=n.max===void 0?e:0;return{start:r?s:i,end:r?i:s}}function vL(t,e,n){if(n===!1)return!1;const r=Xv(t,n),i=Xv(e,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function bL(t){let e,n,r,i;return ht(t)?(e=t.top,n=t.right,r=t.bottom,i=t.left):e=n=r=i=t,{top:e,right:n,bottom:r,left:i,disabled:t===!1}}function sE(t,e){const n=[],r=t._getSortedDatasetMetas(e);let i,s;for(i=0,s=r.length;i<s;++i)n.push(r[i].index);return n}function Jv(t,e,n,r={}){const i=t.keys,s=r.mode==="single";let o,a,c,u;if(e!==null){for(o=0,a=i.length;o<a;++o){if(c=+i[o],c===n){if(r.all)continue;break}u=t.values[c],xn(u)&&(s||e===0||cc(e)===cc(u))&&(e+=u)}return e}}function wL(t,e){const{iScale:n,vScale:r}=e,i=n.axis==="x"?"x":"y",s=r.axis==="x"?"x":"y",o=Object.keys(t),a=new Array(o.length);let c,u,l;for(c=0,u=o.length;c<u;++c)l=o[c],a[c]={[i]:l,[s]:t[l]};return a}function Qv(t,e){const n=t&&t.options.stacked;return n||n===void 0&&e.stack!==void 0}function _L(t,e,n){return`${t.id}
21.${e.id}.${n.stack||n.type}`}function kL(t){const{min:e,max:n,minDefined:r,maxDefined:i}=t.getUserBounds();return{min:r?e:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function SL(t,e,n){const r=t[e]||(t[e]={});return r[n]||(r[n]={})}function eb(t,e,n,r){for(const i of e.getMatchingVisibleMetas(r).reverse()){const s=t[i.index];if(n&&s>0||!n&&s<0)return i.index}return null}function tb(t,e){const{chart:n,_cachedMeta:r}=t,i=n._stacks||(n._stacks={}),{iScale:s,vScale:o,index:a}=r,c=s.axis,u=o.axis,l=_L(s,o,r),h=e.length;let p;for(let g=0;g<h;++g){const y=e[g],{[c]:w,[u]:k}=y,T=y._stacks||(y._stacks={});p=T[u]=SL(i,l,w),p[a]=k,p._top=eb(p,o,!0,r.type),p._bottom=eb(p,o,!1,r.type);const C=p._visualValues||(p._visualValues={});C[a]=k}}function Ip(t,e){const n=t.scales;return Object.keys(n).filter(r=>n[r].axis===e).shift()}function EL(t,e){return po(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function AL(t,e,n){return po(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}function Hc(t,e){const n=t.controller.index,r=t.vScale&&t.vScale.axis;if(r){e=e||t._parsed;for(const i of e){const s=i._stacks;if(!s||s[r]===void 0||s[r][n]===void 0)return;delete s[r][n],s[r]._visualValues!==void 0&&s[r]._visualValues[n]!==void 0&&delete s[r]._visualValues[n]}}}const Cp=t=>t==="reset"||t==="none",nb=(t,e)=>e?t:Object.assign({},t),xL=(t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:sE(n,!0),values:null};class bu{constructor(e,n){this.chart=e,this._ctx=e.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Qv(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&Hc(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(h,p,g,y)=>h==="x"?p:h==="r"?y:g,s=n.xAxisID=et(r.xAxisID,Ip(e,"x")),o=n.yAxisID=et(r.yAxisID,Ip(e,"y")),a=n.rAxisID=et(r.rAxisID,Ip(e,"r")),c=n.indexAxis,u=n.iAxisID=i(c,s,o,a),l=n.vAxisID=i(c,o,s,a);n.xScale=this.getScaleForId(s),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(u),n.vScale=this.getScaleForId(l)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const n=this._cachedMeta;return e===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&Dv(this._data,this),e._stacked&&Hc(e)}_dataCheck(){const e=this.getDataset(),n=e.data||(e.data=[]),r=this._data;if(ht(n)){const i=this._cachedMeta;this._data=wL(n,i)}else if(r!==n){if(r){Dv(r,this);const i=this._cachedMeta;Hc(i),i._parsed=[]}n&&Object.isExtensible(n)&&s3(n,this),this._syncList=[],this._data=n}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const n=this._cachedMeta,r=this.getDataset();let i=!1;this._dataCheck();const s=n._stacked;n._stacked=Qv(n.vScale,n),n.stack!==r.stack&&(i=!0,Hc(n),n.stack=r.stack),this._resyncElements(e),(i||s!==n._stacked)&&tb(this,n._parsed)}configure(){const e=this.chart.config,n=e.datasetScopeKeys(this._type),r=e.getOptionScopes(this.getDataset(),n,!0);this.options=e.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,n){const{_cachedMeta:r,_data:i}=this,{iScale:s,_stacked:o}=r,a=s.axis;let c=e===0&&n===i.length?!0:r._sorted,u=e>0&&r._parsed[e-1],l,h,p;
vendor: 4,831 bytes, line 21
21if(this._parsing===!1)r._parsed=i,r._sorted=!0,p=i;else{Ft(i[e])?p=this.parseArrayData(r,i,e,n):ht(i[e])?p=this.parseObjectData(r,i,e,n):p=this.parsePrimitiveData(r,i,e,n);const g=()=>h[a]===null||u&&h[a]<u[a];for(l=0;l<n;++l)r._parsed[l+e]=h=p[l],c&&(g()&&(c=!1),u=h);r._sorted=c}o&&tb(this,p)}parsePrimitiveData(e,n,r,i){const{iScale:s,vScale:o}=e,a=s.axis,c=o.axis,u=s.getLabels(),l=s===o,h=new Array(i);let p,g,y;for(p=0,g=i;p<g;++p)y=p+r,h[p]={[a]:l||s.parse(u[y],y),[c]:o.parse(n[y],y)};return h}parseArrayData(e,n,r,i){const{xScale:s,yScale:o}=e,a=new Array(i);let c,u,l,h;for(c=0,u=i;c<u;++c)l=c+r,h=n[l],a[c]={x:s.parse(h[0],l),y:o.parse(h[1],l)};return a}parseObjectData(e,n,r,i){const{xScale:s,yScale:o}=e,{xAxisKey:a="x",yAxisKey:c="y"}=this._parsing,u=new Array(i);let l,h,p,g;for(l=0,h=i;l<h;++l)p=l+r,g=n[p],u[l]={x:s.parse(ch(g,a),p),y:o.parse(ch(g,c),p)};return u}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,n,r){const i=this.chart,s=this._cachedMeta,o=n[e.axis],a={keys:sE(i,!0),values:n._stacks[e.axis]._visualValues};return Jv(a,o,s.index,{mode:r})}updateRangeFromParsed(e,n,r,i){const s=r[n.axis];let o=s===null?NaN:s;const a=i&&r._stacks[n.axis];i&&a&&(i.values=a,o=Jv(i,s,this._cachedMeta.index)),e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}getMinMax(e,n){const r=this._cachedMeta,i=r._parsed,s=r._sorted&&e===r.iScale,o=i.length,a=this._getOtherScale(e),c=xL(n,r,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:l,max:h}=kL(a);let p,g;function y(){g=i[p];const w=g[a.axis];return!xn(g[e.axis])||l>w||h<w}for(p=0;p<o&&!(!y()&&(this.updateRangeFromParsed(u,e,g,c),s));++p);if(s){for(p=o-1;p>=0;--p)if(!y()){this.updateRangeFromParsed(u,e,g,c);break}}return u}getAllParsedValues(e){const n=this._cachedMeta._parsed,r=[];let i,s,o;for(i=0,s=n.length;i<s;++i)o=n[i][e.axis],xn(o)&&r.push(o);return r}getMaxOverflow(){return!1}getLabelAndValue(e){const n=this._cachedMeta,r=n.iScale,i=n.vScale,s=this.getParsed(e);return{label:r?""+r.getLabelForValue(s[r.axis]):"",value:i?""+i.getLabelForValue(s[i.axis]):""}}_update(e){const n=this._cachedMeta;this.update(e||"default"),n._clip=bL(et(this.options.clip,vL(n.xScale,n.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,n=this.chart,r=this._cachedMeta,i=r.data||[],s=n.chartArea,o=[],a=this._drawStart||0,c=this._drawCount||i.length-a,u=this.options.drawActiveElementsOnTop;let l;for(r.dataset&&r.dataset.draw(e,s,a,c),l=a;l<a+c;++l){const h=i[l];h.hidden||(h.active&&u?o.push(h):h.draw(e,s))}for(l=0;l<o.length;++l)o[l].draw(e,s)}getStyle(e,n){const r=n?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(e||0,r)}getContext(e,n,r){const i=this.getDataset();let s;if(e>=0&&e<this._cachedMeta.data.length){const o=this._cachedMeta.data[e];s=o.$context||(o.$context=AL(this.getContext(),e,o)),s.parsed=this.getParsed(e),s.raw=i.data[e],s.index=s.dataIndex=e}else s=this.$context||(this.$context=EL(this.chart.getContext(),this.index)),s.dataset=i,s.index=s.datasetIndex=this.index;return s.active=!!n,s.mode=r,s}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,n){return this._resolveElementOptions(this.dataElementType.id,n,e)}_resolveElementOptions(e,n="default",r){const i=n==="active",s=this._cachedDataOpts,o=e+"-"+n,a=s[o],c=this.enableOptionSharing&&uh(r);if(a)return nb(a,c);const u=this.chart.config,l=u.datasetElementScopeKeys(this._type,e),h=i?[`${e}Hover`,"hover",e,""]:[e,""],p=u.getOptionScopes(this.getDataset(),l),g=Object.keys(Vt.elements[e]),y=()=>this.getContext(r,i,n),w=u.resolveNamedOptions(p,g,y,h);return w.$shared&&(w.$shared=c,s[o]=Object.freeze(nb(w,c))),w}_resolveAnimations(e,n,r){const i=this.chart,s=this._cachedDataOpts,o=`animation-${n}`,a=s[o];if(a)return a;let c;if(i.options.animation!==!1){const l=this.chart.config,h=l.datasetAnimationScopeKeys(this._type,n),p=l.getOptionScopes(this.getDataset(),h);c=l.createResolver(p,this.getContext(e,r,n))}const u=new iE(i,c&&c.animations);return c&&c._cacheable&&(s[o]=Object.freeze(u)),u}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,n){return!n||Cp(e)||this.chart._animationsDisabled}_getSharedOptions(e,n){const r=this.resolveDataElementOptions(e,n),i=this._sharedOptions,s=this.getSharedOptions(r),o=this.includeOptions(n,s)||s!==i;return this.updateSharedOptions(s,n,r),{sharedOptions:s,includeOptions:o}}updateElement(e,n,r,i){Cp(i)?Object.assign(e,r):this._resolveAnimations(n,i).update(e,r)}updateSharedOptions(e,n,r){e&&!Cp(n)&&this._resolveAnimations(void 0,n).update(e,r)}_setStyle(e,n,r,i){e.active=i;const s=this.getStyle(n,i);
vendor: 5,815 bytes, line 21
21this._resolveAnimations(n,r,i).update(e,{options:!i&&this.getSharedOptions(s)||s})}removeHoverStyle(e,n,r){this._setStyle(e,r,"active",!1)}setHoverStyle(e,n,r){this._setStyle(e,r,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const n=this._data,r=this._cachedMeta.data;for(const[a,c,u]of this._syncList)this[a](c,u);this._syncList=[];const i=r.length,s=n.length,o=Math.min(s,i);o&&this.parse(0,o),s>i?this._insertElements(i,s-i,e):s<i&&this._removeElements(s,i-s)}_insertElements(e,n,r=!0){const i=this._cachedMeta,s=i.data,o=e+n;let a;const c=u=>{for(u.length+=n,a=u.length-1;a>=o;a--)u[a]=u[a-n]};for(c(s),a=e;a<o;++a)s[a]=new this.dataElementType;this._parsing&&c(i._parsed),this.parse(e,n),r&&this.updateElements(s,e,n,"reset")}updateElements(e,n,r,i){}_removeElements(e,n){const r=this._cachedMeta;if(this._parsing){const i=r._parsed.splice(e,n);r._stacked&&Hc(r,i)}r.data.splice(e,n)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[n,r,i]=e;this[n](r,i)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,n){n&&this._sync(["_removeElements",e,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",e,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}De(bu,"defaults",{}),De(bu,"datasetElementType",null),De(bu,"dataElementType",null);class Tf extends bu{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const n=this._cachedMeta,{dataset:r,data:i=[],_dataset:s}=n,o=this.chart._animationsDisabled;let{start:a,count:c}=u3(n,i,o);this._drawStart=a,this._drawCount=c,l3(n)&&(a=0,c=i.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!s._decimated,r.points=i;const u=this.resolveDatasetElementOptions(e);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(r,void 0,{animated:!o,options:u},e),this.updateElements(i,a,c,e)}updateElements(e,n,r,i){const s=i==="reset",{iScale:o,vScale:a,_stacked:c,_dataset:u}=this._cachedMeta,{sharedOptions:l,includeOptions:h}=this._getSharedOptions(n,i),p=o.axis,g=a.axis,{spanGaps:y,segment:w}=this.options,k=zu(y)?y:Number.POSITIVE_INFINITY,T=this.chart._animationsDisabled||s||i==="none",C=n+r,O=e.length;let I=n>0&&this.getParsed(n-1);for(let N=0;N<O;++N){const F=e[N],L=T?F:{};if(N<n||N>=C){L.skip=!0;continue}const D=this.getParsed(N),H=Nt(D[g]),z=L[p]=o.getPixelForValue(D[p],N),K=L[g]=s||H?a.getBasePixel():a.getPixelForValue(c?this.applyStack(a,D,c):D[g],N);L.skip=isNaN(z)||isNaN(K)||H,L.stop=N>0&&Math.abs(D[p]-I[p])>k,w&&(L.parsed=D,L.raw=u.data[N]),h&&(L.options=l||this.resolveDataElementOptions(N,F.active?"active":i)),T||this.updateElement(F,N,L,i),I=D}}getMaxOverflow(){const e=this._cachedMeta,n=e.dataset,r=n.options&&n.options.borderWidth||0,i=e.data||[];if(!i.length)return r;const s=i[0].size(this.resolveDataElementOptions(0)),o=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,s,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}De(Tf,"id","line"),De(Tf,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),De(Tf,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function Eo(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class my{constructor(e){De(this,"options");this.options=e||{}}static override(e){Object.assign(my.prototype,e)}init(){}formats(){return Eo()}parse(){return Eo()}format(){return Eo()}add(){return Eo()}diff(){return Eo()}startOf(){return Eo()}endOf(){return Eo()}}var RL={_date:my};function TL(t,e,n,r){const{controller:i,data:s,_sorted:o}=t,a=i._cachedMeta.iScale;if(a&&e===a.axis&&e!=="r"&&o&&s.length){const c=a._reversePixels?r3:Ho;if(r){if(i._sharedOptions){const u=s[0],l=typeof u.getRange=="function"&&u.getRange(e);if(l){const h=c(s,e,n-l),p=c(s,e,n+l);return{lo:h.lo,hi:p.hi}}}}else return c(s,e,n)}return{lo:0,hi:s.length-1}}function ml(t,e,n,r,i){const s=t.getSortedVisibleDatasetMetas(),o=n[e];for(let a=0,c=s.length;a<c;++a){const{index:u,data:l}=s[a],{lo:h,hi:p}=TL(s[a],e,o,i);for(let g=h;g<=p;++g){const y=l[g];y.skip||r(y,u,g)}}}function OL(t){const e=t.indexOf("x")!==-1,n=t.indexOf("y")!==-1;return function(r,i){const s=e?Math.abs(r.x-i.x):0,o=n?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(o,2))}}function Np(t,e,n,r,i){const s=[];return!i&&!t.isPointInArea(e)||ml(t,n,e,function(a,c,u){!i&&!us(a,t.chartArea,0)||a.inRange(e.x,e.y,r)&&s.push({element:a,datasetIndex:c,index:u})},!0),s}function IL(t,e,n,r){let i=[];function s(o,a,c){const{startAngle:u,endAngle:l}=o.getProps(["startAngle","endAngle"],r),{angle:h}=e3(o,{x:e.x,y:e.y});WS(h,u,l)&&i.push({element:o,datasetIndex:a,index:c})}return ml(t,n,e,s),i}function CL(t,e,n,r,i,s){let o=[];const a=OL(n);let c=Number.POSITIVE_INFINITY;function u(l,h,p){const g=l.inRange(e.x,e.y,i);if(r&&!g)return;const y=l.getCenterPoint(i);if(!(!!s||t.isPointInArea(y))&&!g)return;const k=a(e,y);k<c?(o=[{element:l,datasetIndex:h,index:p}],c=k):k===c&&o.push({element:l,datasetIndex:h,index:p})}return ml(t,n,e,u),o}function Pp(t,e,n,r,i,s){return!s&&!t.isPointInArea(e)?[]:n==="r"&&!r?IL(t,e,n,i):CL(t,e,n,r,i,s)}function rb(t,e,n,r,i){const s=[],o=n==="x"?"inXRange":"inYRange";let a=!1;return ml(t,n,e,(c,u,l)=>{c[o](e[n],i)&&(s.push({element:c,datasetIndex:u,index:l}
vendor: 8,360 bytes, line 21
21),a=a||c.inRange(e.x,e.y,i))}),r&&!a?[]:s}var NL={evaluateInteractionItems:ml,modes:{index(t,e,n,r){const i=Oo(e,t),s=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?Np(t,i,s,r,o):Pp(t,i,s,!1,r,o),c=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(u=>{const l=a[0].index,h=u.data[l];h&&!h.skip&&c.push({element:h,datasetIndex:u.index,index:l})}),c):[]},dataset(t,e,n,r){const i=Oo(e,t),s=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?Np(t,i,s,r,o):Pp(t,i,s,!1,r,o);if(a.length>0){const c=a[0].datasetIndex,u=t.getDatasetMeta(c).data;a=[];for(let l=0;l<u.length;++l)a.push({element:u[l],datasetIndex:c,index:l})}return a},point(t,e,n,r){const i=Oo(e,t),s=n.axis||"xy",o=n.includeInvisible||!1;return Np(t,i,s,r,o)},nearest(t,e,n,r){const i=Oo(e,t),s=n.axis||"xy",o=n.includeInvisible||!1;return Pp(t,i,s,n.intersect,r,o)},x(t,e,n,r){const i=Oo(e,t);return rb(t,i,"x",n.intersect,r)},y(t,e,n,r){const i=Oo(e,t);return rb(t,i,"y",n.intersect,r)}}};const oE=["left","top","right","bottom"];function Wc(t,e){return t.filter(n=>n.pos===e)}function ib(t,e){return t.filter(n=>oE.indexOf(n.pos)===-1&&n.box.axis===e)}function jc(t,e){return t.sort((n,r)=>{const i=e?r:n,s=e?n:r;return i.weight===s.weight?i.index-s.index:i.weight-s.weight})}function PL(t){const e=[];let n,r,i,s,o,a;for(n=0,r=(t||[]).length;n<r;++n)i=t[n],{position:s,options:{stack:o,stackWeight:a=1}}=i,e.push({index:n,box:i,pos:s,horizontal:i.isHorizontal(),weight:i.weight,stack:o&&s+o,stackWeight:a});return e}function ML(t){const e={};for(const n of t){const{stack:r,pos:i,stackWeight:s}=n;if(!r||!oE.includes(i))continue;const o=e[r]||(e[r]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=s}return e}function LL(t,e){const n=ML(t),{vBoxMaxWidth:r,hBoxMaxHeight:i}=e;let s,o,a;for(s=0,o=t.length;s<o;++s){a=t[s];const{fullSize:c}=a.box,u=n[a.stack],l=u&&a.stackWeight/u.weight;a.horizontal?(a.width=l?l*r:c&&e.availableWidth,a.height=i):(a.width=r,a.height=l?l*i:c&&e.availableHeight)}return n}function BL(t){const e=PL(t),n=jc(e.filter(u=>u.box.fullSize),!0),r=jc(Wc(e,"left"),!0),i=jc(Wc(e,"right")),s=jc(Wc(e,"top"),!0),o=jc(Wc(e,"bottom")),a=ib(e,"x"),c=ib(e,"y");return{fullSize:n,leftAndTop:r.concat(s),rightAndBottom:i.concat(c).concat(o).concat(a),chartArea:Wc(e,"chartArea"),vertical:r.concat(i).concat(c),horizontal:s.concat(o).concat(a)}}function sb(t,e,n,r){return Math.max(t[n],e[n])+Math.max(t[r],e[r])}function aE(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function DL(t,e,n,r){const{pos:i,box:s}=n,o=t.maxPadding;if(!ht(i)){n.size&&(t[i]-=n.size);const h=r[n.stack]||{size:0,count:1};h.size=Math.max(h.size,n.horizontal?s.height:s.width),n.size=h.size/h.count,t[i]+=n.size}s.getPadding&&aE(o,s.getPadding());const a=Math.max(0,e.outerWidth-sb(o,t,"left","right")),c=Math.max(0,e.outerHeight-sb(o,t,"top","bottom")),u=a!==t.w,l=c!==t.h;return t.w=a,t.h=c,n.horizontal?{same:u,other:l}:{same:l,other:u}}function $L(t){const e=t.maxPadding;function n(r){const i=Math.max(e[r]-t[r],0);return t[r]+=i,i}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}function FL(t,e){const n=e.maxPadding;function r(i){const s={left:0,top:0,right:0,bottom:0};return i.forEach(o=>{s[o]=Math.max(e[o],n[o])}),s}return r(t?["left","right"]:["top","bottom"])}function ru(t,e,n,r){const i=[];let s,o,a,c,u,l;for(s=0,o=t.length,u=0;s<o;++s){a=t[s],c=a.box,c.update(a.width||e.w,a.height||e.h,FL(a.horizontal,e));const{same:h,other:p}=DL(e,n,a,r);u|=h&&i.length,l=l||p,c.fullSize||i.push(a)}return u&&ru(i,e,n,r)||l}function Zl(t,e,n,r,i){t.top=n,t.left=e,t.right=e+r,t.bottom=n+i,t.width=r,t.height=i}function ob(t,e,n,r){const i=n.padding;let{x:s,y:o}=e;for(const a of t){const c=a.box,u=r[a.stack]||{count:1,placed:0,weight:1},l=a.stackWeight/u.weight||1;if(a.horizontal){const h=e.w*l,p=u.size||c.height;uh(u.start)&&(o=u.start),c.fullSize?Zl(c,i.left,o,n.outerWidth-i.right-i.left,p):Zl(c,e.left+u.placed,o,h,p),u.start=o,u.placed+=h,o=c.bottom}else{const h=e.h*l,p=u.size||c.width;uh(u.start)&&(s=u.start),c.fullSize?Zl(c,s,i.top,p,n.outerHeight-i.bottom-i.top):Zl(c,s,e.top+u.placed,p,h),u.start=s,u.placed+=h,s=c.right}}e.x=s,e.y=o}var Ur={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(n){e.draw(n)}}]},t.boxes.push(e)},removeBox(t,e){const n=t.boxes?t.boxes.indexOf(e):-1;n!==-1&&t.boxes.splice(n,1)},configure(t,e,n){e.fullSize=n.fullSize,e.position=n.position,e.weight=n.weight},update(t,e,n,r){if(!t)return;const i=Vn(t.options.layout.padding),s=Math.max(e-i.width,0),o=Math.max(n-i.height,0),a=BL(t.boxes),c=a.vertical,u=a.horizontal;yt(t.boxes,w=>{typeof w.beforeLayout=="function"&&w.beforeLayout()});const l=c.reduce((w,k)=>k.box.options&&k.box.options.display===!1?w:w+1,0)||1,h=Object.freeze({outerWidth:e,outerHeight:n,padding:i,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/l,hBoxMaxHeight:o/2}),p=Object.assign({},i);aE(p,Vn(r));const g=Object.assign({maxPadding:p,w:s,h:o,x:i.left,y:i.top},i),y=LL(c.concat(u),h);ru(a.fullSize,g,h,y),ru(c,g,h,y),ru(u,g,h,y)&&ru(c,g,h,y),$L(g),ob(a.leftAndTop,g,h,y),g.x+=g.w,g.y+=g.h,ob(a.rightAndBottom,g,h,y),t.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},yt(a.chartArea,w=>{const k=w.box;Object.assign(k,t.chartArea),k.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class cE{acquireContext(e,n){}releaseContext(e){return!1}addEventListener(e,n,r){}removeEventListener(e,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(e,n,r,i){return n=Math.max(0,n||e.width),r=r||e.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(e){return!0}updateConfig(e){}}class UL extends cE{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const Of="$chartjs",zL={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ab=t=>t===null||t==="";function HL(t,e){const n=t.style,r=t.getAttribute("height"),i=t.getAttribute("width");if(t[Of]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",ab(i)){const s=Vv(t,"width");s!==void 0&&(t.width=s)}if(ab(r))if(t.style.height==="")t.height=t.width/(e||2);else{const s=Vv(t,"height");s!==void 0&&(t.height=s)}return t}const uE=eL?{passive:!0}:!1;function WL(t,e,n){t&&t.addEventListener(e,n,uE)}function jL(t,e,n){t&&t.canvas&&t.canvas.removeEventListener(e,n,uE)}function KL(t,e){const n=zL[t.type]||t.type,{x:r,y:i}=Oo(t,e);return{type:n,chart:e,native:t,x:r!==void 0?r:null,y:i!==void 0?i:null}}function ph(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function VL(t,e,n){const r=t.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||ph(a.addedNodes,r),o=o&&!ph(a.removedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function qL(t,e,n){const r=t.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||ph(a.removedNodes,r),o=o&&!ph(a.addedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const Hu=new Map;let cb=0;function lE(){const t=window.devicePixelRatio;t!==cb&&(cb=t,Hu.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function GL(t,e){Hu.size||window.addEventListener("resize",lE),Hu.set(t,e)}function YL(t){Hu.delete(t),Hu.size||window.removeEventListener("resize",lE)}function ZL(t,e,n){const r=t.canvas,i=r&&gy(r);if(!i)return;const s=VS((a,c)=>{const u=i.clientWidth;n(a,c),u<i.clientWidth&&n()},window),o=new ResizeObserver(a=>{const c=a[0],u=c.contentRect.width,l=c.contentRect.height;u===0&&l===0||s(u,l)});return o.observe(i),GL(t,s),o}function Mp(t,e,n){n&&n.disconnect(),e==="resize"&&YL(t)}function XL(t,e,n){const r=t.canvas,i=VS(s=>{t.ctx!==null&&n(KL(s,t))},t);return WL(r,e,i),i}class JL extends cE{acquireContext(e,n){const r=e&&e.getContext&&e.getContext("2d");return r&&r.canvas===e?(HL(e,n),r):null}releaseContext(e){const n=e.canvas;if(!n[Of])return!1;const r=n[Of].initial;["height","width"].forEach(s=>{const o=r[s];Nt(o)?n.removeAttribute(s):n.setAttribute(s,o)});const i=r.style||{};
vendor: 5,847 bytes, line 21
21return Object.keys(i).forEach(s=>{n.style[s]=i[s]}),n.width=n.width,delete n[Of],!0}addEventListener(e,n,r){this.removeEventListener(e,n);const i=e.$proxies||(e.$proxies={}),o={attach:VL,detach:qL,resize:ZL}[n]||XL;i[n]=o(e,n,r)}removeEventListener(e,n){const r=e.$proxies||(e.$proxies={}),i=r[n];if(!i)return;({attach:Mp,detach:Mp,resize:Mp}[n]||jL)(e,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,n,r,i){return Q3(e,n,r,i)}isAttached(e){const n=e&&gy(e);return!!(n&&n.isConnected)}}function QL(t){return!py()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?UL:JL}var _f;let ba=(_f=class{constructor(){De(this,"x");De(this,"y");De(this,"active",!1);De(this,"options");De(this,"$animations")}tooltipPosition(e){const{x:n,y:r}=this.getProps(["x","y"],e);return{x:n,y:r}}hasValue(){return zu(this.x)&&zu(this.y)}getProps(e,n){const r=this.$animations;if(!n||!r)return this;const i={};return e.forEach(s=>{i[s]=r[s]&&r[s].active()?r[s]._to:this[s]}),i}},De(_f,"defaults",{}),De(_f,"defaultRoutes"),_f);function eB(t,e){const n=t.options.ticks,r=tB(t),i=Math.min(n.maxTicksLimit||r,r),s=n.major.enabled?rB(e):[],o=s.length,a=s[0],c=s[o-1],u=[];if(o>i)return iB(e,u,s,o/i),u;const l=nB(s,e,i);if(o>0){let h,p;const g=o>1?Math.round((c-a)/(o-1)):null;for(Xl(e,u,l,Nt(g)?0:a-g,a),h=0,p=o-1;h<p;h++)Xl(e,u,l,s[h],s[h+1]);return Xl(e,u,l,c,Nt(g)?e.length:c+g),u}return Xl(e,u,l),u}function tB(t){const e=t.options.offset,n=t._tickSize(),r=t._length/n+(e?0:1),i=t._maxLength/n;return Math.floor(Math.min(r,i))}function nB(t,e,n){const r=sB(t),i=e.length/n;if(!r)return Math.max(i,1);const s=JM(r);for(let o=0,a=s.length-1;o<a;o++){const c=s[o];if(c>i)return c}return Math.max(i,1)}function rB(t){const e=[];let n,r;for(n=0,r=t.length;n<r;n++)t[n].major&&e.push(n);return e}function iB(t,e,n,r){let i=0,s=n[0],o;for(r=Math.ceil(r),o=0;o<t.length;o++)o===s&&(e.push(t[o]),i++,s=n[i*r])}function Xl(t,e,n,r,i){const s=et(r,0),o=Math.min(et(i,t.length),t.length);let a=0,c,u,l;for(n=Math.ceil(n),i&&(c=i-r,n=c/Math.floor(c/n)),l=s;l<0;)a++,l=Math.round(s+a*n);for(u=Math.max(s,0);u<o;u++)u===l&&(e.push(t[u]),a++,l=Math.round(s+a*n))}function sB(t){const e=t.length;let n,r;if(e<2)return!1;for(r=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==r)return!1;return r}const oB=t=>t==="left"?"right":t==="right"?"left":t,ub=(t,e,n)=>e==="top"||e==="left"?t[e]+n:t[e]-n,lb=(t,e)=>Math.min(e||t,t);function fb(t,e){const n=[],r=t.length/e,i=t.length;let s=0;for(;s<i;s+=r)n.push(t[Math.floor(s)]);return n}function aB(t,e,n){const r=t.ticks.length,i=Math.min(e,r-1),s=t._startPixel,o=t._endPixel,a=1e-6;let c=t.getPixelForTick(i),u;if(!(n&&(r===1?u=Math.max(c-s,o-c):e===0?u=(t.getPixelForTick(1)-c)/2:u=(c-t.getPixelForTick(i-1))/2,c+=i<e?u:-u,c<s-a||c>o+a)))return c}function cB(t,e){yt(t,n=>{const r=n.gc,i=r.length/2;let s;if(i>e){for(s=0;s<i;++s)delete n.data[r[s]];r.splice(0,i)}})}function Kc(t){return t.drawTicks?t.tickLength:0}function hb(t,e){if(!t.display)return 0;const n=_n(t.font,e),r=Vn(t.padding);return(Ft(t.text)?t.text.length:1)*n.lineHeight+r.height}function uB(t,e){return po(t,{scale:e,type:"scale"})}function lB(t,e,n){return po(t,{tick:n,index:e,type:"tick"})}function fB(t,e,n){let r=oy(t);return(n&&e!=="right"||!n&&e==="right")&&(r=oB(r)),r}function hB(t,e,n,r){const{top:i,left:s,bottom:o,right:a,chart:c}=t,{chartArea:u,scales:l}=c;let h=0,p,g,y;const w=o-i,k=a-s;if(t.isHorizontal()){if(g=Wn(r,s,a),ht(n)){const T=Object.keys(n)[0],C=n[T];y=l[T].getPixelForValue(C)+w-e}else n==="center"?y=(u.bottom+u.top)/2+w-e:y=ub(t,n,e);p=a-s}else{if(ht(n)){const T=Object.keys(n)[0],C=n[T];g=l[T].getPixelForValue(C)-k+e}else n==="center"?g=(u.left+u.right)/2-k+e:g=ub(t,n,e);y=Wn(r,o,i),h=n==="left"?-xr:xr}return{titleX:g,titleY:y,maxWidth:p,rotation:h}}class wa extends ba{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,n){return e}getUserBounds(){let{_userMin:e,_userMax:n,_suggestedMin:r,_suggestedMax:i}=this;return e=mr(e,Number.POSITIVE_INFINITY),n=mr(n,Number.NEGATIVE_INFINITY),r=mr(r,Number.POSITIVE_INFINITY),i=mr(i,Number.NEGATIVE_INFINITY),{min:mr(e,r),max:mr(n,i),minDefined:xn(e),maxDefined:xn(n)}}getMinMax(e){let{min:n,max:r,minDefined:i,maxDefined:s}=this.getUserBounds(),o;if(i&&s)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let c=0,u=a.length;c<u;++c)o=a[c].controller.getMinMax(this,e),i||(n=Math.min(n,o.min)),s||(r=Math.max(r,o.max));return n=s&&n>r?r:n,r=i&&n>r?n:r,{min:mr(n,mr(r,n)),max:mr(r,mr(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}
vendor: 60,620 bytes, lines 21-23
21getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){At(this.options.beforeUpdate,[this])}update(e,n,r){const{beginAtZero:i,grace:s,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=C3(this,s,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=a<this.ticks.length;this._convertTicksToLabels(c?fb(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=eB(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,e=!e),this._startPixel=n,this._endPixel=r,this._reversePixels=e,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){At(this.options.afterUpdate,[this])}beforeSetDimensions(){At(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){At(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),At(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){At(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const n=this.options.ticks;let r,i,s;for(r=0,i=e.length;r<i;r++)s=e[r],s.label=At(n.callback,[s.value,r,e],this)}afterTickToLabelConversion(){At(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){At(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,n=e.ticks,r=lb(this.ticks.length,e.ticks.maxTicksLimit),i=n.minRotation||0,s=n.maxRotation;let o=i,a,c,u;if(!this._isVisible()||!n.display||i>=s||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const l=this._getLabelSizes(),h=l.widest.width,p=l.highest.height,g=Fr(this.chart.width-h,0,this.maxWidth);a=e.offset?this.maxWidth/r:g/(r-1),h+6>a&&(a=g/(r-(e.offset?.5:1)),c=this.maxHeight-Kc(e.grid)-n.padding-hb(e.title,this.chart.options.font),u=Math.sqrt(h*h+p*p),o=iy(Math.min(Math.asin(Fr((l.highest.height+6)/a,-1,1)),Math.asin(Fr(c/u,-1,1))-Math.asin(Fr(p/u,-1,1)))),o=Math.max(i,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){At(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){At(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:s}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const c=hb(i,n.options.font);if(a?(e.width=this.maxWidth,e.height=Kc(s)+c):(e.height=this.maxHeight,e.width=Kc(s)+c),r.display&&this.ticks.length){const{first:u,last:l,widest:h,highest:p}=this._getLabelSizes(),g=r.padding*2,y=Us(this.labelRotation),w=Math.cos(y),k=Math.sin(y);if(a){const T=r.mirror?0:k*h.width+w*p.height;e.height=Math.min(this.maxHeight,e.height+T+g)}else{const T=r.mirror?0:w*h.width+k*p.height;e.width=Math.min(this.maxWidth,e.width+T+g)}this._calculatePadding(u,l,k,w)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,n,r,i){const{ticks:{align:s,padding:o},position:a}=this.options,c=this.labelRotation!==0,u=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const l=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let p=0,g=0;c?u?(p=i*e.width,g=r*n.height):(p=r*e.height,g=i*n.width):s==="start"?g=n.width:s==="end"?p=e.width:s!=="inner"&&(p=e.width/2,g=n.width/2),this.paddingLeft=Math.max((p-l+o)*this.width/(this.width-l),0),this.paddingRight=Math.max((g-h+o)*this.width/(this.width-h),0)}else{let l=n.height/2,h=e.height/2;s==="start"?(l=0,h=e.height):s==="end"&&(l=n.height,h=0),this.paddingTop=l+o,this.paddingBottom=h+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){At(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:n}=this.options;return n==="top"||n==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let n,r;for(n=0,r=e.length;n<r;n++)Nt(e[n].label)&&(e.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=fb(r,n)),this._labelSizes=e=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,n,r){const{ctx:i,_longestTextCache:s}=this,o=[],a=[],c=Math.floor(n/lb(n,r));let u=0,l=0,h,p,g,y,w,k,T,C,O,I,N;for(h=0;h<n;h+=c){if(y=e[h].label,w=this._resolveTickFontOptions(h),i.font=k=w.string,T=s[k]=s[k]||{data:{},gc:[]},C=w.lineHeight,O=I=0,!Nt(y)&&!Ft(y))O=fh(i,T.data,T.gc,O,y),I=C;else if(Ft(y))for(p=0,g=y.length;p<g;++p)N=y[p],!Nt(N)&&!Ft(N)&&(O=fh(i,T.data,T.gc,O,N),I+=C);o.push(O),a.push(I),u=Math.max(O,u),l=Math.max(I,l)}cB(s,n);const F=o.indexOf(u),L=a.indexOf(l),D=H=>({width:o[H]||0,height:a[H]||0});return{first:D(0),last:D(n-1),widest:D(F),highest:D(L),widths:o,heights:a}}getLabelForValue(e){return e}getPixelForValue(e,n){return NaN}getValueForPixel(e){}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const n=this._startPixel+e*this._length;return n3(this._alignToPixels?So(this.chart,n,0):n)}getDecimalForPixel(e){const n=(e-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:n}=this;return e<0&&n<0?n:e>0&&n>0?e:0}getContext(e){const n=this.ticks||[];if(e>=0&&e<n.length){const r=n[e];return r.$context||(r.$context=lB(this.getContext(),e,r))}return this.$context||(this.$context=uB(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,n=Us(this.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),s=this._getLabelSizes(),o=e.autoSkipPadding||0,a=s?s.widest.width+o:0,c=s?s.highest.height+o:0;return this.isHorizontal()?c*r>a*i?a/r:c/i:c*i<a*r?c/r:a/i}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const n=this.axis,r=this.chart,i=this.options,{grid:s,position:o,border:a}=i,c=s.offset,u=this.isHorizontal(),h=this.ticks.length+(c?1:0),p=Kc(s),g=[],y=a.setContext(this.getContext()),w=y.display?y.width:0,k=w/2,T=function(v){return So(r,v,w)};let C,O,I,N,F,L,D,H,z,K,_,m;if(o==="top")C=T(this.bottom),L=this.bottom-p,H=C-k,K=T(e.top)+k,m=e.bottom;else if(o==="bottom")C=T(this.top),K=e.top,m=T(e.bottom)-k,L=C+k,H=this.top+p;else if(o==="left")C=T(this.right),F=this.right-p,D=C-k,z=T(e.left)+k,_=e.right;else if(o==="right")C=T(this.left),z=e.left,_=T(e.right)-k,F=C+k,D=this.left+p;else if(n==="x"){if(o==="center")C=T((e.top+e.bottom)/2+.5);else if(ht(o)){const v=Object.keys(o)[0],b=o[v];C=T(this.chart.scales[v].getPixelForValue(b))}K=e.top,m=e.bottom,L=C+k,H=L+p}else if(n==="y"){if(o==="center")C=T((e.left+e.right)/2);else if(ht(o)){const v=Object.keys(o)[0],b=o[v];C=T(this.chart.scales[v].getPixelForValue(b))}F=C-k,D=F-p,z=e.left,_=e.right}const f=et(i.ticks.maxTicksLimit,h),d=Math.max(1,Math.ceil(h/f));for(O=0;O<h;O+=d){const v=this.getContext(O),b=s.setContext(v),E=a.setContext(v),x=b.lineWidth,M=b.color,P=E.dash||[],S=E.dashOffset,$=b.tickWidth,ie=b.tickColor,le=b.tickBorderDash||[],se=b.tickBorderDashOffset;I=aB(this,O,c),I!==void 0&&(N=So(r,I,x),u?F=D=z=_=N:L=H=K=m=N,g.push({tx1:F,ty1:L,tx2:D,ty2:H,x1:z,y1:K,x2:_,y2:m,width:x,color:M,borderDash:P,borderDashOffset:S,tickWidth:$,tickColor:ie,tickBorderDash:le,tickBorderDashOffset:se}))}return this._ticksLength=h,this._borderValue=C,g}_computeLabelItems(e){const n=this.axis,r=this.options,{position:i,ticks:s}=r,o=this.isHorizontal(),a=this.ticks,{align:c,crossAlign:u,padding:l,mirror:h}=s,p=Kc(r.grid),g=p+l,y=h?-l:g,w=-Us(this.labelRotation),k=[];let T,C,O,I,N,F,L,D,H,z,K,_,m="middle";if(i==="top")F=this.bottom-y,L=this._getXAxisLabelAlignment();else if(i==="bottom")F=this.top+y,L=this._getXAxisLabelAlignment();else if(i==="left"){const d=this._getYAxisLabelAlignment(p);L=d.textAlign,N=d.x}else if(i==="right"){const d=this._getYAxisLabelAlignment(p);L=d.textAlign,N=d.x}else if(n==="x"){if(i==="center")F=(e.top+e.bottom)/2+g;else if(ht(i)){const d=Object.keys(i)[0],v=i[d];F=this.chart.scales[d].getPixelForValue(v)+g}L=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")N=(e.left+e.right)/2-g;else if(ht(i)){const d=Object.keys(i)[0],v=i[d];N=this.chart.scales[d].getPixelForValue(v)}L=this._getYAxisLabelAlignment(p).textAlign}n==="y"&&(c==="start"?m="top":c==="end"&&(m="bottom"));const f=this._getLabelSizes();for(T=0,C=a.length;T<C;++T){O=a[T],I=O.label;const d=s.setContext(this.getContext(T));D=this.getPixelForTick(T)+s.labelOffset,H=this._resolveTickFontOptions(T),z=H.lineHeight,K=Ft(I)?I.length:1;const v=K/2,b=d.color,E=d.textStrokeColor,x=d.textStrokeWidth;let M=L;o?(N=D,L==="inner"&&(T===C-1?M=this.options.reverse?"left":"right":T===0?M=this.options.reverse?"right":"left":M="center"),i==="top"?u==="near"||w!==0?_=-K*z+z/2:u==="center"?_=-f.highest.height/2-v*z+z:_=-f.highest.height+z/2:u==="near"||w!==0?_=z/2:u==="center"?_=f.highest.height/2-v*z:_=f.highest.height-K*z,h&&(_*=-1),w!==0&&!d.showLabelBackdrop&&(N+=z/2*Math.sin(w))):(F=D,_=(1-K)*z/2);let P;if(d.showLabelBackdrop){const S=Vn(d.backdropPadding),$=f.heights[T],ie=f.widths[T];let le=_-S.top,se=0-S.left;switch(m){case"middle":le-=$/2;break;case"bottom":le-=$;break}switch(L){case"center":se-=ie/2;break;case"right":se-=ie;break;case"inner":T===C-1?se-=ie:T>0&&(se-=ie/2);break}P={left:se,top:le,width:ie+S.width,height:$+S.height,color:d.backdropColor}}k.push({label:I,font:H,textOffset:_,options:{rotation:w,color:b,strokeColor:E,strokeWidth:x,textAlign:M,textBaseline:m,translation:[N,F],backdrop:P}})}return k}_getXAxisLabelAlignment(){const{position:e,ticks:n}=this.options;if(-Us(this.labelRotation))return e==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(e){const{position:n,ticks:{crossAlign:r,mirror:i,padding:s}}=this.options,o=this._getLabelSizes(),a=e+s,c=o.widest.width;let u,l;return n==="left"?i?(l=this.right+s,r==="near"?u="left":r==="center"?(u="center",l+=c/2):(u="right",l+=c)):(l=this.right-a,r==="near"?u="right":r==="center"?(u="center",l-=c/2):(u="left",l=this.left)):n==="right"?i?(l=this.left+s,r==="near"?u="right":r==="center"?(u="center",l-=c/2):(u="left",l-=c)):(l=this.left+a,r==="near"?u="left":r==="center"?(u="center",l+=c/2):(u="right",l=this.right)):u="right",{textAlign:u,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:n},left:r,top:i,width:s,height:o}=this;n&&(e.save(),e.fillStyle=n,e.fillRect(r,i,s,o),e.restore())}getLineWidthForValue(e){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(s=>s.value===e);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(e){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let s,o;const a=(c,u,l)=>{!l.width||!l.color||(r.save(),r.lineWidth=l.width,r.strokeStyle=l.color,r.setLineDash(l.borderDash||[]),r.lineDashOffset=l.borderDashOffset,r.beginPath(),r.moveTo(c.x,c.y),r.lineTo(u.x,u.y),r.stroke(),r.restore())};if(n.display)for(s=0,o=i.length;s<o;++s){const c=i[s];n.drawOnChartArea&&a({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),n.drawTicks&&a({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:n,options:{border:r,grid:i}}=this,s=r.setContext(this.getContext()),o=r.display?s.width:0;if(!o)return;const a=i.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let u,l,h,p;this.isHorizontal()?(u=So(e,this.left,o)-o/2,l=So(e,this.right,a)+a/2,h=p=c):(h=So(e,this.top,o)-o/2,p=So(e,this.bottom,a)+a/2,u=l=c),n.save(),n.lineWidth=s.width,n.strokeStyle=s.color,n.beginPath(),n.moveTo(u,h),n.lineTo(l,p),n.stroke(),n.restore()}drawLabels(e){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&uy(r,i);const s=this.getLabelItems(e);for(const o of s){const a=o.options,c=o.font,u=o.label,l=o.textOffset;oa(r,u,0,l,c,a)}i&&ly(r)}drawTitle(){const{ctx:e,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const s=_n(r.font),o=Vn(r.padding),a=r.align;let c=s.lineHeight/2;n==="bottom"||n==="center"||ht(n)?(c+=o.bottom,Ft(r.text)&&(c+=s.lineHeight*(r.text.length-1))):c+=o.top;const{titleX:u,titleY:l,maxWidth:h,rotation:p}=hB(this,c,n,a);oa(e,r.text,0,0,s,{color:r.color,maxWidth:h,rotation:p,textAlign:fB(a,n,i),textBaseline:"middle",translation:[u,l]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,n=e.ticks&&e.ticks.z||0,r=et(e.grid&&e.grid.z,-1),i=et(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==wa.prototype.draw?[{z:n,draw:s=>{this.draw(s)}}]:[{z:r,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let s,o;for(s=0,o=n.length;s<o;++s){const a=n[s];a[r]===this.id&&(!e||a.type===e)&&i.push(a)}return i}_resolveTickFontOptions(e){const n=this.options.ticks.setContext(this.getContext(e));return _n(n.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class Jl{constructor(e,n,r){this.type=e,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const n=Object.getPrototypeOf(e);let r;gB(n)&&(r=this.register(n));const i=this.items,s=e.id,o=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+e);return s in i||(i[s]=e,dB(e,o,r),this.override&&Vt.override(e.id,e.overrides)),o}get(e){return this.items[e]}unregister(e){const n=this.items,r=e.id,i=this.scope;r in n&&delete n[r],i&&r in Vt[i]&&(delete Vt[i][r],this.override&&delete sa[r])}}function dB(t,e,n){const r=Uu(Object.create(null),[n?Vt.get(n):{},Vt.get(e),t.defaults]);Vt.set(e,r),t.defaultRoutes&&pB(e,t.defaultRoutes),t.descriptors&&Vt.describe(e,t.descriptors)}function pB(t,e){Object.keys(e).forEach(n=>{const r=n.split("."),i=r.pop(),s=[t].concat(r).join("."),o=e[n].split("."),a=o.pop(),c=o.join(".");Vt.route(s,i,c,a)})}function gB(t){return"id"in t&&"defaults"in t}class mB{constructor(){this.controllers=new Jl(bu,"datasets",!0),this.elements=new Jl(ba,"elements"),this.plugins=new Jl(Object,"plugins"),this.scales=new Jl(wa,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,n,r){[...n].forEach(i=>{const s=r||this._getRegistryForType(i);r||s.isForType(i)||s===this.plugins&&i.id?this._exec(e,s,i):yt(i,o=>{const a=r||this._getRegistryForType(o);this._exec(e,a,o)})})}_exec(e,n,r){const i=ry(e);At(r["before"+i],[],r),n[e](r),At(r["after"+i],[],r)}_getRegistryForType(e){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(e))return r}return this.plugins}_get(e,n,r){const i=n.get(e);if(i===void 0)throw new Error('"'+e+'" is not a registered '+r+".");return i}}var yi=new mB;class yB{constructor(){this._init=[]}notify(e,n,r,i){n==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const s=i?this._descriptors(e).filter(i):this._descriptors(e),o=this._notify(s,e,n,r);return n==="afterDestroy"&&(this._notify(s,e,"stop"),this._notify(this._init,e,"uninstall")),o}_notify(e,n,r,i){i=i||{};for(const s of e){const o=s.plugin,a=o[r],c=[n,i,s.options];if(At(a,c,o)===!1&&i.cancelable)return!1}return!0}invalidate(){Nt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),n}_createDescriptors(e,n){const r=e&&e.config,i=et(r.options&&r.options.plugins,{}),s=vB(r);return i===!1&&!n?[]:wB(e,s,i,n)}_notifyStateChanges(e){const n=this._oldCache||[],r=this._cache,i=(s,o)=>s.filter(a=>!o.some(c=>a.plugin.id===c.plugin.id));this._notify(i(n,r),e,"stop"),this._notify(i(r,n),e,"start")}}function vB(t){const e={},n=[],r=Object.keys(yi.plugins.items);for(let s=0;s<r.length;s++)n.push(yi.getPlugin(r[s]));const i=t.plugins||[];for(let s=0;s<i.length;s++){const o=i[s];n.indexOf(o)===-1&&(n.push(o),e[o.id]=!0)}return{plugins:n,localIds:e}}function bB(t,e){return!e&&t===!1?null:t===!0?{}:t}function wB(t,{plugins:e,localIds:n},r,i){const s=[],o=t.getContext();for(const a of e){const c=a.id,u=bB(r[c],i);u!==null&&s.push({plugin:a,options:_B(t.config,{plugin:a,local:n[c]},u,o)})}return s}function _B(t,{plugin:e,local:n},r,i){const s=t.pluginScopeKeys(e),o=t.getOptionScopes(r,s);return n&&e.defaults&&o.push(e.defaults),t.createResolver(o,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function a0(t,e){const n=Vt.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function kB(t,e){let n=t;return t==="_index_"?n=e:t==="_value_"&&(n=e==="x"?"y":"x"),n}function SB(t,e){return t===e?"_index_":"_value_"}function db(t){if(t==="x"||t==="y"||t==="r")return t}function EB(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function c0(t,...e){if(db(t))return t;for(const n of e){const r=n.axis||EB(n.position)||t.length>1&&db(t[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function pb(t,e,n){if(n[e+"AxisID"]===t)return{axis:e}}function AB(t,e){if(e.data&&e.data.datasets){const n=e.data.datasets.filter(r=>r.xAxisID===t||r.yAxisID===t);if(n.length)return pb(t,"x",n[0])||pb(t,"y",n[0])}return{}}function xB(t,e){const n=sa[t.type]||{scales:{}},r=e.scales||{},i=a0(t.type,e),s=Object.create(null);return Object.keys(r).forEach(o=>{const a=r[o];if(!ht(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const c=c0(o,a,AB(o,t),Vt.scales[a.type]),u=SB(c,i),l=n.scales||{};s[o]=gu(Object.create(null),[{axis:c},a,l[c],l[u]])}),t.data.datasets.forEach(o=>{const a=o.type||t.type,c=o.indexAxis||a0(a,e),l=(sa[a]||{}).scales||{};Object.keys(l).forEach(h=>{const p=kB(h,c),g=o[p+"AxisID"]||p;s[g]=s[g]||Object.create(null),gu(s[g],[{axis:p},r[g],l[h]])})}),Object.keys(s).forEach(o=>{const a=s[o];gu(a,[Vt.scales[a.type],Vt.scale])}),s}function fE(t){const e=t.options||(t.options={});e.plugins=et(e.plugins,{}),e.scales=xB(t,e)}function hE(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function RB(t){return t=t||{},t.data=hE(t.data),fE(t),t}const gb=new Map,dE=new Set;function Ql(t,e){let n=gb.get(t);return n||(n=e(),gb.set(t,n),dE.add(n)),n}const Vc=(t,e,n)=>{const r=ch(e,n);r!==void 0&&t.add(r)};let TB=class{constructor(e){this._config=RB(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=hE(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),fE(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Ql(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,n){return Ql(`${e}.transition.${n}`,()=>[[`datasets.${e}.transitions.${n}`,`transitions.${n}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,n){return Ql(`${e}-${n}`,()=>[[`datasets.${e}.elements.${n}`,`datasets.${e}`,`elements.${n}`,""]])}pluginScopeKeys(e){const n=e.id,r=this.type;return Ql(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,n){const r=this._scopeCache;let i=r.get(e);return(!i||n)&&(i=new Map,r.set(e,i)),i}getOptionScopes(e,n,r){const{options:i,type:s}=this,o=this._cachedScopes(e,r),a=o.get(n);if(a)return a;const c=new Set;n.forEach(l=>{e&&(c.add(e),l.forEach(h=>Vc(c,e,h))),l.forEach(h=>Vc(c,i,h)),l.forEach(h=>Vc(c,sa[s]||{},h)),l.forEach(h=>Vc(c,Vt,h)),l.forEach(h=>Vc(c,s0,h))});const u=Array.from(c);return u.length===0&&u.push(Object.create(null)),dE.has(n)&&o.set(n,u),u}chartOptionScopes(){const{options:e,type:n}=this;return[e,sa[n]||{},Vt.datasets[n]||{},{type:n},Vt,s0]}resolveNamedOptions(e,n,r,i=[""]){const s={$shared:!0},{resolver:o,subPrefixes:a}=mb(this._resolverCache,e,i);let c=o;if(IB(o,n)){s.$shared=!1,r=oo(r)?r():r;const u=this.createResolver(e,r,a);c=uc(o,r,u)}for(const u of n)s[u]=c[u];return s}createResolver(e,n,r=[""],i){const{resolver:s}=mb(this._resolverCache,e,r);return ht(n)?uc(s,n,void 0,i):s}};function mb(t,e,n){let r=t.get(e);r||(r=new Map,t.set(e,r));const i=n.join();let s=r.get(i);return s||(s={resolver:fy(e,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,s)),s}const OB=t=>ht(t)&&Object.getOwnPropertyNames(t).some(e=>oo(t[e]));function IB(t,e){const{isScriptable:n,isIndexable:r}=ZS(t);for(const i of e){const s=n(i),o=r(i),a=(o||s)&&t[i];if(s&&(oo(a)||OB(a))||o&&Ft(a))return!0}return!1}var CB="4.4.3";const NB=["top","bottom","left","right","chartArea"];function yb(t,e){return t==="top"||t==="bottom"||NB.indexOf(t)===-1&&e==="x"}function vb(t,e){return function(n,r){return n[t]===r[t]?n[e]-r[e]:n[t]-r[t]}}function bb(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),At(n&&n.onComplete,[t],e)}function PB(t){const e=t.chart,n=e.options.animation;At(n&&n.onProgress,[t],e)}function pE(t){return py()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const If={},wb=t=>{const e=pE(t);return Object.values(If).filter(n=>n.canvas===e).pop()};function MB(t,e,n){const r=Object.keys(t);for(const i of r){const s=+i;if(s>=e){const o=t[i];delete t[i],(n>0||s>e)&&(t[s+n]=o)}}}function LB(t,e,n,r){return!n||t.type==="mouseout"?null:r?e:t}function ef(t,e,n){return t.options.clip?t[n]:e[n]}function BB(t,e){const{xScale:n,yScale:r}=t;return n&&r?{left:ef(n,e,"left"),right:ef(n,e,"right"),top:ef(r,e,"top"),bottom:ef(r,e,"bottom")}:e}var Is;let ld=(Is=class{static register(...e){yi.add(...e),_b()}static unregister(...e){yi.remove(...e),_b()}constructor(e,n){const r=this.config=new TB(n),i=pE(e),s=wb(i);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||QL(i)),this.platform.updateConfig(r);const a=this.platform.acquireContext(i,o.aspectRatio),c=a&&a.canvas,u=c&&c.height,l=c&&c.width;if(this.id=WM(),this.ctx=a,this.canvas=c,this.width=l,this.height=u,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new yB,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=a3(h=>this.update(h),o.resizeDelay||0),this._dataChanges=[],If[this.id]=this,!a||!c){console.error("Failed to create chart: can't acquire context from the given item");return}Yi.listen(this,"complete",bb),Yi.listen(this,"progress",PB),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:n},width:r,height:i,_aspectRatio:s}=this;return Nt(e)?n&&s?s:i?r/i:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return yi}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Kv(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Hv(this.canvas,this.ctx),this}stop(){return Yi.stop(this),this}resize(e,n){Yi.running(this)?this._resizeBeforeDraw={width:e,height:n}:this._resize(e,n)}_resize(e,n){const r=this.options,i=this.canvas,s=r.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(i,e,n,s),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Kv(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),At(r.onResize,[this,o],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};yt(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const e=this.options,n=e.scales,r=this.scales,i=Object.keys(r).reduce((o,a)=>(o[a]=!1,o),{});let s=[];n&&(s=s.concat(Object.keys(n).map(o=>{const a=n[o],c=c0(o,a),u=c==="r",l=c==="x";return{options:a,dposition:u?"chartArea":l?"bottom":"left",dtype:u?"radialLinear":l?"category":"linear"}}))),yt(s,o=>{const a=o.options,c=a.id,u=c0(c,a),l=et(a.type,o.dtype);(a.position===void 0||yb(a.position,u)!==yb(o.dposition))&&(a.position=o.dposition),i[c]=!0;let h=null;if(c in r&&r[c].type===l)h=r[c];else{const p=yi.getScale(l);h=new p({id:c,type:l,ctx:this.ctx,chart:this}),r[h.id]=h}h.init(a,e)}),yt(i,(o,a)=>{o||delete r[a]}),yt(r,o=>{Ur.configure(this,o,o.options),Ur.addBox(this,o)})}_updateMetasets(){const e=this._metasets,n=this.data.datasets.length,r=e.length;if(e.sort((i,s)=>i.index-s.index),r>n){for(let i=n;i<r;++i)this._destroyDatasetMeta(i);e.splice(n,r-n)}this._sortedMetasets=e.slice(0).sort(vb("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:n}}=this;e.length>n.length&&delete this._stacks,e.forEach((r,i)=>{n.filter(s=>s===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const e=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r<i;r++){const s=n[r];let o=this.getDatasetMeta(r);const a=s.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(r),o=this.getDatasetMeta(r)),o.type=a,o.indexAxis=s.indexAxis||a0(a,this.options),o.order=s.order||0,o.index=r,o.label=""+s.label,o.visible=this.isDatasetVisible(r),o.controller)o.controller.updateIndex(r),o.controller.linkScales();else{const c=yi.getController(a),{datasetElementType:u,dataElementType:l}=Vt.datasets[a];Object.assign(c,{dataElementType:yi.getElement(l),datasetElementType:u&&yi.getElement(u)}),o.controller=new c(this,r),e.push(o.controller)}}return this._updateMetasets(),e}_resetElements(){yt(this.data.datasets,(e,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,l=this.data.datasets.length;u<l;u++){const{controller:h}=this.getDatasetMeta(u),p=!i&&s.indexOf(h)===-1;h.buildOrUpdateElements(p),o=Math.max(+h.getMaxOverflow(),o)}o=this._minPadding=r.layout.autoPadding?o:0,this._updateLayout(o),i||yt(s,u=>{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(vb("z","_idx"));const{_active:a,_lastEvent:c}=this;c?this._eventHandler(c,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){yt(this.scales,e=>{Ur.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(e.events);(!Pv(n,r)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:s}of n){const o=r==="_removeElements"?-s:s;MB(e,i,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=s=>new Set(e.filter(o=>o[0]===s).map((o,a)=>a+","+o.splice(1).join(","))),i=r(0);for(let s=1;s<n;s++)if(!Pv(i,r(s)))return;return Array.from(i).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Ur.update(this,this.width,this.height,e);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],yt(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,s)=>{i._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,oo(e)?e({datasetIndex:n}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,n){const r=this.getDatasetMeta(e),i={meta:r,index:e,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(r.controller._update(n),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Yi.has(this)?this.attached&&!Yi.running(this)&&Yi.start(this):(this.draw(),bb({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resize(r,i),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(e=0;e<n.length&&n[e].z<=0;++e)n[e].draw(this.chartArea);for(this._drawDatasets();e<n.length;++e)n[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const n=this._sortedMetasets,r=[];let i,s;for(i=0,s=n.length;i<s;++i){const o=n[i];(!e||o.visible)&&r.push(o)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let n=e.length-1;n>=0;--n)this._drawDataset(e[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const n=this.ctx,r=e._clip,i=!r.disabled,s=BB(e,this.chartArea),o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(i&&uy(n,{left:r.left===!1?0:s.left-r.left,right:r.right===!1?this.width:s.right+r.right,top:r.top===!1?0:s.top-r.top,bottom:r.bottom===!1?this.height:s.bottom+r.bottom}),e.controller.draw(),i&&ly(n),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return us(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,n,r,i){const s=NL.modes[n];return typeof s=="function"?s(this,e,r,i):[]}getDatasetMeta(e){const n=this.data.datasets[e],r=this._metasets;let i=r.filter(s=>s&&s._dataset===n).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:e,_dataset:n,_parsed:[],_sorted:!1},r.push(i)),i}getContext(){return this.$context||(this.$context=po(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const n=this.data.datasets[e];if(!n)return!1;const r=this.getDatasetMeta(e);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(e,n){const r=this.getDatasetMeta(e);r.hidden=!n}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,n,r){const i=r?"show":"hide",s=this.getDatasetMeta(e),o=s.controller._resolveAnimations(void 0,i);uh(n)?(s.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(e,r),o.update(s,{visible:r}),this.update(a=>a.datasetIndex===e?i:void 0))}hide(e,n){this._updateVisibility(e,n,!1)}show(e,n){this._updateVisibility(e,n,!0)}_destroyDatasetMeta(e){const n=this._metasets[e];n&&n.controller&&n.controller._destroy(),delete this._metasets[e]}_stop(){let e,n;for(this.stop(),Yi.remove(this),e=0,n=this.data.datasets.length;e<n;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:n}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Hv(e,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete If[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,n=this.platform,r=(s,o)=>{n.addEventListener(this,s,o),e[s]=o},i=(s,o,a)=>{s.offsetX=o,s.offsetY=a,this._eventHandler(s)};yt(this.options.events,s=>r(s,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,n=this.platform,r=(c,u)=>{n.addEventListener(this,c,u),e[c]=u},i=(c,u)=>{e[c]&&(n.removeEventListener(this,c,u),delete e[c])},s=(c,u)=>{this.canvas&&this.resize(c,u)};let o;const a=()=>{i("attach",a),this.attached=!0,this.resize(),r("resize",s),r("detach",o)};o=()=>{this.attached=!1,i("resize",s),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){yt(this._listeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._listeners={},yt(this._responsiveListeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,n,r){const i=r?"set":"remove";let s,o,a,c;for(n==="dataset"&&(s=this.getDatasetMeta(e[0].datasetIndex),s.controller["_"+i+"DatasetHoverStyle"]()),a=0,c=e.length;a<c;++a){o=e[a];const u=o&&this.getDatasetMeta(o.datasetIndex).controller;u&&u[i+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const n=this._active||[],r=e.map(({datasetIndex:s,index:o})=>{const a=this.getDatasetMeta(s);if(!a)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:a.data[o],index:o}});!oh(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(e,n,r){return this._plugins.notify(this,e,n,r)}isPluginEnabled(e){return this._plugins._cache.filter(n=>n.plugin.id===e).length===1}_updateHoverStyles(e,n,r){const i=this.options.hover,s=(c,u)=>c.filter(l=>!u.some(h=>l.datasetIndex===h.datasetIndex&&l.index===h.index)),o=s(n,e),a=r?e:s(e,n);o.length&&this.updateHoverStyle(o,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(e,n){const r={event:e,replay:n,cancelable:!0,inChartArea:this.isPointInArea(e)},i=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const s=this._handleEvent(e,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(s||r.changed)&&this.render(),this}_handleEvent(e,n,r){const{_active:i=[],options:s}=this,o=n,a=this._getActiveElements(e,i,r,o),c=YM(e),u=LB(e,this._lastEvent,r,c);r&&(this._lastEvent=null,At(s.onHover,[e,a,this],this),c&&At(s.onClick,[e,a,this],this));const l=!oh(a,i);return(l||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=u,l}_getActiveElements(e,n,r,i){if(e.type==="mouseout")return[];if(!r)return n;const s=this.options.hover;return this.getElementsAtEventForMode(e,s.mode,s,i)}},De(Is,"defaults",Vt),De(Is,"instances",If),De(Is,"overrides",sa),De(Is,"registry",yi),De(Is,"version",CB),De(Is,"getChart",wb),Is);function _b(){return yt(ld.instances,t=>t._plugins.invalidate())}function gE(t,e,n=e){t.lineCap=et(n.borderCapStyle,e.borderCapStyle),t.setLineDash(et(n.borderDash,e.borderDash)),t.lineDashOffset=et(n.borderDashOffset,e.borderDashOffset),t.lineJoin=et(n.borderJoinStyle,e.borderJoinStyle),t.lineWidth=et(n.borderWidth,e.borderWidth),t.strokeStyle=et(n.borderColor,e.borderColor)}function DB(t,e,n){t.lineTo(n.x,n.y)}function $B(t){return t.stepped?_3:t.tension||t.cubicInterpolationMode==="monotone"?k3:DB}function mE(t,e,n={}){const r=t.length,{start:i=0,end:s=r-1}=n,{start:o,end:a}=e,c=Math.max(i,o),u=Math.min(s,a),l=i<o&&s<o||i>a&&s>a;return{count:r,start:c,loop:e.loop,ilen:u<c&&!l?r+u-c:u-c}}function FB(t,e,n,r){const{points:i,options:s}=e,{count:o,start:a,loop:c,ilen:u}=mE(i,n,r),l=$B(s);let{move:h=!0,reverse:p}=r||{},g,y,w;for(g=0;g<=u;++g)y=i[(a+(p?u-g:g))%o],!y.skip&&(h?(t.moveTo(y.x,y.y),h=!1):l(t,w,y,p,s.stepped),w=y);return c&&(y=i[(a+(p?u:0))%o],l(t,w,y,p,s.stepped)),!!c}function UB(t,e,n,r){const i=e.points,{count:s,start:o,ilen:a}=mE(i,n,r),{move:c=!0,reverse:u}=r||{};let l=0,h=0,p,g,y,w,k,T;const C=I=>(o+(u?a-I:I))%s,O=()=>{w!==k&&(t.lineTo(l,k),t.lineTo(l,w),t.lineTo(l,T))};for(c&&(g=i[C(0)],t.moveTo(g.x,g.y)),p=0;p<=a;++p){if(g=i[C(p)],g.skip)continue;const I=g.x,N=g.y,F=I|0;F===y?(N<w?w=N:N>k&&(k=N),l=(h*l+I)/++h):(O(),t.lineTo(I,N),y=F,h=0,w=k=N),T=N}O()}function u0(t){const e=t.options,n=e.borderDash&&e.borderDash.length;return!t._decimated&&!t._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!n?UB:FB}function zB(t){return t.stepped?tL:t.tension||t.cubicInterpolationMode==="monotone"?nL:Io}function HB(t,e,n,r){let i=e._path;i||(i=e._path=new Path2D,e.path(i,n,r)&&i.closePath()),gE(t,e.options),t.stroke(i)}function WB(t,e,n,r){const{segments:i,options:s}=e,o=u0(e);for(const a of i)gE(t,s,a.style),t.beginPath(),o(t,e,a,{start:n,end:n+r-1})&&t.closePath(),t.stroke()}const jB=typeof Path2D=="function";function KB(t,e,n,r){jB&&!e.options.segment?HB(t,e,n,r):WB(t,e,n,r)}class iu extends ba{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const i=r.spanGaps?this._loop:this._fullLoop;q3(this._points,r,e,i,n),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=lL(this,this.options.segment))}first(){const e=this.segments,n=this.points;return e.length&&n[e[0].start]}last(){const e=this.segments,n=this.points,r=e.length;return r&&n[e[r-1].end]}interpolate(e,n){const r=this.options,i=e[n],s=this.points,o=aL(this,{property:n,start:i,end:i});if(!o.length)return;const a=[],c=zB(r);let u,l;for(u=0,l=o.length;u<l;++u){const{start:h,end:p}=o[u],g=s[h],y=s[p];if(g===y){a.push(g);continue}const w=Math.abs((i-g[n])/(y[n]-g[n])),k=c(g,y,w,r.stepped);k[n]=e[n],a.push(k)}return a.length===1?a[0]:a}pathSegment(e,n,r){return u0(this)(e,this,n,r)}path(e,n,r){const i=this.segments,s=u0(this);let o=this._loop;n=n||0,r=r||this.points.length-n;for(const a of i)o&=s(e,this,a,{start:n,end:n+r-1});return!!o}draw(e,n,r,i){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(e.save(),KB(e,this,r,i),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}De(iu,"id","line"),De(iu,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),De(iu,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),De(iu,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"});function kb(t,e,n,r){const i=t.options,{[n]:s}=t.getProps([n],r);return Math.abs(e-s)<i.radius+i.hitRadius}class Cf extends ba{constructor(n){super();De(this,"parsed");De(this,"skip");De(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,r,i){const s=this.options,{x:o,y:a}=this.getProps(["x","y"],i);return Math.pow(n-o,2)+Math.pow(r-a,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(n,r){return kb(this,n,"x",r)}inYRange(n,r){return kb(this,n,"y",r)}getCenterPoint(n){const{x:r,y:i}=this.getProps(["x","y"],n);return{x:r,y:i}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const i=r&&n.borderWidth||0;return(r+i)*2}draw(n,r){const i=this.options;this.skip||i.radius<.1||!us(this,r,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,o0(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}De(Cf,"id","point"),De(Cf,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),De(Cf,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});const Sb=(t,e)=>{let{boxHeight:n=e,boxWidth:r=e}=t;return t.usePointStyle&&(n=Math.min(n,e),r=t.pointStyleWidth||Math.min(r,e)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(e,n)}},VB=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class Eb extends ba{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,n,r){this.maxWidth=e,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const e=this.options.labels||{};let n=At(e.generateLabels,[this.chart],this)||[];e.filter&&(n=n.filter(r=>e.filter(r,this.chart.data))),e.sort&&(n=n.sort((r,i)=>e.sort(r,i,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:e,ctx:n}=this;if(!e.display){this.width=this.height=0;return}const r=e.labels,i=_n(r.font),s=i.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:c}=Sb(r,s);let u,l;n.font=i.string,this.isHorizontal()?(u=this.maxWidth,l=this._fitRows(o,s,a,c)+10):(l=this.maxHeight,u=this._fitCols(o,i,a,c)+10),this.width=Math.min(u,e.maxWidth||this.maxWidth),this.height=Math.min(l,e.maxHeight||this.maxHeight)}_fitRows(e,n,r,i){const{ctx:s,maxWidth:o,options:{labels:{padding:a}}}=this,c=this.legendHitBoxes=[],u=this.lineWidths=[0],l=i+a;let h=e;s.textAlign="left",s.textBaseline="middle";let p=-1,g=-l;return this.legendItems.forEach((y,w)=>{const k=r+n/2+s.measureText(y.text).width;(w===0||u[u.length-1]+k+2*a>o)&&(h+=l,u[u.length-(w>0?0:1)]=0,g+=l,p++),c[w]={left:0,top:g,row:p,width:k,height:i},u[u.length-1]+=k+a}),h}_fitCols(e,n,r,i){const{ctx:s,maxHeight:o,options:{labels:{padding:a}}}=this,c=this.legendHitBoxes=[],u=this.columnSizes=[],l=o-e;let h=a,p=0,g=0,y=0,w=0;return this.legendItems.forEach((k,T)=>{const{itemWidth:C,itemHeight:O}=qB(r,n,s,k,i);T>0&&g+O+2*a>l&&(h+=p+a,u.push({width:p,height:g}),y+=p+a,w++,p=g=0),c[T]={left:y,top:g,col:w,width:C,height:O},p=Math.max(p,C),g+=O+a}),h+=p,u.push({width:p,height:g}),h}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:s}}=this,o=Xa(s,this.left,this.width);if(this.isHorizontal()){let a=0,c=Wn(r,this.left+i,this.right-this.lineWidths[a]);for(const u of n)a!==u.row&&(a=u.row,c=Wn(r,this.left+i,this.right-this.lineWidths[a])),u.top+=this.top+e+i,u.left=o.leftForLtr(o.x(c),u.width),c+=u.width+i}else{let a=0,c=Wn(r,this.top+e+i,this.bottom-this.columnSizes[a].height);for(const u of n)u.col!==a&&(a=u.col,c=Wn(r,this.top+e+i,this.bottom-this.columnSizes[a].height)),u.top=c,u.left+=this.left+i,u.left=o.leftForLtr(o.x(u.left),u.width),c+=u.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;uy(e,this),this._draw(),ly(e)}}_draw(){const{options:e,columnSizes:n,lineWidths:r,ctx:i}=this,{align:s,labels:o}=e,a=Vt.color,c=Xa(e.rtl,this.left,this.width),u=_n(o.font),{padding:l}=o,h=u.size,p=h/2;let g;this.drawTitle(),i.textAlign=c.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=u.string;const{boxWidth:y,boxHeight:w,itemHeight:k}=Sb(o,h),T=function(F,L,D){if(isNaN(y)||y<=0||isNaN(w)||w<0)return;i.save();const H=et(D.lineWidth,1);if(i.fillStyle=et(D.fillStyle,a),i.lineCap=et(D.lineCap,"butt"),i.lineDashOffset=et(D.lineDashOffset,0),i.lineJoin=et(D.lineJoin,"miter"),i.lineWidth=H,i.strokeStyle=et(D.strokeStyle,a),i.setLineDash(et(D.lineDash,[])),o.usePointStyle){const z={radius:w*Math.SQRT2/2,pointStyle:D.pointStyle,rotation:D.rotation,borderWidth:H},K=c.xPlus(F,y/2),_=L+p;GS(i,z,K,_,o.pointStyleWidth&&y)}else{const z=L+Math.max((h-w)/2,0),K=c.leftForLtr(F,y),_=Za(D.borderRadius);i.beginPath(),Object.values(_).some(m=>m!==0)?hh(i,{x:K,y:z,w:y,h:w,radius:_}):i.rect(K,z,y,w),i.fill(),H!==0&&i.stroke()}i.restore()},C=function(F,L,D){oa(i,D.text,F,L+k/2,u,{strikethrough:D.hidden,textAlign:c.textAlign(D.textAlign)})},O=this.isHorizontal(),I=this._computeTitleHeight();O?g={x:Wn(s,this.left+l,this.right-r[0]),y:this.top+l+I,line:0}:g={x:this.left+l,y:Wn(s,this.top+I+l,this.bottom-n[0].height),line:0},tE(this.ctx,e.textDirection);const N=k+l;this.legendItems.forEach((F,L)=>{i.strokeStyle=F.fontColor,i.fillStyle=F.fontColor;const D=i.measureText(F.text).width,H=c.textAlign(F.textAlign||(F.textAlign=o.textAlign)),z=y+p+D;let K=g.x,_=g.y;c.setWidth(this.width),O?L>0&&K+z+l>this.right&&(_=g.y+=N,g.line++,K=g.x=Wn(s,this.left+l,this.right-r[g.line])):L>0&&_+N>this.bottom&&(K=g.x=K+n[g.line].width+l,g.line++,_=g.y=Wn(s,this.top+I+l,this.bottom-n[g.line].height));const m=c.x(K);if(T(m,_,F),K=c3(H,K+y+p,O?K+z:this.right,e.rtl),C(c.x(K),_,F),O)g.x+=z+l;else if(typeof F.text!="string"){const f=u.lineHeight;g.y+=yE(F,f)+l}else g.y+=N}),nE(this.ctx,e.textDirection)}drawTitle(){const e=this.options,n=e.title,r=_n(n.font),i=Vn(n.padding);if(!n.display)return;const s=Xa(e.rtl,this.left,this.width),o=this.ctx,a=n.position,c=r.size/2,u=i.top+c;let l,h=this.left,p=this.width;if(this.isHorizontal())p=Math.max(...this.lineWidths),l=this.top+u,h=Wn(e.align,h,this.right-p);else{const y=this.columnSizes.reduce((w,k)=>Math.max(w,k.height),0);l=u+Wn(e.align,this.top,this.bottom-y-e.labels.padding-this._computeTitleHeight())}const g=Wn(a,h,h+p);o.textAlign=s.textAlign(oy(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=r.string,oa(o,n.text,g,l,r)}_computeTitleHeight(){const e=this.options.title,n=_n(e.font),r=Vn(e.padding);return e.display?n.lineHeight+r.height:0}_getLegendItemAt(e,n){let r,i,s;if(nu(e,this.left,this.right)&&nu(n,this.top,this.bottom)){for(s=this.legendHitBoxes,r=0;r<s.length;++r)if(i=s[r],nu(e,i.left,i.left+i.width)&&nu(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(e){const n=this.options;if(!ZB(e.type,n))return;const r=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const i=this._hoveredItem,s=VB(i,r);i&&!s&&At(n.onLeave,[e,i,this],this),this._hoveredItem=r,r&&!s&&At(n.onHover,[e,r,this],this)}else r&&At(n.onClick,[e,r,this],this)}}function qB(t,e,n,r,i){const s=GB(r,t,e,n),o=YB(i,r,e.lineHeight);return{itemWidth:s,itemHeight:o}}function GB(t,e,n,r){let i=t.text;return i&&typeof i!="string"&&(i=i.reduce((s,o)=>s.length>o.length?s:o)),e+n.size/2+r.measureText(i).width}function YB(t,e,n){let r=t;return typeof e.text!="string"&&(r=yE(e,n)),r}function yE(t,e){const n=t.text?t.text.length:0;return e*n}function ZB(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var XB={id:"legend",_element:Eb,start(t,e,n){const r=t.legend=new Eb({ctx:t.ctx,options:n,chart:t});Ur.configure(t,r,n),Ur.addBox(t,r)},stop(t){Ur.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const r=t.legend;Ur.configure(t,r,n),r.options=n},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,n){const r=e.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),e.hidden=!0):(i.show(r),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:s,useBorderRadius:o,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map(c=>{const u=c.controller.getStyle(n?0:void 0),l=Vn(u.borderWidth);return{text:e[c.index].label,fillStyle:u.backgroundColor,fontColor:s,hidden:!c.visible,lineCap:u.borderCapStyle,lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:u.borderColor,pointStyle:r||u.pointStyle,rotation:u.rotation,textAlign:i||u.textAlign,borderRadius:o&&(a||u.borderRadius),datasetIndex:c.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class vE extends ba{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=n;const i=Ft(r.text)?r.text.length:1;this._padding=Vn(r.padding);const s=i*_n(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:n,left:r,bottom:i,right:s,options:o}=this,a=o.align;let c=0,u,l,h;return this.isHorizontal()?(l=Wn(a,r,s),h=n+e,u=s-r):(o.position==="left"?(l=r+e,h=Wn(a,i,n),c=mn*-.5):(l=s-e,h=Wn(a,n,i),c=mn*.5),u=i-n),{titleX:l,titleY:h,maxWidth:u,rotation:c}}draw(){const e=this.ctx,n=this.options;if(!n.display)return;const r=_n(n.font),s=r.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:c,rotation:u}=this._drawArgs(s);oa(e,n.text,0,0,r,{color:n.color,maxWidth:c,rotation:u,textAlign:oy(n.align),textBaseline:"middle",translation:[o,a]})}}function JB(t,e){const n=new vE({ctx:t.ctx,options:e,chart:t});Ur.configure(t,n,e),Ur.addBox(t,n),t.titleBlock=n}var QB={id:"title",_element:vE,start(t,e,n){JB(t,n)},stop(t){const e=t.titleBlock;Ur.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const r=t.titleBlock;Ur.configure(t,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const su={average(t){if(!t.length)return!1;let e,n,r=new Set,i=0,s=0;for(e=0,n=t.length;e<n;++e){const a=t[e].element;if(a&&a.hasValue()){const c=a.tooltipPosition();r.add(c.x),i+=c.y,++s}}return{x:[...r].reduce((a,c)=>a+c)/r.size,y:i/s}},nearest(t,e){if(!t.length)return!1;let n=e.x,r=e.y,i=Number.POSITIVE_INFINITY,s,o,a;for(s=0,o=t.length;s<o;++s){const c=t[s].element;if(c&&c.hasValue()){const u=c.getCenterPoint(),l=i0(e,u);l<i&&(i=l,a=c)}}if(a){const c=a.tooltipPosition();n=c.x,r=c.y}return{x:n,y:r}}};function mi(t,e){return e&&(Ft(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Zi(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(` 22`)>-1?t.split(` 23`):t}function e5(t,e){const{element:n,datasetIndex:r,index:i}=e,s=t.getDatasetMeta(r).controller,{label:o,value:a}=s.getLabelAndValue(i);return{chart:t,label:o,parsed:s.getParsed(i),raw:t.data.datasets[r].data[i],formattedValue:a,dataset:s.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function Ab(t,e){const n=t.chart.ctx,{body:r,footer:i,title:s}=t,{boxWidth:o,boxHeight:a}=e,c=_n(e.bodyFont),u=_n(e.titleFont),l=_n(e.footerFont),h=s.length,p=i.length,g=r.length,y=Vn(e.padding);let w=y.height,k=0,T=r.reduce((I,N)=>I+N.before.length+N.lines.length+N.after.length,0);if(T+=t.beforeBody.length+t.afterBody.length,h&&(w+=h*u.lineHeight+(h-1)*e.titleSpacing+e.titleMarginBottom),T){const I=e.displayColors?Math.max(a,c.lineHeight):c.lineHeight;w+=g*I+(T-g)*c.lineHeight+(T-1)*e.bodySpacing}p&&(w+=e.footerMarginTop+p*l.lineHeight+(p-1)*e.footerSpacing);let C=0;const O=function(I){k=Math.max(k,n.measureText(I).width+C)};return n.save(),n.font=u.string,yt(t.title,O),n.font=c.string,yt(t.beforeBody.concat(t.afterBody),O),C=e.displayColors?o+2+e.boxPadding:0,yt(r,I=>{yt(I.before,O),yt(I.lines,O),yt(I.after,O)}),C=0,n.font=l.string,yt(t.footer,O),n.restore(),k+=y.width,{width:k,height:w}}function t5(t,e){const{y:n,height:r}=e;return n<r/2?"top":n>t.height-r/2?"bottom":"center"}function n5(t,e,n,r){const{x:i,width:s}=r,o=n.caretSize+n.caretPadding;if(t==="left"&&i+s+o>e.width||t==="right"&&i-s-o<0)return!0}function r5(t,e,n,r){const{x:i,width:s}=n,{width:o,chartArea:{left:a,right:c}}=t;let u="center";return r==="center"?u=i<=(a+c)/2?"left":"right":i<=s/2?u="left":i>=o-s/2&&(u="right"),n5(u,t,e,n)&&(u="center"),u}function xb(t,e,n){const r=n.yAlign||e.yAlign||t5(t,n);return{xAlign:n.xAlign||e.xAlign||r5(t,e,n,r),yAlign:r}}function i5(t,e){let{x:n,width:r}=t;return e==="right"?n-=r:e==="center"&&(n-=r/2),n}function s5(t,e,n){let{y:r,height:i}=t;return e==="top"?r+=n:e==="bottom"?r-=i+n:r-=i/2,r}function Rb(t,e,n,r){const{caretSize:i,caretPadding:s,cornerRadius:o}=t,{xAlign:a,yAlign:c}=n,u=i+s,{topLeft:l,topRight:h,bottomLeft:p,bottomRight:g}=Za(o);let y=i5(e,a);const w=s5(e,c,u);return c==="center"?a==="left"?y+=u:a==="right"&&(y-=u):a==="left"?y-=Math.max(l,p)+i:a==="right"&&(y+=Math.max(h,g)+i),{x:Fr(y,0,r.width-e.width),y:Fr(w,0,r.height-e.height)}}function tf(t,e,n){const r=Vn(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-r.right:t.x+r.left}function Tb(t){return mi([],Zi(t))}function o5(t,e,n){return po(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function Ob(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const bE={beforeTitle:qi,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(r>0&&e.dataIndex<r)return n[e.dataIndex]}return""},afterTitle:qi,beforeBody:qi,beforeLabel:qi,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return Nt(n)||(e+=n),e},labelColor(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:qi,afterBody:qi,beforeFooter:qi,footer:qi,afterFooter:qi};function tr(t,e,n,r){const i=t[e].call(n,r);return typeof i>"u"?bE[e].call(n,r):i}class l0 extends ba{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const n=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,s=new iE(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=o5(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:r}=n,i=tr(r,"beforeTitle",this,e),s=tr(r,"title",this,e),o=tr(r,"afterTitle",this,e);let a=[];return a=mi(a,Zi(i)),a=mi(a,Zi(s)),a=mi(a,Zi(o)),a}getBeforeBody(e,n){return Tb(tr(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:r}=n,i=[];return yt(e,s=>{const o={before:[],lines:[],after:[]},a=Ob(r,s);mi(o.before,Zi(tr(a,"beforeLabel",this,s))),mi(o.lines,tr(a,"label",this,s)),mi(o.after,Zi(tr(a,"afterLabel",this,s))),i.push(o)}),i}getAfterBody(e,n){return Tb(tr(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:r}=n,i=tr(r,"beforeFooter",this,e),s=tr(r,"footer",this,e),o=tr(r,"afterFooter",this,e);let a=[];return a=mi(a,Zi(i)),a=mi(a,Zi(s)),a=mi(a,Zi(o)),a}_createItems(e){const n=this._active,r=this.chart.data,i=[],s=[],o=[];let a=[],c,u;for(c=0,u=n.length;c<u;
vendor: 4,364 bytes, line 23
23++c)a.push(e5(this.chart,n[c]));return e.filter&&(a=a.filter((l,h,p)=>e.filter(l,h,p,r))),e.itemSort&&(a=a.sort((l,h)=>e.itemSort(l,h,r))),yt(a,l=>{const h=Ob(e.callbacks,l);i.push(tr(h,"labelColor",this,l)),s.push(tr(h,"labelPointStyle",this,l)),o.push(tr(h,"labelTextColor",this,l))}),this.labelColors=i,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=a,a}update(e,n){const r=this.options.setContext(this.getContext()),i=this._active;let s,o=[];if(!i.length)this.opacity!==0&&(s={opacity:0});else{const a=su[r.position].call(this,i,this._eventPosition);o=this._createItems(r),this.title=this.getTitle(o,r),this.beforeBody=this.getBeforeBody(o,r),this.body=this.getBody(o,r),this.afterBody=this.getAfterBody(o,r),this.footer=this.getFooter(o,r);const c=this._size=Ab(this,r),u=Object.assign({},a,c),l=xb(this.chart,r,u),h=Rb(r,u,l,this.chart);this.xAlign=l.xAlign,this.yAlign=l.yAlign,s={opacity:1,x:h.x,y:h.y,width:c.width,height:c.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),e&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(e,n,r,i){const s=this.getCaretPosition(e,r,i);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(e,n,r){const{xAlign:i,yAlign:s}=this,{caretSize:o,cornerRadius:a}=r,{topLeft:c,topRight:u,bottomLeft:l,bottomRight:h}=Za(a),{x:p,y:g}=e,{width:y,height:w}=n;let k,T,C,O,I,N;return s==="center"?(I=g+w/2,i==="left"?(k=p,T=k-o,O=I+o,N=I-o):(k=p+y,T=k+o,O=I-o,N=I+o),C=k):(i==="left"?T=p+Math.max(c,l)+o:i==="right"?T=p+y-Math.max(u,h)-o:T=this.caretX,s==="top"?(O=g,I=O-o,k=T-o,C=T+o):(O=g+w,I=O+o,k=T+o,C=T-o),N=O),{x1:k,x2:T,x3:C,y1:O,y2:I,y3:N}}drawTitle(e,n,r){const i=this.title,s=i.length;let o,a,c;if(s){const u=Xa(r.rtl,this.x,this.width);for(e.x=tf(this,r.titleAlign,r),n.textAlign=u.textAlign(r.titleAlign),n.textBaseline="middle",o=_n(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=o.string,c=0;c<s;++c)n.fillText(i[c],u.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+a,c+1===s&&(e.y+=r.titleMarginBottom-a)}}_drawColorBox(e,n,r,i,s){const o=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:c,boxWidth:u}=s,l=_n(s.bodyFont),h=tf(this,"left",s),p=i.x(h),g=c<l.lineHeight?(l.lineHeight-c)/2:0,y=n.y+g;if(s.usePointStyle){const w={radius:Math.min(u,c)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},k=i.leftForLtr(p,u)+u/2,T=y+c/2;e.strokeStyle=s.multiKeyBackground,e.fillStyle=s.multiKeyBackground,o0(e,w,k,T),e.strokeStyle=o.borderColor,e.fillStyle=o.backgroundColor,o0(e,w,k,T)}else{e.lineWidth=ht(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,e.strokeStyle=o.borderColor,e.setLineDash(o.borderDash||[]),e.lineDashOffset=o.borderDashOffset||0;const w=i.leftForLtr(p,u),k=i.leftForLtr(i.xPlus(p,1),u-2),T=Za(o.borderRadius);Object.values(T).some(C=>C!==0)?(e.beginPath(),e.fillStyle=s.multiKeyBackground,hh(e,{x:w,y,w:u,h:c,radius:T}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),hh(e,{x:k,y:y+1,w:u-2,h:c-2,radius:T}),e.fill()):(e.fillStyle=s.multiKeyBackground,e.fillRect(w,y,u,c),e.strokeRect(w,y,u,c),e.fillStyle=o.backgroundColor,e.fillRect(k,y+1,u-2,c-2))}e.fillStyle=this.labelTextColors[r]}drawBody(e,n,r){const{body:i}=this,{bodySpacing:s,bodyAlign:o,displayColors:a,boxHeight:c,boxWidth:u,boxPadding:l}=r,h=_n(r.bodyFont);let p=h.lineHeight,g=0;const y=Xa(r.rtl,this.x,this.width),w=function(D){n.fillText(D,y.x(e.x+g),e.y+p/2),e.y+=p+s},k=y.textAlign(o);let T,C,O,I,N,F,L;for(n.textAlign=o,n.textBaseline="middle",n.font=h.string,e.x=tf(this,k,r),n.fillStyle=r.bodyColor,yt(this.beforeBody,w),g=a&&k!=="right"?o==="center"?u/2+l:u+2+l:0,I=0,F=i.length;I<F;++I){for(T=i[I],C=this.labelTextColors[I],n.fillStyle=C,yt(T.before,w),O=T.lines,a&&O.length&&(this._drawColorBox(n,e,I,y,r),p=Math.max(h.lineHeight,c)),N=0,L=O.length;N<L;++N)w(O[N]),p=h.lineHeight;yt(T.after,w)}g=0,p=h.lineHeight,yt(this.afterBody,w),e.y-=s}drawFooter(e,n,r){const i=this.footer,s=i.length;let o,a;if(s){const c=Xa(r.rtl,this.x,this.width);for(e.x=tf(this,r.footerAlign,r),e.y+=r.footerMarginTop,n.textAlign=c.textAlign(r.footerAlign),n.textBaseline="middle",o=_n(r.footerFont),n.fillStyle=r.footerColor,n.font=o.string,a=0;a<s;++a)n.fillText(i[a],c.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+r.footerSpacing}}
vendor: 22,935 bytes, line 23
23drawBackground(e,n,r,i){const{xAlign:s,yAlign:o}=this,{x:a,y:c}=e,{width:u,height:l}=r,{topLeft:h,topRight:p,bottomLeft:g,bottomRight:y}=Za(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(a+h,c),o==="top"&&this.drawCaret(e,n,r,i),n.lineTo(a+u-p,c),n.quadraticCurveTo(a+u,c,a+u,c+p),o==="center"&&s==="right"&&this.drawCaret(e,n,r,i),n.lineTo(a+u,c+l-y),n.quadraticCurveTo(a+u,c+l,a+u-y,c+l),o==="bottom"&&this.drawCaret(e,n,r,i),n.lineTo(a+g,c+l),n.quadraticCurveTo(a,c+l,a,c+l-g),o==="center"&&s==="left"&&this.drawCaret(e,n,r,i),n.lineTo(a,c+h),n.quadraticCurveTo(a,c,a+h,c),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(e){const n=this.chart,r=this.$animations,i=r&&r.x,s=r&&r.y;if(i||s){const o=su[e.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=Ab(this,e),c=Object.assign({},o,this._size),u=xb(n,e,c),l=Rb(e,c,u,n);(i._to!==l.x||s._to!==l.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(e){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},s={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const o=Vn(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(e.save(),e.globalAlpha=r,this.drawBackground(s,e,i,n),tE(e,n.textDirection),s.y+=o.top,this.drawTitle(s,e,n),this.drawBody(s,e,n),this.drawFooter(s,e,n),nE(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const r=this._active,i=e.map(({datasetIndex:a,index:c})=>{const u=this.chart.getDatasetMeta(a);if(!u)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:u.data[c],index:c}}),s=!oh(r,i),o=this._positionChanged(i,n);(s||o)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,s=this._active||[],o=this._getActiveElements(e,s,n,r),a=this._positionChanged(o,e),c=n||!oh(o,s)||a;return c&&(this._active=o,(i.enabled||i.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),c}_getActiveElements(e,n,r,i){const s=this.options;if(e.type==="mouseout")return[];if(!i)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(e,s.mode,s,r);return s.reverse&&o.reverse(),o}_positionChanged(e,n){const{caretX:r,caretY:i,options:s}=this,o=su[s.position].call(this,e,n);return o!==!1&&(r!==o.x||i!==o.y)}}De(l0,"positioners",su);var a5={id:"tooltip",_element:l0,positioners:su,afterInit(t,e,n){n&&(t.tooltip=new l0({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:bE},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const c5=(t,e,n,r)=>(typeof e=="string"?(n=t.push(e)-1,r.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function u5(t,e,n,r){const i=t.indexOf(e);if(i===-1)return c5(t,e,n,r);const s=t.lastIndexOf(e);return i!==s?n:i}const l5=(t,e)=>t===null?null:Fr(Math.round(t),0,e);function Ib(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class f0 extends wa{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:i,label:s}of n)r[i]===s&&r.splice(i,1);this._addedLabels=[]}super.init(e)}parse(e,n){if(Nt(e))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===e?n:u5(r,e,et(n,e),this._addedLabels),l5(n,r.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const e=this.min,n=this.max,r=this.options.offset,i=[];let s=this.getLabels();s=e===0&&n===s.length-1?s:s.slice(e,n+1),this._valueRange=Math.max(s.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let o=e;o<=n;o++)i.push({value:o});return i}getLabelForValue(e){return Ib.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}De(f0,"id","category"),De(f0,"defaults",{ticks:{callback:Ib}});function f5(t,e){const n=[],{bounds:i,step:s,min:o,max:a,precision:c,count:u,maxTicks:l,maxDigits:h,includeBounds:p}=t,g=s||1,y=l-1,{min:w,max:k}=e,T=!Nt(o),C=!Nt(a),O=!Nt(u),I=(k-w)/(h+1);let N=Lv((k-w)/y/g)*g,F,L,D,H;if(N<1e-14&&!T&&!C)return[{value:w},{value:k}];H=Math.ceil(k/N)-Math.floor(w/N),H>y&&(N=Lv(H*N/y/g)*g),Nt(c)||(F=Math.pow(10,c),N=Math.ceil(N*F)/F),i==="ticks"?(L=Math.floor(w/N)*N,D=Math.ceil(k/N)*N):(L=w,D=k),T&&C&&s&&QM((a-o)/s,N/1e3)?(H=Math.round(Math.min((a-o)/N,l)),N=(a-o)/H,L=o,D=a):O?(L=T?o:L,D=C?a:D,H=u-1,N=(D-L)/H):(H=(D-L)/N,mu(H,Math.round(H),N/1e3)?H=Math.round(H):H=Math.ceil(H));const z=Math.max(Bv(N),Bv(L));F=Math.pow(10,Nt(c)?z:c),L=Math.round(L*F)/F,D=Math.round(D*F)/F;let K=0;for(T&&(p&&L!==o?(n.push({value:o}),L<o&&K++,mu(Math.round((L+K*N)*F)/F,o,Cb(o,I,t))&&K++):L<o&&K++);K<H;++K){const _=Math.round((L+K*N)*F)/F;if(C&&_>a)break;n.push({value:_})}return C&&p&&D!==a?n.length&&mu(n[n.length-1].value,a,Cb(a,I,t))?n[n.length-1].value=a:n.push({value:a}):(!C||D===a)&&n.push({value:D}),n}function Cb(t,e,{horizontal:n,minRotation:r}){const i=Us(r),s=(n?Math.sin(i):Math.cos(i))||.001,o=.75*e*(""+t).length;return Math.min(e/s,o)}class gh extends wa{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,n){return Nt(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:s}=this;const o=c=>i=n?i:c,a=c=>s=r?s:c;if(e){const c=cc(i),u=cc(s);c<0&&u<0?a(0):c>0&&u>0&&o(0)}if(i===s){let c=s===0?1:Math.abs(s*.05);a(s+c),e||o(i-c)}this.min=i,this.max=s}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=e,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,n=e.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,bounds:e.bounds,min:e.min,max:e.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},s=this._range||this,o=f5(i,s);return e.bounds==="ticks"&&HS(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&e.length){const i=(r-n)/Math.max(e.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(e){return cy(e,this.chart.options.locale,this.options.ticks.format)}}class h0 extends gh{determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=xn(e)?e:0,this.max=xn(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,r=Us(this.options.ticks.minRotation),i=(e?Math.sin(r):Math.cos(r))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,s.lineHeight/i))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}De(h0,"id","linear"),De(h0,"defaults",{ticks:{callback:cd.formatters.numeric}});const Wu=t=>Math.floor(Fs(t)),Ao=(t,e)=>Math.pow(10,Wu(t)+e);function Nb(t){return t/Math.pow(10,Wu(t))===1}function Pb(t,e,n){const r=Math.pow(10,n),i=Math.floor(t/r);return Math.ceil(e/r)-i}function h5(t,e){const n=e-t;let r=Wu(n);for(;Pb(t,e,r)>10;)r++;for(;Pb(t,e,r)<10;)r--;return Math.min(r,Wu(t))}function d5(t,{min:e,max:n}){e=mr(t.min,e);const r=[],i=Wu(e);let s=h5(e,n),o=s<0?Math.pow(10,Math.abs(s)):1;const a=Math.pow(10,s),c=i>s?Math.pow(10,i):0,u=Math.round((e-c)*o)/o,l=Math.floor((e-c)/a/10)*a*10;let h=Math.floor((u-l)/Math.pow(10,s)),p=mr(t.min,Math.round((c+l+h*Math.pow(10,s))*o)/o);for(;p<n;)r.push({value:p,major:Nb(p),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(s++,h=2,o=s>=0?1:o),p=Math.round((c+l+h*Math.pow(10,s))*o)/o;const g=mr(t.max,p);return r.push({value:g,major:Nb(g),significand:h}),r}class Mb extends wa{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,n){const r=gh.prototype.parse.apply(this,[e,n]);if(r===0){this._zero=!0;return}return xn(r)&&r>0?r:null}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=xn(e)?Math.max(0,e):null,this.max=xn(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!xn(this._userMin)&&(this.min=e===Ao(this.min,0)?Ao(this.min,-1):Ao(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let r=this.min,i=this.max;const s=a=>r=e?r:a,o=a=>i=n?i:a;r===i&&(r<=0?(s(1),o(10)):(s(Ao(r,-1)),o(Ao(i,1)))),r<=0&&s(Ao(i,-1)),i<=0&&o(Ao(r,1)),this.min=r,this.max=i}buildTicks(){const e=this.options,n={min:this._userMin,max:this._userMax},r=d5(n,this);return e.bounds==="ticks"&&HS(r,this,"value"),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(e){return e===void 0?"0":cy(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=Fs(e),this._valueRange=Fs(this.max)-Fs(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Fs(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const n=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+n*this._valueRange)}}De(Mb,"id","logarithmic"),De(Mb,"defaults",{ticks:{callback:cd.formatters.logarithmic,major:{enabled:!0}}});function d0(t){const e=t.ticks;if(e.display&&t.display){const n=Vn(e.backdropPadding);return et(e.font&&e.font.size,Vt.font.size)+n.height}return 0}function p5(t,e,n){return n=Ft(n)?n:[n],{w:w3(t,e.string,n),h:n.length*e.lineHeight}}function Lb(t,e,n,r,i){return t===r||t===i?{start:e-n/2,end:e+n/2}:t<r||t>i?{start:e-n,end:e}:{start:e,end:e+n}}function g5(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},n=Object.assign({},e),r=[],i=[],s=t._pointLabels.length,o=t.options.pointLabels,a=o.centerPointLabels?mn/s:0;for(let c=0;c<s;c++){const u=o.setContext(t.getPointLabelContext(c));i[c]=u.padding;const l=t.getPointPosition(c,t.drawingArea+i[c],a),h=_n(u.font),p=p5(t.ctx,h,t._pointLabels[c]);r[c]=p;const g=Jr(t.getIndexAngle(c)+a),y=Math.round(iy(g)),w=Lb(y,l.x,p.w,0,180),k=Lb(y,l.y,p.h,90,270);m5(n,e,g,w,k)}t.setCenterPoint(e.l-n.l,n.r-e.r,e.t-n.t,n.b-e.b),t._pointLabelItems=b5(t,r,i)}function m5(t,e,n,r,i){const s=Math.abs(Math.sin(n)),o=Math.abs(Math.cos(n));let a=0,c=0;r.start<e.l?(a=(e.l-r.start)/s,t.l=Math.min(t.l,e.l-a)):r.end>e.r&&(a=(r.end-e.r)/s,t.r=Math.max(t.r,e.r+a)),i.start<e.t?(c=(e.t-i.start)/o,t.t=Math.min(t.t,e.t-c)):i.end>e.b&&(c=(i.end-e.b)/o,t.b=Math.max(t.b,e.b+c))}function y5(t,e,n){const r=t.drawingArea,{extra:i,additionalAngle:s,padding:o,size:a}=n,c=t.getPointPosition(e,r+i+o,s),u=Math.round(iy(Jr(c.angle+xr))),l=k5(c.y,a.h,u),h=w5(u),p=_5(c.x,a.w,h);return{visible:!0,x:c.x,y:l,textAlign:h,left:p,top:l,right:p+a.w,bottom:l+a.h}}function v5(t,e){if(!e)return!0;const{left:n,top:r,right:i,bottom:s}=t;return!(us({x:n,y:r},e)||us({x:n,y:s},e)||us({x:i,y:r},e)||us({x:i,y:s},e))}function b5(t,e,n){const r=[],i=t._pointLabels.length,s=t.options,{centerPointLabels:o,display:a}=s.pointLabels,c={extra:d0(s)/2,additionalAngle:o?mn/i:0};let u;for(let l=0;l<i;l++){c.padding=n[l],c.size=e[l];const h=y5(t,l,c);r.push(h),a==="auto"&&(h.visible=v5(h,u),h.visible&&(u=h))}return r}function w5(t){return t===0||t===180?"center":t<180?"left":"right"}function _5(t,e,n){return n==="right"?t-=e:n==="center"&&(t-=e/2),t}function k5(t,e,n){return n===90||n===270?t-=e/2:(n>270||n<90)&&(t-=e),t}function S5(t,e,n){const{left:r,top:i,right:s,bottom:o}=n,{backdropColor:a}=e;if(!Nt(a)){const c=Za(e.borderRadius),u=Vn(e.backdropPadding);t.fillStyle=a;const l=r-u.left,h=i-u.top,p=s-r+u.width,g=o-i+u.height;Object.values(c).some(y=>y!==0)?(t.beginPath(),hh(t,{x:l,y:h,w:p,h:g,radius:c}),t.fill()):t.fillRect(l,h,p,g)}}function E5(t,e){const{ctx:n,options:{pointLabels:r}}=t;for(let i=e-1;i>=0;i--){const s=t._pointLabelItems[i];if(!s.visible)continue;const o=r.setContext(t.getPointLabelContext(i));S5(n,o,s);const a=_n(o.font),{x:c,y:u,textAlign:l}=s;oa(n,t._pointLabels[i],c,u+a.lineHeight/2,a,{color:o.color,textAlign:l,textBaseline:"middle"})}}function wE(t,e,n,r){const{ctx:i}=t;if(n)i.arc(t.xCenter,t.yCenter,e,0,jr);else{let s=t.getPointPosition(0,e);i.moveTo(s.x,s.y);for(let o=1;o<r;o++)s=t.getPointPosition(o,e),i.lineTo(s.x,s.y)}}function A5(t,e,n,r,i){const s=t.ctx,o=e.circular,{color:a,lineWidth:c}=e;!o&&!r||!a||!c||n<0||(s.save(),s.strokeStyle=a,s.lineWidth=c,s.setLineDash(i.dash),s.lineDashOffset=i.dashOffset,s.beginPath(),wE(t,n,o,r),s.closePath(),s.stroke(),s.restore())}function x5(t,e,n){return po(t,{label:n,index:e,type:"pointLabel"})}class nf extends gh{constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const e=this._padding=Vn(d0(this.options)/2),n=this.width=this.maxWidth-e.width,r=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+n/2+e.left),this.yCenter=Math.floor(this.top+r/2+e.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!1);this.min=xn(e)&&!isNaN(e)?e:0,this.max=xn(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/d0(this.options))}generateTickLabels(e){gh.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((n,r)=>{const i=At(this.options.pointLabels.callback,[n,r],this);return i||i===0?i:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const e=this.options;e.display&&e.pointLabels.display?g5(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,n,r,i){this.xCenter+=Math.floor((e-n)/2),this.yCenter+=Math.floor((r-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,n,r,i))}getIndexAngle(e){const n=jr/(this._pointLabels.length||1),r=this.options.startAngle||0;return Jr(e*n+Us(r))}getDistanceFromCenterForValue(e){if(Nt(e))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*n:(e-this.min)*n}getValueForDistanceFromCenter(e){if(Nt(e))return NaN;const n=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(e){const n=this._pointLabels||[];if(e>=0&&e<n.length){const r=n[e];return x5(this.getContext(),e,r)}}getPointPosition(e,n,r=0){const i=this.getIndexAngle(e)-xr+r;return{x:Math.cos(i)*n+this.xCenter,y:Math.sin(i)*n+this.yCenter,angle:i}}getPointPositionForValue(e,n){return this.getPointPosition(e,this.getDistanceFromCenterForValue(n))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:n,top:r,right:i,bottom:s}=this._pointLabelItems[e];return{left:n,top:r,right:i,bottom:s}}drawBackground(){const{backgroundColor:e,grid:{circular:n}}=this.options;if(e){const r=this.ctx;r.save(),r.beginPath(),wE(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=e,r.fill(),r.restore()}}drawGrid(){const e=this.ctx,n=this.options,{angleLines:r,grid:i,border:s}=n,o=this._pointLabels.length;let a,c,u;if(n.pointLabels.display&&E5(this,o),i.display&&this.ticks.forEach((l,h)=>{if(h!==0||h===0&&this.min<0){c=this.getDistanceFromCenterForValue(l.value);const p=this.getContext(h),g=i.setContext(p),y=s.setContext(p);A5(this,g,c,o,y)}}),r.display){for(e.save(),a=o-1;a>=0;a--){const l=r.setContext(this.getPointLabelContext(a)),{color:h,lineWidth:p}=l;!p||!h||(e.lineWidth=p,e.strokeStyle=h,e.setLineDash(l.borderDash),e.lineDashOffset=l.borderDashOffset,c=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),u=this.getPointPosition(a,c),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(u.x,u.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const i=this.getIndexAngle(0);let s,o;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(i),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((a,c)=>{if(c===0&&this.min>=0&&!n.reverse)return;const u=r.setContext(this.getContext(c)),l=_n(u.font);if(s=this.getDistanceFromCenterForValue(this.ticks[c].value),u.showLabelBackdrop){e.font=l.string,o=e.measureText(a.label).width,e.fillStyle=u.backdropColor;const h=Vn(u.backdropPadding);e.fillRect(-o/2-h.left,-s-l.size/2-h.top,o+h.width,l.size+h.height)}oa(e,a.label,0,-s,l,{color:u.color,strokeColor:u.textStrokeColor,strokeWidth:u.textStrokeWidth})}),e.restore()}drawTitle(){}}De(nf,"id","radialLinear"),De(nf,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:cd.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}}),De(nf,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),De(nf,"descriptors",{angleLines:{_fallback:"grid"}});const fd={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},sr=Object.keys(fd);function Bb(t,e){return t-e}function Db(t,e){if(Nt(e))return null;const n=t._adapter,{parser:r,round:i,isoWeekday:s}=t._parseOpts;let o=e;return typeof r=="function"&&(o=r(o)),xn(o)||(o=typeof r=="string"?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i==="week"&&(zu(s)||s===!0)?n.startOf(o,"isoWeek",s):n.startOf(o,i)),+o)}function $b(t,e,n,r){const i=sr.length;for(let s=sr.indexOf(t);s<i-1;++s){const o=fd[sr[s]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-e)/(a*o.size))<=r)return sr[s]}return sr[i-1]}function R5(t,e,n,r,i){for(let s=sr.length-1;s>=sr.indexOf(n);s--){const o=sr[s];if(fd[o].common&&t._adapter.diff(i,r,o)>=e-1)return o}return sr[n?sr.indexOf(n):0]}function T5(t){for(let e=sr.indexOf(t)+1,n=sr.length;e<n;++e)if(fd[sr[e]].common)return sr[e]}function Fb(t,e,n){if(!n)t[e]=!0;else if(n.length){const{lo:r,hi:i}=sy(n,e),s=n[r]>=e?n[r]:n[i];t[s]=!0}}function O5(t,e,n,r){const i=t._adapter,s=+i.startOf(e[0].value,r),o=e[e.length-1].value;let a,c;for(a=s;a<=o;a=+i.add(a,1,r))c=n[a],c>=0&&(e[c].major=!0);return e}function Ub(t,e,n){const r=[],i={},s=e.length;let o,a;for(o=0;o<s;++o)a=e[o],i[a]=o,r.push({value:a,major:!1});return s===0||!n?r:O5(t,r,i,n)}class mh extends wa{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,n={}){const r=e.time||(e.time={}),i=this._adapter=new RL._date(e.adapters.date);i.init(n),gu(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(e),this._normalized=n.normalized}parse(e,n){return e===void 0?null:Db(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,n=this._adapter,r=e.time.unit||"day";let{min:i,max:s,minDefined:o,maxDefined:a}=this.getUserBounds();function c(u){!o&&!isNaN(u.min)&&(i=Math.min(i,u.min)),!a&&!isNaN(u.max)&&(s=Math.max(s,u.max))}(!o||!a)&&(c(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&c(this.getMinMax(!1))),i=xn(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),s=xn(s)&&!isNaN(s)?s:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,s-1),this.max=Math.max(i+1,s)}_getLabelBounds(){const e=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return e.length&&(n=e[0],r=e[e.length-1]),{min:n,max:r}}buildTicks(){const e=this.options,n=e.time,r=e.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();
vendor: 5,786 bytes, line 23
23e.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const s=this.min,o=this.max,a=i3(i,s,o);return this._unit=n.unit||(r.autoSkip?$b(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):R5(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:T5(this._unit),this.initOffsets(i),e.reverse&&a.reverse(),Ub(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let n=0,r=0,i,s;this.options.offset&&e.length&&(i=this.getDecimalForValue(e[0]),e.length===1?n=1-i:n=(this.getDecimalForValue(e[1])-i)/2,s=this.getDecimalForValue(e[e.length-1]),e.length===1?r=s:r=(s-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;n=Fr(n,0,o),r=Fr(r,0,o),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const e=this._adapter,n=this.min,r=this.max,i=this.options,s=i.time,o=s.unit||$b(s.minUnit,n,r,this._getLabelCapacity(n)),a=et(i.ticks.stepSize,1),c=o==="week"?s.isoWeekday:!1,u=zu(c)||c===!0,l={};let h=n,p,g;if(u&&(h=+e.startOf(h,"isoWeek",c)),h=+e.startOf(h,u?"day":o),e.diff(r,n,o)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+o);const y=i.ticks.source==="data"&&this.getDataTimestamps();for(p=h,g=0;p<r;p=+e.add(p,a,o),g++)Fb(l,p,y);return(p===r||i.bounds==="ticks"||g===1)&&Fb(l,p,y),Object.keys(l).sort(Bb).map(w=>+w)}getLabelForValue(e){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(e,r.tooltipFormat):n.format(e,r.displayFormats.datetime)}format(e,n){const i=this.options.time.displayFormats,s=this._unit,o=n||i[s];return this._adapter.format(e,o)}_tickFormatFunction(e,n,r,i){const s=this.options,o=s.ticks.callback;if(o)return At(o,[e,n,r],this);const a=s.time.displayFormats,c=this._unit,u=this._majorUnit,l=c&&a[c],h=u&&a[u],p=r[n],g=u&&h&&p&&p.major;return this._adapter.format(e,i||(g?h:l))}generateTickLabels(e){let n,r,i;for(n=0,r=e.length;n<r;++n)i=e[n],i.label=this._tickFormatFunction(i.value,n,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const n=this._offsets,r=this.getDecimalForValue(e);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(e){const n=this._offsets,r=this.getDecimalForPixel(e)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(e){const n=this.options.ticks,r=this.ctx.measureText(e).width,i=Us(this.isHorizontal()?n.maxRotation:n.minRotation),s=Math.cos(i),o=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:r*s+a*o,h:r*o+a*s}}_getLabelCapacity(e){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,s=this._tickFormatFunction(e,0,Ub(this,[e],this._majorUnit),i),o=this._getLabelSize(s),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let e=this._cache.data||[],n,r;if(e.length)return e;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)e=e.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let n,r;if(e.length)return e;const i=this.getLabels();for(n=0,r=i.length;n<r;++n)e.push(Db(this,i[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return o3(e.sort(Bb))}}De(mh,"id","time"),De(mh,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function rf(t,e,n){let r=0,i=t.length-1,s,o,a,c;n?(e>=t[r].pos&&e<=t[i].pos&&({lo:r,hi:i}=Ho(t,"pos",e)),{pos:s,time:a}=t[r],{pos:o,time:c}=t[i]):(e>=t[r].time&&e<=t[i].time&&({lo:r,hi:i}=Ho(t,"time",e)),{time:s,pos:a}=t[r],{time:o,pos:c}=t[i]);const u=o-s;return u?a+(c-a)*(e-s)/u:a}class zb extends mh{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(e);this._minPos=rf(n,this.min),this._tableRange=rf(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:r}=this,i=[],s=[];let o,a,c,u,l;for(o=0,a=e.length;o<a;++o)u=e[o],u>=n&&u<=r&&i.push(u);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(o=0,a=i.length;o<a;++o)l=i[o+1],c=i[o-1],u=i[o],Math.round((l+c)/2)!==u&&s.push({time:u,pos:o/(a-1)});return s}_generate(){const e=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(e)||!r.length)&&r.splice(0,0,e),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((i,s)=>i-s)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?e=this.normalize(n.concat(r)):e=n.length?n:r,e=this._cache.all=e,e}getDecimalForValue(e){return(rf(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,r=this.getDecimalForPixel(e)/n.factor-n.end;return rf(this._table,r*this._tableRange+this._minPos,!0)}}De(zb,"id","timeseries"),De(zb,"defaults",mh.defaults);const _E={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},I5={ariaLabel:{type:String},ariaDescribedby:{type:String}},C5={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},..._E,...I5},N5=NS[0]==="2"?(t,e)=>Object.assign(t,{attrs:e}):(t,e)=>Object.assign(t,e);function Na(t){return Jh(t)?Be(t):t}function P5(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t;return Jh(e)?new Proxy(t,{}):t}
23function M5(t,e){const n=t.options;n&&e&&Object.assign(n,e)}function kE(t,e){t.labels=e}function SE(t,e,n){const r=[];t.datasets=e.map(i=>{const s=t.datasets.find(o=>o[n]===i[n]);return!s||!i.data||r.includes(s)?{...i}:(r.push(s),Object.assign(s,i),s)})}function L5(t,e){const n={labels:[],datasets:[]};return kE(n,t.labels),SE(n,t.datasets,e),n}const B5=dr({props:C5,setup(t,e){let{expose:n,slots:r}=e;const i=ct(null),s=ma(null);n({chart:s});const o=()=>{if(!i.value)return;const{type:u,data:l,options:h,plugins:p,datasetIdKey:g}=t,y=L5(l,g),w=P5(y,l);s.value=new ld(i.value,{type:u,data:w,options:{...h},plugins:p})},a=()=>{const u=Be(s.value);u&&(t.destroyDelay>0?setTimeout(()=>{u.destroy(),s.value=null},t.destroyDelay):(u.destroy(),s.value=null))},c=u=>{u.update(t.updateMode)};return xc(o),pl(a),ai([()=>t.options,()=>t.data],(u,l)=>{let[h,p]=u,[g,y]=l;const w=Be(s.value);if(!w)return;let k=!1;if(h){const T=Na(h),C=Na(g);T&&T!==C&&(M5(w,T),k=!0)}if(p){const T=Na(p.labels),C=Na(y.labels),O=Na(p.datasets),I=Na(y.datasets);T!==C&&(kE(w.config.data,T),k=!0),O&&O!==I&&(SE(w.config.data,O,t.datasetIdKey),k=!0)}k&&ho(()=>{c(w)})},{deep:!0}),()=>ii("canvas",{role:"img",ariaLabel:t.ariaLabel,ariaDescribedby:t.ariaDescribedby,ref:i},[ii("p",{},[r.default?r.default():""])])}});function D5(t,e){return ld.register(e),dr({props:_E,setup(n,r){let{expose:i}=r;const s=ma(null),o=a=>{s.value=a==null?void 0:a.chart};return i({chart:s}),()=>ii(B5,N5({ref:o},{type:t,...n}))}})}const $5=D5("line",Tf);ld.register(f0,h0,Cf,iu,QB,a5,XB);const F5={components:{Line:$5,TokenSwitch:Qm},props:["prices","pool"],data(){return{units:"usd",tokenChoices:[{id:0,name:"USD",logo:"/assets/USDC.png"},{id:1,name:"SOL",logo:"/assets/SOL.png"}]}},computed:{chartData(){if(!this.prices)return null;const t=[];if(this.pool.id===0)t.push({label:"ySOL",data:this.prices.map(e=>this.units==="usd"?e["ysol-usdc"]:e["ysol-usdc"]/e["sol-usdc"]),borderColor:"#c12ecd",backgroundColor:"rgba(121, 233, 132, 0.1)",fill:!0}),t.push({label:"jitoSOL",data:this.prices.map(e=>this.units==="usd"?e["jitosol-usdc"]:e["jitosol-usdc"]/e["sol-usdc"]),borderColor:"#74be89",backgroundColor:"rgba(79, 70, 229, 0.1)",fill:!1}),t.push({label:"SOL",data:this.prices.map(e=>this.units==="usd"?e["sol-usdc"]:1),borderColor:"#486ce3",backgroundColor:"rgba(255, 153, 0, 0.1)",fill:!1});else{const e=this.prices.filter(n=>n["yusd-usdc"]!==void 0);return t.push({label:"yUSD",data:e.map(n=>this.units==="usd"?n["yusd-usdc"]:n["yusd-usdc"]/n["sol-usdc"]),borderColor:"#3880de",backgroundColor:"rgba(121, 233, 132, 0.1)",fill:!0}),t.push({label:"USDC",data:e.map(n=>this.units==="usd"?1:1/n["sol-usdc"]),borderColor:"#fff",backgroundColor:"rgba(121, 233, 132, 0.1)",fill:!0}),t.forEach(n=>{Object.assign(n,{borderWidth:2,tension:.4,pointRadius:0,pointHoverRadius:4})}),{labels:e.map(n=>new Date(n.date).toLocaleDateString()),datasets:t}}return t.forEach(e=>{Object.assign(e,{borderWidth:2,tension:.4,pointRadius:0,pointHoverRadius:4})}),{labels:this.prices.map(e=>new Date(e.date).toLocaleDateString()),datasets:t}},chartOptions(){return{responsive:!0,maintainAspectRatio:!1,interaction:{intersect:!1,mode:"index"},plugins:{legend:{display:!0,position:"top",labels:{color:"#c0b5c5",usePointStyle:!0,pointStyle:"circle",boxWidth:6,boxHeight:6,padding:15,generateLabels:t=>{const e=t.data.datasets;return e.map(n=>({text:n.label,fillStyle:n.borderColor,strokeStyle:n.borderColor,lineWidth:0,hidden:!t.isDatasetVisible(e.indexOf(n)),index:e.indexOf(n),fontColor:"#c0b5c5",pointStyle:"circle",radius:2}))}}},tooltip:{backgroundColor:"#584672",titleColor:"#fff",bodyColor:"#fff",borderColor:"#fff",borderWidth:1,padding:10,usePointStyle:!0,boxWidth:6,boxHeight:6,callbacks:{labelColor:t=>({borderColor:"transparent",backgroundColor:t.dataset.borderColor,borderWidth:0,borderRadius:2}),labelPointStyle:t=>({pointStyle:"circle",rotation:0})}}},scales:{x:{grid:{display:!0,color:"rgba(192, 181, 197, 0.1)"},ticks:{color:"#c0b5c5",maxRotation:45,minRotation:45,autoSkip:!0,maxTicksLimit:8}},y:{position:"right",grid:{color:"rgba(192, 181, 197, 0.1)"},ticks:{color:"#c0b5c5",callback:t=>this.units==="usd"?`$${t.toFixed(2)}`:t.toFixed(3)}}}}},currentPrice(){var n;if(!((n=this.prices)!=null&&n.length))return"---";const t=this.prices[this.prices.length-1];let e;if(this.pool.id===0)e=this.units==="usd"?t["ysol-usdc"]:t["ysol-usdc"]/t["sol-usdc"];else{if(!t["yusd-usdc"])return"---";e=this.units==="usd"?t["yusd-usdc"]:t["yusd-usdc"]/t["sol-usdc"]}return this.units==="usd"?`$${e.toFixed(2)}`:`${e.toFixed(3)} â`},lastUpdated(){var t;return(t=this.prices)!=null&&t.length?new Date(this.prices[this.prices.length-1].date).toLocaleDateString():"---"}},methods:{setUnits(t){this.units=t===0?"usd":"sol"},close(){this.$emit("close")}}},EE=t=>(ya("data-v-98aa6bf9"),t=t(),va(),t),U5={class:"chart-container"},z5=EE(()=>ee("i",{class:"fa-solid fa-xmark"},null,-1)),H5=[z5],W5={class:"header"},j5={class:"header-left"},K5={class:"title"},V5={class:"current-price"},q5={class:"chart-wrapper"},G5={class:"bottom-info"},Y5={class:"units-container"},Z5=EE(()=>ee("span",null,Oe("Units"),-1)),X5={class:"last-updated"};function J5(t,e,n,r,i,s){const o=mt("Line"),a=mt("TokenSwitch");return he(),Ee("div",U5,[ee("button",{onClick:e[0]||(e[0]=(...c)=>s.close&&s.close(...c)),class:"close-btn"},H5),ee("div",W5,[ee("div",j5,[ee("p",K5,"Latest "+Oe(n.pool.receiptToken)+" Price",1),ee("p",V5,Oe(s.currentPrice),1)])]),ee("div",q5,[s.chartData?(he(),gn(o,{key:0,data:s.chartData,options:s.chartOptions},null,8,["data","options"])):xt("",!0)]),ee("div",G5,[ee("div",Y5,[Z5,Pe(a,{choices:i.tokenChoices,onToggleSwitch:s.setUnits,sm:!0}
23,null,8,["choices","onToggleSwitch"])]),ee("p",X5,"Updated: "+Oe(s.lastUpdated),1)])])}const Q5=wn(F5,[["render",J5],["__scopeId","data-v-98aa6bf9"]]);const e8={props:["title","disabled"],methods:{processClick(){this.disabled||this.$emit("button-clicked")}}};function t8(t,e,n,r,i,s){return he(),Ee("button",{class:Kt(["form-button",{disabled:!!n.disabled}]),onClick:e[0]||(e[0]=(...o)=>s.processClick&&s.processClick(...o))},Oe(n.title),3)}const n8=wn(e8,[["render",t8],["__scopeId","data-v-bbf673ec"]]),r8={},i8={xmlns:"http://www.w3.org/2000/svg",width:"21",height:"21",viewBox:"0 0 21 21",fill:"none"},s8=ee("path",{d:"M11.375 7.875H6.125M19.25 9.59875V11.4012C19.25 11.8825 18.865 12.2763 18.375 12.2938H16.66C15.715 12.2938 14.8487 11.6025 14.77 10.6575C14.7175 10.1063 14.9275 9.59 15.295 9.23125C15.6187 8.89875 16.065 8.70625 16.555 8.70625H18.375C18.865 8.72375 19.25 9.1175 19.25 9.59875Z",stroke:"#B8A8D6","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),o8=ee("path",{d:"M15.295 9.23125C14.9275 9.59 14.7175 10.1063 14.77 10.6575C14.8487 11.6025 15.715 12.2938 16.66 12.2938H18.375V13.5625C18.375 16.1875 16.625 17.9375 14 17.9375H6.125C3.5 17.9375 1.75 16.1875 1.75 13.5625V7.4375C1.75 5.0575 3.185 3.395 5.41625 3.115C5.64375 3.08 5.88 3.0625 6.125 3.0625H14C14.2275 3.0625 14.4463 3.07125 14.6562 3.10625C16.9137 3.36875 18.375 5.04 18.375 7.4375V8.70625H16.555C16.065 8.70625 15.6187 8.89875 15.295 9.23125Z",stroke:"#B8A8D6","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),a8=[s8,o8];function c8(t,e){return he(),Ee("svg",i8,a8)}const u8=wn(r8,[["render",c8]]),l8={},f8={xmlns:"http://www.w3.org/2000/svg",width:"17",height:"15",viewBox:"0 0 17 15",fill:"none"},h8=ee("path",{d:"M10.9721 12.5063L14.5208 9.36875H2.47917M6.02792 2.49375L2.47917 5.63125H14.5208",stroke:"#B8A8D6","stroke-width":"1.5","stroke-miterlimit":"10","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),d8=[h8];function p8(t,e){return he(),Ee("svg",f8,d8)}const g8=wn(l8,[["render",p8]]);function AE(t,e){return function(){return t.apply(e,arguments)}}const{toString:m8}=Object.prototype,{getPrototypeOf:yy}=Object,hd=(t=>e=>{const n=m8.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Hi=t=>(t=t.toLowerCase(),e=>hd(e)===t),dd=t=>e=>typeof e===t,{isArray:Rc}=Array,ju=dd("undefined");function y8(t){return t!==null&&!ju(t)&&t.constructor!==null&&!ju(t.constructor)&&Kr(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const xE=Hi("ArrayBuffer");function v8(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&xE(t.buffer),e}const b8=dd("string"),Kr=dd("function"),RE=dd("number"),pd=t=>t!==null&&typeof t=="object",w8=t=>t===!0||t===!1,Nf=t=>{if(hd(t)!=="object")return!1;const e=yy(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},_8=Hi("Date"),k8=Hi("File"),S8=Hi("Blob"),E8=Hi("FileList"),A8=t=>pd(t)&&Kr(t.pipe),x8=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Kr(t.append)&&((e=hd(t))==="formdata"||e==="object"&&Kr(t.toString)&&t.toString()==="[object FormData]"))},R8=Hi("URLSearchParams"),T8=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function yl(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,i;if(typeof t!="object"&&(t=[t]),Rc(t))for(r=0,i=t.length;r<i;r++)e.call(null,t[r],r,t);else{const s=n?Object.getOwnPropertyNames(t):Object.keys(t),o=s.length;let a;for(r=0;r<o;r++)a=s[r],e.call(null,t[a],a,t)}}function TE(t,e){e=e.toLowerCase();const n=Object.keys(t);let r=n.length,i;for(;r-- >0;)if(i=n[r],e===i.toLowerCase())return i;return null}const OE=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:ia)(),IE=t=>!ju(t)&&t!==OE;function p0(){const{caseless:t}=IE(this)&&this||{},e={},n=(r,i)=>{const s=t&&TE(e,i)||i;Nf(e[s])&&Nf(r)?e[s]=p0(e[s],r):Nf(r)?e[s]=p0({},r):Rc(r)?e[s]=r.slice():e[s]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&yl(arguments[r],n);return e}const O8=(t,e,n,{allOwnKeys:r}={})=>(yl(e,(i,s)=>{n&&Kr(i)?t[s]=AE(i,n):t[s]=i},{allOwnKeys:r}),t),I8=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),C8=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},N8=(t,e,n,r)=>{let i,s,o;const a={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),s=i.length;s-- >0;
vendor: 4,920 bytes, line 23
23)o=i[s],(!r||r(o,t,e))&&!a[o]&&(e[o]=t[o],a[o]=!0);t=n!==!1&&yy(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},P8=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},M8=t=>{if(!t)return null;if(Rc(t))return t;let e=t.length;if(!RE(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},L8=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&yy(Uint8Array)),B8=(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let i;for(;(i=r.next())&&!i.done;){const s=i.value;e.call(t,s[0],s[1])}},D8=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},$8=Hi("HTMLFormElement"),F8=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),Hb=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),U8=Hi("RegExp"),CE=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};yl(n,(i,s)=>{let o;(o=e(i,s,t))!==!1&&(r[s]=o||i)}),Object.defineProperties(t,r)},z8=t=>{CE(t,(e,n)=>{if(Kr(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(Kr(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},H8=(t,e)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return Rc(t)?r(t):r(String(t).split(e)),n},W8=()=>{},j8=(t,e)=>(t=+t,Number.isFinite(t)?t:e),Lp="abcdefghijklmnopqrstuvwxyz",Wb="0123456789",NE={DIGIT:Wb,ALPHA:Lp,ALPHA_DIGIT:Lp+Lp.toUpperCase()+Wb},K8=(t=16,e=NE.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n};function V8(t){return!!(t&&Kr(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const q8=t=>{const e=new Array(10),n=(r,i)=>{if(pd(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[i]=r;const s=Rc(r)?[]:{};return yl(r,(o,a)=>{const c=n(o,i+1);!ju(c)&&(s[a]=c)}),e[i]=void 0,s}}return r};return n(t,0)},G8=Hi("AsyncFunction"),Y8=t=>t&&(pd(t)||Kr(t))&&Kr(t.then)&&Kr(t.catch),oe={isArray:Rc,isArrayBuffer:xE,isBuffer:y8,isFormData:x8,isArrayBufferView:v8,isString:b8,isNumber:RE,isBoolean:w8,isObject:pd,isPlainObject:Nf,isUndefined:ju,isDate:_8,isFile:k8,isBlob:S8,isRegExp:U8,isFunction:Kr,isStream:A8,isURLSearchParams:R8,isTypedArray:L8,isFileList:E8,forEach:yl,merge:p0,extend:O8,trim:T8,stripBOM:I8,inherits:C8,toFlatObject:N8,kindOf:hd,kindOfTest:Hi,endsWith:P8,toArray:M8,forEachEntry:B8,matchAll:D8,isHTMLForm:$8,hasOwnProperty:Hb,hasOwnProp:Hb,reduceDescriptors:CE,freezeMethods:z8,toObjectSet:H8,toCamelCase:F8,noop:W8,toFiniteNumber:j8,findKey:TE,global:OE,isContextDefined:IE,ALPHABET:NE,generateString:K8,isSpecCompliantForm:V8,toJSONObject:q8,isAsyncFn:G8,isThenable:Y8};function rt(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}oe.inherits(rt,Error,{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:oe.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const PE=rt.prototype,ME={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{ME[t]={value:t}});Object.defineProperties(rt,ME);Object.defineProperty(PE,"isAxiosError",{value:!0});rt.from=(t,e,n,r,i,s)=>{const o=Object.create(PE);return oe.toFlatObject(t,o,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),rt.call(o,t.message,e,n,r,i),o.cause=t,o.name=t.name,s&&Object.assign(o,s),o};const Z8=null;function g0(t){return oe.isPlainObject(t)||oe.isArray(t)}function LE(t){return oe.endsWith(t,"[]")?t.slice(0,-2):t}function jb(t,e,n){return t?t.concat(e).map(function(i,s){return i=LE(i),!n&&s?"["+i+"]":i}).join(n?".":""):e}function X8(t){return oe.isArray(t)&&!t.some(g0)}const J8=oe.toFlatObject(oe,{},null,function(e){return/^is[A-Z]/.test(e)});function gd(t,e,n){if(!oe.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=oe.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,k){return!oe.isUndefined(k[w])});const r=n.metaTokens,i=n.visitor||l,s=n.dots,o=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&oe.isSpecCompliantForm(e);if(!oe.isFunction(i))throw new TypeError("visitor must be a function");function u(y){if(y===null)return"";if(oe.isDate(y))return y.toISOString();if(!c&&oe.isBlob(y))throw new rt("Blob is not supported. Use a Buffer instead.");return oe.isArrayBuffer(y)||oe.isTypedArray(y)?c&&typeof Blob=="function"?new Blob([y]):ne.Buffer.from(y):y}function l(y,w,k){let T=y;
vendor: 4,323 bytes, line 23
23if(y&&!k&&typeof y=="object"){if(oe.endsWith(w,"{}"))w=r?w:w.slice(0,-2),y=JSON.stringify(y);else if(oe.isArray(y)&&X8(y)||(oe.isFileList(y)||oe.endsWith(w,"[]"))&&(T=oe.toArray(y)))return w=LE(w),T.forEach(function(O,I){!(oe.isUndefined(O)||O===null)&&e.append(o===!0?jb([w],I,s):o===null?w:w+"[]",u(O))}),!1}return g0(y)?!0:(e.append(jb(k,w,s),u(y)),!1)}const h=[],p=Object.assign(J8,{defaultVisitor:l,convertValue:u,isVisitable:g0});function g(y,w){if(!oe.isUndefined(y)){if(h.indexOf(y)!==-1)throw Error("Circular reference detected in "+w.join("."));h.push(y),oe.forEach(y,function(T,C){(!(oe.isUndefined(T)||T===null)&&i.call(e,T,oe.isString(C)?C.trim():C,w,p))===!0&&g(T,w?w.concat(C):[C])}),h.pop()}}if(!oe.isObject(t))throw new TypeError("data must be an object");return g(t),e}function Kb(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function vy(t,e){this._pairs=[],t&&gd(t,this,e)}const BE=vy.prototype;BE.append=function(e,n){this._pairs.push([e,n])};BE.toString=function(e){const n=e?function(r){return e.call(this,r,Kb)}:Kb;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function Q8(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function DE(t,e,n){if(!e)return t;const r=n&&n.encode||Q8,i=n&&n.serialize;let s;if(i?s=i(e,n):s=oe.isURLSearchParams(e)?e.toString():new vy(e,n).toString(r),s){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class e4{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){oe.forEach(this.handlers,function(r){r!==null&&e(r)})}}const Vb=e4,$E={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},t4=typeof URLSearchParams<"u"?URLSearchParams:vy,n4=typeof FormData<"u"?FormData:null,r4=typeof Blob<"u"?Blob:null,i4={isBrowser:!0,classes:{URLSearchParams:t4,FormData:n4,Blob:r4},protocols:["http","https","file","blob","url","data"]},FE=typeof window<"u"&&typeof document<"u",s4=(t=>FE&&["ReactNative","NativeScript","NS"].indexOf(t)<0)(typeof navigator<"u"&&navigator.product),o4=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),a4=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:FE,hasStandardBrowserEnv:s4,hasStandardBrowserWebWorkerEnv:o4},Symbol.toStringTag,{value:"Module"})),Ti={...a4,...i4};function c4(t,e){return gd(t,new Ti.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,s){return Ti.isNode&&oe.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function u4(t){return oe.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function l4(t){const e={},n=Object.keys(t);let r;const i=n.length;let s;for(r=0;r<i;r++)s=n[r],e[s]=t[s];return e}function UE(t){function e(n,r,i,s){let o=n[s++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),c=s>=n.length;return o=!o&&oe.isArray(i)?i.length:o,c?(oe.hasOwnProp(i,o)?i[o]=[i[o],r]:i[o]=r,!a):((!i[o]||!oe.isObject(i[o]))&&(i[o]=[]),e(n,r,i[o],s)&&oe.isArray(i[o])&&(i[o]=l4(i[o])),!a)}if(oe.isFormData(t)&&oe.isFunction(t.entries)){const n={};return oe.forEachEntry(t,(r,i)=>{e(u4(r),i,n,0)}),n}return null}function f4(t,e,n){if(oe.isString(t))try{return(e||JSON.parse)(t),oe.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const by={transitional:$E,adapter:["xhr","http"],transformRequest:[function(e,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=oe.isObject(e);if(s&&oe.isHTMLForm(e)&&(e=new FormData(e)),oe.isFormData(e))return i?JSON.stringify(UE(e)):e;if(oe.isArrayBuffer(e)||oe.isBuffer(e)||oe.isStream(e)||oe.isFile(e)||oe.isBlob(e))return e;if(oe.isArrayBufferView(e))return e.buffer;if(oe.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(s){if(r.indexOf("application/x-www-form-urlencoded")>
vendor: 4,102 bytes, lines 23-25
23-1)return c4(e,this.formSerializer).toString();if((a=oe.isFileList(e))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return gd(a?{"files[]":e}:e,c&&new c,this.formSerializer)}}return s||i?(n.setContentType("application/json",!1),f4(e)):e}],transformResponse:[function(e){const n=this.transitional||by.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(e&&oe.isString(e)&&(r&&!this.responseType||i)){const o=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(a){if(o)throw a.name==="SyntaxError"?rt.from(a,rt.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ti.classes.FormData,Blob:Ti.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};oe.forEach(["delete","get","head","post","put","patch"],t=>{by.headers[t]={}});const wy=by,h4=oe.toObjectSet(["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"]),d4=t=>{const e={};let n,r,i;return t&&t.split(` 24`).forEach(function(o){i=o.indexOf(":"),n=o.substring(0,i).trim().toLowerCase(),r=o.substring(i+1).trim(),!(!n||e[n]&&h4[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},qb=Symbol("internals");function qc(t){return t&&String(t).trim().toLowerCase()}function Pf(t){return t===!1||t==null?t:oe.isArray(t)?t.map(Pf):String(t)}function p4(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const g4=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Bp(t,e,n,r,i){if(oe.isFunction(r))return r.call(this,e,n);if(i&&(e=n),!!oe.isString(e)){if(oe.isString(r))return e.indexOf(r)!==-1;if(oe.isRegExp(r))return r.test(e)}}function m4(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function y4(t,e){const n=oe.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(i,s,o){return this[r].call(this,e,i,s,o)},configurable:!0})})}class md{constructor(e){e&&this.set(e)}set(e,n,r){const i=this;function s(a,c,u){const l=qc(c);if(!l)throw new Error("header name must be a non-empty string");const h=oe.findKey(i,l);(!h||i[h]===void 0||u===!0||u===void 0&&i[h]!==!1)&&(i[h||c]=Pf(a))}const o=(a,c)=>oe.forEach(a,(u,l)=>s(u,l,c));return oe.isPlainObject(e)||e instanceof this.constructor?o(e,n):oe.isString(e)&&(e=e.trim())&&!g4(e)?o(d4(e),n):e!=null&&s(n,e,r),this}get(e,n){if(e=qc(e),e){const r=oe.findKey(this,e);if(r){const i=this[r];if(!n)return i;if(n===!0)return p4(i);if(oe.isFunction(n))return n.call(this,i,r);if(oe.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=qc(e),e){const r=oe.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||Bp(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let i=!1;function s(o){if(o=qc(o),o){const a=oe.findKey(r,o);a&&(!n||Bp(r,r[a],a,n))&&(delete r[a],i=!0)}}return oe.isArray(e)?e.forEach(s):s(e),i}clear(e){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const s=n[r];(!e||Bp(this,this[s],s,e,!0))&&(delete this[s],i=!0)}return i}normalize(e){const n=this,r={};return oe.forEach(this,(i,s)=>{const o=oe.findKey(r,s);if(o){n[o]=Pf(i),delete n[s];return}const a=e?m4(s):String(s).trim();a!==s&&delete n[s],n[a]=Pf(i),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return oe.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=e&&oe.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(` 25`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);
25return n.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[qb]=this[qb]={accessors:{}}).accessors,i=this.prototype;function s(o){const a=qc(o);r[a]||(y4(i,o),r[a]=!0)}return oe.isArray(e)?e.forEach(s):s(e),this}}md.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);oe.reduceDescriptors(md.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});oe.freezeMethods(md);const fs=md;function Dp(t,e){const n=this||wy,r=e||n,i=fs.from(r.headers);let s=r.data;return oe.forEach(t,function(a){s=a.call(n,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function zE(t){return!!(t&&t.__CANCEL__)}function vl(t,e,n){rt.call(this,t??"canceled",rt.ERR_CANCELED,e,n),this.name="CanceledError"}oe.inherits(vl,rt,{__CANCEL__:!0});function v4(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new rt("Request failed with status code "+n.status,[rt.ERR_BAD_REQUEST,rt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const b4=Ti.hasStandardBrowserEnv?{write(t,e,n,r,i,s){const o=[t+"="+encodeURIComponent(e)];oe.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),oe.isString(r)&&o.push("path="+r),oe.isString(i)&&o.push("domain="+i),s===!0&&o.push("secure"),document.cookie=o.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function w4(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function _4(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function HE(t,e){return t&&!w4(e)?_4(t,e):e}const k4=Ti.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function i(s){let o=s;return e&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{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 r=i(window.location.href),function(o){const a=oe.isString(o)?i(o):o;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}();function S4(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function E4(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i=0,s=0,o;return e=e!==void 0?e:1e3,function(c){const u=Date.now(),l=r[s];o||(o=u),n[i]=c,r[i]=u;let h=s,p=0;for(;h!==i;)p+=n[h++],h=h%t;if(i=(i+1)%t,i===s&&(s=(s+1)%t),u-o<e)return;const g=l&&u-l;return g?Math.round(p*1e3/g):void 0}}function Gb(t,e){let n=0;const r=E4(50,250);return i=>{const s=i.loaded,o=i.lengthComputable?i.total:void 0,a=s-n,c=r(a),u=s<=o;n=s;const l={loaded:s,total:o,progress:o?s/o:void 0,bytes:a,rate:c||void 0,estimated:c&&o&&u?(o-s)/c:void 0,event:i};l[e?"download":"upload"]=!0,t(l)}}const A4=typeof XMLHttpRequest<"u",x4=A4&&function(t){return new Promise(function(n,r){let i=t.data;const s=fs.from(t.headers).normalize();let{responseType:o,withXSRFToken:a}=t,c;function u(){t.cancelToken&&t.cancelToken.unsubscribe(c),t.signal&&t.signal.removeEventListener("abort",c)}let l;if(oe.isFormData(i)){if(Ti.hasStandardBrowserEnv||Ti.hasStandardBrowserWebWorkerEnv)s.setContentType(!1);else if((l=s.getContentType())!==!1){const[w,...k]=l?l.split(";").map(T=>T.trim()).filter(Boolean):[];s.setContentType([w||"multipart/form-data",...k].join("; "))}}let h=new XMLHttpRequest;if(t.auth){const w=t.auth.username||"",k=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";s.set("Authorization","Basic "+btoa(w+":"+k))}const p=HE(t.baseURL,t.url);h.open(t.method.toUpperCase(),DE(p,t.params,t.paramsSerializer),!0),h.timeout=t.timeout;function g(){if(!h)return;const w=fs.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),T={data:!o||o==="text"||o==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:w,config:t,request:h};v4(function(O){n(O),u()},function(O){r(O),u()},T),h=null}if("onloadend"in h?h.onloadend=g:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(g)},h.onabort=function(){h&&(r(new rt("Request aborted",rt.ECONNABORTED,t,h)),h=null)},h.onerror=function(){r(new rt("Network Error",rt.ERR_NETWORK,t,h)),h=null},h.ontimeout=function(){let k=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const T=t.transitional||$E;t.timeoutErrorMessage&&(k=t.timeoutErrorMessage),r(new rt(k,T.clarifyTimeoutError?rt.ETIMEDOUT:rt.ECONNABORTED,t,h)),h=null},Ti.hasStandardBrowserEnv&&(a&&oe.isFunction(a)&&(a=a(t)),a||a!==!1&&k4(p))){const w=t.xsrfHeaderName&&t.xsrfCookieName&&b4.read(t.xsrfCookieName);w&&s.set(t.xsrfHeaderName,w)}i===void 0&&s.setContentType(null),"setRequestHeader"in h&&oe.forEach(s.toJSON(),function(k,T){h.setRequestHeader(T,k)}
25),oe.isUndefined(t.withCredentials)||(h.withCredentials=!!t.withCredentials),o&&o!=="json"&&(h.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&h.addEventListener("progress",Gb(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&h.upload&&h.upload.addEventListener("progress",Gb(t.onUploadProgress)),(t.cancelToken||t.signal)&&(c=w=>{h&&(r(!w||w.type?new vl(null,t,h):w),h.abort(),h=null)},t.cancelToken&&t.cancelToken.subscribe(c),t.signal&&(t.signal.aborted?c():t.signal.addEventListener("abort",c)));const y=S4(p);if(y&&Ti.protocols.indexOf(y)===-1){r(new rt("Unsupported protocol "+y+":",rt.ERR_BAD_REQUEST,t));return}h.send(i||null)})},m0={http:Z8,xhr:x4};oe.forEach(m0,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Yb=t=>`- ${t}`,R4=t=>oe.isFunction(t)||t===null||t===!1,WE={getAdapter:t=>{t=oe.isArray(t)?t:[t];const{length:e}=t;let n,r;const i={};for(let s=0;s<e;s++){n=t[s];let o;if(r=n,!R4(n)&&(r=m0[(o=String(n)).toLowerCase()],r===void 0))throw new rt(`Unknown adapter '${o}'`);if(r)break;i[o||"#"+s]=r}if(!r){const s=Object.entries(i).map(([a,c])=>`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build"));let o=e?s.length>1?`since : 26`+s.map(Yb).join(` 27`):" "+Yb(s[0]):"as no adapter specified";throw new rt("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:m0};function $p(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new vl(null,t)}function Zb(t){return $p(t),t.headers=fs.from(t.headers),t.data=Dp.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),WE.getAdapter(t.adapter||wy.adapter)(t).then(function(r){return $p(t),r.data=Dp.call(t,t.transformResponse,r),r.headers=fs.from(r.headers),r},function(r){return zE(r)||($p(t),r&&r.response&&(r.response.data=Dp.call(t,t.transformResponse,r.response),r.response.headers=fs.from(r.response.headers))),Promise.reject(r)})}const Xb=t=>t instanceof fs?{...t}:t;function fc(t,e){e=e||{};const n={};function r(u,l,h){return oe.isPlainObject(u)&&oe.isPlainObject(l)?oe.merge.call({caseless:h},u,l):oe.isPlainObject(l)?oe.merge({},l):oe.isArray(l)?l.slice():l}function i(u,l,h){if(oe.isUndefined(l)){if(!oe.isUndefined(u))return r(void 0,u,h)}else return r(u,l,h)}function s(u,l){if(!oe.isUndefined(l))return r(void 0,l)}function o(u,l){if(oe.isUndefined(l)){if(!oe.isUndefined(u))return r(void 0,u)}else return r(void 0,l)}function a(u,l,h){if(h in e)return r(u,l);if(h in t)return r(void 0,u)}const c={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(u,l)=>i(Xb(u),Xb(l),!0)};return oe.forEach(Object.keys(Object.assign({},t,e)),function(l){const h=c[l]||i,p=h(t[l],e[l],l);oe.isUndefined(p)&&h!==a||(n[l]=p)}),n}const jE="1.6.8",_y={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{_y[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const Jb={};_y.transitional=function(e,n,r){function i(s,o){return"[Axios v"+jE+"] Transitional option '"+s+"'"+o+(r?". "+r:"")}return(s,o,a)=>{if(e===!1)throw new rt(i(o," has been removed"+(n?" in "+n:"")),rt.ERR_DEPRECATED);return n&&!Jb[o]&&(Jb[o]=!0,console.warn(i(o," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(s,o,a):!0}};function T4(t,e,n){if(typeof t!="object")throw new rt("options must be an object",rt.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const s=r[i],o=e[s];if(o){const a=t[s],c=a===void 0||o(a,s,t);if(c!==!0)throw new rt("option "+s+" must be "+c,rt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new rt("Unknown option "+s,rt.ERR_BAD_OPTION)}}const y0={assertOptions:T4,validators:_y},As=y0.validators;class yh{constructor(e){this.defaults=e,this.interceptors={request:new Vb,response:new Vb}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const s=i.stack?i.stack.replace(/^.+\n/,""):"";r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=` 28`+s):r.stack=s}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=fc(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&y0.assertOptions(r,{silentJSONParsing:As.transitional(As.boolean),forcedJSONParsing:As.transitional(As.boolean),clarifyTimeoutError:As.transitional(As.boolean)}
vendor: 2,629 bytes, line 28
28,!1),i!=null&&(oe.isFunction(i)?n.paramsSerializer={serialize:i}:y0.assertOptions(i,{encode:As.function,serialize:As.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&oe.merge(s.common,s[n.method]);s&&oe.forEach(["delete","get","head","post","put","patch","common"],y=>{delete s[y]}),n.headers=fs.concat(o,s);const a=[];let c=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(n)===!1||(c=c&&w.synchronous,a.unshift(w.fulfilled,w.rejected))});const u=[];this.interceptors.response.forEach(function(w){u.push(w.fulfilled,w.rejected)});let l,h=0,p;if(!c){const y=[Zb.bind(this),void 0];for(y.unshift.apply(y,a),y.push.apply(y,u),p=y.length,l=Promise.resolve(n);h<p;)l=l.then(y[h++],y[h++]);return l}p=a.length;let g=n;for(h=0;h<p;){const y=a[h++],w=a[h++];try{g=y(g)}catch(k){w.call(this,k);break}}try{l=Zb.call(this,g)}catch(y){return Promise.reject(y)}for(h=0,p=u.length;h<p;)l=l.then(u[h++],u[h++]);return l}getUri(e){e=fc(this.defaults,e);const n=HE(e.baseURL,e.url);return DE(n,e.params,e.paramsSerializer)}}oe.forEach(["delete","get","head","options"],function(e){yh.prototype[e]=function(n,r){return this.request(fc(r||{},{method:e,url:n,data:(r||{}).data}))}});oe.forEach(["post","put","patch"],function(e){function n(r){return function(s,o,a){return this.request(fc(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}yh.prototype[e]=n(),yh.prototype[e+"Form"]=n(!0)});const Mf=yh;class ky{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(i=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(a=>{r.subscribe(a),s=a}).then(i);return o.cancel=function(){r.unsubscribe(s)},o},e(function(s,o,a){r.reason||(r.reason=new vl(s,o,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}static source(){let e;return{token:new ky(function(i){e=i}),cancel:e}}}const O4=ky;function I4(t){return function(n){return t.apply(null,n)}}function C4(t){return oe.isObject(t)&&t.isAxiosError===!0}const v0={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,Parti
28alContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(v0).forEach(([t,e])=>{v0[e]=t});const N4=v0;function KE(t){const e=new Mf(t),n=AE(Mf.prototype.request,e);return oe.extend(n,Mf.prototype,e,{allOwnKeys:!0}),oe.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return KE(fc(t,i))},n}const vn=KE(wy);vn.Axios=Mf;vn.CanceledError=vl;vn.CancelToken=O4;vn.isCancel=zE;vn.VERSION=jE;vn.toFormData=gd;vn.AxiosError=rt;vn.Cancel=vn.CanceledError;vn.all=function(e){return Promise.all(e)};vn.spread=I4;vn.isAxiosError=C4;vn.mergeConfig=fc;vn.AxiosHeaders=fs;vn.formToJSON=t=>UE(oe.isHTMLForm(t)?new FormData(t):t);vn.getAdapter=WE.getAdapter;vn.HttpStatusCode=N4;vn.default=vn;const VE=vn,P4="https://quote-api.jup.ag/v6/quote";class qE{constructor(e=10){this.slippage=e,this.axios=VE.create({headers:{"Content-Type":"application/json"}})}async getQuote(e,n,r){const{data:i}=await this.axios.get(`${P4}?inputMint=${e}&outputMint=${n}&amount=${r}`);return i}}const M4={props:["settings"],components:{Button:n8,WalletIcon:u8,SwapIcon:g8},setup(){return{jup:new qE}},computed:{tokenBalance(){return parseFloat((this.settings.depositTokenBalance/this.unitFactor).toFixed(this.settings.decimals))},exchangeRate(){const t=this.invertExchangeRate?1/this.settings.exchangeRate:this.settings.exchangeRate;return parseFloat(t.toFixed(6))},validExchange(){return this.depositAmount&&this.depositAmount*this.unitFactor<=this.settings.depositTokenBalance&&this.receiveAmount*this.unitFactor<=this.settings.capacity},unitFactor(){return Math.pow(10,this.settings.decimals)},receiveAmount(){return parseFloat((this.depositAmount*this.settings.exchangeRate).toFixed(this.settings.decimals))},emitSelection(t){this.$emit("dropdown",t)},recommendJup(){return this.depositAmount?this.settings.capacity?this.jupQuote>this.receiveAmount*this.unitFactor?"Better rates found on Jupiter":"":"Swap on Jupiter":""}},watch:{settings(t,e){t.depositToken!==e.depositToken&&(this.depositAmount=0,this.$refs.depositInput.value="")},async depositAmount(t){let e=(t||1)*this.unitFactor,n=0;try{const r=await this.jup.getQuote(this.settings.depositTokenMint,this.settings.withdrawTokenMint,e);n=parseInt(r.outAmount)}catch(r){console.log(r)}this.depositAmount===t&&(this.jupQuote=n)}},data(){return{depositAmount:0,jupQuote:0,invertExchangeRate:!1}},methods:{setMaxDeposit(){let t=this.settings.depositTokenBalance/this.unitFactor;this.settings.depositToken==="SOL"&&(t=Math.max(t-.05,0));let e;this.settings.capacity===1/0||this.settings.capacity===0?e=this.settings.capacity:e=parseInt(this.settings.capacity/this.settings.exchangeRate)/this.unitFactor,t=Math.min(t,e),this.depositAmount=t,this.$refs.depositInput.value=this.depositAmount},toggleExchangeRate(){this.invertExchangeRate=!this.invertExchangeRate},swap(){const t=Math.floor(this.depositAmount*this.unitFactor);if(!(t<=0)&&!(t>this.settings.depositTokenBalance))return this.$emit(this.settings.action,t)},validateOnKeyDown(t){if(!new Set(["0","1","2","3","4","5","6","7","8","9",".","ArrowLeft","ArrowRight","Backspace"]).has(t.key))return t.preventDefault();t.key==="."&&t.target.value.includes(".")&&t.preventDefault()},validateInput(t){let e=!1,n=t.target.value.split("").filter(i=>i>="0"&&i<="9"?!0:i==="."&&!e?(e=!0,!0):!1).join("");n=n.replace(/^0+(?=\d)/,"").replace(/^0+(?=\.)/,"0");const r=n.indexOf(".");r!==-1&&n.length-r-1>this.settings.decimals&&(n=n.slice(0,r+1+this.settings.decimals)),this.jupQuote=0,t.target.value=n,this.depositAmount=n?parseFloat(t.target.value):0},handleDropdownSelect(t){this.$emit("dropdown",t)}}},yd=t=>(ya("data-v-aa99e4cf"),t=t(),va(),t),L4={class:"form"},B4={class:"form-row"},D4={class:"form-row-title"},$4={class:"w-600 fs-13"},F4={class:"form-row-content"},U4={class:"input-currency"},z4=["src"],H4=["disabled"],W4={class:"form-row"},j4={class:"form-row-title"},K4={class:"w-600 fs-13"},V4={key:0,class:"light-font"},q4={class:"apy-value w-600"},G4={class:"form-row-content disabled-input"},Y4={class:"input-currency"},Z4=["src"],X4=["href"],J4={class:"form-alert"},Q4=yd(()=>ee("i",{class:"fa-solid fa-arrow-right"},null,-1)),e6={key:1,class:"form-notice"},t6={class:"form-info"},n6={class:"form-info-item light-font"},r6=yd(()=>ee("p",null,"Exchange rate",-1)),i6={key:0},s6={key:1},o6=yd(()=>ee("div",{class:"form-info-item light-font"},[ee("p",null,"Network cost"),ee("p",null,"0.000005 SOL")],-1)),a6={class:"form-info-item light-font"},c6=yd(()=>ee("p",null,"Max Priority Fee",-1));function u6(t,e,n,r,i,s){const o=mt("WalletIcon"),a=mt("Button"),c=mt("SwapIcon"),u=jm("tooltip");return he(),Ee("div",L4,[ee("div",B4,[ee("div",D4,[ee("p",$4,"Deposit "+Oe(n.settings.depositToken),1),ee("div",{class:"balance form-row-item light-font",onClick:e[0]||(e[0]=(...l)=>s.setMaxDeposit&&s.setMaxDeposit(...l))},[Pe(o),ee("p",null,Oe(s.tokenBalance)+" "+Oe(n.settings.depositToken),1)])]),ee("div",F4,[ee("div",U4,[ee("img",{class:"logo",src:n.settings.depositLogo},null,8,z4),ee("input",{type:"tel",pattern:"[0-9]*",class:"form-input w-600",placeholder:"0.00",onKeydown:e[1]||(e[1]=(...l)=>s.validateOnKeyDown&&s.validateOnKeyDown(...l)),onInput:e[2]||(e[2]=(...l)=>s.validateInput&&s.validateInput(...l)),ref:"depositInput",disabled:s.exchangeRate<.001,inputmode:"decimal"},null,40,H4)]),ee("button",{class:"max-btn",onClick:e[3]||(e[3]=(...l)=>s.setMaxDeposit&&s.setMaxDeposit(...l))},"Max")])]),ee("div",W4,[ee("div",j4,[ee("p",K4,"Receive "+Oe(n.settings.withdrawToken),1),n.settings.withdrawTokenApy?kr((he(),Ee("p",V4,[Qr(" APY "),ee("span",q4,Oe(parseFloat((n.settings.withdrawTokenApy*100).toFixed(2)))+"%",1)])),[[u,"Computed since pool inception."]]):xt("",!0)]),ee("div",G4,[ee("div",Y4,[ee("img",{class:"logo",src:n.settings.withdrawLogo},null,8,Z4),kr(ee("input",{type:"number",class:"form-input w-600","onUpdate:modelValue":e[4]||(e[4]=l=>s.receiveAmount=l),disabled:""},null,512),[[IN,s.receiveAmount]])])])]),Pe(a,{title:n.settings.buttonTitle,disabled:!s.validExchange,onButtonClicked:s.swap},null,8,["title","disabled","onButtonClicked"]),s.recommendJup?(he(),Ee("a",{key:0,href:`https://jup.ag/swap/${n.settings.depositToken}_${n.settings.depositTokenMint}-${n.settings.withdrawToken}_${n.settings.withdrawTokenMint}`,target:"_blank"}
28,[ee("div",J4,[Qr(Oe(s.recommendJup)+" ",1),Q4])],8,X4)):xt("",!0),n.settings.formNotice?(he(),Ee("div",e6,[ee("p",null,Oe(n.settings.formNotice),1)])):xt("",!0),ee("div",t6,[ee("div",n6,[r6,ee("div",{class:"form-row-item exchange-rate",onClick:e[5]||(e[5]=(...l)=>s.toggleExchangeRate&&s.toggleExchangeRate(...l))},[Pe(c),s.exchangeRate>.001?(he(),Ee("p",i6," 1 "+Oe(i.invertExchangeRate?n.settings.withdrawToken:n.settings.depositToken)+" = "+Oe(s.exchangeRate)+" "+Oe(i.invertExchangeRate?n.settings.depositToken:n.settings.withdrawToken),1)):(he(),Ee("p",s6,"N/A"))])]),o6,ee("div",a6,[c6,ee("p",null,Oe(n.settings.maxPriorityFee)+" SOL",1)])])])}const l6=wn(M4,[["render",u6],["__scopeId","data-v-aa99e4cf"]]);const f6={data(){return{drops:Array.from({length:50},()=>{const t=Math.random()*30+5;return{x:Math.random()*1200,y:Math.random()*-800,width:Math.random()*2+2,length:t,opacity:(30-t)/30*.5+.5,duration:20/t*2,delay:Math.random()*1,color:this.getRandomBlue()}})}},methods:{getRandomBlue(){const t=["#00aaff","#00d2f3","#0088cc","#0099ee","#00bbff"];return t[Math.floor(Math.random()*t.length)]}}},h6={class:"background-rain"},d6={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1200 800",preserveAspectRatio:"xMidYMid",style:{"shape-rendering":"auto",display:"block",background:"rgba(255, 255, 255, 0)"},class:"rain"},p6=["stroke","stroke-width","d"];function g6(t,e,n,r,i,s){return he(),Ee("div",h6,[(he(),Ee("svg",d6,[(he(!0),Ee(Ct,null,so(i.drops,(o,a)=>(he(),Ee("path",{key:a,stroke:o.color,"stroke-linejoin":"round","stroke-linecap":"round","stroke-width":o.width,d:"M0 -"+o.length+"L0 0Z",class:Kt("drop-animation"),style:Ir({"--x":o.x+"px","--y":o.y+"px","--opacity":o.opacity,animationDuration:o.duration+"s",animationDelay:o.delay+"s"})},null,12,p6))),128))]))])}const m6=wn(f6,[["render",g6],["__scopeId","data-v-df91a43d"]]);const y6={},v6={class:"background-waves"},b6=TS('<svg width="100%" height="100%" id="svg" viewBox="0 0 1440 500" xmlns="http://www.w3.org/2000/svg" class="waves transition duration-300 ease-in-out delay-150" data-v-df8ff3a8><defs data-v-df8ff3a8><linearGradient id="gradient" x1="5%" y1="28%" x2="95%" y2="72%" data-v-df8ff3a8><stop offset="5%" stop-color="#346592" data-v-df8ff3a8></stop><stop offset="95%" stop-color="#401449" data-v-df8ff3a8></stop></linearGradient></defs><path d="M 0,500 L 0,75 C 69.95809000343525,64.63929920989351 139.9161800068705,54.27859841978701 197,57 C 254.0838199931295,59.72140158021299 298.2933699759532,75.52490553074546 375,86 C 451.7066300240468,96.47509446925454 560.9103400893164,101.62177945723118 636,89 C 711.0896599106836,76.37822054276882 752.0652696667812,45.98797664032979 813,45 C 873.9347303332188,44.01202335967021 954.828581243559,72.42631398144967 1028,90 C 1101.171418756441,107.57368601855033 1166.6204053589831,114.30676743387153 1234,110 C 1301.3795946410169,105.69323256612847 1370.6897973205084,90.34661628306424 1440,75 L 1440,500 L 0,500 Z" stroke="none" stroke-width="0" fill="url(#gradient)" fill-opacity="0.265" class="transition-all duration-300 ease-in-out delay-150 path-0" data-v-df8ff3a8></path><defs data-v-df8ff3a8><linearGradient id="gradient" x1="5%" y1="28%" x2="95%" y2="72%" data-v-df8ff3a8><stop offset="5%" stop-color="#346592" data-v-df8ff3a8></stop><stop offset="95%" stop-color="#401449" data-v-df8ff3a8></stop></linearGradient></defs><path d="M 0,500 L 0,175 C 79.30882858124355,195.94675369288905 158.6176571624871,216.8935073857781 233,205 C 307.3823428375129,193.1064926142219 376.83819993129504,148.3727241497767 433,139 C 489.16180006870496,129.6272758502233 532.0295431123325,155.61559601511507 587,176 C 641.9704568876675,196.38440398488493 709.0436276193749,211.164891789763 799,212 C 888.9563723806251,212.835108210237 1001.7959464101682,199.72483682583302 1065,194 C 1128.2040535898318,188.27516317416698 1141.772586739952,189.93576090690485 1196,188 C 1250.227413260048,186.06423909309515 1345.113706630024,180.53211954654756 1440,175 L 1440,500 L 0,500 Z" stroke="none" stroke-width="0" fill="url(#gradient)" fill-opacity="0.4" class="transition-all duration-300 ease-in-out delay-150 path-1" data-v-df8ff3a8></path><defs data-v-df8ff3a8><linearGradient id="gradient" x1="5%" y1="28%" x2="95%" y2="72%" data-v-df8ff3a8><stop offset="5%" stop-color="#346592" data-v-df8ff3a8></stop><stop offset="95%" stop-color="#401449" data-v-df8ff3a8></stop></linearGradient></defs><path d="M 0,500 L 0,275 C 51.15905187220888,274.1260735142563 102.31810374441775,273.2521470285125 177,270 C 251.68189625558225,266.7478529714875 349.8866368945379,261.1174854002061 433,269 C 516.1133631054621,276.8825145997939 584.1353486774304,298.277911370663 646,297 C 707.8646513225696,295.722088629337 763.5719683957402,271.77086911714184 836,254 C 908.4280316042598,236.22913088285813 997.5767777396086,224.63861216076947 1066,239
28C 1134.4232222603914,253.36138783923053 1182.1209206458263,293.67468223978017 1241,304 C 1299.8790793541737,314.32531776021983 1369.939539677087,294.6626588801099 1440,275 L 1440,500 L 0,500 Z" stroke="none" stroke-width="0" fill="url(#gradient)" fill-opacity="0.53" class="transition-all duration-300 ease-in-out delay-150 path-2" data-v-df8ff3a8></path><defs data-v-df8ff3a8><linearGradient id="gradient" x1="5%" y1="28%" x2="95%" y2="72%" data-v-df8ff3a8><stop offset="5%" stop-color="#346592" data-v-df8ff3a8></stop><stop offset="95%" stop-color="#401449" data-v-df8ff3a8></stop></linearGradient></defs><path d="M 0,500 L 0,375 C 75.0223290965304,389.38062521470283 150.0446581930608,403.76125042940566 225,400 C 299.9553418069392,396.23874957059434 374.84369632428724,374.33562349708006 432,367 C 489.15630367571276,359.66437650291994 528.5805565097904,366.8962555822741 601,370 C 673.4194434902096,373.1037444177259 778.8340776365511,372.07935417382345 854,362 C 929.1659223634489,351.92064582617655 974.0831329440055,332.7863277224322 1026,339 C 1077.9168670559945,345.2136722775678 1136.8333905874272,376.7753349364479 1207,387 C 1277.1666094125728,397.2246650635521 1358.5833047062865,386.112332531776 1440,375 L 1440,500 L 0,500 Z" stroke="none" stroke-width="0" fill="url(#gradient)" fill-opacity="1" class="transition-all duration-300 ease-in-out delay-150 path-3" data-v-df8ff3a8></path></svg>',1),w6=[b6];function _6(t,e){return he(),Ee("div",v6,w6)}const k6=wn(y6,[["render",_6],["__scopeId","data-v-df8ff3a8"]]);var Fp={exports:{}},Qb;function Sy(){return Qb||(Qb=1,function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(c,u,l){this.fn=c,this.context=u,this.once=l||!1}function s(c,u,l,h,p){if(typeof l!="function")throw new TypeError("The listener must be a function");var g=new i(l,h||c,p),y=n?n+u:u;return c._events[y]?c._events[y].fn?c._events[y]=[c._events[y],g]:c._events[y].push(g):(c._events[y]=g,c._eventsCount++),c}function o(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var u=[],l,h;if(this._eventsCount===0)return u;for(h in l=this._events)e.call(l,h)&&u.push(n?h.slice(1):h);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(l)):u},a.prototype.listeners=function(u){var l=n?n+u:u,h=this._events[l];if(!h)return[];if(h.fn)return[h.fn];for(var p=0,g=h.length,y=new Array(g);p<g;p++)y[p]=h[p].fn;return y},a.prototype.listenerCount=function(u){var l=n?n+u:u,h=this._events[l];return h?h.fn?1:h.length:0},a.prototype.emit=function(u,l,h,p,g,y){var w=n?n+u:u;if(!this._events[w])return!1;var k=this._events[w],T=arguments.length,C,O;if(k.fn){switch(k.once&&this.removeListener(u,k.fn,void 0,!0),T){case 1:return k.fn.call(k.context),!0;case 2:return k.fn.call(k.context,l),!0;case 3:return k.fn.call(k.context,l,h),!0;case 4:return k.fn.call(k.context,l,h,p),!0;case 5:return k.fn.call(k.context,l,h,p,g),!0;case 6:return k.fn.call(k.context,l,h,p,g,y),!0}for(O=1,C=new Array(T-1);O<T;O++)C[O-1]=arguments[O];k.fn.apply(k.context,C)}else{var I=k.length,N;for(O=0;O<I;O++)switch(k[O].once&&this.removeListener(u,k[O].fn,void 0,!0),T){case 1:k[O].fn.call(k[O].context);break;case 2:k[O].fn.call(k[O].context,l);break;case 3:k[O].fn.call(k[O].context,l,h);break;case 4:k[O].fn.call(k[O].context,l,h,p);break;default:if(!C)for(N=1,C=new Array(T-1);N<T;N++)C[N-1]=arguments[N];k[O].fn.apply(k[O].context,C)}}return!0},a.prototype.on=function(u,l,h){return s(this,u,l,h,!1)},a.prototype.once=function(u,l,h){return s(this,u,l,h,!0)},a.prototype.removeListener=function(u,l,h,p){var g=n?n+u:u;if(!this._events[g])return this;if(!l)return o(this,g),this;var y=this._events[g];if(y.fn)y.fn===l&&(!p||y.once)&&(!h||y.context===h)&&o(this,g);else{for(var w=0,k=[],T=y.length;w<T;w++)(y[w].fn!==l||p&&!y[w].once||h&&y[w].context!==h)&&k.push(y[w]);k.length?this._events[g]=k.length===1?k[0]:k:o(this,g)}return this},a.prototype.removeAllListeners=function(u){var l;return u?(l=n?n+u:u,this._events[l]&&o(this,l)):(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}(Fp)),Fp.exports}var S6=Sy();const GE=Ui(S6);
28class er extends Error{constructor(e,n){super(e),this.error=n}}class Ku extends er{constructor(){super(...arguments),this.name="WalletNotReadyError"}}class Lf extends er{constructor(){super(...arguments),this.name="WalletConfigError"}}class b0 extends er{constructor(){super(...arguments),this.name="WalletConnectionError"}}class YE extends er{constructor(){super(...arguments),this.name="WalletDisconnectedError"}}class E6 extends er{constructor(){super(...arguments),this.name="WalletDisconnectionError"}}class Bf extends er{constructor(){super(...arguments),this.name="WalletAccountError"}}class w0 extends er{constructor(){super(...arguments),this.name="WalletPublicKeyError"}}class Oi extends er{constructor(){super(...arguments),this.name="WalletNotConnectedError"}}class Wo extends er{constructor(){super(...arguments),this.name="WalletSendTransactionError"}}class zs extends er{constructor(){super(...arguments),this.name="WalletSignTransactionError"}}class _0 extends er{constructor(){super(...arguments),this.name="WalletSignMessageError"}}var Wt;(function(t){t.Installed="Installed",t.NotDetected="NotDetected",t.Loadable="Loadable",t.Unsupported="Unsupported"})(Wt||(Wt={}));class ZE extends GE{get connected(){return!!this.publicKey}async autoConnect(){await this.connect()}async prepareTransaction(e,n,r={}){const i=this.publicKey;if(!i)throw new Oi;return e.feePayer=e.feePayer||i,e.recentBlockhash=e.recentBlockhash||(await n.getLatestBlockhash({commitment:r.preflightCommitment,minContextSlot:r.minContextSlot})).blockhash,e}}function jo(t){return"version"in t}class A6 extends ZE{async sendTransaction(e,n,r={}){let i=!0;try{if(jo(e)){if(!this.supportedTransactionVersions)throw new Wo("Sending versioned transactions isn't supported by this wallet");if(!this.supportedTransactionVersions.has(e.version))throw new Wo(`Sending transaction version ${e.version} isn't supported by this wallet`);try{e=await this.signTransaction(e);const s=e.serialize();return await n.sendRawTransaction(s,r)}catch(s){throw s instanceof zs?(i=!1,s):new Wo(s==null?void 0:s.message,s)}}else try{const{signers:s,...o}=r;e=await this.prepareTransaction(e,n,o),s!=null&&s.length&&e.partialSign(...s),e=await this.signTransaction(e);const a=e.serialize();return await n.sendRawTransaction(a,o)}catch(s){throw s instanceof zs?(i=!1,s):new Wo(s==null?void 0:s.message,s)}}catch(s){throw i&&this.emit("error",s),s}}async signAllTransactions(e){for(const r of e)if(jo(r)){if(!this.supportedTransactionVersions)throw new zs("Signing versioned transactions isn't supported by this wallet");if(!this.supportedTransactionVersions.has(r.version))throw new zs(`Signing transaction version ${r.version} isn't supported by this wallet`)}const n=[];for(const r of e)n.push(await this.signTransaction(r));return n}}class x6 extends A6{}const Cs="solana:signAndSendTransaction",sf="solana:signMessage",jn="solana:signTransaction",XE="standard:connect",ew="standard:disconnect",JE="standard:events";function R6(t){return XE in t.features&&JE in t.features&&(Cs in t.features||jn in t.features)}class QE extends er{constructor(){super(...arguments),this.name="WalletNotSelectedError"}}class T6 extends er{constructor(){super(...arguments),this.name="WalletNotSelectedError"}}function Ue(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}const O6=Object.freeze(Object.defineProperty({__proto__:null,default:Ue},Symbol.toStringTag,{value:"Module"}));function lr(t){"@babel/helpers - typeof";return lr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},lr(t)}const I6=Object.freeze(Object.defineProperty({__proto__:null,default:lr},Symbol.toStringTag,{value:"Module"}));function C6(t,e){if(lr(t)!=="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(lr(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function eA(t){var e=C6(t,"string");return lr(e)==="symbol"?e:String(e)}function tw(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,eA(r.key),r)}}function ze(t,e,n){return e&&tw(t.prototype,e),n&&tw(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}const N6=Object.freeze(Object.defineProperty({__proto__:null,default:ze},Symbol.toStringTag,{value:"Module"}));function k0(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function P6(t){if(typeof t!="boolean")throw new Error(`Expected boolean, not ${t}`)}function tA(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function M6(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");k0(t.outputLen),k0(t.blockLen)}function L6(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 B6(t,e){tA(t);const n=e.outputLen;if(t.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const Er={number:k0,bool:P6,bytes:tA,hash:M6,exists:L6,output:B6},Up=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const nA=t=>t instanceof Uint8Array,D6=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),zp=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),pi=(t,e)=>t<<32-e|t>>>e,$6=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!$6)throw new Error("Non little-endian hardware is not supported");Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function rA(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function bl(t){if(typeof t=="string"&&(t=rA(t)),!nA(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function iA(...t){const e=new Uint8Array(t.reduce((r,i)=>r+i.length,0));let n=0;return t.forEach(r=>{if(!nA(r))throw new Error("Uint8Array expected");
28e.set(r,n),n+=r.length}),e}class Ey{clone(){return this._cloneInto()}}function _a(t){const e=r=>t().update(bl(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function F6(t){const e=(r,i)=>t(i).update(bl(r)).digest(),n=t({});return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=r=>t(r),e}function sA(t=32){if(Up&&typeof Up.getRandomValues=="function")return Up.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}function U6(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const i=BigInt(32),s=BigInt(4294967295),o=Number(n>>i&s),a=Number(n&s),c=r?4:0,u=r?0:4;t.setUint32(e+c,o,r),t.setUint32(e+u,a,r)}class oA extends Ey{constructor(e,n,r,i){super(),this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=zp(this.buffer)}update(e){Er.exists(this);const{view:n,buffer:r,blockLen:i}=this;e=bl(e);const s=e.length;for(let o=0;o<s;){const a=Math.min(i-this.pos,s-o);if(a===i){const c=zp(e);for(;i<=s-o;o+=i)this.process(c,o);continue}r.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===i&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Er.exists(this),Er.output(e,this),this.finished=!0;const{buffer:n,view:r,blockLen:i,isLE:s}=this;let{pos:o}=this;n[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>i-o&&(this.process(r,0),o=0);for(let h=o;h<i;h++)n[h]=0;U6(r,i-8,BigInt(this.length*8),s),this.process(r,0);const a=zp(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,l=this.get();if(u>l.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h<u;h++)a.setUint32(4*h,l[h],s)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const r=e.slice(0,n);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:n,buffer:r,length:i,finished:s,destroyed:o,pos:a}=this;return e.length=i,e.pos=a,e.finished=s,e.destroyed=o,i%n&&e.buffer.set(r),e}}const of=BigInt(2**32-1),S0=BigInt(32);function aA(t,e=!1){return e?{h:Number(t&of),l:Number(t>>S0&of)}:{h:Number(t>>S0&of)|0,l:Number(t&of)|0}}
vendor: 2,047 bytes, line 28
28function z6(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:o}=aA(t[i],e);[n[i],r[i]]=[s,o]}return[n,r]}const H6=(t,e)=>BigInt(t>>>0)<<S0|BigInt(e>>>0),W6=(t,e,n)=>t>>>n,j6=(t,e,n)=>t<<32-n|e>>>n,K6=(t,e,n)=>t>>>n|e<<32-n,V6=(t,e,n)=>t<<32-n|e>>>n,q6=(t,e,n)=>t<<64-n|e>>>n-32,G6=(t,e,n)=>t>>>n-32|e<<64-n,Y6=(t,e)=>e,Z6=(t,e)=>t,X6=(t,e,n)=>t<<n|e>>>32-n,J6=(t,e,n)=>e<<n|t>>>32-n,Q6=(t,e,n)=>e<<n-32|t>>>64-n,eD=(t,e,n)=>t<<n-32|e>>>64-n;function tD(t,e,n,r){const i=(e>>>0)+(r>>>0);return{h:t+n+(i/2**32|0)|0,l:i|0}}const nD=(t,e,n)=>(t>>>0)+(e>>>0)+(n>>>0),rD=(t,e,n,r)=>e+n+r+(t/2**32|0)|0,iD=(t,e,n,r)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0),sD=(t,e,n,r,i)=>e+n+r+i+(t/2**32|0)|0,oD=(t,e,n,r,i)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)+(i>>>0),aD=(t,e,n,r,i,s)=>e+n+r+i+s+(t/2**32|0)|0,Fe={fromBig:aA,split:z6,toBig:H6,shrSH:W6,shrSL:j6,rotrSH:K6,rotrSL:V6,rotrBH:q6,rotrBL:G6,rotr32H:Y6,rotr32L:Z6,rotlSH:X6,rotlSL:J6,rotlBH:Q6,rotlBL:eD,add:tD,add3L:nD,add3H:rD,add4L:iD,add4H:sD,add5H:aD,add5L:oD},[cD,uD]=Fe.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","0xf40e3585
285771202a","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))),xs=new Uint32Array(80),Rs=new Uint32Array(80);class vd extends oA{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:e,Al:n,Bh:r,Bl:i,Ch:s,Cl:o,Dh:a,Dl:c,Eh:u,El:l,Fh:h,Fl:p,Gh:g,Gl:y,Hh:w,Hl:k}=this;return[e,n,r,i,s,o,a,c,u,l,h,p,g,y,w,k]}set(e,n,r,i,s,o,a,c,u,l,h,p,g,y,w,k){this.Ah=e|0,this.Al=n|0,this.Bh=r|0,this.Bl=i|0,this.Ch=s|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=u|0,this.El=l|0,this.Fh=h|0,this.Fl=p|0,this.Gh=g|0,this.Gl=y|0,this.Hh=w|0,this.Hl=k|0}process(e,n){for(let O=0;O<16;O++,n+=4)xs[O]=e.getUint32(n),Rs[O]=e.getUint32(n+=4);for(let O=16;O<80;O++){const I=xs[O-15]|0,N=Rs[O-15]|0,F=Fe.rotrSH(I,N,1)^Fe.rotrSH(I,N,8)^Fe.shrSH(I,N,7),L=Fe.rotrSL(I,N,1)^Fe.rotrSL(I,N,8)^Fe.shrSL(I,N,7),D=xs[O-2]|0,H=Rs[O-2]|0,z=Fe.rotrSH(D,H,19)^Fe.rotrBH(D,H,61)^Fe.shrSH(D,H,6),K=Fe.rotrSL(D,H,19)^Fe.rotrBL(D,H,61)^Fe.shrSL(D,H,6),_=Fe.add4L(L,K,Rs[O-7],Rs[O-16]),m=Fe.add4H(_,F,z,xs[O-7],xs[O-16]);xs[O]=m|0,Rs[O]=_|0}let{Ah:r,Al:i,Bh:s,Bl:o,Ch:a,Cl:c,Dh:u,Dl:l,Eh:h,El:p,Fh:g,Fl:y,Gh:w,Gl:k,Hh:T,Hl:C}=this;for(let O=0;O<80;O++){const I=Fe.rotrSH(h,p,14)^Fe.rotrSH(h,p,18)^Fe.rotrBH(h,p,41),N=Fe.rotrSL(h,p,14)^Fe.rotrSL(h,p,18)^Fe.rotrBL(h,p,41),F=h&g^~h&w,L=p&y^~p&k,D=Fe.add5L(C,N,L,uD[O],Rs[O]),H=Fe.add5H(D,T,I,F,cD[O],xs[O]),z=D|0,K=Fe.rotrSH(r,i,28)^Fe.rotrBH(r,i,34)^Fe.rotrBH(r,i,39),_=Fe.rotrSL(r,i,28)^Fe.rotrBL(r,i,34)^Fe.rotrBL(r,i,39),m=r&s^r&a^s&a,f=i&o^i&c^o&c;T=w|0,C=k|0,w=g|0,k=y|0,g=h|0,y=p|0,{h,l:p}=Fe.add(u|0,l|0,H|0,z|0),u=a|0,l=c|0,a=s|0,c=o|0,s=r|0,o=i|0;const d=Fe.add3L(z,_,f);r=Fe.add3H(d,H,K,m),i=d|0}({h:r,l:i}=Fe.add(this.Ah|0,this.Al|0,r|0,i|0)),{h:s,l:o}=Fe.add(this.Bh|0,this.Bl|0,s|0,o|0),{h:a,l:c}=Fe.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:u,l}=Fe.add(this.Dh|0,this.Dl|0,u|0,l|0),{h,l:p}=Fe.add(this.Eh|0,this.El|0,h|0,p|0),{h:g,l:y}=Fe.add(this.Fh|0,this.Fl|0,g|0,y|0),{h:w,l:k}=Fe.add(this.Gh|0,this.Gl|0,w|0,k|0),{h:T,l:C}=Fe.add(this.Hh|0,this.Hl|0,T|0,C|0),this.set(r,i,s,o,a,c,u,l,h,p,g,y,w,k,T,C)}roundClean(){xs.fill(0),Rs.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 lD extends vd{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}class fD extends vd{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 hD extends vd{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 cA=_a(()=>new vd);_a(()=>new lD);_a(()=>new fD);_a(()=>new hD);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const uA=
28BigInt(0),bd=BigInt(1),dD=BigInt(2),wd=t=>t instanceof Uint8Array,pD=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function aa(t){if(!wd(t))throw new Error("Uint8Array expected");let e="";for(let n=0;n<t.length;n++)e+=pD[t[n]];return e}function lA(t){const e=t.toString(16);return e.length&1?`0${e}`:e}function Ay(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return BigInt(t===""?"0":`0x${t}`)}function hc(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const n=new Uint8Array(e/2);for(let r=0;r<n.length;r++){const i=r*2,s=t.slice(i,i+2),o=Number.parseInt(s,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");n[r]=o}return n}function ra(t){return Ay(aa(t))}function Ja(t){if(!wd(t))throw new Error("Uint8Array expected");return Ay(aa(Uint8Array.from(t).reverse()))}function Qa(t,e){return hc(t.toString(16).padStart(e*2,"0"))}function vh(t,e){return Qa(t,e).reverse()}function gD(t){return hc(lA(t))}function pn(t,e,n){let r;if(typeof e=="string")try{r=hc(e)}catch(s){throw new Error(`${t} must be valid hex string, got "${e}". Cause: ${s}`)}else if(wd(e))r=Uint8Array.from(e);else throw new Error(`${t} must be hex string or Uint8Array`);const i=r.length;if(typeof n=="number"&&i!==n)throw new Error(`${t} expected ${n} bytes, got ${i}`);return r}function ca(...t){const e=new Uint8Array(t.reduce((r,i)=>r+i.length,0));let n=0;return t.forEach(r=>{if(!wd(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}function mD(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}function yD(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function vD(t){let e;for(e=0;t>uA;t>>=bd,e+=1);return e}function bD(t,e){return t>>BigInt(e)&bd}const wD=(t,e,n)=>t|(n?bd:uA)<<BigInt(e),xy=t=>(dD<<BigInt(t-1))-bd,Hp=t=>new Uint8Array(t),nw=t=>Uint8Array.from(t);function fA(t,e,n){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=Hp(t),i=Hp(t),s=0;const o=()=>{r.fill(1),i.fill(0),s=0},a=(...h)=>n(i,r,...h),c=(h=Hp())=>{i=a(nw([0]),h),r=a(),h.length!==0&&(i=a(nw([1]),h),r=a())},u=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let h=0;const p=[];for(;h<e;){r=a();const g=r.slice();p.push(g),h+=r.length}return ca(...p)};return(h,p)=>{o(),c(h);let g;for(;!(g=p(u()));)c();return o(),g}}const _D={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function Tc(t,e,n={}){const r=(i,s,o)=>{const a=_D[s];if(typeof a!="function")throw new Error(`Invalid validator "${s}", expected function`);const c=t[i];if(!(o&&c===void 0)&&!a(c,t))throw new Error(`Invalid param ${String(i)}=${c} (${typeof c}), expected ${s}`)};for(const[i,s]of Object.entries(e))r(i,s,!1);for(const[i,s]of Object.entries(n))r(i,s,!0);return t}const kD=Object.freeze(Object.defineProperty({__proto__:null,bitGet:bD,bitLen:vD,bitMask:xy,bitSet:wD,bytesToHex:aa,bytesToNumberBE:ra,bytesToNumberLE:Ja,concatBytes:ca,createHmacDrbg:fA,ensureBytes:pn,equalBytes:mD,hexToBytes:hc,hexToNumber:Ay,numberToBytesBE:Qa,numberToBytesLE:vh,numberToHexUnpadded:lA,numberToVarBytesBE:gD,utf8ToBytes:yD,validateObject:Tc},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Rn=BigInt(0),$t=BigInt(1),Bo=BigInt(2),SD=BigInt(3),E0=BigInt(4),rw=BigInt(5),iw=BigInt(8);BigInt(9);BigInt(16);function Bt(t,e){const n=t%e;return n>=Rn?n:e+n}function ED(t,e,n){if(n<=Rn||e<Rn)throw new Error("Expected power/modulo > 0");if(n===$t)return Rn;let r=$t;for(;e>Rn;)e&$t&&(r=r*t%n),t=t*t%n,e>>=$t;return r}function zt(t,e,n){let r=t;for(;e-- >Rn;)r*=r,r%=n;return r}function A0(t,e){if(t===Rn||e<=Rn)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let n=Bt(t,e),r=e,i=Rn,s=$t;for(;n!==Rn;){const a=r/n,c=r%n,u=i-s*a;r=n,n=c,i=s,s=u}if(r!==$t)throw new Error("invert: does not exist");return Bt(i,e)}function AD(t){const e=(t-$t)/Bo;let n,r,i;for(n=t-$t,r=0;n%Bo===Rn;n/=Bo,r++);for(i=Bo;i<t&&ED(i,e,t)!==t-$t;i++);if(r===1){const o=(t+$t)/E0;return function(c,u){const l=c.pow(u,o);if(!c.eql(c.sqr(l),u))throw new Error("Cannot find square root");return l}}
28const s=(n+$t)/Bo;return function(a,c){if(a.pow(c,e)===a.neg(a.ONE))throw new Error("Cannot find square root");let u=r,l=a.pow(a.mul(a.ONE,i),n),h=a.pow(c,s),p=a.pow(c,n);for(;!a.eql(p,a.ONE);){if(a.eql(p,a.ZERO))return a.ZERO;let g=1;for(let w=a.sqr(p);g<u&&!a.eql(w,a.ONE);g++)w=a.sqr(w);const y=a.pow(l,$t<<BigInt(u-g-1));l=a.sqr(y),h=a.mul(h,y),p=a.mul(p,l),u=g}return h}}function xD(t){if(t%E0===SD){const e=(t+$t)/E0;return function(r,i){const s=r.pow(i,e);if(!r.eql(r.sqr(s),i))throw new Error("Cannot find square root");return s}}if(t%iw===rw){const e=(t-rw)/iw;return function(r,i){const s=r.mul(i,Bo),o=r.pow(s,e),a=r.mul(i,o),c=r.mul(r.mul(a,Bo),o),u=r.mul(a,r.sub(c,r.ONE));if(!r.eql(r.sqr(u),i))throw new Error("Cannot find square root");return u}}return AD(t)}const RD=(t,e)=>(Bt(t,e)&$t)===$t,TD=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function OD(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=TD.reduce((r,i)=>(r[i]="function",r),e);return Tc(t,n)}function ID(t,e,n){if(n<Rn)throw new Error("Expected power > 0");if(n===Rn)return t.ONE;if(n===$t)return e;let r=t.ONE,i=e;for(;n>Rn;)n&$t&&(r=t.mul(r,i)),i=t.sqr(i),n>>=$t;return r}function CD(t,e){const n=new Array(e.length),r=e.reduce((s,o,a)=>t.is0(o)?s:(n[a]=s,t.mul(s,o)),t.ONE),i=t.inv(r);return e.reduceRight((s,o,a)=>t.is0(o)?s:(n[a]=t.mul(s,n[a]),t.mul(s,o)),i),n}function Ry(t,e){const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function hA(t,e,n=!1,r={}){if(t<=Rn)throw new Error(`Expected Fp ORDER > 0, got ${t}`);const{nBitLength:i,nByteLength:s}=Ry(t,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=xD(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:s,MASK:xy(i),ZERO:Rn,ONE:$t,create:c=>Bt(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return Rn<=c&&c<t},is0:c=>c===Rn,isOdd:c=>(c&$t)===$t,neg:c=>Bt(-c,t),eql:(c,u)=>c===u,sqr:c=>Bt(c*c,t),add:(c,u)=>Bt(c+u,t),sub:(c,u)=>Bt(c-u,t),mul:(c,u)=>Bt(c*u,t),pow:(c,u)=>ID(a,c,u),div:(c,u)=>Bt(c*A0(u,t),t),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>A0(c,t),sqrt:r.sqrt||(c=>o(a,c)),invertBatch:c=>CD(a,c),cmov:(c,u,l)=>l?u:c,toBytes:c=>n?vh(c,s):Qa(c,s),fromBytes:c=>{if(c.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${c.length}`);return n?Ja(c):ra(c)}});return Object.freeze(a)}function ND(t,e){if(!t.isOdd)throw new Error("Field doesn't have isOdd");const n=t.sqrt(e);return t.isOdd(n)?t.neg(n):n}function PD(t,e,n=!1){t=pn("privateHash",t);const r=t.length,i=Ry(e).nByteLength+8;if(i<24||r<i||r>1024)throw new Error(`hashToPrivateScalar: expected ${i}-1024 bytes of input, got ${r}`);const s=n?Ja(t):ra(t);return Bt(s,e-$t)+$t}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const MD=BigInt(0),Wp=BigInt(1);function dA(t,e){const n=(i,s)=>{const o=s.negate();return i?o:s},r=i=>{const s=Math.ceil(e/i)+1,o=2**(i-1);return{windows:s,windowSize:o}};return{constTimeNegate:n,unsafeLadder(i,s){let o=t.ZERO,a=i;for(;s>MD;)s&Wp&&(o=o.add(a)),a=a.double(),s>>=Wp;return o},precomputeWindow(i,s){const{windows:o,windowSize:a}=r(s),c=[];let u=i,l=u;for(let h=0;h<o;h++){l=u,c.push(l);for(let p=1;p<a;p++)l=l.add(u),c.push(l);u=l.double()}return c},wNAF(i,s,o){const{windows:a,windowSize:c}=r(i);let u=t.ZERO,l=t.BASE;const h=BigInt(2**i-1),p=2**i,g=BigInt(i);for(let y=0;y<a;y++){const w=y*c;let k=Number(o&h);o>>=g,k>c&&(k-=p,o+=Wp);const T=w,C=w+Math.abs(k)-1,O=y%2!==0,I=k<0;k===0?l=l.add(n(O,s[T])):u=u.add(n(I,s[C]))}return{p:u,f:l}},wNAFCached(i,s,o,a){const c=i._WINDOW_SIZE||1;let u=s.get(i);return u||(u=this.precomputeWindow(i,c),c!==1&&s.set(i,a(u))),this.wNAF(c,u,o)}}}function Ty(t){return OD(t.Fp),Tc(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Ry(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Xr=BigInt(0),pr=BigInt(1),af=BigInt(2),LD=BigInt(8),BD={zip215:!0};function DD(t){const e=Ty(t);return Tc(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function Oy(t){const e=DD(t),{Fp:n,n:r,prehash:i,hash:s,randomBytes:o,nByteLength:a,h:c}=e,u=af<<BigInt(a*8)-pr,l=n.create,h=e.uvRatio||((E,x)=>{try{return{isValid:!0,value:n.sqrt(E*n.inv(x))}}catch{return{isValid:!1,value:Xr}}}),p=e.adjustScalarBytes||(E=>E),g=e.domain||((E,x,M)=>
28{if(x.length||M)throw new Error("Contexts/pre-hash are not supported");return E}),y=E=>typeof E=="bigint"&&Xr<E,w=(E,x)=>y(E)&&y(x)&&E<x,k=E=>E===Xr||w(E,u);function T(E,x){if(w(E,x))return E;throw new Error(`Expected valid scalar < ${x}, got ${typeof E} ${E}`)}function C(E){return E===Xr?E:T(E,r)}const O=new Map;function I(E){if(!(E instanceof N))throw new Error("ExtendedPoint expected")}class N{constructor(x,M,P,S){if(this.ex=x,this.ey=M,this.ez=P,this.et=S,!k(x))throw new Error("x required");if(!k(M))throw new Error("y required");if(!k(P))throw new Error("z required");if(!k(S))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(x){if(x instanceof N)throw new Error("extended point not allowed");const{x:M,y:P}=x||{};if(!k(M)||!k(P))throw new Error("invalid affine point");return new N(M,P,pr,l(M*P))}static normalizeZ(x){const M=n.invertBatch(x.map(P=>P.ez));return x.map((P,S)=>P.toAffine(M[S])).map(N.fromAffine)}_setWindowSize(x){this._WINDOW_SIZE=x,O.delete(this)}assertValidity(){const{a:x,d:M}=e;if(this.is0())throw new Error("bad point: ZERO");const{ex:P,ey:S,ez:$,et:ie}=this,le=l(P*P),se=l(S*S),xe=l($*$),Re=l(xe*xe),_e=l(le*x),Xe=l(xe*l(_e+se)),Ie=l(Re+l(M*l(le*se)));if(Xe!==Ie)throw new Error("bad point: equation left != right (1)");const W=l(P*S),q=l($*ie);if(W!==q)throw new Error("bad point: equation left != right (2)")}equals(x){I(x);const{ex:M,ey:P,ez:S}=this,{ex:$,ey:ie,ez:le}=x,se=l(M*le),xe=l($*S),Re=l(P*le),_e=l(ie*S);return se===xe&&Re===_e}is0(){return this.equals(N.ZERO)}negate(){return new N(l(-this.ex),this.ey,this.ez,l(-this.et))}double(){const{a:x}=e,{ex:M,ey:P,ez:S}=this,$=l(M*M),ie=l(P*P),le=l(af*l(S*S)),se=l(x*$),xe=M+P,Re=l(l(xe*xe)-$-ie),_e=se+ie,Xe=_e-le,Ie=se-ie,W=l(Re*Xe),q=l(_e*Ie),Y=l(Re*Ie),te=l(Xe*_e);return new N(W,q,te,Y)}add(x){I(x);const{a:M,d:P}=e,{ex:S,ey:$,ez:ie,et:le}=this,{ex:se,ey:xe,ez:Re,et:_e}=x;if(M===BigInt(-1)){const Q=l(($-S)*(xe+se)),re=l(($+S)*(xe-se)),ce=l(re-Q);if(ce===Xr)return this.double();const ye=l(ie*af*_e),me=l(le*af*Re),ve=me+ye,qe=re+Q,Le=me-ye,Ye=l(ve*ce),Zr=l(qe*Le),Rt=l(ve*Le),_t=l(ce*qe);return new N(Ye,Zr,_t,Rt)}const Xe=l(S*se),Ie=l($*xe),W=l(le*P*_e),q=l(ie*Re),Y=l((S+$)*(se+xe)-Xe-Ie),te=q-W,B=q+W,A=l(Ie-M*Xe),R=l(Y*te),U=l(B*A),j=l(Y*A),V=l(te*B);return new N(R,U,V,j)}subtract(x){return this.add(x.negate())}wNAF(x){return D.wNAFCached(this,O,x,N.normalizeZ)}multiply(x){const{p:M,f:P}=this.wNAF(T(x,r));return N.normalizeZ([M,P])[0]}multiplyUnsafe(x){let M=C(x);return M===Xr?L:this.equals(L)||M===pr?this:this.equals(F)?this.wNAF(M).p:D.unsafeLadder(this,M)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return D.unsafeLadder(this,r).is0()}toAffine(x){const{ex:M,ey:P,ez:S}=this,$=this.is0();x==null&&(x=$?LD:n.inv(S));const ie=l(M*x),le=l(P*x),se=l(S*x);if($)return{x:Xr,y:pr};if(se!==pr)throw new Error("invZ was invalid");return{x:ie,y:le}}clearCofactor(){const{h:x}=e;return x===pr?this:this.multiplyUnsafe(x)}static fromHex(x,M=!1){const{d:P,a:S}=e,$=n.BYTES;x=pn("pointHex",x,$);const ie=x.slice(),le=x[$-1];ie[$-1]=le&-129;const se=Ja(ie);se===Xr||(M?T(se,u):T(se,n.ORDER));const xe=l(se*se),Re=l(xe-pr),_e=l(P*xe-S);let{isValid:Xe,value:Ie}=h(Re,_e);if(!Xe)throw new Error("Point.fromHex: invalid y coordinate");const W=(Ie&pr)===pr,q=(le&128)!==0;if(!M&&Ie===Xr&&q)throw new Error("Point.fromHex: x=0 and x_0=1");return q!==W&&(Ie=l(-Ie)),N.fromAffine({x:Ie,y:se})}static fromPrivateKey(x){return K(x).point}toRawBytes(){const{x,y:M}=this.toAffine(),P=vh(M,n.BYTES);return P[P.length-1]|=x&pr?128:0,P}toHex(){return aa(this.toRawBytes())}}N.BASE=new N(e.Gx,e.Gy,pr,l(e.Gx*e.Gy)),N.ZERO=new N(Xr,pr,pr,Xr);const{BASE:F,ZERO:L}=N,D=dA(N,a*8);function H(E){return Bt(E,r)}function z(E){return H(Ja(E))}function K(E){const x=a;E=pn("private key",E,x);const M=pn("hashed private key",s(E),2*x),P=p(M.slice(0,x)),S=M.slice(x,2*x),$=z(P),ie=F.multiply($),le=ie.toRawBytes();return{head:P,prefix:S,scalar:$,point:ie,pointBytes:le}}function _(E){return K(E).pointBytes}function m(E=new Uint8Array,...x){const M=ca(...x);return z(s(g(M,pn("context",E),!!i)))}function f(E,x,M={}){E=pn("message",E),i&&(E=i(E));const{prefix:P,scalar:S,pointBytes:$}=K(x),ie=m(M.context,P,E),le=F.multiply(ie).toRawBytes(),se=m(M.context,le,$,E),xe=H(ie+se*S);C(xe);const Re=ca(le,vh(xe,n.BYTES));return pn("result",Re,a*2)}const d=BD;function v(E,x,M,P=d){const{context:S,zip215:$}=P,ie=n.BYTES;
28E=pn("signature",E,2*ie),x=pn("message",x),i&&(x=i(x));const le=Ja(E.slice(ie,2*ie));let se,xe,Re;try{se=N.fromHex(M,$),xe=N.fromHex(E.slice(0,ie),$),Re=F.multiplyUnsafe(le)}catch{return!1}if(!$&&se.isSmallOrder())return!1;const _e=m(S,xe.toRawBytes(),se.toRawBytes(),x);return xe.add(se.multiplyUnsafe(_e)).subtract(Re).clearCofactor().equals(N.ZERO)}return F._setWindowSize(8),{CURVE:e,getPublicKey:_,sign:f,verify:v,ExtendedPoint:N,utils:{getExtendedPublicKey:K,randomPrivateKey:()=>o(n.BYTES),precompute(E=8,x=N.BASE){return x._setWindowSize(E),x.multiply(BigInt(3)),x}}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */BigInt(0);BigInt(1);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Iy=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),sw=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);const $D=BigInt(1),x0=BigInt(2),FD=BigInt(5),ow=BigInt(10),UD=BigInt(20),zD=BigInt(40),aw=BigInt(80);function HD(t){const e=Iy,r=t*t%e*t%e,i=zt(r,x0,e)*r%e,s=zt(i,$D,e)*t%e,o=zt(s,FD,e)*s%e,a=zt(o,ow,e)*o%e,c=zt(a,UD,e)*a%e,u=zt(c,zD,e)*c%e,l=zt(u,aw,e)*u%e,h=zt(l,aw,e)*u%e,p=zt(h,ow,e)*o%e;return{pow_p_5_8:zt(p,x0,e)*t%e,b2:r}}function WD(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function jD(t,e){const n=Iy,r=Bt(e*e*e,n),i=Bt(r*r*e,n),s=HD(t*i).pow_p_5_8;let o=Bt(t*r*s,n);const a=Bt(e*o*o,n),c=o,u=Bt(o*sw,n),l=a===t,h=a===Bt(-t,n),p=a===Bt(-t*sw,n);return l&&(o=c),(h||p)&&(o=u),RD(o,n)&&(o=Bt(-o,n)),{isValid:l||h,value:o}}const hs=hA(Iy,void 0,!0),Cy={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:hs,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:cA,randomBytes:sA,adjustScalarBytes:WD,uvRatio:jD},Oc=Oy(Cy);function pA(t,e,n){if(e.length>255)throw new Error("Context is too big");return iA(rA("SigEd25519 no Ed25519 collisions"),new Uint8Array([n?1:0,e.length]),e,t)}Oy({...Cy,domain:pA});Oy({...Cy,domain:pA,prehash:cA});const KD=(hs.ORDER+BigInt(3))/BigInt(8);hs.pow(x0,KD);hs.sqrt(hs.neg(hs.ONE));(hs.ORDER-BigInt(5))/BigInt(8);BigInt(486662);ND(hs,hs.neg(BigInt(486664)));BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235");BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578");BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838");BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function cw(t,e,n,r,i,s,o){try{var a=t[s](o),c=a.value}catch(u){n(u);return}a.done?e(c):Promise.resolve(c).then(r,i)}function ae(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var s=t.apply(e,n);function o(c){cw(s,r,i,o,a,"next",c)}function a(c){cw(s,r,i,o,a,"throw",c)}o(void 0)})}}const VD=Object.freeze(Object.defineProperty({__proto__:null,default:ae},Symbol.toStringTag,{value:"Module"}));function Vu(t,e){return Vu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Vu(t,e)}function ws(t,e){if(typeof e!="function"&&e!==null)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&&Vu(t,e)}const qD=Object.freeze(Object.defineProperty({__proto__:null,default:ws},Symbol.toStringTag,{value:"Module"}));function GD(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ic(t,e){if(e&&(lr(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return GD(t)}const YD=Object.freeze(Object.defineProperty({__proto__:null,default:Ic},Symbol.toStringTag,{value:"Module"}));
vendor: 16,508 bytes, line 28
28function $n(t){return $n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},$n(t)}const ZD=Object.freeze(Object.defineProperty({__proto__:null,default:$n},Symbol.toStringTag,{value:"Module"}));var Ny={exports:{}};Ny.exports;(function(t){(function(e,n){function r(m,f){if(!m)throw new Error(f||"Assertion failed")}function i(m,f){m.super_=f;var d=function(){};d.prototype=f.prototype,m.prototype=new d,m.prototype.constructor=m}function s(m,f,d){if(s.isBN(m))return m;this.negative=0,this.words=null,this.length=0,this.red=null,m!==null&&((f==="le"||f==="be")&&(d=f,f=10),this._init(m||0,f||10,d||"be"))}typeof e=="object"?e.exports=s:n.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=ne.Buffer}catch{}s.isBN=function(f){return f instanceof s?!0:f!==null&&typeof f=="object"&&f.constructor.wordSize===s.wordSize&&Array.isArray(f.words)},s.max=function(f,d){return f.cmp(d)>0?f:d},s.min=function(f,d){return f.cmp(d)<0?f:d},s.prototype._init=function(f,d,v){if(typeof f=="number")return this._initNumber(f,d,v);if(typeof f=="object")return this._initArray(f,d,v);d==="hex"&&(d=16),r(d===(d|0)&&d>=2&&d<=36),f=f.toString().replace(/\s+/g,"");var b=0;f[0]==="-"&&(b++,this.negative=1),b<f.length&&(d===16?this._parseHex(f,b,v):(this._parseBase(f,d,b),v==="le"&&this._initArray(this.toArray(),d,v)))},s.prototype._initNumber=function(f,d,v){f<0&&(this.negative=1,f=-f),f<67108864?(this.words=[f&67108863],this.length=1):f<4503599627370496?(this.words=[f&67108863,f/67108864&67108863],this.length=2):(r(f<9007199254740992),this.words=[f&67108863,f/67108864&67108863,1],this.length=3),v==="le"&&this._initArray(this.toArray(),d,v)},s.prototype._initArray=function(f,d,v){if(r(typeof f.length=="number"),f.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(f.length/3),this.words=new Array(this.length);for(var b=0;b<this.length;b++)this.words[b]=0;var E,x,M=0;if(v==="be")for(b=f.length-1,E=0;b>=0;b-=3)x=f[b]|f[b-1]<<8|f[b-2]<<16,this.words[E]|=x<<M&67108863,this.words[E+1]=x>>>26-M&67108863,M+=24,M>=26&&(M-=26,E++);else if(v==="le")for(b=0,E=0;b<f.length;b+=3)x=f[b]|f[b+1]<<8|f[b+2]<<16,this.words[E]|=x<<M&67108863,this.words[E+1]=x>>>26-M&67108863,M+=24,M>=26&&(M-=26,E++);return this._strip()};function a(m,f){var d=m.charCodeAt(f);if(d>=48&&d<=57)return d-48;if(d>=65&&d<=70)return d-55;if(d>=97&&d<=102)return d-87;r(!1,"Invalid character in "+m)}function c(m,f,d){var v=a(m,d);return d-1>=f&&(v|=a(m,d-1)<<4),v}s.prototype._parseHex=function(f,d,v){this.length=Math.ceil((f.length-d)/6),this.words=new Array(this.length);for(var b=0;b<this.length;b++)this.words[b]=0;var E=0,x=0,M;if(v==="be")for(b=f.length-1;b>=d;b-=2)M=c(f,d,b)<<E,this.words[x]|=M&67108863,E>=18?(E-=18,x+=1,this.words[x]|=M>>>26):E+=8;else{var P=f.length-d;for(b=P%2===0?d+1:d;b<f.length;b+=2)M=c(f,d,b)<<E,this.words[x]|=M&67108863,E>=18?(E-=18,x+=1,this.words[x]|=M>>>26):E+=8}this._strip()};function u(m,f,d,v){for(var b=0,E=0,x=Math.min(m.length,d),M=f;M<x;M++){var P=m.charCodeAt(M)-48;b*=v,P>=49?E=P-49+10:P>=17?E=P-17+10:E=P,r(P>=0&&E<v,"Invalid character"),b+=E}return b}s.prototype._parseBase=function(f,d,v){this.words=[0],this.length=1;for(var b=0,E=1;E<=67108863;E*=d)b++;b--,E=E/d|0;for(var x=f.length-v,M=x%b,P=Math.min(x,x-M)+v,S=0,$=v;$<P;$+=b)S=u(f,$,$+b,d),this.imuln(E),this.words[0]+S<67108864?this.words[0]+=S:this._iaddn(S);if(M!==0){var ie=1;for(S=u(f,$,f.length,d),$=0;$<M;$++)ie*=d;this.imuln(ie),this.words[0]+S<67108864?this.words[0]+=S:this._iaddn(S)}this._strip()},s.prototype.copy=function(f){f.words=new Array(this.length);for(var d=0;d<this.length;d++)f.words[d]=this.words[d];f.length=this.length,f.negative=this.negative,f.red=this.red};function l(m,f){m.words=f.words,m.length=f.length,m.negative=f.negative,m.red=f.red}if(s.prototype._move=function(f){l(f,this)},s.prototype.clone=function(){var f=new s(null);return this.copy(f),f},s.prototype._expand=function(f){for(;this.length<f;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=h}catch{s.prototype.inspect=h}else s.prototype.inspect=h;function h(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var p=["","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"],g=[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],y=[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];s.prototype.toString=function(f,d){f=f||10,d=d|0||1;var v;if(f===16||f==="hex"){v="";for(var b=0,E=0,x=0;x<this.length;x++){var M=this.words[x],P=((M<<b|E)&16777215).toString(16);E=M>>>24-b&16777215,b+=2,b>=26&&(b-=26,x--),E!==0||x!==this.length-1?v=p[6-P.length]+P+v:v=P+v}for(E!==0&&(v=E.toString(16)+v);v.length%d!==0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}if(f===(f|0)&&f>=2&&f<=36){var S=g[f],$=y[f];v="";var ie=this.clone();for(ie.negative=0;!ie.isZero();){var le=ie.modrn($).toString(f);ie=ie.idivn($),ie.isZero()?v=le+v:v=p[S-le.length]+le+v}for(this.isZero()&&(v="0"+v);v.length%d!==0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}r(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var f=this.words[0];return this.length===2?f+=this.words[1]*67108864:this.length===3&&this.words[2]===1?f+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-f:f},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(f,d){return this.toArrayLike(o,f,d)}),s.prototype.toArray=function(f,d){return this.toArrayLike(Array,f,d)};var w=function(f,d){return f.allocUnsafe?f.allocUnsafe(d):new f(d)};s.prototype.toArrayLike=function(f,d,v){this._strip();var b=this.byteLength(),E=v||Math.max(1,b);r(b<=E,"byte array longer than desired length"),r(E>0,"Requested array length <= 0");var x=w(f,E),M=d==="le"?"LE":"BE";return this["_toArrayLike"+M](x,b),x},s.prototype._toArrayLikeLE=function(f,d){for(var v=0,b=0,E=0,x=0;E<this.length;E++){var M=this.words[E]<<x|b;f[v++]=M&255,v<f.length&&(f[v++]=M>>8&255),v<f.length&&(f[v++]=M>>16&255),x===6?(v<f.length&&(f[v++]=M>>24&255),b=0,x=0):(b=M>>>24,x+=2)}if(v<f.length)for(f[v++]=b;v<f.length;)f[v++]=0},s.prototype._toArrayLikeBE=function(f,d){for(var v=f.length-1,b=0,E=0,x=0;E<this.length;E++){var M=this.words[E]<<x|b;f[v--]=M&255,v>=0&&(f[v--]=M>>8&255),v>=0&&(f[v--]=M>>16&255),x===6?(v>=0&&(f[v--]=M>>24&255),b=0,x=0):(b=M>>>24,x+=2)}if(v>=0)for(f[v--]=b;v>=0;)f[v--]=0},Math.clz32?s.prototype._countBits=function(f){return 32-Math.clz32(f)}:s.prototype._countBits=function(f){var d=f,v=0;return d>=4096&&(v+=13,d>>>=13),d>=64&&(v+=7,d>>>=7),d>=8&&(v+=4,d>>>=4),d>=2&&(v+=2,d>>>=2),v+d},s.prototype._zeroBits=function(f){if(f===0)return 26;var d=f,v=0;return d&8191||(v+=13,d>>>=13),d&127||(v+=7,d>>>=7),d&15||(v+=4,d>>>=4),d&3||(v+=2,d>>>=2),d&1||v++,v},s.prototype.bitLength=function(){var f=this.words[this.length-1],d=this._countBits(f);return(this.length-1)*26+d};function k(m){for(var f=new Array(m.bitLength()),d=0;d<f.length;d++){var v=d/26|0,b=d%26;f[d]=m.words[v]>>>b&1}return f}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var f=0,d=0;d<this.length;d++){var v=this._zeroBits(this.words[d]);if(f+=v,v!==26)break}return f},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(f){return this.negative!==0?this.abs().inotn(f).iaddn(1):this.clone()},s.prototype.fromTwos=function(f){return this.testn(f-1)?this.notn(f).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(f){for(;this.length<f.length;)this.words[this.length++]=0;for(var d=0;d<f.length;d++)this.words[d]=this.words[d]|f.words[d];return this._strip()},s.prototype.ior=function(f){return r((this.negative|f.negative)===0),this.iuor(f)},s.prototype.or=function(f){return this.length>f.length?this.clone().ior(f):f.clone().ior(this)},s.prototype.uor=function(f){return this.length>f.length?this.clone().iuor(f):f.clone().iuor(this)},s.prototype.iuand=function(f){var d;this.length>f.length?d=f:d=this;for(var v=0;v<d.length;v++)this.words[v]=this.words[v]&f.words[v];return this.length=d.length,this._strip()},s.prototype.iand=function(f){return r((this.negative|f.negative)===0),this.iuand(f)},s.prototype.and=function(f){return this.length>f.length?this.clone().iand(f):f.clone().iand(this)},s.prototype.uand=function(f){return this.length>f.length?this.clone().iuand(f):f.clone().iuand(this)},s.prototype.iuxor=function(f){var d,v;this.length>f.length?(d=this,v=f):(d=f,v=this);for(var b=0;b<v.length;b++)this.words[b]=d.words[b]^v.words[b];if(this!==d)for(;b<d.length;b++)this.words[b]=d.words[b];return this.length=d.length,this._strip()},s.prototype.ixor=function(f){return r((this.negative|f.negative)===0),this.iuxor(f)},s.prototype.xor=function(f){return this.length>f.length?this.clone().ixor(f):f.clone().ixor(this)},s.prototype.uxor=function(f){return this.length>f.length?this.clone().iuxor(f):f.clone().iuxor(this)},s.prototype.inotn=function(f){r(typeof f=="number"&&f>=0);var d=Math.ceil(f/26)|0,v=f%26;this._expand(d),v>0&&d--;for(var b=0;b<d;b++)this.words[b]=~this.words[b]&67108863;return v>0&&(this.words[b]=~this.words[b]&67108863>>26-v),this._strip()},s.prototype.notn=function(f){return this.clone().inotn(f)},s.prototype.setn=function(f,d){r(typeof f=="number"&&f>=0);var v=f/26|0,b=f%26;return this._expand(v+1),d?this.words[v]=this.words[v]|1<<b:this.words[v]=this.words[v]&~(1<<b),this._strip()},s.prototype.iadd=function(f){var d;if(this.negative!==0&&f.negative===0)return this.negative=0,d=this.isub(f),this.negative^=1,this._normSign();if(this.negative===0&&f.negative!==0)return f.negative=0,d=this.isub(f),f.negative=1,d._normSign();var v,b;this.length>f.length?(v=this,b=f):(v=f,b=this);for(var E=0,x=0;x<b.length;x++)d=(v.words[x]|0)+(b.words[x]|0)+E,this.words[x]=d&67108863,E=d>>>26;for(;E!==0&&x<v.length;x++)d=(v.words[x]|0)+E,this.words[x]=d&67108863,E=d>>>26;if(this.length=v.length,E!==0)this.words[this.length]=E,this.length++;else if(v!==this)for(;x<v.length;x++)this.words[x]=v.words[x];return this},s.prototype.add=function(f){var d;return f.negative!==0&&this.negative===0?(f.negative=0,d=this.sub(f),f.negative^=1,d):f.negative===0&&this.negative!==0?(this.negative=0,d=f.sub(this),this.negative=1,d):this.length>f.length?this.clone().iadd(f):f.clone().iadd(this)},s.prototype.isub=function(f){if(f.negative!==0){f.negative=0;var d=this.iadd(f);return f.negative=1,d._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(f),this.negative=1,this._normSign();var v=this.cmp(f);if(v===0)return this.negative=0,this.length=1,this.words[0]=0,this;var b,E;v>0?(b=this,E=f):(b=f,E=this);for(var x=0,M=0;M<E.length;M++)d=(b.words[M]|0)-(E.words[M]|0)+x,x=d>>26,this.words[M]=d&67108863;for(;x!==0&&M<b.length;M++)d=(b.words[M]|0)+x,x=d>>26,this.words[M]=d&67108863;if(x===0&&M<b.length&&b!==this)for(;M<b.length;M++)this.words[M]=b.words[M];return this.length=Math.max(this.length,M),b!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(f){return this.clone().isub(f)};function T(m,f,d){d.negative=f.negative^m.negative;var v=m.length+f.length|0;d.length=v,v=v-1|0;var b=m.words[0]|0,E=f.words[0]|0,x=b*E,M=x&67108863,P=x/67108864|0;d.words[0]=M;for(var S=1;S<v;S++){for(var $=P>>>26,ie=P&67108863,le=Math.min(S,f.length-1),se=Math.max(0,S-m.length+1);se<=le;se++){var xe=S-se|0;b=m.words[xe]|0,E=f.words[se]|0,x=b*E+ie,$+=x/67108864|0,ie=x&67108863}d.words[S]=ie|0,P=$|0}return P!==0?d.words[S]=P|0:d.length--,d._strip()}var C=function(f,d,v){var b=f.words,E=d.words,x=v.words,M=0,P,S,$,ie=b[0]|0,le=ie&8191,se=ie>>>13,xe=b[1]|0,Re=xe&8191,_e=xe>>>13,Xe=b[2]|0,Ie=Xe&8191,W=Xe>>>13,q=b[3]|0,Y=q&8191,te=q>>>13,B=b[4]|0,A=B&8191,R=B>>>13,U=b[5]|0,j=U&8191,V=U>>>13,Q=b[6]|0,re=Q&8191,ce=Q>>>13,ye=b[7]|0,me=ye&8191,ve=ye>>>13,qe=b[8]|0,Le=qe&8191,Ye=qe>>>13,Zr=b[9]|0,Rt=Zr&8191,_t=Zr>>>13,Fc=E[0]|0,tt=Fc&8191,lt=Fc>>>13,Uc=E[1]|0,Yt=Uc&8191,Zt=Uc>>>13,M1=E[2]|0,Xt=M1&8191,Jt=M1>>>13,L1=E[3]|0,Qt=L1&8191,en=L1>>>13,B1=E[4]|0,tn=B1&8191,nn=B1>>>13,D1=E[5]|0,rn=D1&8191,sn=D1>>>13,$1=E[6]|0,on=$1&8191,an=$1>>>13,F1=E[7]|0,cn=F1&8191,un=F1>>>13,U1=E[8]|0,ln=U1&8191,fn=U1>>>13,z1=E[9]|0,hn=z1&8191,dn=z1>>>13;v.negative=f.negative^d.negative,v.length=19,P=Math.imul(le,tt),S=Math.imul(le,lt),S=S+Math.imul(se,tt)|0,$=Math.imul(se,lt);var ep=(M+P|0)+((S&8191)<<13)|0;M=($+(S>>>13)|0)+(ep>>>26)|0,ep&=67108863,P=Math.imul(Re,tt),S=Math.imul(Re,lt),S=S+Math.imul(_e,tt)|0,$=Math.imul(_e,lt),P=P+Math.imul(le,Yt)|0,S=S+Math.imul(le,Zt)|0,S=S+Math.imul(se,Yt)|0,$=$+Math.imul(se,Zt)|0;var tp=(M+P|0)+((S&8191)<<13)|0;M=($+(S>>>13)|0)+(tp>>>26)|0,tp&=67108863,P=Math.imul(Ie,tt),S=Math.imul(Ie,lt),S=S+Math.imul(W,tt)|0,$=Math.imul(W,lt),P=P+Math.imul(Re,Yt)|0,S=S+Math.imul(Re,Zt)|0,S=S+Math.imul(_e,Yt)|0,$=$+Math.imul(_e,Zt)|0,P=P+Math.imul(le,Xt)|0,S=S+Math.imul(le,Jt)|0,S=S+Math.imul(se,Xt)|0,$=$+Math.imul(se,Jt)|0;var np=(M+P|0)+((S&8191)<<13)|0;M=($+(S>>>13)|0)+(np>>>26)|0,np&=67108863,P=Math.imul(Y,tt),S=Math.imul(Y,lt),S=S+Math.imul(te,tt)|0,$=Math.imul(te,lt),P=P+Math.imul(Ie,Yt)|0,S=S+Math.imul(Ie,Zt)|0,S=S+Math.imul(W,Yt)|0,$=$+Math.imul(W,Zt)|0,P=P+Math.imul(Re,Xt)|0,S=S+Math.imul(Re,Jt)|0,S=S+Math.imul(_e,Xt)|0,$=$+Math.imul(_e,Jt)|0,P=P+Math.imul(le,Qt)|0,S=S+Math.imul(le,en)|0,S=S+Math.imul(se,Qt)|0,$=$+Math.imul(se,en)|0;var rp=(M+P|0)+((S&8191)<<13)|0;M=($+(S>>>13)|0)+(rp>>>26)|0,rp&=67108863,P=Math.imul(A,tt),S=Math.imul(A,lt),S=S+Math.imul(R,tt)|0,$=Math.imul(R,lt),P=P+Math.imul(Y,Yt)|0,S=S+Math.imul(Y,Zt)|0,S=S+Math.imul(te,Yt)|0,$=$+Math.imul(te,Zt)|0,P=P+Math.imul(Ie,Xt)|0,S=S+Math.imul(Ie,Jt)|0,S=S+Math.imul(W,Xt)|0,$=$+Math.imul(W,Jt)|0,P=P+Math.imul(Re,Qt)|0,S=S+Math.imul(Re,en)|0,S=S+Math.imul(_e,Qt)|0,$=$+Math.imul(_e,en)|0,P=P+Math.imul(le,tn)|0,S=S+Math.imul(le,nn)|0,S=S+Math.imul(se,tn)|0,$=$+Math.imul(se,nn)|0;var ip=(M+P|0)+((S&8191)<<13)|0;M=($+(S>>>13)|0)+(ip>>>26)|0,ip&=67108863,P=Math.imul(j,tt),S=Math.imul(j,lt),S=S+Math.imul(V,tt)|0,$=Math.imul(V,lt),P=P+Math.imul(A,Yt)|0,S=S+Math.imul(A,Zt)|0,S=S+Math.imul(R,Yt)|0,$=$+Math.imul(R,Zt)|0,P=P+Math.imul(Y,Xt)|0,S=S+Math.imul(Y,Jt)|0,S=S+Math.imul(te,Xt)|0,$=$+Math.imul(te,Jt)|0,P=P+Math.imul(Ie,Qt)|0,S=S+Math.imul(Ie,en)|0,S=S+Math.imul(W,Qt)|0,$=$+Math.imul(W,en)|0,P=P+Math.imul(Re,tn)|0,S=S+Math.imul(Re,nn)|0,S=S+Math.imul(_e,tn)|0,$=$+Math.imul(_e,nn)|0,P=P+Math.imul(le,rn)|0,S=S+Math.imul(le,sn)|0,S=S+Math.imul(se,rn)|0,$=$+Math.imul(se,sn)|0;var sp=(M+P|0)+((S&8191)<<13)|0;M=($+(S>>>13)|0)+(sp>>>26)|0,sp&=67108863,P=Math.imul(re,tt),S=Math.imul(re,lt),S=S+Math.imul(ce,tt)|0,$=Math.imul(ce,lt),P=P+Math.imul(j,Yt)|0,S=S+Math.imul(j,Zt)|0,S=S+Math.imul(V,Yt)|0,$=$+Math.imul(V,Zt)|0,P=P+Math.imul(A,Xt)|0,S=S+Math.imul(A,Jt)|0,S=S+Math.imul(R,Xt)|0,$=$+Math.imul(R,Jt)|0,P=P+Math.imul(Y,Qt)|0,S=S+Math.imul(Y,en)|0,S=S+Math.imul(te,Qt)|0,$=$+Math.imul(te,en)|0,P=P+Math.imul(Ie,tn)|0,S=S+Math.imul(Ie,nn)|0,S=S+Math.imul(W,tn)|0,$=$+Math.imul(W,nn)|0,P=P+Math.imul(Re,rn)|0,S=S+Math.imul(Re,sn)|0,S=S+Math.imul(_e,rn)|0,$=$+Math.imul(_e,sn)|0,P=P+Math.imul(le,on)|0,S=S+Math.imul(le,an)|0,S=S+Math.imul(se,on)|0,$=$+Math.imul(se,an)|0;var op=(M+P|0)+((S&8191)<<13)|0;M=($+(S>>>13)|0)+(op>>>26)|0,op&=67108863,P=Math.imul(me,tt),S=Math.imul(me,lt),S=S+Math.imul(ve,tt)|0,$=Math.imul(ve,lt),P=P+Math.imul(re,Yt)|0,S=S+Math.imul(re,Zt)|0,S=S+Math.imul(ce,Yt)|0,$=$+Math.imul(ce,Zt)|0,P=P+Math.imul(j,
28Xt)|0,S=S+Math.imul(j,Jt)|0,S=S+Math.imul(V,Xt)|0,$=$+Math.imul(V,Jt)|0,P=P+Math.imul(A,Qt)|0,S=S+Math.imul(A,en)|0,S=S+Math.imul(R,Qt)|0,$=$+Math.imul(R,en)|0,P=P+Math.imul(Y,tn)|0,S=S+Math.imul(Y,nn)|0,S=S+Math.imul(te,tn)|0,$=$+Math.imul(te,nn)|0,P=P+Math.imul(Ie,rn)|0,S=S+Math.imul(Ie,sn)|0,S=S+Math.imul(W,rn)|0,$=$+Math.imul(W,sn)|0,P=P+Math.imul(Re,on)|0,S=S+Math.imul(Re,an)|0,S=S+Math.imul(_e,on)|0,$=$+Math.imul(_e,an)|0,P=P+Math.imul(le,cn)|0,S=S+Math.imul(le,un)|0,S=S+Math.imul(se,cn)|0,$=$+Math.imul(se,un)|0;var ap=(M+P|0)+((S&8191)<<13)|0;M=($+(S>>>13)|0)+(ap>>>26)|0,ap&=67108863,P=Math.imul(Le,tt),S=Math.imul(Le,lt),S=S+Math.imul(Ye,tt)|0,$=Math.imul(Ye,lt),P=P+Math.imul(me,Yt)|0,S=S+Math.imul(me,Zt)|0,S=S+Math.imul(ve,Yt)|0,$=$+Math.imul(ve,Zt)|0,P=P+Math.imul(re,Xt)|0,S=S+Math.imul(re,Jt)|0,S=S+Math.imul(ce,Xt)|0,$=$+Math.imul(ce,Jt)|0,P=P+Math.imul(j,Qt)|0,S=S+Math.imul(j,en)|0,S=S+Math.imul(V,Qt)|0,$=$+Math.imul(V,en)|0,P=P+Math.imul(A,tn)|0,S=S+Math.imul(A,nn)|0,S=S+Math.imul(R,tn)|0,$=$+Math.imul(R,nn)|0,P=P+Math.imul(Y,rn)|0,S=S+Math.imul(Y,sn)|0,S=S+Math.imul(te,rn)|0,$=$+Math.imul(te,sn)|0,P=P+Math.imul(Ie,on)|0,S=S+Math.imul(Ie,an)|0,S=S+Math.imul(W,on)|0,$=$+Math.imul(W,an)|0,P=P+Math.imul(Re,cn)|0,S=S+Math.imul(Re,un)|0,S=S+Math.imul(_e,cn)|0,$=$+Math.imul(_e,un)|0,P=P+Math.imul(le,ln)|0,S=S+Math.imul(le,fn)|0,S=S+Math.imul(se,ln)|0,$=$+Math.imul(se,fn)|0;var cp=(M+P|0)+((S&8191)<<13)|0;M=($+(S>>>13)|0)+(cp>>>26)|0,cp&=67108863,P=Math.imul(Rt,tt),S=Math.imul(Rt,lt),S=S+Math.imul(_t,tt)|0,$=Math.imul(_t,lt),P=P+Math.imul(Le,Yt)|0,S=S+Math.imul(Le,Zt)|0,S=S+Math.imul(Ye,Yt)|0,$=$+Math.imul(Ye,Zt)|0,P=P+Math.imul(me,Xt)|0,S=S+Math.imul(me,Jt)|0,S=S+Math.imul(ve,Xt)|0,$=$+Math.imul(ve,Jt)|0,P=P+Math.imul(re,Qt)|0,S=S+Math.imul(re,en)|0,S=S+Math.imul(ce,Qt)|0,$=$+Math.imul(ce,en)|0,P=P+Math.imul(j,tn)|0,S=S+Math.imul(j,nn)|0,S=S+Math.imul(V,tn)|0,$=$+Math.imul(V,nn)|0,P=P+Math.imul(A,rn)|0,S=S+Math.imul(A,sn)|0,S=S+Math.imul(R,rn)|0,$=$+Math.imul(R,sn)|0,P=P+Math.imul(Y,on)|0,S=S+Math.imul(Y,an)|0,S=S+Math.imul(te,on)|0,$=$+Math.imul(te,an)|0,P=P+Math.imul(Ie,cn)|0,S=S+Math.imul(Ie,un)|0,S=S+Math.imul(W,cn)|0,$=$+Math.imul(W,un)|0,P=P+Math.imul(Re,ln)|0,S=S+Math.imul(Re,fn)|0,S=S+Math.imul(_e,ln)|0,$=$+Math.imul(_e,fn)|0,P=P+Math.imul(le,hn)|0,S=S+Math.imul(le,dn)|0,S=S+Math.imul(se,hn)|0,$=$+Math.imul(se,dn)|0;var up=(M+P|0)+((S&8191)<<13)|0;M=($+(S>>>13)|0)+(up>>>26)|0,up&=67108863,P=Math.imul(Rt,Yt),S=Math.imul(Rt,Zt),S=S+Math.imul(_t,Yt)|0,$=Math.imul(_t,Zt),P=P+Math.imul(Le,Xt)|0,S=S+Math.imul(Le,Jt)|0,S=S+Math.imul(Ye,Xt)|0,$=$+Math.imul(Ye,Jt)|0,P=P+Math.imul(me,Qt)|0,S=S+Math.imul(me,en)|0,S=S+Math.imul(ve,Qt)|0,$=$+Math.imul(ve,en)|0,P=P+Math.imul(re,tn)|0,S=S+Math.imul(re,nn)|0,S=S+Math.imul(ce,tn)|0,$=$+Math.imul(ce,nn)|0,P=P+Math.imul(j,rn)|0,S=S+Math.imul(j,sn)|0,S=S+Math.imul(V,rn)|0,$=$+Math.imul(V,sn)|0,P=P+Math.imul(A,on)|0,S=S+Math.imul(A,an)|0,S=S+Math.imul(R,on)|0,$=$+Math.imul(R,an)|0,P=P+Math.imul(Y,cn)|0,S=S+Math.imul(Y,un)|0,S=S+Math.imul(te,cn)|0,$=$+Math.imul(te,un)|0,P=P+Math.imul(Ie,ln)|0,S=S+Math.imul(Ie,fn)|0,S=S+Math.imul(W,ln)|0,$=$+Math.imul(W,fn)|0,P=P+Math.imul(Re,hn)|0,S=S+Math.imul(Re,dn)|0,S=S+Math.imul(_e,hn)|0,$=$+Math.imul(_e,dn)|0;var lp=(M+P|0)+((S&8191)<<13)|0;M=($+(S>>>13)|0)+(lp>>>26)|0,lp&=67108863,P=Math.imul(Rt,Xt),S=Math.imul(Rt,Jt),S=S+Math.imul(_t,Xt)|0,$=Math.imul(_t,Jt),P=P+Math.imul(Le,Qt)|0,S=S+Math.imul(Le,en)|0,S=S+Math.imul(Ye,Qt)|0,$=$+Math.imul(Ye,en)|0,P=P+Math.imul(me,tn)|0,S=S+Math.imul(me,nn)|0,S=S+Math.imul(ve,tn)|0,$=$+Math.imul(ve,nn)|0,P=P+Math.imul(re,rn)|0,S=S+Math.imul(re,sn)|0,S=S+Math.imul(ce,rn)|0,$=$+Math.imul(ce,sn)|0,P=P+Math.imul(j,on)|0,S=S+Math.imul(j,an)|0,S=S+Math.imul(V,on)|0,$=$+Math.imul(V,an)|0,P=P+Math.imul(A,cn)|0,S=S+Math.imul(A,un)|0,S=S+Math.imul(R,cn)|0,$=$+Math.imul(R,un)|0,P=P+Math.imul(Y,ln)|0,S=S+Math.imul(Y,fn)|0,S=S+Math.imul(te,ln)|0,$=$+Math.imul(te,fn)|0,P=P+Math.imul(Ie,hn)|0,S=S+Math.imul(Ie,dn)|0,S=S+Math.imul(W,hn)|0,$=$+Math.imul(W,dn)|0;var fp=(M+P|0)+((S&8191)<<13)|0;M=($+(S>>>13)|0)+(fp>>>26)|0,fp&=67108863,P=Math.imul(Rt,Qt),S=Math.imul(Rt,en),S=S+Math.imul(_t,Qt)|0,$=Math.imul(_t,en),P=P+Math.imul(Le,tn)|0,S=S+Math.imul(Le,nn)|0,S=S+Math.imul(Ye,tn)|0,$=$+Math.imul(Ye,nn)|0,P=P+Math.imul(me,rn)|0,S=S+Math.imul(me,sn)|0,S=S+Math.imul(ve,rn)|0,$=$+Math.imul(ve,sn)|0,P=P+Math.imul(re,on)|0,S=S+Math.imul(re,an)|0,S=S+Math.imul(ce,on)|0,$=$+Math.imul(ce,an)|0,P=P+Math.imul(j,cn)|0,S=S+Math.imul(j,un)|0,S=S+Math.imul(V,cn)|0,$=$+Math.imul(V,un)|0,P=P+Math.imul(A,ln)|0,S=S+Math.imul(A,fn)|0,S=S+Math.imul(R,ln)|0,$=$+Math.imul(R,fn)|0,P=P+Math.imul(Y,hn)|0,S=S+Math.imul(Y,dn)|0,S=S+Math.imul(te,hn)|0,$=$+Math.imul(te,dn)|0;var hp=(M+P|0)+((S&8191)<<13)|0;M=($+(S>>>13)|0)+(hp>>>
vendor: 20,356 bytes, line 28
2826)|0,hp&=67108863,P=Math.imul(Rt,tn),S=Math.imul(Rt,nn),S=S+Math.imul(_t,tn)|0,$=Math.imul(_t,nn),P=P+Math.imul(Le,rn)|0,S=S+Math.imul(Le,sn)|0,S=S+Math.imul(Ye,rn)|0,$=$+Math.imul(Ye,sn)|0,P=P+Math.imul(me,on)|0,S=S+Math.imul(me,an)|0,S=S+Math.imul(ve,on)|0,$=$+Math.imul(ve,an)|0,P=P+Math.imul(re,cn)|0,S=S+Math.imul(re,un)|0,S=S+Math.imul(ce,cn)|0,$=$+Math.imul(ce,un)|0,P=P+Math.imul(j,ln)|0,S=S+Math.imul(j,fn)|0,S=S+Math.imul(V,ln)|0,$=$+Math.imul(V,fn)|0,P=P+Math.imul(A,hn)|0,S=S+Math.imul(A,dn)|0,S=S+Math.imul(R,hn)|0,$=$+Math.imul(R,dn)|0;var dp=(M+P|0)+((S&8191)<<13)|0;M=($+(S>>>13)|0)+(dp>>>26)|0,dp&=67108863,P=Math.imul(Rt,rn),S=Math.imul(Rt,sn),S=S+Math.imul(_t,rn)|0,$=Math.imul(_t,sn),P=P+Math.imul(Le,on)|0,S=S+Math.imul(Le,an)|0,S=S+Math.imul(Ye,on)|0,$=$+Math.imul(Ye,an)|0,P=P+Math.imul(me,cn)|0,S=S+Math.imul(me,un)|0,S=S+Math.imul(ve,cn)|0,$=$+Math.imul(ve,un)|0,P=P+Math.imul(re,ln)|0,S=S+Math.imul(re,fn)|0,S=S+Math.imul(ce,ln)|0,$=$+Math.imul(ce,fn)|0,P=P+Math.imul(j,hn)|0,S=S+Math.imul(j,dn)|0,S=S+Math.imul(V,hn)|0,$=$+Math.imul(V,dn)|0;var pp=(M+P|0)+((S&8191)<<13)|0;M=($+(S>>>13)|0)+(pp>>>26)|0,pp&=67108863,P=Math.imul(Rt,on),S=Math.imul(Rt,an),S=S+Math.imul(_t,on)|0,$=Math.imul(_t,an),P=P+Math.imul(Le,cn)|0,S=S+Math.imul(Le,un)|0,S=S+Math.imul(Ye,cn)|0,$=$+Math.imul(Ye,un)|0,P=P+Math.imul(me,ln)|0,S=S+Math.imul(me,fn)|0,S=S+Math.imul(ve,ln)|0,$=$+Math.imul(ve,fn)|0,P=P+Math.imul(re,hn)|0,S=S+Math.imul(re,dn)|0,S=S+Math.imul(ce,hn)|0,$=$+Math.imul(ce,dn)|0;var gp=(M+P|0)+((S&8191)<<13)|0;M=($+(S>>>13)|0)+(gp>>>26)|0,gp&=67108863,P=Math.imul(Rt,cn),S=Math.imul(Rt,un),S=S+Math.imul(_t,cn)|0,$=Math.imul(_t,un),P=P+Math.imul(Le,ln)|0,S=S+Math.imul(Le,fn)|0,S=S+Math.imul(Ye,ln)|0,$=$+Math.imul(Ye,fn)|0,P=P+Math.imul(me,hn)|0,S=S+Math.imul(me,dn)|0,S=S+Math.imul(ve,hn)|0,$=$+Math.imul(ve,dn)|0;var mp=(M+P|0)+((S&8191)<<13)|0;M=($+(S>>>13)|0)+(mp>>>26)|0,mp&=67108863,P=Math.imul(Rt,ln),S=Math.imul(Rt,fn),S=S+Math.imul(_t,ln)|0,$=Math.imul(_t,fn),P=P+Math.imul(Le,hn)|0,S=S+Math.imul(Le,dn)|0,S=S+Math.imul(Ye,hn)|0,$=$+Math.imul(Ye,dn)|0;var yp=(M+P|0)+((S&8191)<<13)|0;M=($+(S>>>13)|0)+(yp>>>26)|0,yp&=67108863,P=Math.imul(Rt,hn),S=Math.imul(Rt,dn),S=S+Math.imul(_t,hn)|0,$=Math.imul(_t,dn);var vp=(M+P|0)+((S&8191)<<13)|0;return M=($+(S>>>13)|0)+(vp>>>26)|0,vp&=67108863,x[0]=ep,x[1]=tp,x[2]=np,x[3]=rp,x[4]=ip,x[5]=sp,x[6]=op,x[7]=ap,x[8]=cp,x[9]=up,x[10]=lp,x[11]=fp,x[12]=hp,x[13]=dp,x[14]=pp,x[15]=gp,x[16]=mp,x[17]=yp,x[18]=vp,M!==0&&(x[19]=M,v.length++),v};Math.imul||(C=T);function O(m,f,d){d.negative=f.negative^m.negative,d.length=m.length+f.length;for(var v=0,b=0,E=0;E<d.length-1;E++){var x=b;b=0;for(var M=v&67108863,P=Math.min(E,f.length-1),S=Math.max(0,E-m.length+1);S<=P;S++){var $=E-S,ie=m.words[$]|0,le=f.words[S]|0,se=ie*le,xe=se&67108863;x=x+(se/67108864|0)|0,xe=xe+M|0,M=xe&67108863,x=x+(xe>>>26)|0,b+=x>>>26,x&=67108863}d.words[E]=M,v=x,x=b}return v!==0?d.words[E]=v:d.length--,d._strip()}function I(m,f,d){return O(m,f,d)}s.prototype.mulTo=function(f,d){var v,b=this.length+f.length;return this.length===10&&f.length===10?v=C(this,f,d):b<63?v=T(this,f,d):b<1024?v=O(this,f,d):v=I(this,f,d),v},s.prototype.mul=function(f){var d=new s(null);return d.words=new Array(this.length+f.length),this.mulTo(f,d)},s.prototype.mulf=function(f){var d=new s(null);return d.words=new Array(this.length+f.length),I(this,f,d)},s.prototype.imul=function(f){return this.clone().mulTo(f,this)},s.prototype.imuln=function(f){var d=f<0;d&&(f=-f),r(typeof f=="number"),r(f<67108864);for(var v=0,b=0;b<this.length;b++){var E=(this.words[b]|0)*f,x=(E&67108863)+(v&67108863);v>>=26,v+=E/67108864|0,v+=x>>>26,this.words[b]=x&67108863}return v!==0&&(this.words[b]=v,this.length++),d?this.ineg():this},s.prototype.muln=function(f){return this.clone().imuln(f)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(f){var d=k(f);if(d.length===0)return new s(1);for(var v=this,b=0;b<d.length&&d[b]===0;b++,v=v.sqr());if(++b<d.length)for(var E=v.sqr();b<d.length;b++,E=E.sqr())d[b]!==0&&(v=v.mul(E));return v},s.prototype.iushln=function(f){r(typeof f=="number"&&f>=0);var d=f%26,v=(f-d)/26,b=67108863>>>26-d<<26-d,E;if(d!==0){var x=0;for(E=0;E<this.length;E++){var M=this.words[E]&b,P=(this.words[E]|0)-M<<d;this.words[E]=P|x,x=M>>>26-d}x&&(this.words[E]=x,this.length++)}if(v!==0){for(E=this.length-1;E>=0;E--)this.words[E+v]=this.words[E];for(E=0;E<v;E++)this.words[E]=0;this.length+=v}return this._strip()},s.prototype.ishln=function(f){return r(this.negative===0),this.iushln(f)},s.prototype.iushrn=function(f,d,v){r(typeof f=="number"&&f>=0);var b;d?b=(d-d%26)/26:b=0;var E=f%26,x=Math.min((f-E)/26,this.length),M=67108863^67108863>>>E<<E,P=v;if(b-=x,b=Math.max(0,b),P){for(var S=0;S<x;S++)P.words[S]=this.words[S];P.length=x}if(x!==0)if(this.length>x)for(this.length-=x,S=0;S<this.length;S++)this.words[S]=this.words[S+x];else this.words[0]=0,this.length=1;var $=0;for(S=this.length-1;S>=0&&($!==0||S>=b);S--){var ie=this.words[S]|0;this.words[S]=$<<26-E|ie>>>E,$=ie&M}return P&&$!==0&&(P.words[P.length++]=$),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(f,d,v){return r(this.negative===0),this.iushrn(f,d,v)},s.prototype.shln=function(f){return this.clone().ishln(f)},s.prototype.ushln=function(f){return this.clone().iushln(f)},s.prototype.shrn=function(f){return this.clone().ishrn(f)},s.prototype.ushrn=function(f){return this.clone().iushrn(f)},s.prototype.testn=function(f){r(typeof f=="number"&&f>=0);var d=f%26,v=(f-d)/26,b=1<<d;if(this.length<=v)return!1;var E=this.words[v];return!!(E&b)},s.prototype.imaskn=function(f){r(typeof f=="number"&&f>=0);var d=f%26,v=(f-d)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=v)return this;if(d!==0&&v++,this.length=Math.min(v,this.length),d!==0){var b=67108863^67108863>>>d<<d;this.words[this.length-1]&=b}return this._strip()},s.prototype.maskn=function(f){return this.clone().imaskn(f)},s.prototype.iaddn=function(f){return r(typeof f=="number"),r(f<67108864),f<0?this.isubn(-f):this.negative!==0?this.length===1&&(this.words[0]|0)<=f?(this.words[0]=f-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(f),this.negative=1,this):this._iaddn(f)},s.prototype._iaddn=function(f){this.words[0]+=f;for(var d=0;d<this.length&&this.words[d]>=67108864;d++)this.words[d]-=67108864,d===this.length-1?this.words[d+1]=1:this.words[d+1]++;return this.length=Math.max(this.length,d+1),this},s.prototype.isubn=function(f){if(r(typeof f=="number"),r(f<67108864),f<0)return this.iaddn(-f);if(this.negative!==0)return this.negative=0,this.iaddn(f),this.negative=1,this;if(this.words[0]-=f,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var d=0;d<this.length&&this.words[d]<0;d++)this.words[d]+=67108864,this.words[d+1]-=1;return this._strip()},s.prototype.addn=function(f){return this.clone().iaddn(f)},s.prototype.subn=function(f){return this.clone().isubn(f)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(f,d,v){var b=f.length+v,E;this._expand(b);var x,M=0;for(E=0;E<f.length;E++){x=(this.words[E+v]|0)+M;var P=(f.words[E]|0)*d;x-=P&67108863,M=(x>>26)-(P/67108864|0),this.words[E+v]=x&67108863}for(;E<this.length-v;E++)x=(this.words[E+v]|0)+M,M=x>>26,this.words[E+v]=x&67108863;if(M===0)return this._strip();for(r(M===-1),M=0,E=0;E<this.length;E++)x=-(this.words[E]|0)+M,M=x>>26,this.words[E]=x&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(f,d){var v=this.length-f.length,b=this.clone(),E=f,x=E.words[E.length-1]|0,M=this._countBits(x);v=26-M,v!==0&&(E=E.ushln(v),b.iushln(v),x=E.words[E.length-1]|0);var P=b.length-E.length,S;if(d!=="mod"){S=new s(null),S.length=P+1,S.words=new Array(S.length);for(var $=0;$<S.length;$++)S.words[$]=0}var ie=b.clone()._ishlnsubmul(E,1,P);ie.negative===0&&(b=ie,S&&(S.words[P]=1));for(var le=P-1;le>=0;le--){var se=(b.words[E.length+le]|0)*67108864+(b.words[E.length+le-1]|0);for(se=Math.min(se/x|0,67108863),b._ishlnsubmul(E,se,le);b.negative!==0;)se--,b.negative=0,b._ishlnsubmul(E,1,le),b.isZero()||(b.negative^=1);S&&(S.words[le]=se)}return S&&S._strip(),b._strip(),d!=="div"&&v!==0&&b.iushrn(v),{div:S||null,mod:b}},s.prototype.divmod=function(f,d,v){if(r(!f.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var b,E,x;return this.negative!==0&&f.negative===0?(x=this.neg().divmod(f,d),d!=="mod"&&(b=x.div.neg()),d!=="div"&&(E=x.mod.neg(),v&&E.negative!==0&&E.iadd(f)),{div:b,mod:E}):this.negative===0&&f.negative!==0?(x=this.divmod(f.neg(),d),d!=="mod"&&(b=x.div.neg()),{div:b,mod:x.mod}):this.negative&f.negative?(x=this.neg().divmod(f.neg(),d),d!=="div"&&(E=x.mod.neg(),v&&E.negative!==0&&E.isub(f)),{div:x.div,mod:E}):f.length>this.length||this.cmp(f)<0?{div:new s(0),mod:this}:f.length===1?d==="div"?{div:this.divn(f.words[0]),mod:null}:d==="mod"?{div:null,mod:new s(this.modrn(f.words[0]))}:{div:this.divn(f.words[0]),mod:new s(this.modrn(f.words[0]))}:this._wordDiv(f,d)},s.prototype.div=function(f){return this.divmod(f,"div",!1).div},s.prototype.mod=function(f){return this.divmod(f,"mod",!1).mod},s.prototype.umod=function(f){return this.divmod(f,"mod",!0).mod},s.prototype.divRound=function(f){var d=this.divmod(f);if(d.mod.isZero())return d.div;var v=d.div.negative!==0?d.mod.isub(f):d.mod,b=f.ushrn(1),E=f.andln(1),x=v.cmp(b);return x<0||E===1&&x===0?d.div:d.div.negative!==0?d.div.isubn(1):d.div.iaddn(1)},s.prototype.modrn=function(f){var d=f<0;d&&(f=-f),r(f<=67108863);for(var v=(1<<26)%f,b=0,E=this.length-1;E>=0;E--)b=(v*b+(this.words[E]|0))%f;return d?-b:b},s.prototype.modn=function(f){return this.modrn(f)},s.prototype.idivn=function(f){var d=f<0;d&&(f=-f),r(f<=67108863);for(var v=0,b=this.length-1;b>=0;b--){var E=(this.words[b]|0)+v*67108864;this.words[b]=E/f|0,v=E%f}return this._strip(),d?this.ineg():this},s.prototype.divn=function(f){return this.clone().idivn(f)},s.prototype.egcd=function(f){r(f.negative===0),r(!f.isZero());var d=this,v=f.clone();d.negative!==0?d=d.umod(f):d=d.clone();for(var b=new s(1),E=new s(0),x=new s(0),M=new s(1),P=0;d.isEven()&&v.isEven();)d.iushrn(1),v.iushrn(1),++P;for(var S=v.clone(),$=d.clone();!d.isZero();){for(var ie=0,le=1;!(d.words[0]&le)&&ie<26;++ie,le<<=1);if(ie>0)for(d.iushrn(ie);ie-- >0;)(b.isOdd()||E.isOdd())&&(b.iadd(S),E.isub($)),b.iushrn(1),E.iushrn(1);for(var se=0,xe=1;!(v.words[0]&xe)&&se<26;++se,xe<<=1);if(se>0)for(v.iushrn(se);se-- >0;)(x.isOdd()||M.isOdd())&&(x.iadd(S),M.isub($)),x.iushrn(1),M.iushrn(1);d.cmp(v)>=0?(d.isub(v),b.isub(x),E.isub(M)):(v.isub(d),x.isub(b),M.isub(E))}return{a:x,b:M,gcd:v.iushln(P)}},s.prototype._invmp=function(f){r(f.negative===0),r(!f.isZero());var d=this,v=f.clone();d.negative!==0?d=d.umod(f):d=d.clone();for(var b=new s(1),E=new s(0),x=v.clone();d.cmpn(1)>0&&v.cmpn(1)>0;){for(var M=0,P=1;!(d.words[0]&P)&&M<26;++M,P<<=1);if(M>0)for(d.iushrn(M);M-- >0;)b.isOdd()&&b.iadd(x),b.iushrn(1);for(var S=0,$=1;!(v.words[0]&$)&&S<26;++S,$<<=1);if(S>0)for(v.iushrn(S);S-- >0;)E.isOdd()&&E.iadd(x),E.iushrn(1);d.cmp(v)>=0?(d.isub(v),b.isub(E)):(v.isub(d),E.isub(b))}var ie;return d.cmpn(1)===0?ie=b:ie=E,ie.cmpn(0)<0&&ie.iadd(f),ie},s.prototype.gcd=function(f){if(this.isZero())return f.abs();if(f.isZero())return this.abs();var d=this.clone(),v=f.clone();d.negative=0,v.negative=0;for(var b=0;d.isEven()&&v.isEven();b++)d.iushrn(1),v.iushrn(1);do{for(;d.isEven();)d.iushrn(1);for(;v.isEven();)v.iushrn(1);var E=d.cmp(v);if(E<0){var x=d;d=v,v=x}else if(E===0||v.cmpn(1)===0)break;d.isub(v)}while(!0);return v.iushln(b)},s.prototype.invm=function(f){return this.egcd(f).a.umod(f)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(f){return this.words[0]&f},s.prototype.bincn=function(f){r(typeof f=="number");var d=f%26,v=(f-d)/26,b=1<<d;if(this.length<=v)return this._expand(v+1),this.words[v]|=b,this;for(var E=b,x=v;E!==0&&x<this.length;x++){var M=this.words[x]|0;M+=E,E=M>>>26,M&=67108863,this.words[x]=M}return E!==0&&(this.words[x]=E,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(f){var d=f<0;if(this.negative!==0&&!d)return-1;if(this.negative===0&&d)return 1;this._strip();var v;if(this.length>1)v=1;else{d&&(f=-f),r(f<=67108863,"Number is too big");var b=this.words[0]|0;v=b===f?0:b<f?-1:1}return this.negative!==0?-v|0:v},s.prototype.cmp=function(f){if(this.negative!==0&&f.negative===0)return-1;if(this.negative===0&&f.negative!==0)return 1;var d=this.ucmp(f);return this.negative!==0?-d|0:d},s.prototype.ucmp=function(f){if(this.length>f.length)return 1;if(this.length<f.length)return-1;for(var d=0,v=this.length-1;v>=0;v--){var b=this.words[v]|0,E=f.words[v]|0;if(b!==E){b<E?d=-1:b>E&&(d=1);break}}return d},s.prototype.gtn=function(f){return this.cmpn(f)===1},s.prototype.gt=function(f){return this.cmp(f)===1},s.prototype.gten=function(f){return this.cmpn(f)>=0},s.prototype.gte=function(f){return this.cmp(f)>=0},s.prototype.ltn=function(f){return this.cmpn(f)===-1},s.prototype.lt=function(f){return this.cmp(f)===-1},s.prototype.lten=function(f){return this.cmpn(f)<=0},s.prototype.lte=function(f){return this.cmp(f)<=0},s.prototype.eqn=function(f){return this.cmpn(f)===0},s.prototype.eq=function(f){return this.cmp(f)===0},s.red=function(f){return new K(f)},s.prototype.toRed=function(f){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),f.convertTo(this)._forceRed(f)},s.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(f){return this.red=f,this},s.prototype.forceRed=function(f){return r(!this.red,"Already a number in reduction context"),this._forceRed(f)},s.prototype.redAdd=function(f){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,f)},s.prototype.redIAdd=function(f){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,f)},s.prototype.redSub=function(f){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,f)},s.prototype.redISub=function(f){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,f)},s.prototype.redShl=function(f){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,f)},s.prototype.redMul=function(f){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.mul(this,f)},s.prototype.redIMul=function(f){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.imul(this,f)},s.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(f){return r(this.red&&!f.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,f)};var N={k256:null,p224:null,p192:null,p25519:null};function F(m,f){this.name=m,this.p=new s(f,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}F.prototype._tmp=function(){var f=new s(null);return f.words=new Array(Math.ceil(this.n/13)),f},F.prototype.ireduce=function(f){var d=f,v;do this.split(d,this.tmp),d=this.imulK(d),d=d.iadd(this.tmp),v=d.bitLength();while(v>this.n);var b=v<this.n?-1:d.ucmp(this.p);return b===0?(d.words[0]=0,d.length=1):b>0?d.isub(this.p):d.strip!==void 0?d.strip():d._strip(),d},F.prototype.split=function(f,d){f.iushrn(this.n,0,d)},F.prototype.imulK=function(f){return f.imul(this.k)};function L(){F.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(L,F),L.prototype.split=function(f,d){for(var v=4194303,b=Math.min(f.length,9),E=0;E<b;E++)d.words[E]=f.words[E];if(d.length=b,f.length<=9){f.words[0]=0,f.length=1;return}var x=f.words[9];for(d.words[d.length++]=x&v,E=10;E<f.length;E++){var M=f.words[E]|0;f.words[E-10]=(M&v)<<4|x>>>22,x=M}x>>>=22,f.words[E-10]=x,x===0&&f.length>10?f.length-=10:f.length-=9},L.prototype.imulK=function(f){f.words[f.length]=0,f.words[f.length+1]=0,f.length+=2;for(var d=0,v=0;v<f.length;v++){var b=f.words[v]|0;d+=b*977,f.words[v]=d&67108863,d=b*64+(d/67108864|0)}return f.words[f.length-1]===0&&(f.length--,f.words[f.length-1]===0&&f.length--),f};function D(){F.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(D,F);function H(){F.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(H,F);function z(){F.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(z,F),z.prototype.imulK=function(f){for(var d=0,v=0;v<f.length;v++){var b=(f.words[v]|0)*19+d,E=b&67108863;b>>>=26,f.words[v]=E,d=b}return d!==0&&(f.words[f.length++]=d),f},s._prime=function(f){if(N[f])return N[f];var d;if(f==="k256")d=new L;else if(f==="p224")d=new D;else if(f==="p192")d=new H;else if(f==="p25519")d=new z;else throw new Error("Unknown prime "+f);return N[f]=d,d};function K(m){if(typeof m=="string"){var f=s._prime(m);this.m=f.p,this.prime=f}else r(m.gtn(1),"modulus must be greater than 1"),this.m=m,this.prime=null}K.prototype._verify1=function(f){r(f.negative===0,"red works only with positives"),r(f.red,"red works only with red numbers")},K.prototype._verify2=function(f,d){r((f.negative|d.negative)===0,"red works only with positives"),r(f.red&&f.red===d.red,"red works only with red numbers")},K.prototype.imod=function(f){return this.prime?this.prime.ireduce(f)._forceRed(this):(l(f,f.umod(this.m)._forceRed(this)),f)},K.prototype.neg=function(f){return f.isZero()?f.clone():this.m.sub(f)._forceRed(this)},K.prototype.add=function(f,d){this._verify2(f,d);var v=f.add(d);return v.cmp(this.m)>=0&&v.isub(this.m),v._forceRed(this)},K.prototype.iadd=function(f,d){this._verify2(f,d);var v=f.iadd(d);return v.cmp(this.m)>=0&&v.isub(this.m),v},K.prototype.sub=function(f,d){this._verify2(f,d);var v=f.sub(d);return v.cmpn(0)<0&&v.iadd(this.m),v._forceRed(this)},K.prototype.isub=function(f,d){this._verify2(f,d);var v=f.isub(d);return v.cmpn(0)<0&&v.iadd(this.m),v},K.prototype.shl=function(f,d){return this._verify1(f),this.imod(f.ushln(d))},K.prototype.imul=function(f,d){return this._verify2(f,d),this.imod(f.imul(d))},K.prototype.mul=function(f,d){return this._verify2(f,d),this.imod(f.mul(d))},K.prototype.isqr=function(f){return this.imul(f,f.clone())},K.prototype.sqr=function(f){return this.mul(f,f)},K.prototype.sqrt=function(f){if(f.isZero())return f.clone();var d=this.m.andln(3);if(r(d%2===1),d===3){var v=this.m.add(new s(1)).iushrn(2);return this.pow(f,v)}for(var b=this.m.subn(1),E=0;!b.isZero()&&b.andln(1)===0;)E++,b.iushrn(1);r(!b.isZero());var x=new s(1).toRed(this),M=x.redNeg(),P=this.m.subn(1).iushrn(1),S=this.m.bitLength();for(S=new s(2*S*S).toRed(this);this.pow(S,P).cmp(M)!==0;)S.redIAdd(M);for(var $=this.pow(S,b),ie=this.pow(f,b.addn(1).iushrn(1)),le=this.pow(f,b),se=E;le.cmp(x)!==0;){for(var xe=le,Re=0;xe.cmp(x)!==0;Re++)xe=xe.redSqr();r(Re<se);var _e=this.pow($,new s(1).iushln(se-Re-1));ie=ie.redMul(_e),$=_e.redSqr(),le=le.redMul($),se=Re}return ie},K.prototype.invm=function(f){var d=f._invmp(this.m);return d.negative!==0?(d.negative=0,this.imod(d).redNeg()):this.imod(d)},K.prototype.pow=function(f,d){if(d.isZero())return new s(1).toRed(this);if(d.cmpn(1)===0)return f.clone();var v=4,b=new Array(1<<v);b[0]=new s(1).toRed(this),b[1]=f;for(var E=2;E<b.length;E++)b[E]=this.mul(b[E-1],f);var x=b[0],M=0,P=0,S=d.bitLength()%26;for(S===0&&(S=26),E=d.length-1;E>=0;E--){for(var $=d.words[E],ie=S-1;ie>=0;ie--){var le=$>>ie&1;if(x!==b[0]&&(x=this.sqr(x)),le===0&&M===0){P=0;continue}
28M<<=1,M|=le,P++,!(P!==v&&(E!==0||ie!==0))&&(x=this.mul(x,b[M]),P=0,M=0)}S=26}return x},K.prototype.convertTo=function(f){var d=f.umod(this.m);return d===f?d.clone():d},K.prototype.convertFrom=function(f){var d=f.clone();return d.red=null,d},s.mont=function(f){return new _(f)};function _(m){K.call(this,m),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(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)}i(_,K),_.prototype.convertTo=function(f){return this.imod(f.ushln(this.shift))},_.prototype.convertFrom=function(f){var d=this.imod(f.mul(this.rinv));return d.red=null,d},_.prototype.imul=function(f,d){if(f.isZero()||d.isZero())return f.words[0]=0,f.length=1,f;var v=f.imul(d),b=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=v.isub(b).iushrn(this.shift),x=E;return E.cmp(this.m)>=0?x=E.isub(this.m):E.cmpn(0)<0&&(x=E.iadd(this.m)),x._forceRed(this)},_.prototype.mul=function(f,d){if(f.isZero()||d.isZero())return new s(0)._forceRed(this);var v=f.mul(d),b=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=v.isub(b).iushrn(this.shift),x=E;return E.cmp(this.m)>=0?x=E.isub(this.m):E.cmpn(0)<0&&(x=E.iadd(this.m)),x._forceRed(this)},_.prototype.invm=function(f){var d=this.imod(f._invmp(this.m).mul(this.r2));return d._forceRed(this)}})(t,Jn)})(Ny);var Py=Ny.exports;const Ei=Ui(Py);var R0={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(t,e){var n=ne,r=n.Buffer;function i(o,a){for(var c in o)a[c]=o[c]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=n:(i(n,e),e.Buffer=s);function s(o,a,c){return r(o,a,c)}s.prototype=Object.create(r.prototype),i(r,s),s.from=function(o,a,c){if(typeof o=="number")throw new TypeError("Argument must not be a number");return r(o,a,c)},s.alloc=function(o,a,c){if(typeof o!="number")throw new TypeError("Argument must be a number");var u=r(o);return a!==void 0?typeof c=="string"?u.fill(a,c):u.fill(a):u.fill(0),u},s.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r(o)},s.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(o)}})(R0,R0.exports);var XD=R0.exports,cf=XD.Buffer;function JD(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 r=0;r<t.length;r++){var i=t.charAt(r),s=i.charCodeAt(0);if(e[s]!==255)throw new TypeError(i+" is ambiguous");e[s]=r}var o=t.length,a=t.charAt(0),c=Math.log(o)/Math.log(256),u=Math.log(256)/Math.log(o);function l(g){if((Array.isArray(g)||g instanceof Uint8Array)&&(g=cf.from(g)),!cf.isBuffer(g))throw new TypeError("Expected Buffer");if(g.length===0)return"";for(var y=0,w=0,k=0,T=g.length;k!==T&&g[k]===0;)k++,y++;for(var C=(T-k)*u+1>>>0,O=new Uint8Array(C);k!==T;){for(var I=g[k],N=0,F=C-1;(I!==0||N<w)&&F!==-1;F--,N++)I+=256*O[F]>>>0,O[F]=I%o>>>0,I=I/o>>>0;if(I!==0)throw new Error("Non-zero carry");w=N,k++}for(var L=C-w;L!==C&&O[L]===0;)L++;for(var D=a.repeat(y);L<C;++L)D+=t.charAt(O[L]);return D}function h(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return cf.alloc(0);for(var y=0,w=0,k=0;g[y]===a;)w++,y++;for(var T=(g.length-y)*c+1>>>0,C=new Uint8Array(T);g[y];){var O=e[g.charCodeAt(y)];if(O===255)return;for(var I=0,N=T-1;(O!==0||I<k)&&N!==-1;N--,I++)O+=o*C[N]>>>0,C[N]=O%256>>>0,O=O/256>>>0;if(O!==0)throw new Error("Non-zero carry");k=I,y++}for(var F=T-k;F!==T&&C[F]===0;)F++;var L=cf.allocUnsafe(w+(T-F));L.fill(0,0,w);for(var D=w;F!==T;)L[D++]=C[F++];return L}function p(g){var y=h(g);if(y)return y;throw new Error("Non-base"+o+" character")}return{encode:l,decodeUnsafe:h,decode:p}}var QD=JD,e$=QD,t$="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",gA=e$(t$);const jt=Ui(gA),n$=(t,e,n)=>t&e^~t&n,r$=(t,e,n)=>t&e^t&n^e&n,i$=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,2756
vendor: 6,151 bytes, line 28
28734187,3204031479,3329325298]),Ts=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Os=new Uint32Array(64);class mA extends oA{constructor(){super(64,32,8,!1),this.A=Ts[0]|0,this.B=Ts[1]|0,this.C=Ts[2]|0,this.D=Ts[3]|0,this.E=Ts[4]|0,this.F=Ts[5]|0,this.G=Ts[6]|0,this.H=Ts[7]|0}get(){const{A:e,B:n,C:r,D:i,E:s,F:o,G:a,H:c}=this;return[e,n,r,i,s,o,a,c]}set(e,n,r,i,s,o,a,c){this.A=e|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,n){for(let h=0;h<16;h++,n+=4)Os[h]=e.getUint32(n,!1);for(let h=16;h<64;h++){const p=Os[h-15],g=Os[h-2],y=pi(p,7)^pi(p,18)^p>>>3,w=pi(g,17)^pi(g,19)^g>>>10;Os[h]=w+Os[h-7]+y+Os[h-16]|0}let{A:r,B:i,C:s,D:o,E:a,F:c,G:u,H:l}=this;for(let h=0;h<64;h++){const p=pi(a,6)^pi(a,11)^pi(a,25),g=l+p+n$(a,c,u)+i$[h]+Os[h]|0,w=(pi(r,2)^pi(r,13)^pi(r,22))+r$(r,i,s)|0;l=u,u=c,c=a,a=o+g|0,o=s,s=i,i=r,r=g+w|0}r=r+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,l=l+this.H|0,this.set(r,i,s,o,a,c,u,l)}roundClean(){Os.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class s$ extends mA{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const qu=_a(()=>new mA);_a(()=>new s$);var Mn={};function rs(t,e,n){return e<=t&&t<=n}function _d(t){if(t===void 0)return{};if(t===Object(t))return t;throw TypeError("Could not convert argument to dictionary")}function o$(t){for(var e=String(t),n=e.length,r=0,i=[];r<n;){var s=e.charCodeAt(r);if(s<55296||s>57343)i.push(s);else if(56320<=s&&s<=57343)i.push(65533);else if(55296<=s&&s<=56319)if(r===n-1)i.push(65533);else{var o=t.charCodeAt(r+1);if(56320<=o&&o<=57343){var a=s&1023,c=o&1023;i.push(65536+(a<<10)+c),r+=1}else i.push(65533)}r+=1}return i}function a$(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((r>>10)+55296,(r&1023)+56320))}return e}var bh=-1;function My(t){this.tokens=[].slice.call(t)}My.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():bh},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 dc=-1;function jp(t,e){if(t)throw TypeError("Decoder error");return e||65533}var wh="utf-8";function _h(t,e){if(!(this instanceof _h))return new _h(t,e);if(t=t!==void 0?String(t).toLowerCase():wh,t!==wh)throw new Error("Encoding not supported. Only utf-8 is supported");e=_d(e),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=!!e.fatal,this._ignoreBOM=!!e.ignoreBOM,Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}_h.prototype={decode:function(e,n){var r;typeof e=="object"&&e instanceof ArrayBuffer?r=new Uint8Array(e):typeof e=="object"&&"buffer"in e&&e.buffer instanceof ArrayBuffer?r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):r=new Uint8Array(0),n=_d(n),this._streaming||(this._decoder=new c$({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!n.stream;for(var i=new My(r),s=[],o;!i.endOfStream()&&(o=this._decoder.handler(i,i.read()),o!==dc);)o!==null&&(Array.isArray(o)?s.push.apply(s,o):s.push(o));if(!this._streaming){do{if(o=this._decoder.handler(i,i.read()),o===dc)break;o!==null&&(Array.isArray(o)?s.push.apply(s,o):s.push(o))}while(!i.endOfStream());this._decoder=null}return s.length&&["utf-8"].indexOf(this.encoding)!==-1&&!this._ignoreBOM&&!this._BOMseen&&(s[0]===65279?(this._BOMseen=!0,s.shift()):this._BOMseen=!0),a$(s)}};function kh(t,e){if(!(this instanceof kh))return new kh(t,e);if(t=t!==void 0?String(t).toLowerCase():wh,t!==wh)throw new Error("Encoding not supported. Only utf-8 is supported");e=_d(e),this._streaming=!1,this._encoder=null,this._options={fatal:!!e.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}kh.prototype={encode:function(e,n){e=e?String(e):"",n=_d(n),this._streaming||(this._encoder=new u$(this._options)),this._streaming=!!n.stream;for(var r=[],i=new My(o$(e)),s;!i.endOfStream()&&(s=this._encoder.handler(i,i.read()),s!==dc);)Array.isArray(s)?r.push.apply(r,s):r.push(s);if(!this._streaming){for(;s=this._encoder.handler(i,i.read()),s!==dc;)Array.isArray(s)?r.push.apply(r,s):r.push(s);this._encoder=null}return new Uint8Array(r)}};function c$(t){var e=t.fatal,n=0,r=0,i=0,s=128,o=191;this.handler=function(a,c){if(c===bh&&i!==0)return i=0,jp(e);if(c===bh)return dc;if(i===0){if(rs(c,0,127))return c;if(rs(c,194,223))i=1,n=c-192;else if(rs(c,224,239))c===224&&(s=160),c===237&&(o=159),i=2,n=c-224;else if(rs(c,240,244))c===240&&(s=144),c===244&&(o=143),i=3,n=c-240;else return jp(e);return n=n<<6*i,null}if(!rs(c,s,o))return n=i=r=0,s=128,o=191,a.prepend(c),jp(e);if(s=128,o=191,r+=1,n+=c-128<<6*(i-r),r!==i)return null;var u=n;return n=i=r=0,u}}function u$(t){t.fatal,this.handler=function(e,n){if(n===bh)return dc;if(rs(n,0,127))return n;var r,i;rs(n,128,2047)?(r=1,i=192):rs(n,2048,65535)?(r=2,i=224):rs(n,65536,1114111)&&(r=3,i=240);for(var s=[(n>>6*r)+i];r>0;){var o=n>>6*(r-1);s.push(128|o&63),r-=1}return s}}const l$=Object.freeze(Object.defineProperty({__proto__:null,TextDecoder:_h,TextEncoder:kh},Symbol.toStringTag,{value:"Module"})),f$=zi(l$);var h$=Jn&&Jn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),d$=Jn&&Jn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Wi=Jn&&Jn.__decorate||function(t,e,n,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;
28a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,n,s):o(e,n))||s);return i>3&&s&&Object.defineProperty(e,n,s),s},p$=Jn&&Jn.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.hasOwnProperty.call(t,n)&&h$(e,t,n);return d$(e,t),e},yA=Jn&&Jn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Mn,"__esModule",{value:!0});var vA=Mn.deserializeUnchecked=EA=Mn.deserialize=SA=Mn.serialize=Mn.BinaryReader=Mn.BinaryWriter=Mn.BorshError=Mn.baseDecode=Mn.baseEncode=void 0;const Hs=yA(Py),bA=yA(gA),g$=p$(f$),m$=typeof TextDecoder!="function"?g$.TextDecoder:TextDecoder,y$=new m$("utf-8",{fatal:!0});function v$(t){return typeof t=="string"&&(t=ne.Buffer.from(t,"utf8")),bA.default.encode(ne.Buffer.from(t))}Mn.baseEncode=v$;function b$(t){return ne.Buffer.from(bA.default.decode(t))}Mn.baseDecode=b$;const Kp=1024;class Yn extends Error{constructor(e){super(e),this.fieldPath=[],this.originalMessage=e}addToFieldPath(e){this.fieldPath.splice(0,0,e),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}Mn.BorshError=Yn;class wA{constructor(){this.buf=ne.Buffer.alloc(Kp),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=ne.Buffer.concat([this.buf,ne.Buffer.alloc(Kp)]))}writeU8(e){this.maybeResize(),this.buf.writeUInt8(e,this.length),this.length+=1}writeU16(e){this.maybeResize(),this.buf.writeUInt16LE(e,this.length),this.length+=2}writeU32(e){this.maybeResize(),this.buf.writeUInt32LE(e,this.length),this.length+=4}writeU64(e){this.maybeResize(),this.writeBuffer(ne.Buffer.from(new Hs.default(e).toArray("le",8)))}writeU128(e){this.maybeResize(),this.writeBuffer(ne.Buffer.from(new Hs.default(e).toArray("le",16)))}writeU256(e){this.maybeResize(),this.writeBuffer(ne.Buffer.from(new Hs.default(e).toArray("le",32)))}writeU512(e){this.maybeResize(),this.writeBuffer(ne.Buffer.from(new Hs.default(e).toArray("le",64)))}writeBuffer(e){this.buf=ne.Buffer.concat([ne.Buffer.from(this.buf.subarray(0,this.length)),e,ne.Buffer.alloc(Kp)]),this.length+=e.length}writeString(e){this.maybeResize();const n=ne.Buffer.from(e,"utf8");this.writeU32(n.length),this.writeBuffer(n)}writeFixedArray(e){this.writeBuffer(ne.Buffer.from(e))}writeArray(e,n){this.maybeResize(),this.writeU32(e.length);for(const r of e)this.maybeResize(),n(r)}toArray(){return this.buf.subarray(0,this.length)}}Mn.BinaryWriter=wA;function ji(t,e,n){const r=n.value;n.value=function(...i){try{return r.apply(this,i)}catch(s){if(s instanceof RangeError){const o=s.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(o)>=0)throw new Yn("Reached the end of buffer when deserializing")}throw s}}}class Cr{constructor(e){this.buf=e,this.offset=0}readU8(){const e=this.buf.readUInt8(this.offset);return this.offset+=1,e}readU16(){const e=this.buf.readUInt16LE(this.offset);return this.offset+=2,e}readU32(){const e=this.buf.readUInt32LE(this.offset);return this.offset+=4,e}readU64(){const e=this.readBuffer(8);return new Hs.default(e,"le")}readU128(){const e=this.readBuffer(16);return new Hs.default(e,"le")}readU256(){const e=this.readBuffer(32);return new Hs.default(e,"le")}readU512(){const e=this.readBuffer(64);return new Hs.default(e,"le")}readBuffer(e){if(this.offset+e>this.buf.length)throw new Yn(`Expected buffer length ${e} isn't within bounds`);const n=this.buf.slice(this.offset,this.offset+e);return this.offset+=e,n}readString(){const e=this.readU32(),n=this.readBuffer(e);try{return y$.decode(n)}catch(r){throw new Yn(`Error decoding UTF-8 string: ${r}`)}}readFixedArray(e){return new Uint8Array(this.readBuffer(e))}readArray(e){const n=this.readU32(),r=Array();for(let i=0;i<n;++i)r.push(e());return r}}Wi([ji],Cr.prototype,"readU8",null);Wi([ji],Cr.prototype,"readU16",null);Wi([ji],Cr.prototype,"readU32",null);Wi([ji],Cr.prototype,"readU64",null);Wi([ji],Cr.prototype,"readU128",null);Wi([ji],Cr.prototype,"readU256",null);Wi([ji],Cr.prototype,"readU512",null);Wi([ji],Cr.prototype,"readString",null);Wi([ji],Cr.prototype,"readFixedArray",null);Wi([ji],Cr.prototype,"readArray",null);Mn.BinaryReader=Cr;function _A(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Do(t,e,n,r,i){try{if(typeof r=="string")i[`write${_A(r)}`](n);else if(r instanceof Array)if(typeof r[0]=="number"){if(n.length!==r[0])throw new Yn(`Expecting byte array of length ${r[0]}, but got ${n.length} bytes`);i.writeFixedArray(n)}else if(r.length===2&&typeof r[1]=="number"){if(n.length!==r[1])throw new Yn(`Expecting byte array of length ${r[1]}, but got ${n.length} bytes`);for(let s=0;s<r[1];s++)Do(t,null,n[s],r[0],i)}else i.writeArray(n,s=>{Do(t,e,s,r[0],i)});else if(r.kind!==void 0)switch(r.kind){case"option":{n==null?i.writeU8(0):(i.writeU8(1),Do(t,e,n,r.type,i));break}
28case"map":{i.writeU32(n.size),n.forEach((s,o)=>{Do(t,e,o,r.key,i),Do(t,e,s,r.value,i)});break}default:throw new Yn(`FieldType ${r} unrecognized`)}else kA(t,n,i)}catch(s){throw s instanceof Yn&&s.addToFieldPath(e),s}}function kA(t,e,n){if(typeof e.borshSerialize=="function"){e.borshSerialize(n);return}const r=t.get(e.constructor);if(!r)throw new Yn(`Class ${e.constructor.name} is missing in schema`);if(r.kind==="struct")r.fields.map(([i,s])=>{Do(t,i,e[i],s,n)});else if(r.kind==="enum"){const i=e[r.field];for(let s=0;s<r.values.length;++s){const[o,a]=r.values[s];if(o===i){n.writeU8(s),Do(t,o,e[o],a,n);break}}}else throw new Yn(`Unexpected schema kind: ${r.kind} for ${e.constructor.name}`)}function w$(t,e,n=wA){const r=new n;return kA(t,e,r),r.toArray()}var SA=Mn.serialize=w$;function $o(t,e,n,r){try{if(typeof n=="string")return r[`read${_A(n)}`]();if(n instanceof Array){if(typeof n[0]=="number")return r.readFixedArray(n[0]);if(typeof n[1]=="number"){const i=[];for(let s=0;s<n[1];s++)i.push($o(t,null,n[0],r));return i}else return r.readArray(()=>$o(t,e,n[0],r))}if(n.kind==="option")return r.readU8()?$o(t,e,n.type,r):void 0;if(n.kind==="map"){let i=new Map;const s=r.readU32();for(let o=0;o<s;o++){const a=$o(t,e,n.key,r),c=$o(t,e,n.value,r);i.set(a,c)}return i}return Ly(t,n,r)}catch(i){throw i instanceof Yn&&i.addToFieldPath(e),i}}function Ly(t,e,n){if(typeof e.borshDeserialize=="function")return e.borshDeserialize(n);const r=t.get(e);if(!r)throw new Yn(`Class ${e.name} is missing in schema`);if(r.kind==="struct"){const i={};for(const[s,o]of t.get(e).fields)i[s]=$o(t,s,o,n);return new e(i)}if(r.kind==="enum"){const i=n.readU8();if(i>=r.values.length)throw new Yn(`Enum index: ${i} is out of range`);const[s,o]=r.values[i],a=$o(t,s,o,n);return new e({[s]:a})}throw new Yn(`Unexpected schema kind: ${r.kind} for ${e.constructor.name}`)}function _$(t,e,n,r=Cr){const i=new r(n),s=Ly(t,e,i);if(i.offset<n.length)throw new Yn(`Unexpected ${n.length-i.offset} bytes after deserialized data`);return s}var EA=Mn.deserialize=_$;function k$(t,e,n,r=Cr){const i=new r(n);return Ly(t,e,i)}vA=Mn.deserializeUnchecked=k$;var J={};Object.defineProperty(J,"__esModule",{value:!0});J.s16=J.s8=J.nu64be=J.u48be=J.u40be=J.u32be=J.u24be=J.u16be=In=J.nu64=J.u48=J.u40=Se=J.u32=J.u24=Br=J.u16=Ge=J.u8=Gs=J.offset=J.greedy=J.Constant=J.UTF8=J.CString=J.Blob=J.Boolean=J.BitField=J.BitStructure=J.VariantLayout=J.Union=J.UnionLayoutDiscriminator=J.UnionDiscriminator=J.Structure=J.Sequence=J.DoubleBE=J.Double=J.FloatBE=J.Float=J.NearInt64BE=J.NearInt64=J.NearUInt64BE=J.NearUInt64=J.IntBE=J.Int=J.UIntBE=J.UInt=J.OffsetLayout=J.GreedyCount=J.ExternalLayout=J.bindConstructorLayout=J.nameWithProperty=J.Layout=J.uint8ArrayToBuffer=J.checkUint8Array=void 0;J.constant=J.utf8=J.cstr=kt=J.blob=J.unionLayoutDiscriminator=J.union=Dn=J.seq=J.bits=Ae=J.struct=J.f64be=J.f64=J.f32be=J.f32=J.ns64be=J.s48be=J.s40be=J.s32be=J.s24be=J.s16be=wr=J.ns64=J.s48=J.s40=J.s32=J.s24=void 0;const By=ne;function Cc(t){if(!(t instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}J.checkUint8Array=Cc;function ut(t){return Cc(t),By.Buffer.from(t.buffer,t.byteOffset,t.length)}J.uint8ArrayToBuffer=ut;let bt=class{constructor(e,n){if(!Number.isInteger(e))throw new TypeError("span must be an integer");this.span=e,this.property=n}makeDestinationObject(){return{}}getSpan(e,n){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(e){const n=Object.create(this.constructor.prototype);return Object.assign(n,this),n.property=e,n}fromArray(e){}};J.Layout=bt;function Dy(t,e){return e.property?t+"["+e.property+"]":t}J.nameWithProperty=Dy;function S$(t,e){if(typeof t!="function")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 bt))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(n,r){return e.encode(this,n,r)},writable:!0}),Object.defineProperty(t,"decode",{value(n,r){return e.decode(n,r)},writable:!0})}J.bindConstructorLayout=S$;let or=class extends bt{isCount(){throw new Error("ExternalLayout is abstract")}};J.ExternalLayout=or;let AA=class extends or{constructor(e=1,n){if(!Number.isInteger(e)||0>=e)throw new TypeError("elementSpan must be a (positive) integer");super(-1,n),this.elementSpan=e}isCount(){return!0}decode(e,n=0){Cc(e);const r=e.length-n;return Math.floor(r/this.elementSpan)}encode(e,n,r){return 0}};J.GreedyCount=AA;let $y=class extends or{constructor(e,n=0,r){if(!(e instanceof bt))throw new TypeError("layout must be a Layout");if(!Number.isInteger(n))throw new TypeError("offset must be integer or undefined");super(e.span,r||e.property),this.layout=e,this.offset=n}isCount(){return this.layout instanceof Vr||this.layout instanceof ci}decode(e,n=0){return this.layout.decode(e,n+this.offset)}
28encode(e,n,r=0){return this.layout.encode(e,n,r+this.offset)}};J.OffsetLayout=$y;let Vr=class extends bt{constructor(e,n){if(super(e,n),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,n=0){return ut(e).readUIntLE(n,this.span)}encode(e,n,r=0){return ut(n).writeUIntLE(e,r,this.span),this.span}};J.UInt=Vr;let ci=class extends bt{constructor(e,n){if(super(e,n),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,n=0){return ut(e).readUIntBE(n,this.span)}encode(e,n,r=0){return ut(n).writeUIntBE(e,r,this.span),this.span}};J.UIntBE=ci;let ka=class extends bt{constructor(e,n){if(super(e,n),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,n=0){return ut(e).readIntLE(n,this.span)}encode(e,n,r=0){return ut(n).writeIntLE(e,r,this.span),this.span}};J.Int=ka;let Nc=class extends bt{constructor(e,n){if(super(e,n),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,n=0){return ut(e).readIntBE(n,this.span)}encode(e,n,r=0){return ut(n).writeIntBE(e,r,this.span),this.span}};J.IntBE=Nc;const T0=Math.pow(2,32);function kd(t){const e=Math.floor(t/T0),n=t-e*T0;return{hi32:e,lo32:n}}function Sd(t,e){return t*T0+e}let xA=class extends bt{constructor(e){super(8,e)}decode(e,n=0){const r=ut(e),i=r.readUInt32LE(n),s=r.readUInt32LE(n+4);return Sd(s,i)}encode(e,n,r=0){const i=kd(e),s=ut(n);return s.writeUInt32LE(i.lo32,r),s.writeUInt32LE(i.hi32,r+4),8}};J.NearUInt64=xA;let RA=class extends bt{constructor(e){super(8,e)}decode(e,n=0){const r=ut(e),i=r.readUInt32BE(n),s=r.readUInt32BE(n+4);return Sd(i,s)}encode(e,n,r=0){const i=kd(e),s=ut(n);return s.writeUInt32BE(i.hi32,r),s.writeUInt32BE(i.lo32,r+4),8}};J.NearUInt64BE=RA;let TA=class extends bt{constructor(e){super(8,e)}decode(e,n=0){const r=ut(e),i=r.readUInt32LE(n),s=r.readInt32LE(n+4);return Sd(s,i)}encode(e,n,r=0){const i=kd(e),s=ut(n);return s.writeUInt32LE(i.lo32,r),s.writeInt32LE(i.hi32,r+4),8}};J.NearInt64=TA;let OA=class extends bt{constructor(e){super(8,e)}decode(e,n=0){const r=ut(e),i=r.readInt32BE(n),s=r.readUInt32BE(n+4);return Sd(i,s)}encode(e,n,r=0){const i=kd(e),s=ut(n);return s.writeInt32BE(i.hi32,r),s.writeUInt32BE(i.lo32,r+4),8}};J.NearInt64BE=OA;let IA=class extends bt{constructor(e){super(4,e)}decode(e,n=0){return ut(e).readFloatLE(n)}encode(e,n,r=0){return ut(n).writeFloatLE(e,r),4}};J.Float=IA;let CA=class extends bt{constructor(e){super(4,e)}decode(e,n=0){return ut(e).readFloatBE(n)}encode(e,n,r=0){return ut(n).writeFloatBE(e,r),4}};J.FloatBE=CA;let NA=class extends bt{constructor(e){super(8,e)}decode(e,n=0){return ut(e).readDoubleLE(n)}encode(e,n,r=0){return ut(n).writeDoubleLE(e,r),8}};J.Double=NA;let PA=class extends bt{constructor(e){super(8,e)}decode(e,n=0){return ut(e).readDoubleBE(n)}encode(e,n,r=0){return ut(n).writeDoubleBE(e,r),8}};J.DoubleBE=PA;let MA=class extends bt{constructor(e,n,r){if(!(e instanceof bt))throw new TypeError("elementLayout must be a Layout");if(!(n instanceof or&&n.isCount()||Number.isInteger(n)&&0<=n))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let i=-1;!(n instanceof or)&&0<e.span&&(i=n*e.span),super(i,r),this.elementLayout=e,this.count=n}getSpan(e,n=0){if(0<=this.span)return this.span;let r=0,i=this.count;if(i instanceof or&&(i=i.decode(e,n)),0<this.elementLayout.span)r=i*this.elementLayout.span;else{let s=0;for(;s<i;)r+=this.elementLayout.getSpan(e,n+r),++s}return r}decode(e,n=0){const r=[];let i=0,s=this.count;for(s instanceof or&&(s=s.decode(e,n));i<s;)r.push(this.elementLayout.decode(e,n)),n+=this.elementLayout.getSpan(e,n),i+=1;return r}encode(e,n,r=0){const i=this.elementLayout,s=e.reduce((o,a)=>o+i.encode(a,n,r+o),0);return this.count instanceof or&&this.count.encode(e.length,n,r),s}};J.Sequence=MA;let LA=class extends bt{constructor(e,n,r){if(!(Array.isArray(e)&&e.reduce((s,o)=>s&&o instanceof bt,!0)))throw new TypeError("fields must be array of Layout instances");typeof n=="boolean"&&r===void 0&&(r=n,n=void 0);for(const s of e)if(0>s.span&&s.property===void 0)throw new Error("fields cannot contain unnamed variable-length layout");let i=-1;try{i=e.reduce((s,o)=>s+o.getSpan(),0)}catch{}super(i,n),this.fields=e,this.decodePrefixes=!!r}getSpan(e,n=0){if(0<=this.span)return this.span;let r=0;try{r=this.fields.reduce((i,s)=>
28{const o=s.getSpan(e,n);return n+=o,i+o},0)}catch{throw new RangeError("indeterminate span")}return r}decode(e,n=0){Cc(e);const r=this.makeDestinationObject();for(const i of this.fields)if(i.property!==void 0&&(r[i.property]=i.decode(e,n)),n+=i.getSpan(e,n),this.decodePrefixes&&e.length===n)break;return r}encode(e,n,r=0){const i=r;let s=0,o=0;for(const a of this.fields){let c=a.span;if(o=0<c?c:0,a.property!==void 0){const u=e[a.property];u!==void 0&&(o=a.encode(u,n,r),0>c&&(c=a.getSpan(n,r)))}s=r,r+=c}return s+o-i}fromArray(e){const n=this.makeDestinationObject();for(const r of this.fields)r.property!==void 0&&0<e.length&&(n[r.property]=e.shift());return n}layoutFor(e){if(typeof e!="string")throw new TypeError("property must be string");for(const n of this.fields)if(n.property===e)return n}offsetOf(e){if(typeof e!="string")throw new TypeError("property must be string");let n=0;for(const r of this.fields){if(r.property===e)return n;0>r.span?n=-1:0<=n&&(n+=r.span)}}};J.Structure=LA;let Fy=class{constructor(e){this.property=e}decode(e,n){throw new Error("UnionDiscriminator is abstract")}encode(e,n,r){throw new Error("UnionDiscriminator is abstract")}};J.UnionDiscriminator=Fy;let Sh=class extends Fy{constructor(e,n){if(!(e instanceof or&&e.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");super(n||e.property||"variant"),this.layout=e}decode(e,n){return this.layout.decode(e,n)}encode(e,n,r){return this.layout.encode(e,n,r)}};J.UnionLayoutDiscriminator=Sh;let Uy=class extends bt{constructor(e,n,r){let i;if(e instanceof Vr||e instanceof ci)i=new Sh(new $y(e));else if(e instanceof or&&e.isCount())i=new Sh(e);else if(e instanceof Fy)i=e;else throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(n===void 0&&(n=null),!(n===null||n instanceof bt))throw new TypeError("defaultLayout must be null or a Layout");if(n!==null){if(0>n.span)throw new Error("defaultLayout must have constant span");n.property===void 0&&(n=n.replicate("content"))}let s=-1;n&&(s=n.span,0<=s&&(e instanceof Vr||e instanceof ci)&&(s+=i.layout.span)),super(s,r),this.discriminator=i,this.usesPrefixDiscriminator=e instanceof Vr||e instanceof ci,this.defaultLayout=n,this.registry={};let o=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(a){return o(a)},this.configGetSourceVariant=function(a){o=a.bind(this)}}getSpan(e,n=0){if(0<=this.span)return this.span;const r=this.getVariant(e,n);if(!r)throw new Error("unable to determine span for unrecognized variant");return r.getSpan(e,n)}defaultGetSourceVariant(e){if(Object.prototype.hasOwnProperty.call(e,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(e,this.defaultLayout.property))return;const n=this.registry[e[this.discriminator.property]];if(n&&(!n.layout||n.property&&Object.prototype.hasOwnProperty.call(e,n.property)))return n}else for(const n in this.registry){const r=this.registry[n];if(r.property&&Object.prototype.hasOwnProperty.call(e,r.property))return r}throw new Error("unable to infer src variant")}decode(e,n=0){let r;const i=this.discriminator,s=i.decode(e,n),o=this.registry[s];if(o===void 0){const a=this.defaultLayout;let c=0;this.usesPrefixDiscriminator&&(c=i.layout.span),r=this.makeDestinationObject(),r[i.property]=s,r[a.property]=a.decode(e,n+c)}else r=o.decode(e,n);return r}encode(e,n,r=0){const i=this.getSourceVariant(e);if(i===void 0){const s=this.discriminator,o=this.defaultLayout;let a=0;return this.usesPrefixDiscriminator&&(a=s.layout.span),s.encode(e[s.property],n,r),a+o.encode(e[o.property],n,r+a)}return i.encode(e,n,r)}addVariant(e,n,r){const i=new BA(this,e,n,r);return this.registry[e]=i,i}getVariant(e,n=0){let r;return e instanceof Uint8Array?r=this.discriminator.decode(e,n):r=e,this.registry[r]}};J.Union=Uy;let BA=class extends bt{constructor(e,n,r,i){if(!(e instanceof Uy))throw new TypeError("union must be a Union");if(!Number.isInteger(n)||0>n)throw new TypeError("variant must be a (non-negative) integer");if(typeof r=="string"&&i===void 0&&(i=r,r=null),r){if(!(r instanceof bt))throw new TypeError("layout must be a Layout");if(e.defaultLayout!==null&&0<=r.span&&r.span>e.defaultLayout.span)throw new Error("variant span exceeds span of containing union");
vendor: 4,685 bytes, line 28
28if(typeof i!="string")throw new TypeError("variant must have a String property")}let s=e.span;0>e.span&&(s=r?r.span:0,0<=s&&e.usesPrefixDiscriminator&&(s+=e.discriminator.layout.span)),super(s,i),this.union=e,this.variant=n,this.layout=r||null}getSpan(e,n=0){if(0<=this.span)return this.span;let r=0;this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span);let i=0;return this.layout&&(i=this.layout.getSpan(e,n+r)),r+i}decode(e,n=0){const r=this.makeDestinationObject();if(this!==this.union.getVariant(e,n))throw new Error("variant mismatch");let i=0;return this.union.usesPrefixDiscriminator&&(i=this.union.discriminator.layout.span),this.layout?r[this.property]=this.layout.decode(e,n+i):this.property?r[this.property]=!0:this.union.usesPrefixDiscriminator&&(r[this.union.discriminator.property]=this.variant),r}encode(e,n,r=0){let i=0;if(this.union.usesPrefixDiscriminator&&(i=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(e,this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,n,r);let s=i;if(this.layout&&(this.layout.encode(e[this.property],n,r+i),s+=this.layout.getSpan(n,r+i),0<=this.union.span&&s>this.union.span))throw new Error("encoded variant overruns containing union");return s}fromArray(e){if(this.layout)return this.layout.fromArray(e)}};J.VariantLayout=BA;function Ba(t){return 0>t&&(t+=4294967296),t}let zy=class extends bt{constructor(e,n,r){if(!(e instanceof Vr||e instanceof ci))throw new TypeError("word must be a UInt or UIntBE layout");if(typeof n=="string"&&r===void 0&&(r=n,n=!1),4<e.span)throw new RangeError("word cannot exceed 32 bits");super(e.span,r),this.word=e,this.msb=!!n,this.fields=[];let i=0;this._packedSetValue=function(s){return i=Ba(s),this},this._packedGetValue=function(){return i}}decode(e,n=0){const r=this.makeDestinationObject(),i=this.word.decode(e,n);this._packedSetValue(i);for(const s of this.fields)s.property!==void 0&&(r[s.property]=s.decode(e));return r}encode(e,n,r=0){const i=this.word.decode(n,r);this._packedSetValue(i);for(const s of this.fields)if(s.property!==void 0){const o=e[s.property];o!==void 0&&s.encode(o)}return this.word.encode(this._packedGetValue(),n,r)}addField(e,n){const r=new Hy(this,e,n);return this.fields.push(r),r}addBoolean(e){const n=new DA(this,e);return this.fields.push(n),n}fieldFor(e){if(typeof e!="string")throw new TypeError("property must be string");for(const n of this.fields)if(n.property===e)return n}};J.BitStructure=zy;let Hy=class{constructor(e,n,r){if(!(e instanceof zy))throw new TypeError("container must be a BitStructure");if(!Number.isInteger(n)||0>=n)throw new TypeError("bits must be positive integer");const i=8*e.span,s=e.fields.reduce((o,a)=>o+a.bits,0);if(n+s>i)throw new Error("bits too long for span remainder ("+(i-s)+" of "+i+" remain)");this.container=e,this.bits=n,this.valueMask=(1<<n)-1,n===32&&(this.valueMask=4294967295),this.start=s,this.container.msb&&(this.start=i-s-n),this.wordMask=Ba(this.valueMask<<this.start),this.property=r}decode(e,n){const r=this.container._packedGetValue();return Ba(r&this.wordMask)>>>this.start}encode(e){if(typeof e!="number"||!Number.isInteger(e)||e!==Ba(e&this.valueMask))throw new TypeError(Dy("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);const n=this.container._packedGetValue(),r=Ba(e<<this.start);this.container._packedSetValue(Ba(n&~this.wordMask)|r)}};J.BitField=Hy;let DA=class extends Hy{constructor(e,n){super(e,1,n)}decode(e,n){return!!super.decode(e,n)}encode(e){typeof e=="boolean"&&(e=+e),super.encode(e)}};J.Boolean=DA;let $A=class extends bt{constructor(e,n){if(!(e instanceof or&&e.isCount()||Number.isInteger(e)&&0<=e))throw new TypeError("length must be positive integer or an unsigned integer ExternalLayout");let r=-1;e instanceof or||(r=e),super(r,n),this.length=e}getSpan(e,n){let r=this.span;return 0>r&&(r=this.length.decode(e,n)),r}decode(e,n=0){let r=this.span;return 0>r&&(r=this.length.decode(e,n)),ut(e).slice(n,n+r)}encode(e,n,r){let i=this.length;if(this.length instanceof or&&(i=e.length),!(e instanceof Uint8Array&&i===e.length))throw new TypeError(Dy("Blob.encode",this)+" requires (length "+i+") Uint8Array as src");if(r+i>n.length)throw new RangeError("encoding overruns Uint8Array");const s=ut(e);return ut(n).write(s.toString("hex"),r,i,"hex"),this.length instanceof or&&this.length.encode(i,n,r),i}};J.Blob=$A;let FA=class extends bt{constructor(e){super(-1,e)}getSpan(e,n=0){Cc(e);let r=n;for(;r<e.length&&e[r]!==0;)r+=1;return 1+r-n}decode(e,n=0){const r=this.getSpan(e,n);return ut(e).slice(n,n+r-1).toString("utf-8")}
28encode(e,n,r=0){typeof e!="string"&&(e=String(e));const i=By.Buffer.from(e,"utf8"),s=i.length;if(r+s>n.length)throw new RangeError("encoding overruns Buffer");const o=ut(n);return i.copy(o,r),o[r+s]=0,s+1}};J.CString=FA;let UA=class extends bt{constructor(e,n){if(typeof e=="string"&&n===void 0&&(n=e,e=void 0),e===void 0)e=-1;else if(!Number.isInteger(e))throw new TypeError("maxSpan must be an integer");super(-1,n),this.maxSpan=e}getSpan(e,n=0){return Cc(e),e.length-n}decode(e,n=0){const r=this.getSpan(e,n);if(0<=this.maxSpan&&this.maxSpan<r)throw new RangeError("text length exceeds maxSpan");return ut(e).slice(n,n+r).toString("utf-8")}encode(e,n,r=0){typeof e!="string"&&(e=String(e));const i=By.Buffer.from(e,"utf8"),s=i.length;if(0<=this.maxSpan&&this.maxSpan<s)throw new RangeError("text length exceeds maxSpan");if(r+s>n.length)throw new RangeError("encoding overruns Buffer");return i.copy(ut(n),r),s}};J.UTF8=UA;let zA=class extends bt{constructor(e,n){super(0,n),this.value=e}decode(e,n){return this.value}encode(e,n,r){return 0}};J.Constant=zA;J.greedy=(t,e)=>new AA(t,e);var Gs=J.offset=(t,e,n)=>new $y(t,e,n),Ge=J.u8=t=>new Vr(1,t),Br=J.u16=t=>new Vr(2,t);J.u24=t=>new Vr(3,t);var Se=J.u32=t=>new Vr(4,t);J.u40=t=>new Vr(5,t);J.u48=t=>new Vr(6,t);var In=J.nu64=t=>new xA(t);J.u16be=t=>new ci(2,t);J.u24be=t=>new ci(3,t);J.u32be=t=>new ci(4,t);J.u40be=t=>new ci(5,t);J.u48be=t=>new ci(6,t);J.nu64be=t=>new RA(t);J.s8=t=>new ka(1,t);J.s16=t=>new ka(2,t);J.s24=t=>new ka(3,t);J.s32=t=>new ka(4,t);J.s40=t=>new ka(5,t);J.s48=t=>new ka(6,t);var wr=J.ns64=t=>new TA(t);J.s16be=t=>new Nc(2,t);J.s24be=t=>new Nc(3,t);J.s32be=t=>new Nc(4,t);J.s40be=t=>new Nc(5,t);J.s48be=t=>new Nc(6,t);J.ns64be=t=>new OA(t);J.f32=t=>new IA(t);J.f32be=t=>new CA(t);J.f64=t=>new NA(t);J.f64be=t=>new PA(t);var Ae=J.struct=(t,e,n)=>new LA(t,e,n);J.bits=(t,e,n)=>new zy(t,e,n);var Dn=J.seq=(t,e,n)=>new MA(t,e,n);J.union=(t,e,n)=>new Uy(t,e,n);J.unionLayoutDiscriminator=(t,e)=>new Sh(t,e);var kt=J.blob=(t,e)=>new $A(t,e);J.cstr=t=>new FA(t);J.utf8=(t,e)=>new UA(t,e);J.constant=(t,e)=>new zA(t,e);function E$(t){if(Array.isArray(t))return t}function A$(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,s,o,a=[],c=!0,u=!1;try{if(s=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=s.call(n)).done)&&(a.push(r.value),a.length!==e);c=!0);}catch(l){u=!0,i=l}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function O0(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function HA(t,e){if(t){if(typeof t=="string")return O0(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return O0(t,e)}}function x$(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 29In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ot(t,e){return E$(t)||A$(t,e)||HA(t,e)||x$()}var wl={};Object.defineProperty(wl,"__esModule",{value:!0});function R$(t){{const e=ne.Buffer.from(t);e.reverse();const n=e.toString("hex");return n.length===0?BigInt(0):BigInt(`0x${n}`)}}var WA=wl.toBigIntLE=R$;function T$(t){{const e=t.toString("hex");return e.length===0?BigInt(0):BigInt(`0x${e}`)}}wl.toBigIntBE=T$;function O$(t,e){{const n=t.toString(16),r=ne.Buffer.from(n.padStart(e*2,"0").slice(0,e*2),"hex");return r.reverse(),r}}var Wy=wl.toBufferLE=O$;function I$(t,e){{const n=t.toString(16);return ne.Buffer.from(n.padStart(e*2,"0").slice(0,e*2),"hex")}}wl.toBufferBE=I$;function jy(t,e,n){return e=eA(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function C$(t){if(Array.isArray(t))return O0(t)}function N$(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function P$(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 30In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ut(t){return C$(t)||N$(t)||HA(t)||P$()}function M$(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,s;for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function Df(t,e){if(t==null)return{};var n=M$(t,e),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)r=s[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}let L$=class extends TypeError{constructor(e,n){let r;const{message:i,...s}=e,{path:o}=e,a=o.length===0?i:"At path: "+o.join(".")+" -- "+i;super(a),Object.assign(this,s),this.name=this.constructor.name,this.failures=()=>{var c;return(c=r)!=null?c:r=[e,...n()]}}};function B$(t){return Ys(t)&&typeof t[Symbol.iterator]=="function"}function Ys(t){return typeof t=="object"&&t!=null}function fi(t){return typeof t=="string"?JSON.stringify(t):""+t}function D$(t){const{done:e,value:n}=t.next();return e?void 0:n}function $$(t,e,n,r){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:i,branch:s}=e,{type:o}=n,{refinement:a,message:c="Expected a value of type `"+o+"`"+(a?" with refinement `"+a+"`":"")+", but received: `"+fi(r)+"`"}=t;return{value:r,type:o,refinement:a,key:i[i.length-1],path:i,branch:s,...t,message:c}}function*uw(t,e,n,r){B$(t)||(t=[t]);for(const i of t){const s=$$(i,e,n,r);s&&(yield s)}}function*Ky(t,e,n={}){const{path:r=[],branch:i=[t],coerce:s=!1,mask:o=!1}=n,a={path:r,branch:i};if(s&&(t=e.coercer(t,a),o&&e.type!=="type"&&Ys(e.schema)&&Ys(t)&&!Array.isArray(t)))for(const u in t)e.schema[u]===void 0&&delete t[u];let c=!0;for(const u of e.validator(t,a))c=!1,yield[u,void 0];for(let[u,l,h]of e.entries(t,a)){const p=Ky(l,h,{path:u===void 0?r:[...r,u],branch:u===void 0?i:[...i,l],coerce:s,mask:o});for(const g of p)g[0]?(c=!1,yield[g[0],void 0]):s&&(l=g[1],u===void 0?t=l:t instanceof Map?t.set(u,l):t instanceof Set?t.add(l):Ys(t)&&(t[u]=l))}if(c)for(const u of e.refiner(t,a))c=!1,yield[u,void 0];c&&(yield[void 0,t])}let Ki=class{constructor(e){const{type:n,schema:r,validator:i,refiner:s,coercer:o=c=>c,entries:a=function*(){}}=e;this.type=n,this.schema=r,this.entries=a,this.coercer=o,i?this.validator=(c,u)=>{const l=i(c,u);return uw(l,u,this,c)}:this.validator=()=>[],s?this.refiner=(c,u)=>{const l=s(c,u);return uw(l,u,this,c)}:this.refiner=()=>[]}assert(e){return jA(e,this)}create(e){return pe(e,this)}is(e){return KA(e,this)}mask(e){return F$(e,this)}validate(e,n={}){return _l(e,this,n)}};function jA(t,e){const n=_l(t,e);if(n[0])throw n[0]}function pe(t,e){const n=_l(t,e,{coerce:!0});if(n[0])throw n[0];return n[1]}function F$(t,e){const n=_l(t,e,{coerce:!0,mask:!0});if(n[0])throw n[0];return n[1]}function KA(t,e){return!_l(t,e)[0]}function _l(t,e,n={}){const r=Ky(t,e,n),i=D$(r);return i[0]?[new L$(i[0],function*(){for(const o of r)o[0]&&(yield o[0])}),void 0]:[void 0,i[1]]}function Sa(t,e){return new Ki({type:t,schema:null,validator:e})}function U$(){return Sa("any",()=>!0)}function be(t){return new Ki({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[n,r]of e.entries())yield[n,r,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||"Expected an array value, but received: "+fi(e)}})}function Di(){return Sa("boolean",t=>typeof t=="boolean")}function Vy(t){return Sa("instance",e=>
30e instanceof t||"Expected a `"+t.name+"` instance, but received: "+fi(e))}function Dt(t){const e=fi(t),n=typeof t;return new Ki({type:"literal",schema:n==="string"||n==="number"||n==="boolean"?t:null,validator(r){return r===t||"Expected the literal `"+e+"`, but received: "+fi(r)}})}function z$(){return Sa("never",()=>!1)}function we(t){return new Ki({...t,validator:(e,n)=>e===null||t.validator(e,n),refiner:(e,n)=>e===null||t.refiner(e,n)})}function Z(){return Sa("number",t=>typeof t=="number"&&!isNaN(t)||"Expected a number, but received: "+fi(t))}function Me(t){return new Ki({...t,validator:(e,n)=>e===void 0||t.validator(e,n),refiner:(e,n)=>e===void 0||t.refiner(e,n)})}function VA(t,e){return new Ki({type:"record",schema:null,*entries(n){if(Ys(n))for(const r in n){const i=n[r];yield[r,r,t],yield[r,i,e]}},validator(n){return Ys(n)||"Expected an object, but received: "+fi(n)}})}function de(){return Sa("string",t=>typeof t=="string"||"Expected a string, but received: "+fi(t))}function qy(t){const e=z$();return new Ki({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(n){return Array.isArray(n)||"Expected an array, but received: "+fi(n)}})}function fe(t){const e=Object.keys(t);return new Ki({type:"type",schema:t,*entries(n){if(Ys(n))for(const r of e)yield[r,n[r],t[r]]},validator(n){return Ys(n)||"Expected an object, but received: "+fi(n)}})}function fr(t){const e=t.map(n=>n.type).join(" | ");return new Ki({type:"union",schema:null,validator(n,r){const i=[];for(const s of t){const[...o]=Ky(n,s,r),[a]=o;if(a[0])for(const[c]of o)c&&i.push(c);else return[]}return["Expected the value to satisfy a union of `"+e+"`, but received: "+fi(n),...i]}})}function kl(){return Sa("unknown",()=>!0)}function Sl(t,e,n){return new Ki({...t,coercer:(r,i)=>KA(r,e)?t.coercer(n(r,i),i):t.coercer(r,i)})}var uf,H$=new Uint8Array(16);function qA(){if(!uf&&(uf=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!uf))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return uf(H$)}const W$=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Ed(t){return typeof t=="string"&&W$.test(t)}var On=[];for(var Vp=0;Vp<256;++Vp)On.push((Vp+256).toString(16).substr(1));function Ad(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(On[t[e+0]]+On[t[e+1]]+On[t[e+2]]+On[t[e+3]]+"-"+On[t[e+4]]+On[t[e+5]]+"-"+On[t[e+6]]+On[t[e+7]]+"-"+On[t[e+8]]+On[t[e+9]]+"-"+On[t[e+10]]+On[t[e+11]]+On[t[e+12]]+On[t[e+13]]+On[t[e+14]]+On[t[e+15]]).toLowerCase();if(!Ed(n))throw TypeError("Stringified UUID is invalid");return n}var lw,qp,Gp=0,Yp=0;function j$(t,e,n){var r=e&&n||0,i=e||new Array(16);t=t||{};var s=t.node||lw,o=t.clockseq!==void 0?t.clockseq:qp;if(s==null||o==null){var a=t.random||(t.rng||qA)();s==null&&(s=lw=[a[0]|1,a[1],a[2],a[3],a[4],a[5]]),o==null&&(o=qp=(a[6]<<8|a[7])&16383)}var c=t.msecs!==void 0?t.msecs:Date.now(),u=t.nsecs!==void 0?t.nsecs:Yp+1,l=c-Gp+(u-Yp)/1e4;if(l<0&&t.clockseq===void 0&&(o=o+1&16383),(l<0||c>Gp)&&t.nsecs===void 0&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Gp=c,Yp=u,qp=o,c+=122192928e5;var h=((c&268435455)*1e4+u)%4294967296;i[r++]=h>>>24&255,i[r++]=h>>>16&255,i[r++]=h>>>8&255,i[r++]=h&255;var p=c/4294967296*1e4&268435455;i[r++]=p>>>8&255,i[r++]=p&255,i[r++]=p>>>24&15|16,i[r++]=p>>>16&255,i[r++]=o>>>8|128,i[r++]=o&255;for(var g=0;g<6;++g)i[r+g]=s[g];return e||Ad(i)}function GA(t){if(!Ed(t))throw TypeError("Invalid UUID");var e,n=new Uint8Array(16);return n[0]=(e=parseInt(t.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=e&255,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=e&255,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=e&255,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=e&255,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=e&255,n}function K$(t){t=unescape(encodeURIComponent(t));for(var e=[],n=0;n<t.length;++n)e.push(t.charCodeAt(n));return e}var V$="6ba7b810-9dad-11d1-80b4-00c04fd430c8",q$="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function YA(t,e,n){function r(i,s,o,a){if(typeof i=="string"&&(i=K$(i)),typeof s=="string"&&(s=GA(s)),s.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var c=new Uint8Array(16+i.length);if(c.set(s),c.set(i,s.length),c=n(c),c[6]=c[6]&15|e,c[8]=c[8]&63|128,o){a=a||0;for(var u=0;u<16;++u)o[a+u]=c[u];return o}return Ad(c)}try{r.name=t}catch{}return r.DNS=V$,r.URL=q$,r}function G$(t){if(typeof t=="string"){var e=unescape(encodeURIComponent(t));
vendor: 4,226 bytes, line 30
30t=new Uint8Array(e.length);for(var n=0;n<e.length;++n)t[n]=e.charCodeAt(n)}return Y$(Z$(X$(t),t.length*8))}function Y$(t){for(var e=[],n=t.length*32,r="0123456789abcdef",i=0;i<n;i+=8){var s=t[i>>5]>>>i%32&255,o=parseInt(r.charAt(s>>>4&15)+r.charAt(s&15),16);e.push(o)}return e}function ZA(t){return(t+64>>>9<<4)+14+1}function Z$(t,e){t[e>>5]|=128<<e%32,t[ZA(e)-1]=e;for(var n=1732584193,r=-271733879,i=-1732584194,s=271733878,o=0;o<t.length;o+=16){var a=n,c=r,u=i,l=s;n=Fn(n,r,i,s,t[o],7,-680876936),s=Fn(s,n,r,i,t[o+1],12,-389564586),i=Fn(i,s,n,r,t[o+2],17,606105819),r=Fn(r,i,s,n,t[o+3],22,-1044525330),n=Fn(n,r,i,s,t[o+4],7,-176418897),s=Fn(s,n,r,i,t[o+5],12,1200080426),i=Fn(i,s,n,r,t[o+6],17,-1473231341),r=Fn(r,i,s,n,t[o+7],22,-45705983),n=Fn(n,r,i,s,t[o+8],7,1770035416),s=Fn(s,n,r,i,t[o+9],12,-1958414417),i=Fn(i,s,n,r,t[o+10],17,-42063),r=Fn(r,i,s,n,t[o+11],22,-1990404162),n=Fn(n,r,i,s,t[o+12],7,1804603682),s=Fn(s,n,r,i,t[o+13],12,-40341101),i=Fn(i,s,n,r,t[o+14],17,-1502002290),r=Fn(r,i,s,n,t[o+15],22,1236535329),n=Un(n,r,i,s,t[o+1],5,-165796510),s=Un(s,n,r,i,t[o+6],9,-1069501632),i=Un(i,s,n,r,t[o+11],14,643717713),r=Un(r,i,s,n,t[o],20,-373897302),n=Un(n,r,i,s,t[o+5],5,-701558691),s=Un(s,n,r,i,t[o+10],9,38016083),i=Un(i,s,n,r,t[o+15],14,-660478335),r=Un(r,i,s,n,t[o+4],20,-405537848),n=Un(n,r,i,s,t[o+9],5,568446438),s=Un(s,n,r,i,t[o+14],9,-1019803690),i=Un(i,s,n,r,t[o+3],14,-187363961),r=Un(r,i,s,n,t[o+8],20,1163531501),n=Un(n,r,i,s,t[o+13],5,-1444681467),s=Un(s,n,r,i,t[o+2],9,-51403784),i=Un(i,s,n,r,t[o+7],14,1735328473),r=Un(r,i,s,n,t[o+12],20,-1926607734),n=zn(n,r,i,s,t[o+5],4,-378558),s=zn(s,n,r,i,t[o+8],11,-2022574463),i=zn(i,s,n,r,t[o+11],16,1839030562),r=zn(r,i,s,n,t[o+14],23,-35309556),n=zn(n,r,i,s,t[o+1],4,-1530992060),s=zn(s,n,r,i,t[o+4],11,1272893353),i=zn(i,s,n,r,t[o+7],16,-155497632),r=zn(r,i,s,n,t[o+10],23,-1094730640),n=zn(n,r,i,s,t[o+13],4,681279174),s=zn(s,n,r,i,t[o],11,-358537222),i=zn(i,s,n,r,t[o+3],16,-722521979),r=zn(r,i,s,n,t[o+6],23,76029189),n=zn(n,r,i,s,t[o+9],4,-640364487),s=zn(s,n,r,i,t[o+12],11,-421815835),i=zn(i,s,n,r,t[o+15],16,530742520),r=zn(r,i,s,n,t[o+2],23,-995338651),n=Hn(n,r,i,s,t[o],6,-198630844),s=Hn(s,n,r,i,t[o+7],10,1126891415),i=Hn(i,s,n,r,t[o+14],15,-1416354905),r=Hn(r,i,s,n,t[o+5],21,-57434055),n=Hn(n,r,i,s,t[o+12],6,1700485571),s=Hn(s,n,r,i,t[o+3],10,-1894986606),i=Hn(i,s,n,r,t[o+10],15,-1051523),r=Hn(r,i,s,n,t[o+1],21,-2054922799),n=Hn(n,r,i,s,t[o+8],6,1873313359),s=Hn(s,n,r,i,t[o+15],10,-30611744),i=Hn(i,s,n,r,t[o+6],15,-1560198380),r=Hn(r,i,s,n,t[o+13],21,1309151649),n=Hn(n,r,i,s,t[o+4],6,-145523070),s=Hn(s,n,r,i,t[o+11],10,-1120210379),i=Hn(i,s,n,r,t[o+2],15,718787259),r=Hn(r,i,s,n,t[o+9],21,-343485551),n=Ws(n,a),r=Ws(r,c),i=Ws(i,u),s=Ws(s,l)}return[n,r,i,s]}function X$(t){if(t.length===0)return[];for(var e=t.length*8,n=new Uint32Array(ZA(e)),r=0;r<e;r+=8)n[r>>5]|=(t[r/8]&255)<<r%32;return n}function Ws(t,e){var n=(t&65535)+(e&65535),r=(t>>16)+(e>>16)+(n>>16);return r<<16|n&65535}function J$(t,e){return t<<e|t>>>32-e}function xd(t,e,n,r,i,s){return Ws(J$(Ws(Ws(e,t),Ws(r,s)),i),n)}function Fn(t,e,n,r,i,s,o){return xd(e&n|~e&r,t,e,i,s,o)}function Un(t,e,n,r,i,s,o){return xd(e&r|n&~r,t,e,i,s,o)}function zn(t,e,n,r,i,s,o){return xd(e^n^r,t,e,i,s,o)}function Hn(t,e,n,r,i,s,o){return xd(n^(e|~r),t,e,i,s,o)}var Q$=YA("v3",48,G$);const eF=Q$;function tF(t,e,n){t=t||{};var r=t.random||(t.rng||qA)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){n=n||0;for(var i=0;i<16;++i)e[n+i]=r[i];return e}return Ad(r)}function nF(t,e,n,r){switch(t){case 0:return e&n^~e&r;case 1:return e^n^r;case 2:return e&n^e&r^n&r;case 3:return e^n^r}}function Zp(t,e){return t<<e|t>>>32-e}function rF(t){var e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof t=="string"){var r=unescape(encodeURIComponent(t));t=[];for(var i=0;i<r.length;++i)t.push(r.charCodeAt(i))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);for(var s=t.length/4+2,o=Math.ceil(s/16),a=new Array(o),c=0;c<o;++c){for(var u=new Uint32Array(16),l=0;l<16;++l)u[l]=t[c*64+l*4]<<24|t[c*64+l*4+1]<<16|t[c*64+l*4+2]<<8|t[c*64+l*4+3];a[c]=u}a[o-1][14]=(t.length-1)*8/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][
3014]),a[o-1][15]=(t.length-1)*8&4294967295;for(var h=0;h<o;++h){for(var p=new Uint32Array(80),g=0;g<16;++g)p[g]=a[h][g];for(var y=16;y<80;++y)p[y]=Zp(p[y-3]^p[y-8]^p[y-14]^p[y-16],1);for(var w=n[0],k=n[1],T=n[2],C=n[3],O=n[4],I=0;I<80;++I){var N=Math.floor(I/20),F=Zp(w,5)+nF(N,k,T,C)+O+e[N]+p[I]>>>0;O=C,C=T,T=Zp(k,30)>>>0,k=w,w=F}n[0]=n[0]+w>>>0,n[1]=n[1]+k>>>0,n[2]=n[2]+T>>>0,n[3]=n[3]+C>>>0,n[4]=n[4]+O>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,n[0]&255,n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,n[1]&255,n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,n[2]&255,n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,n[3]&255,n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,n[4]&255]}var iF=YA("v5",80,rF);const sF=iF,oF="00000000-0000-0000-0000-000000000000";function aF(t){if(!Ed(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}const cF=Object.freeze(Object.defineProperty({__proto__:null,NIL:oF,parse:GA,stringify:Ad,v1:j$,v3:eF,v4:tF,v5:sF,validate:Ed,version:aF},Symbol.toStringTag,{value:"Module"})),XA=zi(cF),uF=XA.v4,lF=function(t,e,n,r){if(typeof t!="string")throw new TypeError(t+" must be a string");r=r||{};const i=typeof r.version=="number"?r.version:2;if(i!==1&&i!==2)throw new TypeError(i+" must be 1 or 2");const s={method:t};if(i===2&&(s.jsonrpc="2.0"),e){if(typeof e!="object"&&!Array.isArray(e))throw new TypeError(e+" must be an object, array or omitted");s.params=e}if(typeof n>"u"){const o=typeof r.generator=="function"?r.generator:function(){return uF()};s.id=o(s,r)}else i===2&&n===null?r.notificationIdNull&&(s.id=null):s.id=n;return s};var fF=lF;const hF=XA.v4,dF=fF,Gu=function(t,e){if(!(this instanceof Gu))return new Gu(t,e);e||(e={}),this.options={reviver:typeof e.reviver<"u"?e.reviver:null,replacer:typeof e.replacer<"u"?e.replacer:null,generator:typeof e.generator<"u"?e.generator:function(){return hF()},version:typeof e.version<"u"?e.version:2,notificationIdNull:typeof e.notificationIdNull=="boolean"?e.notificationIdNull:!1},this.callServer=t};var pF=Gu;Gu.prototype.request=function(t,e,n,r){const i=this;let s=null;const o=Array.isArray(t)&&typeof e=="function";if(this.options.version===1&&o)throw new TypeError("JSON-RPC 1.0 does not support batching");if(o||!o&&t&&typeof t=="object"&&typeof e=="function")r=e,s=t;else{typeof n=="function"&&(r=n,n=void 0);const u=typeof r=="function";try{s=dF(t,e,n,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(l){if(u)return r(l);throw l}if(!u)return s}let c;try{c=JSON.stringify(s,this.options.replacer)}catch(u){return r(u)}return this.callServer(c,function(u,l){i._parseResponse(u,l,r)}),s};Gu.prototype._parseResponse=function(t,e,n){if(t){n(t);return}if(!e)return n();let r;try{r=JSON.parse(e,this.options.reviver)}catch(i){return n(i)}if(n.length===3)if(Array.isArray(r)){const i=function(o){return typeof o.error<"u"},s=function(o){return!i(o)};return n(null,r.filter(i),r.filter(s))}else return n(null,r.error,r.result);n(null,r)};const gF=Ui(pF);function mF(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function yF(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function $f(t,e,n){return yF()?$f=Reflect.construct.bind():$f=function(i,s,o){var a=[null];a.push.apply(a,s);var c=Function.bind.apply(i,a),u=new c;return o&&Vu(u,o.prototype),u},$f.apply(null,arguments)}function ua(t){var e=typeof Map=="function"?new Map:void 0;return ua=function(r){if(r===null||!mF(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(r))return e.get(r);e.set(r,i)}function i(){return $f(r,arguments,$n(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Vu(i,r)},ua(t)}function vF(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&(t=$n(t),t!==null););return t}function wu(){return typeof Reflect<"u"&&Reflect.get?wu=Reflect.get.bind():wu=function(e,n,r){var i=vF(e,n);if(i){var s=Object.getOwnPropertyDescriptor(i,n);return s.get?s.get.call(arguments.length<3?e:r):s.value}},wu.apply(this,arguments)}var JA={},QA={exports:{}};(function(t){function e(n){return n&&n.__esModule?n:{default:n}}
30t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})(QA);var e2=QA.exports,Xp={exports:{}},Jp={exports:{}},fw;function bF(){return fw||(fw=1,function(t){function e(n){"@babel/helpers - typeof";return t.exports=e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}(Jp)),Jp.exports}var hw;function wF(){return hw||(hw=1,function(t){var e=bF().default;function n(){t.exports=n=function(){return r},t.exports.__esModule=!0,t.exports.default=t.exports;var r={},i=Object.prototype,s=i.hasOwnProperty,o=Object.defineProperty||function(d,v,b){d[v]=b.value},a=typeof Symbol=="function"?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function h(d,v,b){return Object.defineProperty(d,v,{value:b,enumerable:!0,configurable:!0,writable:!0}),d[v]}try{h({},"")}
vendor: 4,208 bytes, line 30
30catch{h=function(b,E,x){return b[E]=x}}function p(d,v,b,E){var x=v&&v.prototype instanceof w?v:w,M=Object.create(x.prototype),P=new _(E||[]);return o(M,"_invoke",{value:D(d,b,P)}),M}function g(d,v,b){try{return{type:"normal",arg:d.call(v,b)}}catch(E){return{type:"throw",arg:E}}}r.wrap=p;var y={};function w(){}function k(){}function T(){}var C={};h(C,c,function(){return this});var O=Object.getPrototypeOf,I=O&&O(O(m([])));I&&I!==i&&s.call(I,c)&&(C=I);var N=T.prototype=w.prototype=Object.create(C);function F(d){["next","throw","return"].forEach(function(v){h(d,v,function(b){return this._invoke(v,b)})})}function L(d,v){function b(x,M,P,S){var $=g(d[x],d,M);if($.type!=="throw"){var ie=$.arg,le=ie.value;return le&&e(le)=="object"&&s.call(le,"__await")?v.resolve(le.__await).then(function(se){b("next",se,P,S)},function(se){b("throw",se,P,S)}):v.resolve(le).then(function(se){ie.value=se,P(ie)},function(se){return b("throw",se,P,S)})}S($.arg)}var E;o(this,"_invoke",{value:function(M,P){function S(){return new v(function($,ie){b(M,P,$,ie)})}return E=E?E.then(S,S):S()}})}function D(d,v,b){var E="suspendedStart";return function(x,M){if(E==="executing")throw new Error("Generator is already running");if(E==="completed"){if(x==="throw")throw M;return f()}for(b.method=x,b.arg=M;;){var P=b.delegate;if(P){var S=H(P,b);if(S){if(S===y)continue;return S}}if(b.method==="next")b.sent=b._sent=b.arg;else if(b.method==="throw"){if(E==="suspendedStart")throw E="completed",b.arg;b.dispatchException(b.arg)}else b.method==="return"&&b.abrupt("return",b.arg);E="executing";var $=g(d,v,b);if($.type==="normal"){if(E=b.done?"completed":"suspendedYield",$.arg===y)continue;return{value:$.arg,done:b.done}}$.type==="throw"&&(E="completed",b.method="throw",b.arg=$.arg)}}}function H(d,v){var b=v.method,E=d.iterator[b];if(E===void 0)return v.delegate=null,b==="throw"&&d.iterator.return&&(v.method="return",v.arg=void 0,H(d,v),v.method==="throw")||b!=="return"&&(v.method="throw",v.arg=new TypeError("The iterator does not provide a '"+b+"' method")),y;var x=g(E,d.iterator,v.arg);if(x.type==="throw")return v.method="throw",v.arg=x.arg,v.delegate=null,y;var M=x.arg;return M?M.done?(v[d.resultName]=M.value,v.next=d.nextLoc,v.method!=="return"&&(v.method="next",v.arg=void 0),v.delegate=null,y):M:(v.method="throw",v.arg=new TypeError("iterator result is not an object"),v.delegate=null,y)}function z(d){var v={tryLoc:d[0]};1 in d&&(v.catchLoc=d[1]),2 in d&&(v.finallyLoc=d[2],v.afterLoc=d[3]),this.tryEntries.push(v)}function K(d){var v=d.completion||{};v.type="normal",delete v.arg,d.completion=v}function _(d){this.tryEntries=[{tryLoc:"root"}],d.forEach(z,this),this.reset(!0)}function m(d){if(d){var v=d[c];if(v)return v.call(d);if(typeof d.next=="function")return d;if(!isNaN(d.length)){var b=-1,E=function x(){for(;++b<d.length;)if(s.call(d,b))return x.value=d[b],x.done=!1,x;return x.value=void 0,x.done=!0,x};return E.next=E}}return{next:f}}function f(){return{value:void 0,done:!0}}return k.prototype=T,o(N,"constructor",{value:T,configurable:!0}),o(T,"constructor",{value:k,configurable:!0}),k.displayName=h(T,l,"GeneratorFunction"),r.isGeneratorFunction=function(d){var v=typeof d=="function"&&d.constructor;return!!v&&(v===k||(v.displayName||v.name)==="GeneratorFunction")},r.mark=function(d){return Object.setPrototypeOf?Object.setPrototypeOf(d,T):(d.__proto__=T,h(d,l,"GeneratorFunction")),d.prototype=Object.create(N),d},r.awrap=function(d){return{__await:d}},F(L.prototype),h(L.prototype,u,function(){return this}),r.AsyncIterator=L,r.async=function(d,v,b,E,x){x===void 0&&(x=Promise);var M=new L(p(d,v,b,E),x);return r.isGeneratorFunction(v)?M:M.next().then(function(P){return P.done?P.value:M.next()})},F(N),h(N,l,"Generator"),h(N,c,function(){return this}),h(N,"toString",function(){return"[object Generator]"}),r.keys=function(d){var v=Object(d),b=[];for(var E in v)b.push(E);return b.reverse(),function x(){for(;b.length;){var M=b.pop();if(M in v)return x.value=M,x.done=!1,x}return x.done=!0,x}},r.values=m,_.prototype={constructor:_,reset:function(v){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.forEac
30h(K),!v)for(var b in this)b.charAt(0)==="t"&&s.call(this,b)&&!isNaN(+b.slice(1))&&(this[b]=void 0)},stop:function(){this.done=!0;var v=this.tryEntries[0].completion;if(v.type==="throw")throw v.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var b=this;function E(ie,le){return P.type="throw",P.arg=v,b.next=ie,le&&(b.method="next",b.arg=void 0),!!le}for(var x=this.tryEntries.length-1;x>=0;--x){var M=this.tryEntries[x],P=M.completion;if(M.tryLoc==="root")return E("end");if(M.tryLoc<=this.prev){var S=s.call(M,"catchLoc"),$=s.call(M,"finallyLoc");if(S&&$){if(this.prev<M.catchLoc)return E(M.catchLoc,!0);if(this.prev<M.finallyLoc)return E(M.finallyLoc)}else if(S){if(this.prev<M.catchLoc)return E(M.catchLoc,!0)}else{if(!$)throw new Error("try statement without catch or finally");if(this.prev<M.finallyLoc)return E(M.finallyLoc)}}}},abrupt:function(v,b){for(var E=this.tryEntries.length-1;E>=0;--E){var x=this.tryEntries[E];if(x.tryLoc<=this.prev&&s.call(x,"finallyLoc")&&this.prev<x.finallyLoc){var M=x;break}}M&&(v==="break"||v==="continue")&&M.tryLoc<=b&&b<=M.finallyLoc&&(M=null);var P=M?M.completion:{};return P.type=v,P.arg=b,M?(this.method="next",this.next=M.finallyLoc,y):this.complete(P)},complete:function(v,b){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&b&&(this.next=b),y},finish:function(v){for(var b=this.tryEntries.length-1;b>=0;--b){var E=this.tryEntries[b];if(E.finallyLoc===v)return this.complete(E.completion,E.afterLoc),K(E),y}},catch:function(v){for(var b=this.tryEntries.length-1;b>=0;--b){var E=this.tryEntries[b];if(E.tryLoc===v){var x=E.completion;if(x.type==="throw"){var M=x.arg;K(E)}return M}}throw new Error("illegal catch attempt")},delegateYield:function(v,b,E){return this.delegate={iterator:m(v),resultName:b,nextLoc:E},this.method==="next"&&(this.arg=void 0),y}},r}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}(Xp)),Xp.exports}var Qp,dw;function _F(){if(dw)return Qp;dw=1;var t=wF()();Qp=t;try{regeneratorRuntime=t}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}return Qp}const kF=zi(VD),SF=zi(I6),t2=zi(O6),n2=zi(N6),r2=zi(qD),i2=zi(YD),s2=zi(ZD);(function(t){var e=e2;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=e(_F()),r=e(kF),i=e(SF),s=e(t2),o=e(n2),a=e(r2),c=e(i2),u=e(s2),l=Sy();function h(w){var k=p();return function(){var C=(0,u.default)(w),O;if(k){var I=(0,u.default)(this).constructor;O=Reflect.construct(C,arguments,I)}else O=C.apply(this,arguments);return(0,c.default)(this,O)}}function p(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var g=function(w,k){var T={};for(var C in w)Object.prototype.hasOwnProperty.call(w,C)&&k.indexOf(C)<0&&(T[C]=w[C]);if(w!=null&&typeof Object.getOwnPropertySymbols=="function")for(var O=0,C=Object.getOwnPropertySymbols(w);O<C.length;O++)k.indexOf(C[O])<0&&Object.prototype.propertyIsEnumerable.call(w,C[O])&&(T[C[O]]=w[C[O]]);return T},y=function(w){(0,a.default)(T,w);var k=h(T);function T(C){var O,I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"ws://localhost:8080",N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},F=arguments.length>3?arguments[3]:void 0;(0,s.default)(this,T);var L=N.autoconnect,D=L===void 0?!0:L,H=N.reconnect,z=H===void 0?!0:H,K=N.reconnect_interval,_=K===void 0?1e3:K,m=N.max_reconnects,f=m===void 0?5:m,d=g(N,["autoconnect","reconnect","reconnect_interval","max_reconnects"]);return O=k.call(this),O.webSocketFactory=C,O.queue={},O.rpc_id=0,O.address=I,O.autoconnect=D,O.ready=!1,O.reconnect=z,O.reconnect_timer_id=void 0,O.reconnect_interval=_,O.max_reconnects=f,O.rest_options=d,O.current_reconnects=0,O.generate_request_id=F||function(){return++O.rpc_id},O.autoconnect&&O._connect(O.address,Object.assign({autoconnect:O.autoconnect,reconnect:O.reconnect,reconnect_interval:O.reconnect_interval,max_reconnects:O.max_reconnects},O.rest_options)),O}
30return(0,o.default)(T,[{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(O,I,N,F){var L=this;return!F&&(0,i.default)(N)==="object"&&(F=N,N=null),new Promise(function(D,H){if(!L.ready)return H(new Error("socket not ready"));var z=L.generate_request_id(O,I),K={jsonrpc:"2.0",method:O,params:I||null,id:z};L.socket.send(JSON.stringify(K),F,function(_){if(_)return H(_);L.queue[z]={promise:[D,H]},N&&(L.queue[z].timeout=setTimeout(function(){delete L.queue[z],H(new Error("reply timeout"))},N))})})}},{key:"login",value:function(){var C=(0,r.default)(n.default.mark(function I(N){var F;return n.default.wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return D.next=2,this.call("rpc.login",N);case 2:if(F=D.sent,F){D.next=5;break}throw new Error("authentication failed");case 5:return D.abrupt("return",F);case 6:case"end":return D.stop()}},I,this)}));function O(I){return C.apply(this,arguments)}return O}()},{key:"listMethods",value:function(){var C=(0,r.default)(n.default.mark(function I(){return n.default.wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return F.next=2,this.call("__listMethods");case 2:return F.abrupt("return",F.sent);case 3:case"end":return F.stop()}},I,this)}));function O(){return C.apply(this,arguments)}return O}()},{key:"notify",value:function(O,I){var N=this;return new Promise(function(F,L){if(!N.ready)return L(new Error("socket not ready"));var D={jsonrpc:"2.0",method:O,params:I||null};N.socket.send(JSON.stringify(D),function(H){if(H)return L(H);F()})})}},{key:"subscribe",value:function(){var C=(0,r.default)(n.default.mark(function I(N){var F;return n.default.wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return typeof N=="string"&&(N=[N]),D.next=3,this.call("rpc.on",N);case 3:if(F=D.sent,!(typeof N=="string"&&F[N]!=="ok")){D.next=6;break}throw new Error("Failed subscribing to an event '"+N+"' with: "+F[N]);case 6:return D.abrupt("return",F);case 7:case"end":return D.stop()}},I,this)}));function O(I){return C.apply(this,arguments)}return O}()},{key:"unsubscribe",value:function(){var C=(0,r.default)(n.default.mark(function I(N){var F;return n.default.wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return typeof N=="string"&&(N=[N]),D.next=3,this.call("rpc.off",N);case 3:if(F=D.sent,!(typeof N=="string"&&F[N]!=="ok")){D.next=6;break}throw new Error("Failed unsubscribing from an event with: "+F);case 6:return D.abrupt("return",F);case 7:case"end":return D.stop()}},I,this)}));function O(I){return C.apply(this,arguments)}return O}()},{key:"close",value:function(O,I){this.socket.close(O||1e3,I)}},{key:"_connect",value:function(O,I){var N=this;clearTimeout(this.reconnect_timer_id),this.socket=this.webSocketFactory(O,I),this.socket.addEventListener("open",function(){N.ready=!0,N.emit("open"),N.current_reconnects=0}),this.socket.addEventListener("message",function(F){var L=F.data;L instanceof ArrayBuffer&&(L=ne.Buffer.from(L).toString());try{L=JSON.parse(L)}catch{return}if(L.notification&&N.listeners(L.notification).length){if(!Object.keys(L.params).length)return N.emit(L.notification);var D=[L.notification];if(L.params.constructor===Object)D.push(L.params);else for(var H=0;H<L.params.length;H++)D.push(L.params[H]);return Promise.resolve().then(function(){N.emit.apply(N,D)})}if(!N.queue[L.id])return L.method&&L.params?Promise.resolve().then(function(){N.emit(L.method,L.params)}):void 0;"error"in L=="result"in L&&N.queue[L.id].promise[1](new Error('Server response malformed. Response must include either "result" or "error", but not both.')),N.queue[L.id].timeout&&clearTimeout(N.queue[L.id].timeout),L.error?N.queue[L.id].promise[1](L.error):N.queue[L.id].promise[0](L.result),delete N.queue[L.id]}),this.socket.addEventListener("error",function(F){return N.emit("error",F)}),this.socket.addEventListener("close",function(F){var L=F.code,D=F.reason;N.ready&&setTimeout(function(){return N.emit("close",L,D)},0),N.ready=!1,N.socket=void 0,L!==1e3&&(N.current_reconnects++,N.reconnect&&(N.max_reconnects>N.current_reconnects||N.max_reconnects===0)&&(N.reconnect_timer_id=setTimeout(function(){return N._connect(O,I)},N.reconnect_interval)))})}}]),T}(l.EventEmitter);t.default=y})(JA);const EF=Ui(JA);var o2={};(function(t){var e=e2;
30Object.defineProperty(t,"__esModule",{value:!0}),t.default=h;var n=e(t2),r=e(n2),i=e(r2),s=e(i2),o=e(s2),a=Sy();function c(p){var g=u();return function(){var w=(0,o.default)(p),k;if(g){var T=(0,o.default)(this).constructor;k=Reflect.construct(w,arguments,T)}else k=w.apply(this,arguments);return(0,s.default)(this,k)}}function u(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var l=function(p){(0,i.default)(y,p);var g=c(y);function y(w,k,T){var C;return(0,n.default)(this,y),C=g.call(this),C.socket=new window.WebSocket(w,T),C.socket.onopen=function(){return C.emit("open")},C.socket.onmessage=function(O){return C.emit("message",O.data)},C.socket.onerror=function(O){return C.emit("error",O)},C.socket.onclose=function(O){C.emit("close",O.code,O.reason)},C}return(0,r.default)(y,[{key:"send",value:function(k,T,C){var O=C||T;try{this.socket.send(k),O()}catch(I){O(I)}}},{key:"close",value:function(k,T){this.socket.close(k,T)}},{key:"addEventListener",value:function(k,T,C){this.socket.addEventListener(k,T,C)}}]),y}(a.EventEmitter);function h(p,g){return new l(p,g)}})(o2);const AF=Ui(o2),[a2,c2,u2]=[[],[],[]],xF=BigInt(0),Gc=BigInt(1),RF=BigInt(2),TF=BigInt(7),OF=BigInt(256),IF=BigInt(113);for(let t=0,e=Gc,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],a2.push(2*(5*r+n)),c2.push((t+1)*(t+2)/2%64);let i=xF;for(let s=0;s<7;s++)e=(e<<Gc^(e>>TF)*IF)%OF,e&RF&&(i^=Gc<<(Gc<<BigInt(s))-Gc);u2.push(i)}const[CF,NF]=Fe.split(u2,!0),pw=(t,e,n)=>n>32?Fe.rotlBH(t,e,n):Fe.rotlSH(t,e,n),gw=(t,e,n)=>n>32?Fe.rotlBL(t,e,n):Fe.rotlSL(t,e,n);function PF(t,e=24){const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let o=0;o<10;o++)n[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,u=n[c],l=n[c+1],h=pw(u,l,1)^n[a],p=gw(u,l,1)^n[a+1];for(let g=0;g<50;g+=10)t[o+g]^=h,t[o+g+1]^=p}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=c2[o],c=pw(i,s,a),u=gw(i,s,a),l=a2[o];i=t[l],s=t[l+1],t[l]=c,t[l+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)n[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~n[(a+2)%10]&n[(a+4)%10]}t[0]^=CF[r],t[1]^=NF[r]}n.fill(0)}class Rd extends Ey{constructor(e,n,r,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=n,this.outputLen=r,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Er.number(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=D6(this.state)}keccak(){PF(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Er.exists(this);const{blockLen:n,state:r}=this;e=bl(e);const i=e.length;for(let s=0;s<i;){const o=Math.min(n-this.pos,i-s);for(let a=0;a<o;a++)r[this.pos++]^=e[s++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:n,pos:r,blockLen:i}=this;e[r]^=n,n&128&&r===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){Er.exists(this,!1),Er.bytes(e),this.finish();const n=this.state,{blockLen:r}=this;for(let i=0,s=e.length;i<s;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,s-i);e.set(n.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Er.number(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(Er.output(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:n,suffix:r,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new Rd(n,r,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=r,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const go=(t,e,n)=>_a(()=>new Rd(e,t,n));go(6,144,224/8);go(6,136,256/8);go(6,104,384/8);go(6,72,512/8);go(1,144,224/8);const mw=go(1,136,256/8);go(1,104,384/8);go(1,72,512/8);const l2=(t,e,n)=>F6((r={})=>new Rd(e,t,r.dkLen===void 0?n:r.dkLen,!0));l2(31,168,128/8);l2(31,136,256/8);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function MF(t){const e=Ty(t);Tc(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});
30const{endo:n,Fp:r,a:i}=e;if(n){if(!r.eql(i,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:LF,hexToBytes:BF}=kD,Ko={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){const{Err:e}=Ko;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");const n=t[1],r=t.subarray(2,n+2);if(!n||r.length!==n)throw new e("Invalid signature integer: wrong length");if(r[0]&128)throw new e("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:LF(r),l:t.subarray(n+2)}},toSig(t){const{Err:e}=Ko,n=typeof t=="string"?BF(t):t;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||n[0]!=48)throw new e("Invalid signature tag");if(n[1]!==r-2)throw new e("Invalid signature: incorrect length");const{d:i,l:s}=Ko._parseInt(n.subarray(2)),{d:o,l:a}=Ko._parseInt(s);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(t){const e=u=>Number.parseInt(u[0],16)&8?"00"+u:u,n=u=>{const l=u.toString(16);return l.length&1?`0${l}`:l},r=e(n(t.s)),i=e(n(t.r)),s=r.length/2,o=i.length/2,a=n(s),c=n(o);return`30${n(o+s+4)}02${c}${i}02${a}${r}`}},is=BigInt(0),Lr=BigInt(1);BigInt(2);const yw=BigInt(3);BigInt(4);function DF(t){const e=MF(t),{Fp:n}=e,r=e.toBytes||((y,w,k)=>{const T=w.toAffine();return ca(Uint8Array.from([4]),n.toBytes(T.x),n.toBytes(T.y))}),i=e.fromBytes||(y=>{const w=y.subarray(1),k=n.fromBytes(w.subarray(0,n.BYTES)),T=n.fromBytes(w.subarray(n.BYTES,2*n.BYTES));return{x:k,y:T}});function s(y){const{a:w,b:k}=e,T=n.sqr(y),C=n.mul(T,y);return n.add(n.add(C,n.mul(y,w)),k)}if(!n.eql(n.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function o(y){return typeof y=="bigint"&&is<y&&y<e.n}function a(y){if(!o(y))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function c(y){const{allowedPrivateKeyLengths:w,nByteLength:k,wrapPrivateKey:T,n:C}=e;if(w&&typeof y!="bigint"){if(y instanceof Uint8Array&&(y=aa(y)),typeof y!="string"||!w.includes(y.length))throw new Error("Invalid key");y=y.padStart(k*2,"0")}let O;try{O=typeof y=="bigint"?y:ra(pn("private key",y,k))}catch{throw new Error(`private key must be ${k} bytes, hex or bigint, not ${typeof y}`)}return T&&(O=Bt(O,C)),a(O),O}const u=new Map;function l(y){if(!(y instanceof h))throw new Error("ProjectivePoint expected")}class h{constructor(w,k,T){if(this.px=w,this.py=k,this.pz=T,w==null||!n.isValid(w))throw new Error("x required");if(k==null||!n.isValid(k))throw new Error("y required");if(T==null||!n.isValid(T))throw new Error("z required")}static fromAffine(w){const{x:k,y:T}=w||{};if(!w||!n.isValid(k)||!n.isValid(T))throw new Error("invalid affine point");if(w instanceof h)throw new Error("projective point not allowed");const C=O=>n.eql(O,n.ZERO);return C(k)&&C(T)?h.ZERO:new h(k,T,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(w){const k=n.invertBatch(w.map(T=>T.pz));return w.map((T,C)=>T.toAffine(k[C])).map(h.fromAffine)}static fromHex(w){const k=h.fromAffine(i(pn("pointHex",w)));return k.assertValidity(),k}static fromPrivateKey(w){return h.BASE.multiply(c(w))}_setWindowSize(w){this._WINDOW_SIZE=w,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint)return;throw new Error("bad point: ZERO")}const{x:w,y:k}=this.toAffine();if(!n.isValid(w)||!n.isValid(k))throw new Error("bad point: x or y not FE");const T=n.sqr(k),C=s(w);if(!n.eql(T,C))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:w}=this.toAffine();if(n.isOdd)return!n.isOdd(w);throw new Error("Field doesn't support isOdd")}equals(w){l(w);const{px:k,py:T,pz:C}=this,{px:O,py:I,pz:N}=w,F=n.eql(n.mul(k,N),n.mul(O,C)),L=n.eql(n.mul(T,N),n.mul(I,C));return F&&L}negate(){return new h(this.px,n.neg(this.py),this.pz)}double(){const{a:w,b:k}=e,T=n.mul(k,yw),{px:C,py:O,pz:I}=this;let N=n.ZERO,F=n.ZERO,L=n.ZERO,D=n.mul(C,C),H=n.mul(O,O),z=n.mul(I,I),K=n.mul(C,O);return K=n.add(K,K),L=n.mul(C,I),L=n.add(L,L),N=n.mul(w,L),F=n.mul(T,z),F=n.add(N,F),N=n.sub(H,F),F=n.add(H,F),F=n.mul(N,F),N=n.mul(K,N),L=n.mul(T,L),z=n.mul(w,z),K=n.sub(D,z),K=n.mul(w,K),K=n.add(K,L),L=n.add(D,D),D=n.add(L,D),D=n.add(D,z),D=n.mul(D,K),F=n.add(F,D),z=n.mul(O,I),z=n.add(z,z),D=n.mul(z,K),N=n.sub(N,D),L=n.mul(z,H),L=n.add(L,L),L=n.add(L,L),new h(N,F,L)}add(w){l(w);const{px:k,py:T,pz:C}=this,{px:O,py:I,pz:N}=w;let F=n.ZERO,L=n.ZERO,D=n.ZERO;const H=e.a,z=n.mul(e.b,yw);let K=n.mul(k,O),_=n.mul(T,I),m=n.mul(C,N),f=n.add(k,T),d=n.add(O,I);f=n.mul(f,d),d=n.add(K,_),f=n.sub(f,d),d=n.add(k,C);let v=n.add(O,N);return d=n.mul(d,v),v=n.add(K,m),d=n.sub(d,v),v=n.add(T,C),F=n.add(I,N),v=n.mul(v,F),F=n.add(_,m),v=n.sub(v,F),D=n.mul(H,d),F=n.mul(z,m),D=n.add(F,D),F=n.sub(_,D),D=n.add(_,D),L=n.mul(F,D),_=n.add(K,K),_=n.add(_,K),m=n.mul(H,m),d=n.mul(z,d),_=n.add(_,m),m=n.sub(K,m),m=n.mul(H,m),d=n.add(d,m),K=n.mul(_,d),L=n.add(L,K),K=n.mul(v,d),F=n.mul(f,F),F=n.sub(F,K),K=n.mul(f,_),D=n.mul(v,D),D=n.add(D,K),new h(F,L,D)}subtract(w){return this.add(w.negate())}is0(){return this.equals(h.ZERO)}wNAF(w){return g.wNAFCached(this,u,w,k=>{const T=n.invertBatch(k.map(C=>C.pz));return k.map((C,O)=>C.toAffine(T[O])).map(h.fromAffine)})}multiplyUnsafe(w){const k=h.ZERO;if(w===is)return k;if(a(w),w===Lr)return this;
30const{endo:T}=e;if(!T)return g.unsafeLadder(this,w);let{k1neg:C,k1:O,k2neg:I,k2:N}=T.splitScalar(w),F=k,L=k,D=this;for(;O>is||N>is;)O&Lr&&(F=F.add(D)),N&Lr&&(L=L.add(D)),D=D.double(),O>>=Lr,N>>=Lr;return C&&(F=F.negate()),I&&(L=L.negate()),L=new h(n.mul(L.px,T.beta),L.py,L.pz),F.add(L)}multiply(w){a(w);let k=w,T,C;const{endo:O}=e;if(O){const{k1neg:I,k1:N,k2neg:F,k2:L}=O.splitScalar(k);let{p:D,f:H}=this.wNAF(N),{p:z,f:K}=this.wNAF(L);D=g.constTimeNegate(I,D),z=g.constTimeNegate(F,z),z=new h(n.mul(z.px,O.beta),z.py,z.pz),T=D.add(z),C=H.add(K)}else{const{p:I,f:N}=this.wNAF(k);T=I,C=N}return h.normalizeZ([T,C])[0]}multiplyAndAddUnsafe(w,k,T){const C=h.BASE,O=(N,F)=>F===is||F===Lr||!N.equals(C)?N.multiplyUnsafe(F):N.multiply(F),I=O(this,k).add(O(w,T));return I.is0()?void 0:I}toAffine(w){const{px:k,py:T,pz:C}=this,O=this.is0();w==null&&(w=O?n.ONE:n.inv(C));const I=n.mul(k,w),N=n.mul(T,w),F=n.mul(C,w);if(O)return{x:n.ZERO,y:n.ZERO};if(!n.eql(F,n.ONE))throw new Error("invZ was invalid");return{x:I,y:N}}isTorsionFree(){const{h:w,isTorsionFree:k}=e;if(w===Lr)return!0;if(k)return k(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:w,clearCofactor:k}=e;return w===Lr?this:k?k(h,this):this.multiplyUnsafe(e.h)}toRawBytes(w=!0){return this.assertValidity(),r(h,this,w)}toHex(w=!0){return aa(this.toRawBytes(w))}}h.BASE=new h(e.Gx,e.Gy,n.ONE),h.ZERO=new h(n.ZERO,n.ONE,n.ZERO);const p=e.nBitLength,g=dA(h,e.endo?Math.ceil(p/2):p);return{CURVE:e,ProjectivePoint:h,normPrivateKeyToScalar:c,weierstrassEquation:s,isWithinCurveOrder:o}}function $F(t){const e=Ty(t);return Tc(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function FF(t){const e=$F(t),{Fp:n,n:r}=e,i=n.BYTES+1,s=2*n.BYTES+1;function o(d){return is<d&&d<n.ORDER}function a(d){return Bt(d,r)}function c(d){return A0(d,r)}const{ProjectivePoint:u,normPrivateKeyToScalar:l,weierstrassEquation:h,isWithinCurveOrder:p}=DF({...e,toBytes(d,v,b){const E=v.toAffine(),x=n.toBytes(E.x),M=ca;return b?M(Uint8Array.from([v.hasEvenY()?2:3]),x):M(Uint8Array.from([4]),x,n.toBytes(E.y))},fromBytes(d){const v=d.length,b=d[0],E=d.subarray(1);if(v===i&&(b===2||b===3)){const x=ra(E);if(!o(x))throw new Error("Point is not on curve");const M=h(x);let P=n.sqrt(M);const S=(P&Lr)===Lr;return(b&1)===1!==S&&(P=n.neg(P)),{x,y:P}}else if(v===s&&b===4){const x=n.fromBytes(E.subarray(0,n.BYTES)),M=n.fromBytes(E.subarray(n.BYTES,2*n.BYTES));return{x,y:M}}else throw new Error(`Point of length ${v} was invalid. Expected ${i} compressed bytes or ${s} uncompressed bytes`)}}),g=d=>aa(Qa(d,e.nByteLength));function y(d){const v=r>>Lr;return d>v}function w(d){return y(d)?a(-d):d}const k=(d,v,b)=>ra(d.slice(v,b));class T{constructor(v,b,E){this.r=v,this.s=b,this.recovery=E,this.assertValidity()}static fromCompact(v){const b=e.nByteLength;return v=pn("compactSignature",v,b*2),new T(k(v,0,b),k(v,b,2*b))}static fromDER(v){const{r:b,s:E}=Ko.toSig(pn("DER",v));return new T(b,E)}assertValidity(){if(!p(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!p(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(v){return new T(this.r,this.s,v)}recoverPublicKey(v){const{r:b,s:E,recovery:x}=this,M=L(pn("msgHash",v));if(x==null||![0,1,2,3].includes(x))throw new Error("recovery id invalid");const P=x===2||x===3?b+e.n:b;if(P>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const S=x&1?"03":"02",$=u.fromHex(S+g(P)),ie=c(P),le=a(-M*ie),se=a(E*ie),xe=u.BASE.multiplyAndAddUnsafe($,le,se);if(!xe)throw new Error("point at infinify");return xe.assertValidity(),xe}hasHighS(){return y(this.s)}normalizeS(){return this.hasHighS()?new T(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return hc(this.toDERHex())}toDERHex(){return Ko.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return hc(this.toCompactHex())}toCompactHex(){return g(this.r)+g(this.s)}}const C={isValidPrivateKey(d){try{return l(d),!0}catch{return!1}},normPrivateKeyToScalar:l,randomPrivateKey:()=>{const d=e.randomBytes(n.BYTES+8),v=PD(d,r);return Qa(v,e.nByteLength)},precompute(d=8,v=u.BASE){return v._setWindowSize(d),v.multiply(BigInt(3)),v}};function O(d,v=!0){return u.fromPrivateKey(d).toRawBytes(v)}
30function I(d){const v=d instanceof Uint8Array,b=typeof d=="string",E=(v||b)&&d.length;return v?E===i||E===s:b?E===2*i||E===2*s:d instanceof u}function N(d,v,b=!0){if(I(d))throw new Error("first arg must be private key");if(!I(v))throw new Error("second arg must be public key");return u.fromHex(v).multiply(l(d)).toRawBytes(b)}const F=e.bits2int||function(d){const v=ra(d),b=d.length*8-e.nBitLength;return b>0?v>>BigInt(b):v},L=e.bits2int_modN||function(d){return a(F(d))},D=xy(e.nBitLength);function H(d){if(typeof d!="bigint")throw new Error("bigint expected");if(!(is<=d&&d<D))throw new Error(`bigint expected < 2^${e.nBitLength}`);return Qa(d,e.nByteLength)}function z(d,v,b=K){if(["recovered","canonical"].some(_e=>_e in b))throw new Error("sign() legacy options not supported");const{hash:E,randomBytes:x}=e;let{lowS:M,prehash:P,extraEntropy:S}=b;M==null&&(M=!0),d=pn("msgHash",d),P&&(d=pn("prehashed msgHash",E(d)));const $=L(d),ie=l(v),le=[H(ie),H($)];if(S!=null){const _e=S===!0?x(n.BYTES):S;le.push(pn("extraEntropy",_e,n.BYTES))}const se=ca(...le),xe=$;function Re(_e){const Xe=F(_e);if(!p(Xe))return;const Ie=c(Xe),W=u.BASE.multiply(Xe).toAffine(),q=a(W.x);if(q===is)return;const Y=a(Ie*a(xe+q*ie));if(Y===is)return;let te=(W.x===q?0:2)|Number(W.y&Lr),B=Y;return M&&y(Y)&&(B=w(Y),te^=1),new T(q,B,te)}return{seed:se,k2sig:Re}}const K={lowS:e.lowS,prehash:!1},_={lowS:e.lowS,prehash:!1};function m(d,v,b=K){const{seed:E,k2sig:x}=z(d,v,b),M=e;return fA(M.hash.outputLen,M.nByteLength,M.hmac)(E,x)}u.BASE._setWindowSize(8);function f(d,v,b,E=_){var W;const x=d;if(v=pn("msgHash",v),b=pn("publicKey",b),"strict"in E)throw new Error("options.strict was renamed to lowS");const{lowS:M,prehash:P}=E;let S,$;try{if(typeof x=="string"||x instanceof Uint8Array)try{S=T.fromDER(x)}catch(q){if(!(q instanceof Ko.Err))throw q;S=T.fromCompact(x)}else if(typeof x=="object"&&typeof x.r=="bigint"&&typeof x.s=="bigint"){const{r:q,s:Y}=x;S=new T(q,Y)}else throw new Error("PARSE");$=u.fromHex(b)}catch(q){if(q.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(M&&S.hasHighS())return!1;P&&(v=e.hash(v));const{r:ie,s:le}=S,se=L(v),xe=c(le),Re=a(se*xe),_e=a(ie*xe),Xe=(W=u.BASE.multiplyAndAddUnsafe($,Re,_e))==null?void 0:W.toAffine();return Xe?a(Xe.x)===ie:!1}return{CURVE:e,getPublicKey:O,getSharedSecret:N,sign:m,verify:f,ProjectivePoint:u,Signature:T,utils:C}}class f2 extends Ey{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,Er.hash(e);const r=bl(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,s=new Uint8Array(i);s.set(r.length>i?e.create().update(r).digest():r);for(let o=0;o<s.length;o++)s[o]^=54;this.iHash.update(s),this.oHash=e.create();for(let o=0;o<s.length;o++)s[o]^=106;this.oHash.update(s),s.fill(0)}update(e){return Er.exists(this),this.iHash.update(e),this}digestInto(e){Er.exists(this),Er.bytes(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:i,destroyed:s,blockLen:o,outputLen:a}=this;return e=e,e.finished=i,e.destroyed=s,e.blockLen=o,e.outputLen=a,e.oHash=n._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const h2=(t,e,n)=>new f2(t,e).update(n).digest();h2.create=(t,e)=>new f2(t,e);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function UF(t){return{hash:t,hmac:(e,...n)=>h2(t,e,iA(...n)),randomBytes:sA}}function zF(t,e){const n=r=>FF({...t,...UF(r)});return Object.freeze({...n(e),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const d2=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),vw=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),HF=BigInt(1),I0=BigInt(2),bw=(t,e)=>(t+e/I0)/e;function WF(t){const e=d2,n=BigInt(3),r=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),u=t*t*t%e,l=u*u*t%e,h=zt(l,n,e)*l%e,p=zt(h,n,e)*l%e,g=zt(p,I0,e)*u%e,y=zt(g,i,e)*g%e,w=zt(y,s,e)*y%e,k=zt(w,a,e)*w%e,T=zt(k,c,e)*k%e,C=zt(T,a,e)*w%e,O=zt(C,n,e)*l%e,I=zt(O,o,e)*y%e,N=zt(I,r,e)*u%e,F=zt(N,I0,e);if(!C0.eql(C0.sqr(F),t))throw new Error("Cannot find square root");return F}const C0=hA(d2,void 0,void 0,{sqrt:WF}),Td=zF({a:BigInt(0),b:BigInt(7),Fp:C0,n:vw,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=vw,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-HF*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=n,o=BigInt("0x100000000000000000000000000000000"),a=bw(s*t,e),c=bw(-r*t,e);let u=Bt(t-a*n-c*i,e),l=Bt(-a*r-c*s,e);const h=u>o,p=l>o;
30if(h&&(u=e-u),p&&(l=e-l),u>o||l>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:h,k1:u,k2neg:p,k2:l}}}},qu);BigInt(0);Td.ProjectivePoint;var jF=Oc.utils.randomPrivateKey,ww=function(){var e=Oc.utils.randomPrivateKey(),n=Eh(e),r=new Uint8Array(64);return r.set(e),r.set(n,32),{publicKey:n,secretKey:r}},Eh=Oc.getPublicKey;function _w(t){try{return Oc.ExtendedPoint.fromHex(t),!0}catch{return!1}}var Gy=function(e,n){return Oc.sign(e,n.slice(0,32))},KF=Oc.verify,Ke=function(e){return ne.Buffer.isBuffer(e)?e:e instanceof Uint8Array?ne.Buffer.from(e.buffer,e.byteOffset,e.byteLength):ne.Buffer.from(e)};function VF(t){var e=qF();return function(){var r=$n(t),i;if(e){var s=$n(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return Ic(this,i)}}function qF(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Yy=function(){function t(e){Ue(this,t),Object.assign(this,e)}return ze(t,[{key:"encode",value:function(){return ne.Buffer.from(SA(_u,this))}}],[{key:"decode",value:function(n){return EA(_u,this,n)}},{key:"decodeUnchecked",value:function(n){return vA(_u,this,n)}}]),t}(),GF=function(t){ws(n,t);var e=VF(n);function n(r){var i;if(Ue(this,n),i=e.call(this,r),i.enum="",Object.keys(r).length!==1)throw new Error("Enum can only take single value");return Object.keys(r).map(function(s){i.enum=s}),i}return ze(n)}(Yy),_u=new Map,p2;function Co(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Co=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(_,m,f){_[m]=f.value},i=typeof Symbol=="function"?Symbol:{},s=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function c(_,m,f){return Object.defineProperty(_,m,{value:f,enumerable:!0,configurable:!0,writable:!0}),_[m]}try{c({},"")}catch{c=function(f,d,v){return f[d]=v}}function u(_,m,f,d){var v=m&&m.prototype instanceof p?m:p,b=Object.create(v.prototype),E=new H(d||[]);return r(b,"_invoke",{value:N(_,f,E)}),b}function l(_,m,f){try{return{type:"normal",arg:_.call(m,f)}}catch(d){return{type:"throw",arg:d}}}t.wrap=u;var h={};function p(){}function g(){}function y(){}var w={};c(w,s,function(){return this});var k=Object.getPrototypeOf,T=k&&k(k(z([])));T&&T!==e&&n.call(T,s)&&(w=T);var C=y.prototype=p.prototype=Object.create(w);function O(_){["next","throw","return"].forEach(function(m){c(_,m,function(f){return this._invoke(m,f)})})}function I(_,m){function f(v,b,E,x){var M=l(_[v],_,b);if(M.type!=="throw"){var P=M.arg,S=P.value;return S&&lr(S)=="object"&&n.call(S,"__await")?m.resolve(S.__await).then(function($){f("next",$,E,x)},function($){f("throw",$,E,x)}):m.resolve(S).then(function($){P.value=$,E(P)},function($){return f("throw",$,E,x)})}x(M.arg)}var d;r(this,"_invoke",{value:function(b,E){function x(){return new m(function(M,P){f(b,E,M,P)})}return d=d?d.then(x,x):x()}})}function N(_,m,f){var d="suspendedStart";return function(v,b){if(d==="executing")throw new Error("Generator is already running");if(d==="completed"){if(v==="throw")throw b;return K()}for(f.method=v,f.arg=b;;){var E=f.delegate;if(E){var x=F(E,f);if(x){if(x===h)continue;return x}}if(f.method==="next")f.sent=f._sent=f.arg;else if(f.method==="throw"){if(d==="suspendedStart")throw d="completed",f.arg;f.dispatchException(f.arg)}else f.method==="return"&&f.abrupt("return",f.arg);d="executing";var M=l(_,m,f);if(M.type==="normal"){if(d=f.done?"completed":"suspendedYield",M.arg===h)continue;return{value:M.arg,done:f.done}}M.type==="throw"&&(d="completed",f.method="throw",f.arg=M.arg)}}}function F(_,m){var f=m.method,d=_.iterator[f];if(d===void 0)return m.delegate=null,f==="throw"&&_.iterator.return&&(m.method="return",m.arg=void 0,F(_,m),m.method==="throw")||f!=="return"&&(m.method="throw",m.arg=new TypeError("The iterator does not provide a '"+f+"' method")),h;var v=l(d,_.iterator,m.arg);
30if(v.type==="throw")return m.method="throw",m.arg=v.arg,m.delegate=null,h;var b=v.arg;return b?b.done?(m[_.resultName]=b.value,m.next=_.nextLoc,m.method!=="return"&&(m.method="next",m.arg=void 0),m.delegate=null,h):b:(m.method="throw",m.arg=new TypeError("iterator result is not an object"),m.delegate=null,h)}function L(_){var m={tryLoc:_[0]};1 in _&&(m.catchLoc=_[1]),2 in _&&(m.finallyLoc=_[2],m.afterLoc=_[3]),this.tryEntries.push(m)}function D(_){var m=_.completion||{};m.type="normal",delete m.arg,_.completion=m}function H(_){this.tryEntries=[{tryLoc:"root"}],_.forEach(L,this),this.reset(!0)}function z(_){if(_){var m=_[s];if(m)return m.call(_);if(typeof _.next=="function")return _;if(!isNaN(_.length)){var f=-1,d=function v(){for(;++f<_.length;)if(n.call(_,f))return v.value=_[f],v.done=!1,v;return v.value=void 0,v.done=!0,v};return d.next=d}}return{next:K}}function K(){return{value:void 0,done:!0}}return g.prototype=y,r(C,"constructor",{value:y,configurable:!0}),r(y,"constructor",{value:g,configurable:!0}),g.displayName=c(y,a,"GeneratorFunction"),t.isGeneratorFunction=function(_){var m=typeof _=="function"&&_.constructor;return!!m&&(m===g||(m.displayName||m.name)==="GeneratorFunction")},t.mark=function(_){return Object.setPrototypeOf?Object.setPrototypeOf(_,y):(_.__proto__=y,c(_,a,"GeneratorFunction")),_.prototype=Object.create(C),_},t.awrap=function(_){return{__await:_}},O(I.prototype),c(I.prototype,o,function(){return this}),t.AsyncIterator=I,t.async=function(_,m,f,d,v){v===void 0&&(v=Promise);var b=new I(u(_,m,f,d),v);return t.isGeneratorFunction(m)?b:b.next().then(function(E){return E.done?E.value:b.next()})},O(C),c(C,a,"Generator"),c(C,s,function(){return this}),c(C,"toString",function(){return"[object Generator]"}),t.keys=function(_){var m=Object(_),f=[];for(var d in m)f.push(d);return f.reverse(),function v(){for(;f.length;){var b=f.pop();if(b in m)return v.value=b,v.done=!1,v}return v.done=!0,v}},t.values=z,H.prototype={constructor:H,reset:function(m){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(D),!m)for(var f in this)f.charAt(0)==="t"&&n.call(this,f)&&!isNaN(+f.slice(1))&&(this[f]=void 0)},stop:function(){this.done=!0;var m=this.tryEntries[0].completion;if(m.type==="throw")throw m.arg;return this.rval},dispatchException:function(m){if(this.done)throw m;var f=this;function d(P,S){return E.type="throw",E.arg=m,f.next=P,S&&(f.method="next",f.arg=void 0),!!S}for(var v=this.tryEntries.length-1;v>=0;--v){var b=this.tryEntries[v],E=b.completion;if(b.tryLoc==="root")return d("end");if(b.tryLoc<=this.prev){var x=n.call(b,"catchLoc"),M=n.call(b,"finallyLoc");if(x&&M){if(this.prev<b.catchLoc)return d(b.catchLoc,!0);if(this.prev<b.finallyLoc)return d(b.finallyLoc)}else if(x){if(this.prev<b.catchLoc)return d(b.catchLoc,!0)}else{if(!M)throw new Error("try statement without catch or finally");if(this.prev<b.finallyLoc)return d(b.finallyLoc)}}}},abrupt:function(m,f){for(var d=this.tryEntries.length-1;d>=0;--d){var v=this.tryEntries[d];if(v.tryLoc<=this.prev&&n.call(v,"finallyLoc")&&this.prev<v.finallyLoc){var b=v;break}}b&&(m==="break"||m==="continue")&&b.tryLoc<=f&&f<=b.finallyLoc&&(b=null);var E=b?b.completion:{};return E.type=m,E.arg=f,b?(this.method="next",this.next=b.finallyLoc,h):this.complete(E)},complete:function(m,f){if(m.type==="throw")throw m.arg;return m.type==="break"||m.type==="continue"?this.next=m.arg:m.type==="return"?(this.rval=this.arg=m.arg,this.method="return",this.next="end"):m.type==="normal"&&f&&(this.next=f),h},finish:function(m){for(var f=this.tryEntries.length-1;f>=0;--f){var d=this.tryEntries[f];if(d.finallyLoc===m)return this.complete(d.completion,d.afterLoc),D(d),h}},catch:function(m){for(var f=this.tryEntries.length-1;f>=0;--f){var d=this.tryEntries[f];if(d.tryLoc===m){var v=d.completion;if(v.type==="throw"){var b=v.arg;D(d)}return b}}throw new Error("illegal catch attempt")},delegateYield:function(m,f,d){return this.delegate={iterator:z(m),resultName:f,nextLoc:d},this.method==="next"&&(this.arg=void 0),h}},t}function YF(t){var e=ZF();return function(){var r=$n(t),i;if(e){var s=$n(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return Ic(this,i)}}function ZF(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var g2=32,Rr=32;function XF(t){return t._bn!==void 0}var kw=1;p2=Symbol.toStringTag;var ue=function(t){ws(n,t);var e=YF(n);function n(r){var i;if(Ue(this,n),i=e.call(this,{}),i._bn=void 0,XF(r))i._bn=r._bn;else{if(typeof r=="string"){var s=jt.decode(r);if(s.length!=Rr)throw new Error("Invalid public key input");i._bn=new Ei(s)}else i._bn=new Ei(r);if(i._bn.byteLength()>Rr)throw new Error("Invalid public key input")}return i}return ze(n,[{key:"equals",value:function(i){return this._bn.eq(i._bn)}},{key:"toBase58",value:function(){return jt.encode(this.toBytes())}},{key:"toJSON",value:function(){return this.toBase58()}},{key:"toBytes",value:function(){var i=this.toBuffer();return new Uint8Array(i.buffer,i.byteOffset,i.byteLength)}},{key:"toBuffer",value:function(){var i=this._bn.toArrayLike(ne.Buffer);if(i.length===Rr)return i;var s=ne.Buffer.alloc(32);return i.copy(s,32-i.length),s}},{key:p2,get:function(){return"PublicKey(".concat(this.toString(),")")}},{key:"toString",value:function(){return this.toBase58()}}],[{key:"unique",value:function(){var i=new n(kw);return kw+=1,new n(i.toBuffer())}},{key:"createWithSeed",value:function(){var r=ae(Co().mark(function s(o,a,c){var u,l;return Co().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return u=ne.Buffer.concat([o.toBuffer(),ne.Buffer.from(a),c.toBuffer()]),l=qu(u),p.abrupt("return",new n(l));case 3:case"end":return p.stop()}},s)}));function i(s,o,a){return r.apply(this,arguments)}return i}()},{key:"createProgramAddressSync",value:function(i,s){var o=ne.Buffer.alloc(0);
30i.forEach(function(c){if(c.length>g2)throw new TypeError("Max seed length exceeded");o=ne.Buffer.concat([o,Ke(c)])}),o=ne.Buffer.concat([o,s.toBuffer(),ne.Buffer.from("ProgramDerivedAddress")]);var a=qu(o);if(_w(a))throw new Error("Invalid seeds, address must fall off the curve");return new n(a)}},{key:"createProgramAddress",value:function(){var r=ae(Co().mark(function s(o,a){return Co().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",this.createProgramAddressSync(o,a));case 1:case"end":return u.stop()}},s,this)}));function i(s,o){return r.apply(this,arguments)}return i}()},{key:"findProgramAddressSync",value:function(i,s){for(var o=255,a;o!=0;){try{var c=i.concat(ne.Buffer.from([o]));a=this.createProgramAddressSync(c,s)}catch(u){if(u instanceof TypeError)throw u;o--;continue}return[a,o]}throw new Error("Unable to find a viable program address nonce")}},{key:"findProgramAddress",value:function(){var r=ae(Co().mark(function s(o,a){return Co().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",this.findProgramAddressSync(o,a));case 1:case"end":return u.stop()}},s,this)}));function i(s,o){return r.apply(this,arguments)}return i}()},{key:"isOnCurve",value:function(i){var s=new n(i);return _w(s.toBytes())}}]),n}(Yy);ue.default=new ue("11111111111111111111111111111111");_u.set(ue,{kind:"struct",fields:[["_bn","u256"]]});var JF=function(){function t(e){if(Ue(this,t),this._publicKey=void 0,this._secretKey=void 0,e){var n=Ke(e);if(e.length!==64)throw new Error("bad secret key size");this._publicKey=n.slice(32,64),this._secretKey=n.slice(0,32)}else this._secretKey=Ke(jF()),this._publicKey=Ke(Eh(this._secretKey))}return ze(t,[{key:"publicKey",get:function(){return new ue(this._publicKey)}},{key:"secretKey",get:function(){return ne.Buffer.concat([this._secretKey,this._publicKey],64)}}]),t}(),QF=new ue("BPFLoader1111111111111111111111111111111111"),Zs=1280-40-8,Od=127,la=64;function Zy(t){var e=eU();return function(){var r=$n(t),i;if(e){var s=$n(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return Ic(this,i)}}function eU(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Xy=function(t){ws(n,t);var e=Zy(n);function n(r){var i;return Ue(this,n),i=e.call(this,"Signature ".concat(r," has expired: block height exceeded.")),i.signature=void 0,i.signature=r,i}return ze(n)}(ua(Error));Object.defineProperty(Xy.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});var Jy=function(t){ws(n,t);var e=Zy(n);function n(r,i){var s;return Ue(this,n),s=e.call(this,"Transaction was not confirmed in ".concat(i.toFixed(2)," seconds. It is ")+"unknown if it succeeded or failed. Check signature "+"".concat(r," using the Solana Explorer or CLI tools.")),s.signature=void 0,s.signature=r,s}return ze(n)}(ua(Error));Object.defineProperty(Jy.prototype,"name",{value:"TransactionExpiredTimeoutError"});var Ua=function(t){ws(n,t);var e=Zy(n);function n(r){var i;return Ue(this,n),i=e.call(this,"Signature ".concat(r," has expired: the nonce is no longer valid.")),i.signature=void 0,i.signature=r,i}return ze(n)}(ua(Error));Object.defineProperty(Ua.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});function tU(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=nU(t))||e&&t&&typeof t.length=="number"){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 31In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=!0,o=!1,a;return{s:function(){n=n.call(t)},n:function(){var u=n.next();return s=u.done,u},e:function(u){o=!0,a=u},f:function(){try{!s&&n.return!=null&&n.return()}finally{if(o)throw a}}}}function nU(t,e){if(t){if(typeof t=="string")return Sw(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sw(t,e)}}function Sw(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Yu=function(){function t(e,n){Ue(this,t),this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=e,this.accountKeysFromLookups=n}return ze(t,[{key:"keySegments",value:function(){var n=[this.staticAccountKeys];return this.accountKeysFromLookups&&(n.push(this.accountKeysFromLookups.writable),n.push(this.accountKeysFromLookups.readonly)),n}},{key:"get",value:function(n){var r=tU(this.keySegments()),i;try{for(r.s();!(i=r.n()).done;){var s=i.value;if(n<s.length)return s[n];n-=s.length}}catch(o){r.e(o)}finally{r.f()}}},{key:"length",get:function(){return this.keySegments().flat().length}},{key:"compileInstructions",value:function(n){var r=255;if(this.length>r+1)throw new Error("Account index overflow encountered during compilation");var i=new Map;
31this.keySegments().flat().forEach(function(o,a){i.set(o.toBase58(),a)});var s=function(a){var c=i.get(a.toBase58());if(c===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return c};return n.map(function(o){return{programIdIndex:s(o.programId),accountKeyIndexes:o.keys.map(function(a){return s(a.pubkey)}),data:o.data}})}}]),t}(),Ze=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"publicKey";return kt(32,e)},rU=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"signature";return kt(64,e)},Vo=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"string",n=Ae([Se("length"),Se("lengthPadding"),kt(Gs(Se(),-8),"chars")],e),r=n.decode.bind(n),i=n.encode.bind(n),s=n;return s.decode=function(o,a){var c=r(o,a);return c.chars.toString()},s.encode=function(o,a,c){var u={chars:ne.Buffer.from(o,"utf8")};return i(u,a,c)},s.alloc=function(o){return Se().span+Se().span+ne.Buffer.from(o,"utf8").length},s},iU=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"authorized";return Ae([Ze("staker"),Ze("withdrawer")],e)},sU=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"lockup";return Ae([wr("unixTimestamp"),wr("epoch"),Ze("custodian")],e)},oU=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"voteInit";return Ae([Ze("nodePubkey"),Ze("authorizedVoter"),Ze("authorizedWithdrawer"),Ge("commission")],e)},aU=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"voteAuthorizeWithSeedArgs";return Ae([Se("voteAuthorizationType"),Ze("currentAuthorityDerivedKeyOwnerPubkey"),Vo("currentAuthorityDerivedKeySeed"),Ze("newAuthorized")],e)};function m2(t,e){var n=function i(s){if(s.span>=0)return s.span;if(typeof s.alloc=="function")return s.alloc(e[s.property]);if("count"in s&&"elementLayout"in s){var o=e[s.property];if(Array.isArray(o))return o.length*i(s.elementLayout)}else if("fields"in s)return m2({layout:s},e[s.property]);return 0},r=0;return t.layout.fields.forEach(function(i){r+=n(i)}),r}function ir(t){for(var e=0,n=0;;){var r=t.shift();if(e|=(r&127)<<n*7,n+=1,!(r&128))break}return e}function _r(t,e){for(var n=e;;){var r=n&127;if(n>>=7,n==0){t.push(r);break}else r|=128,t.push(r)}}function at(t,e){if(!t)throw new Error(e||"Assertion failed")}function eg(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=cU(t))||e&&t&&typeof t.length=="number"){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 32In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=!0,o=!1,a;return{s:function(){n=n.call(t)},n:function(){var u=n.next();return s=u.done,u},e:function(u){o=!0,a=u},f:function(){try{!s&&n.return!=null&&n.return()}finally{if(o)throw a}}}}function cU(t,e){if(t){if(typeof t=="string")return Ew(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ew(t,e)}}function Ew(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var y2=function(){function t(e,n){Ue(this,t),this.payer=void 0,this.keyMetaMap=void 0,this.payer=e,this.keyMetaMap=n}return ze(t,[{key:"getMessageComponents",value:function(){var n=Ut(this.keyMetaMap.entries());at(n.length<=256,"Max static account keys length exceeded");var r=n.filter(function(h){var p=Ot(h,2),g=p[1];return g.isSigner&&g.isWritable}),i=n.filter(function(h){var p=Ot(h,2),g=p[1];return g.isSigner&&!g.isWritable}),s=n.filter(function(h){var p=Ot(h,2),g=p[1];return!g.isSigner&&g.isWritable}),o=n.filter(function(h){var p=Ot(h,2),g=p[1];return!g.isSigner&&!g.isWritable}),a={numRequiredSignatures:r.length+i.length,numReadonlySignedAccounts:i.length,numReadonlyUnsignedAccounts:o.length};{at(r.length>0,"Expected at least one writable signer key");var c=Ot(r[0],1),u=c[0];at(u===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}var l=[].concat(Ut(r.map(function(h){var p=Ot(h,1),g=p[0];return new ue(g)})),Ut(i.map(function(h){var p=Ot(h,1),g=p[0];return new ue(g)})),Ut(s.map(function(h){var p=Ot(h,1),g=p[0];return new ue(g)})),Ut(o.map(function(h){var p=Ot(h,1),g=p[0];return new ue(g)})));return[a,l]}},{key:"extractTableLookup",value:function(n){var r=this.drainKeysFoundInLookupTable(n.state.addresses,function(h){return!h.isSigner&&!h.isInvoked&&h.isWritable}),i=Ot(r,2),s=i[0],o=i[1],a=this.drainKeysFoundInLookupTable(n.state.addresses,function(h){return!h.isSigner&&!h.isInvoked&&!h.isWritable}),c=Ot(a,2),u=c[0],l=c[1];if(!(s.length===0&&u.length===0))return[{accountKey:n.key,writableIndexes:s,readonlyIndexes:u},{writable:o,readonly:l}]}},{key:"drainKeysFoundInLookupTable",value:function(n,r){var i=this,s=new Array,o=new Array,a=eg(this.keyMetaMap.entries()),c;try{var u=function(){var h=Ot(c.value,2),p=h[0],g=h[1];if(r(g)){var y=new ue(p),w=n.findIndex(function(k){return k.equals(y)});w>=0&&(at(w<256,"Max lookup table index exceeded"),s.push(w),o.push(y),i.keyMetaMap.delete(p))}};for(a.s();!(c=a.n()).done;)u()}catch(l){a.e(l)}finally{a.f()}return[s,o]}}
32],[{key:"compile",value:function(n,r){var i=new Map,s=function(w){var k=w.toBase58(),T=i.get(k);return T===void 0&&(T={isSigner:!1,isWritable:!1,isInvoked:!1},i.set(k,T)),T},o=s(r);o.isSigner=!0,o.isWritable=!0;var a=eg(n),c;try{for(a.s();!(c=a.n()).done;){var u=c.value;s(u.programId).isInvoked=!0;var l=eg(u.keys),h;try{for(l.s();!(h=l.n()).done;){var p=h.value,g=s(p.pubkey);g.isSigner||(g.isSigner=p.isSigner),g.isWritable||(g.isWritable=p.isWritable)}}catch(y){l.e(y)}finally{l.f()}}}catch(y){a.e(y)}finally{a.f()}return new t(r,i)}}]),t}(),ao=function(){function t(e){var n=this;Ue(this,t),this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=e.header,this.accountKeys=e.accountKeys.map(function(r){return new ue(r)}),this.recentBlockhash=e.recentBlockhash,this.instructions=e.instructions,this.instructions.forEach(function(r){return n.indexToProgramIds.set(r.programIdIndex,n.accountKeys[r.programIdIndex])})}return ze(t,[{key:"version",get:function(){return"legacy"}},{key:"staticAccountKeys",get:function(){return this.accountKeys}},{key:"compiledInstructions",get:function(){return this.instructions.map(function(n){return{programIdIndex:n.programIdIndex,accountKeyIndexes:n.accounts,data:jt.decode(n.data)}})}},{key:"addressTableLookups",get:function(){return[]}},{key:"getAccountKeys",value:function(){return new Yu(this.staticAccountKeys)}},{key:"isAccountSigner",value:function(n){return n<this.header.numRequiredSignatures}},{key:"isAccountWritable",value:function(n){var r=this.header.numRequiredSignatures;if(n>=this.header.numRequiredSignatures){var i=n-r,s=this.accountKeys.length-r,o=s-this.header.numReadonlyUnsignedAccounts;return i<o}else{var a=r-this.header.numReadonlySignedAccounts;return n<a}}},{key:"isProgramId",value:function(n){return this.indexToProgramIds.has(n)}},{key:"programIds",value:function(){return Ut(this.indexToProgramIds.values())}},{key:"nonProgramIds",value:function(){var n=this;return this.accountKeys.filter(function(r,i){return!n.isProgramId(i)})}},{key:"serialize",value:function(){var n=this.accountKeys.length,r=[];_r(r,n);var i=this.instructions.map(function(p){var g=p.accounts,y=p.programIdIndex,w=Array.from(jt.decode(p.data)),k=[];_r(k,g.length);var T=[];return _r(T,w.length),{programIdIndex:y,keyIndicesCount:ne.Buffer.from(k),keyIndices:g,dataLength:ne.Buffer.from(T),data:w}}),s=[];_r(s,i.length);var o=ne.Buffer.alloc(Zs);ne.Buffer.from(s).copy(o);var a=s.length;i.forEach(function(p){var g=Ae([Ge("programIdIndex"),kt(p.keyIndicesCount.length,"keyIndicesCount"),Dn(Ge("keyIndex"),p.keyIndices.length,"keyIndices"),kt(p.dataLength.length,"dataLength"),Dn(Ge("userdatum"),p.data.length,"data")]),y=g.encode(p,o,a);a+=y}),o=o.slice(0,a);var c=Ae([kt(1,"numRequiredSignatures"),kt(1,"numReadonlySignedAccounts"),kt(1,"numReadonlyUnsignedAccounts"),kt(r.length,"keyCount"),Dn(Ze("key"),n,"keys"),Ze("recentBlockhash")]),u={numRequiredSignatures:ne.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:ne.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:ne.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:ne.Buffer.from(r),keys:this.accountKeys.map(function(p){return Ke(p.toBytes())}),recentBlockhash:jt.decode(this.recentBlockhash)},l=ne.Buffer.alloc(2048),h=c.encode(u,l);return o.copy(l,h),l.slice(0,h+o.length)}}],[{key:"compile",value:function(n){var r=y2.compile(n.instructions,n.payerKey),i=r.getMessageComponents(),s=Ot(i,2),o=s[0],a=s[1],c=new Yu(a),u=c.compileInstructions(n.instructions).map(function(l){return{programIdIndex:l.programIdIndex,accounts:l.accountKeyIndexes,data:jt.encode(l.data)}});return new t({header:o,accountKeys:a,recentBlockhash:n.recentBlockhash,instructions:u})}},{key:"from",value:function(n){var r=Ut(n),i=r.shift();if(i!==(i&Od))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");for(var s=r.shift(),o=r.shift(),a=ir(r),c=[],u=0;u<a;u++){var l=r.slice(0,Rr);r=r.slice(Rr),c.push(new ue(ne.Buffer.from(l)))}var h=r.slice(0,Rr);r=r.slice(Rr);for(var p=ir(r),g=[],y=0;y<p;y++){var w=r.shift(),k=ir(r),T=r.slice(0,k);r=r.slice(k);
32var C=ir(r),O=r.slice(0,C),I=jt.encode(ne.Buffer.from(O));r=r.slice(C),g.push({programIdIndex:w,accounts:T,data:I})}var N={header:{numRequiredSignatures:i,numReadonlySignedAccounts:s,numReadonlyUnsignedAccounts:o},recentBlockhash:jt.encode(ne.Buffer.from(h)),accountKeys:c,instructions:g};return new t(N)}}]),t}();function xo(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=uU(t))||e&&t&&typeof t.length=="number"){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 33In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=!0,o=!1,a;return{s:function(){n=n.call(t)},n:function(){var u=n.next();return s=u.done,u},e:function(u){o=!0,a=u},f:function(){try{!s&&n.return!=null&&n.return()}finally{if(o)throw a}}}}function uU(t,e){if(t){if(typeof t=="string")return Aw(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Aw(t,e)}}function Aw(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Id=function(){function t(e){Ue(this,t),this.header=void 0,this.staticAccountKeys=void 0,this.recentBlockhash=void 0,this.compiledInstructions=void 0,this.addressTableLookups=void 0,this.header=e.header,this.staticAccountKeys=e.staticAccountKeys,this.recentBlockhash=e.recentBlockhash,this.compiledInstructions=e.compiledInstructions,this.addressTableLookups=e.addressTableLookups}return ze(t,[{key:"version",get:function(){return 0}},{key:"numAccountKeysFromLookups",get:function(){var n=0,r=xo(this.addressTableLookups),i;try{for(r.s();!(i=r.n()).done;){var s=i.value;n+=s.readonlyIndexes.length+s.writableIndexes.length}}catch(o){r.e(o)}finally{r.f()}return n}},{key:"getAccountKeys",value:function(n){var r;if(n&&"accountKeysFromLookups"in n&&n.accountKeysFromLookups){if(this.numAccountKeysFromLookups!=n.accountKeysFromLookups.writable.length+n.accountKeysFromLookups.readonly.length)throw new Error("Failed to get account keys because of a mismatch in the number of account keys from lookups");r=n.accountKeysFromLookups}else if(n&&"addressLookupTableAccounts"in n&&n.addressLookupTableAccounts)r=this.resolveAddressTableLookups(n.addressLookupTableAccounts);else if(this.addressTableLookups.length>0)throw new Error("Failed to get account keys because address table lookups were not resolved");return new Yu(this.staticAccountKeys,r)}},{key:"isAccountSigner",value:function(n){return n<this.header.numRequiredSignatures}},{key:"isAccountWritable",value:function(n){var r=this.header.numRequiredSignatures,i=this.staticAccountKeys.length;if(n>=i){var s=n-i,o=this.addressTableLookups.reduce(function(h,p){return h+p.writableIndexes.length},0);return s<o}else if(n>=this.header.numRequiredSignatures){var a=n-r,c=i-r,u=c-this.header.numReadonlyUnsignedAccounts;return a<u}else{var l=r-this.header.numReadonlySignedAccounts;return n<l}}},{key:"resolveAddressTableLookups",value:function(n){var r={writable:[],readonly:[]},i=xo(this.addressTableLookups),s;try{var o=function(){var c=s.value,u=n.find(function(k){return k.key.equals(c.accountKey)});if(!u)throw new Error("Failed to find address lookup table account for table key ".concat(c.accountKey.toBase58()));var l=xo(c.writableIndexes),h;try{for(l.s();!(h=l.n()).done;){var p=h.value;if(p<u.state.addresses.length)r.writable.push(u.state.addresses[p
33]);else throw new Error("Failed to find address for index ".concat(p," in address lookup table ").concat(c.accountKey.toBase58()))}}catch(k){l.e(k)}finally{l.f()}var g=xo(c.readonlyIndexes),y;try{for(g.s();!(y=g.n()).done;){var w=y.value;if(w<u.state.addresses.length)r.readonly.push(u.state.addresses[w]);else throw new Error("Failed to find address for index ".concat(w," in address lookup table ").concat(c.accountKey.toBase58()))}}catch(k){g.e(k)}finally{g.f()}};for(i.s();!(s=i.n()).done;)o()}catch(a){i.e(a)}finally{i.f()}return r}},{key:"serialize",value:function(){var n=Array();_r(n,this.staticAccountKeys.length);var r=this.serializeInstructions(),i=Array();_r(i,this.compiledInstructions.length);var s=this.serializeAddressTableLookups(),o=Array();_r(o,this.addressTableLookups.length);var a=Ae([Ge("prefix"),Ae([Ge("numRequiredSignatures"),Ge("numReadonlySignedAccounts"),Ge("numReadonlyUnsignedAccounts")],"header"),kt(n.length,"staticAccountKeysLength"),Dn(Ze(),this.staticAccountKeys.length,"staticAccountKeys"),Ze("recentBlockhash"),kt(i.length,"instructionsLength"),kt(r.length,"serializedInstructions"),kt(o.length,"addressTableLookupsLength"),kt(s.length,"serializedAddressTableLookups")]),c=new Uint8Array(Zs),u=128,l=a.encode({prefix:u,header:this.header,staticAccountKeysLength:new Uint8Array(n),staticAccountKeys:this.staticAccountKeys.map(function(h){return h.toBytes()}),recentBlockhash:jt.decode(this.recentBlockhash),instructionsLength:new Uint8Array(i),serializedInstructions:r,addressTableLookupsLength:new Uint8Array(o),serializedAddressTableLookups:s},c);return c.slice(0,l)}},{key:"serializeInstructions",value:function(){var n=0,r=new Uint8Array(Zs),i=xo(this.compiledInstructions),s;try{for(i.s();!(s=i.n()).done;){var o=s.value,a=Array();_r(a,o.accountKeyIndexes.length);var c=Array();_r(c,o.data.length);var u=Ae([Ge("programIdIndex"),kt(a.length,"encodedAccountKeyIndexesLength"),Dn(Ge(),o.accountKeyIndexes.length,"accountKeyIndexes"),kt(c.length,"encodedDataLength"),kt(o.data.length,"data")]);n+=u.encode({programIdIndex:o.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(a),accountKeyIndexes:o.accountKeyIndexes,encodedDataLength:new Uint8Array(c),data:o.data},r,n)}}catch(l){i.e(l)}finally{i.f()}return r.slice(0,n)}},{key:"serializeAddressTableLookups",value:function(){var n=0,r=new Uint8Array(Zs),i=xo(this.addressTableLookups),s;try{for(i.s();!(s=i.n()).done;){var o=s.value,a=Array();_r(a,o.writableIndexes.length);var c=Array();_r(c,o.readonlyIndexes.length);var u=Ae([Ze("accountKey"),kt(a.length,"encodedWritableIndexesLength"),Dn(Ge(),o.writableIndexes.length,"writableIndexes"),kt(c.length,"encodedReadonlyIndexesLength"),Dn(Ge(),o.readonlyIndexes.length,"readonlyIndexes")]);n+=u.encode({accountKey:o.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(a),writableIndexes:o.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(c),readonlyIndexes:o.readonlyIndexes},r,n)}}catch(l){i.e(l)}finally{i.f()}return r.slice(0,n)}}],[{key:"compile",value:function(n){var r=y2.compile(n.instructions,n.payerKey),i=new Array,s={writable:new Array,readonly:new Array},o=n.addressLookupTableAccounts||[],a=xo(o),c;try{for(a.s();!(c=a.n()).done;){var u=c.value,l=r.extractTableLookup(u);if(l!==void 0){var h,p,g=Ot(l,2),y=g[0],w=g[1],k=w.writable,T=w.readonly;i.push(y),(h=s.writable).push.apply(h,Ut(k)),(p=s.readonly).push.apply(p,Ut(T))}}}catch(D){a.e(D)}finally{a.f()}var C=r.getMessageComponents(),O=Ot(C,2),I=O[0],N=O[1],F=new Yu(N,s),L=F.compileInstructions(n.instructions);return new t({header:I,staticAccountKeys:N,recentBlockhash:n.recentBlockhash,compiledInstructions:L,addressTableLookups:i})}},{key:"deserialize",value:function(n){var r=Ut(n),i=r.shift(),s=i&Od;at(i!==s,"Expected versioned message but received legacy message");var o=s;at(o===0,"Expected versioned message with version 0 but found version ".concat(o));for(var a={numRequiredSignatures:r.shift(),numReadonlySignedAccounts:r.shift(),numReadonlyUnsignedAccounts:r.shift()},c=[],u=ir(r),l=0;l<u;l++)c.push(new ue(r.splice(0,Rr)));for(var h=jt.encode(r.splice(0,Rr)),p=ir(r),g=[],y=0;y<p;y++){var w=r.shift(),k=ir(r),T=r.splice(0,k),C=ir(r),O=new Uint8Array(r.splice(0,C));g.push({programIdIndex:w,accountKeyIndexes:T,data:O})}for(var I=ir(r),N=[],F=0;F<I;F++){var L=new ue(r.splice(0,Rr)),D=ir(r),H=r.splice(0,D),z=ir(r),K=r.splice(0,z);N.push({accountKey:L,writableIndexes:H,readonlyIndexes:K})}
vendor: 5,162 bytes, line 33
33return new t({header:a,staticAccountKeys:c,recentBlockhash:h,compiledInstructions:g,addressTableLookups:N})}}]),t}(),Cd={deserializeMessageVersion:function(e){var n=e[0],r=n&Od;return r===n?"legacy":r},deserialize:function(e){var n=Cd.deserializeMessageVersion(e);if(n==="legacy")return ao.from(e);if(n===0)return Id.deserialize(e);throw new Error("Transaction message version ".concat(n," deserialization is not supported"))}};function N0(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */N0=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(_,m,f){_[m]=f.value},i=typeof Symbol=="function"?Symbol:{},s=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function c(_,m,f){return Object.defineProperty(_,m,{value:f,enumerable:!0,configurable:!0,writable:!0}),_[m]}try{c({},"")}catch{c=function(f,d,v){return f[d]=v}}function u(_,m,f,d){var v=m&&m.prototype instanceof p?m:p,b=Object.create(v.prototype),E=new H(d||[]);return r(b,"_invoke",{value:N(_,f,E)}),b}function l(_,m,f){try{return{type:"normal",arg:_.call(m,f)}}catch(d){return{type:"throw",arg:d}}}t.wrap=u;var h={};function p(){}function g(){}function y(){}var w={};c(w,s,function(){return this});var k=Object.getPrototypeOf,T=k&&k(k(z([])));T&&T!==e&&n.call(T,s)&&(w=T);var C=y.prototype=p.prototype=Object.create(w);function O(_){["next","throw","return"].forEach(function(m){c(_,m,function(f){return this._invoke(m,f)})})}function I(_,m){function f(v,b,E,x){var M=l(_[v],_,b);if(M.type!=="throw"){var P=M.arg,S=P.value;return S&&lr(S)=="object"&&n.call(S,"__await")?m.resolve(S.__await).then(function($){f("next",$,E,x)},function($){f("throw",$,E,x)}):m.resolve(S).then(function($){P.value=$,E(P)},function($){return f("throw",$,E,x)})}x(M.arg)}var d;r(this,"_invoke",{value:function(b,E){function x(){return new m(function(M,P){f(b,E,M,P)})}return d=d?d.then(x,x):x()}})}function N(_,m,f){var d="suspendedStart";return function(v,b){if(d==="executing")throw new Error("Generator is already running");if(d==="completed"){if(v==="throw")throw b;return K()}for(f.method=v,f.arg=b;;){var E=f.delegate;if(E){var x=F(E,f);if(x){if(x===h)continue;return x}}if(f.method==="next")f.sent=f._sent=f.arg;else if(f.method==="throw"){if(d==="suspendedStart")throw d="completed",f.arg;f.dispatchException(f.arg)}else f.method==="return"&&f.abrupt("return",f.arg);d="executing";var M=l(_,m,f);if(M.type==="normal"){if(d=f.done?"completed":"suspendedYield",M.arg===h)continue;return{value:M.arg,done:f.done}}M.type==="throw"&&(d="completed",f.method="throw",f.arg=M.arg)}}}function F(_,m){var f=m.method,d=_.iterator[f];if(d===void 0)return m.delegate=null,f==="throw"&&_.iterator.return&&(m.method="return",m.arg=void 0,F(_,m),m.method==="throw")||f!=="return"&&(m.method="throw",m.arg=new TypeError("The iterator does not provide a '"+f+"' method")),h;var v=l(d,_.iterator,m.arg);if(v.type==="throw")return m.method="throw",m.arg=v.arg,m.delegate=null,h;var b=v.arg;return b?b.done?(m[_.resultName]=b.value,m.next=_.nextLoc,m.method!=="return"&&(m.method="next",m.arg=void 0),m.delegate=null,h):b:(m.method="throw",m.arg=new TypeError("iterator result is not an object"),m.delegate=null,h)}function L(_){var m={tryLoc:_[0]};1 in _&&(m.catchLoc=_[1]),2 in _&&(m.finallyLoc=_[2],m.afterLoc=_[3]),this.tryEntries.push(m)}function D(_){var m=_.completion||{};m.type="normal",delete m.arg,_.completion=m}function H(_){this.tryEntries=[{tryLoc:"root"}],_.forEach(L,this),this.reset(!0)}function z(_){if(_){var m=_[s];if(m)return m.call(_);if(typeof _.next=="function")return _;if(!isNaN(_.length)){var f=-1,d=function v(){for(;++f<_.length;)if(n.call(_,f))return v.value=_[f],v.done=!1,v;return v.value=void 0,v.done=!0,v};return d.next=d}}return{next:K}}function K(){return{value:void 0,done:!0}}return g.prototype=y,r(C,"constructor",{value:y,configurable:!0}),r(y,"constructor",{value:g,configurable:!0}),g.displayName=c(y,a,"GeneratorFunction"),t.isGeneratorFunction=function(_){var m=typeof _=="function"&&_.constructor;return!!m&&(m===g||(m.displayName||m.name)==="GeneratorFunction")},t.mark=function(_){return Object.setPrototypeOf?Object.setPrototypeOf(_,y):(_.__proto__=y,c(_,a,"GeneratorFunction")),_.prototype=Object.create(C),_},t.awrap=function(_){return{__await:_}},O(I.prototype),c(I.prototype,o,function(){return this}),t.AsyncIterator=I,t.async=function(_,m,f,d,v){v===void 0&&(v=Promise);var b=new I(u(_,m,f,d),v);return t.isGeneratorFunction(m)?b:b.next().then(function(E){return E.done?E.value:b.next()})},O(C),c(C,a,"Generator"),c(C,s,function(){return this}),c(C,"toString",function(){return"[object Generator]"}),t.keys=function(_){var m=Object(_),f=[];for(var d in m)f.push(d);return f.reverse(),function v(){for(;f.length;){var b=f.pop();if(b in m)return v.value=b,v.done=!1,v}return v.done=!0,v}},t.values=z,H.prototype={constructor:H,reset:function(m){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.forEac
33h(D),!m)for(var f in this)f.charAt(0)==="t"&&n.call(this,f)&&!isNaN(+f.slice(1))&&(this[f]=void 0)},stop:function(){this.done=!0;var m=this.tryEntries[0].completion;if(m.type==="throw")throw m.arg;return this.rval},dispatchException:function(m){if(this.done)throw m;var f=this;function d(P,S){return E.type="throw",E.arg=m,f.next=P,S&&(f.method="next",f.arg=void 0),!!S}for(var v=this.tryEntries.length-1;v>=0;--v){var b=this.tryEntries[v],E=b.completion;if(b.tryLoc==="root")return d("end");if(b.tryLoc<=this.prev){var x=n.call(b,"catchLoc"),M=n.call(b,"finallyLoc");if(x&&M){if(this.prev<b.catchLoc)return d(b.catchLoc,!0);if(this.prev<b.finallyLoc)return d(b.finallyLoc)}else if(x){if(this.prev<b.catchLoc)return d(b.catchLoc,!0)}else{if(!M)throw new Error("try statement without catch or finally");if(this.prev<b.finallyLoc)return d(b.finallyLoc)}}}},abrupt:function(m,f){for(var d=this.tryEntries.length-1;d>=0;--d){var v=this.tryEntries[d];if(v.tryLoc<=this.prev&&n.call(v,"finallyLoc")&&this.prev<v.finallyLoc){var b=v;break}}b&&(m==="break"||m==="continue")&&b.tryLoc<=f&&f<=b.finallyLoc&&(b=null);var E=b?b.completion:{};return E.type=m,E.arg=f,b?(this.method="next",this.next=b.finallyLoc,h):this.complete(E)},complete:function(m,f){if(m.type==="throw")throw m.arg;return m.type==="break"||m.type==="continue"?this.next=m.arg:m.type==="return"?(this.rval=this.arg=m.arg,this.method="return",this.next="end"):m.type==="normal"&&f&&(this.next=f),h},finish:function(m){for(var f=this.tryEntries.length-1;f>=0;--f){var d=this.tryEntries[f];if(d.finallyLoc===m)return this.complete(d.completion,d.afterLoc),D(d),h}},catch:function(m){for(var f=this.tryEntries.length-1;f>=0;--f){var d=this.tryEntries[f];if(d.tryLoc===m){var v=d.completion;if(v.type==="throw"){var b=v.arg;D(d)}return b}}throw new Error("illegal catch attempt")},delegateYield:function(m,f,d){return this.delegate={iterator:z(m),resultName:f,nextLoc:d},this.method==="next"&&(this.arg=void 0),h}},t}function xw(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=lU(t))||e&&t&&typeof t.length=="number"){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 34In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=!0,o=!1,a;return{s:function(){n=n.call(t)},n:function(){var u=n.next();return s=u.done,u},e:function(u){o=!0,a=u},f:function(){try{!s&&n.return!=null&&n.return()}finally{if(o)throw a}}}}function lU(t,e){if(t){if(typeof t=="string")return Rw(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Rw(t,e)}}function Rw(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Tw(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function fU(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Tw(Object(n),!0).forEach(function(r){jy(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Tw(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var Xi=function(t){return t[t.BLOCKHEIGHT_EXCEEDED=0]="BLOCKHEIGHT_EXCEEDED",t[t.PROCESSED=1]="PROCESSED",t[t.TIMED_OUT=2]="TIMED_OUT",t[t.NONCE_INVALID=3]="NONCE_INVALID",t}({}),hU=ne.Buffer.alloc(la).fill(0),vt=function(){function t(e){Ue(this,t),this.keys=void 0,this.programId=void 0,this.data=ne.Buffer.alloc(0),this.programId=e.programId,this.keys=e.keys,e.data&&(this.data=e.data)}return ze(t,[{key:"toJSON",value:function(){return{keys:this.keys.map(function(n){var r=n.pubkey,i=n.isSigner,s=n.isWritable;return{pubkey:r.toJSON(),isSigner:i,isWritable:s}}),programId:this.programId.toJSON(),data:Ut(this.data)}}}]),t}(),ot=function(){function t(e){if(Ue(this,t),this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this.minNonceContextSlot=void 0,this._message=void 0,this._json=void 0,!!e)if(e.feePayer&&(this.feePayer=e.feePayer),e.signatures&&(this.signatures=e.signatures),Object.prototype.hasOwnProperty.call(e,"nonceInfo")){var n=e,r=n.minContextSlot,i=n.nonceInfo;this.minNonceContextSlot=r,this.nonceInfo=i}else if(Object.prototype.hasOwnProperty.call(e,"lastValidBlockHeight")){var s=e,o=s.blockhash,a=s.lastValidBlockHeight;this.recentBlockhash=o,this.lastValidBlockHeight=a}else{var c=e,u=c.recentBlockhash,l=c.nonceInfo;l&&(this.nonceInfo=l),this.recentBlockhash=u}}return ze(t,[{key:"signature",get:function(){return this.signatures.length>0?this.signatures[0].signature:null}},{key:"toJSON",value:function(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstru
34ction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map(function(n){return n.toJSON()}),signers:this.signatures.map(function(n){var r=n.publicKey;return r.toJSON()})}}},{key:"add",value:function(){for(var n=this,r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];if(i.length===0)throw new Error("No instructions");return i.forEach(function(o){"instructions"in o?n.instructions=n.instructions.concat(o.instructions):"data"in o&&"programId"in o&&"keys"in o?n.instructions.push(o):n.instructions.push(new vt(o))}),this}},{key:"compileMessage",value:function(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;var n,r;if(this.nonceInfo?(n=this.nonceInfo.nonce,this.instructions[0]!=this.nonceInfo.nonceInstruction?r=[this.nonceInfo.nonceInstruction].concat(Ut(this.instructions)):r=this.instructions):(n=this.recentBlockhash,r=this.instructions),!n)throw new Error("Transaction recentBlockhash required");r.length<1&&console.warn("No instructions provided");var i;if(this.feePayer)i=this.feePayer;else if(this.signatures.length>0&&this.signatures[0].publicKey)i=this.signatures[0].publicKey;else throw new Error("Transaction fee payer required");for(var s=0;s<r.length;s++)if(r[s].programId===void 0)throw new Error("Transaction instruction index ".concat(s," has undefined program id"));var o=[],a=[];r.forEach(function(L){L.keys.forEach(function(H){a.push(fU({},H))});var D=L.programId.toString();o.includes(D)||o.push(D)}),o.forEach(function(L){a.push({pubkey:new ue(L),isSigner:!1,isWritable:!1})});var c=[];a.forEach(function(L){var D=L.pubkey.toString(),H=c.findIndex(function(z){return z.pubkey.toString()===D});H>-1?(c[H].isWritable=c[H].isWritable||L.isWritable,c[H].isSigner=c[H].isSigner||L.isSigner):c.push(L)}),c.sort(function(L,D){if(L.isSigner!==D.isSigner)return L.isSigner?-1:1;if(L.isWritable!==D.isWritable)return L.isWritable?-1:1;var H={localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"};return L.pubkey.toBase58().localeCompare(D.pubkey.toBase58(),"en",H)});var u=c.findIndex(function(L){return L.pubkey.equals(i)});if(u>-1){var l=c.splice(u,1),h=Ot(l,1),p=h[0];p.isSigner=!0,p.isWritable=!0,c.unshift(p)}else c.unshift({pubkey:i,isSigner:!0,isWritable:!0});var g=xw(this.signatures),y;try{var w=function(){var D=y.value,H=c.findIndex(function(z){return z.pubkey.equals(D.publicKey)});if(H>-1)c[H].isSigner||(c[H].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."));else throw new Error("unknown signer: ".concat(D.publicKey.toString()))};for(g.s();!(y=g.n()).done;)w()}catch(L){g.e(L)}finally{g.f()}var k=0,T=0,C=0,O=[],I=[];c.forEach(function(L){var D=L.pubkey,H=L.isSigner,z=L.isWritable;H?(O.push(D.toString()),k+=1,z||(T+=1)):(I.push(D.toString()),z||(C+=1))});var N=O.concat(I),F=r.map(function(L){var D=L.data,H=L.programId;return{programIdIndex:N.indexOf(H.toString()),accounts:L.keys.map(function(z){return N.indexOf(z.pubkey.toString())}),data:jt.encode(D)}});return F.forEach(function(L){at(L.programIdIndex>=0),L.accounts.forEach(function(D){return at(D>=0)})}),new ao({header:{numRequiredSignatures:k,numReadonlySignedAccounts:T,numReadonlyUnsignedAccounts:C},accountKeys:N,recentBlockhash:n,instructions:F})}},{key:"_compile",value:function(){var n=this.compileMessage(),r=n.accountKeys.slice(0,n.header.numRequiredSignatures);if(this.signatures.length===r.length){var i=this.signatures.every(function(s,o){return r[o].equals(s.publicKey)});if(i)return n}return this.signatures=r.map(function(s){return{signature:null,publicKey:s}}),n}},{key:"serializeMessage",value:function(){return this._compile().serialize()}},{key:"getEstimatedFee",value:function(){var e=ae(N0().mark(function r(i){return N0().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,i.getFeeForMessage(this.compileMessage());case 2:return o.abrupt("return",o.sent.value);case 3:case"end":return o.stop()}},r,this)}));function n(r){return e.apply(this,arguments)}return n}()},{key:"setSigners",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];if(r.length===0)throw new Error("No signers");var s=new Set;this.signatures=r.filter(function(o){var a=o.toString();return s.has(a)?!1:(s.add(a),!0)}).map(function(o){return{signature:null,publicKey:o}})}},{key:"sign",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];if(r.length===0)throw new Error("No signers");
34for(var s=new Set,o=[],a=0,c=r;a<c.length;a++){var u=c[a],l=u.publicKey.toString();s.has(l)||(s.add(l),o.push(u))}this.signatures=o.map(function(p){return{signature:null,publicKey:p.publicKey}});var h=this._compile();this._partialSign.apply(this,[h].concat(o))}},{key:"partialSign",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];if(r.length===0)throw new Error("No signers");for(var s=new Set,o=[],a=0,c=r;a<c.length;a++){var u=c[a],l=u.publicKey.toString();s.has(l)||(s.add(l),o.push(u))}var h=this._compile();this._partialSign.apply(this,[h].concat(o))}},{key:"_partialSign",value:function(n){for(var r=this,i=n.serialize(),s=arguments.length,o=new Array(s>1?s-1:0),a=1;a<s;a++)o[a-1]=arguments[a];o.forEach(function(c){var u=Gy(i,c.secretKey);r._addSignature(c.publicKey,Ke(u))})}},{key:"addSignature",value:function(n,r){this._compile(),this._addSignature(n,r)}},{key:"_addSignature",value:function(n,r){at(r.length===64);var i=this.signatures.findIndex(function(s){return n.equals(s.publicKey)});if(i<0)throw new Error("unknown signer: ".concat(n.toString()));this.signatures[i].signature=ne.Buffer.from(r)}},{key:"verifySignatures",value:function(n){return this._verifySignatures(this.serializeMessage(),n===void 0?!0:n)}},{key:"_verifySignatures",value:function(n,r){var i=xw(this.signatures),s;try{for(i.s();!(s=i.n()).done;){var o=s.value,a=o.signature,c=o.publicKey;if(a===null){if(r)return!1}else if(!KF(a,n,c.toBytes()))return!1}}catch(u){i.e(u)}finally{i.f()}return!0}},{key:"serialize",value:function(n){var r=Object.assign({requireAllSignatures:!0,verifySignatures:!0},n),i=r.requireAllSignatures,s=r.verifySignatures,o=this.serializeMessage();if(s&&!this._verifySignatures(o,i))throw new Error("Signature verification failed");return this._serialize(o)}},{key:"_serialize",value:function(n){var r=this.signatures,i=[];_r(i,r.length);var s=i.length+r.length*64+n.length,o=ne.Buffer.alloc(s);return at(r.length<256),ne.Buffer.from(i).copy(o,0),r.forEach(function(a,c){var u=a.signature;u!==null&&(at(u.length===64,"signature has invalid length"),ne.Buffer.from(u).copy(o,i.length+c*64))}),n.copy(o,i.length+r.length*64),at(o.length<=Zs,"Transaction too large: ".concat(o.length," > ").concat(Zs)),o}},{key:"keys",get:function(){return at(this.instructions.length===1),this.instructions[0].keys.map(function(n){return n.pubkey})}},{key:"programId",get:function(){return at(this.instructions.length===1),this.instructions[0].programId}},{key:"data",get:function(){return at(this.instructions.length===1),this.instructions[0].data}}],[{key:"from",value:function(n){for(var r=Ut(n),i=ir(r),s=[],o=0;o<i;o++){var a=r.slice(0,la);r=r.slice(la),s.push(jt.encode(ne.Buffer.from(a)))}return t.populate(ao.from(r),s)}},{key:"populate",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=new t;return i.recentBlockhash=n.recentBlockhash,n.header.numRequiredSignatures>0&&(i.feePayer=n.accountKeys[0]),r.forEach(function(s,o){var a={signature:s==jt.encode(hU)?null:jt.decode(s),publicKey:n.accountKeys[o]};i.signatures.push(a)}),n.instructions.forEach(function(s){var o=s.accounts.map(function(a){var c=n.accountKeys[a];return{pubkey:c,isSigner:i.signatures.some(function(u){return u.publicKey.toString()===c.toString()})||n.isAccountSigner(a),isWritable:n.isAccountWritable(a)}});i.instructions.push(new vt({keys:o,programId:n.accountKeys[s.programIdIndex],data:jt.decode(s.data)}))}),i._message=n,i._json=i.toJSON(),i}}]),t}();function Ow(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=dU(t))||e&&t&&typeof t.length=="number"){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 35In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=!0,o=!1,a;return{s:function(){n=n.call(t)},n:function(){var u=n.next();return s=u.done,u},e:function(u){o=!0,a=u},f:function(){try{!s&&n.return!=null&&n.return()}finally{if(o)throw a}}}}function dU(t,e){if(t){if(typeof t=="string")return Iw(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Iw(t,e)}}function Iw(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var pU=function(){function t(e){Ue(this,t),this.payerKey=void 0,this.instructions=void 0,this.recentBlockhash=void 0,this.payerKey=e.payerKey,this.instructions=e.instructions,this.recentBlockhash=e.recentBlockhash}
35return ze(t,[{key:"compileToLegacyMessage",value:function(){return ao.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions})}},{key:"compileToV0Message",value:function(n){return Id.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions,addressLookupTableAccounts:n})}}],[{key:"decompile",value:function(n,r){var i=n.header,s=n.compiledInstructions,o=n.recentBlockhash,a=i.numRequiredSignatures,c=i.numReadonlySignedAccounts,u=i.numReadonlyUnsignedAccounts,l=a-c;at(l>0,"Message header is invalid");var h=n.staticAccountKeys.length-a-u;at(h>=0,"Message header is invalid");var p=n.getAccountKeys(r),g=p.get(0);if(g===void 0)throw new Error("Failed to decompile message because no account keys were found");var y=[],w=Ow(s),k;try{for(w.s();!(k=w.n()).done;){var T=k.value,C=[],O=Ow(T.accountKeyIndexes),I;try{for(O.s();!(I=O.n()).done;){var N=I.value,F=p.get(N);if(F===void 0)throw new Error("Failed to find key for account key index ".concat(N));var L=N<a,D=void 0;L?D=N<l:N<p.staticAccountKeys.length?D=N-a<h:D=N-p.staticAccountKeys.length<p.accountKeysFromLookups.writable.length,C.push({pubkey:F,isSigner:N<i.numRequiredSignatures,isWritable:D})}}catch(z){O.e(z)}finally{O.f()}var H=p.get(T.programIdIndex);if(H===void 0)throw new Error("Failed to find program id for program id index ".concat(T.programIdIndex));y.push(new vt({programId:H,data:Ke(T.data),keys:C}))}}catch(z){w.e(z)}finally{w.f()}return new t({payerKey:g,instructions:y,recentBlockhash:o})}}]),t}();function gU(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=mU(t))||e&&t&&typeof t.length=="number"){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 36In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=!0,o=!1,a;return{s:function(){n=n.call(t)},n:function(){var u=n.next();return s=u.done,u},e:function(u){o=!0,a=u},f:function(){try{!s&&n.return!=null&&n.return()}finally{if(o)throw a}}}}function mU(t,e){if(t){if(typeof t=="string")return Cw(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Cw(t,e)}}function Cw(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Ah=function(){function t(e,n){if(Ue(this,t),this.signatures=void 0,this.message=void 0,n!==void 0)at(n.length===e.header.numRequiredSignatures,"Expected signatures length to be equal to the number of required signatures"),this.signatures=n;else{for(var r=[],i=0;i<e.header.numRequiredSignatures;i++)r.push(new Uint8Array(la));this.signatures=r}this.message=e}return ze(t,[{key:"version",get:function(){return this.message.version}},{key:"serialize",value:function(){var n=this.message.serialize(),r=Array();_r(r,this.signatures.length);var i=Ae([kt(r.length,"encodedSignaturesLength"),Dn(rU(),this.signatures.length,"signatures"),kt(n.length,"serializedMessage")]),s=new Uint8Array(2048),o=i.encode({encodedSignaturesLength:new Uint8Array(r),signatures:this.signatures,serializedMessage:n},s);return s.slice(0,o)}},{key:"sign",value:function(n){var r=this,i=this.message.serialize(),s=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures),o=gU(n),a;try{var c=function(){var l=a.value,h=s.findIndex(function(p){return p.equals(l.publicKey)});at(h>=0,"Cannot sign with non signer key ".concat(l.publicKey.toBase58())),r.signatures[h]=Gy(i,l.secretKey)};for(o.s();!(a=o.n()).done;)c()}catch(u){o.e(u)}finally{o.f()}}},{key:"addSignature",value:function(n,r){at(r.byteLength===64,"Signature must be 64 bytes long");var i=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures),s=i.findIndex(function(o){return o.equals(n)});at(s>=0,"Can not add signature; `".concat(n.toBase58(),"` is not required to sign this transaction")),this.signatures[s]=r}}],[{key:"deserialize",value:function(n){for(var r=Ut(n),i=[],s=ir(r),o=0;o<s;o++)i.push(new Uint8Array(r.splice(0,la)));var a=Cd.deserialize(new Uint8Array(r));return new t(a,i)}}]),t}(),yU=160,vU=64,bU=yU/vU,v2=1e3/bU,_i=new ue("SysvarC1ock11111111111111111111111111111111"),wU=new ue("SysvarEpochSchedu1e111111111111111111111111"),_U=new ue("Sysvar1nstructions1111111111111111111111111"),Ff=new ue("SysvarRecentB1ockHashes11111111111111111111"),pc=new ue("SysvarRent111111111111111111111111111111111"),kU=new ue("SysvarRewards111111111111111111111111111111"),SU=new ue("SysvarS1otHashes111111111111111111111111111"),EU=new ue("SysvarS1otHistory11111111111111111111111111"),Uf=new ue("SysvarStakeHistory1111111111111111111111111");function P0(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */P0=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(_,m,f){_[m]=f.value},i=typeof Symbol=="function"?Symbol:{},s=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function c(_,m,f){return Object.defineProperty(_,m,{value:f,enumerable:!0,configurable:!0,writable:!0}),_[m]}try{c({},"")}catch{c=function(f,d,v){return f[d]=v}}function u(_,m,f,d){var v=m&&m.prototype instanceof p?m:p,b=Object.create(v.prototype),E=new H(d||[]);return r(b,"_invoke",{value:N(_,f,E)}),b}function l(_,m,f){try{return{type:"normal",arg:_.call(m,f)}}catch(d){return{type:"throw",arg:d}}}t.wrap=u;var h={};function p(){}function g(){}function y(){}var w={};c(w,s,function(){return this});var k=Object.getPrototypeOf,T=k&&k(k(z([])));T&&T!==e&&n.call(T,s)&&(w=T);var C=y.prototype=p.prototype=Object.create(w);function O(_){["next","throw","return"].forEach(function(m){c(_,m,function(f){return this._invoke(m,f)})})}function I(_,m){function f(v,b,E,x){var M=l(_[v],_,b);if(M.type!=="throw"){var P=M.arg,S=P.value;return S&&lr(S)=="object"&&n.call(S,"__await")?m.resolve(S.__await).then(function($){f("next",$,E,x)},function($){f("throw",$,E,x)}):m.resolve(S).then(function($){P.value=$,E(P)},function($){return f("throw",$,E,x)})}x(M.arg)}var d;r(this,"_invoke",{value:function(b,E){function x(){return new m(function(M,P){f(b,E,M,P)})}return d=d?d.then(x,x):x()}})}function N(_,m,f){var d="suspendedStart";return function(v,b){if(d==="executing")throw new Error("Generator is already running");if(d==="completed"){if(v==="throw")throw b;return K()}for(f.method=v,f.arg=b;;){var E=f.delegate;if(E){var x=F(E,f);
vendor: 5,402 bytes, line 36
36if(x){if(x===h)continue;return x}}if(f.method==="next")f.sent=f._sent=f.arg;else if(f.method==="throw"){if(d==="suspendedStart")throw d="completed",f.arg;f.dispatchException(f.arg)}else f.method==="return"&&f.abrupt("return",f.arg);d="executing";var M=l(_,m,f);if(M.type==="normal"){if(d=f.done?"completed":"suspendedYield",M.arg===h)continue;return{value:M.arg,done:f.done}}M.type==="throw"&&(d="completed",f.method="throw",f.arg=M.arg)}}}function F(_,m){var f=m.method,d=_.iterator[f];if(d===void 0)return m.delegate=null,f==="throw"&&_.iterator.return&&(m.method="return",m.arg=void 0,F(_,m),m.method==="throw")||f!=="return"&&(m.method="throw",m.arg=new TypeError("The iterator does not provide a '"+f+"' method")),h;var v=l(d,_.iterator,m.arg);if(v.type==="throw")return m.method="throw",m.arg=v.arg,m.delegate=null,h;var b=v.arg;return b?b.done?(m[_.resultName]=b.value,m.next=_.nextLoc,m.method!=="return"&&(m.method="next",m.arg=void 0),m.delegate=null,h):b:(m.method="throw",m.arg=new TypeError("iterator result is not an object"),m.delegate=null,h)}function L(_){var m={tryLoc:_[0]};1 in _&&(m.catchLoc=_[1]),2 in _&&(m.finallyLoc=_[2],m.afterLoc=_[3]),this.tryEntries.push(m)}function D(_){var m=_.completion||{};m.type="normal",delete m.arg,_.completion=m}function H(_){this.tryEntries=[{tryLoc:"root"}],_.forEach(L,this),this.reset(!0)}function z(_){if(_){var m=_[s];if(m)return m.call(_);if(typeof _.next=="function")return _;if(!isNaN(_.length)){var f=-1,d=function v(){for(;++f<_.length;)if(n.call(_,f))return v.value=_[f],v.done=!1,v;return v.value=void 0,v.done=!0,v};return d.next=d}}return{next:K}}function K(){return{value:void 0,done:!0}}return g.prototype=y,r(C,"constructor",{value:y,configurable:!0}),r(y,"constructor",{value:g,configurable:!0}),g.displayName=c(y,a,"GeneratorFunction"),t.isGeneratorFunction=function(_){var m=typeof _=="function"&&_.constructor;return!!m&&(m===g||(m.displayName||m.name)==="GeneratorFunction")},t.mark=function(_){return Object.setPrototypeOf?Object.setPrototypeOf(_,y):(_.__proto__=y,c(_,a,"GeneratorFunction")),_.prototype=Object.create(C),_},t.awrap=function(_){return{__await:_}},O(I.prototype),c(I.prototype,o,function(){return this}),t.AsyncIterator=I,t.async=function(_,m,f,d,v){v===void 0&&(v=Promise);var b=new I(u(_,m,f,d),v);return t.isGeneratorFunction(m)?b:b.next().then(function(E){return E.done?E.value:b.next()})},O(C),c(C,a,"Generator"),c(C,s,function(){return this}),c(C,"toString",function(){return"[object Generator]"}),t.keys=function(_){var m=Object(_),f=[];for(var d in m)f.push(d);return f.reverse(),function v(){for(;f.length;){var b=f.pop();if(b in m)return v.value=b,v.done=!1,v}return v.done=!0,v}},t.values=z,H.prototype={constructor:H,reset:function(m){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(D),!m)for(var f in this)f.charAt(0)==="t"&&n.call(this,f)&&!isNaN(+f.slice(1))&&(this[f]=void 0)},stop:function(){this.done=!0;var m=this.tryEntries[0].completion;if(m.type==="throw")throw m.arg;return this.rval},dispatchException:function(m){if(this.done)throw m;var f=this;function d(P,S){return E.type="throw",E.arg=m,f.next=P,S&&(f.method="next",f.arg=void 0),!!S}for(var v=this.tryEntries.length-1;v>=0;--v){var b=this.tryEntries[v],E=b.completion;if(b.tryLoc==="root")return d("end");if(b.tryLoc<=this.prev){var x=n.call(b,"catchLoc"),M=n.call(b,"finallyLoc");if(x&&M){if(this.prev<b.catchLoc)return d(b.catchLoc,!0);if(this.prev<b.finallyLoc)return d(b.finallyLoc)}else if(x){if(this.prev<b.catchLoc)return d(b.catchLoc,!0)}else{if(!M)throw new Error("try statement without catch or finally");if(this.prev<b.finallyLoc)return d(b.finallyLoc)}}}},abrupt:function(m,f){for(var d=this.tryEntries.length-1;d>=0;--d){var v=this.tryEntries[d];if(v.tryLoc<=this.prev&&n.call(v,"finallyLoc")&&this.prev<v.finallyLoc){var b=v;break}}b&&(m==="break"||m==="continue")&&b.tryLoc<=f&&f<=b.finallyLoc&&(b=null);var E=b?b.completion:{};return E.type=m,E.arg=f,b?(this.method="next",this.next=b.finallyLoc,h):this.complete(E)},complete:function(m,f){if(m.type==="throw")throw m.arg;return m.type==="break"||m.type==="continue"?this.next=m.arg:m.type==="return"?(this.rval=this.arg=m.arg,this.method="return",this.next="end"):m.type==="normal"&&f&&(this.next=f),h},finish:function(m){for(var f=this.tryEntries.length-1;f>=0;--f){var d=this.tryEntries[f];if(d.finallyLoc===m)return this.complete(d.completion,d.afterLoc),D(d),h}},catch:function(m){for(var f=this.tryEntries.length-1;f>=0;--f){var d=this.tryEntries[f];if(d.tryLoc===m){var v=d.completion;if(v.type==="throw"){var b=v.arg;D(d)}return b}}throw new Error("illegal catch attempt")},delegateYield:function(m,f,d){return this.delegate={iterator:z(m),resultName:f,nextLoc:d},this.method==="next"&&(this.arg=void 0),h}},t}function M0(t,e,n,r){return L0.apply(this,arguments)}function L0(){return L0=ae(P0().mark(function t(e,n,r,i){var s,o,a,c,u;return P0().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return s=i&&{skipPreflight:i.skipPreflight,preflightCommitment:i.preflightCommitment||i.commitment,maxRetries:i.maxRetries,minContextSlot:i.minContextSlot},h.next=3,e.sendTransaction(n,r,s);case 3:if(o=h.sent,!(n.recentBlockhash!=null&&n.lastValidBlockHeight!=null)){h.next=10;break}return h.next=7,e.confirmTransaction({abortSignal:i==null?void 0:i.abort
36Signal,signature:o,blockhash:n.recentBlockhash,lastValidBlockHeight:n.lastValidBlockHeight},i&&i.commitment);case 7:a=h.sent.value,h.next=22;break;case 10:if(!(n.minNonceContextSlot!=null&&n.nonceInfo!=null)){h.next=18;break}return c=n.nonceInfo.nonceInstruction,u=c.keys[0].pubkey,h.next=15,e.confirmTransaction({abortSignal:i==null?void 0:i.abortSignal,minContextSlot:n.minNonceContextSlot,nonceAccountPubkey:u,nonceValue:n.nonceInfo.nonce,signature:o},i&&i.commitment);case 15:a=h.sent.value,h.next=22;break;case 18:return(i==null?void 0:i.abortSignal)!=null&&console.warn("sendAndConfirmTransaction(): A transaction with a deprecated confirmation strategy was supplied along with an `abortSignal`. Only transactions having `lastValidBlockHeight` or a combination of `nonceInfo` and `minNonceContextSlot` are abortable."),h.next=21,e.confirmTransaction(o,i&&i.commitment);case 21:a=h.sent.value;case 22:if(!a.err){h.next=24;break}throw new Error("Transaction ".concat(o," failed (").concat(JSON.stringify(a),")"));case 24:return h.abrupt("return",o);case 25:case"end":return h.stop()}},t)})),L0.apply(this,arguments)}function Fo(t){return new Promise(function(e){return setTimeout(e,t)})}function st(t,e){var n=t.layout.span>=0?t.layout.span:m2(t,e),r=ne.Buffer.alloc(n),i=Object.assign({instruction:t.index},e);return t.layout.encode(i,r),r}function dt(t,e){var 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 ".concat(n.instruction," != ").concat(t.index));return n}var b2=In("lamportsPerSignature"),w2=Ae([Se("version"),Se("state"),Ze("authorizedPubkey"),Ze("nonce"),Ae([b2],"feeCalculator")]),Zu=w2.span,_2=function(){function t(e){Ue(this,t),this.authorizedPubkey=void 0,this.nonce=void 0,this.feeCalculator=void 0,this.authorizedPubkey=e.authorizedPubkey,this.nonce=e.nonce,this.feeCalculator=e.feeCalculator}return ze(t,null,[{key:"fromAccountData",value:function(n){var r=w2.decode(Ke(n),0);return new t({authorizedPubkey:new ue(r.authorizedPubkey),nonce:new ue(r.nonce).toString(),feeCalculator:r.feeCalculator})}}]),t}(),AU=function(e){var n=e.decode.bind(e),r=e.encode.bind(e);return{decode:n,encode:r}},xU=function(e){return function(n){var r=kt(e,n),i=AU(r),s=i.encode,o=i.decode,a=r;return a.decode=function(c,u){var l=o(c,u);return WA(ne.Buffer.from(l))},a.encode=function(c,u,l){var h=Wy(c,e);return s(h,u,l)},a}},gc=xU(8),RU=function(){function t(){Ue(this,t)}return ze(t,null,[{key:"decodeInstructionType",value:function(n){this.checkProgramId(n.programId);for(var r=Se("instruction"),i=r.decode(n.data),s,o=0,a=Object.entries(Et);o<a.length;o++){var c=Ot(a[o],2),u=c[0],l=c[1];if(l.index==i){s=u;break}}if(!s)throw new Error("Instruction type incorrect; not a SystemInstruction");return s}},{key:"decodeCreateAccount",value:function(n){this.checkProgramId(n.programId),this.checkKeyLength(n.keys,2);var r=dt(Et.Create,n.data),i=r.lamports,s=r.space,o=r.programId;return{fromPubkey:n.keys[0].pubkey,newAccountPubkey:n.keys[1].pubkey,lamports:i,space:s,programId:new ue(o)}}},{key:"decodeTransfer",value:function(n){this.checkProgramId(n.programId),this.checkKeyLength(n.keys,2);var r=dt(Et.Transfer,n.data),i=r.lamports;return{fromPubkey:n.keys[0].pubkey,toPubkey:n.keys[1].pubkey,lamports:i}}},{key:"decodeTransferWithSeed",value:function(n){this.checkProgramId(n.programId),this.checkKeyLength(n.keys,3);var r=dt(Et.TransferWithSeed,n.data),i=r.lamports,s=r.seed,o=r.programId;return{fromPubkey:n.keys[0].pubkey,basePubkey:n.keys[1].pubkey,toPubkey:n.keys[2].pubkey,lamports:i,seed:s,programId:new ue(o)}}},{key:"decodeAllocate",value:function(n){this.checkProgramId(n.programId),this.checkKeyLength(n.keys,1);var r=dt(Et.Allocate,n.data),i=r.space;return{accountPubkey:n.keys[0].pubkey,space:i}}},{key:"decodeAllocateWithSeed",value:function(n){this.checkProgramId(n.programId),this.checkKeyLength(n.keys,1);var r=dt(Et.AllocateWithSeed,n.data),i=r.base,s=r.seed,o=r.space,a=r.programId;return{accountPubkey:n.keys[0].pubkey,basePubkey:new ue(i),seed:s,space:o,programId:new ue(a)}}},{key:"decodeAssign",value:function(n){this.checkProgramId(n.programId),this.checkKeyLength(n.keys,1);var r=dt(Et.Assign,n.data),i=r.programId;return{accountPubkey:n.keys[0].pubkey,programId:new ue(i)}}},{key:"decodeAssignWithSeed",value:function(n){this.checkProgramId(n.programId),this.checkKeyLength(n.keys,1);var r=dt(Et.AssignWithSeed,n.data),i=r.base,s=r.seed,o=r.programId;return{accountPubkey:n.keys[0].pubkey,basePubkey:new ue(i),seed:s,programId:new ue(o)}}},{key:"decodeCreateWithSeed",value:function(n){this.checkProgramId(n.programId),this.checkKeyLength(n.keys,2);var r=dt(Et.CreateWithSeed,n.data),i=r.base,s=r.seed,o=r.lamports,a=r.space,c=r.programId;return{fromPubkey:n.keys[0].pubkey,newAccountPubkey:n.keys[1].pubkey,basePubkey:new ue(i),seed:s,lamports:o,space:a,programId:new ue(c)}}},{key:"decodeNonceInitialize",value:function(n){this.checkProgramId(n.programId),this.checkKeyLength(n.keys,3);var r=dt(Et.InitializeNonceAccount,n.data),i=r.authorized;return{noncePubkey:n.keys[0].pubkey,authorizedPubkey:new ue(i)}}},{key:"decodeNonceAdvance",value:function(n){return this.checkProgramId(n.programId),this.checkKeyLength(n.keys,3),dt(Et.AdvanceNonceAccount,n.data),{noncePubkey:n.keys[0].pubkey,authorizedPubkey:n.keys[2].pubkey}}},{key:"decodeNonceWithdraw",value:function(n){this.checkProgramId(n.programId),this.checkKeyLength(n.keys,5);var r=dt(Et.WithdrawNonceAccount,n.data),i=r.lamports;return{noncePubkey:n.keys[0].pubkey,toPubkey:n.keys[1].pubkey,authorizedPubkey:n.keys[4].pubkey,lamports:i}}},{key:"decodeNonceAuthorize",value:function(n){this.checkProgramId(n.programId),this.checkKeyLength(n.keys,2);var r=dt(Et.AuthorizeNonceAccount,n.data),i=r.authorized;return{noncePubkey:n.keys[0].pubkey,authorizedPubkey:n.keys[1].pubkey,newAuthorizedPubkey:new ue(i)}}},{key:"checkProgramId",value:function(n){if(!n.equals(Zn.programId))throw new Error("invalid instruction; programId is not SystemProgram")}},{key:"checkKeyLength",value:function(n,r){if(n.length<r)throw new Error("invalid instruction; found ".concat(n.length," keys, expected at least ").concat(r))}}]),t}(),Et=Object.freeze({Create:{index:0,layout:Ae([Se("instruction"),wr("lamports"),wr("space"),Ze("programId")])},Assign:{index:1,layout:Ae([Se("instruction"),Ze("programId")])},Transfer:{index:2,layout:Ae([Se("instruction"),gc("lamports")])},CreateWithSeed:{index:3,layout:Ae([Se("instruction"),Ze("base"),Vo("seed"),wr("lamports"),wr("space"),Ze("programId")])},AdvanceNonceAccount:{index:4,layout:Ae([Se("instruction")])},WithdrawNonceAccount:{index:5,layout:Ae([Se("instruction"),wr("lamports")])},InitializeNonceAccount:{index:6,layout:Ae([Se("instruction"),Ze("authorized")])},AuthorizeNonceAccount:{index:7,layout:Ae([Se("instruction"),Ze("authorized")])},Allocate:{index:8,layout:Ae([Se("instruction"),wr("space")])},AllocateWithSeed:{index:9,layout:Ae([Se("instruction"),Ze("base"),Vo("seed"),wr("space"),Ze("programId")])},AssignWithSeed:{index:10,layout:Ae([Se("instruction"),Ze("base"),Vo("seed"),Ze("programId")])},TransferWithSeed:{index:11,layout:Ae([Se("instruction"),gc("lamports"),Vo("seed"),Ze("programId")])},UpgradeNonceAccount:{index:12,layout:Ae([Se("instruction")])}}),Zn=function(){function t(){Ue(this,t)}return ze(t,null,[{key:"createAccount",value:function(n){var r=Et.Create,i=st(r,{lamports:n.lamports,space:n.space,programId:Ke(n.programId.toBuffer())});return new vt({keys:[{pubkey:n.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:n.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:i})}},{key:"transfer",value:function(n){var r,i;if("basePubkey"in n){var s=Et.TransferWithSeed;r=st(s,{lamports:BigInt(n.lamports),seed:n.seed,programId:Ke(n.programId.toBuffer())}),i=[{pubkey:n.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:n.basePubkey,isSigner:!0,isWritable:!1},{pubkey:n.toPubkey,isSigner:!1,isWritable:!0}]}else{var o=Et.Transfer;r=st(o,{lamports:BigInt(n.lamports)}),i=[{pubkey:n.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:n.toPubkey,isSigner:!1,isWritable:!0}]}return new vt({keys:i,programId:this.programId,data:r})}},{key:"assign",value:function(n){var r,i;if("basePubkey"in n){var s=Et.AssignWithSeed;r=st(s,{base:Ke(n.basePubkey.toBuffer()),seed:n.seed,programId:Ke(n.programId.toBuffer())}),i=[{pubkey:n.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:n.basePubkey,isSigner:!0,isWritable:!1}]}else{var o=Et.Assign;r=st(o,{programId:Ke(n.programId.toBuffer())}),i=[{pubkey:n.accountPubkey,isSigner:!0,isWritable:!0}]}return new vt({keys:i,programId:this.programId,data:r})}},{key:"createAccountWithSeed",value:function(n){var r=Et.CreateWithSeed,i=st(r,{base:Ke(n.basePubkey.toBuffer()),seed:n.seed,lamports:n.lamports,space:n.space,programId:Ke(n.programId.toBuffer())}),s=[{pubkey:n.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:n.newAccountPubkey,isSigner:!1,isWritable:!0}];return n.basePubkey!=n.fromPubkey&&s.push({pubkey:n.basePubkey,isSigner:!0,isWritable:!1}),new vt({keys:s,programId:this.programId,data:i})}},{key:"createNonceAccount",value:function(n){var r=new ot;"basePubkey"in n&&"seed"in n?r.add(t.createAccountWithSeed({fromPubkey:n.fromPubkey,newAccountPubkey:n.noncePubkey,basePubkey:n.basePubkey,seed:n.seed,lamports:n.lamports,space:Zu,programId:this.programId})):r.add(t.createAccount({fromPubkey:n.fromPubkey,newAccountPubkey:n.noncePubkey,lamports:n.lamports,space:Zu,programId:this.programId}));var i={noncePubkey:n.noncePubkey,authorizedPubkey:n.authorizedPubkey};return r.add(this.nonceInitialize(i)),r}},{key:"nonceInitialize",value:function(n){var r=Et.InitializeNonceAccount,i=st(r,{authorized:Ke(n.authorizedPubkey.toBuffer())}),s={keys:[{pubkey:n.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:Ff,isSigner:!1,isWritable:!1},{pubkey:pc,isSigner:!1,isWritable:!1}],programId:this.programId,data:i};return new vt(s)}},{key:"nonceAdvance",value:function(n){var r=Et.AdvanceNonceAccount,i=st(r),s={keys:[{pubkey:n.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:Ff,isSigner:!1,isWritable:!1},{pubkey:n.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:i};return new vt(s)}},{key:"nonceWithdraw",value:function(n){var r=Et.WithdrawNonceAccount,i=st(r,{lamports:n.lamports});return new vt({keys:[{pubkey:n.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:n.toPubkey,isSigner:!1,isWritable:!0},{pubkey:Ff,isSigner:!1,isWritable:!1},{pubkey:pc,isSigner:!1,isWritable:!1},{pubkey:n.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}},{key:"nonceAuthorize",value:function(n){var r=Et.AuthorizeNonceAccount,i=st(r,{authorized:Ke(n.newAuthorizedPubkey.toBuffer())});return new vt({keys:[{pubkey:n.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:n.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}},{key:"allocate",value:function(n){var r,i;if("basePubkey"in n){var s=Et.AllocateWithSeed;r=st(s,{base:Ke(n.basePubkey.toBuffer()),seed:n.seed,space:n.space,programId:Ke(n.programId.toBuffer())}),i=[{pubkey:n.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:n.basePubkey,isSigner:!0,isWritable:!1}]}else{var o=Et.Allocate;r=st(o,{space:n.space}),i=[{pubkey:n.accountPubkey,isSigner:!0,isWritable:!0}]}return new vt({keys:i,programId:this.programId,data:r})}}]),t}();Zn.programId=new ue("11111111111111111111111111111111");function B0(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */B0=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(_,m,f){_[m]=f.value},i=typeof Symbol=="function"?Symbol:{},s=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function c(_,m,f){return Object.defineProperty(_,m,{value:f,enumerable:!0,configurable:!0,writable:!0}),_[m]}try{c({},"")}catch{c=function(f,d,v){return f[d]=v}}function u(_,m,f,d){var v=m&&m.prototype instanceof p?m:p,b=Object.create(v.prototype),E=new H(d||[]);return r(b,"_invoke",{value:N(_,f,E)}),b}function l(_,m,f){try{return{type:"normal",arg:_.call(m,f)}}catch(d){return{type:"throw",arg:d}}}t.wrap=u;var h={};function p(){}function g(){}function y(){}var w={};c(w,s,function(){return this});var k=Object.getPrototypeOf,T=k&&k(k(z([])));T&&T!==e&&n.call(T,s)&&(w=T);var C=y.prototype=p.prototype=Object.create(w);function O(_){["next","throw","return"].forEach(function(m){c(_,m,function(f){return this._invoke(m,f)})})}function I(_,m){function f(v,b,E,x){var M=l(_[v],_,b);if(M.type!=="throw"){var P=M.arg,S=P.value;return S&&lr(S)=="object"&&n.call(S,"__await")?m.resolve(S.__await).then(function($){f("next",$,E,x)},function($){f("throw",$,E,x)}):m.resolve(S).then(function($){P.value=$,E(P)},function($){return f("throw",$,E,x)})}x(M.arg)}var d;r(this,"_invoke",{value:function(b,E){function x(){return new m(function(M,P){f(b,E,M,P)})}return d=d?d.then(x,x):x()}})}function N(_,m,f){var d="suspendedStart";return function(v,b){if(d==="executing")throw new Error("Generator is already running");if(d==="completed"){if(v==="throw")throw b;return K()}for(f.method=v,f.arg=b;;){var E=f.delegate;if(E){var x=F(E,f);
36if(x){if(x===h)continue;return x}}if(f.method==="next")f.sent=f._sent=f.arg;else if(f.method==="throw"){if(d==="suspendedStart")throw d="completed",f.arg;f.dispatchException(f.arg)}else f.method==="return"&&f.abrupt("return",f.arg);d="executing";var M=l(_,m,f);if(M.type==="normal"){if(d=f.done?"completed":"suspendedYield",M.arg===h)continue;return{value:M.arg,done:f.done}}M.type==="throw"&&(d="completed",f.method="throw",f.arg=M.arg)}}}function F(_,m){var f=m.method,d=_.iterator[f];if(d===void 0)return m.delegate=null,f==="throw"&&_.iterator.return&&(m.method="return",m.arg=void 0,F(_,m),m.method==="throw")||f!=="return"&&(m.method="throw",m.arg=new TypeError("The iterator does not provide a '"+f+"' method")),h;var v=l(d,_.iterator,m.arg);if(v.type==="throw")return m.method="throw",m.arg=v.arg,m.delegate=null,h;var b=v.arg;return b?b.done?(m[_.resultName]=b.value,m.next=_.nextLoc,m.method!=="return"&&(m.method="next",m.arg=void 0),m.delegate=null,h):b:(m.method="throw",m.arg=new TypeError("iterator result is not an object"),m.delegate=null,h)}function L(_){var m={tryLoc:_[0]};1 in _&&(m.catchLoc=_[1]),2 in _&&(m.finallyLoc=_[2],m.afterLoc=_[3]),this.tryEntries.push(m)}function D(_){var m=_.completion||{};m.type="normal",delete m.arg,_.completion=m}function H(_){this.tryEntries=[{tryLoc:"root"}],_.forEach(L,this),this.reset(!0)}function z(_){if(_){var m=_[s];if(m)return m.call(_);if(typeof _.next=="function")return _;if(!isNaN(_.length)){var f=-1,d=function v(){for(;++f<_.length;)if(n.call(_,f))return v.value=_[f],v.done=!1,v;return v.value=void 0,v.done=!0,v};return d.next=d}}return{next:K}}function K(){return{value:void 0,done:!0}}return g.prototype=y,r(C,"constructor",{value:y,configurable:!0}),r(y,"constructor",{value:g,configurable:!0}),g.displayName=c(y,a,"GeneratorFunction"),t.isGeneratorFunction=function(_){var m=typeof _=="function"&&_.constructor;return!!m&&(m===g||(m.displayName||m.name)==="GeneratorFunction")},t.mark=function(_){return Object.setPrototypeOf?Object.setPrototypeOf(_,y):(_.__proto__=y,c(_,a,"GeneratorFunction")),_.prototype=Object.create(C),_},t.awrap=function(_){return{__await:_}},O(I.prototype),c(I.prototype,o,function(){return this}),t.AsyncIterator=I,t.async=function(_,m,f,d,v){v===void 0&&(v=Promise);var b=new I(u(_,m,f,d),v);return t.isGeneratorFunction(m)?b:b.next().then(function(E){return E.done?E.value:b.next()})},O(C),c(C,a,"Generator"),c(C,s,function(){return this}),c(C,"toString",function(){return"[object Generator]"}),t.keys=function(_){var m=Object(_),f=[];for(var d in m)f.push(d);return f.reverse(),function v(){for(;f.length;){var b=f.pop();if(b in m)return v.value=b,v.done=!1,v}return v.done=!0,v}},t.values=z,H.prototype={constructor:H,reset:function(m){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(D),!m)for(var f in this)f.charAt(0)==="t"&&n.call(this,f)&&!isNaN(+f.slice(1))&&(this[f]=void 0)},stop:function(){this.done=!0;var m=this.tryEntries[0].completion;if(m.type==="throw")throw m.arg;return this.rval},dispatchException:function(m){if(this.done)throw m;var f=this;function d(P,S){return E.type="throw",E.arg=m,f.next=P,S&&(f.method="next",f.arg=void 0),!!S}for(var v=this.tryEntries.length-1;v>=0;--v){var b=this.tryEntries[v],E=b.completion;if(b.tryLoc==="root")return d("end");if(b.tryLoc<=this.prev){var x=n.call(b,"catchLoc"),M=n.call(b,"finallyLoc");if(x&&M){if(this.prev<b.catchLoc)return d(b.catchLoc,!0);if(this.prev<b.finallyLoc)return d(b.finallyLoc)}else if(x){if(this.prev<b.catchLoc)return d(b.catchLoc,!0)}else{if(!M)throw new Error("try statement without catch or finally");if(this.prev<b.finallyLoc)return d(b.finallyLoc)}}}},abrupt:function(m,f){for(var d=this.tryEntries.length-1;d>=0;--d){var v=this.tryEntries[d];if(v.tryLoc<=this.prev&&n.call(v,"finallyLoc")&&this.prev<v.finallyLoc){var b=v;break}}b&&(m==="break"||m==="continue")&&b.tryLoc<=f&&f<=b.finallyLoc&&(b=null);var E=b?b.completion:{};return E.type=m,E.arg=f,b?(this.method="next",this.next=b.finallyLoc,h):this.complete(E)},complete:function(m,f){if(m.type==="throw")throw m.arg;return m.type==="break"||m.type==="continue"?this.next=m.arg:m.type==="return"?(this.rval=this.arg=m.arg,this.method="return",this.next="end"):m.type==="normal"&&f&&(this.next=f),h},finish:function(m){for(var f=this.tryEntries.length-1;f>=0;--f){var d=this.tryEntries[f];if(d.finallyLoc===m)return this.complete(d.completion,d.afterLoc),D(d),h}},catch:function(m){for(var f=this.tryEntries.length-1;f>=0;--f){var d=this.tryEntries[f];if(d.tryLoc===m){var v=d.completion;if(v.type==="throw"){var b=v.arg;D(d)}return b}}throw new Error("illegal catch attempt")},delegateYield:function(m,f,d){return this.delegate={iterator:z(m),resultName:f,nextLoc:d},this.method==="next"&&(this.arg=void 0),h}},t}var TU=Zs-300,xh=function(){function t(){Ue(this,t)}return ze(t,null,[{key:"getMinNumSignatures",value:function(n){return 2*(Math.ceil(n/t.chunkSize)+1+1)}},{key:"load",value:function(){var e=ae(B0().mark(function r(i,s,o,a,c){var u,l,h,p,g,y,w,k,T,C,O,I,N,F,L,D,H,z,K,_,m;return B0().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,i.getMinimumBalanceForRentExemption(c.length);case 2:return u=d.sent,d.next=5,i.getAccountInfo(o.publicKey,"confirmed");case 5:if(l=d.sent,h=null,l===null){d.next=16;break}if(!l.executable){d.next=11;break}return console.error("Program load failed, account is already executable"),d.abrupt("return",!1);case 11:l.data.length!==c.length&&(h=h||new ot,h.add(Zn.allocate({accountPubkey:o.publicKey,space:c.length}))),l.owner.equals(a)||(h=h||new ot,h.add(Zn.assign({accountPubkey:o.publicKey,programId:a}))),l.lamports<u&&(h=h||new ot,h.add(Zn.transfer({fromPubkey:s.publicKey,toPubkey:o.publicKey,lamports:u-l.lamports}))),d.next=17;break;
36case 16:h=new ot().add(Zn.createAccount({fromPubkey:s.publicKey,newAccountPubkey:o.publicKey,lamports:u>0?u:1,space:c.length,programId:a}));case 17:if(h===null){d.next=20;break}return d.next=20,M0(i,h,[s,o],{commitment:"confirmed"});case 20:p=Ae([Se("instruction"),Se("offset"),Se("bytesLength"),Se("bytesLengthPadding"),Dn(Ge("byte"),Gs(Se(),-8),"bytes")]),g=t.chunkSize,y=0,w=c,k=[];case 25:if(!(w.length>0)){d.next=39;break}if(T=w.slice(0,g),C=ne.Buffer.alloc(g+16),p.encode({instruction:0,offset:y,bytes:T,bytesLength:0,bytesLengthPadding:0},C),O=new ot().add({keys:[{pubkey:o.publicKey,isSigner:!0,isWritable:!0}],programId:a,data:C}),k.push(M0(i,O,[s,o],{commitment:"confirmed"})),!i._rpcEndpoint.includes("solana.com")){d.next=35;break}return I=4,d.next=35,Fo(1e3/I);case 35:y+=g,w=w.slice(g),d.next=25;break;case 39:return d.next=41,Promise.all(k);case 41:return N=Ae([Se("instruction")]),F=ne.Buffer.alloc(N.span),N.encode({instruction:1},F),L=new ot().add({keys:[{pubkey:o.publicKey,isSigner:!0,isWritable:!0},{pubkey:pc,isSigner:!1,isWritable:!1}],programId:a,data:F}),D="processed",d.next=48,i.sendTransaction(L,[s,o],{preflightCommitment:D});case 48:return H=d.sent,d.next=51,i.confirmTransaction({signature:H,lastValidBlockHeight:L.lastValidBlockHeight,blockhash:L.recentBlockhash},D);case 51:if(z=d.sent,K=z.context,_=z.value,!_.err){d.next=56;break}throw new Error("Transaction ".concat(H," failed (").concat(JSON.stringify(_),")"));case 56:return d.prev=57,d.next=60,i.getSlot({commitment:D});case 60:if(m=d.sent,!(m>K.slot)){d.next=63;break}return d.abrupt("break",71);case 63:d.next=67;break;case 65:d.prev=65,d.t0=d.catch(57);case 67:return d.next=69,new Promise(function(v){return setTimeout(v,Math.round(v2/2))});case 69:d.next=56;break;case 71:return d.abrupt("return",!0);case 72:case"end":return d.stop()}},r,null,[[57,65]])}));function n(r,i,s,o,a){return e.apply(this,arguments)}return n}()}]),t}();xh.chunkSize=TU;var OU=new ue("BPFLoader2111111111111111111111111111111111"),IU=function(){function t(){Ue(this,t)}return ze(t,null,[{key:"getMinNumSignatures",value:function(n){return xh.getMinNumSignatures(n)}},{key:"load",value:function(n,r,i,s,o){return xh.load(n,r,i,o,s)}}]),t}();function CU(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var NU=Object.prototype.toString,PU=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};function ou(t,e){var n,r,i,s,o,a,c;if(t===!0)return"true";if(t===!1)return"false";switch(typeof t){case"object":if(t===null)return null;if(t.toJSON&&typeof t.toJSON=="function")return ou(t.toJSON(),e);if(c=NU.call(t),c==="[object Array]"){for(i="[",r=t.length-1,n=0;n<r;n++)i+=ou(t[n],!0)+",";return r>-1&&(i+=ou(t[n],!0)),i+"]"}else if(c==="[object Object]"){for(s=PU(t).sort(),r=s.length,i="",n=0;n<r;)o=s[n],a=ou(t[o],!1),a!==void 0&&(i&&(i+=","),i+=JSON.stringify(o)+":"+a),n++;return"{"+i+"}"}else 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 MU=function(t){var e=ou(t,!1);if(e!==void 0)return""+e},Nw=CU(MU),Yc=32;function tg(t){for(var e=0;t>1;)t/=2,e++;return e}function LU(t){return t===0?1:(t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,t|=t>>32,t+1)}var k2=function(){function t(e,n,r,i,s){Ue(this,t),this.slotsPerEpoch=void 0,this.leaderScheduleSlotOffset=void 0,this.warmup=void 0,this.firstNormalEpoch=void 0,this.firstNormalSlot=void 0,this.slotsPerEpoch=e,this.leaderScheduleSlotOffset=n,this.warmup=r,this.firstNormalEpoch=i,this.firstNormalSlot=s}return ze(t,[{key:"getEpoch",value:function(n){return this.getEpochAndSlotIndex(n)[0]}},{key:"getEpochAndSlotIndex",value:function(n){if(n<this.firstNormalSlot){var r=tg(LU(n+Yc+1))-tg(Yc)-1,i=this.getSlotsInEpoch(r),s=n-(i-Yc);return[r,s]}else{var o=n-this.firstNormalSlot,a=Math.floor(o/this.slotsPerEpoch),c=this.firstNormalEpoch+a,u=o%this.slotsPerEpoch;return[c,u]}}},{key:"getFirstSlotInEpoch",value:function(n){return n<=this.firstNormalEpoch?(Math.pow(2,n)-1)*Yc:(n-this.firstNormalEpoch)*this.slotsPerEpoch+this.firstNormalSlot}},{key:"getLastSlotInEpoch",value:function(n){return this.getFirstSlotInEpoch(n)+this.getSlotsInEpoch(n)-1}},{key:"getSlotsInEpoch",value:function(n){return n<this.firstNormalEpoch?Math.pow(2,n+tg(Yc)):this.slotsPerEpoch}}]),t}();function S2(t){var e=BU();return function(){var r=$n(t),i;if(e){var s=$n(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return Ic(this,i)}}function BU(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var mc=function(t){ws(n,t);var e=S2(n);function n(r,i){var s;return Ue(this,n),s=e.call(this,r),s.logs=void 0,s.logs=i,s}return ze(n)}(ua(Error)),DU={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_ER
36ROR:-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},Te=function(t){ws(n,t);var e=S2(n);function n(r,i){var s,o=r.code,a=r.message,c=r.data;return Ue(this,n),s=e.call(this,i!=null?"".concat(i,": ").concat(a):a),s.code=void 0,s.data=void 0,s.code=o,s.data=c,s.name="SolanaJSONRPCError",s}return ze(n)}(ua(Error)),$U=globalThis.fetch;function Pw(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function FU(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Pw(Object(n),!0).forEach(function(r){jy(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Pw(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function UU(t){var e=zU();return function(){var r=$n(t),i;if(e){var s=$n(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return Ic(this,i)}}function zU(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var HU=function(t){ws(n,t);var e=UU(n);function n(r,i,s){var o;Ue(this,n);var a=function(u){var l=AF(u,FU({autoconnect:!0,max_reconnects:5,reconnect:!0,reconnect_interval:1e3},i));return"socket"in l?o.underlyingSocket=l.socket:o.underlyingSocket=l,l};return o=e.call(this,a,r,i,s),o.underlyingSocket=void 0,o}return ze(n,[{key:"call",value:function(){for(var i,s=(i=this.underlyingSocket)===null||i===void 0?void 0:i.readyState,o=arguments.length,a=new Array(o),c=0;c<o;c++)a[c]=arguments[c];if(s===1){var u;return(u=wu($n(n.prototype),"call",this)).call.apply(u,[this].concat(a))}return Promise.reject(new Error("Tried to call a JSON-RPC method `"+a[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+s+")"))}},{key:"notify",value:function(){for(var i,s=(i=this.underlyingSocket)===null||i===void 0?void 0:i.readyState,o=arguments.length,a=new Array(o),c=0;c<o;c++)a[c]=arguments[c];if(s===1){var u;return(u=wu($n(n.prototype),"notify",this)).call.apply(u,[this].concat(a))}return Promise.reject(new Error("Tried to send a JSON-RPC notification `"+a[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+s+")"))}}]),n}(EF);function WU(t,e){var 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 ".concat(n.typeIndex," != ").concat(t.index));return n}var Mw=56,D0=function(){function t(e){Ue(this,t),this.key=void 0,this.state=void 0,this.key=e.key,this.state=e.state}return ze(t,[{key:"isActive",value:function(){var n=BigInt("0xffffffffffffffff");return this.state.deactivationSlot===n}}],[{key:"deserialize",value:function(n){var r=WU(jU,n),i=n.length-Mw;at(i>=0,"lookup table is invalid"),at(i%32===0,"lookup table is invalid");var s=i/32,o=Ae([Dn(Ze(),s,"addresses")]).decode(n.slice(Mw)),a=o.addresses;return{deactivationSlot:r.deactivationSlot,lastExtendedSlot:r.lastExtendedSlot,lastExtendedSlotStartIndex:r.lastExtendedStartIndex,authority:r.authority.length!==0?new ue(r.authority[0]):void 0,addresses:a.map(function(c){return new ue(c)})}}}]),t}(),jU={index:1,layout:Ae([Se("typeIndex"),gc("deactivationSlot"),In("lastExtendedSlot"),Ge("lastExtendedStartIndex"),Ge(),Dn(Ze(),Gs(Ge(),-1),"authority")])},KU=/^[^:]+:\/\/([^:[]+|\[[^\]]+\])(:\d+)?(.*)/i;function VU(t){var e=t.match(KU);if(e==null)throw TypeError("Failed to validate endpoint URL `".concat(t,"`"));var n=Ot(e,4);n[0];var r=n[1],i=n[2],s=n[3],o=t.startsWith("https:")?"wss:":"ws:",a=i==null?null:parseInt(i.slice(1),10),c=a==null?"":":".concat(a+1);return"".concat(o,"//").concat(r).concat(c).concat(s)}var ng,qU=["commitment"],GU=["encoding"],YU=["commitment"],ZU=["commitment"];function G(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */G=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(_,m,f){_[m]=f.value},i=typeof Symbol=="function"?Symbol:{},s=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function c(_,m,f){return Object.defineProperty(_,m,{value:f,enumerable:!0,configurable:!0,writable:!0}),_[m]}try{c({},"")}catch{c=function(f,d,v){return f[d]=v}}function u(_,m,f,d){var v=m&&m.prototype instanceof p?m:p,b=Object.create(v.prototype),E=new H(d||[]);return r(b,"_invoke",{value:N(_,f,E)}),b}function l(_,m,f){try{return{type:"normal",arg:_.call(m,f)}}catch(d){return{type:"throw",arg:d}}}t.wrap=u;var h={};function p(){}function g(){}function y(){}var w={};c(w,s,function(){return this});var k=Object.getPrototypeOf,T=k&&k(k(z([])));T&&T!==e&&n.call(T,s)&&(w=T);var C=y.prototype=p.prototype=Object.create(w);function O(_){["next","throw","return"].forEach(function(m){c(_,m,function(f){return this._invoke(m,f)})})}function I(_,m){function f(v,b,E,x){var M=l(_[v],_,b);if(M.type!=="throw"){var P=M.arg,S=P.value;return S&&lr(S)=="object"&&n.call(S,"__await")?m.resolve(S.__await).then(function($){f("next",$,E,x)},function($){f("throw",$,E,x)}):m.resolve(S).then(function($){P.value=$,E(P)},function($){return f("throw",$,E,x)})}x(M.arg)}var d;r(this,"_invoke",{value:function(b,E){function x(){return new m(function(M,P){f(b,E,M,P)})}return d=d?d.then(x,x):x()}})}function N(_,m,f){var d="suspendedStart";return function(v,b){if(d==="executing")throw new Error("Generator is already running");if(d==="completed"){if(v==="throw")throw b;return K()}for(f.method=v,f.arg=b;;){var E=f.delegate;if(E){var x=F(E,f);
vendor: 5,171 bytes, line 36
36if(x){if(x===h)continue;return x}}if(f.method==="next")f.sent=f._sent=f.arg;else if(f.method==="throw"){if(d==="suspendedStart")throw d="completed",f.arg;f.dispatchException(f.arg)}else f.method==="return"&&f.abrupt("return",f.arg);d="executing";var M=l(_,m,f);if(M.type==="normal"){if(d=f.done?"completed":"suspendedYield",M.arg===h)continue;return{value:M.arg,done:f.done}}M.type==="throw"&&(d="completed",f.method="throw",f.arg=M.arg)}}}function F(_,m){var f=m.method,d=_.iterator[f];if(d===void 0)return m.delegate=null,f==="throw"&&_.iterator.return&&(m.method="return",m.arg=void 0,F(_,m),m.method==="throw")||f!=="return"&&(m.method="throw",m.arg=new TypeError("The iterator does not provide a '"+f+"' method")),h;var v=l(d,_.iterator,m.arg);if(v.type==="throw")return m.method="throw",m.arg=v.arg,m.delegate=null,h;var b=v.arg;return b?b.done?(m[_.resultName]=b.value,m.next=_.nextLoc,m.method!=="return"&&(m.method="next",m.arg=void 0),m.delegate=null,h):b:(m.method="throw",m.arg=new TypeError("iterator result is not an object"),m.delegate=null,h)}function L(_){var m={tryLoc:_[0]};1 in _&&(m.catchLoc=_[1]),2 in _&&(m.finallyLoc=_[2],m.afterLoc=_[3]),this.tryEntries.push(m)}function D(_){var m=_.completion||{};m.type="normal",delete m.arg,_.completion=m}function H(_){this.tryEntries=[{tryLoc:"root"}],_.forEach(L,this),this.reset(!0)}function z(_){if(_){var m=_[s];if(m)return m.call(_);if(typeof _.next=="function")return _;if(!isNaN(_.length)){var f=-1,d=function v(){for(;++f<_.length;)if(n.call(_,f))return v.value=_[f],v.done=!1,v;return v.value=void 0,v.done=!0,v};return d.next=d}}return{next:K}}function K(){return{value:void 0,done:!0}}return g.prototype=y,r(C,"constructor",{value:y,configurable:!0}),r(y,"constructor",{value:g,configurable:!0}),g.displayName=c(y,a,"GeneratorFunction"),t.isGeneratorFunction=function(_){var m=typeof _=="function"&&_.constructor;return!!m&&(m===g||(m.displayName||m.name)==="GeneratorFunction")},t.mark=function(_){return Object.setPrototypeOf?Object.setPrototypeOf(_,y):(_.__proto__=y,c(_,a,"GeneratorFunction")),_.prototype=Object.create(C),_},t.awrap=function(_){return{__await:_}},O(I.prototype),c(I.prototype,o,function(){return this}),t.AsyncIterator=I,t.async=function(_,m,f,d,v){v===void 0&&(v=Promise);var b=new I(u(_,m,f,d),v);return t.isGeneratorFunction(m)?b:b.next().then(function(E){return E.done?E.value:b.next()})},O(C),c(C,a,"Generator"),c(C,s,function(){return this}),c(C,"toString",function(){return"[object Generator]"}),t.keys=function(_){var m=Object(_),f=[];for(var d in m)f.push(d);return f.reverse(),function v(){for(;f.length;){var b=f.pop();if(b in m)return v.value=b,v.done=!1,v}return v.done=!0,v}},t.values=z,H.prototype={constructor:H,reset:function(m){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(D),!m)for(var f in this)f.charAt(0)==="t"&&n.call(this,f)&&!isNaN(+f.slice(1))&&(this[f]=void 0)},stop:function(){this.done=!0;var m=this.tryEntries[0].completion;if(m.type==="throw")throw m.arg;return this.rval},dispatchException:function(m){if(this.done)throw m;var f=this;function d(P,S){return E.type="throw",E.arg=m,f.next=P,S&&(f.method="next",f.arg=void 0),!!S}for(var v=this.tryEntries.length-1;v>=0;--v){var b=this.tryEntries[v],E=b.completion;if(b.tryLoc==="root")return d("end");if(b.tryLoc<=this.prev){var x=n.call(b,"catchLoc"),M=n.call(b,"finallyLoc");if(x&&M){if(this.prev<b.catchLoc)return d(b.catchLoc,!0);if(this.prev<b.finallyLoc)return d(b.finallyLoc)}else if(x){if(this.prev<b.catchLoc)return d(b.catchLoc,!0)}else{if(!M)throw new Error("try statement without catch or finally");if(this.prev<b.finallyLoc)return d(b.finallyLoc)}}}},abrupt:function(m,f){for(var d=this.tryEntries.length-1;d>=0;--d){var v=this.tryEntries[d];if(v.tryLoc<=this.prev&&n.call(v,"finallyLoc")&&this.prev<v.finallyLoc){var b=v;break}}b&&(m==="break"||m==="continue")&&b.tryLoc<=f&&f<=b.finallyLoc&&(b=null);var E=b?b.completion:{};return E.type=m,E.arg=f,b?(this.method="next",this.next=b.finallyLoc,h):this.complete(E)},complete:function(m,f){if(m.type==="throw")throw m.arg;return m.type==="break"||m.type==="continue"?this.next=m.arg:m.type==="return"?(this.rval=this.arg=m.arg,this.method="return",this.next="end"):m.type==="normal"&&f&&(this.next=f),h},finish:function(m){for(var f=this.tryEntries.length-1;f>=0;--f){var d=this.tryEntries[f];if(d.finallyLoc===m)return this.complete(d.completion,d.afterLoc),D(d),h}},catch:function(m){for(var f=this.tryEntries.length-1;f>=0;--f){var d=this.tryEntries[f];if(d.tryLoc===m){var v=d.completion;if(v.type==="throw"){var b=v.arg;D(d)}return b}}throw new Error("illegal catch attempt")},delegateYield:function(m,f,d){return this.delegate={iterator:z(m),resultName:f,nextLoc:d},this.method==="next"&&(this.arg=void 0),h}},t}function Lw(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Ce(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};
36e%2?Lw(Object(n),!0).forEach(function(r){jy(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Lw(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var bn=Sl(Vy(ue),de(),function(t){return new ue(t)}),E2=qy([de(),Dt("base64")]),Qy=Sl(Vy(ne.Buffer),E2,function(t){return ne.Buffer.from(t[0],"base64")}),A2=30*1e3;function XU(t){if(/^https?:/.test(t)===!1)throw new TypeError("Endpoint URL must start with `http:` or `https:`.");return t}function Mt(t){var e,n;if(typeof t=="string")e=t;else if(t){var r=t.commitment,i=Df(t,qU);e=r,n=i}return{commitment:e,config:n}}function x2(t){return fr([fe({jsonrpc:Dt("2.0"),id:de(),result:t}),fe({jsonrpc:Dt("2.0"),id:de(),error:fe({code:kl(),message:de(),data:Me(U$())})})])}var JU=x2(kl());function je(t){return Sl(x2(t),JU,function(e){return"error"in e?e:Ce(Ce({},e),{},{result:pe(e.result,t)})})}function Ht(t){return je(fe({context:fe({slot:Z()}),value:t}))}function Nd(t){return fe({context:fe({slot:Z()}),value:t})}function rg(t,e){return t===0?new Id({header:e.header,staticAccountKeys:e.accountKeys.map(function(n){return new ue(n)}),recentBlockhash:e.recentBlockhash,compiledInstructions:e.instructions.map(function(n){return{programIdIndex:n.programIdIndex,accountKeyIndexes:n.accounts,data:jt.decode(n.data)}}),addressTableLookups:e.addressTableLookups}):new ao(e)}
36var QU=fe({foundation:Z(),foundationTerm:Z(),initial:Z(),taper:Z(),terminal:Z()}),ez=je(be(we(fe({epoch:Z(),effectiveSlot:Z(),amount:Z(),postBalance:Z(),commission:Me(we(Z()))})))),tz=be(fe({slot:Z(),prioritizationFee:Z()})),nz=fe({total:Z(),validator:Z(),foundation:Z(),epoch:Z()}),rz=fe({epoch:Z(),slotIndex:Z(),slotsInEpoch:Z(),absoluteSlot:Z(),blockHeight:Me(Z()),transactionCount:Me(Z())}),iz=fe({slotsPerEpoch:Z(),leaderScheduleSlotOffset:Z(),warmup:Di(),firstNormalEpoch:Z(),firstNormalSlot:Z()}),sz=VA(de(),be(Z())),Ea=we(fr([fe({}),de()])),oz=fe({err:Ea}),az=Dt("receivedSignature"),cz=fe({"solana-core":de(),"feature-set":Me(Z())}),Bw=Ht(fe({err:we(fr([fe({}),de()])),logs:we(be(de())),accounts:Me(we(be(we(fe({executable:Di(),owner:de(),lamports:Z(),data:be(de()),rentEpoch:Me(Z())}))))),unitsConsumed:Me(Z()),returnData:Me(we(fe({programId:de(),data:qy([de(),Dt("base64")])})))})),uz=Ht(fe({byIdentity:VA(de(),be(Z())),range:fe({firstSlot:Z(),lastSlot:Z()})}));function lz(t,e,n,r,i,s){var o=n||$U,a;s!=null&&console.warn("You have supplied an `httpAgent` when creating a `Connection` in a browser environment.It has been ignored; `httpAgent` is only used in Node environments.");var c;r&&(c=function(){var l=ae(G().mark(function h(p,g){var y;return G().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return k.next=2,new Promise(function(T,C){try{r(p,g,function(O,I){return T([O,I])})}catch(O){C(O)}});case 2:return y=k.sent,k.next=5,o.apply(void 0,Ut(y));case 5:return k.abrupt("return",k.sent);case 6:case"end":return k.stop()}},h)}));return function(p,g){return l.apply(this,arguments)}}());var u=new gF(function(){var l=ae(G().mark(function h(p,g){var y,w,k,T,C;return G().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:y={method:"POST",body:p,agent:a,headers:Object.assign({"Content-Type":"application/json"},e||{},fH)},I.prev=1,w=5,T=500;case 4:if(!c){I.next=10;break}return I.next=7,c(t,y);case 7:k=I.sent,I.next=13;break;case 10:return I.next=12,o(t,y);case 12:k=I.sent;case 13:if(k.status===429){I.next=15;break}return I.abrupt("break",26);case 15:if(i!==!0){I.next=17;break}return I.abrupt("break",26);case 17:if(w-=1,w!==0){I.next=20;break}return I.abrupt("break",26);case 20:return console.log("Server responded with ".concat(k.status," ").concat(k.statusText,". Retrying after ").concat(T,"ms delay...")),I.next=23,Fo(T);case 23:T*=2;case 24:I.next=4;break;case 26:return I.next=28,k.text();case 28:C=I.sent,k.ok?g(null,C):g(new Error("".concat(k.status," ").concat(k.statusText,": ").concat(C))),I.next=35;break;case 32:I.prev=32,I.t0=I.catch(1),I.t0 instanceof Error&&g(I.t0);case 35:case"end":return I.stop()}},h,null,[[1,32]])}));return function(h,p){return l.apply(this,arguments)}}(),{});return u}function fz(t){return function(e,n){return new Promise(function(r,i){t.request(e,n,function(s,o){if(s){i(s);return}r(o)})})}}function hz(t){return function(e){return new Promise(function(n,r){e.length===0&&n([]);var i=e.map(function(s){return t.request(s.methodName,s.args)});t.request(i,function(s,o){if(s){r(s);return}n(o)})})}}var dz=je(QU),pz=je(nz),gz=je(tz),mz=je(rz),yz=je(iz),vz=je(sz),bz=je(Z()),wz=Ht(fe({total:Z(),circulating:Z(),nonCirculating:Z(),nonCirculatingAccounts:be(bn)})),$0=fe({amount:de(),uiAmount:we(Z()),decimals:Z(),uiAmountString:Me(de())}),_z=Ht(be(fe({address:bn,amount:de(),uiAmount:we(Z()),decimals:Z(),uiAmountString:Me(de())}))),kz=Ht(be(fe({pubkey:bn,account:fe({executable:Di(),owner:bn,lamports:Z(),data:Qy,rentEpoch:Z()})}))),F0=fe({program:de(),parsed:kl(),space:Z()}),Sz=Ht(be(fe({pubkey:bn,account:fe({executable:Di(),owner:bn,lamports:Z(),data:F0,rentEpoch:Z()})}))),Ez=Ht(be(fe({lamports:Z(),address:bn}))),Xu=fe({executable:Di(),owner:bn,lamports:Z(),data:Qy,rentEpoch:Z()}),Az=fe({pubkey:bn,account:Xu}),xz=Sl(fr([Vy(ne.Buffer),F0]),fr([E2,F0]),function(t){return Array.isArray(t)?pe(t,Qy):t}),U0=fe({executable:Di(),owner:bn,lamports:Z(),data:xz,rentEpoch:Z()}),Rz=fe({pubkey:bn,account:U0}),Tz=fe({state:fr([Dt("active"),Dt("inactive"),Dt("activating"),Dt("deactivating")]),active:Z(),inactive:Z()}),Oz=je(be(fe({signature:de(),slot:Z(),err:Ea,memo:we(de()),blockTime:Me(we(Z()))}))),Iz=je(be(fe({signature:de(),slot:Z(),err:Ea,memo:we(de()),blockTime:Me(we(Z()))}))),Cz=fe({subscription:Z(),result:Nd(Xu)}),Nz=fe({pubkey:bn,account:Xu}),Pz=fe({subscription:Z(),result:Nd(Nz)}),Mz=fe({parent:Z(),slot:Z(),root:Z()}),Lz=fe({subscription:Z(),result:Mz}),Bz=fr([fe({type:fr([Dt("firstShredReceived"),Dt("completed"),Dt("optimisticConfirmation"),Dt("root")]),slot:Z(),timestamp:Z()}),fe({type:Dt("createdBank"),parent:Z(),slot:Z(),timestamp:Z()}),fe({type:Dt("frozen"),slot:Z(),timestamp:Z(),stats:fe({numTransactionEntries:Z(),numSuccessfulTransactions:Z(),numFailedTransactions:Z(),maxTransactionsPerEntry:Z()})}),fe({type:Dt("dead"),slot:Z(),timestamp:Z(),err:de()})]),Dz=fe({subscription:Z(),result:Bz}),$z=fe({subscription:Z(),result:Nd(fr([oz,az]))}),Fz=fe({subscription:Z(),result:Z()}),Uz=fe({pubkey:de(),gossip:we(de()),tpu:we(de()),rpc:we(de()),version:we(de())}),Dw=fe({votePubkey:de(),nodePubkey:de(),activatedStake:Z(),epochVoteAccount:Di(),epochCredits:be(qy([Z(),Z(),Z()])
36),commission:Z(),lastVote:Z(),rootSlot:we(Z())}),zz=je(fe({current:be(Dw),delinquent:be(Dw)})),Hz=fr([Dt("processed"),Dt("confirmed"),Dt("finalized")]),Wz=fe({slot:Z(),confirmations:we(Z()),err:Ea,confirmationStatus:Me(Hz)}),jz=Ht(be(we(Wz))),Kz=je(Z()),R2=fe({accountKey:bn,writableIndexes:be(Z()),readonlyIndexes:be(Z())}),e1=fe({signatures:be(de()),message:fe({accountKeys:be(de()),header:fe({numRequiredSignatures:Z(),numReadonlySignedAccounts:Z(),numReadonlyUnsignedAccounts:Z()}),instructions:be(fe({accounts:be(Z()),data:de(),programIdIndex:Z()})),recentBlockhash:de(),addressTableLookups:Me(be(R2))})}),T2=fe({pubkey:bn,signer:Di(),writable:Di(),source:Me(fr([Dt("transaction"),Dt("lookupTable")]))}),O2=fe({accountKeys:be(T2),signatures:be(de())}),I2=fe({parsed:kl(),program:de(),programId:bn}),C2=fe({accounts:be(bn),data:de(),programId:bn}),Vz=fr([C2,I2]),qz=fr([fe({parsed:kl(),program:de(),programId:de()}),fe({accounts:be(de()),data:de(),programId:de()})]),N2=Sl(Vz,qz,function(t){return"accounts"in t?pe(t,C2):pe(t,I2)}),P2=fe({signatures:be(de()),message:fe({accountKeys:be(T2),instructions:be(N2),recentBlockhash:de(),addressTableLookups:Me(we(be(R2)))})}),Rh=fe({accountIndex:Z(),mint:de(),owner:Me(de()),uiTokenAmount:$0}),M2=fe({writable:be(bn),readonly:be(bn)}),Pd=fe({err:Ea,fee:Z(),innerInstructions:Me(we(be(fe({index:Z(),instructions:be(fe({accounts:be(Z()),data:de(),programIdIndex:Z()}))})))),preBalances:be(Z()),postBalances:be(Z()),logMessages:Me(we(be(de()))),preTokenBalances:Me(we(be(Rh))),postTokenBalances:Me(we(be(Rh))),loadedAddresses:Me(M2),computeUnitsConsumed:Me(Z())}),t1=fe({err:Ea,fee:Z(),innerInstructions:Me(we(be(fe({index:Z(),instructions:be(N2)})))),preBalances:be(Z()),postBalances:be(Z()),logMessages:Me(we(be(de()))),preTokenBalances:Me(we(be(Rh))),postTokenBalances:Me(we(be(Rh))),loadedAddresses:Me(M2),computeUnitsConsumed:Me(Z())}),Pc=fr([Dt(0),Dt("legacy")]),Aa=fe({pubkey:de(),lamports:Z(),postBalance:we(Z()),rewardType:we(de()),commission:Me(we(Z()))}),Gz=je(we(fe({blockhash:de(),previousBlockhash:de(),parentSlot:Z(),transactions:be(fe({transaction:e1,meta:we(Pd),version:Me(Pc)})),rewards:Me(be(Aa)),blockTime:we(Z()),blockHeight:we(Z())}))),Yz=je(we(fe({blockhash:de(),previousBlockhash:de(),parentSlot:Z(),rewards:Me(be(Aa)),blockTime:we(Z()),blockHeight:we(Z())}))),Zz=je(we(fe({blockhash:de(),previousBlockhash:de(),parentSlot:Z(),transactions:be(fe({transaction:O2,meta:we(Pd),version:Me(Pc)})),rewards:Me(be(Aa)),blockTime:we(Z()),blockHeight:we(Z())}))),Xz=je(we(fe({blockhash:de(),previousBlockhash:de(),parentSlot:Z(),transactions:be(fe({transaction:P2,meta:we(t1),version:Me(Pc)})),rewards:Me(be(Aa)),blockTime:we(Z()),blockHeight:we(Z())}))),Jz=je(we(fe({blockhash:de(),previousBlockhash:de(),parentSlot:Z(),transactions:be(fe({transaction:O2,meta:we(t1),version:Me(Pc)})),rewards:Me(be(Aa)),blockTime:we(Z()),blockHeight:we(Z())}))),Qz=je(we(fe({blockhash:de(),previousBlockhash:de(),parentSlot:Z(),rewards:Me(be(Aa)),blockTime:we(Z()),blockHeight:we(Z())}))),eH=je(we(fe({blockhash:de(),previousBlockhash:de(),parentSlot:Z(),transactions:be(fe({transaction:e1,meta:we(Pd)})),rewards:Me(be(Aa)),blockTime:we(Z())}))),$w=je(we(fe({blockhash:de(),previousBlockhash:de(),parentSlot:Z(),signatures:be(de()),blockTime:we(Z())}))),ig=je(we(fe({slot:Z(),meta:Pd,blockTime:Me(we(Z())),transaction:e1,version:Me(Pc)}))),lf=je(we(fe({slot:Z(),transaction:P2,meta:we(t1),blockTime:Me(we(Z())),version:Me(Pc)}))),tH=Ht(fe({blockhash:de(),feeCalculator:fe({lamportsPerSignature:Z()})})),nH=Ht(fe({blockhash:de(),lastValidBlockHeight:Z()})),rH=Ht(Di()),iH=fe({slot:Z(),numTransactions:Z(),numSlots:Z(),samplePeriodSecs:Z()}),sH=je(be(iH)),oH=Ht(we(fe({feeCalculator:fe({lamportsPerSignature:Z()})}))),aH=je(de()),cH=je(de()),uH=fe({err:Ea,logs:be(de()),signature:de()}),lH=fe({result:Nd(uH),subscription:Z()}),fH={"solana-client":"js/".concat((ng="0.0.0-development")!==null&&ng!==void 0?ng:"UNKNOWN")},L2=function(){function t(e,n){var r=this;Ue(this,t),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={}
36,this._subscriptionHashByClientSubscriptionId={},this._subscriptionStateChangeCallbacksByHash={},this._subscriptionCallbacksByServerSubscriptionId={},this._subscriptionsByHash={},this._subscriptionsAutoDisposedByRpc=new Set,this.getBlockHeight=function(){var l={};return function(){var h=ae(G().mark(function p(g){var y,w,k,T,C,O;return G().wrap(function(N){for(;;)switch(N.prev=N.next){case 0:return w=Mt(g),k=w.commitment,T=w.config,C=r._buildArgs([],k,void 0,T),O=Nw(C),l[O]=(y=l[O])!==null&&y!==void 0?y:ae(G().mark(function F(){var L,D;return G().wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return z.prev=0,z.next=3,r._rpcRequest("getBlockHeight",C);case 3:if(L=z.sent,D=pe(L,je(Z())),!("error"in D)){z.next=7;break}throw new Te(D.error,"failed to get block height information");case 7:return z.abrupt("return",D.result);case 8:return z.prev=8,delete l[O],z.finish(8);case 11:case"end":return z.stop()}},F,null,[[0,,8,11]])}))(),N.next=6,l[O];case 6:return N.abrupt("return",N.sent);case 7:case"end":return N.stop()}},p)}));return function(p){return h.apply(this,arguments)}}()}();var i,s,o,a,c,u;n&&typeof n=="string"?this._commitment=n:n&&(this._commitment=n.commitment,this._confirmTransactionInitialTimeout=n.confirmTransactionInitialTimeout,i=n.wsEndpoint,s=n.httpHeaders,o=n.fetch,a=n.fetchMiddleware,c=n.disableRetryOnRateLimit,u=n.httpAgent),this._rpcEndpoint=XU(e),this._rpcWsEndpoint=i||VU(e),this._rpcClient=lz(e,s,o,a,c,u),this._rpcRequest=fz(this._rpcClient),this._rpcBatchRequest=hz(this._rpcClient),this._rpcWebSocket=new HU(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))}return ze(t,[{key:"commitment",get:function(){return this._commitment}},{key:"rpcEndpoint",get:function(){return this._rpcEndpoint}},{key:"getBalanceAndContext",value:function(){var e=ae(G().mark(function r(i,s){var o,a,c,u,l,h;return G().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return o=Mt(s),a=o.commitment,c=o.config,u=this._buildArgs([i.toBase58()],a,void 0,c),g.next=4,this._rpcRequest("getBalance",u);case 4:if(l=g.sent,h=pe(l,Ht(Z())),!("error"in h)){g.next=8;break}throw new Te(h.error,"failed to get balance for ".concat(i.toBase58()));case 8:return g.abrupt("return",h.result);case 9:case"end":return g.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"getBalance",value:function(){var e=ae(G().mark(function r(i,s){return G().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.getBalanceAndContext(i,s).then(function(c){return c.value}).catch(function(c){throw new Error("failed to get balance of account "+i.toBase58()+": "+c)});case 2:return a.abrupt("return",a.sent);case 3:case"end":return a.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"getBlockTime",value:function(){var e=ae(G().mark(function r(i){var s,o;return G().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,this._rpcRequest("getBlockTime",[i]);case 2:if(s=c.sent,o=pe(s,je(we(Z()))),!("error"in o)){c.next=6;break}throw new Te(o.error,"failed to get block time for slot ".concat(i));case 6:return c.abrupt("return",o.result);case 7:case"end":return c.stop()}},r,this)}));function n(r){return e.apply(this,arguments)}return n}()},{key:"getMinimumLedgerSlot",value:function(){var e=ae(G().mark(function r(){var i,s;return G().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this._rpcRequest("minimumLedgerSlot",[]);
36case 2:if(i=a.sent,s=pe(i,je(Z())),!("error"in s)){a.next=6;break}throw new Te(s.error,"failed to get minimum ledger slot");case 6:return a.abrupt("return",s.result);case 7:case"end":return a.stop()}},r,this)}));function n(){return e.apply(this,arguments)}return n}()},{key:"getFirstAvailableBlock",value:function(){var e=ae(G().mark(function r(){var i,s;return G().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this._rpcRequest("getFirstAvailableBlock",[]);case 2:if(i=a.sent,s=pe(i,bz),!("error"in s)){a.next=6;break}throw new Te(s.error,"failed to get first available block");case 6:return a.abrupt("return",s.result);case 7:case"end":return a.stop()}},r,this)}));function n(){return e.apply(this,arguments)}return n}()},{key:"getSupply",value:function(){var e=ae(G().mark(function r(i){var s,o,a;return G().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return s={},typeof i=="string"?s={commitment:i}:i?s=Ce(Ce({},i),{},{commitment:i&&i.commitment||this.commitment}):s={commitment:this.commitment},u.next=4,this._rpcRequest("getSupply",[s]);case 4:if(o=u.sent,a=pe(o,wz),!("error"in a)){u.next=8;break}throw new Te(a.error,"failed to get supply");case 8:return u.abrupt("return",a.result);case 9:case"end":return u.stop()}},r,this)}));function n(r){return e.apply(this,arguments)}return n}()},{key:"getTokenSupply",value:function(){var e=ae(G().mark(function r(i,s){var o,a,c;return G().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return o=this._buildArgs([i.toBase58()],s),l.next=3,this._rpcRequest("getTokenSupply",o);case 3:if(a=l.sent,c=pe(a,Ht($0)),!("error"in c)){l.next=7;break}throw new Te(c.error,"failed to get token supply");case 7:return l.abrupt("return",c.result);case 8:case"end":return l.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"getTokenAccountBalance",value:function(){var e=ae(G().mark(function r(i,s){var o,a,c;return G().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return o=this._buildArgs([i.toBase58()],s),l.next=3,this._rpcRequest("getTokenAccountBalance",o);case 3:if(a=l.sent,c=pe(a,Ht($0)),!("error"in c)){l.next=7;break}throw new Te(c.error,"failed to get token account balance");case 7:return l.abrupt("return",c.result);case 8:case"end":return l.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"getTokenAccountsByOwner",value:function(){var e=ae(G().mark(function r(i,s,o){var a,c,u,l,h,p,g;return G().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return a=Mt(o),c=a.commitment,u=a.config,l=[i.toBase58()],"mint"in s?l.push({mint:s.mint.toBase58()}):l.push({programId:s.programId.toBase58()}),h=this._buildArgs(l,c,"base64",u),w.next=6,this._rpcRequest("getTokenAccountsByOwner",h);case 6:if(p=w.sent,g=pe(p,kz),!("error"in g)){w.next=10;break}throw new Te(g.error,"failed to get token accounts owned by account ".concat(i.toBase58()));case 10:return w.abrupt("return",g.result);case 11:case"end":return w.stop()}},r,this)}));function n(r,i,s){return e.apply(this,arguments)}return n}()},{key:"getParsedTokenAccountsByOwner",value:function(){var e=ae(G().mark(function r(i,s,o){var a,c,u,l;return G().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return a=[i.toBase58()],"mint"in s?a.push({mint:s.mint.toBase58()}):a.push({programId:s.programId.toBase58()}),c=this._buildArgs(a,o,"jsonParsed"),p.next=5,this._rpcRequest("getTokenAccountsByOwner",c);case 5:if(u=p.sent,l=pe(u,Sz),!("error"in l)){p.next=9;break}throw new Te(l.error,"failed to get token accounts owned by account ".concat(i.toBase58()));case 9:return p.abrupt("return",l.result);case 10:case"end":return p.stop()}},r,this)}));function n(r,i,s){return e.apply(this,arguments)}return n}()},{key:"getLargestAccounts",value:function(){var e=ae(G().mark(function r(i){var s,o,a,c;return G().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return s=Ce(Ce({},i),{},{commitment:i&&i.commitment||this.commitment}),o=s.filter||s.commitment?[s]:[],l.next=4,this._rpcRequest("getLargestAccounts",o);case 4:if(a=l.sent,c=pe(a,Ez),!("error"in c)){l.next=8;break}throw new Te(c.error,"failed to get largest accounts");case 8:return l.abrupt("return",c.result);case 9:case"end":return l.stop()}},r,this)}));function n(r){return e.apply(this,arguments)}return n}()},{key:"getTokenLargestAccounts",value:function(){var e=ae(G().mark(function r(i,s){var o,a,c;return G().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return o=this._buildArgs([i.toBase58()],s),l.next=3,this._rpcRequest("getTokenLargestAccounts",o);case 3:if(a=l.sent,c=pe(a,_z),!("error"in c)){l.next=7;break}throw new Te(c.error,"failed to get token largest accounts");case 7:return l.abrupt("return",c.result);case 8:case"end":return l.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"getAccountInfoAndContext",value:function(){var e=ae(G().mark(function r(i,s){var o,a,c,u,l,h;return G().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return o=Mt(s),a=o.commitment,c=o.config,u=this._buildArgs([i.toBase58()],a,"base64",c),g.next=4,this._rpcRequest("getAccountInfo",u);case 4:if(l=g.sent,h=pe(l,Ht(we(Xu))),!("error"in h)){g.next=8;break}throw new Te(h.error,"failed to get info about account ".concat(i.toBase58()
36));case 8:return g.abrupt("return",h.result);case 9:case"end":return g.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"getParsedAccountInfo",value:function(){var e=ae(G().mark(function r(i,s){var o,a,c,u,l,h;return G().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return o=Mt(s),a=o.commitment,c=o.config,u=this._buildArgs([i.toBase58()],a,"jsonParsed",c),g.next=4,this._rpcRequest("getAccountInfo",u);case 4:if(l=g.sent,h=pe(l,Ht(we(U0))),!("error"in h)){g.next=8;break}throw new Te(h.error,"failed to get info about account ".concat(i.toBase58()));case 8:return g.abrupt("return",h.result);case 9:case"end":return g.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"getAccountInfo",value:function(){var e=ae(G().mark(function r(i,s){var o;return G().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.prev=0,c.next=3,this.getAccountInfoAndContext(i,s);case 3:return o=c.sent,c.abrupt("return",o.value);case 7:throw c.prev=7,c.t0=c.catch(0),new Error("failed to get info about account "+i.toBase58()+": "+c.t0);case 10:case"end":return c.stop()}},r,this,[[0,7]])}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"getMultipleParsedAccounts",value:function(){var e=ae(G().mark(function r(i,s){var o,a,c,u,l,h,p;return G().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return o=Mt(s),a=o.commitment,c=o.config,u=i.map(function(w){return w.toBase58()}),l=this._buildArgs([u],a,"jsonParsed",c),y.next=5,this._rpcRequest("getMultipleAccounts",l);case 5:if(h=y.sent,p=pe(h,Ht(be(we(U0)))),!("error"in p)){y.next=9;break}throw new Te(p.error,"failed to get info for accounts ".concat(u));case 9:return y.abrupt("return",p.result);case 10:case"end":return y.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"getMultipleAccountsInfoAndContext",value:function(){var e=ae(G().mark(function r(i,s){var o,a,c,u,l,h,p;return G().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return o=Mt(s),a=o.commitment,c=o.config,u=i.map(function(w){return w.toBase58()}),l=this._buildArgs([u],a,"base64",c),y.next=5,this._rpcRequest("getMultipleAccounts",l);case 5:if(h=y.sent,p=pe(h,Ht(be(we(Xu)))),!("error"in p)){y.next=9;break}throw new Te(p.error,"failed to get info for accounts ".concat(u));case 9:return y.abrupt("return",p.result);case 10:case"end":return y.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"getMultipleAccountsInfo",value:function(){var e=ae(G().mark(function r(i,s){var o;return G().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,this.getMultipleAccountsInfoAndContext(i,s);case 2:return o=c.sent,c.abrupt("return",o.value);case 4:case"end":return c.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"getStakeActivation",value:function(){var e=ae(G().mark(function r(i,s,o){var a,c,u,l,h,p;return G().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return a=Mt(s),c=a.commitment,u=a.config,l=this._buildArgs([i.toBase58()],c,void 0,Ce(Ce({},u),{},{epoch:o??(u==null?void 0:u.epoch)})),y.next=4,this._rpcRequest("getStakeActivation",l);case 4:if(h=y.sent,p=pe(h,je(Tz)),!("error"in p)){y.next=8;break}throw new Te(p.error,"failed to get Stake Activation ".concat(i.toBase58()));case 8:return y.abrupt("return",p.result);case 9:case"end":return y.stop()}},r,this)}));function n(r,i,s){return e.apply(this,arguments)}return n}()},{key:"getProgramAccounts",value:function(){var e=ae(G().mark(function r(i,s){var o,a,c,u,l,h,p,g,y,w;return G().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return o=Mt(s),a=o.commitment,c=o.config,u=c||{},l=u.encoding,h=Df(u,GU),p=this._buildArgs([i.toBase58()],a,l||"base64",h),T.next=5,this._rpcRequest("getProgramAccounts",p);case 5:if(g=T.sent,y=be(Az),w=h.withContext===!0?pe(g,Ht(y)):pe(g,je(y)),!("error"in w)){T.next=10;break}throw new Te(w.error,"failed to get accounts owned by program ".concat(i.toBase58()));case 10:return T.abrupt("return",w.result);case 11:case"end":return T.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"getParsedProgramAccounts",value:function(){var e=ae(G().mark(function r(i,s){var o,a,c,u,l,h;return G().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return o=Mt(s),a=o.commitment,c=o.config,u=this._buildArgs([i.toBase58()],a,"jsonParsed",c),g.next=4,this._rpcRequest("getProgramAccounts",u);case 4:if(l=g.sent,h=pe(l,je(be(Rz))),!("error"in h)){g.next=8;break}throw new Te(h.error,"failed to get accounts owned by program ".concat(i.toBase58()
36));case 8:return g.abrupt("return",h.result);case 9:case"end":return g.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"confirmTransaction",value:function(){var e=ae(G().mark(function r(i,s){var o,a,c,u;return G().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(typeof i!="string"){h.next=4;break}o=i,h.next=8;break;case 4:if(c=i,!((a=c.abortSignal)!==null&&a!==void 0&&a.aborted)){h.next=7;break}return h.abrupt("return",Promise.reject(c.abortSignal.reason));case 7:o=c.signature;case 8:h.prev=8,u=jt.decode(o),h.next=15;break;case 12:throw h.prev=12,h.t0=h.catch(8),new Error("signature must be base58 encoded: "+o);case 15:if(at(u.length===64,"signature has invalid length"),typeof i!="string"){h.next=22;break}return h.next=19,this.confirmTransactionUsingLegacyTimeoutStrategy({commitment:s||this.commitment,signature:o});case 19:return h.abrupt("return",h.sent);case 22:if(!("lastValidBlockHeight"in i)){h.next=28;break}return h.next=25,this.confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:s||this.commitment,strategy:i});case 25:return h.abrupt("return",h.sent);case 28:return h.next=30,this.confirmTransactionUsingDurableNonceStrategy({commitment:s||this.commitment,strategy:i});case 30:return h.abrupt("return",h.sent);case 31:case"end":return h.stop()}},r,this,[[8,12]])}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"getCancellationPromise",value:function(n){return new Promise(function(r,i){n!=null&&(n.aborted?i(n.reason):n.addEventListener("abort",function(){i(n.reason)}))})}},{key:"getTransactionConfirmationPromise",value:function(n){var r=this,i=n.commitment,s=n.signature,o,a,c=!1,u=new Promise(function(h,p){try{o=r.onSignature(s,function(y,w){o=void 0;var k={context:w,value:y};h({__type:Xi.PROCESSED,response:k})},i);var g=new Promise(function(y){o==null?y():a=r._onSubscriptionStateChange(o,function(w){w==="subscribed"&&y()})});ae(G().mark(function y(){var w,k,T;return G().wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return O.next=2,g;case 2:if(!c){O.next=4;break}return O.abrupt("return");case 4:return O.next=6,r.getSignatureStatus(s);case 6:if(w=O.sent,!c){O.next=9;break}return O.abrupt("return");case 9:if(w!=null){O.next=11;break}return O.abrupt("return");case 11:if(k=w.context,T=w.value,T!=null){O.next=14;break}return O.abrupt("return");case 14:if(!(T!=null&&T.err)){O.next=18;break}p(T.err),O.next=29;break;case 18:O.t0=i,O.next=O.t0==="confirmed"||O.t0==="single"||O.t0==="singleGossip"?21:O.t0==="finalized"||O.t0==="max"||O.t0==="root"?24:(O.t0==="processed"||O.t0==="recent",27);break;case 21:if(T.confirmationStatus!=="processed"){O.next=23;break}return O.abrupt("return");case 23:return O.abrupt("break",27);case 24:if(!(T.confirmationStatus==="processed"||T.confirmationStatus==="confirmed")){O.next=26;break}return O.abrupt("return");case 26:return O.abrupt("break",27);case 27:c=!0,h({__type:Xi.PROCESSED,response:{context:k,value:T}});case 29:case"end":return O.stop()}},y)}))()}catch(y){p(y)}}),l=function(){a&&(a(),a=void 0),o!=null&&(r.removeSignatureListener(o),o=void 0)};return{abortConfirmation:l,confirmationPromise:u}}},{key:"confirmTransactionUsingBlockHeightExceedanceStrategy",value:function(){var e=ae(G().mark(function r(i){var s=this,o,a,c,u,l,h,p,g,y,w,k,T,C;return G().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return o=i.commitment,a=i.strategy,c=a.abortSignal,u=a.lastValidBlockHeight,l=a.signature,h=!1,p=new Promise(function(N){var F=function(){var L=ae(G().mark(function D(){var H;return G().wrap(function(K){for(;;)switch(K.prev=K.next){case 0:return K.prev=0,K.next=3,s.getBlockHeight(o);case 3:return H=K.sent,K.abrupt("return",H);case 7:return K.prev=7,K.t0=K.catch(0),K.abrupt("return",-1);case 10:case"end":return K.stop()}},D,null,[[0,7]])}));return function(){return L.apply(this,arguments)}}();ae(G().mark(function L(){var D;return G().wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return z.next=2,F();case 2:if(D=z.sent,!h){z.next=5;break}return z.abrupt("return");case 5:if(!(D<=u)){z.next=17;break}return z.next=8,Fo(1e3);case 8:if(!h){z.next=10;break}return z.abrupt("return");case 10:return z.next=12,F();case 12:if(D=z.sent,!h){z.next=15;break}return z.abrupt("return");case 15:z.next=5;break;case 17:N({__type:Xi.BLOCKHEIGHT_EXCEEDED});case 18:case"end":return z.stop()}},L)}))()}),g=this.getTransactionConfirmationPromise({commitment:o,signature:l}),y=g.abortConfirmation,w=g.confirmationPromise,k=this.getCancellationPromise(c),I.prev=5,I.next=8,Promise.race([k,w,p]);case 8:if(C=I.sent,C.__type!==Xi.PROCESSED){I.next=13;break}T=C.response,I.next=14;break;case 13:throw new Xy(l);case 14:return I.prev=14,h=!0,y(),I.finish(14);case 18:return I.abrupt("return",T);case 19:case"end":return I.stop()}},r,this,[[5,,14,18]])}));function n(r){return e.apply(this,arguments)}return n}()},{key:"confirmTransactionUsingDurableNonceStrategy",value:function(){var e=ae(G().mark(function r(i){var s=this,o,a,c,u,l,h,p,g,y,w,k,T,C,O,I,N,F,L,D,H,z;return G().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return o=i.commitment,a=i.strategy,c=a.abortSignal,u=a.minContextSlot,l=a.nonceAccountPubkey,h=a.nonceValue,p=a.signature,g=!1,y=new Promise(function(m){var f=h,d=null,v=function(){var b=ae(G().mark(function E(){var x,M,P;return G().wrap(function($){for(;;)switch($.prev=$.next){case 0:return $.prev=0,$.next=3,s.getNonceAndContext(l,{commitment:o,minContextSlot:u});case 3:return x=$.sent,M=x.context,P=x.value,d=M.slot,$.abrupt("return",P==null?void 0:P.nonce);case 10:return $.prev=10,$.t0=$.catch(0),$.abrupt("return",f);case 13:case"end":return $.stop()}},E,null,[[0,10]])}));return function(){return b.apply(this,arguments)}}();ae(G().mark(function b(){return G().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return x.next=2,v();case 2:if(f=x.sent,!g){x.next=5;break}return x.abrupt("return");case 5:if(h===f){x.next=9;break}return m({__type:Xi.NONCE_INVALID,slotInWhichNonceDidAdvance:d}),x.abrupt("return");case 9:return x.next=11,Fo(2e3);case 11:if(!g){x.next=13;break}return x.abrupt("return");case 13:return x.next=15,v();case 15:if(f=x.sent,!g){x.next=18;break}return x.abrupt("return");case 18:x.next=5;break;case 20:case"end":return x.stop()}},b)}))()}),w=this.getTransactionConfirmationPromise({commitment:o,signature:p}),k=w.abortConfirmation,T=w.confirmationPromise,C=this.getCancellationPromise(c),_.prev=5,_.next=8,Promise.race([C,T,y]);case 8:if(I=_.sent,I.__type!==Xi.PROCESSED){_.next=13;break}O=I.response,_.next=47;break;
36case 13:return _.next=16,this.getSignatureStatus(p);case 16:if(D=_.sent,D!=null){_.next=19;break}return _.abrupt("break",27);case 19:if(!(D.context.slot<((L=I.slotInWhichNonceDidAdvance)!==null&&L!==void 0?L:u))){_.next=23;break}return _.next=22,Fo(400);case 22:return _.abrupt("continue",13);case 23:return F=D,_.abrupt("break",27);case 27:if(!((N=F)!==null&&N!==void 0&&N.value)){_.next=46;break}H=o||"finalized",z=F.value.confirmationStatus,_.t0=H,_.next=_.t0==="processed"||_.t0==="recent"?33:_.t0==="confirmed"||_.t0==="single"||_.t0==="singleGossip"?36:_.t0==="finalized"||_.t0==="max"||_.t0==="root"?39:42;break;case 33:if(!(z!=="processed"&&z!=="confirmed"&&z!=="finalized")){_.next=35;break}throw new Ua(p);case 35:return _.abrupt("break",43);case 36:if(!(z!=="confirmed"&&z!=="finalized")){_.next=38;break}throw new Ua(p);case 38:return _.abrupt("break",43);case 39:if(z==="finalized"){_.next=41;break}throw new Ua(p);case 41:return _.abrupt("break",43);case 42:case 43:O={context:F.context,value:{err:F.value.err}},_.next=47;break;case 46:throw new Ua(p);case 47:return _.prev=47,g=!0,k(),_.finish(47);case 51:return _.abrupt("return",O);case 52:case"end":return _.stop()}},r,this,[[5,,47,51]])}));function n(r){return e.apply(this,arguments)}return n}()},{key:"confirmTransactionUsingLegacyTimeoutStrategy",value:function(){var e=ae(G().mark(function r(i){var s=this,o,a,c,u,l,h,p,g,y;return G().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return o=i.commitment,a=i.signature,u=new Promise(function(T){var C=s._confirmTransactionInitialTimeout||6e4;switch(o){case"processed":case"recent":case"single":case"confirmed":case"singleGossip":{C=s._confirmTransactionInitialTimeout||3e4;break}}c=setTimeout(function(){return T({__type:Xi.TIMED_OUT,timeoutMs:C})},C)}),l=this.getTransactionConfirmationPromise({commitment:o,signature:a}),h=l.abortConfirmation,p=l.confirmationPromise,k.prev=3,k.next=6,Promise.race([p,u]);case 6:if(y=k.sent,y.__type!==Xi.PROCESSED){k.next=11;break}g=y.response,k.next=12;break;case 11:throw new Jy(a,y.timeoutMs/1e3);case 12:return k.prev=12,clearTimeout(c),h(),k.finish(12);case 16:return k.abrupt("return",g);case 17:case"end":return k.stop()}},r,this,[[3,,12,16]])}));function n(r){return e.apply(this,arguments)}return n}()},{key:"getClusterNodes",value:function(){var e=ae(G().mark(function r(){var i,s;return G().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this._rpcRequest("getClusterNodes",[]);case 2:if(i=a.sent,s=pe(i,je(be(Uz))),!("error"in s)){a.next=6;break}throw new Te(s.error,"failed to get cluster nodes");case 6:return a.abrupt("return",s.result);case 7:case"end":return a.stop()}},r,this)}));function n(){return e.apply(this,arguments)}return n}()},{key:"getVoteAccounts",value:function(){var e=ae(G().mark(function r(i){var s,o,a;return G().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return s=this._buildArgs([],i),u.next=3,this._rpcRequest("getVoteAccounts",s);case 3:if(o=u.sent,a=pe(o,zz),!("error"in a)){u.next=7;break}throw new Te(a.error,"failed to get vote accounts");case 7:return u.abrupt("return",a.result);case 8:case"end":return u.stop()}},r,this)}));function n(r){return e.apply(this,arguments)}return n}()},{key:"getSlot",value:function(){var e=ae(G().mark(function r(i){var s,o,a,c,u,l;return G().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return s=Mt(i),o=s.commitment,a=s.config,c=this._buildArgs([],o,void 0,a),p.next=4,this._rpcRequest("getSlot",c);case 4:if(u=p.sent,l=pe(u,je(Z())),!("error"in l)){p.next=8;break}throw new Te(l.error,"failed to get slot");case 8:return p.abrupt("return",l.result);case 9:case"end":return p.stop()}},r,this)}));function n(r){return e.apply(this,arguments)}return n}()},{key:"getSlotLeader",value:function(){var e=ae(G().mark(function r(i){var s,o,a,c,u,l;return G().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return s=Mt(i),o=s.commitment,a=s.config,c=this._buildArgs([],o,void 0,a),p.next=4,this._rpcRequest("getSlotLeader",c);case 4:if(u=p.sent,l=pe(u,je(de())),!("error"in l)){p.next=8;break}throw new Te(l.error,"failed to get slot leader");case 8:return p.abrupt("return",l.result);case 9:case"end":return p.stop()}},r,this)}));function n(r){return e.apply(this,arguments)}return n}()},{key:"getSlotLeaders",value:function(){var e=ae(G().mark(function r(i,s){var o,a,c;return G().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return o=[i,s],l.next=3,this._rpcRequest("getSlotLeaders",o);case 3:if(a=l.sent,c=pe(a,je(be(bn))),!("error"in c)){l.next=7;break}throw new Te(c.error,"failed to get slot leaders");case 7:return l.abrupt("return",c.result);case 8:case"end":return l.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"getSignatureStatus",value:function(){var e=ae(G().mark(function r(i,s){var o,a,c,u;return G().wrap(function(h){for(;;
36)switch(h.prev=h.next){case 0:return h.next=2,this.getSignatureStatuses([i],s);case 2:return o=h.sent,a=o.context,c=o.value,at(c.length===1),u=c[0],h.abrupt("return",{context:a,value:u});case 8:case"end":return h.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"getSignatureStatuses",value:function(){var e=ae(G().mark(function r(i,s){var o,a,c;return G().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return o=[i],s&&o.push(s),l.next=4,this._rpcRequest("getSignatureStatuses",o);case 4:if(a=l.sent,c=pe(a,jz),!("error"in c)){l.next=8;break}throw new Te(c.error,"failed to get signature status");case 8:return l.abrupt("return",c.result);case 9:case"end":return l.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"getTransactionCount",value:function(){var e=ae(G().mark(function r(i){var s,o,a,c,u,l;return G().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return s=Mt(i),o=s.commitment,a=s.config,c=this._buildArgs([],o,void 0,a),p.next=4,this._rpcRequest("getTransactionCount",c);case 4:if(u=p.sent,l=pe(u,je(Z())),!("error"in l)){p.next=8;break}throw new Te(l.error,"failed to get transaction count");case 8:return p.abrupt("return",l.result);case 9:case"end":return p.stop()}},r,this)}));function n(r){return e.apply(this,arguments)}return n}()},{key:"getTotalSupply",value:function(){var e=ae(G().mark(function r(i){var s;return G().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.getSupply({commitment:i,excludeNonCirculatingAccountsList:!0});case 2:return s=a.sent,a.abrupt("return",s.value.total);case 4:case"end":return a.stop()}},r,this)}));function n(r){return e.apply(this,arguments)}return n}()},{key:"getInflationGovernor",value:function(){var e=ae(G().mark(function r(i){var s,o,a;return G().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return s=this._buildArgs([],i),u.next=3,this._rpcRequest("getInflationGovernor",s);case 3:if(o=u.sent,a=pe(o,dz),!("error"in a)){u.next=7;break}throw new Te(a.error,"failed to get inflation");case 7:return u.abrupt("return",a.result);case 8:case"end":return u.stop()}},r,this)}));function n(r){return e.apply(this,arguments)}return n}()},{key:"getInflationReward",value:function(){var e=ae(G().mark(function r(i,s,o){var a,c,u,l,h,p;return G().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return a=Mt(o),c=a.commitment,u=a.config,l=this._buildArgs([i.map(function(w){return w.toBase58()})],c,void 0,Ce(Ce({},u),{},{epoch:s??(u==null?void 0:u.epoch)})),y.next=4,this._rpcRequest("getInflationReward",l);case 4:if(h=y.sent,p=pe(h,ez),!("error"in p)){y.next=8;break}throw new Te(p.error,"failed to get inflation reward");case 8:return y.abrupt("return",p.result);case 9:case"end":return y.stop()}},r,this)}));function n(r,i,s){return e.apply(this,arguments)}return n}()},{key:"getInflationRate",value:function(){var e=ae(G().mark(function r(){var i,s;return G().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this._rpcRequest("getInflationRate",[]);case 2:if(i=a.sent,s=pe(i,pz),!("error"in s)){a.next=6;break}throw new Te(s.error,"failed to get inflation rate");case 6:return a.abrupt("return",s.result);case 7:case"end":return a.stop()}},r,this)}));function n(){return e.apply(this,arguments)}return n}()},{key:"getEpochInfo",value:function(){var e=ae(G().mark(function r(i){var s,o,a,c,u,l;return G().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return s=Mt(i),o=s.commitment,a=s.config,c=this._buildArgs([],o,void 0,a),p.next=4,this._rpcRequest("getEpochInfo",c);case 4:if(u=p.sent,l=pe(u,mz),!("error"in l)){p.next=8;break}throw new Te(l.error,"failed to get epoch info");case 8:return p.abrupt("return",l.result);case 9:case"end":return p.stop()}},r,this)}));function n(r){return e.apply(this,arguments)}return n}()},{key:"getEpochSchedule",value:function(){var e=ae(G().mark(function r(){var i,s,o;return G().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,this._rpcRequest("getEpochSchedule",[]);case 2:if(i=c.sent,s=pe(i,yz),!("error"in s)){c.next=6;break}throw new Te(s.error,"failed to get epoch schedule");case 6:return o=s.result,c.abrupt("return",new k2(o.slotsPerEpoch,o.leaderScheduleSlotOffset,o.warmup,o.firstNormalEpoch,o.firstNormalSlot));case 8:case"end":return c.stop()}},r,this)}));function n(){return e.apply(this,arguments)}return n}()},{key:"getLeaderSchedule",value:function(){var e=ae(G().mark(function r(){var i,s;return G().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this._rpcRequest("getLeaderSchedule",[]);case 2:if(i=a.sent,s=pe(i,vz),!("error"in s)){a.next=6;break}throw new Te(s.error,"failed to get leader schedule");case 6:return a.abrupt("return",s.result);case 7:case"end":return a.stop()}},r,this)}));function n(){return e.apply(this,arguments)}return n}()},{key:"getMinimumBalanceForRentExemption",value:function(){var e=ae(G().mark(function r(i,s){var o,a,c;return G().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return o=this._buildArgs([i],s),l.next=3,this._rpcRequest("getMinimumBalanceForRentExemption",o);case 3:if(a=l.sent,c=pe(a,Kz),!("error"in c)){l.next=8;break}return console.warn("Unable to fetch minimum balance for rent exemption"),l.abrupt("return",0);case 8:return l.abrupt("return",c.result);case 9:case"end":return l.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"getRecentBlockhashAndContext",value:function(){var e=ae(G().mark(function r(i){var s,o,a;return G().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return s=this._buildArgs([],i),u.next=3,this._rpcRequest("getRecentBlockhash",s);case 3:if(o=u.sent,a=pe(o,tH),!("error"in a)){u.next=7;break}throw new Te(a.error,"failed to get recent blockhash");case 7:return u.abrupt("return",a.result);case 8:case"end":return u.stop()}},r,this)}));function n(r){return e.apply(this,arguments)}return n}()},{key:"getRecentPerformanceSamples",value:function(){var e=ae(G().mark(function r(i){var s,o;return G().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,this._rpcRequest("getRecentPerformanceSamples",i?[i]:[]);
36case 2:if(s=c.sent,o=pe(s,sH),!("error"in o)){c.next=6;break}throw new Te(o.error,"failed to get recent performance samples");case 6:return c.abrupt("return",o.result);case 7:case"end":return c.stop()}},r,this)}));function n(r){return e.apply(this,arguments)}return n}()},{key:"getFeeCalculatorForBlockhash",value:function(){var e=ae(G().mark(function r(i,s){var o,a,c,u,l,h;return G().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return o=this._buildArgs([i],s),g.next=3,this._rpcRequest("getFeeCalculatorForBlockhash",o);case 3:if(a=g.sent,c=pe(a,oH),!("error"in c)){g.next=7;break}throw new Te(c.error,"failed to get fee calculator");case 7:return u=c.result,l=u.context,h=u.value,g.abrupt("return",{context:l,value:h!==null?h.feeCalculator:null});case 9:case"end":return g.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"getFeeForMessage",value:function(){var e=ae(G().mark(function r(i,s){var o,a,c,u;return G().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return o=Ke(i.serialize()).toString("base64"),a=this._buildArgs([o],s),h.next=4,this._rpcRequest("getFeeForMessage",a);case 4:if(c=h.sent,u=pe(c,Ht(we(Z()))),!("error"in u)){h.next=8;break}throw new Te(u.error,"failed to get fee for message");case 8:if(u.result!==null){h.next=10;break}throw new Error("invalid blockhash");case 10:return h.abrupt("return",u.result);case 11:case"end":return h.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"getRecentPrioritizationFees",value:function(){var e=ae(G().mark(function r(i){var s,o,a,c,u;return G().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return o=i==null||(s=i.lockedWritableAccounts)===null||s===void 0?void 0:s.map(function(p){return p.toBase58()}),a=this._buildArgs(o!=null&&o.length?[o]:[]),h.next=4,this._rpcRequest("getRecentPrioritizationFees",a);case 4:if(c=h.sent,u=pe(c,gz),!("error"in u)){h.next=8;break}throw new Te(u.error,"failed to get recent prioritization fees");case 8:return h.abrupt("return",u.result);case 9:case"end":return h.stop()}},r,this)}));function n(r){return e.apply(this,arguments)}return n}()},{key:"getRecentBlockhash",value:function(){var e=ae(G().mark(function r(i){var s;return G().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,this.getRecentBlockhashAndContext(i);case 3:return s=a.sent,a.abrupt("return",s.value);case 7:throw a.prev=7,a.t0=a.catch(0),new Error("failed to get recent blockhash: "+a.t0);case 10:case"end":return a.stop()}},r,this,[[0,7]])}));function n(r){return e.apply(this,arguments)}return n}()},{key:"getLatestBlockhash",value:function(){var e=ae(G().mark(function r(i){var s;return G().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,this.getLatestBlockhashAndContext(i);case 3:return s=a.sent,a.abrupt("return",s.value);case 7:throw a.prev=7,a.t0=a.catch(0),new Error("failed to get recent blockhash: "+a.t0);case 10:case"end":return a.stop()}},r,this,[[0,7]])}));function n(r){return e.apply(this,arguments)}return n}()},{key:"getLatestBlockhashAndContext",value:function(){var e=ae(G().mark(function r(i){var s,o,a,c,u,l;return G().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return s=Mt(i),o=s.commitment,a=s.config,c=this._buildArgs([],o,void 0,a),p.next=4,this._rpcRequest("getLatestBlockhash",c);case 4:if(u=p.sent,l=pe(u,nH),!("error"in l)){p.next=8;break}throw new Te(l.error,"failed to get latest blockhash");case 8:return p.abrupt("return",l.result);case 9:case"end":return p.stop()}},r,this)}));function n(r){return e.apply(this,arguments)}return n}()},{key:"isBlockhashValid",value:function(){var e=ae(G().mark(function r(i,s){var o,a,c,u,l,h;return G().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return o=Mt(s),a=o.commitment,c=o.config,u=this._buildArgs([i],a,void 0,c),g.next=4,this._rpcRequest("isBlockhashValid",u);case 4:if(l=g.sent,h=pe(l,rH),!("error"in h)){g.next=8;break}throw new Te(h.error,"failed to determine if the blockhash `"+i+"`is valid");case 8:return g.abrupt("return",h.result);case 9:case"end":return g.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"getVersion",value:function(){var e=ae(G().mark(function r(){var i,s;return G().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this._rpcRequest("getVersion",[]);case 2:if(i=a.sent,s=pe(i,je(cz)),!("error"in s)){a.next=6;break}throw new Te(s.error,"failed to get version");case 6:return a.abrupt("return",s.result);case 7:case"end":return a.stop()}},r,this)}));function n(){return e.apply(this,arguments)}return n}()},{key:"getGenesisHash",value:function(){var e=ae(G().mark(function r(){var i,s;return G().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this._rpcRequest("getGenesisHash",[]);case 2:if(i=a.sent,s=pe(i,je(de())),!("error"in s)){a.next=6;break}throw new Te(s.error,"failed to get genesis hash");case 6:return a.abrupt("return",s.result);case 7:case"end":return a.stop()}},r,this)}));function n(){return e.apply(this,arguments)}return n}()},{key:"getBlock",value:function(){var e=ae(G().mark(function r(i,s){var o,a,c,u,l,h,p,g,y;return G().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return o=Mt(s),a=o.commitment,c=o.config,u=this._buildArgsAtLeastConfirmed([i],a,void 0,c),k.next=4,this._rpcRequest("getBlock",u);case 4:l=k.sent,k.prev=5,k.t0=c==null?void 0:c.transactionDetail
36s,k.next=k.t0==="accounts"?9:k.t0==="none"?13:17;break;case 9:if(h=pe(l,Zz),!("error"in h)){k.next=12;break}throw h.error;case 12:return k.abrupt("return",h.result);case 13:if(p=pe(l,Yz),!("error"in p)){k.next=16;break}throw p.error;case 16:return k.abrupt("return",p.result);case 17:if(g=pe(l,Gz),!("error"in g)){k.next=20;break}throw g.error;case 20:return y=g.result,k.abrupt("return",y?Ce(Ce({},y),{},{transactions:y.transactions.map(function(T){var C=T.transaction,O=T.meta,I=T.version;return{meta:O,transaction:Ce(Ce({},C),{},{message:rg(I,C.message)}),version:I}})}):null);case 22:k.next=27;break;case 24:throw k.prev=24,k.t1=k.catch(5),new Te(k.t1,"failed to get confirmed block");case 27:case"end":return k.stop()}},r,this,[[5,24]])}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"getParsedBlock",value:function(){var e=ae(G().mark(function r(i,s){var o,a,c,u,l,h,p,g;return G().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return o=Mt(s),a=o.commitment,c=o.config,u=this._buildArgsAtLeastConfirmed([i],a,"jsonParsed",c),w.next=4,this._rpcRequest("getBlock",u);case 4:l=w.sent,w.prev=5,w.t0=c==null?void 0:c.transactionDetails,w.next=w.t0==="accounts"?9:w.t0==="none"?13:17;break;case 9:if(h=pe(l,Jz),!("error"in h)){w.next=12;break}throw h.error;case 12:return w.abrupt("return",h.result);case 13:if(p=pe(l,Qz),!("error"in p)){w.next=16;break}throw p.error;case 16:return w.abrupt("return",p.result);case 17:if(g=pe(l,Xz),!("error"in g)){w.next=20;break}throw g.error;case 20:return w.abrupt("return",g.result);case 21:w.next=26;break;case 23:throw w.prev=23,w.t1=w.catch(5),new Te(w.t1,"failed to get block");case 26:case"end":return w.stop()}},r,this,[[5,23]])}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"getBlockProduction",value:function(){var e=ae(G().mark(function r(i){var s,o,a,c,u,l,h;return G().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return typeof i=="string"?o=i:i&&(a=i.commitment,c=Df(i,YU),o=a,s=c),u=this._buildArgs([],o,"base64",s),g.next=4,this._rpcRequest("getBlockProduction",u);case 4:if(l=g.sent,h=pe(l,uz),!("error"in h)){g.next=8;break}throw new Te(h.error,"failed to get block production information");case 8:return g.abrupt("return",h.result);case 9:case"end":return g.stop()}},r,this)}));function n(r){return e.apply(this,arguments)}return n}()},{key:"getTransaction",value:function(){var e=ae(G().mark(function r(i,s){var o,a,c,u,l,h,p;return G().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return o=Mt(s),a=o.commitment,c=o.config,u=this._buildArgsAtLeastConfirmed([i],a,void 0,c),y.next=4,this._rpcRequest("getTransaction",u);case 4:if(l=y.sent,h=pe(l,ig),!("error"in h)){y.next=8;break}throw new Te(h.error,"failed to get transaction");case 8:if(p=h.result,p){y.next=11;break}return y.abrupt("return",p);case 11:return y.abrupt("return",Ce(Ce({},p),{},{transaction:Ce(Ce({},p.transaction),{},{message:rg(p.version,p.transaction.message)})}));case 12:case"end":return y.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"getParsedTransaction",value:function(){var e=ae(G().mark(function r(i,s){var o,a,c,u,l,h;return G().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return o=Mt(s),a=o.commitment,c=o.config,u=this._buildArgsAtLeastConfirmed([i],a,"jsonParsed",c),g.next=4,this._rpcRequest("getTransaction",u);case 4:if(l=g.sent,h=pe(l,lf),!("error"in h)){g.next=8;break}throw new Te(h.error,"failed to get transaction");case 8:return g.abrupt("return",h.result);case 9:case"end":return g.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"getParsedTransactions",value:function(){var e=ae(G().mark(function r(i,s){var o=this,a,c,u,l,h,p;return G().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return a=Mt(s),c=a.commitment,u=a.config,l=i.map(function(w){var k=o._buildArgsAtLeastConfirmed([w],c,"jsonParsed",u);return{methodName:"getTransaction",args:k}}),y.next=4,this._rpcBatchRequest(l);case 4:return h=y.sent,p=h.map(function(w){var k=pe(w,lf);if("error"in k)throw new Te(k.error,"failed to get transactions");return k.result}),y.abrupt("return",p);case 7:case"end":return y.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"getTransactions",value:function(){var e=ae(G().mark(function r(i,s){var o=this,a,c,u,l,h,p;return G().wrap(function(y){for(;;
36)switch(y.prev=y.next){case 0:return a=Mt(s),c=a.commitment,u=a.config,l=i.map(function(w){var k=o._buildArgsAtLeastConfirmed([w],c,void 0,u);return{methodName:"getTransaction",args:k}}),y.next=4,this._rpcBatchRequest(l);case 4:return h=y.sent,p=h.map(function(w){var k=pe(w,ig);if("error"in k)throw new Te(k.error,"failed to get transactions");var T=k.result;return T&&Ce(Ce({},T),{},{transaction:Ce(Ce({},T.transaction),{},{message:rg(T.version,T.transaction.message)})})}),y.abrupt("return",p);case 7:case"end":return y.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"getConfirmedBlock",value:function(){var e=ae(G().mark(function r(i,s){var o,a,c,u,l;return G().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return o=this._buildArgsAtLeastConfirmed([i],s),p.next=3,this._rpcRequest("getConfirmedBlock",o);case 3:if(a=p.sent,c=pe(a,eH),!("error"in c)){p.next=7;break}throw new Te(c.error,"failed to get confirmed block");case 7:if(u=c.result,u){p.next=10;break}throw new Error("Confirmed block "+i+" not found");case 10:return l=Ce(Ce({},u),{},{transactions:u.transactions.map(function(g){var y=g.transaction,w=g.meta,k=new ao(y.message);return{meta:w,transaction:Ce(Ce({},y),{},{message:k})}})}),p.abrupt("return",Ce(Ce({},l),{},{transactions:l.transactions.map(function(g){var y=g.transaction,w=g.meta;return{meta:w,transaction:ot.populate(y.message,y.signatures)}})}));case 12:case"end":return p.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"getBlocks",value:function(){var e=ae(G().mark(function r(i,s,o){var a,c,u;return G().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return a=this._buildArgsAtLeastConfirmed(s!==void 0?[i,s]:[i],o),h.next=3,this._rpcRequest("getBlocks",a);case 3:if(c=h.sent,u=pe(c,je(be(Z()))),!("error"in u)){h.next=7;break}throw new Te(u.error,"failed to get blocks");case 7:return h.abrupt("return",u.result);case 8:case"end":return h.stop()}},r,this)}));function n(r,i,s){return e.apply(this,arguments)}return n}()},{key:"getBlockSignatures",value:function(){var e=ae(G().mark(function r(i,s){var o,a,c,u;return G().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return o=this._buildArgsAtLeastConfirmed([i],s,void 0,{transactionDetails:"signatures",rewards:!1}),h.next=3,this._rpcRequest("getBlock",o);case 3:if(a=h.sent,c=pe(a,$w),!("error"in c)){h.next=7;break}throw new Te(c.error,"failed to get block");case 7:if(u=c.result,u){h.next=10;break}throw new Error("Block "+i+" not found");case 10:return h.abrupt("return",u);case 11:case"end":return h.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"getConfirmedBlockSignatures",value:function(){var e=ae(G().mark(function r(i,s){var o,a,c,u;return G().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return o=this._buildArgsAtLeastConfirmed([i],s,void 0,{transactionDetails:"signatures",rewards:!1}),h.next=3,this._rpcRequest("getConfirmedBlock",o);case 3:if(a=h.sent,c=pe(a,$w),!("error"in c)){h.next=7;break}throw new Te(c.error,"failed to get confirmed block");case 7:if(u=c.result,u){h.next=10;break}throw new Error("Confirmed block "+i+" not found");case 10:return h.abrupt("return",u);case 11:case"end":return h.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"getConfirmedTransaction",value:function(){var e=ae(G().mark(function r(i,s){var o,a,c,u,l,h;return G().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return o=this._buildArgsAtLeastConfirmed([i],s),g.next=3,this._rpcRequest("getConfirmedTransaction",o);case 3:if(a=g.sent,c=pe(a,ig),!("error"in c)){g.next=7;break}throw new Te(c.error,"failed to get transaction");case 7:if(u=c.result,u){g.next=10;break}return g.abrupt("return",u);case 10:return l=new ao(u.transaction.message),h=u.transaction.signatures,g.abrupt("return",Ce(Ce({},u),{},{transaction:ot.populate(l,h)}));case 13:case"end":return g.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"getParsedConfirmedTransaction",value:function(){var e=ae(G().mark(function r(i,s){var o,a,c;return G().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return o=this._buildArgsAtLeastConfirmed([i],s,"jsonParsed"),l.next=3,this._rpcRequest("getConfirmedTransaction",o);case 3:if(a=l.sent,c=pe(a,lf),!("error"in c)){l.next=7;break}throw new Te(c.error,"failed to get confirmed transaction");case 7:return l.abrupt("return",c.result);case 8:case"end":return l.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"getParsedConfirmedTransactions",value:function(){var e=ae(G().mark(function r(i,s){var o=this,a,c,u;return G().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return a=i.map(function(p){var g=o._buildArgsAtLeastConfirmed([p],s,"jsonParsed");return{methodName:"getConfirmedTransaction",args:g}}),h.next=3,this._rpcBatchRequest(a);case 3:return c=h.sent,u=c.map(function(p){var g=pe(p,lf);if("error"in g)throw new Te(g.error,"failed to get confirmed transactions");return g.result}),h.abrupt("return",u);case 6:case"end":return h.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"getConfirmedSignaturesForAddress",value:function(){var e=ae(G().mark(function r(i,s,o){var a,c,u,l,h,p;return G().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return a={},y.next=3,this.getFirstAvailableBlock();case 3:c=y.sent;case 4:if("until"in a){y.next=24;break}if(s--,!(s<=0||s<c)){y.next=8;break}return y.abrupt("break",24);case 8:return y.prev=8,y.next=11,this.getConfirmedBlockSignatures(s,"finalized");case 11:u=y.sent,u.signatures.length>0&&(a.until=u.signatures[u.signatures.length-1].toString()),y.next=22;break;case 15:if(y.prev=15,y.t0=y.catch(8),!(y.t0 instanceof Error&&y.t0.message.includes("skipped"))){y.next=21;break}return y.abrupt("continue",4);case 21:throw y.t0;case 22:y.next=4;break;
36case 24:return y.next=26,this.getSlot("finalized");case 26:l=y.sent;case 27:if("before"in a){y.next=47;break}if(o++,!(o>l)){y.next=31;break}return y.abrupt("break",47);case 31:return y.prev=31,y.next=34,this.getConfirmedBlockSignatures(o);case 34:h=y.sent,h.signatures.length>0&&(a.before=h.signatures[h.signatures.length-1].toString()),y.next=45;break;case 38:if(y.prev=38,y.t1=y.catch(31),!(y.t1 instanceof Error&&y.t1.message.includes("skipped"))){y.next=44;break}return y.abrupt("continue",27);case 44:throw y.t1;case 45:y.next=27;break;case 47:return y.next=49,this.getConfirmedSignaturesForAddress2(i,a);case 49:return p=y.sent,y.abrupt("return",p.map(function(w){return w.signature}));case 51:case"end":return y.stop()}},r,this,[[8,15],[31,38]])}));function n(r,i,s){return e.apply(this,arguments)}return n}()},{key:"getConfirmedSignaturesForAddress2",value:function(){var e=ae(G().mark(function r(i,s,o){var a,c,u;return G().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return a=this._buildArgsAtLeastConfirmed([i.toBase58()],o,void 0,s),h.next=3,this._rpcRequest("getConfirmedSignaturesForAddress2",a);case 3:if(c=h.sent,u=pe(c,Oz),!("error"in u)){h.next=7;break}throw new Te(u.error,"failed to get confirmed signatures for address");case 7:return h.abrupt("return",u.result);case 8:case"end":return h.stop()}},r,this)}));function n(r,i,s){return e.apply(this,arguments)}return n}()},{key:"getSignaturesForAddress",value:function(){var e=ae(G().mark(function r(i,s,o){var a,c,u;return G().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return a=this._buildArgsAtLeastConfirmed([i.toBase58()],o,void 0,s),h.next=3,this._rpcRequest("getSignaturesForAddress",a);case 3:if(c=h.sent,u=pe(c,Iz),!("error"in u)){h.next=7;break}throw new Te(u.error,"failed to get signatures for address");case 7:return h.abrupt("return",u.result);case 8:case"end":return h.stop()}},r,this)}));function n(r,i,s){return e.apply(this,arguments)}return n}()},{key:"getAddressLookupTable",value:function(){var e=ae(G().mark(function r(i,s){var o,a,c,u;return G().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return h.next=2,this.getAccountInfoAndContext(i,s);case 2:return o=h.sent,a=o.context,c=o.value,u=null,c!==null&&(u=new D0({key:i,state:D0.deserialize(c.data)})),h.abrupt("return",{context:a,value:u});case 8:case"end":return h.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"getNonceAndContext",value:function(){var e=ae(G().mark(function r(i,s){var o,a,c,u;return G().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return h.next=2,this.getAccountInfoAndContext(i,s);case 2:return o=h.sent,a=o.context,c=o.value,u=null,c!==null&&(u=_2.fromAccountData(c.data)),h.abrupt("return",{context:a,value:u});case 8:case"end":return h.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"getNonce",value:function(){var e=ae(G().mark(function r(i,s){return G().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.getNonceAndContext(i,s).then(function(c){return c.value}).catch(function(c){throw new Error("failed to get nonce for account "+i.toBase58()+": "+c)});case 2:return a.abrupt("return",a.sent);case 3:case"end":return a.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"requestAirdrop",value:function(){var e=ae(G().mark(function r(i,s){var o,a;return G().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,this._rpcRequest("requestAirdrop",[i.toBase58(),s]);case 2:if(o=u.sent,a=pe(o,aH),!("error"in a)){u.next=6;break}throw new Te(a.error,"airdrop to ".concat(i.toBase58()," failed"));case 6:return u.abrupt("return",a.result);case 7:case"end":return u.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"_blockhashWithExpiryBlockHeight",value:function(){var e=ae(G().mark(function r(i){var s,o;return G().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(i){c.next=10;break}case 1:if(!this._pollingBlockhash){c.next=6;break}return c.next=4,Fo(100);case 4:c.next=1;break;case 6:if(s=Date.now()-this._blockhashInfo.lastFetch,o=s>=A2,!(this._blockhashInfo.latestBlockhash!==null&&!o)){c.next=10;break}return c.abrupt("return",this._blockhashInfo.latestBlockhash);case 10:return c.next=12,this._pollNewBlockhash();case 12:return c.abrupt("return",c.sent);case 13:case"end":return c.stop()}},r,this)}));function n(r){return e.apply(this,arguments)}return n}()},{key:"_pollNewBlockhash",value:function(){var e=ae(G().mark(function r(){var i,s,o,a,c;return G().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:this._pollingBlockhash=!0,l.prev=1,i=Date.now(),s=this._blockhashInfo.latestBlockhash,o=s?s.blockhash:null,a=0;case 6:if(!(a<50)){l.next=18;break}return l.next=9,this.getLatestBlockhash("finalized");case 9:if(c=l.sent,o===c.blockhash){l.next=13;break}return this._blockhashInfo={latestBlockhash:c,lastFetch:Date.now(),transactionSignatures:[],simulatedSignatures:[]},l.abrupt("return",c);case 13:return l.next=15,Fo(v2/2);case 15:a++,l.next=6;break;case 18:throw new Error("Unable to obtain a new blockhash after ".concat(Date.now()-i,"ms"));case 19:return l.prev=19,this._pollingBlockhash=!1,l.finish(19);case 22:case"end":return l.stop()}},r,this,[[1,,19,22]])}));function n(){return e.apply(this,arguments)}return n}()},{key:"getStakeMinimumDelegation",value:function(){var e=ae(G().mark(function r(i){var s,o,a,c,u,l;return G().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return s=Mt(i),o=s.commitment,a=s.config,c=this._buildArgs([],o,"base64",a),p.next=4,this._rpcRequest("getStakeMinimumDelegation",c);case 4:if(u=p.sent,l=pe(u,Ht(Z())),!("error"in l)){p.next=8;break}throw new Te(l.error,"failed to get stake minimum delegation");case 8:return p.abrupt("return",l.result);case 9:case"end":return p.stop()}},r,this)}));function n(r){return e.apply(this,arguments)}return n}()},{key:"simulateTransaction",value:function(){var e=ae(G().mark(function r(i,s,o){var a,c,u,l,h,p,g,y,w,k,T,C,O,I,N,F,L,D,H,z,K,_,m,f,d,v,b;return G().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:if(!("message"in i)){x.next=17;break}if(a=i,c=a.serialize(),u=ne.Buffer.from(c).toString("base64"),!(Array.isArray(s)||o!==void 0)){x.next=6;break}throw new Error("Invalid arguments");case 6:return l=s||{},l.encoding="base64","commitment"in l||(l.commitment=this.commitment),h=[u,l],x.next=12,this._rpcRequest("simulateTransaction",h);case 12:if(p=x.sent,g=pe(p,Bw),!("error"in g)){x.next=16;break}throw new Error("failed to simulate transaction: "+g.error.message);case 16:return x.abrupt("return",g.result);case 17:if(i instanceof ot?(w=i,y=new ot,y.feePayer=w.feePayer,y.instructions=i.instructions,y.nonceInfo=w.nonceInfo,y.signatures=w.signatures):(y=ot.populate(i),y._message=y._json=void 0),!(s!==void 0&&!Array.isArray(s))
36){x.next=20;break}throw new Error("Invalid arguments");case 20:if(k=s,!(y.nonceInfo&&k)){x.next=25;break}(T=y).sign.apply(T,Ut(k)),x.next=45;break;case 25:C=this._disableBlockhashCaching;case 26:return x.next=28,this._blockhashWithExpiryBlockHeight(C);case 28:if(I=x.sent,y.lastValidBlockHeight=I.lastValidBlockHeight,y.recentBlockhash=I.blockhash,k){x.next=33;break}return x.abrupt("break",45);case 33:if((O=y).sign.apply(O,Ut(k)),y.signature){x.next=36;break}throw new Error("!signature");case 36:if(N=y.signature.toString("base64"),!(!this._blockhashInfo.simulatedSignatures.includes(N)&&!this._blockhashInfo.transactionSignatures.includes(N))){x.next=42;break}return this._blockhashInfo.simulatedSignatures.push(N),x.abrupt("break",45);case 42:C=!0;case 43:x.next=26;break;case 45:return F=y._compile(),L=F.serialize(),D=y._serialize(L),H=D.toString("base64"),z={encoding:"base64",commitment:this.commitment},o&&(K=(Array.isArray(o)?o:F.nonProgramIds()).map(function(M){return M.toBase58()}),z.accounts={encoding:"base64",addresses:K}),k&&(z.sigVerify=!0),_=[H,z],x.next=55,this._rpcRequest("simulateTransaction",_);case 55:if(m=x.sent,f=pe(m,Bw),!("error"in f)){x.next=60;break}throw"data"in f.error&&(d=f.error.data.logs,d&&Array.isArray(d)&&(v=` 37 `,b=v+d.join(v),console.error(f.error.message,b))),new mc("failed to simulate transaction: "+f.error.message,d);case 60:return x.abrupt("return",f.result);case 61:case"end":return x.stop()}},r,this)}));function n(r,i,s){return e.apply(this,arguments)}return n}()},{key:"sendTransaction",value:function(){var e=ae(G().mark(function r(i,s,o){var a,c,u,l,h,p;return G().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(!("version"in i)){y.next=7;break}if(!(s&&Array.isArray(s))){y.next=3;break}throw new Error("Invalid arguments");case 3:return a=i.serialize(),y.next=6,this.sendRawTransaction(a,s);case 6:return y.abrupt("return",y.sent);case 7:if(!(s===void 0||!Array.isArray(s))){y.next=9;break}throw new Error("Invalid arguments");case 9:if(c=s,!i.nonceInfo){y.next=14;break}i.sign.apply(i,Ut(c)),y.next=32;break;case 14:u=this._disableBlockhashCaching;case 15:return y.next=17,this._blockhashWithExpiryBlockHeight(u);case 17:if(l=y.sent,i.lastValidBlockHeight=l.lastValidBlockHeight,i.recentBlockhash=l.blockhash,i.sign.apply(i,Ut(c)),i.signature){y.next=23;break}throw new Error("!signature");case 23:if(h=i.signature.toString("base64"),this._blockhashInfo.transactionSignatures.includes(h)){y.next=29;break}return this._blockhashInfo.transactionSignatures.push(h),y.abrupt("break",32);case 29:u=!0;case 30:y.next=15;break;case 32:return p=i.serialize(),y.next=35,this.sendRawTransaction(p,o);case 35:return y.abrupt("return",y.sent);case 36:case"end":return y.stop()}},r,this)}));function n(r,i,s){return e.apply(this,arguments)}return n}()},{key:"sendRawTransaction",value:function(){var e=ae(G().mark(function r(i,s){var o,a;return G().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return o=Ke(i).toString("base64"),u.next=3,this.sendEncodedTransaction(o,s);case 3:return a=u.sent,u.abrupt("return",a);case 5:case"end":return u.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"sendEncodedTransaction",value:function(){var e=ae(G().mark(function r(i,s){var o,a,c,u,l,h,p;return G().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return o={encoding:"base64"},a=s&&s.skipPreflight,c=s&&s.preflightCommitment||this.commitment,s&&s.maxRetries!=null&&(o.maxRetries=s.maxRetries),s&&s.minContextSlot!=null&&(o.minContextSlot=s.minContextSlot),a&&(o.skipPreflight=a),c&&(o.preflightCommitment=c),u=[i,o],y.next=10,this._rpcRequest("sendTransaction",u);case 10:if(l=y.sent,h=pe(l,cH),!("error"in h)){y.next=15;break}throw"data"in h.error&&(p=h.error.data.logs),new mc("failed to send transaction: "+h.error.message,p);case 15:return y.abrupt("return",h.result);case 16:case"end":return y.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"_wsOnOpen",value:function(){var n=this;this._rpcWebSocketConnected=!0,this._rpcWebSocketHeartbeat=setInterval(function(){ae(G().mark(function r(){return G().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.prev=0,s.next=3,n._rpcWebSocket.notify("ping");case 3:s.next=7;break;case 5:s.prev=5,s.t0=s.catch(0);case 7:case"end":return s.stop()}},r,null,[[0,5]])}))()},5e3),this._updateSubscriptions()}},{key:"_wsOnError",value:function(n){this._rpcWebSocketConnected=!1,console.error("ws error:",n.message)}},{key:"_wsOnClose",value:function(n){var r=this;if(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),n===1e3){this._updateSubscriptions();return}this._subscriptionCallbacksByServerSubscriptionId={}
37,Object.entries(this._subscriptionsByHash).forEach(function(i){var s=Ot(i,2),o=s[0],a=s[1];r._setSubscription(o,Ce(Ce({},a),{},{state:"pending"}))})}},{key:"_setSubscription",value:function(n,r){var i,s=(i=this._subscriptionsByHash[n])===null||i===void 0?void 0:i.state;if(this._subscriptionsByHash[n]=r,s!==r.state){var o=this._subscriptionStateChangeCallbacksByHash[n];o&&o.forEach(function(a){try{a(r.state)}catch{}})}}},{key:"_onSubscriptionStateChange",value:function(n,r){var i,s=this,o=this._subscriptionHashByClientSubscriptionId[n];if(o==null)return function(){};var a=(i=this._subscriptionStateChangeCallbacksByHash)[o]||(i[o]=new Set);return a.add(r),function(){a.delete(r),a.size===0&&delete s._subscriptionStateChangeCallbacksByHash[o]}}},{key:"_updateSubscriptions",value:function(){var e=ae(G().mark(function r(){var i=this,s,o;return G().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(Object.keys(this._subscriptionsByHash).length!==0){c.next=3;break}return this._rpcWebSocketConnected&&(this._rpcWebSocketConnected=!1,this._rpcWebSocketIdleTimeout=setTimeout(function(){i._rpcWebSocketIdleTimeout=null;try{i._rpcWebSocket.close()}catch(u){u instanceof Error&&console.log("Error when closing socket connection: ".concat(u.message))}},500)),c.abrupt("return");case 3:if(this._rpcWebSocketIdleTimeout!==null&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketConnected=!0),this._rpcWebSocketConnected){c.next=7;break}return this._rpcWebSocket.connect(),c.abrupt("return");case 7:return s=this._rpcWebSocketGeneration,o=function(){return s===i._rpcWebSocketGeneration},c.next=11,Promise.all(Object.keys(this._subscriptionsByHash).map(function(){var u=ae(G().mark(function l(h){var p;return G().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(p=i._subscriptionsByHash[h],p!==void 0){y.next=3;break}return y.abrupt("return");case 3:y.t0=p.state,y.next=y.t0==="pending"||y.t0==="unsubscribed"?6:y.t0==="subscribed"?15:y.t0==="subscribing"||y.t0==="unsubscribing"?19:20;break;case 6:if(p.callbacks.size!==0){y.next=12;break}return delete i._subscriptionsByHash[h],p.state==="unsubscribed"&&delete i._subscriptionCallbacksByServerSubscriptionId[p.serverSubscriptionId],y.next=11,i._updateSubscriptions();case 11:return y.abrupt("return");case 12:return y.next=14,ae(G().mark(function w(){var k,T,C;return G().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return k=p.args,T=p.method,I.prev=1,i._setSubscription(h,Ce(Ce({},p),{},{state:"subscribing"})),I.next=5,i._rpcWebSocket.call(T,k);case 5:return C=I.sent,i._setSubscription(h,Ce(Ce({},p),{},{serverSubscriptionId:C,state:"subscribed"})),i._subscriptionCallbacksByServerSubscriptionId[C]=p.callbacks,I.next=10,i._updateSubscriptions();case 10:I.next=20;break;case 12:if(I.prev=12,I.t0=I.catch(1),I.t0 instanceof Error&&console.error("".concat(T," error for argument"),k,I.t0.message),o()){I.next=17;break}return I.abrupt("return");case 17:return i._setSubscription(h,Ce(Ce({},p),{},{state:"pending"})),I.next=20,i._updateSubscriptions();case 20:case"end":return I.stop()}},w,null,[[1,12]])}))();case 14:return y.abrupt("break",20);case 15:if(p.callbacks.size!==0){y.next=18;break}return y.next=18,ae(G().mark(function w(){var k,T;return G().wrap(function(O){for(;;)switch(O.prev=O.next){case 0:if(k=p.serverSubscriptionId,T=p.unsubscribeMethod,!i._subscriptionsAutoDisposedByRpc.has(k)){O.next=5;break}i._subscriptionsAutoDisposedByRpc.delete(k),O.next=21;break;case 5:return i._setSubscription(h,Ce(Ce({},p),{},{state:"unsubscribing"})),i._setSubscription(h,Ce(Ce({},p),{},{state:"unsubscribing"})),O.prev=7,O.next=10,i._rpcWebSocket.call(T,[k]);case 10:O.next=21;break;case 12:if(O.prev=12,O.t0=O.catch(7),O.t0 instanceof Error&&console.error("".concat(T," error:"),O.t0.message),o()){O.next=17;break}return O.abrupt("return");case 17:return i._setSubscription(h,Ce(Ce({},p),{},{state:"subscribed"})),O.next=20,i._updateSubscriptions();case 20:return O.abrupt("return");case 21:return i._setSubscription(h,Ce(Ce({},p),{},{state:"unsubscribed"})),O.next=24,i._updateSubscriptions();case 24:case"end":return O.stop()}},w,null,[[7,12]])}))();case 18:return y.abrupt("break",20);case 19:return y.abrupt("break",20);case 20:case"end":return y.stop()}},l)}));return function(l){return u.apply(this,arguments)}}()));case 11:case"end":return c.stop()}},r,this)}));function n(){return e.apply(this,arguments)}return n}()},{key:"_handleServerNotification",value:function(n,r){var i=this._subscriptionCallbacksByServerSubscriptionId[n];
37i!==void 0&&i.forEach(function(s){try{s.apply(void 0,Ut(r))}catch(o){console.error(o)}})}},{key:"_wsOnAccountNotification",value:function(n){var r=pe(n,Cz),i=r.result,s=r.subscription;this._handleServerNotification(s,[i.value,i.context])}},{key:"_makeSubscription",value:function(n,r){var i=this,s=this._nextClientSubscriptionId++,o=Nw([n.method,r],!0),a=this._subscriptionsByHash[o];return a===void 0?this._subscriptionsByHash[o]=Ce(Ce({},n),{},{args:r,callbacks:new Set([n.callback]),state:"pending"}):a.callbacks.add(n.callback),this._subscriptionHashByClientSubscriptionId[s]=o,this._subscriptionDisposeFunctionsByClientSubscriptionId[s]=ae(G().mark(function c(){var u;return G().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return delete i._subscriptionDisposeFunctionsByClientSubscriptionId[s],delete i._subscriptionHashByClientSubscriptionId[s],u=i._subscriptionsByHash[o],at(u!==void 0,"Could not find a `Subscription` when tearing down client subscription #".concat(s)),u.callbacks.delete(n.callback),h.next=7,i._updateSubscriptions();case 7:case"end":return h.stop()}},c)})),this._updateSubscriptions(),s}},{key:"onAccountChange",value:function(n,r,i){var s=this._buildArgs([n.toBase58()],i||this._commitment||"finalized","base64");return this._makeSubscription({callback:r,method:"accountSubscribe",unsubscribeMethod:"accountUnsubscribe"},s)}},{key:"removeAccountChangeListener",value:function(){var e=ae(G().mark(function r(i){return G().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this._unsubscribeClientSubscription(i,"account change");case 2:case"end":return o.stop()}},r,this)}));function n(r){return e.apply(this,arguments)}return n}()},{key:"_wsOnProgramAccountNotification",value:function(n){var r=pe(n,Pz),i=r.result,s=r.subscription;this._handleServerNotification(s,[{accountId:i.value.pubkey,accountInfo:i.value.account},i.context])}},{key:"onProgramAccountChange",value:function(n,r,i,s){var o=this._buildArgs([n.toBase58()],i||this._commitment||"finalized","base64",s?{filters:s}:void 0);return this._makeSubscription({callback:r,method:"programSubscribe",unsubscribeMethod:"programUnsubscribe"},o)}},{key:"removeProgramAccountChangeListener",value:function(){var e=ae(G().mark(function r(i){return G().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this._unsubscribeClientSubscription(i,"program account change");case 2:case"end":return o.stop()}},r,this)}));function n(r){return e.apply(this,arguments)}return n}()},{key:"onLogs",value:function(n,r,i){var s=this._buildArgs([lr(n)==="object"?{mentions:[n.toString()]}:n],i||this._commitment||"finalized");return this._makeSubscription({callback:r,method:"logsSubscribe",unsubscribeMethod:"logsUnsubscribe"},s)}},{key:"removeOnLogsListener",value:function(){var e=ae(G().mark(function r(i){return G().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this._unsubscribeClientSubscription(i,"logs");case 2:case"end":return o.stop()}},r,this)}));function n(r){return e.apply(this,arguments)}return n}()},{key:"_wsOnLogsNotification",value:function(n){var r=pe(n,lH),i=r.result,s=r.subscription;this._handleServerNotification(s,[i.value,i.context])}},{key:"_wsOnSlotNotification",value:function(n){var r=pe(n,Lz),i=r.result,s=r.subscription;this._handleServerNotification(s,[i])}},{key:"onSlotChange",value:function(n){return this._makeSubscription({callback:n,method:"slotSubscribe",unsubscribeMethod:"slotUnsubscribe"},[])}},{key:"removeSlotChangeListener",value:function(){var e=ae(G().mark(function r(i){return G().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this._unsubscribeClientSubscription(i,"slot change");case 2:case"end":return o.stop()}},r,this)}));function n(r){return e.apply(this,arguments)}return n}()},{key:"_wsOnSlotUpdatesNotification",value:function(n){var r=pe(n,Dz),i=r.result,s=r.subscription;this._handleServerNotification(s,[i])}},{key:"onSlotUpdate",value:function(n){return this._makeSubscription({callback:n,method:"slotsUpdatesSubscribe",unsubscribeMethod:"slotsUpdatesUnsubscribe"},[])}},{key:"removeSlotUpdateListener",value:function(){var e=ae(G().mark(function r(i){return G().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this._unsubscribeClientSubscription(i,"slot update");case 2:case"end":return o.stop()}},r,this)}));function n(r){return e.apply(this,arguments)}return n}()},{key:"_unsubscribeClientSubscription",value:function(){var e=ae(G().mark(function r(i,s){var o;return G().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(o=this._subscriptionDisposeFunctionsByClientSubscriptionId[i],!o){c.next=6;break}return c.next=4,o();case 4:c.next=7;break;case 6:console.warn("Ignored unsubscribe request because an active subscription with id "+"`".concat(i,"` for '").concat(s,"' events ")+"could not be found.");case 7:case"end":return c.stop()}},r,this)}));function n(r,i){return e.apply(this,arguments)}return n}()},{key:"_buildArgs",value:function(n,r,i,s){var o=r||this._commitment;if(o||i||s){var a={};i&&(a.encoding=i),o&&(a.commitment=o),s&&(a=Object.assign(a,s)),n.push(a)}return n}},{key:"_buildArgsAtLeastConfirmed",value:function(n,r,i,s){var o=r||this._commitment;if(o&&!["confirmed","finalized"].includes(o))throw new Error("Using Connection with default commitment: `"+this._commitment+"`, but method requires at least `confirmed`");return this._buildArgs(n,r,i,s)}},{key:"_wsOnSignatureNotification",value:function(n){var r=pe(n,$z),i=r.result,s=r.subscription;i.value!=="receivedSignature"&&this._subscriptionsAutoDisposedByRpc.add(s),this._handleServerNotification(s,i.value==="receivedSignature"?[{type:"received"},i.context]:[{type:"status",result:i.value},i.context])}},{key:"onSignature",value:function(n,r,i){var s=this,o=this._buildArgs([n],i||this._commitment||"finalized"),a=this._makeSubscription({callback:function(u,l){if(u.type==="status"){r(u.result,l);
37try{s.removeSignatureListener(a)}catch{}}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},o);return a}},{key:"onSignatureWithOptions",value:function(n,r,i){var s=this,o=Ce(Ce({},i),{},{commitment:i&&i.commitment||this._commitment||"finalized"}),a=o.commitment,c=Df(o,ZU),u=this._buildArgs([n],a,void 0,c),l=this._makeSubscription({callback:function(p,g){r(p,g);try{s.removeSignatureListener(l)}catch{}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},u);return l}},{key:"removeSignatureListener",value:function(){var e=ae(G().mark(function r(i){return G().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this._unsubscribeClientSubscription(i,"signature result");case 2:case"end":return o.stop()}},r,this)}));function n(r){return e.apply(this,arguments)}return n}()},{key:"_wsOnRootNotification",value:function(n){var r=pe(n,Fz),i=r.result,s=r.subscription;this._handleServerNotification(s,[i])}},{key:"onRootChange",value:function(n){return this._makeSubscription({callback:n,method:"rootSubscribe",unsubscribeMethod:"rootUnsubscribe"},[])}},{key:"removeRootChangeListener",value:function(){var e=ae(G().mark(function r(i){return G().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this._unsubscribeClientSubscription(i,"root change");case 2:case"end":return o.stop()}},r,this)}));function n(r){return e.apply(this,arguments)}return n}()}]),t}(),B2=function(){function t(e){Ue(this,t),this._keypair=void 0,this._keypair=e??ww()}return ze(t,[{key:"publicKey",get:function(){return new ue(this._keypair.publicKey)}},{key:"secretKey",get:function(){return new Uint8Array(this._keypair.secretKey)}}],[{key:"generate",value:function(){return new t(ww())}},{key:"fromSecretKey",value:function(n,r){if(n.byteLength!==64)throw new Error("bad secret key size");var i=n.slice(32,64);if(!r||!r.skipValidation){for(var s=n.slice(0,32),o=Eh(s),a=0;a<32;a++)if(i[a]!==o[a])throw new Error("provided secretKey is invalid")}return new t({publicKey:i,secretKey:n})}},{key:"fromSeed",value:function(n){var r=Eh(n),i=new Uint8Array(64);return i.set(n),i.set(r,32),new t({publicKey:r,secretKey:i})}}]),t}(),ss=Object.freeze({CreateLookupTable:{index:0,layout:Ae([Se("instruction"),gc("recentSlot"),Ge("bumpSeed")])},FreezeLookupTable:{index:1,layout:Ae([Se("instruction")])},ExtendLookupTable:{index:2,layout:Ae([Se("instruction"),gc(),Dn(Ze(),Gs(Se(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:Ae([Se("instruction")])},CloseLookupTable:{index:4,layout:Ae([Se("instruction")])}}),hH=function(){function t(){Ue(this,t)}return ze(t,null,[{key:"decodeInstructionType",value:function(n){this.checkProgramId(n.programId);for(var r=Se("instruction"),i=r.decode(n.data),s,o=0,a=Object.entries(ss);o<a.length;o++){var c=Ot(a[o],2),u=c[0],l=c[1];if(l.index==i){s=u;break}}if(!s)throw new Error("Invalid Instruction. Should be a LookupTable Instruction");return s}},{key:"decodeCreateLookupTable",value:function(n){this.checkProgramId(n.programId),this.checkKeysLength(n.keys,4);var r=dt(ss.CreateLookupTable,n.data),i=r.recentSlot;return{authority:n.keys[1].pubkey,payer:n.keys[2].pubkey,recentSlot:Number(i)}}},{key:"decodeExtendLookupTable",value:function(n){if(this.checkProgramId(n.programId),n.keys.length<2)throw new Error("invalid instruction; found ".concat(n.keys.length," keys, expected at least 2"));var r=dt(ss.ExtendLookupTable,n.data),i=r.addresses;return{lookupTable:n.keys[0].pubkey,authority:n.keys[1].pubkey,payer:n.keys.length>2?n.keys[2].pubkey:void 0,addresses:i.map(function(s){return new ue(s)})}}},{key:"decodeCloseLookupTable",value:function(n){return this.checkProgramId(n.programId),this.checkKeysLength(n.keys,3),{lookupTable:n.keys[0].pubkey,authority:n.keys[1].pubkey,recipient:n.keys[2].pubkey}}},{key:"decodeFreezeLookupTable",value:function(n){return this.checkProgramId(n.programId),this.checkKeysLength(n.keys,2),{lookupTable:n.keys[0].pubkey,authority:n.keys[1].pubkey}}},{key:"decodeDeactivateLookupTable",value:function(n){return this.checkProgramId(n.programId),this.checkKeysLength(n.keys,2),{lookupTable:n.keys[0].pubkey,authority:n.keys[1].pubkey}}},{key:"checkProgramId",value:function(n){if(!n.equals(n1.programId))throw new Error("invalid instruction; programId is not AddressLookupTable Program")}},{key:"checkKeysLength",value:function(n,r){if(n.length<r)throw new Error("invalid instruction; found ".concat(n.length," keys, expected at least ").concat(r))}}]),t}(),n1=function(){function t(){Ue(this,t)}return ze(t,null,[{key:"createLookupTable",value:function(n){var r=ue.findProgramAddressSync([n.authority.toBuffer(),Wy(BigInt(n.recentSlot),8)],this.programId),i=Ot(r,2),s=i[0],o=i[1],a=ss.CreateLookupTable,c=st(a,{recentSlot:BigInt(n.recentSlot),bumpSeed:o}),u=[{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:n.authority,isSigner:!0,isWritable:!1},{pubkey:n.payer,isSigner:!0,isWritable:!0},{pubkey:Zn.programId,isSigner:!1,isWritable:!1}];return[new vt({programId:this.programId,keys:u,data:c}),s]}},{key:"freezeLookupTable",value:function(n){var r=ss.FreezeLookupTable,i=st(r),s=[{pubkey:n.lookupTable,isSigner:!1,isWritable:!0},{pubkey:n.authority,isSigner:!0,isWritable:!1}];return new vt({programId:this.programId,keys:s,data:i})}},{key:"extendLookupTable",value:function(n){var r=ss.ExtendLookupTable,i=st(r,{addresses:n.addresses.map(function(o){return o.toBytes()})}),s=[{pubkey:n.lookupTable,isSigner:!1,isWritable:!0},{pubkey:n.authority,isSigner:!0,isWritable:!1}];return n.payer&&s.push({pubkey:n.payer,isSigner:!0,isWritable:!0},{pubkey:Zn.programId,isSigner:!1,isWritable:!1}),new vt({programId:this.programId,keys:s,data:i})}},{key:"deactivateLookupTable",value:function(n){var r=ss.DeactivateLookupTable,i=st(r),s=[{pubkey:n.lookupTable,isSigner:!1,isWritable:!0},{pubkey:n.authority,isSigner:!0,isWritable:!1}];return new vt({programId:this.programId,keys:s,data:i})}},{key:"closeLookupTable",value:function(n){var r=ss.CloseLookupTable,i=st(r),s=[{pubkey:n.lookupTable,isSigner:!1,isWritable:!0},{pubkey:n.authority,isSigner:!0,isWritable:!1},{pubkey:n.recipient,isSigner:!1,isWritable:!0}];return new vt({programId:this.programId,keys:s,data:i})}}]),t}();n1.programId=new ue("AddressLookupTab1e1111111111111111111111111");var dH=function(){function t(){Ue(this,t)}return ze(t,null,[{key:"decodeInstructionType",value:function(n){this.checkProgramId(n.programId);for(var r=Ge("instruction"),i=r.decode(n.data),s,o=0,a=Object.entries(Ai);o<a.length;o++){var c=Ot(a[o],2),u=c[0],l=c[1];if(l.index==i){s=u;break}}if(!s)throw new Error("Instruction type incorrect; not a ComputeBudgetInstruction");return s}},{key:"decodeRequestUnits",value:function(n){this.checkProgramId(n.programId);var r=dt(Ai.RequestUnits,n.data),i=r.units,s=r.additionalFee;return{units:i,additionalFee:s}}},{key:"decodeRequestHeapFrame",value:function(n){this.checkProgramId(n.programId);var r=dt(Ai.RequestHeapFrame,n.data),i=r.bytes;return{bytes:i}}},{key:"decodeSetComputeUnitLimit",value:function(n){this.checkProgramId(n.programId);var r=dt(Ai.SetComputeUnitLimit,n.data),i=r.units;return{units:i}}},{key:"decodeSetComputeUnitPrice",value:function(n){this.checkProgramId(n.programId);var r=dt(Ai.SetComputeUnitPrice,n.data),i=r.microLamports;return{microLamports:i}}},{key:"checkProgramId",value:function(n){if(!n.equals(r1.programId))throw new Error("invalid instruction; programId is not ComputeBudgetProgram")}}]),t}(),Ai=Object.freeze({RequestUnits:{index:0,layout:Ae([Ge("instruction"),Se("units"),Se("additionalFee")])},RequestHeapFrame:{index:1,layout:Ae([Ge("instruction"),Se("bytes")])},SetComputeUnitLimit:{index:2,layout:Ae([Ge("instruction"),Se("units")])},SetComputeUnitPrice:{index:3,layout:Ae([Ge("instruction"),gc("microLamports")])}}),r1=function(){function t(){Ue(this,t)}return ze(t,null,[{key:"requestUnits",value:function(n){var r=Ai.RequestUnits,i=st(r,n);return new vt({keys:[],programId:this.programId,data:i})}},{key:"requestHeapFrame",value:function(n){var r=Ai.RequestHeapFrame,i=st(r,n);return new vt({keys:[],programId:this.programId,data:i})}},{key:"setComputeUnitLimit",value:function(n){var r=Ai.SetComputeUnitLimit,i=st(r,n);return new vt({keys:[],programId:this.programId,data:i})}},{key:"setComputeUnitPrice",value:function(n){var r=Ai.SetComputeUnitPrice,i=st(r,{microLamports:BigInt(n.microLamports)});return new vt({keys:[],programId:this.programId,data:i})}}]),t}();r1.programId=new ue("ComputeBudget111111111111111111111111111111");var Fw=64,Uw=32,zw=64,Hw=Ae([Ge("numSignatures"),Ge("padding"),Br("signatureOffset"),Br("signatureInstructionIndex"),Br("publicKeyOffset"),Br("publicKeyInstructionIndex"),Br("messageDataOffset"),Br("messageDataSize"),Br("messageInstructionIndex")]
37),D2=function(){function t(){Ue(this,t)}return ze(t,null,[{key:"createInstructionWithPublicKey",value:function(n){var r=n.publicKey,i=n.message,s=n.signature,o=n.instructionIndex;at(r.length===Uw,"Public Key must be ".concat(Uw," bytes but received ").concat(r.length," bytes")),at(s.length===zw,"Signature must be ".concat(zw," bytes but received ").concat(s.length," bytes"));var a=Hw.span,c=a+r.length,u=c+s.length,l=1,h=ne.Buffer.alloc(u+i.length),p=o??65535;return Hw.encode({numSignatures:l,padding:0,signatureOffset:c,signatureInstructionIndex:p,publicKeyOffset:a,publicKeyInstructionIndex:p,messageDataOffset:u,messageDataSize:i.length,messageInstructionIndex:p},h),h.fill(r,a),h.fill(s,c),h.fill(i,u),new vt({keys:[],programId:t.programId,data:h})}},{key:"createInstructionWithPrivateKey",value:function(n){var r=n.privateKey,i=n.message,s=n.instructionIndex;at(r.length===Fw,"Private key must be ".concat(Fw," bytes but received ").concat(r.length," bytes"));try{var o=B2.fromSecretKey(r),a=o.publicKey.toBytes(),c=Gy(i,o.secretKey);return this.createInstructionWithPublicKey({publicKey:a,message:i,signature:c,instructionIndex:s})}catch(u){throw new Error("Error creating instruction; ".concat(u))}}}]),t}();D2.programId=new ue("Ed25519SigVerify111111111111111111111111111");var pH=function(e,n){var r=Td.sign(e,n);return[r.toCompactRawBytes(),r.recovery]};Td.utils.isValidPrivateKey;var gH=Td.getPublicKey,Ww=32,sg=20,jw=64,mH=11,og=Ae([Ge("numSignatures"),Br("signatureOffset"),Ge("signatureInstructionIndex"),Br("ethAddressOffset"),Ge("ethAddressInstructionIndex"),Br("messageDataOffset"),Br("messageDataSize"),Ge("messageInstructionIndex"),kt(20,"ethAddress"),kt(64,"signature"),Ge("recoveryId")]),$2=function(){function t(){Ue(this,t)}return ze(t,null,[{key:"publicKeyToEthAddress",value:function(n){at(n.length===jw,"Public key must be ".concat(jw," bytes but received ").concat(n.length," bytes"));try{return ne.Buffer.from(mw(Ke(n))).slice(-sg)}catch(r){throw new Error("Error constructing Ethereum address: ".concat(r))}}},{key:"createInstructionWithPublicKey",value:function(n){var r=n.publicKey,i=n.message,s=n.signature,o=n.recoveryId,a=n.instructionIndex;return t.createInstructionWithEthAddress({ethAddress:t.publicKeyToEthAddress(r),message:i,signature:s,recoveryId:o,instructionIndex:a})}},{key:"createInstructionWithEthAddress",value:function(n){var r=n.ethAddress,i=n.message,s=n.signature,o=n.recoveryId,a=n.instructionIndex,c=a===void 0?0:a,u;typeof r=="string"?r.startsWith("0x")?u=ne.Buffer.from(r.substr(2),"hex"):u=ne.Buffer.from(r,"hex"):u=r,at(u.length===sg,"Address must be ".concat(sg," bytes but received ").concat(u.length," bytes"));var l=1+mH,h=l,p=l+u.length,g=p+s.length+1,y=1,w=ne.Buffer.alloc(og.span+i.length);return og.encode({numSignatures:y,signatureOffset:p,signatureInstructionIndex:c,ethAddressOffset:h,ethAddressInstructionIndex:c,messageDataOffset:g,messageDataSize:i.length,messageInstructionIndex:c,signature:Ke(s),ethAddress:Ke(u),recoveryId:o},w),w.fill(Ke(i),og.span),new vt({keys:[],programId:t.programId,data:w})}},{key:"createInstructionWithPrivateKey",value:function(n){var r=n.privateKey,i=n.message,s=n.instructionIndex;at(r.length===Ww,"Private key must be ".concat(Ww," bytes but received ").concat(r.length," bytes"));try{var o=Ke(r),a=gH(o,!1).slice(1),c=ne.Buffer.from(mw(Ke(i))),u=pH(c,o),l=Ot(u,2),h=l[0],p=l[1];return this.createInstructionWithPublicKey({publicKey:a,message:i,signature:h,recoveryId:p,instructionIndex:s})}catch(g){throw new Error("Error creating instruction; ".concat(g))}}}]),t}();$2.programId=new ue("KeccakSecp256k11111111111111111111111111111");var F2=new ue("StakeConfig11111111111111111111111111111111"),U2=ze(function t(e,n){Ue(this,t),this.staker=void 0,this.withdrawer=void 0,this.staker=e,this.withdrawer=n}),Ju=ze(function t(e,n,r){Ue(this,t),this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=e,this.epoch=n,this.custodian=r});Ju.default=new Ju(0,0,ue.default);var yH=function(){function t(){Ue(this,t)}return ze(t,null,[{key:"decodeInstructionType",value:function(n){this.checkProgramId(n.programId);for(var r=Se("instruction"),i=r.decode(n.data),s,o=0,a=Object.entries(En);o<a.length;o++){var c=Ot(a[o],2),u=c[0],l=c[1];if(l.index==i){s=u;break}}if(!s)throw new Error("Instruction type incorrect;
37 not a StakeInstruction");return s}},{key:"decodeInitialize",value:function(n){this.checkProgramId(n.programId),this.checkKeyLength(n.keys,2);var r=dt(En.Initialize,n.data),i=r.authorized,s=r.lockup;return{stakePubkey:n.keys[0].pubkey,authorized:new U2(new ue(i.staker),new ue(i.withdrawer)),lockup:new Ju(s.unixTimestamp,s.epoch,new ue(s.custodian))}}},{key:"decodeDelegate",value:function(n){return this.checkProgramId(n.programId),this.checkKeyLength(n.keys,6),dt(En.Delegate,n.data),{stakePubkey:n.keys[0].pubkey,votePubkey:n.keys[1].pubkey,authorizedPubkey:n.keys[5].pubkey}}},{key:"decodeAuthorize",value:function(n){this.checkProgramId(n.programId),this.checkKeyLength(n.keys,3);var r=dt(En.Authorize,n.data),i=r.newAuthorized,s=r.stakeAuthorizationType,o={stakePubkey:n.keys[0].pubkey,authorizedPubkey:n.keys[2].pubkey,newAuthorizedPubkey:new ue(i),stakeAuthorizationType:{index:s}};return n.keys.length>3&&(o.custodianPubkey=n.keys[3].pubkey),o}},{key:"decodeAuthorizeWithSeed",value:function(n){this.checkProgramId(n.programId),this.checkKeyLength(n.keys,2);var r=dt(En.AuthorizeWithSeed,n.data),i=r.newAuthorized,s=r.stakeAuthorizationType,o=r.authoritySeed,a=r.authorityOwner,c={stakePubkey:n.keys[0].pubkey,authorityBase:n.keys[1].pubkey,authoritySeed:o,authorityOwner:new ue(a),newAuthorizedPubkey:new ue(i),stakeAuthorizationType:{index:s}};return n.keys.length>3&&(c.custodianPubkey=n.keys[3].pubkey),c}},{key:"decodeSplit",value:function(n){this.checkProgramId(n.programId),this.checkKeyLength(n.keys,3);var r=dt(En.Split,n.data),i=r.lamports;return{stakePubkey:n.keys[0].pubkey,splitStakePubkey:n.keys[1].pubkey,authorizedPubkey:n.keys[2].pubkey,lamports:i}}},{key:"decodeMerge",value:function(n){return this.checkProgramId(n.programId),this.checkKeyLength(n.keys,3),dt(En.Merge,n.data),{stakePubkey:n.keys[0].pubkey,sourceStakePubKey:n.keys[1].pubkey,authorizedPubkey:n.keys[4].pubkey}}},{key:"decodeWithdraw",value:function(n){this.checkProgramId(n.programId),this.checkKeyLength(n.keys,5);var r=dt(En.Withdraw,n.data),i=r.lamports,s={stakePubkey:n.keys[0].pubkey,toPubkey:n.keys[1].pubkey,authorizedPubkey:n.keys[4].pubkey,lamports:i};return n.keys.length>5&&(s.custodianPubkey=n.keys[5].pubkey),s}},{key:"decodeDeactivate",value:function(n){return this.checkProgramId(n.programId),this.checkKeyLength(n.keys,3),dt(En.Deactivate,n.data),{stakePubkey:n.keys[0].pubkey,authorizedPubkey:n.keys[2].pubkey}}},{key:"checkProgramId",value:function(n){if(!n.equals(Md.programId))throw new Error("invalid instruction; programId is not StakeProgram")}},{key:"checkKeyLength",value:function(n,r){if(n.length<r)throw new Error("invalid instruction; found ".concat(n.length," keys, expected at least ").concat(r))}}]),t}(),En=Object.freeze({Initialize:{index:0,layout:Ae([Se("instruction"),iU(),sU()])},Authorize:{index:1,layout:Ae([Se("instruction"),Ze("newAuthorized"),Se("stakeAuthorizationType")])},Delegate:{index:2,layout:Ae([Se("instruction")])},Split:{index:3,layout:Ae([Se("instruction"),wr("lamports")])},Withdraw:{index:4,layout:Ae([Se("instruction"),wr("lamports")])},Deactivate:{index:5,layout:Ae([Se("instruction")])},Merge:{index:7,layout:Ae([Se("instruction")])},AuthorizeWithSeed:{index:8,layout:Ae([Se("instruction"),Ze("newAuthorized"),Se("stakeAuthorizationType"),Vo("authoritySeed"),Ze("authorityOwner")])}}),vH=Object.freeze({Staker:{index:0},Withdrawer:{index:1}}),Md=function(){function t(){Ue(this,t)}return ze(t,null,[{key:"initialize",value:function(n){var r=n.stakePubkey,i=n.authorized,s=n.lockup,o=s||Ju.default,a=En.Initialize,c=st(a,{authorized:{staker:Ke(i.staker.toBuffer()),withdrawer:Ke(i.withdrawer.toBuffer())},lockup:{unixTimestamp:o.unixTimestamp,epoch:o.epoch,custodian:Ke(o.custodian.toBuffer())}}),u={keys:[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:pc,isSigner:!1,isWritable:!1}],programId:this.programId,data:c};return new vt(u)}},{key:"createAccountWithSeed",value:function(n){var r=new ot;r.add(Zn.createAccountWithSeed({fromPubkey:n.fromPubkey,newAccountPubkey:n.stakePubkey,basePubkey:n.basePubkey,seed:n.seed,lamports:n.lamports,space:this.space,programId:this.programId}));var i=n.stakePubkey,s=n.authorized,o=n.lockup;return r.add(this.initialize({stakePubkey:i,authorized:s,lockup:o}))}},{key:"createAccount",value:function(n){var r=new ot;r.add(Zn.createAccount({fromPubkey:n.fromPubkey,newAccountPubkey:n.stakePubkey,lamports:n.lamports,space:this.space,programId:this.programId}));var i=n.stakePubkey,s=n.authorized,o=n.lockup;return r.add(this.initialize({stakePubkey:i,authorized:s,lockup:o}))}},{key:"delegate",value:function(n){var r=n.stakePubkey,i=n.authorizedPubkey,s=n.votePubkey,o=En.Delegate,a=st(o);return new ot().add({keys:[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:s,isSigner:!1,isWritable:!1},{pubkey:_i,isSigner:!1,isWritable:!1},{pubkey:Uf,isSigner:!1,isWritable:!1},{pubkey:F2,isSigner:!1,isWritable:!1},{pubkey:i,isSigner:!0,isWritable:!1}],programId:this.programId,data:a})}},{key:"authorize",value:function(n){var r=n.stakePubkey,i=n.authorizedPubkey,s=n.newAuthorizedPubkey,o=n.stakeAuthorizationType,a=n.custodianPubkey,c=En.Authorize,u=st(c,{newAuthorized:Ke(s.toBuffer()),stakeAuthorizationType:o.index}),l=[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:_i,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!0,isWritable:!1}];return a&&l.push({pubkey:a,isSigner:!1,isWritable:!1}),new ot().add({keys:l,programId:this.programId,data:u})}},{key:"authorizeWithSeed",value:function(n){var r=n.stakePubkey,i=n.authorityBase,s=n.authoritySeed,o=n.authorityOwner,a=n.newAuthorizedPubkey,c=n.stakeAuthorizationType,u=n.custodianPubkey,l=En.AuthorizeWithSeed,h=st(l,{newAuthorized:Ke(a.toBuffer()),stakeAuthorizationType:c.index,authoritySeed:s,authorityOwner:Ke(o.toBuffer())}),p=[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!0,isWritable:!1},{pubkey:_i,isSigner:!1,isWritable:!1}];return u&&p.push({pubkey:u,isSigner:!1,isWritable:!1}),new ot().add({keys:p,programId:this.programId,data:h})}},{key:"splitInstruction",value:function(n){var r=n.stakePubkey,i=n.authorizedPubkey,s=n.splitStakePubkey,o=n.lamports,a=En.Split,c=st(a,{lamports:o});return new vt({keys:[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!0,isWritable:!1}],programId:this.programId,data:c})}},{key:"split",value:function(n){var r=new ot;return r.add(Zn.createAccount({fromPubkey:n.authorizedPubkey,newAccountPubkey:n.splitStakePubkey,lamports:0,space:this.space,programId:this.programId})),r.add(this.splitInstruction(n))}},{key:"splitWithSeed",value:function(n){var r=n.stakePubkey,i=n.authorizedPubkey,s=n.splitStakePubkey,o=n.basePubkey,a=n.seed,c=n.lamports,u=new ot;return u.add(Zn.allocate({accountPubkey:s,basePubkey:o,seed:a,space:this.space,programId:this.programId})),u.add(this.splitInstruction({stakePubkey:r,authorizedPubkey:i,splitStakePubkey:s,lamports:c}))}},{key:"merge",value:function(n){var r=n.stakePubkey,i=n.sourceStakePubKey,s=n.authorizedPubkey,o=En.Merge,a=st(o);return new ot().add({keys:[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:_i,isSigner:!1,isWritable:!1},{pubkey:Uf,isSigner:!1,isWritable:!1},{pubkey:s,isSigner:!0,isWritable:!1}],programId:this.programId,data:a})}},{key:"withdraw",value:function(n){var r=n.stakePubkey,i=n.authorizedPubkey,s=n.toPubkey,o=n.lamports,a=n.custodianPubkey,c=En.Withdraw,u=st(c,{lamports:o}),l=[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:_i,isSigner:!1,isWritable:!1},{pubkey:Uf,isSigner:!1,isWritable:!1},{pubkey:i,isSigner:!0,isWritable:!1}];return a&&l.push({pubkey:a,isSigner:!1,isWritable:!1}),new ot().add({keys:l,programId:this.programId,data:u})}},{key:"deactivate",value:function(n){var r=n.stakePubkey,i=n.authorizedPubkey,s=En.Deactivate,o=st(s);return new ot().add({keys:[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:_i,isSigner:!1,isWritable:!1},{pubkey:i,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}}]),t}();Md.programId=new ue("Stake11111111111111111111111111111111111111");
37Md.space=200;var z2=ze(function t(e,n,r,i){Ue(this,t),this.nodePubkey=void 0,this.authorizedVoter=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.nodePubkey=e,this.authorizedVoter=n,this.authorizedWithdrawer=r,this.commission=i}),bH=function(){function t(){Ue(this,t)}return ze(t,null,[{key:"decodeInstructionType",value:function(n){this.checkProgramId(n.programId);for(var r=Se("instruction"),i=r.decode(n.data),s,o=0,a=Object.entries(os);o<a.length;o++){var c=Ot(a[o],2),u=c[0],l=c[1];if(l.index==i){s=u;break}}if(!s)throw new Error("Instruction type incorrect; not a VoteInstruction");return s}},{key:"decodeInitializeAccount",value:function(n){this.checkProgramId(n.programId),this.checkKeyLength(n.keys,4);var r=dt(os.InitializeAccount,n.data),i=r.voteInit;return{votePubkey:n.keys[0].pubkey,nodePubkey:n.keys[3].pubkey,voteInit:new z2(new ue(i.nodePubkey),new ue(i.authorizedVoter),new ue(i.authorizedWithdrawer),i.commission)}}},{key:"decodeAuthorize",value:function(n){this.checkProgramId(n.programId),this.checkKeyLength(n.keys,3);var r=dt(os.Authorize,n.data),i=r.newAuthorized,s=r.voteAuthorizationType;return{votePubkey:n.keys[0].pubkey,authorizedPubkey:n.keys[2].pubkey,newAuthorizedPubkey:new ue(i),voteAuthorizationType:{index:s}}}},{key:"decodeAuthorizeWithSeed",value:function(n){this.checkProgramId(n.programId),this.checkKeyLength(n.keys,3);var r=dt(os.AuthorizeWithSeed,n.data),i=r.voteAuthorizeWithSeedArgs,s=i.currentAuthorityDerivedKeyOwnerPubkey,o=i.currentAuthorityDerivedKeySeed,a=i.newAuthorized,c=i.voteAuthorizationType;return{currentAuthorityDerivedKeyBasePubkey:n.keys[2].pubkey,currentAuthorityDerivedKeyOwnerPubkey:new ue(s),currentAuthorityDerivedKeySeed:o,newAuthorizedPubkey:new ue(a),voteAuthorizationType:{index:c},votePubkey:n.keys[0].pubkey}}},{key:"decodeWithdraw",value:function(n){this.checkProgramId(n.programId),this.checkKeyLength(n.keys,3);var r=dt(os.Withdraw,n.data),i=r.lamports;return{votePubkey:n.keys[0].pubkey,authorizedWithdrawerPubkey:n.keys[2].pubkey,lamports:i,toPubkey:n.keys[1].pubkey}}},{key:"checkProgramId",value:function(n){if(!n.equals(Ld.programId))throw new Error("invalid instruction; programId is not VoteProgram")}},{key:"checkKeyLength",value:function(n,r){if(n.length<r)throw new Error("invalid instruction; found ".concat(n.length," keys, expected at least ").concat(r))}}]),t}(),os=Object.freeze({InitializeAccount:{index:0,layout:Ae([Se("instruction"),oU()])},Authorize:{index:1,layout:Ae([Se("instruction"),Ze("newAuthorized"),Se("voteAuthorizationType")])},Withdraw:{index:3,layout:Ae([Se("instruction"),wr("lamports")])},AuthorizeWithSeed:{index:10,layout:Ae([Se("instruction"),aU()])}}),wH=Object.freeze({Voter:{index:0},Withdrawer:{index:1}}),Ld=function(){function t(){Ue(this,t)}return ze(t,null,[{key:"initializeAccount",value:function(n){var r=n.votePubkey,i=n.nodePubkey,s=n.voteInit,o=os.InitializeAccount,a=st(o,{voteInit:{nodePubkey:Ke(s.nodePubkey.toBuffer()),authorizedVoter:Ke(s.authorizedVoter.toBuffer()),authorizedWithdrawer:Ke(s.authorizedWithdrawer.toBuffer()),commission:s.commission}}),c={keys:[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:pc,isSigner:!1,isWritable:!1},{pubkey:_i,isSigner:!1,isWritable:!1},{pubkey:i,isSigner:!0,isWritable:!1}],programId:this.programId,data:a};return new vt(c)}},{key:"createAccount",value:function(n){var r=new ot;return r.add(Zn.createAccount({fromPubkey:n.fromPubkey,newAccountPubkey:n.votePubkey,lamports:n.lamports,space:this.space,programId:this.programId})),r.add(this.initializeAccount({votePubkey:n.votePubkey,nodePubkey:n.voteInit.nodePubkey,voteInit:n.voteInit}))}},{key:"authorize",value:function(n){var r=n.votePubkey,i=n.authorizedPubkey,s=n.newAuthorizedPubkey,o=n.voteAuthorizationType,a=os.Authorize,c=st(a,{newAuthorized:Ke(s.toBuffer()),voteAuthorizationType:o.index}),u=[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:_i,isSigner:!1,isWritable:!1},{pubkey:i,isSigner:!0,isWritable:!1}];return new ot().add({keys:u,programId:this.programId,data:c})}},{key:"authorizeWithSeed",value:function(n){var r=n.currentAuthorityDerivedKeyBasePubkey,i=n.currentAuthorityDerivedKeyOwnerPubkey,s=n.currentAuthorityDerivedKeySeed,o=n.newAuthorizedPubkey,a=n.voteAuthorizationType,c=n.votePubkey,u=os.AuthorizeWithSeed,l=st(u,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:Ke(i.toBuffer()),currentAuthorityDerivedKeySeed:s,newAuthorized:Ke(o.toBuffer()),voteAuthorizationType:a.index}}),h=[{pubkey:c,isSigner:!1,isWritable:!0},{pubkey:_i,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return new ot().add({keys:h,programId:this.programId,data:l})}},{key:"withdraw",value:function(n){var r=n.votePubkey,i=n.authorizedWithdrawerPubkey,s=n.lamports,o=n.toPubkey,a=os.Withdraw,c=st(a,{lamports:s}),u=[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:o,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!0,isWritable:!1}];return new ot().add({keys:u,programId:this.programId,data:c})}},{key:"safeWithdraw",value:function(n,r,i){if(n.lamports>r-i)throw new Error("Withdraw will leave vote account with insuffcient funds.");return t.withdraw(n)}}]),t}();Ld.programId=new ue("Vote111111111111111111111111111111111111111");Ld.space=3731;var H2=new ue("Va1idator1nfo111111111111111111111111111111"),_H=fe({name:de(),website:Me(de()),details:Me(de()),keybaseUsername:Me(de())}),kH=function(){function t(e,n){Ue(this,t),this.key=void 0,this.info=void 0,this.key=e,this.info=n}return ze(t,null,[{key:"fromConfigData",value:function(n){var r=Ut(n),i=ir(r);if(i!==2)return null;for(var s=[],o=0;o<2;o++){var a=new ue(r.slice(0,Rr));r=r.slice(Rr);var c=r.slice(0,1)[0]===1;r=r.slice(1),s.push({publicKey:a,isSigner:c})}if(s[0].publicKey.equals(H2)&&s[1].isSigner){var u=Vo().decode(ne.Buffer.from(r)),l=JSON.parse(u);return jA(l,_H),new t(s[1].publicKey,l)}return null}}]),t}(),SH=new ue("Vote111111111111111111111111111111111111111"),EH=Ae
37([Ze("nodePubkey"),Ze("authorizedWithdrawer"),Ge("commission"),In(),Dn(Ae([In("slot"),Se("confirmationCount")]),Gs(Se(),-8),"votes"),Ge("rootSlotValid"),In("rootSlot"),In(),Dn(Ae([In("epoch"),Ze("authorizedVoter")]),Gs(Se(),-8),"authorizedVoters"),Ae([Dn(Ae([Ze("authorizedPubkey"),In("epochOfLastAuthorizedSwitch"),In("targetEpoch")]),32,"buf"),In("idx"),Ge("isEmpty")],"priorVoters"),In(),Dn(Ae([In("epoch"),In("credits"),In("prevCredits")]),Gs(Se(),-8),"epochCredits"),Ae([In("slot"),In("timestamp")],"lastTimestamp")]),AH=function(){function t(e){Ue(this,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=e.nodePubkey,this.authorizedWithdrawer=e.authorizedWithdrawer,this.commission=e.commission,this.rootSlot=e.rootSlot,this.votes=e.votes,this.authorizedVoters=e.authorizedVoters,this.priorVoters=e.priorVoters,this.epochCredits=e.epochCredits,this.lastTimestamp=e.lastTimestamp}return ze(t,null,[{key:"fromAccountData",value:function(n){var r=4,i=EH.decode(Ke(n),r),s=i.rootSlot;return i.rootSlotValid||(s=null),new t({nodePubkey:new ue(i.nodePubkey),authorizedWithdrawer:new ue(i.authorizedWithdrawer),commission:i.commission,votes:i.votes,rootSlot:s,authorizedVoters:i.authorizedVoters.map(xH),priorVoters:RH(i.priorVoters),epochCredits:i.epochCredits,lastTimestamp:i.lastTimestamp})}}]),t}();function xH(t){var e=t.authorizedVoter,n=t.epoch;return{epoch:n,authorizedVoter:new ue(e)}}function Kw(t){var e=t.authorizedPubkey,n=t.epochOfLastAuthorizedSwitch,r=t.targetEpoch;return{authorizedPubkey:new ue(e),epochOfLastAuthorizedSwitch:n,targetEpoch:r}}function RH(t){var e=t.buf,n=t.idx,r=t.isEmpty;return r?[]:[].concat(Ut(e.slice(n+1).map(Kw)),Ut(e.slice(0,n).map(Kw)))}var Vw={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 TH(t,e){var n=e===!1?"http":"https";if(!t)return Vw[n].devnet;var r=Vw[n][t];if(!r)throw new Error("Unknown ".concat(n," cluster: ").concat(t));return r}function z0(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */z0=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(_,m,f){_[m]=f.value},i=typeof Symbol=="function"?Symbol:{},s=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function c(_,m,f){return Object.defineProperty(_,m,{value:f,enumerable:!0,configurable:!0,writable:!0}),_[m]}try{c({},"")}catch{c=function(f,d,v){return f[d]=v}}function u(_,m,f,d){var v=m&&m.prototype instanceof p?m:p,b=Object.create(v.prototype),E=new H(d||[]);return r(b,"_invoke",{value:N(_,f,E)}),b}function l(_,m,f){try{return{type:"normal",arg:_.call(m,f)}}catch(d){return{type:"throw",arg:d}}}t.wrap=u;var h={};function p(){}function g(){}function y(){}var w={};c(w,s,function(){return this});var k=Object.getPrototypeOf,T=k&&k(k(z([])));T&&T!==e&&n.call(T,s)&&(w=T);var C=y.prototype=p.prototype=Object.create(w);function O(_){["next","throw","return"].forEach(function(m){c(_,m,function(f){return this._invoke(m,f)})})}function I(_,m){function f(v,b,E,x){var M=l(_[v],_,b);if(M.type!=="throw"){var P=M.arg,S=P.value;return S&&lr(S)=="object"&&n.call(S,"__await")?m.resolve(S.__await).then(function($){f("next",$,E,x)},function($){f("throw",$,E,x)}):m.resolve(S).then(function($){P.value=$,E(P)},function($){return f("throw",$,E,x)})}x(M.arg)}var d;r(this,"_invoke",{value:function(b,E){function x(){return new m(function(M,P){f(b,E,M,P)})}return d=d?d.then(x,x):x()}})}function N(_,m,f){var d="suspendedStart";return function(v,b){if(d==="executing")throw new Error("Generator is already running");if(d==="completed"){if(v==="throw")throw b;return K()}for(f.method=v,f.arg=b;;){var E=f.delegate;if(E){var x=F(E,f);
37if(x){if(x===h)continue;return x}}if(f.method==="next")f.sent=f._sent=f.arg;else if(f.method==="throw"){if(d==="suspendedStart")throw d="completed",f.arg;f.dispatchException(f.arg)}else f.method==="return"&&f.abrupt("return",f.arg);d="executing";var M=l(_,m,f);if(M.type==="normal"){if(d=f.done?"completed":"suspendedYield",M.arg===h)continue;return{value:M.arg,done:f.done}}M.type==="throw"&&(d="completed",f.method="throw",f.arg=M.arg)}}}function F(_,m){var f=m.method,d=_.iterator[f];if(d===void 0)return m.delegate=null,f==="throw"&&_.iterator.return&&(m.method="return",m.arg=void 0,F(_,m),m.method==="throw")||f!=="return"&&(m.method="throw",m.arg=new TypeError("The iterator does not provide a '"+f+"' method")),h;var v=l(d,_.iterator,m.arg);if(v.type==="throw")return m.method="throw",m.arg=v.arg,m.delegate=null,h;var b=v.arg;return b?b.done?(m[_.resultName]=b.value,m.next=_.nextLoc,m.method!=="return"&&(m.method="next",m.arg=void 0),m.delegate=null,h):b:(m.method="throw",m.arg=new TypeError("iterator result is not an object"),m.delegate=null,h)}function L(_){var m={tryLoc:_[0]};1 in _&&(m.catchLoc=_[1]),2 in _&&(m.finallyLoc=_[2],m.afterLoc=_[3]),this.tryEntries.push(m)}function D(_){var m=_.completion||{};m.type="normal",delete m.arg,_.completion=m}function H(_){this.tryEntries=[{tryLoc:"root"}],_.forEach(L,this),this.reset(!0)}function z(_){if(_){var m=_[s];if(m)return m.call(_);if(typeof _.next=="function")return _;if(!isNaN(_.length)){var f=-1,d=function v(){for(;++f<_.length;)if(n.call(_,f))return v.value=_[f],v.done=!1,v;return v.value=void 0,v.done=!0,v};return d.next=d}}return{next:K}}function K(){return{value:void 0,done:!0}}return g.prototype=y,r(C,"constructor",{value:y,configurable:!0}),r(y,"constructor",{value:g,configurable:!0}),g.displayName=c(y,a,"GeneratorFunction"),t.isGeneratorFunction=function(_){var m=typeof _=="function"&&_.constructor;return!!m&&(m===g||(m.displayName||m.name)==="GeneratorFunction")},t.mark=function(_){return Object.setPrototypeOf?Object.setPrototypeOf(_,y):(_.__proto__=y,c(_,a,"GeneratorFunction")),_.prototype=Object.create(C),_},t.awrap=function(_){return{__await:_}},O(I.prototype),c(I.prototype,o,function(){return this}),t.AsyncIterator=I,t.async=function(_,m,f,d,v){v===void 0&&(v=Promise);var b=new I(u(_,m,f,d),v);return t.isGeneratorFunction(m)?b:b.next().then(function(E){return E.done?E.value:b.next()})},O(C),c(C,a,"Generator"),c(C,s,function(){return this}),c(C,"toString",function(){return"[object Generator]"}),t.keys=function(_){var m=Object(_),f=[];for(var d in m)f.push(d);return f.reverse(),function v(){for(;f.length;){var b=f.pop();if(b in m)return v.value=b,v.done=!1,v}return v.done=!0,v}},t.values=z,H.prototype={constructor:H,reset:function(m){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(D),!m)for(var f in this)f.charAt(0)==="t"&&n.call(this,f)&&!isNaN(+f.slice(1))&&(this[f]=void 0)},stop:function(){this.done=!0;var m=this.tryEntries[0].completion;if(m.type==="throw")throw m.arg;return this.rval},dispatchException:function(m){if(this.done)throw m;var f=this;function d(P,S){return E.type="throw",E.arg=m,f.next=P,S&&(f.method="next",f.arg=void 0),!!S}for(var v=this.tryEntries.length-1;v>=0;--v){var b=this.tryEntries[v],E=b.completion;if(b.tryLoc==="root")return d("end");if(b.tryLoc<=this.prev){var x=n.call(b,"catchLoc"),M=n.call(b,"finallyLoc");if(x&&M){if(this.prev<b.catchLoc)return d(b.catchLoc,!0);if(this.prev<b.finallyLoc)return d(b.finallyLoc)}else if(x){if(this.prev<b.catchLoc)return d(b.catchLoc,!0)}else{if(!M)throw new Error("try statement without catch or finally");if(this.prev<b.finallyLoc)return d(b.finallyLoc)}}}},abrupt:function(m,f){for(var d=this.tryEntries.length-1;d>=0;--d){var v=this.tryEntries[d];if(v.tryLoc<=this.prev&&n.call(v,"finallyLoc")&&this.prev<v.finallyLoc){var b=v;break}}b&&(m==="break"||m==="continue")&&b.tryLoc<=f&&f<=b.finallyLoc&&(b=null);var E=b?b.completion:{};return E.type=m,E.arg=f,b?(this.method="next",this.next=b.finallyLoc,h):this.complete(E)},complete:function(m,f){if(m.type==="throw")throw m.arg;return m.type==="break"||m.type==="continue"?this.next=m.arg:m.type==="return"?(this.rval=this.arg=m.arg,this.method="return",this.next="end"):m.type==="normal"&&f&&(this.next=f),h},finish:function(m){for(var f=this.tryEntries.length-1;f>=0;--f){var d=this.tryEntries[f];if(d.finallyLoc===m)return this.complete(d.completion,d.afterLoc),D(d),h}},catch:function(m){for(var f=this.tryEntries.length-1;f>=0;--f){var d=this.tryEntries[f];if(d.tryLoc===m){var v=d.completion;if(v.type==="throw"){var b=v.arg;D(d)}return b}}throw new Error("illegal catch attempt")},delegateYield:function(m,f,d){return this.delegate={iterator:z(m),resultName:f,nextLoc:d},this.method==="next"&&(this.arg=void 0),h}},t}function OH(t,e,n,r){return H0.apply(this,arguments)}function H0(){return H0=ae(z0().mark(function t(e,n,r,i){var s,o,a,c,u,l,h;return z0().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return r&&Object.prototype.hasOwnProperty.call(r,"lastValidBlockHeight")||r&&Object.prototype.hasOwnProperty.call(r,"nonceValue")?(s=r,o=i):o=r,a=o&&{skipPreflight:o.skipPreflight,preflightCommitment:o.preflightCommitment||o.commitment,minContextSlot:o.minContextSlot},g.next=4,e.sendRawTransaction(n,a);case 4:return c=g.sent,u=o&&o.commitment,l=s?e.confirmTransaction(s,u):e.confirmTransaction(c,u),g.next=9,l;case 9:if(h=g.sent.value,!h.err){g.next=12;break}throw new Error("Raw transaction ".concat(c," failed (").concat(JSON.stringify(h),")"));case 12:return g.abrupt("return",c);case 13:case"end":return g.stop()}},t)})),H0.apply(this,arguments)}var W2=1e9;const j2=Object.freeze(Object.defineProperty({__proto__:null,Account:JF,AddressLookupTableAccount:D0,AddressLookupTableInstruction:hH,AddressLookupTableProgram:n1,Authorized:U2,BLOCKHASH_CACHE_TIMEOUT_MS:A2,BPF_LOADER_DEPRECATED_PROGRAM_ID:QF,BPF_LOADER_PROGRAM_ID:OU,BpfLoader:IU,COMPUTE_BUDGET_INSTRUCTION_LAYOUTS:Ai,ComputeBudgetInstruction:dH,ComputeBudgetProgram:r1,Connection:L2,Ed25519Program:D2,
37Enum:GF,EpochSchedule:k2,FeeCalculatorLayout:b2,Keypair:B2,LAMPORTS_PER_SOL:W2,LOOKUP_TABLE_INSTRUCTION_LAYOUTS:ss,Loader:xh,Lockup:Ju,MAX_SEED_LENGTH:g2,Message:ao,MessageAccountKeys:Yu,MessageV0:Id,NONCE_ACCOUNT_LENGTH:Zu,NonceAccount:_2,PACKET_DATA_SIZE:Zs,PUBLIC_KEY_LENGTH:Rr,PublicKey:ue,SIGNATURE_LENGTH_IN_BYTES:la,SOLANA_SCHEMA:_u,STAKE_CONFIG_ID:F2,STAKE_INSTRUCTION_LAYOUTS:En,SYSTEM_INSTRUCTION_LAYOUTS:Et,SYSVAR_CLOCK_PUBKEY:_i,SYSVAR_EPOCH_SCHEDULE_PUBKEY:wU,SYSVAR_INSTRUCTIONS_PUBKEY:_U,SYSVAR_RECENT_BLOCKHASHES_PUBKEY:Ff,SYSVAR_RENT_PUBKEY:pc,SYSVAR_REWARDS_PUBKEY:kU,SYSVAR_SLOT_HASHES_PUBKEY:SU,SYSVAR_SLOT_HISTORY_PUBKEY:EU,SYSVAR_STAKE_HISTORY_PUBKEY:Uf,Secp256k1Program:$2,SendTransactionError:mc,SolanaJSONRPCError:Te,SolanaJSONRPCErrorCode:DU,StakeAuthorizationLayout:vH,StakeInstruction:yH,StakeProgram:Md,Struct:Yy,SystemInstruction:RU,SystemProgram:Zn,Transaction:ot,TransactionExpiredBlockheightExceededError:Xy,TransactionExpiredNonceInvalidError:Ua,TransactionExpiredTimeoutError:Jy,TransactionInstruction:vt,TransactionMessage:pU,TransactionStatus:Xi,VALIDATOR_INFO_KEY:H2,VERSION_PREFIX_MASK:Od,VOTE_PROGRAM_ID:SH,ValidatorInfo:kH,VersionedMessage:Cd,VersionedTransaction:Ah,VoteAccount:AH,VoteAuthorizationLayout:wH,VoteInit:z2,VoteInstruction:bH,VoteProgram:Ld,clusterApiUrl:TH,sendAndConfirmRawTransaction:OH,sendAndConfirmTransaction:M0},Symbol.toStringTag,{value:"Module"})),co={ERROR_ASSOCIATION_PORT_OUT_OF_RANGE:"ERROR_ASSOCIATION_PORT_OUT_OF_RANGE",ERROR_FORBIDDEN_WALLET_BASE_URL:"ERROR_FORBIDDEN_WALLET_BASE_URL",ERROR_SECURE_CONTEXT_REQUIRED:"ERROR_SECURE_CONTEXT_REQUIRED",ERROR_SESSION_CLOSED:"ERROR_SESSION_CLOSED",ERROR_SESSION_TIMEOUT:"ERROR_SESSION_TIMEOUT",ERROR_WALLET_NOT_FOUND:"ERROR_WALLET_NOT_FOUND"};
37class uo extends Error{constructor(...e){const[n,r,i]=e;super(r),this.code=n,this.data=i,this.name="SolanaMobileWalletAdapterError"}}class K2 extends Error{constructor(...e){const[n,r,i,s]=e;super(i),this.code=r,this.data=s,this.jsonRpcMessageId=n,this.name="SolanaMobileWalletAdapterProtocolError"}}function Ar(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(l){try{u(r.next(l))}catch(h){o(h)}}function c(l){try{u(r.throw(l))}catch(h){o(h)}}function u(l){l.done?s(l.value):i(l.value).then(a,c)}u((r=r.apply(t,e||[])).next())})}function IH(t,e){return Ar(this,void 0,void 0,function*(){const n=yield crypto.subtle.exportKey("raw",t),r=yield crypto.subtle.sign({hash:"SHA-256",name:"ECDSA"},e,n),i=new Uint8Array(n.byteLength+r.byteLength);return i.set(new Uint8Array(n),0),i.set(new Uint8Array(r),n.byteLength),i})}const za=4;function CH(t){if(t>=4294967296)throw new Error("Outbound sequence number overflow. The maximum sequence number is 32-bytes.");const e=new ArrayBuffer(za);return new DataView(e).setUint32(0,t,!1),new Uint8Array(e)}function NH(){return Ar(this,void 0,void 0,function*(){return yield crypto.subtle.generateKey({name:"ECDSA",namedCurve:"P-256"},!1,["sign"])})}function PH(){return Ar(this,void 0,void 0,function*(){return yield crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!1,["deriveKey","deriveBits"])})}const W0=12;function MH(t,e){return Ar(this,void 0,void 0,function*(){const n=JSON.stringify(t),r=CH(t.id),i=new Uint8Array(W0);crypto.getRandomValues(i);const s=yield crypto.subtle.encrypt(V2(r,i),e,new TextEncoder().encode(n)),o=new Uint8Array(r.byteLength+i.byteLength+s.byteLength);return o.set(new Uint8Array(r),0),o.set(new Uint8Array(i),r.byteLength),o.set(new Uint8Array(s),r.byteLength+i.byteLength),o})}function LH(t,e){return Ar(this,void 0,void 0,function*(){const n=t.slice(0,za),r=t.slice(za,za+W0),i=t.slice(za+W0),s=yield crypto.subtle.decrypt(V2(n,r),e,i),o=BH().decode(s),a=JSON.parse(o);if(Object.hasOwnProperty.call(a,"error"))throw new K2(a.id,a.error.code,a.error.message);return a})}function V2(t,e){return{additionalData:t,iv:e,name:"AES-GCM",tagLength:128}}let ag;function BH(){return ag===void 0&&(ag=new TextDecoder("utf-8")),ag}function DH(t,e,n){return Ar(this,void 0,void 0,function*(){const[r,i]=yield Promise.all([crypto.subtle.exportKey("raw",e),crypto.subtle.importKey("raw",t,{name:"ECDH",namedCurve:"P-256"},!1,[])]),s=yield crypto.subtle.deriveBits({name:"ECDH",public:i},n,256),o=yield crypto.subtle.importKey("raw",s,"HKDF",!1,["deriveKey"]);return yield crypto.subtle.deriveKey({name:"HKDF",hash:"SHA-256",salt:new Uint8Array(r),info:new Uint8Array},o,{name:"AES-GCM",length:128},!1,["encrypt","decrypt"])})}function $H(){return q2(49152+Math.floor(Math.random()*(65535-49152+1)))}function q2(t){if(t<49152||t>65535)throw new uo(co.ERROR_ASSOCIATION_PORT_OUT_OF_RANGE,`Association port number must be between 49152 and 65535. ${t} given.`,{port:t});return t}function FH(t){let e="";const n=new Uint8Array(t),r=n.byteLength;for(let i=0;i<r;i++)e+=String.fromCharCode(n[i]);return window.btoa(e)}function UH(t){return t.replace(/[/+=]/g,e=>({"/":"_","+":"-","=":"."})[e])}const zH="solana-wallet";function qw(t){return t.replace(/(^\/+|\/+$)/g,"").split("/")}function HH(t,e){let n=null;if(e){try{n=new URL(e)}catch{}if((n==null?void 0:n.protocol)!=="https:")throw new uo(co.ERROR_FORBIDDEN_WALLET_BASE_URL,"Base URLs supplied by wallets must be valid `https` URLs")}n||(n=new URL(`${zH}:/`));const r=t.startsWith("/")?t:[...qw(n.pathname),...qw(t)].join("/");return new URL(r,n)}function WH(t,e,n){return Ar(this,void 0,void 0,function*(){const r=q2(e),i=yield crypto.subtle.exportKey("raw",t),s=FH(i),o=HH("v1/associate/local",n);return o.searchParams.set("association",UH(s)),o.searchParams.set("port",`${r}`),o})}const Th={Firefox:0,Other:1};function jH(){return navigator.userAgent.indexOf("Firefox/")!==-1?Th.Firefox:Th.Other}function KH(){return new Promise((t,e)=>{function n(){clearTimeout(i),window.removeEventListener("blur",r)}function r(){n(),t()}window.addEventListener("blur",r);const i=setTimeout(()=>{n(),e()},2e3)})}let Zc=null;function VH(t){Zc==null&&(Zc=document.createElement("iframe"),Zc.style.display="none",document.body.appendChild(Zc)),Zc.contentWindow.location.href=t.toString()}function qH(t,e){return Ar(this,void 0,void 0,function*(){const n=$H(),r=yield WH(t,n,e);if(r.protocol==="https:")window.location.assign(r);else try{const i=jH();switch(i){case Th.Firefox:VH(r);break;case Th.Other:{const s=KH();window.location.assign(r),yield s;break}default:}}catch{throw new uo(co.ERROR_WALLET_NOT_FOUND,"Found no installed wallet that supports the mobile wallet protocol.")}return n})}const Gw={retryDelayScheduleMs:[150,150,200,500,500,750,750,1e3],timeoutMs:3e4},GH="com.solana.mobilewalletadapter.v1";function YH(){if(typeof window>"u"||window.isSecureContext!==!0)throw new uo(co.ERROR_SECURE_CONTEXT_REQUIRED,"The mobile wallet adapter protocol must be used in a secure context (`https`).")}function ZH(t){let e;try{e=new URL(t)}catch{throw new uo(co.ERROR_FORBIDDEN_WALLET_BASE_URL,"Invalid base URL supplied by wallet")}if(e.protocol!=="https:")throw new uo(co.ERROR_FORBIDDEN_WALLET_BASE_URL,"Base URLs supplied by wallets must be valid `https` URLs")}function XH(t){return new DataView(t).getUint32(0,!1)}function JH(t,e){return Ar(this,void 0,void 0,function*(){YH();const n=yield NH(),r=yield qH(n.publicKey,e==null?void 0:e.baseUri),i=`ws://localhost:${r}/solana-wallet`;let s;const o=(()=>{const l=[...Gw.retryDelayScheduleMs];return()=>l.length>1?l.shift():l[0]})();let a=1,c=0,u={__type:"disconnected"};return new Promise((l,h)=>{let p;const g={},y=()=>Ar(this,void 0,void 0,function*(){if(u.__type!=="connecting"){console.warn(`Expected adapter state to be \`connecting\` at the moment the websocket opens. Got \`${u.__type}\`.`);return}const{associationKeypair:N}=u;p.removeEventListener("open",y);const F=yield PH();p.send(yield IH(F.publicKey,N.privateKey)),u={__type:"hello_req_sent",associationPublicKey:N.publicKey,ecdhPrivateKey:F.privateKey}}),w=N=>{N.wasClean?u={__type:"disconnected"}:h(new uo(co.ERROR_SESSION_CLOSED,`The wallet session dropped unexpectedly (${N.code}: ${N.reason}).`,{closeEvent:N})),C()},k=N=>Ar(this,void 0,void 0,function*(){C(),Date.now()-s>=Gw.timeoutMs?h(new uo(co.ERROR_SESSION_TIMEOUT,`Failed to connect to the wallet websocket on port ${r}.`)):(yield new Promise(F=>{const L=o();O=window.setTimeout(F,L)}),I())}),T=N=>Ar(this,void 0,void 0,function*(){const F=yield N.data.arrayBuffer();switch(u.__type){case"connected":try{const L=F.slice(0,za),D=XH(L);
37if(D!==c+1)throw new Error("Encrypted message has invalid sequence number");c=D;const H=yield LH(F,u.sharedSecret),z=g[H.id];delete g[H.id],z.resolve(H.result)}catch(L){if(L instanceof K2){const D=g[L.jsonRpcMessageId];delete g[L.jsonRpcMessageId],D.reject(L)}else throw L}break;case"hello_req_sent":{const L=yield DH(F,u.associationPublicKey,u.ecdhPrivateKey);u={__type:"connected",sharedSecret:L};const D=new Proxy({},{get(H,z){if(H[z]==null){const K=z.toString().replace(/[A-Z]/g,_=>`_${_.toLowerCase()}`).toLowerCase();H[z]=function(_){return Ar(this,void 0,void 0,function*(){const m=a++;return p.send(yield MH({id:m,jsonrpc:"2.0",method:K,params:_??{}},L)),new Promise((f,d)=>{g[m]={resolve(v){switch(z){case"authorize":case"reauthorize":{const{wallet_uri_base:b}=v;if(b!=null)try{ZH(b)}catch(E){d(E);return}break}}f(v)},reject:d}})})}}return H[z]},defineProperty(){return!1},deleteProperty(){return!1}});try{l(yield t(D))}catch(H){h(H)}finally{C(),p.close()}break}}});let C,O;const I=()=>{C&&C(),u={__type:"connecting",associationKeypair:n},s===void 0&&(s=Date.now()),p=new WebSocket(i,[GH]),p.addEventListener("open",y),p.addEventListener("close",w),p.addEventListener("error",k),p.addEventListener("message",T),C=()=>{window.clearTimeout(O),p.removeEventListener("open",y),p.removeEventListener("close",w),p.removeEventListener("error",k),p.removeEventListener("message",T)}};I()})})}function QH(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 r=0;r<t.length;r++){var i=t.charAt(r),s=i.charCodeAt(0);if(e[s]!==255)throw new TypeError(i+" is ambiguous");e[s]=r}var o=t.length,a=t.charAt(0),c=Math.log(o)/Math.log(256),u=Math.log(256)/Math.log(o);function l(g){if(g instanceof Uint8Array||(ArrayBuffer.isView(g)?g=new Uint8Array(g.buffer,g.byteOffset,g.byteLength):Array.isArray(g)&&(g=Uint8Array.from(g))),!(g instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(g.length===0)return"";for(var y=0,w=0,k=0,T=g.length;k!==T&&g[k]===0;)k++,y++;for(var C=(T-k)*u+1>>>0,O=new Uint8Array(C);k!==T;){for(var I=g[k],N=0,F=C-1;(I!==0||N<w)&&F!==-1;F--,N++)I+=256*O[F]>>>0,O[F]=I%o>>>0,I=I/o>>>0;if(I!==0)throw new Error("Non-zero carry");w=N,k++}for(var L=C-w;L!==C&&O[L]===0;)L++;for(var D=a.repeat(y);L<C;++L)D+=t.charAt(O[L]);return D}function h(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;for(var y=0,w=0,k=0;g[y]===a;)w++,y++;for(var T=(g.length-y)*c+1>>>0,C=new Uint8Array(T);g[y];){var O=e[g.charCodeAt(y)];if(O===255)return;for(var I=0,N=T-1;(O!==0||I<k)&&N!==-1;N--,I++)O+=o*C[N]>>>0,C[N]=O%256>>>0,O=O/256>>>0;if(O!==0)throw new Error("Non-zero carry");k=I,y++}for(var F=T-k;F!==T&&C[F]===0;)F++;for(var L=new Uint8Array(w+(T-F)),D=w;F!==T;)L[D++]=C[F++];return L}function p(g){var y=h(g);if(y)return y;throw new Error("Non-base"+o+" character")}return{encode:l,decodeUnsafe:h,decode:p}}var e7=QH;const t7=e7,n7="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";var r7=t7(n7);const i7=Ui(r7);function cg(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,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 ff(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(l){try{u(r.next(l))}catch(h){o(h)}}function c(l){try{u(r.throw(l))}catch(h){o(h)}}function u(l){l.done?s(l.value):i(l.value).then(a,c)}u((r=r.apply(t,e||[])).next())})}function G2(t){return window.btoa(String.fromCharCode.call(null,...t))}function ug(t){return new Uint8Array(window.atob(t).split("").map(e=>e.charCodeAt(0)))}function Yw(t){const e="version"in t?t.serialize():t.serialize({requireAllSignatures:!1,verifySignatures:!1});return G2(e)}function s7(t){const n=t[0]*la+1;return Cd.deserializeMessageVersion(t.slice(n,t.length))==="legacy"?ot.from(t):Ah.deserialize(t)}function o7(t,e){return ff(this,void 0,void 0,function*(){return yield JH(r=>{const i=new Proxy({},{get(s,o){if(s[o]==null)switch(o){case"signAndSendTransactions":s[o]=function(a){var{minContextSlot:c,transactions:u}=a,l=cg(a,["minContextSlot","transactions"]);return ff(this,void 0,void 0,function*(){const h=u.map(Yw),{signatures:p}=yield r.signAndSendTransactions(Object.assign(Object.assign(Object.assign({},l),c!=null?{options:{min_context_slot:c}}:null),{payloads:h}
37));return p.map(ug).map(i7.encode)})};break;case"signMessages":s[o]=function(a){var{payloads:c}=a,u=cg(a,["payloads"]);return ff(this,void 0,void 0,function*(){const l=c.map(G2),{signed_payloads:h}=yield r.signMessages(Object.assign(Object.assign({},u),{payloads:l}));return h.map(ug)})};break;case"signTransactions":s[o]=function(a){var{transactions:c}=a,u=cg(a,["transactions"]);return ff(this,void 0,void 0,function*(){const l=c.map(Yw),{signed_payloads:h}=yield r.signTransactions(Object.assign(Object.assign({},u),{payloads:l}));return h.map(ug).map(s7)})};break;default:{s[o]=r[o];break}}return s[o]},defineProperty(){return!1},deleteProperty(){return!1}});return t(i)},e)})}function gt(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(l){try{u(r.next(l))}catch(h){o(h)}}function c(l){try{u(r.throw(l))}catch(h){o(h)}}function u(l){l.done?s(l.value):i(l.value).then(a,c)}u((r=r.apply(t,e||[])).next())})}function a7(t){return new Uint8Array(window.atob(t).split("").map(e=>e.charCodeAt(0)))}function c7(){return typeof window<"u"&&window.isSecureContext&&typeof document<"u"&&/android/i.test(navigator.userAgent)}const yc="Mobile Wallet Adapter",u7=64;function l7(t){const e=a7(t);return new ue(e)}function Zw(t){return"version"in t}class f7 extends x6{constructor(e){super(),this.supportedTransactionVersions=new Set(["legacy",0]),this.name=yc,this.url="https://solanamobile.com/wallets",this.icon="data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjI4IiB3aWR0aD0iMjgiIHZpZXdCb3g9Ii0zIDAgMjggMjgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI0RDQjhGRiI+PHBhdGggZD0iTTE3LjQgMTcuNEgxNXYyLjRoMi40di0yLjRabTEuMi05LjZoLTIuNHYyLjRoMi40VjcuOFoiLz48cGF0aCBkPSJNMjEuNiAzVjBoLTIuNHYzaC0zLjZWMGgtMi40djNoLTIuNHY2LjZINC41YTIuMSAyLjEgMCAxIDEgMC00LjJoMi43VjNINC41QTQuNSA0LjUgMCAwIDAgMCA3LjVWMjRoMjEuNnYtNi42aC0yLjR2NC4ySDIuNFYxMS41Yy41LjMgMS4yLjQgMS44LjVoNy41QTYuNiA2LjYgMCAwIDAgMjQgOVYzaC0yLjRabTAgNS43YTQuMiA0LjIgMCAxIDEtOC40IDBWNS40aDguNHYzLjNaIi8+PC9nPjwvc3ZnPg==",this._connecting=!1,this._connectionGeneration=0,this._readyState=c7()?Wt.Loadable:Wt.Unsupported,this._authorizationResultCache=e.authorizationResultCache,this._addressSelector=e.addressSelector,this._appIdentity=e.appIdentity,this._cluster=e.cluster,this._onWalletNotFound=e.onWalletNotFound,this._readyState!==Wt.Unsupported&&this._authorizationResultCache.get().then(n=>{n&&this.declareWalletAsInstalled()})}get publicKey(){if(this._publicKey==null&&this._selectedAddress!=null)try{this._publicKey=l7(this._selectedAddress)}catch(e){throw new w0(e instanceof Error&&(e==null?void 0:e.message)||"Unknown error",e)}return this._publicKey?this._publicKey:null}get connected(){return!!this._authorizationResult}get connecting(){return this._connecting}get readyState(){return this._readyState}declareWalletAsInstalled(){this._readyState!==Wt.Installed&&this.emit("readyStateChange",this._readyState=Wt.Installed)}runWithGuard(e){return gt(this,void 0,void 0,function*(){try{return yield e()}catch(n){throw this.emit("error",n),n}})}autoConnect_DO_NOT_USE_OR_YOU_WILL_BE_FIRED(){return gt(this,void 0,void 0,function*(){return yield this.autoConnect()})}autoConnect(){return gt(this,void 0,void 0,function*(){if(!(this.connecting||this.connected))return yield this.runWithGuard(()=>gt(this,void 0,void 0,function*(){if(this._readyState!==Wt.Installed&&this._readyState!==Wt.Loadable)throw new Ku;this._connecting=!0;try{const e=yield this._authorizationResultCache.get();e&&this.handleAuthorizationResult(e)}catch(e){throw new b0(e instanceof Error&&e.message||"Unknown error",e)}finally{this._connecting=!1}}))})}connect(){return gt(this,void 0,void 0,function*(){if(!(this.connecting||this.connected))return yield this.runWithGuard(()=>gt(this,void 0,void 0,function*(){if(this._readyState!==Wt.Installed&&this._readyState!==Wt.Loadable)throw new Ku;this._connecting=!0;try{const e=yield this._authorizationResultCache.get();if(e){this.handleAuthorizationResult(e);return}yield this.transact(n=>gt(this,void 0,void 0,function*(){const r=yield n.authorize({cluster:this._cluster,identity:this._appIdentity});Promise.all([this._authorizationResultCache.set(r),this.handleAuthorizationResult(r)])}))}catch(e){throw new b0(e instanceof Error&&e.message||"Unknown error",e)}finally{this._connecting=!1}}))})}handleAuthorizationResult(e){var n;return gt(this,void 0,void 0,function*(){const r=this._authorizationResult==null||((n=this._authorizationResult)===null||n===void 0?void 0:n.accounts.length)!==e.accounts.length||this._authorizationResult.accounts.some((i,s)=>i.address!==e.accounts[s].address);if(this._authorizationResult=e,this.declareWalletAsInstalled(),r){const i=yield this._addressSelector.select(e.accounts.map(({address:s})=>s));i!==this._selectedAddress&&(this._selectedAddress=i,delete this._publicKey,this.emit
37("connect",this.publicKey))}})}performReauthorization(e,n){return gt(this,void 0,void 0,function*(){try{const r=yield e.reauthorize({auth_token:n,identity:this._appIdentity});Promise.all([this._authorizationResultCache.set(r),this.handleAuthorizationResult(r)])}catch(r){throw this.disconnect(),new YE(r instanceof Error&&(r==null?void 0:r.message)||"Unknown error",r)}})}disconnect(){return gt(this,void 0,void 0,function*(){this._authorizationResultCache.clear(),this._connecting=!1,this._connectionGeneration++,delete this._authorizationResult,delete this._publicKey,delete this._selectedAddress,this.emit("disconnect")})}transact(e){var n;return gt(this,void 0,void 0,function*(){const r=(n=this._authorizationResult)===null||n===void 0?void 0:n.wallet_uri_base,i=r?{baseUri:r}:void 0,s=this._connectionGeneration;try{return yield o7(e,i)}catch(o){throw this._connectionGeneration!==s&&(yield new Promise(()=>{})),o instanceof Error&&o.name==="SolanaMobileWalletAdapterError"&&o.code==="ERROR_WALLET_NOT_FOUND"&&(yield this._onWalletNotFound(this)),o}})}assertIsAuthorized(){if(!this._authorizationResult||!this._selectedAddress)throw new Oi;return{authToken:this._authorizationResult.auth_token,selectedAddress:this._selectedAddress}}performSignTransactions(e){return gt(this,void 0,void 0,function*(){const{authToken:n}=this.assertIsAuthorized();try{return yield this.transact(r=>gt(this,void 0,void 0,function*(){return yield this.performReauthorization(r,n),yield r.signTransactions({transactions:e})}))}catch(r){throw new zs(r==null?void 0:r.message,r)}})}sendTransaction(e,n,r){return gt(this,void 0,void 0,function*(){return yield this.runWithGuard(()=>gt(this,void 0,void 0,function*(){const{authToken:i}=this.assertIsAuthorized(),s=r==null?void 0:r.minContextSlot;try{return yield this.transact(o=>gt(this,void 0,void 0,function*(){function a(){let h;switch(n.commitment){case"confirmed":case"finalized":case"processed":h=n.commitment;break;default:h="finalized"}let p;switch(r==null?void 0:r.preflightCommitment){case"confirmed":case"finalized":case"processed":p=r.preflightCommitment;break;case void 0:p=h;default:p="finalized"}return(p==="finalized"?2:p==="confirmed"?1:0)<(h==="finalized"?2:h==="confirmed"?1:0)?p:h}const[c,u,l]=yield Promise.all([o.getCapabilities(),this.performReauthorization(o,i),Zw(e)?null:(()=>gt(this,void 0,void 0,function*(){var h;if(e.feePayer||(e.feePayer=(h=this.publicKey)!==null&&h!==void 0?h:void 0),e.recentBlockhash==null){const{blockhash:p}=yield n.getLatestBlockhash({commitment:a()});e.recentBlockhash=p}}))()]);if(c.supports_sign_and_send_transactions)return(yield o.signAndSendTransactions({minContextSlot:s,transactions:[e]}))[0];{const[h]=yield o.signTransactions({transactions:[e]});if(Zw(h))return yield n.sendTransaction(h);{const p=h.serialize();return yield n.sendRawTransaction(p,Object.assign(Object.assign({},r),{preflightCommitment:a()}))}}}))}catch(o){throw new Wo(o==null?void 0:o.message,o)}}))})}signTransaction(e){return gt(this,void 0,void 0,function*(){return yield this.runWithGuard(()=>gt(this,void 0,void 0,function*(){const[n]=yield this.performSignTransactions([e]);return n}))})}signAllTransactions(e){return gt(this,void 0,void 0,function*(){return yield this.runWithGuard(()=>gt(this,void 0,void 0,function*(){return yield this.performSignTransactions(e)}))})}signMessage(e){return gt(this,void 0,void 0,function*(){return yield this.runWithGuard(()=>gt(this,void 0,void 0,function*(){const{authToken:n,selectedAddress:r}=this.assertIsAuthorized();try{return yield this.transact(i=>gt(this,void 0,void 0,function*(){yield this.performReauthorization(i,n);const[s]=yield i.signMessages({addresses:[r],payloads:[e]});return s.slice(-u7)}))}catch(i){throw new _0(i==null?void 0:i.message,i)}}))})}}function h7(){return{select(t){return gt(this,void 0,void 0,function*(){return t[0]})}}}const lg="SolanaMobileWalletAdapterDefaultAuthorizationCache";function d7(){let t;try{t=window.localStorage}catch{}return{clear(){return gt(this,void 0,void 0,function*(){if(t)try{t.removeItem(lg)}catch{}})},get(){return gt(this,void 0,void 0,function*(){if(t)try{return JSON.parse(t.getItem(lg))||void 0}catch{}})},set(e){return gt(this,void 0,void 0,function*(){if(t)try{t.setItem(lg,JSON.stringify(e))}catch{}})}}}function p7(t){return gt(this,void 0,void 0,function*(){typeof window<"u"&&window.location.assign(t.url)})}function g7(){return p7}function m7(t,e,n,r,i,s){ai(t,(o,a)=>{const c=o==null?void 0:o.adapter,u=a==null?void 0:a.adapter;!c||!u||c.name!==u.name&&u.name!==yc&&u.disconnect()}),oi(o=>{var h;const a=(h=t.value)==null?void 0:h.adapter;if(!a)return;const c=()=>{i()},u=()=>{e.value||n.value||r(!0)},l=p=>s(p,a);a.on("connect",c),a.on("disconnect",u),a.on("error",l),o(()=>{a.off("connect",c),a.off("disconnect",u),a.off("error",l)})})}function y7(t,e,n,r,i,s,o){const a=ct(t),c=ct(!1);return ai(e,()=>{c.value=!1}),oi(()=>{c.value||!a.value||!e.value||!s.value||i.value||r.value||(async()=>
37{if(e.value){r.value=!0,c.value=!0;try{n.value?await e.value.adapter.autoConnect_DO_NOT_USE_OR_YOU_WILL_BE_FIRED():await e.value.adapter.connect()}catch{o()}finally{r.value=!1}}})()}),a}function v7(t){const e=b7(),n=w7(),r=Ve(()=>_7(t.value,e)),i=Ve(()=>r.value===1);return{userAgent:e,uriForAppIdentity:n,environment:r,isMobile:i}}let fg;function b7(){var t;return fg===void 0&&(fg=((t=globalThis.navigator)==null?void 0:t.userAgent)??null),fg}function w7(){const t=globalThis.location;return t==null?null:`${t.protocol}//${t.host}`}function _7(t,e){return t.some(i=>i.name!==yc&&i.readyState===Wt.Installed)?0:e&&k7(e)&&!S7(e)?1:0}function k7(t){return/android/i.test(t)}function S7(t){return/(WebView|Version\/.+(Chrome)\/(\d+)\.(\d+)\.(\d+)\.(\d+)|; wv\).+(Chrome)\/(\d+)\.(\d+)\.(\d+)\.(\d+))/i.test(t)}function E7(t,e){return(n,r)=>t.value?n:e?(e(n,r),n):(console.error(n,r),n instanceof Ku&&typeof window<"u"&&r&&window.open(r.url,"_blank"),n)}function A7(t,e,n,r){const i=Ve(()=>{if(!e.value)return null;const s=t.value.find(o=>o.name===yc);return s||new f7({addressSelector:h7(),appIdentity:{uri:n||void 0},authorizationResultCache:d7(),cluster:r.value,onWalletNotFound:g7()})});return Ve(()=>i.value==null||t.value.indexOf(i.value)!==-1?t.value:[i.value,...t.value])}function x7(t){oi(e=>{function n(r){const i=t.value,s=i.findIndex(({adapter:o})=>o===this);s!==-1&&(t.value=[...i.slice(0,s),{adapter:this,readyState:r},...i.slice(s+1)])}t.value.forEach(({adapter:r})=>r.on("readyStateChange",n,r)),e(()=>t.value.forEach(({adapter:r})=>r.off("readyStateChange",n,r)))})}var Xw;const Bd=typeof window<"u",R7=t=>typeof t=="function",T7=t=>typeof t=="string",Y2=()=>{},j0=Bd&&((Xw=window==null?void 0:window.navigator)==null?void 0:Xw.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function fa(t){return typeof t=="function"?t():Um(t)}function O7(t,e){function n(...r){return new Promise((i,s)=>{Promise.resolve(t(()=>e.apply(this,r),{fn:e,thisArg:this,args:r})).then(i).catch(s)})}return n}const Z2=t=>t();function I7(t=Z2){const e=ct(!0);function n(){e.value=!1}function r(){e.value=!0}const i=(...s)=>{e.value&&t(...s)};return{isActive:Xh(e),pause:n,resume:r,eventFilter:i}}function C7(t){return t}function i1(t){return Hk()?(vI(t),!0):!1}function N7(t){return typeof t=="function"?Ve(t):ct(t)}function P7(t,e=!0){OS()?xc(t):e?t():ho(t)}function M7(t,e,n={}){const{immediate:r=!0}=n,i=ct(!1);let s=null;function o(){s&&(clearTimeout(s),s=null)}function a(){i.value=!1,o()}function c(...u){o(),i.value=!0,s=setTimeout(()=>{i.value=!1,s=null,t(...u)},fa(e))}return r&&(i.value=!0,Bd&&c()),i1(a),{isPending:Xh(i),start:c,stop:a}}var Jw=Object.getOwnPropertySymbols,L7=Object.prototype.hasOwnProperty,B7=Object.prototype.propertyIsEnumerable,D7=(t,e)=>{var n={};for(var r in t)L7.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&Jw)for(var r of Jw(t))e.indexOf(r)<0&&B7.call(t,r)&&(n[r]=t[r]);return n};function $7(t,e,n={}){const r=n,{eventFilter:i=Z2}=r,s=D7(r,["eventFilter"]);return ai(t,O7(i,e),s)}var F7=Object.defineProperty,U7=Object.defineProperties,z7=Object.getOwnPropertyDescriptors,Oh=Object.getOwnPropertySymbols,X2=Object.prototype.hasOwnProperty,J2=Object.prototype.propertyIsEnumerable,Qw=(t,e,n)=>e in t?F7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,H7=(t,e)=>{for(var n in e||(e={}))X2.call(e,n)&&Qw(t,n,e[n]);if(Oh)for(var n of Oh(e))J2.call(e,n)&&Qw(t,n,e[n]);return t},W7=(t,e)=>U7(t,z7(e)),j7=(t,e)=>{var n={};for(var r in t)X2.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&Oh)for(var r of Oh(t))e.indexOf(r)<0&&J2.call(t,r)&&(n[r]=t[r]);return n};function K7(t,e,n={}){const r=n,{eventFilter:i}=r,s=j7(r,["eventFilter"]),{eventFilter:o,pause:a,resume:c,isActive:u}=I7(i);return{stop:$7(t,e,W7(H7({},s),{eventFilter:o})),pause:a,resume:c,isActive:u}}function au(t){var e;const n=fa(t);return(e=n==null?void 0:n.$el)!=null?e:n}const vc=Bd?window:void 0,V7=Bd?window.navigator:void 0;function Xs(...t){let e,n,r,i;if(T7(t[0])||Array.isArray(t[0])?([n,r,i]=t,e=vc):[e,n,r,i]=t,!e)return Y2;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const s=[],o=()=>
37{s.forEach(l=>l()),s.length=0},a=(l,h,p,g)=>(l.addEventListener(h,p,g),()=>l.removeEventListener(h,p,g)),c=ai(()=>[au(e),fa(i)],([l,h])=>{o(),l&&s.push(...n.flatMap(p=>r.map(g=>a(l,p,g,h))))},{immediate:!0,flush:"post"}),u=()=>{c(),o()};return i1(u),u}let e_=!1;function Q2(t,e,n={}){const{window:r=vc,ignore:i=[],capture:s=!0,detectIframe:o=!1}=n;if(!r)return;j0&&!e_&&(e_=!0,Array.from(r.document.body.children).forEach(p=>p.addEventListener("click",Y2)));let a=!0;const c=p=>i.some(g=>{if(typeof g=="string")return Array.from(r.document.querySelectorAll(g)).some(y=>y===p.target||p.composedPath().includes(y));{const y=au(g);return y&&(p.target===y||p.composedPath().includes(y))}}),l=[Xs(r,"click",p=>{const g=au(t);if(!(!g||g===p.target||p.composedPath().includes(g))){if(p.detail===0&&(a=!c(p)),!a){a=!0;return}e(p)}},{passive:!0,capture:s}),Xs(r,"pointerdown",p=>{const g=au(t);g&&(a=!p.composedPath().includes(g)&&!c(p))},{passive:!0}),o&&Xs(r,"blur",p=>{var g;const y=au(t);((g=r.document.activeElement)==null?void 0:g.tagName)==="IFRAME"&&!(y!=null&&y.contains(r.document.activeElement))&&e(p)})].filter(Boolean);return()=>l.forEach(p=>p())}const q7=t=>typeof t=="function"?t:typeof t=="string"?e=>e.key===t:Array.isArray(t)?e=>t.includes(e.key):()=>!0;function t_(...t){let e,n,r={};t.length===3?(e=t[0],n=t[1],r=t[2]):t.length===2?typeof t[1]=="object"?(e=!0,n=t[0],r=t[1]):(e=t[0],n=t[1]):(e=!0,n=t[0]);const{target:i=vc,eventName:s="keydown",passive:o=!1}=r,a=q7(e);return Xs(i,s,u=>{a(u)&&n(u)},o)}function G7(t,e=!1){const n=ct(),r=()=>n.value=!!t();return r(),P7(r,e),n}function Y7(t={}){const{navigator:e=V7,read:n=!1,source:r,copiedDuring:i=1500,legacy:s=!1}=t,o=["copy","cut"],a=G7(()=>e&&"clipboard"in e),c=Ve(()=>a.value||s),u=ct(""),l=ct(!1),h=M7(()=>l.value=!1,i);function p(){a.value?e.clipboard.readText().then(k=>{u.value=k}):u.value=w()}if(c.value&&n)for(const k of o)Xs(k,p);async function g(k=fa(r)){c.value&&k!=null&&(a.value?await e.clipboard.writeText(k):y(k),u.value=k,l.value=!0,h.start())}function y(k){const T=document.createElement("textarea");T.value=k??"",T.style.position="absolute",T.style.opacity="0",document.body.appendChild(T),T.select(),document.execCommand("copy"),T.remove()}function w(){var k,T,C;return(C=(T=(k=document==null?void 0:document.getSelection)==null?void 0:k.call(document))==null?void 0:T.toString())!=null?C:""}return{isSupported:c,text:u,copied:l,copy:g}}const K0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof ia<"u"?ia:typeof self<"u"?self:{},V0="__vueuse_ssr_handlers__";K0[V0]=K0[V0]||{};const Z7=K0[V0];function X7(t,e){return Z7[t]||e}function J7(t){return t==null?"any":t instanceof Set?"set":t instanceof Map?"map":t instanceof Date?"date":typeof t=="boolean"?"boolean":typeof t=="string"?"string":typeof t=="object"?"object":Number.isNaN(t)?"any":"number"}var Q7=Object.defineProperty,n_=Object.getOwnPropertySymbols,e9=Object.prototype.hasOwnProperty,t9=Object.prototype.propertyIsEnumerable,r_=(t,e,n)=>e in t?Q7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,i_=(t,e)=>{for(var n in e||(e={}))e9.call(e,n)&&r_(t,n,e[n]);if(n_)for(var n of n_(e))t9.call(e,n)&&r_(t,n,e[n]);return t};const n9={boolean:{read:t=>t==="true",write:t=>String(t)},object:{read:t=>JSON.parse(t),write:t=>JSON.stringify(t)},number:{read:t=>Number.parseFloat(t),write:t=>String(t)},any:{read:t=>t,write:t=>String(t)},string:{read:t=>t,write:t=>String(t)},map:{read:t=>new Map(JSON.parse(t)),write:t=>JSON.stringify(Array.from(t.entries()))},set:{read:t=>new Set(JSON.parse(t)),write:t=>JSON.stringify(Array.from(t))},date:{read:t=>new Date(t),write:t=>t.toISOString()}},s_="vueuse-storage";function r9(t,e,n,r={}){var i;const{flush:s="pre",deep:o=!0,listenToStorageChanges:a=!0,writeDefaults:c=!0,mergeDefaults:u=!1,shallow:l,window:h=vc,eventFilter:p,onError:g=D=>{console.error(D)}}=r,y=(l?ma:ct)(e);if(!n)try{n=X7("getDefaultStorage",()=>{var D;return(D=vc)==null?void 0:D.localStorage})()}catch(D){g(D)}if(!n)return y;const w=fa(e),k=J7(w),T=(i=r.serializer)!=null?i:n9[k],{pause:C,resume:O}=K7(y,()=>I(y.value),{flush:s,deep:o,eventFilter:p});return h&&a&&(Xs(h,"storage",L),Xs(h,s_,F)),L(),y;function I(D){try{if(D==null)n.removeItem(t);else{const H=T.write(D),z=n.getItem(t);z!==H&&(n.setItem(t,H),h&&h.dispatchEvent(new CustomEvent(s_,{detail:{key:t,oldValue:z,newValue:H,storageArea:n}})))}}catch(H){g(H)}}function N(D){const H=D?D.newValue:n.getItem(t);if(H==null)return c&&w!==null&&n.setItem(t,T.write(w)),w;if(!D&&u){const z=T.read(H);return R7(u)?u(z,w):k==="object"&&!Array.isArray(z)?i_(i_({},w),z):z}else return typeof H!="string"?H:T.read(H)}function F(D){L(D.detail)}
37function L(D){if(!(D&&D.storageArea!==n)){if(D&&D.key==null){y.value=w;return}if(!(D&&D.key!==t)){C();try{y.value=N(D)}catch(H){g(H)}finally{D?ho(O):O()}}}}}function i9(t,e,n={}){const{window:r=vc}=n;return r9(t,e,r==null?void 0:r.localStorage,n)}var o_;(function(t){t.UP="UP",t.RIGHT="RIGHT",t.DOWN="DOWN",t.LEFT="LEFT",t.NONE="NONE"})(o_||(o_={}));function ex(t){const e=window.getComputedStyle(t);if(e.overflowX==="scroll"||e.overflowY==="scroll"||e.overflowX==="auto"&&t.clientHeight<t.scrollHeight||e.overflowY==="auto"&&t.clientWidth<t.scrollWidth)return!0;{const n=t.parentNode;return!n||n.tagName==="BODY"?!1:ex(n)}}function s9(t){const e=t||window.event,n=e.target;return ex(n)?!1:e.touches.length>1?!0:(e.preventDefault&&e.preventDefault(),!1)}function o9(t,e=!1){const n=ct(e);let r=null,i;ai(N7(t),a=>{if(a){const c=a;i=c.style.overflow,n.value&&(c.style.overflow="hidden")}},{immediate:!0});const s=()=>{const a=fa(t);!a||n.value||(j0&&(r=Xs(a,"touchmove",c=>{s9(c)},{passive:!1})),a.style.overflow="hidden",n.value=!0)},o=()=>{const a=fa(t);!a||!n.value||(j0&&(r==null||r()),a.style.overflow=i,n.value=!1)};return i1(o),Ve({get(){return n.value},set(a){a?s():o()}})}var a9=Object.defineProperty,a_=Object.getOwnPropertySymbols,c9=Object.prototype.hasOwnProperty,u9=Object.prototype.propertyIsEnumerable,c_=(t,e,n)=>e in t?a9(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,l9=(t,e)=>{for(var n in e||(e={}))c9.call(e,n)&&c_(t,n,e[n]);if(a_)for(var n of a_(e))u9.call(e,n)&&c_(t,n,e[n]);return t};const f9={easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]};l9({linear:C7},f9);function h9(t,e){const n=i9(t,e.value?yc:null),r=Ve(()=>n.value===yc),i=Ve(()=>r.value&&e.value);return{name:n,isUsingMwaAdapter:r,isUsingMwaAdapterOnMobile:i,select:a=>{n.value!==a&&(n.value=a)},deselect:(a=!0)=>{(a||r.value)&&(n.value=null)}}}function hg(t){switch(t){case"processed":case"confirmed":case"finalized":case void 0:return t;case"recent":return"processed";case"single":case"singleGossip":return"confirmed";case"max":case"root":return"finalized";default:return}}const u_="solana:mainnet",d9="solana:devnet",p9="solana:testnet",g9="solana:localnet",m9="https://api.mainnet-beta.solana.com";function y9(t){return t.includes(m9)?u_:/\bdevnet\b/i.test(t)?d9:/\btestnet\b/i.test(t)?p9:/\blocalhost\b/i.test(t)||/\b127\.0\.0\.1\b/.test(t)?g9:u_}globalThis&&globalThis.__classPrivateFieldSet;globalThis&&globalThis.__classPrivateFieldGet;function v9(t,e){if(t===e)return!0;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var rr=globalThis&&globalThis.__classPrivateFieldSet||function(t,e,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(t,n):i?i.value=n:e.set(t,n),n},$e=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)},ei,xi,Ha,Da,$a,ku,Tt,zf,Hf,Ih,Wf,q0,l_,f_,h_;class b9 extends ZE{constructor({wallet:e}){super(),ei.add(this),xi.set(this,void 0),Ha.set(this,void 0),Da.set(this,void 0),$a.set(this,void 0),ku.set(this,void 0),Tt.set(this,void 0),zf.set(this,void 0),Hf.set(this,typeof window>"u"||typeof document>"u"?Wt.Unsupported:Wt.Installed),q0.set(this,r=>{if($e(this,$a,"f")||!$e(this,xi,"f")||!$e(this,Ha,"f")||!("accounts"in r))return;const i=$e(this,Tt,"f").accounts[0];
37if(!i){$e(this,ei,"m",Wf).call(this),this.emit("error",new YE),this.emit("disconnect");return}if(i===$e(this,xi,"f"))return;let s;try{s=new ue(i.publicKey)}catch(o){$e(this,ei,"m",Wf).call(this),this.emit("error",new w0(o==null?void 0:o.message)),this.emit("disconnect");return}$e(this,ei,"m",Ih).call(this,i,s),this.emit("connect",s)}),rr(this,Tt,e,"f");const n=Cs in e.features?e.features[Cs].supportedTransactionVersions:e.features[jn].supportedTransactionVersions;rr(this,zf,v9(n,["legacy"])?null:new Set(n),"f"),rr(this,xi,null,"f"),rr(this,Ha,null,"f"),rr(this,Da,!1,"f"),rr(this,$a,!1,"f")}get supportedTransactionVersions(){return $e(this,zf,"f")}get name(){return $e(this,Tt,"f").name}get icon(){return $e(this,Tt,"f").icon}get url(){return"https://github.com/solana-labs/wallet-standard"}get publicKey(){return $e(this,Ha,"f")}get connecting(){return $e(this,Da,"f")}get readyState(){return $e(this,Hf,"f")}get wallet(){return $e(this,Tt,"f")}get standard(){return!0}async connect(){try{if(this.connected||this.connecting)return;if($e(this,Hf,"f")!==Wt.Installed)throw new Ku;if(rr(this,Da,!0,"f"),!$e(this,Tt,"f").accounts.length)try{await $e(this,Tt,"f").features[XE].connect()}catch(r){throw new b0(r==null?void 0:r.message,r)}if(!$e(this,Tt,"f").accounts.length)throw new Bf;const e=$e(this,Tt,"f").accounts[0];let n;try{n=new ue(e.publicKey)}catch(r){throw new w0(r==null?void 0:r.message,r)}rr(this,ku,$e(this,Tt,"f").features[JE].on("change",$e(this,q0,"f")),"f"),$e(this,ei,"m",Ih).call(this,e,n),this.emit("connect",n)}catch(e){throw this.emit("error",e),e}finally{rr(this,Da,!1,"f")}}async disconnect(){if(ew in $e(this,Tt,"f").features)try{rr(this,$a,!0,"f"),await $e(this,Tt,"f").features[ew].disconnect()}catch(e){this.emit("error",new E6(e==null?void 0:e.message,e))}finally{rr(this,$a,!1,"f")}$e(this,ei,"m",Wf).call(this),this.emit("disconnect")}async sendTransaction(e,n,r={}){try{const i=$e(this,xi,"f");if(!i)throw new Oi;let s;if(Cs in $e(this,Tt,"f").features)if(i.features.includes(Cs))s=Cs;else if(jn in $e(this,Tt,"f").features&&i.features.includes(jn))s=jn;else throw new Bf;else if(jn in $e(this,Tt,"f").features){if(!i.features.includes(jn))throw new Bf;s=jn}else throw new Lf;const o=y9(n.rpcEndpoint);if(!i.chains.includes(o))throw new Wo;try{const{signers:a,...c}=r;let u;if(jo(e)?(a!=null&&a.length&&e.sign(a),u=e.serialize()):(e=await this.prepareTransaction(e,n,c),a!=null&&a.length&&e.partialSign(...a),u=new Uint8Array(e.serialize({requireAllSignatures:!1,verifySignatures:!1}))),s===Cs){const[l]=await $e(this,Tt,"f").features[Cs].signAndSendTransaction({account:i,chain:o,transaction:u,options:{preflightCommitment:hg(c.preflightCommitment||n.commitment),skipPreflight:c.skipPreflight,maxRetries:c.maxRetries,minContextSlot:c.minContextSlot}});return jt.encode(l.signature)}else{const[l]=await $e(this,Tt,"f").features[jn].signTransaction({account:i,chain:o,transaction:u,options:{preflightCommitment:hg(c.preflightCommitment||n.commitment),minContextSlot:c.minContextSlot}});return await n.sendRawTransaction(l.signedTransaction,{...c,preflightCommitment:hg(c.preflightCommitment||n.commitment)})}}catch(a){throw a instanceof er?a:new Wo(a==null?void 0:a.message,a)}}catch(i){throw this.emit("error",i),i}}}xi=new WeakMap,Ha=new WeakMap,Da=new WeakMap,$a=new WeakMap,ku=new WeakMap,Tt=new WeakMap,zf=new WeakMap,Hf=new WeakMap,q0=new WeakMap,ei=new WeakSet,Ih=function(e,n){rr(this,xi,e,"f"),rr(this,Ha,n,"f"),e!=null&&e.features.includes(jn)?(this.signTransaction=$e(this,ei,"m",l_),this.signAllTransactions=$e(this,ei,"m",f_)):(delete this.signTransaction,delete this.signAllTransactions),e!=null&&e.features.includes(sf)?this.signMessage=$e(this,ei,"m",h_):delete this.signMessage},Wf=function(){const e=$e(this,ku,"f");e&&(rr(this,ku,void 0,"f"),e()),$e(this,ei,"m",Ih).call(this,null,null)},l_=async function(e){try{const n=$e(this,xi,"f");if(!n)throw new Oi;if(!(jn in $e(this,Tt,"f").features))throw new Lf;if(!n.features.includes(jn))throw new Bf;try{const i=(await $e(this,Tt,"f").features[jn].signTransaction({account:n,transaction:jo(e)?e.serialize():new Uint8Array(e.serialize({requireAllSignatures:!1,verifySignatures:!1}))}
37))[0].signedTransaction;return jo(e)?Ah.deserialize(i):ot.from(i)}catch(r){throw r instanceof er?r:new zs(r==null?void 0:r.message,r)}}catch(n){throw this.emit("error",n),n}},f_=async function(e){try{const n=$e(this,xi,"f");if(!n)throw new Oi;if(!(jn in $e(this,Tt,"f").features))throw new Lf;if(!n.features.includes(jn))throw new zs;try{const r=await $e(this,Tt,"f").features[jn].signTransaction(...e.map(i=>({account:n,transaction:jo(i)?i.serialize():new Uint8Array(i.serialize({requireAllSignatures:!1,verifySignatures:!1}))})));return e.map((i,s)=>{const o=r[s].signedTransaction;return jo(i)?Ah.deserialize(o):ot.from(o)})}catch(r){throw new zs(r==null?void 0:r.message,r)}}catch(n){throw this.emit("error",n),n}},h_=async function(e){try{const n=$e(this,xi,"f");if(!n)throw new Oi;if(!(sf in $e(this,Tt,"f").features))throw new Lf;if(!n.features.includes(sf))throw new _0;try{return(await $e(this,Tt,"f").features[sf].signMessage({account:n,message:e}))[0].signature}catch(r){throw new _0(r==null?void 0:r.message,r)}}catch(n){throw this.emit("error",n),n}};const w9=R6;var _9=globalThis&&globalThis.__classPrivateFieldSet||function(t,e,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(t,n):i?i.value=n:e.set(t,n),n},k9=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)},jf;let br;const Kf=new Set,Wa={};function S9(){if(br||(br=Object.freeze({register:d_,get:E9,on:A9}),typeof window>"u"))return br;const t=Object.freeze({register:d_});try{window.addEventListener("wallet-standard:register-wallet",({detail:e})=>e(t))}catch(e){console.error(`wallet-standard:register-wallet event listener could not be added 38`,e)}try{window.dispatchEvent(new x9(t))}catch(e){console.error(`wallet-standard:app-ready event could not be dispatched 39`,e)}return br}function d_(...t){var e;return t=t.filter(n=>!Kf.has(n)),t.length?(t.forEach(n=>Kf.add(n)),(e=Wa.register)==null||e.forEach(n=>G0(()=>n(...t))),function(){var r;t.forEach(i=>Kf.delete(i)),(r=Wa.unregister)==null||r.forEach(i=>G0(()=>i(...t)))}):()=>{}}function E9(){return[...Kf]}function A9(t,e){var n;return(n=Wa[t])!=null&&n.push(e)||(Wa[t]=[e]),function(){var i;Wa[t]=(i=Wa[t])==null?void 0:i.filter(s=>e!==s)}}function G0(t){try{t()}catch(e){console.error(e)}}class x9 extends Event{constructor(e){super("wallet-standard:app-ready",{bubbles:!1,cancelable:!1,composed:!1}),jf.set(this,void 0),_9(this,jf,e,"f")}get detail(){return k9(this,jf,"f")}get type(){return"wallet-standard:app-ready"}preventDefault(){throw new Error("preventDefault cannot be called")}stopImmediatePropagation(){throw new Error("stopImmediatePropagation cannot be called")}stopPropagation(){throw new Error("stopPropagation cannot be called")}}jf=new WeakMap;function R9(){if(br||(br=S9(),typeof window>"u"))return br;const t=window.navigator.wallets||[];if(!Array.isArray(t))return console.error("window.navigator.wallets is not an array"),br;const{register:e}=br,n=(...r)=>r.forEach(i=>G0(()=>i({register:e})));try{Object.defineProperty(window.navigator,"wallets",{value:Object.freeze({push:n})})}catch{return console.error("window.navigator.wallets could not be set"),br}return n(...t),br}function T9(t){const e=new Set,{get:n,on:r}=R9(),i=ma(p_(n()));return oi(s=>{const o=[r("register",(...a)=>i.value=[...i.value,...p_(a)]),r("unregister",(...a)=>i.value=i.value.filter(c=>a.some(u=>u===c.wallet)))];s(()=>o.forEach(a=>a()))}),Ve(()=>[...i.value,...t.value.filter(({name:s})=>i.value.some(o=>o.name===s)?(e.has(s)||(e.add(s),console.warn(`${s} was registered as a Standard Wallet. The Wallet Adapter for ${s} can be removed from your app.`)),!1):!0)])}function p_(t){return t.filter(w9).map(e=>new b9({wallet:e}))}function O9(t,e){const n=async(o,a,c)=>{var l;const u=(l=t.value)==null?void 0:l.adapter;if(!u)throw e(new QE);if(!u.connected)throw e(new Oi,u);return await u.sendTransaction(o,a,c)},r=Ve(()=>{var a;const o=(a=t.value)==null?void 0:a.adapter;if(o&&"signTransaction"in o)return async c=>{if(!o.connected)throw e(new Oi);return await o.signTransaction(c)}}),i=Ve(()=>{var a;const o=(a=t.value)==null?void 0:a.adapter;if(o&&"signAllTransactions"in o)return async c=>{if(!o.connected)throw e(new Oi);return await o.signAllTransactions(c)}}),s=Ve(()=>{var a;const o=(a=t.value)==null?void 0:a.adapter;if(o&&"signMessage"in o)return async c=>{if(!o.connected)throw e(new Oi);return await o.signMessage(c)}});return{sendTransaction:n,signTransaction:r,signAllTransactions:i,signMessage:s}}function I9(t){const e=ct(!1);return typeof window>"u"||oi(n=>{if(t.value)return;const r=()=>e.value=!0;window.addEventListener("beforeunload",r),n(()=>window.removeEventListener("beforeunload",r))}),e}function C9(t,e){const n=ma(null),r=ct(null),i=ct(!1),s=ct(Wt.Unsupported),o=Ve(()=>s.value===Wt.Installed||s.value===Wt.Loadable),a=()=>{var c,u,l;r.value=((c=n.value)==null?void 0:c.adapter.publicKey)??null,i.value=((u=n.value)==null?void 0:u.adapter.connected)??!1,s.value=((l=n.value)==null?void 0:l.readyState)??Wt.Unsupported};return oi(()=>{n.value=e.value?t.value.find(({adapter:c})=>c.name===e.value)??null:null,a()}),{wallet:n,publicKey:r,connected:i,readyState:s,ready:o,refreshWalletState:a}}function N9(t){const e=ma([]);return oi(()=>{e.value=t.value.map(n=>({adapter:n,readyState:n.readyState}))}),e}const P9=({wallets:t=[],autoConnect:e=!1,cluster:n="mainnet-beta",onError:r,localStorageKey:i="walletName"})=>{const s=ct(n),o=ct(!1),a=ct(!1),c=ma(t),u=T9(c),{isMobile:l,uriForAppIdentity:h}=v7(u),p=A7(u,l,h,s),g=N9(p),{name:y,isUsingMwaAdapterOnMobile:w,select:k,deselect:T}=h9(i,l),{wallet:C,publicKey:O,connected:I,readyState:N,ready:F,refreshWalletState:L}=C9(g,y),D=I9(w),H=E7(D,r);x7(g),m7(C,D,w,T,L,H);const z=y7(e,C,w,o,I,F,T),{sendTransaction:K,signTransaction:_,signAllTransactions:m,signMessage:f}=O9(C,H);return{wallets:g,autoConnect:z,cluster:s,wallet:C,publicKey:O,readyState:N,ready:F,connected:I,connecting:o,disconnecting:a,select:k,connect:async()=>
39{if(I.value||o.value||a.value)return;if(!C.value)throw H(new QE);const b=C.value.adapter;if(!F.value)throw H(new Ku,b);try{o.value=!0,await b.connect()}catch(E){throw T(),E}finally{o.value=!1}},disconnect:async()=>{if(!(a.value||!C.value))try{a.value=!0,setTimeout(()=>{a.value=!1},1e3),await C.value.adapter.disconnect()}finally{a.value=!1}},sendTransaction:K,signTransaction:_,signAllTransactions:m,signMessage:f}};let Y0=null;const El=()=>{if(Y0)return Y0;throw new T6("Wallet not initialized. Please use the `initWallet` method to initialize the wallet.")},M9=t=>{Y0=P9(t)},L9=dr({props:{wallet:Object},setup(t){return Qh(t)}}),B9={class:"swv-button-icon"},D9=["src","alt"];function $9(t,e,n,r,i,s){return he(),Ee("i",B9,[t.wallet?(he(),Ee("img",{key:0,src:t.wallet.adapter.icon,alt:`${t.wallet.adapter.name} icon`},null,8,D9)):xt("",!0)])}const s1=wn(L9,[["render",$9]]),F9=dr({components:{WalletIcon:s1},props:{disabled:Boolean},setup(t,{emit:e}){const{disabled:n}=Qh(t),{wallet:r,connect:i,connecting:s,connected:o}=El(),a=Ve(()=>s.value?"Connecting ...":o.value?"Connected":r.value?"Connect":"Connect Wallet"),u={wallet:r,disabled:n,connecting:s,connected:o,content:a,onClick:l=>{e("click",l),!l.defaultPrevented&&i().catch(()=>{})}};return{scope:u,...u}}}),U9=["disabled"],z9=["textContent"];function H9(t,e,n,r,i,s){const o=mt("wallet-icon");return Gn(t.$slots,"default",Dr(Sr(t.scope)),()=>[ee("button",{class:"swv-button swv-button-trigger",disabled:t.disabled||!t.wallet||t.connecting||t.connected,onClick:e[0]||(e[0]=(...a)=>t.onClick&&t.onClick(...a))},[t.wallet?(he(),gn(o,{key:0,wallet:t.wallet},null,8,["wallet"])):xt("",!0),ee("p",{textContent:Oe(t.content)},null,8,z9)],8,U9)])}const W9=wn(F9,[["render",H9]]),j9=dr({components:{WalletIcon:s1},props:{featured:{type:Number,default:3},container:{type:String,default:"body"},logo:String,dark:Boolean},setup(t,{slots:e}){const{featured:n,container:r,logo:i,dark:s}=Qh(t),o=ct(null),a=ct(!1),c=()=>a.value=!0,u=()=>a.value=!1,l=Ve(()=>!!e.logo||!!i.value),{wallets:h,select:p}=El(),g=Ve(()=>{const I=[],N=[],F=[];return h.value.forEach(L=>{L.readyState===Wt.NotDetected?N.push(L):L.readyState===Wt.Loadable?F.push(L):L.readyState===Wt.Installed&&I.push(L)}
39),[...I,...F,...N]}),y=ct(!1),w=Ve(()=>g.value.slice(0,n.value)),k=Ve(()=>g.value.slice(n.value)),T=Ve(()=>y.value?h.value:w.value);Q2(o,u),t_("Escape",u),t_("Tab",I=>{var D;const N=((D=o.value)==null?void 0:D.querySelectorAll("button"))??[],F=N==null?void 0:N[0],L=N==null?void 0:N[N.length-1];I.shiftKey&&document.activeElement===F&&L?(L.focus(),I.preventDefault()):!I.shiftKey&&document.activeElement===L&&F&&(F.focus(),I.preventDefault())}),ai(a,I=>{I&&ho(()=>{var N,F,L;return(L=(F=(N=o.value)==null?void 0:N.querySelectorAll("button"))==null?void 0:F[0])==null?void 0:L.focus()})});const C=o9(document.body);ai(a,I=>C.value=I);const O={dark:s,logo:i,hasLogo:l,featured:n,container:r,modalPanel:o,modalOpened:a,openModal:c,closeModal:u,expandedWallets:y,walletsToDisplay:T,featuredWallets:w,hiddenWallets:k,selectWallet:p};return{scope:O,...O}}}),K9=ee("div",{class:"swv-modal-overlay"},null,-1),V9={class:"swv-modal-container",ref:"modalPanel"},q9={key:0,class:"swv-modal-logo-wrapper"},G9=["src"],Y9={class:"swv-header-row"},Z9=ee("h1",{class:"swv-modal-title",id:"swv-modal-title"},"Connect Wallet",-1),X9=ee("i",{class:"fa-solid fa-xmark"},null,-1),J9=[X9],Q9={class:"swv-modal-list"},eW=["onClick"],tW={class:"swv-button"},nW=["textContent"],rW={key:0,class:"swv-wallet-status"},iW=["aria-expanded"],sW=ee("i",{class:"swv-button-icon"},[ee("svg",{width:"11",height:"6",xmlns:"http://www.w3.org/2000/svg"},[ee("path",{d:"m5.938 5.73 4.28-4.126a.915.915 0 0 0 0-1.322 1 1 0 0 0-1.371 0L5.253 3.736 1.659.272a1 1 0 0 0-1.371 0A.93.93 0 0 0 0 .932c0 .246.1.48.288.662l4.28 4.125a.99.99 0 0 0 1.37.01z"})])],-1);function oW(t,e,n,r,i,s){const o=mt("wallet-icon");return he(),Ee(Ct,null,[ee("div",{class:Kt(t.dark?"swv-dark":"")},[Gn(t.$slots,"default",Dr(Sr(t.scope)))],2),t.modalOpened?(he(),gn(GC,{key:0,to:t.container},[ee("div",{"aria-labelledby":"swv-modal-title","aria-modal":"true",class:Kt(["swv-modal",t.dark?"swv-dark":""]),role:"dialog"},[Gn(t.$slots,"overlay",Dr(Sr(t.scope)),()=>[K9]),ee("div",V9,[Gn(t.$slots,"modal",Dr(Sr(t.scope)),()=>[ee("div",{class:Kt(["swv-modal-wrapper",{"swv-modal-wrapper-no-logo":!t.hasLogo}])},[t.hasLogo?(he(),Ee("div",q9,[Gn(t.$slots,"logo",Dr(Sr(t.scope)),()=>[ee("img",{alt:"logo",class:"swv-modal-logo",src:t.logo},null,8,G9)])])):xt("",!0),ee("div",Y9,[Z9,ee("button",{onClick:e[0]||(e[0]=PN((...a)=>t.closeModal&&t.closeModal(...a),["prevent"])),class:"swv-modal-button-close"},J9)]),ee("ul",Q9,[(he(!0),Ee(Ct,null,so(t.walletsToDisplay,a=>(he(),Ee("li",{key:a.adapter.name,onClick:c=>{t.selectWallet(a.adapter.name),t.closeModal()}},[ee("button",tW,[Pe(o,{wallet:a},null,8,["wallet"]),ee("p",{textContent:Oe(a.adapter.name)},null,8,nW),a.readyState==="Installed"?(he(),Ee("div",rW," Detected ")):xt("",!0)])],8,eW))),128))]),t.hiddenWallets.length>0?(he(),Ee("button",{key:1,"aria-controls":"swv-modal-collapse","aria-expanded":t.expandedWallets,class:Kt(["swv-button swv-modal-collapse-button",{"swv-modal-collapse-button-active":t.expandedWallets}]),onClick:e[1]||(e[1]=a=>t.expandedWallets=!t.expandedWallets)},[Qr(Oe(t.expandedWallets?"Less":"More")+" options ",1),sW],10,iW)):xt("",!0)],2)])],512)],2)],8,["to"])):xt("",!0)],64)}const aW=wn(j9,[["render",oW]]),cW=dr({components:{WalletConnectButton:W9,WalletIcon:s1,WalletModalProvider:aW},props:{featured:{type:Number,default:3},container:{type:String,default:"body"},logo:String,dark:Boolean},setup(t){const{featured:e,container:n,logo:r,dark:i}=Qh(t),{publicKey:s,wallet:o,disconnect:a}=El(),c=ct(),u=ct(!1),l=()=>{u.value=!0},h=()=>{u.value=!1};Q2(c,h);const p=Ve(()=>{var O;return(O=s.value)==null?void 0:O.toBase58()}),g=Ve(()=>!o.value||!p.value?null:p.value.slice(0,4)),{copy:y,copied:w,isSupported:k}=Y7(),C={featured:e,container:n,logo:r,dark:i,wallet:o,publicKey:s,publicKeyTrimmed:g,publicKeyBase58:p,canCopy:k,addressCopied:w,dropdownPanel:c,dropdownOpened:u,openDropdown:l,closeDropdown:h,copyAddress:()=>p.value&&y(p.value),disconnect:a};return{scope:C,...C}}}),uW=["onClick"],lW={key:2,class:"swv-dropdown"},fW=["aria-expanded","title"],hW=["textContent"],dW=["onClick"];function pW(t,e,n,r,i,s){const o=mt("wallet-connect-button"),a=mt("wallet-icon"),c=mt("wallet-modal-provider");return he(),gn(c,{featured:t.featured,container:t.container,logo:t.logo,dark:t.dark},{default:Ii(u=>[Gn(t.$slots,"default",Dr(Sr({...u,...t.scope})),()=>[t.wallet?t.publicKeyBase58?(he(),Ee("div",lW,[Gn(t.$slots,"dropdown-button",Dr(Sr({...u,...t.scope})),()=>[ee("button",{class:"swv-button swv-button-trigger",style:Ir({pointerEvents:t.dropdownOpened?"none":"auto"}),"aria-expanded":t.dropdownOpened,title:t.publicKeyBase58,onClick:e[0]||(e[0]=(...l)=>t.openDropdown&&t.openDropdown(...l))},[Pe(a,{wallet:t.wallet},null,8,["wallet"]),ee("p",{textContent:Oe(t.publicKeyTrimmed)},null,8,hW)],12,fW)]),Gn(t.$slots,"dropdown",Dr(Sr({...u,...t.scope})),()=>[ee("ul",{"aria-label":"dropdown-list",class:Kt(["swv-dropdown-list",{"swv-dropdown-list-active":t.dropdownOpened}]),ref:"dropdownPanel",role:"menu"},[Gn(t.$slots,"dropdown-list",Dr(Sr({...u,...t.scope})),()=>[t.canCopy?(he(),Ee("li",{key:0,onClick:e[1]||(e[1]=l=>{t.copyAddress(),t.closeDropdown()}),class:"swv-dropdown-list-item",role:"menuitem"},Oe(t.addressCopied?"Copied":"Copy Address"),1)):xt("",!0),ee("li",{onClick:l=>{u.openModal(),t.closeDropdown()},class:"swv-dropdown-list-item",role:"menuitem"}," Change Wallet ",8,dW),ee("li",{onClick:e[2]||(e[2]=l=>{t.disconnect(),t.closeDropdown()}),class:"swv-dropdown-list-item",role:"menuitem"}," Disconnect ")])],2)])])):(he(),gn(o,{key:1})):(he(),Ee("button",{key:0,class:"swv-button swv-button-trigger",onClick:u.openModal}," Connect ",8,uW))])]),overlay:Ii(u=>[Gn(t.$slots,"modal-overlay",Dr(Sr({...u,...t.scope})))]),modal:Ii(u=>[Gn(t.$slots,"modal",Dr(Sr({...u,...t.scope})))]),_:3},8,["featured","container","logo","dark"])}const gW=wn(cW,[["render",pW]]);function mW(){const t=El();return Ve(()=>{if(!t)return;const{signTransaction:e,signAllTransactions:n,publicKey:r}=t;if(!(!r.value||!e.value||!n.value))return{publicKey:r.value,signTransaction:e.value,signAllTransactions:n.value}})}const yW={install:(t,e={})=>{M9(e),t.config.globalProperties.$wallet=El()}},vW={__name:"Wallet",setup(t){return(e,n)=>(he(),gn(Um(gW)))}};var o1={exports:{}};const bW=/[\p{Lu}]/u,wW=/[\p{Ll}]/u,g_=/^[\p{Lu}](?![\p{Lu}])/gu,tx=/([\p{Alpha}\p{N}_]|$)/u,nx=/[_.\- ]+/,_W=new RegExp("^"+nx.source),m_=new RegExp(nx.source+tx.source,"gu"),y_=new RegExp("\\d+"+tx.source,"gu"),kW=(t,e,n)=>{let r=!1,i=!1,s=!1;for(let o=0;o<t.length;o++){const a=t[o];r&&bW.test(a)?(t=t.slice(0,o)+"-"+t.slice(o),r=!1,s=i,i=!0,o++):i&&s&&wW.test(a)?(t=t.slice(0,o-1)+"-"+t.slice(o-1),s=i,i=!1,r=!0):(r=e(a)===a&&n(a)!==a,s=i,i=n(a)===a&&e(a)!==a)}return t},SW=(t,e)=>(g_.lastIndex=0,t.replace(g_,n=>e(n))),EW=(t,e)=>(m_.lastIndex=0,y_.lastIndex=0,t.replace(m_,(n,r)=>e(r)).replace(y_,n=>e(n))),rx=(t,e)=>{if(!(typeof t=="string"||Array.isArray(t)))throw new TypeError("Expected the input to be `string | string[]`");if(e={pascalCase:!1,preserveConsecutiveUppercase:!1,...e},Array.isArray(t)?t=t.map(s=>s.trim()).filter(s=>s.length).join("-"):t=t.trim(),t.length===0)return"";const n=e.locale===!1?s=>s.toLowerCase():s=>s.toLocaleLowerCase(e.locale),r=e.locale===!1?s=>s.toUpperCase():s=>s.toLocaleUpperCase(e.locale);return t.length===1?e.pascalCase?r(t):n(t):(t!==n(t)&&(t=kW(t,n,r)),t=t.replace(_W,""),e.preserveConsecutiveUppercase?t=SW(t,n):t=n(t),e.pascalCase&&(t=r(t.charAt(0))+t.slice(1)),EW(t,r))};o1.exports=rx;o1.exports.default=rx;var AW=o1.exports;const xW=Ui(AW);var He={},ke={};let wt=class{constructor(e,n){if(!Number.isInteger(e))throw new TypeError("span must be an integer");this.span=e,this.property=n}makeDestinationObject(){return{}}decode(e,n){throw new Error("Layout is abstract")}encode(e,n,r){throw new Error("Layout is abstract")}getSpan(e,n){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(e){const n=Object.create(this.constructor.prototype);return Object.assign(n,this),n.property=e,n}fromArray(e){}};ke.Layout=wt;function a1(t,e){return e.property?t+"["+e.property+"]":t}ke.nameWithProperty=a1;function RW(t,e){if(typeof t!="function")throw new TypeError("Class must be constructor");if(t.hasOwnProperty("layout_"))throw new Error("Class is already bound to a layout");if(!(e&&e instanceof wt))throw new TypeError("layout must be a Layout");if(e.hasOwnProperty("boundConstructor_"))throw new Error("layout is already bound to a constructor");
39t.layout_=e,e.boundConstructor_=t,e.makeDestinationObject=()=>new t,Object.defineProperty(t.prototype,"encode",{value:function(n,r){return e.encode(this,n,r)},writable:!0}),Object.defineProperty(t,"decode",{value:function(n,r){return e.decode(n,r)},writable:!0})}ke.bindConstructorLayout=RW;let ar=class extends wt{isCount(){throw new Error("ExternalLayout is abstract")}};class ix extends ar{constructor(e,n){if(e===void 0&&(e=1),!Number.isInteger(e)||0>=e)throw new TypeError("elementSpan must be a (positive) integer");super(-1,n),this.elementSpan=e}isCount(){return!0}decode(e,n){n===void 0&&(n=0);const r=e.length-n;return Math.floor(r/this.elementSpan)}encode(e,n,r){return 0}}let c1=class extends ar{constructor(e,n,r){if(!(e instanceof wt))throw new TypeError("layout must be a Layout");if(n===void 0)n=0;else if(!Number.isInteger(n))throw new TypeError("offset must be integer or undefined");super(e.span,r||e.property),this.layout=e,this.offset=n}isCount(){return this.layout instanceof Vi||this.layout instanceof _s}decode(e,n){return n===void 0&&(n=0),this.layout.decode(e,n+this.offset)}encode(e,n,r){return r===void 0&&(r=0),this.layout.encode(e,n,r+this.offset)}},Vi=class extends wt{constructor(e,n){if(super(e,n),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,n){return n===void 0&&(n=0),e.readUIntLE(n,this.span)}encode(e,n,r){return r===void 0&&(r=0),n.writeUIntLE(e,r,this.span),this.span}},_s=class extends wt{constructor(e,n){if(super(e,n),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,n){return n===void 0&&(n=0),e.readUIntBE(n,this.span)}encode(e,n,r){return r===void 0&&(r=0),n.writeUIntBE(e,r,this.span),this.span}};class xa extends wt{constructor(e,n){if(super(e,n),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,n){return n===void 0&&(n=0),e.readIntLE(n,this.span)}encode(e,n,r){return r===void 0&&(r=0),n.writeIntLE(e,r,this.span),this.span}}class Mc extends wt{constructor(e,n){if(super(e,n),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,n){return n===void 0&&(n=0),e.readIntBE(n,this.span)}encode(e,n,r){return r===void 0&&(r=0),n.writeIntBE(e,r,this.span),this.span}}const Z0=Math.pow(2,32);function Dd(t){const e=Math.floor(t/Z0),n=t-e*Z0;return{hi32:e,lo32:n}}function $d(t,e){return t*Z0+e}let TW=class extends wt{constructor(e){super(8,e)}decode(e,n){n===void 0&&(n=0);const r=e.readUInt32LE(n),i=e.readUInt32LE(n+4);return $d(i,r)}encode(e,n,r){r===void 0&&(r=0);const i=Dd(e);return n.writeUInt32LE(i.lo32,r),n.writeUInt32LE(i.hi32,r+4),8}};class OW extends wt{constructor(e){super(8,e)}decode(e,n){n===void 0&&(n=0);const r=e.readUInt32BE(n),i=e.readUInt32BE(n+4);return $d(r,i)}encode(e,n,r){r===void 0&&(r=0);const i=Dd(e);return n.writeUInt32BE(i.hi32,r),n.writeUInt32BE(i.lo32,r+4),8}}let IW=class extends wt{constructor(e){super(8,e)}decode(e,n){n===void 0&&(n=0);const r=e.readUInt32LE(n),i=e.readInt32LE(n+4);return $d(i,r)}encode(e,n,r){r===void 0&&(r=0);const i=Dd(e);return n.writeUInt32LE(i.lo32,r),n.writeInt32LE(i.hi32,r+4),8}};class CW extends wt{constructor(e){super(8,e)}decode(e,n){n===void 0&&(n=0);const r=e.readInt32BE(n),i=e.readUInt32BE(n+4);return $d(r,i)}encode(e,n,r){r===void 0&&(r=0);const i=Dd(e);return n.writeInt32BE(i.hi32,r),n.writeUInt32BE(i.lo32,r+4),8}}class sx extends wt{constructor(e){super(4,e)}decode(e,n){return n===void 0&&(n=0),e.readFloatLE(n)}encode(e,n,r){return r===void 0&&(r=0),n.writeFloatLE(e,r),4}}class ox extends wt{constructor(e){super(4,e)}decode(e,n){return n===void 0&&(n=0),e.readFloatBE(n)}encode(e,n,r){return r===void 0&&(r=0),n.writeFloatBE(e,r),4}}class ax extends wt{constructor(e){super(8,e)}decode(e,n){return n===void 0&&(n=0),e.readDoubleLE(n)}encode(e,n,r){return r===void 0&&(r=0),n.writeDoubleLE(e,r),8}}class cx extends wt{constructor(e){super(8,e)}decode(e,n){return n===void 0&&(n=0),e.readDoubleBE(n)}encode(e,n,r){return r===void 0&&(r=0),n.writeDoubleBE(e,r),8}}class ux extends wt{constructor(e,n,r){if(!(e instanceof wt))throw new TypeError("elementLayout must be a Layout");if(!(n instanceof ar&&n.isCount()||Number.isInteger(n)&&0<=n))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let i=-1;!(n instanceof ar)&&0<e.span&&(i=n*e.span),super(i,r),this.elementLayout=e,this.count=n}getSpan(e,n){if(0<=this.span)return this.span;n===void 0&&(n=0);let r=0,i=this.count;if(i instanceof ar&&(i=i.decode(e,n)),0<this.elementLayout.span)r=i*this.elementLayout.span;else{let s=0;for(;s<i;)r+=this.elementLayout.getSpan(e,n+r),++s}return r}decode(e,n){n===void 0&&(n=0);const r=[];let i=0,s=this.count;for(s instanceof ar&&(s=s.decode(e,n));i<s;)r.push(this.elementLayout.decode(e,n)),n+=this.elementLayout.getSpan(e,n),i+=1;return r}encode(e,n,r){r===void 0&&(r=0);const i=this.elementLayout,s=e.reduce((o,a)=>o+i.encode(a,n,r+o),0);return this.count instanceof ar&&this.count.encode(e.length,n,r),s}}let lx=class extends wt{constructor(e,n,r){if(!(Array.isArray(e)&&e.reduce((s,o)=>s&&o instanceof wt,!0)))throw new TypeError("fields must be array of Layout instances");typeof n=="boolean"&&r===void 0&&(r=n,n=void 0);for(const s of e)if(0>s.span&&s.property===void 0)throw new Error("fields cannot contain unnamed variable-length layout");let i=-1;try{i=e.reduce((s,o)=>s+o.getSpan(),0)}catch{}super(i,n),this.fields=e,this.decodePrefixes=!!r}getSpan(e,n){if(0<=this.span)return this.span;n===void 0&&(n=0);let r=0;try{r=this.fields.reduce((i,s)=>
39{const o=s.getSpan(e,n);return n+=o,i+o},0)}catch{throw new RangeError("indeterminate span")}return r}decode(e,n){n===void 0&&(n=0);const r=this.makeDestinationObject();for(const i of this.fields)if(i.property!==void 0&&(r[i.property]=i.decode(e,n)),n+=i.getSpan(e,n),this.decodePrefixes&&e.length===n)break;return r}encode(e,n,r){r===void 0&&(r=0);const i=r;let s=0,o=0;for(const a of this.fields){let c=a.span;if(o=0<c?c:0,a.property!==void 0){const u=e[a.property];u!==void 0&&(o=a.encode(u,n,r),0>c&&(c=a.getSpan(n,r)))}s=r,r+=c}return s+o-i}fromArray(e){const n=this.makeDestinationObject();for(const r of this.fields)r.property!==void 0&&0<e.length&&(n[r.property]=e.shift());return n}layoutFor(e){if(typeof e!="string")throw new TypeError("property must be string");for(const n of this.fields)if(n.property===e)return n}offsetOf(e){if(typeof e!="string")throw new TypeError("property must be string");let n=0;for(const r of this.fields){if(r.property===e)return n;0>r.span?n=-1:0<=n&&(n+=r.span)}}},u1=class{constructor(e){this.property=e}decode(){throw new Error("UnionDiscriminator is abstract")}encode(){throw new Error("UnionDiscriminator is abstract")}},Ch=class extends u1{constructor(e,n){if(!(e instanceof ar&&e.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");super(n||e.property||"variant"),this.layout=e}decode(e,n){return this.layout.decode(e,n)}encode(e,n,r){return this.layout.encode(e,n,r)}},l1=class extends wt{constructor(e,n,r){const i=e instanceof Vi||e instanceof _s;if(i)e=new Ch(new c1(e));else if(e instanceof ar&&e.isCount())e=new Ch(e);else if(!(e instanceof u1))throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(n===void 0&&(n=null),!(n===null||n instanceof wt))throw new TypeError("defaultLayout must be null or a Layout");if(n!==null){if(0>n.span)throw new Error("defaultLayout must have constant span");n.property===void 0&&(n=n.replicate("content"))}let s=-1;n&&(s=n.span,0<=s&&i&&(s+=e.layout.span)),super(s,r),this.discriminator=e,this.usesPrefixDiscriminator=i,this.defaultLayout=n,this.registry={};let o=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(a){return o(a)},this.configGetSourceVariant=function(a){o=a.bind(this)}}getSpan(e,n){if(0<=this.span)return this.span;n===void 0&&(n=0);const r=this.getVariant(e,n);if(!r)throw new Error("unable to determine span for unrecognized variant");return r.getSpan(e,n)}defaultGetSourceVariant(e){if(e.hasOwnProperty(this.discriminator.property)){if(this.defaultLayout&&e.hasOwnProperty(this.defaultLayout.property))return;const n=this.registry[e[this.discriminator.property]];if(n&&(!n.layout||e.hasOwnProperty(n.property)))return n}else for(const n in this.registry){const r=this.registry[n];if(e.hasOwnProperty(r.property))return r}throw new Error("unable to infer src variant")}decode(e,n){n===void 0&&(n=0);let r;const i=this.discriminator,s=i.decode(e,n);let o=this.registry[s];if(o===void 0){let a=0;o=this.defaultLayout,this.usesPrefixDiscriminator&&(a=i.layout.span),r=this.makeDestinationObject(),r[i.property]=s,r[o.property]=this.defaultLayout.decode(e,n+a)}else r=o.decode(e,n);return r}encode(e,n,r){r===void 0&&(r=0);const i=this.getSourceVariant(e);if(i===void 0){const s=this.discriminator,o=this.defaultLayout;let a=0;return this.usesPrefixDiscriminator&&(a=s.layout.span),s.encode(e[s.property],n,r),a+o.encode(e[o.property],n,r+a)}return i.encode(e,n,r)}addVariant(e,n,r){const i=new fx(this,e,n,r);return this.registry[e]=i,i}getVariant(e,n){let r=e;return ne.Buffer.isBuffer(e)&&(n===void 0&&(n=0),r=this.discriminator.decode(e,n)),this.registry[r]}},fx=class extends wt{constructor(e,n,r,i){if(!(e instanceof l1))throw new TypeError("union must be a Union");if(!Number.isInteger(n)||0>n)throw new TypeError("variant must be a (non-negative) integer");if(typeof r=="string"&&i===void 0&&(i=r,r=null),r){if(!(r instanceof wt))throw new TypeError("layout must be a Layout");if(e.defaultLayout!==null&&0<=r.span&&r.span>e.defaultLayout.span)throw new Error("variant span exceeds span of containing union");
39if(typeof i!="string")throw new TypeError("variant must have a String property")}let s=e.span;0>e.span&&(s=r?r.span:0,0<=s&&e.usesPrefixDiscriminator&&(s+=e.discriminator.layout.span)),super(s,i),this.union=e,this.variant=n,this.layout=r||null}getSpan(e,n){if(0<=this.span)return this.span;n===void 0&&(n=0);let r=0;return this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),r+this.layout.getSpan(e,n+r)}decode(e,n){const r=this.makeDestinationObject();if(n===void 0&&(n=0),this!==this.union.getVariant(e,n))throw new Error("variant mismatch");let i=0;return this.union.usesPrefixDiscriminator&&(i=this.union.discriminator.layout.span),this.layout?r[this.property]=this.layout.decode(e,n+i):this.property?r[this.property]=!0:this.union.usesPrefixDiscriminator&&(r[this.union.discriminator.property]=this.variant),r}encode(e,n,r){r===void 0&&(r=0);let i=0;if(this.union.usesPrefixDiscriminator&&(i=this.union.discriminator.layout.span),this.layout&&!e.hasOwnProperty(this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,n,r);let s=i;if(this.layout&&(this.layout.encode(e[this.property],n,r+i),s+=this.layout.getSpan(n,r+i),0<=this.union.span&&s>this.union.span))throw new Error("encoded variant overruns containing union");return s}fromArray(e){if(this.layout)return this.layout.fromArray(e)}};function Fa(t){return 0>t&&(t+=4294967296),t}class f1 extends wt{constructor(e,n,r){if(!(e instanceof Vi||e instanceof _s))throw new TypeError("word must be a UInt or UIntBE layout");if(typeof n=="string"&&r===void 0&&(r=n,n=void 0),4<e.span)throw new RangeError("word cannot exceed 32 bits");super(e.span,r),this.word=e,this.msb=!!n,this.fields=[];let i=0;this._packedSetValue=function(s){return i=Fa(s),this},this._packedGetValue=function(){return i}}decode(e,n){const r=this.makeDestinationObject();n===void 0&&(n=0);const i=this.word.decode(e,n);this._packedSetValue(i);for(const s of this.fields)s.property!==void 0&&(r[s.property]=s.decode(i));return r}encode(e,n,r){r===void 0&&(r=0);const i=this.word.decode(n,r);this._packedSetValue(i);for(const s of this.fields)if(s.property!==void 0){const o=e[s.property];o!==void 0&&s.encode(o)}return this.word.encode(this._packedGetValue(),n,r)}addField(e,n){const r=new Su(this,e,n);return this.fields.push(r),r}addBoolean(e){const n=new hx(this,e);return this.fields.push(n),n}fieldFor(e){if(typeof e!="string")throw new TypeError("property must be string");for(const n of this.fields)if(n.property===e)return n}}class Su{constructor(e,n,r){if(!(e instanceof f1))throw new TypeError("container must be a BitStructure");if(!Number.isInteger(n)||0>=n)throw new TypeError("bits must be positive integer");const i=8*e.span,s=e.fields.reduce((o,a)=>o+a.bits,0);if(n+s>i)throw new Error("bits too long for span remainder ("+(i-s)+" of "+i+" remain)");this.container=e,this.bits=n,this.valueMask=(1<<n)-1,n===32&&(this.valueMask=4294967295),this.start=s,this.container.msb&&(this.start=i-s-n),this.wordMask=Fa(this.valueMask<<this.start),this.property=r}decode(){const e=this.container._packedGetValue();return Fa(e&this.wordMask)>>>this.start}encode(e){if(!Number.isInteger(e)||e!==Fa(e&this.valueMask))throw new TypeError(a1("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);const n=this.container._packedGetValue(),r=Fa(e<<this.start);this.container._packedSetValue(Fa(n&~this.wordMask)|r)}}let hx=class extends Su{constructor(e,n){super(e,1,n)}decode(e,n){return!!Su.prototype.decode.call(this,e,n)}encode(e){return typeof e=="boolean"&&(e=+e),Su.prototype.encode.call(this,e)}},dx=class extends wt{constructor(e,n){if(!(e instanceof ar&&e.isCount()||Number.isInteger(e)&&0<=e))throw new TypeError("length must be positive integer or an unsigned integer ExternalLayout");let r=-1;e instanceof ar||(r=e),super(r,n),this.length=e}getSpan(e,n){let r=this.span;return 0>r&&(r=this.length.decode(e,n)),r}decode(e,n){n===void 0&&(n=0);let r=this.span;return 0>r&&(r=this.length.decode(e,n)),e.slice(n,n+r)}encode(e,n,r){let i=this.length;if(this.length instanceof ar&&(i=e.length),!(ne.Buffer.isBuffer(e)&&i===e.length))throw new TypeError(a1("Blob.encode",this)+" requires (length "+i+") Buffer as src");if(r+i>n.length)throw new RangeError("encoding overruns Buffer");return n.write(e.toString("hex"),r,i,"hex"),this.length instanceof ar&&this.length.encode(i,n,r),i}};class px extends wt{constructor(e){super(-1,e)}getSpan(e,n){if(!ne.Buffer.isBuffer(e))throw new TypeError("b must be a Buffer");n===void 0&&(n=0);let r=n;for(;r<e.length&&e[r]!==0;)r+=1;return 1+r-n}decode(e,n,r){n===void 0&&(n=0);let i=this.getSpan(e,n);return e.slice(n,n+i-1).toString("utf-8")}encode(e,n,r){r===void 0&&(r=0),typeof e!="string"&&(e=e.toString());const i=new ne.Buffer(e,"utf8"),s=i.length;if(r+s>n.length)throw new RangeError("encoding overruns Buffer");return i.copy(n,r),n[r+s]=0,s+1}}class gx extends wt{constructor(e,n){if(typeof e=="string"&&n===void 0&&(n=e,e=void 0),e===void 0)e=-1;else if(!Number.isInteger(e))throw new TypeError("maxSpan must be an integer");super(-1,n),this.maxSpan=e}getSpan(e,n){if(!ne.Buffer.isBuffer(e))throw new TypeError("b must be a Buffer");return n===void 0&&(n=0),e.length-n}decode(e,n,r){n===void 0&&(n=0);let i=this.getSpan(e,n);if(0<=this.maxSpan&&this.maxSpan<i)throw new RangeError("text length exceeds maxSpan");return e.slice(n,n+i).toString("utf-8")}encode(e,n,r){r===void 0&&(r=0),typeof e!="string"&&(e=e.toString());const i=new ne.Buffer(e,"utf8"),s=i.length;if(0<=this.maxSpan&&this.maxSpan<s)throw new RangeError("text length exceeds maxSpan");if(r+s>n.length)throw new RangeError("encoding overruns Buffer");return i.copy(n,r),s}}class mx extends wt{constructor(e,n){super(0,n),this.value=e}decode(e,n,r){return this.value}encode(e,n,r){return 0}}ke.ExternalLayout=ar;ke.GreedyCount=ix;ke.OffsetLayout=c1;ke.UInt=Vi;ke.UIntBE=_s;ke.Int=xa;ke.IntBE=Mc;ke.Float=sx;ke.FloatBE=ox;ke.Double=ax;ke.DoubleBE=cx;ke.Sequence=ux;ke.Structure=lx;ke.UnionDiscriminator=u1;ke.UnionLayoutDiscriminator=Ch;ke.Union=l1;ke.VariantLayout=fx;ke.BitStructure=f1;ke.BitField=Su;ke.Boolean=hx;ke.Blob=dx;ke.CString=px;ke.UTF8=gx;ke.Constant=mx;ke.greedy=(t,e)=>new ix(t,e);ke.offset=(t,e,n)=>new c1(t,e,n);ke.u8=t=>new Vi(1,t);ke.u16=t=>new Vi(2,t);ke.u24=t=>new Vi(3,t);ke.u32=t=>new Vi(4,t);ke.u40=t=>new Vi(5,t);ke.u48=t=>new Vi(6,t);ke.nu64=t=>new TW(t);ke.u16be=t=>new _s(2,t);ke.u24be=t=>new _s(3,t);ke.u32be=t=>new _s(4,t);ke.u40be=t=>new _s(5,t);ke.u48be=t=>new _s(6,t);ke.nu64be=t=>new OW(t);ke.s8=t=>new xa(1,t);ke.s16=t=>new xa(2,t);ke.s24=t=>new xa(3,t);ke.s32=t=>new xa(4,t);ke.s40=t=>new xa(5,t);ke.s48=t=>new xa(6,t);ke.ns64=t=>new IW(t);ke.s16be=t=>new Mc(2,t);ke.s24be=t=>new Mc(3,t);ke.s32be=t=>new Mc(4,t);ke.s40be=t=>new Mc(5,t);ke.s48be=t=>new Mc(6,t);ke.ns64be=t=>new CW(t);ke.f32=t=>new sx(t);ke.f32be=t=>new ox(t);ke.f64=t=>new ax(t);ke.f64be=t=>new cx(t);ke.struct=(t,e,n)=>new lx(t,e,n);ke.bits=(t,e,n)=>new f1(t,e,n);ke.seq=(t,e,n)=>new ux(t,e,n);ke.union=(t,e,n)=>new l1(t,e,n);ke.unionLayoutDiscriminator=(t,e)=>new Ch(t,e);ke.blob=(t,e)=>new dx(t,e);ke.cstr=t=>new px(t);ke.utf8=(t,e)=>new gx(t,e);ke.const=(t,e)=>new mx(t,e);const NW=zi(j2);(function(t){var e=Jn&&Jn.__importDefault||function(_){return _&&_.__esMo
39dule?_:{default:_}};Object.defineProperty(t,"__esModule",{value:!0}),t.struct=t.f64=t.f32=t.i32=t.u32=t.i16=t.u16=t.i8=t.u8=void 0,t.u64=a,t.i64=c,t.u128=u,t.i128=l,t.u256=h,t.i256=p,t.publicKey=y,t.option=k,t.bool=T,t.vec=I,t.tagged=N,t.vecU8=F,t.str=L,t.rustEnum=D,t.array=H,t.map=K;const n=ke,r=NW,i=e(Py);var s=ke;Object.defineProperty(t,"u8",{enumerable:!0,get:function(){return s.u8}}),Object.defineProperty(t,"i8",{enumerable:!0,get:function(){return s.s8}}),Object.defineProperty(t,"u16",{enumerable:!0,get:function(){return s.u16}}),Object.defineProperty(t,"i16",{enumerable:!0,get:function(){return s.s16}}),Object.defineProperty(t,"u32",{enumerable:!0,get:function(){return s.u32}}),Object.defineProperty(t,"i32",{enumerable:!0,get:function(){return s.s32}}),Object.defineProperty(t,"f32",{enumerable:!0,get:function(){return s.f32}}),Object.defineProperty(t,"f64",{enumerable:!0,get:function(){return s.f64}}),Object.defineProperty(t,"struct",{enumerable:!0,get:function(){return s.struct}});class o extends n.Layout{constructor(m,f,d){super(m,d),this.blob=(0,n.blob)(m),this.signed=f}decode(m,f=0){const d=new i.default(this.blob.decode(m,f),10,"le");return this.signed?d.fromTwos(this.span*8).clone():d}encode(m,f,d=0){return this.signed&&(m=m.toTwos(this.span*8)),this.blob.encode(m.toArrayLike(ne.Buffer,"le",this.span),f,d)}}function a(_){return new o(8,!1,_)}function c(_){return new o(8,!0,_)}function u(_){return new o(16,!1,_)}function l(_){return new o(16,!0,_)}function h(_){return new o(32,!1,_)}function p(_){return new o(32,!0,_)}class g extends n.Layout{constructor(m,f,d,v){super(m.span,v),this.layout=m,this.decoder=f,this.encoder=d}decode(m,f){return this.decoder(this.layout.decode(m,f))}encode(m,f,d){return this.layout.encode(this.encoder(m),f,d)}getSpan(m,f){return this.layout.getSpan(m,f)}}function y(_){return new g((0,n.blob)(32),m=>new r.PublicKey(m),m=>m.toBuffer(),_)}class w extends n.Layout{constructor(m,f){super(-1,f),this.layout=m,this.discriminator=(0,n.u8)()}encode(m,f,d=0){return m==null?this.discriminator.encode(0,f,d):(this.discriminator.encode(1,f,d),this.layout.encode(m,f,d+1)+1)}decode(m,f=0){const d=this.discriminator.decode(m,f);if(d===0)return null;if(d===1)return this.layout.decode(m,f+1);throw new Error("Invalid option "+this.property)}getSpan(m,f=0){const d=this.discriminator.decode(m,f);if(d===0)return 1;if(d===1)return this.layout.getSpan(m,f+1)+1;throw new Error("Invalid option "+this.property)}}function k(_,m){return new w(_,m)}function T(_){return new g((0,n.u8)(),C,O,_)}function C(_){if(_===0)return!1;if(_===1)return!0;throw new Error("Invalid bool: "+_)}function O(_){return _?1:0}function I(_,m){const f=(0,n.u32)("length"),d=(0,n.struct)([f,(0,n.seq)(_,(0,n.offset)(f,-f.span),"values")]);return new g(d,({values:v})=>v,v=>({values:v}),m)}function N(_,m,f){const d=(0,n.struct)([a("tag"),m.replicate("data")]);function v({tag:b,data:E}){if(!b.eq(_))throw new Error("Invalid tag, expected: "+_.toString("hex")+", got: "+b.toString("hex"));return E}return new g(d,v,b=>({tag:_,data:b}),f)}function F(_){const m=(0,n.u32)("length"),f=(0,n.struct)([m,(0,n.blob)((0,n.offset)(m,-m.span),"data")]);return new g(f,({data:d})=>d,d=>({data:d}),_)}function L(_){return new g(F(),m=>m.toString("utf-8"),m=>ne.Buffer.from(m,"utf-8"),_)}function D(_,m,f){const d=(0,n.union)(f??(0,n.u8)(),m);return _.forEach((v,b)=>d.addVariant(b,v,v.property)),d}function H(_,m,f){const d=(0,n.struct)([(0,n.seq)(_,m,"values")]);return new g(d,({values:v})=>v,v=>({values:v}),f)}class z extends n.Layout{constructor(m,f,d){super(m.span+f.span,d),this.keyLayout=m,this.valueLayout=f}decode(m,f){f=f||0;const d=this.keyLayout.decode(m,f),v=this.valueLayout.decode(m,f+this.keyLayout.getSpan(m,f));return[d,v]}encode(m,f,d){d=d||0;const v=this.keyLayout.encode(m[0],f,d),b=this.valueLayout.encode(m[1],f,d+v);return v+b}getSpan(m,f){return this.keyLayout.getSpan(m,f)+this.valueLayout.getSpan(m,f)}}function K(_,m,f){const d=(0,n.u32)("length"),v=(0,n.struct)([d,(0,n.seq)(new z(_,m),(0,n.offset)(d,-d.span),"values")]);return new g(v,({values:b})=>new Map(b),b=>({values:Array.from(b.entries())}),f)}})(He);/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const PW=4,v_=0,b_=1,MW=2;function Lc(t){let e=t.length;for(;--e>=0;)t[e]=0}const LW=0,yx=1,BW=2,DW=3,$W=258,h1=29,Al=256,Qu=Al+1+h1,ec=30,d1=19,vx=2*Qu+1,qo=15,dg=16,FW=7,p1=256,bx=16,wx=17,_x=18,X0=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Vf=ne
vendor: 27,580 bytes, line 39
39w Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),UW=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),kx=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),zW=512,ts=new Array((Qu+2)*2);Lc(ts);const Eu=new Array(ec*2);Lc(Eu);const el=new Array(zW);Lc(el);const tl=new Array($W-DW+1);Lc(tl);const g1=new Array(h1);Lc(g1);const Nh=new Array(ec);Lc(Nh);function pg(t,e,n,r,i){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=t&&t.length}let Sx,Ex,Ax;function gg(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}const xx=t=>t<256?el[t]:el[256+(t>>>7)],nl=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},cr=(t,e,n)=>{t.bi_valid>dg-n?(t.bi_buf|=e<<t.bi_valid&65535,nl(t,t.bi_buf),t.bi_buf=e>>dg-t.bi_valid,t.bi_valid+=n-dg):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=n)},Ri=(t,e,n)=>{cr(t,n[e*2],n[e*2+1])},Rx=(t,e)=>{let n=0;do n|=t&1,t>>>=1,n<<=1;while(--e>0);return n>>>1},HW=t=>{t.bi_valid===16?(nl(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)},WW=(t,e)=>{const n=e.dyn_tree,r=e.max_code,i=e.stat_desc.static_tree,s=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,a=e.stat_desc.extra_base,c=e.stat_desc.max_length;let u,l,h,p,g,y,w=0;for(p=0;p<=qo;p++)t.bl_count[p]=0;for(n[t.heap[t.heap_max]*2+1]=0,u=t.heap_max+1;u<vx;u++)l=t.heap[u],p=n[n[l*2+1]*2+1]+1,p>c&&(p=c,w++),n[l*2+1]=p,!(l>r)&&(t.bl_count[p]++,g=0,l>=a&&(g=o[l-a]),y=n[l*2],t.opt_len+=y*(p+g),s&&(t.static_len+=y*(i[l*2+1]+g)));if(w!==0){do{for(p=c-1;t.bl_count[p]===0;)p--;t.bl_count[p]--,t.bl_count[p+1]+=2,t.bl_count[c]--,w-=2}while(w>0);for(p=c;p!==0;p--)for(l=t.bl_count[p];l!==0;)h=t.heap[--u],!(h>r)&&(n[h*2+1]!==p&&(t.opt_len+=(p-n[h*2+1])*n[h*2],n[h*2+1]=p),l--)}},Tx=(t,e,n)=>{const r=new Array(qo+1);let i=0,s,o;for(s=1;s<=qo;s++)i=i+n[s-1]<<1,r[s]=i;for(o=0;o<=e;o++){let a=t[o*2+1];a!==0&&(t[o*2]=Rx(r[a]++,a))}},jW=()=>{let t,e,n,r,i;const s=new Array(qo+1);for(n=0,r=0;r<h1-1;r++)for(g1[r]=n,t=0;t<1<<X0[r];t++)tl[n++]=r;for(tl[n-1]=r,i=0,r=0;r<16;r++)for(Nh[r]=i,t=0;t<1<<Vf[r];t++)el[i++]=r;for(i>>=7;r<ec;r++)for(Nh[r]=i<<7,t=0;t<1<<Vf[r]-7;t++)el[256+i++]=r;for(e=0;e<=qo;e++)s[e]=0;for(t=0;t<=143;)ts[t*2+1]=8,t++,s[8]++;for(;t<=255;)ts[t*2+1]=9,t++,s[9]++;for(;t<=279;)ts[t*2+1]=7,t++,s[7]++;for(;t<=287;)ts[t*2+1]=8,t++,s[8]++;for(Tx(ts,Qu+1,s),t=0;t<ec;t++)Eu[t*2+1]=5,Eu[t*2]=Rx(t,5);Sx=new pg(ts,X0,Al+1,Qu,qo),Ex=new pg(Eu,Vf,0,ec,qo),Ax=new pg(new Array(0),UW,0,d1,FW)},Ox=t=>{let e;for(e=0;e<Qu;e++)t.dyn_ltree[e*2]=0;for(e=0;e<ec;e++)t.dyn_dtree[e*2]=0;for(e=0;e<d1;e++)t.bl_tree[e*2]=0;t.dyn_ltree[p1*2]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},Ix=t=>{t.bi_valid>8?nl(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},w_=(t,e,n,r)=>{const i=e*2,s=n*2;return t[i]<t[s]||t[i]===t[s]&&r[e]<=r[n]},mg=(t,e,n)=>{const r=t.heap[n];let i=n<<1;for(;i<=t.heap_len&&(i<t.heap_len&&w_(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!w_(e,r,t.heap[i],t.depth));)t.heap[n]=t.heap[i],n=i,i<<=1;t.heap[n]=r},__=(t,e,n)=>{let r,i,s=0,o,a;if(t.sym_next!==0)do r=t.pending_buf[t.sym_buf+s++]&255,r+=(t.pending_buf[t.sym_buf+s++]&255)<<8,i=t.pending_buf[t.sym_buf+s++],r===0?Ri(t,i,e):(o=tl[i],Ri(t,o+Al+1,e),a=X0[o],a!==0&&(i-=g1[o],cr(t,i,a)),r--,o=xx(r),Ri(t,o,n),a=Vf[o],a!==0&&(r-=Nh[o],cr(t,r,a)));while(s<t.sym_next);Ri(t,p1,e)},J0=(t,e)=>{const n=e.dyn_tree,r=e.stat_desc.static_tree,i=e.stat_desc.has_stree,s=e.stat_desc.elems;let o,a,c=-1,u;for(t.heap_len=0,t.heap_max=vx,o=0;o<s;o++)n[o*2]!==0?(t.heap[++t.heap_len]=c=o,t.depth[o]=0):n[o*2+1]=0;for(;t.heap_len<2;)u=t.heap[++t.heap_len]=c<2?++c:0,n[u*2]=1,t.depth[u]=0,t.opt_len--,i&&(t.static_len-=r[u*2+1]);for(e.max_code=c,o=t.heap_len>>1;o>=1;o--)mg(t,n,o);u=s;do o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],mg(t,n,1),a=t.heap[1],t.heap[--t.heap_max]=o,t.heap[--t.heap_max]=a,n[u*2]=n[o*2]+n[a*2],t.depth[u]=(t.depth[o]>=t.depth[a]?t.depth[o]:t.depth[a])+1,n[o*2+1]=n[a*2+1]=u,t.heap[1]=u++,mg(t,n,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],WW(t,e),Tx(n,c,t.bl_count)},k_=(t,e,n)=>{let r,i=-1,s,o=e[0*2+1],a=0,c=7,u=4;for(o===0&&(c=138,u=3),e[(n+1)*2+1]=65535,r=0;r<=n;r++)s=o,o=e[(r+1)*2+1],!(++a<c&&s===o)&&(a<u?t.bl_tree[s*2]+=a:s!==0?(s!==i&&t.bl_tree[s*2]++,t.bl_tree[bx*2]++):a<=10?t.bl_tree[wx*2]++:t.bl_tree[_x*2]++,a=0,i=s,o===0?(c=138,u=3):s===o?(c=6,u=3):(c=7,u=4))},S_=(t,e,n)=>{let r,i=-1,s,o=e[0*2+1],a=0,c=7,u=4;for(o===0&&(c=138,u=3),r=0;r<=n;r++)if(s=o,o=e[(r+1)*2+1],!(++a<c&&s===o)){if(a<u)do Ri(t,s,t.bl_tree);while(--a!==0);else s!==0?(s!==i&&(Ri(t,s,t.bl_tree),a--),Ri(t,bx,t.bl_tree),cr(t,a-3,2)):a<=10?(Ri(t,wx,t.bl_tree),cr(t,a-3,3)):(Ri(t,_x,t.bl_tree),cr(t,a-11,7));a=0,i=s,o===0?(c=138,u=3):s===o?(c=6,u=3):(c=7,u=4)}},KW=t=>{let e;for(k_(t,t.dyn_ltree,t.l_desc.max_code),k_(t,t.dyn_dtree,t.d_desc.max_code),J0(t,t.bl_desc),e=d1-1;e>=3&&t.bl_tree[kx[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},VW=(t,e,n,r)=>{let i;for(cr(t,e-257,5),cr(t,n-1,5),cr(t,r-4,4),i=0;i<r;i++)cr(t,t.bl_tree[kx[i]*2+1],3);S_(t,t.dyn_ltree,e-1),S_(t,t.dyn_dtree,n-1)},qW=t=>{let e=4093624447,n;for(n=0;n<=31;n++,e>>>=1)if(e&1&&t.dyn_ltree[n*2]!==0)return v_;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return b_;for(n=32;n<Al;n++)if(t.dyn_ltree[n*2]!==0)return b_;return v_};let E_=!1;const GW=t=>{E_||(jW(),E_=!0),t.l_desc=new gg(t.dyn_ltree,Sx),t.d_desc=new gg(t.dyn_dtree,Ex),t.bl_desc=new gg(t.bl_tree,Ax),t.bi_buf=0,t.bi_valid=0,Ox(t)},Cx=(t,e,n,r)=>{cr(t,(LW<<1)+(r?1:0),3),Ix(t),nl(t,n),nl(t,~n),n&&t.pending_buf.set(t.window.subarray(e,e+n),t.pending),t.pending+=n},YW=t=>{cr(t,yx<<1,3),Ri(t,p1,ts),HW(t)},ZW=(t,e,n,r)=>{let i,s,o=0;t.level>0?(t.strm.data_type===MW&&(t.strm.data_type=qW(t)),J0(t,t.l_desc),J0(t,t.d_desc),o=KW(t),i=t.opt_len+3+7>>>3,s=t.static_len+3+7>>>3,s<=i&&(i=s)):i=s=n+5,n+4<=i&&e!==-1?Cx(t,e,n,r):t.strategy===PW||s===i?(cr(t,(yx<<1)+(r?1:0),3),__(t,ts,Eu)):(cr(t,(BW<<1)+(r?1:0),3),VW(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),__(t,t.dyn_ltree,t.dyn_dtree)),Ox(t),r&&Ix(t)},XW=(t,e,n)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=n,e===0?t.dyn_ltree[n*2]++:(t.matches++,e--,t.dyn_ltree[(tl[n]+Al+1)*2]++,t.dyn_dtree[xx(e)*2]++),t.sym_next===t.sym_end);var JW=GW,QW=Cx,ej=ZW,tj=XW,nj=YW,rj={_tr_init:JW,_tr_stored_block:QW,_tr_flush_block:ej,_tr_tally:tj,_tr_align:nj};const ij=(t,e,n,r)=>{let i=t&65535|0,s=t>>>16&65535|0,o=0;for(;n!==0;){o=n>2e3?2e3:n,n-=o;do i=i+e[r++]|0,s=s+i|0;while(--o);i%=65521,s%=65521}return i|s<<16|0};var rl=ij;const sj=()=>{let t,e=[];for(var n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=t&1?3988292384^t>>>1:t>>>1;e[n]=t}return e},oj=new Uint32Array(sj()),aj=(t,e,n,r)=>{const i=oj,s=r+n;t^=-1;for(let o=r;o<s;o++)t=t>>>8^i[(t^e[o])&255];return t^-1};var Sn=aj,bc={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},xl={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:cj,_tr_stored_block:Q0,_tr_flush_block:uj,_tr_tally:Js,_tr_align:lj}=rj,{Z_NO_FLUSH:Qs,Z_PARTIAL_FLUSH:fj,Z_FULL_FLUSH:hj,Z_FINISH:$r,Z_BLOCK:A_,Z_OK:Cn,Z_STREAM_END:x_,Z_STREAM_ERROR:Ci,Z_DATA_ERROR:dj,Z_BUF_ERROR:yg,Z_DEFAULT_COMPRESSION:pj,Z_FILTERED:gj,Z_HUFFMAN_ONLY:hf,Z_RLE:mj,Z_FIXED:yj,Z_DEFAULT_STRATEGY:vj,Z_UNKNOWN:bj,Z_DEFLATED:Fd}=xl,wj=9,_j=15,kj=8,Sj=29,Ej=256,em=Ej+1+Sj,Aj=30,xj=19,Rj=2*em+1,Tj=15,Qe=3,js=258,Ni=js+Qe+1,Oj=32,wc=42,m1=57,tm=69,nm=73,rm=91,im=103,Go=113,cu=666,Xn=1,Bc=2,ha=3,Dc=4,Ij=3,Yo=(t,e)=>(t.msg=bc[e],e),R_=t=>t*2-(t>4?9:0),Bs=t=>{let e=t.length;for(;--e>=0;)t[e]=0},Cj=t=>{let e,n,r,i=t.w_size;e=t.hash_size,r=e;do n=t.head[--r],t.head[r]=n>=i?n-i:0;while(--e);e=i,r=e;do n=t.prev[--r],t.prev[r]=n>=i?n-i:0;while(--e)};let Nj=(t,e,n)=>(e<<t.hash_shift^n)&t.hash_mask,eo=Nj;const yr=t=>{const e=t.state;let n=e.pending;n>t.avail_out&&(n=t.avail_out),n!==0&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+n),t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,e.pending===0&&(e.pending_out=0))},Tr=(t,e)=>{uj(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,yr(t.strm)},ft=(t,e)=>{t.pending_buf[t.pending++]=e},Xc=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255},sm=(t,e,n,r)=>{let i=t.avail_in;return i>r&&(i=r),i===0?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),n),t.state.wrap===1?t.adler=rl(t.adler,e,i,n):t.state.wrap===2&&(t.adler=Sn(t.adler,e,i,n)),t.next_in+=i,t.total_in+=i,i)},Nx=(t,e)=>{let n=t.max_chain_length,r=t.strstart,i,s,o=t.prev_length,a=t.nice_match;const c=t.strstart>t.w_size-Ni?t.strstart-(t.w_size-Ni):0,u=t.window,l=t.w_mask,h=t.prev,p=t.strstart+js;let g=u[r+o-1],y=u[r+o];t.prev_length>=t.good_match&&(n>>=2),a>t.lookahead&&(a=t.lookahead);do if(i=e,!(u[i+o]!==y||u[i+o-1]!==g||u[i]!==u[r]||u[++i]!==u[r+1])){r+=2,i++;do;while(u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&r<p);if(s=js-(p-r),r=p-js,s>o){if(t.match_start=e,o=s,s>=a)break;g=u[r+o-1],y=u[r+o]}}while((e=h[e&l])>c&&--n!==0);return o<=t.lookahead?o:t.lookahead},_c=t=>{const e=t.w_size;let n,r,i;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Ni)&&(t.window.set(t.window.subarray(e,e+e-r),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),Cj(t),r+=e),t.strm.avail_in===0)break;if(n=sm(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=n,t.lookahead+t.insert>=Qe)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=eo(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=eo(t,t.ins_h,t.window[i+Qe-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<Qe)););}while(t.lookahead<Ni&&t.strm.avail_in!==0)},Px=(t,e)=>{let n=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,r,i,s,o=0,a=t.strm.avail_in;do{if(r=65535,s=t.bi_valid+42>>3,t.strm.avail_out<s||(s=t.strm.avail_out-s,i=t.strstart-t.block_start,r>i+t.strm.avail_in&&(r=i+t.strm.avail_in),r>s&&(r=s),r<n&&(r===0&&e!==$r||e===Qs||r!==i+t.strm.avail_in)))break;o=e===$r&&r===i+t.strm.avail_in?1:0,Q0(t,0,0,o),t.pending_buf[t.pending-4]=r,t.pending_buf[t.pending-3]=r>>8,t.pending_buf[t.pending-2]=~r,t.pending_buf[t.pending-1]=~r>>8,yr(t.strm),i&&(i>r&&(i=r),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,r-=i),r&&(sm(t.strm,t.strm.output,t.strm.next_out,r),t.strm.next_out+=r,t.strm.avail_out-=r,t.strm.total_out+=r)}while(o===0);return a-=t.strm.avail_in,a&&(a>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=a&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-a,t.strm.next_in),t.strstart),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),o?Dc:e!==Qs&&e!==$r&&t.strm.avail_in===0&&t.strstart===t.block_start?Bc:(s=t.window_size-t.strstart,t.strm.avail_in>s&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,s+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),s>t.strm.avail_in&&(s=t.strm.avail_in),s&&(sm(t.strm,t.window,t.strstart,s),t.strstart+=s,t.insert+=s>t.w_size-t.insert?t.w_size-t.insert:s),t.high_water<t.strstart&&(t.high_water=t.strstart),s=t.bi_valid+42>>3,s=t.pending_buf_size-s>65535?65535:t.pending_buf_size-s,n=s>t.w_size?t.w_size:s,i=t.strstart-t.block_start,(i>=n||(i||e===$r)&&e!==Qs&&t.strm.avail_in===0&&i<=s)&&(r=i>s?s:i,o=e===$r&&t.strm.avail_in===0&&r===i?1:0,Q0(t,t.block_start,r,o),t.block_start+=r,yr(t.strm)),o?ha:Xn)},vg=(t,e)=>{let n,r;for(;;){if(t.lookahead<Ni){if(_c(t),t.lookahead<Ni&&e===Qs)return Xn;if(t.lookahead===0)break}if(n=0,t.lookahead>=Qe&&(t.ins_h=eo(t,t.ins_h,t.window[t.strstart+Qe-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),n!==0&&t.strstart-n<=t.w_size-Ni&&(t.match_length=Nx(t,n)),t.match_length>=Qe)if(r=Js(t,t.strstart-t.match_start,t.match_length-Qe),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=Qe){t.match_length--;do t.strstart++,t.ins_h=eo(t,t.ins_h,t.window[t.strstart+Qe-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=eo(t,t.ins_h,t.window[t.strstart+1]);else r=Js(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(r&&(Tr(t,!1),t.strm.avail_out===0))return Xn}return t.insert=t.strstart<Qe-1?t.strstart:Qe-1,e===$r?(Tr(t,!0),t.strm.avail_out===0?ha:Dc):t.sym_next&&(Tr(t,!1),t.strm.avail_out===0)?Xn:Bc},Pa=(t,e)=>{let n,r,i;for(;;){if(t.lookahead<Ni){if(_c(t),t.lookahead<Ni&&e===Qs)return Xn;if(t.lookahead===0)break}if(n=0,t.lookahead>=Qe&&(t.ins_h=eo(t,t.ins_h,t.window[t.strstart+Qe-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=Qe-1,n!==0&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-Ni&&(t.match_length=Nx(t,n),t.match_length<=5&&(t.strategy===gj||t.match_length===Qe&&t.strstart-t.match_start>4096)&&(t.match_length=Qe-1)),t.prev_length>=Qe&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-Qe,r=Js(t,t.strstart-1-t.prev_match,t.prev_length-Qe),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=eo(t,t.ins_h,t.window[t.strstart+Qe-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=Qe-1,t.strstart++,r&&(Tr(t,!1),t.strm.avail_out===0))return Xn}else if(t.match_available){if(r=Js(t,0,t.window[t.strstart-1]),r&&Tr(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return Xn}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(r=Js(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<Qe-1?t.strstart:Qe-1,e===$r?(Tr(t,!0),t.strm.avail_out===0?ha:Dc):t.sym_next&&(Tr(t,!1),t.strm.avail_out===0)?Xn:Bc},Pj=(t,e)=>{let n,r,i,s;const o=t.window;for(;;){if(t.lookahead<=js){if(_c(t),t.lookahead<=js&&e===Qs)return Xn;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=Qe&&t.strstart>0&&(i=t.strstart-1,r=o[i],r===o[++i]&&r===o[++i]&&r===o[++i])){s=t.strstart+js;do;while(r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&i<s);t.match_length=js-(s-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=Qe?(n=Js(t,1,t.match_length-Qe),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=Js(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(Tr(t,!1),t.strm.avail_out===0))return Xn}return t.insert=0,e===$r?(Tr(t,!0),t.strm.avail_out===0?ha:Dc):t.sym_next&&(Tr(t,!1),t.strm.avail_out===0)?Xn:Bc},Mj=(t,e)=>{let n;for(;;){if(t.lookahead===0&&(_c(t),t.lookahead===0)){if(e===Qs)return Xn;break}if(t.match_length=0,n=Js(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(Tr(t,!1),t.strm.avail_out===0))return Xn}return t.insert=0,e===$r?(Tr(t,!0),t.strm.avail_out===0?ha:Dc):t.sym_next&&(Tr(t,!1),t.strm.avail_out===0)?Xn:Bc};function gi(t,e,n,r,i){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=r,this.func=i}const uu=[new gi(0,0,0,0,Px),new gi(4,4,8,4,vg),new gi(4,5,16,8,vg),new gi(4,6,32,32,vg),new gi(4,4,16,16,Pa),new gi(8,16,32,32,Pa),new gi(8,16,128,128,Pa),new gi(8,32,128,256,Pa),new gi(32,128,258,1024,Pa),new gi(32,258,258,4096,Pa)],Lj=t=>{t.window_size=2*t.w_size,Bs(t.head),t.max_lazy_match=uu[t.level].max_lazy,t.good_match=uu[t.level].good_length,t.nice_match=uu[t.level].nice_length,t.max_chain_length=uu[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=Qe-1,t.match_available=0,t.ins_h=0};function Bj(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Fd,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(Rj*2),this.dyn_dtree=new Uint16Array((2*Aj+1)*2),this.bl_tree=new Uint16Array((2*xj+1)*2),Bs(this.dyn_ltree),Bs(this.dyn_dtree),Bs(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Tj+1),this.heap=new Uint16Array(2*em+1),Bs(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*em+1),Bs(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Rl=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.status!==wc&&e.status!==m1&&e.status!==tm&&e.status!==nm&&e.status!==rm&&e.status!==im&&e.status!==Go&&e.status!==cu?1:0},Mx=t=>{if(Rl(t))return Yo(t,Ci);t.total_in=t.total_out=0,t.data_type=bj;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?m1:e.wrap?wc:Go,t.adler=e.wrap===2?0:1,e.last_flush=-2,cj(e),Cn},Lx=t=>{const e=Mx(t);return e===Cn&&Lj(t.state),e},Dj=(t,e)=>Rl(t)||t.state.wrap!==2?Ci:(t.state.gzhead=e,Cn),Bx=(t,e,n,r,i,s)=>{if(!t)return Ci;let o=1;if(e===pj&&(e=6),r<0?(o=0,r=-r):r>15&&(o=2,r-=16),i<1||i>wj||n!==Fd||r<8||r>15||e<0||e>9||s<0||s>yj||r===8&&o!==1)return Yo(t,Ci);r===8&&(r=9);const a=new Bj;return t.state=a,a.strm=t,a.status=wc,a.wrap=o,a.gzhead=null,a.w_bits=r,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=i+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+Qe-1)/Qe),a.window=new Uint8Array(a.w_size*2),a.head=new Uint16Array(a.hash_size),a.prev=new Uint16Array(a.w_size),a.lit_bufsize=1<<i+6,a.pending_buf_size=a.lit_bufsize*4,a.pending_buf=new Uint8Array(a.pending_buf_size),a.sym_buf=a.lit_bufsize,a.sym_end=(a.lit_bufsize-1)*3,a.level=e,a.strategy=s,a.method=n,Lx(t)},$j=(t,e)=>Bx(t,e,Fd,_j,kj,vj),Fj=(t,e)=>{if(Rl(t)||e>A_||e<0)return t?Yo(t,Ci):Ci;const n=t.state;if(!t.output||t.avail_in!==0&&!t.input||n.status===cu&&e!==$r)return Yo(t,t.avail_out===0?yg:Ci);const r=n.last_flush;if(n.last_flush=e,n.pending!==0){if(yr(t),t.avail_out===0)return n.last_flush=-1,Cn}else if(t.avail_in===0&&R_(e)<=R_(r)&&e!==$r)return Yo(t,yg);if(n.status===cu&&t.avail_in!==0)return Yo(t,yg);if(n.status===wc&&n.wrap===0&&(n.status=Go),n.status===wc){let i=Fd+(n.w_bits-8<<4)<<8,s=-1;if(n.strategy>=hf||n.level<2?s=0:n.level<6?s=1:n.level===6?s=2:s=3,i|=s<<6,n.strstart!==0&&(i|=Oj),i+=31-i%31,Xc(n,i),n.strstart!==0&&(Xc(n,t.adler>>>16),Xc(n,t.adler&65535)),t.adler=1,n.status=Go,yr(t),n.pending!==0)return n.last_flush=-1,Cn}if(n.status===m1){if(t.adler=0,ft(n,31),ft(n,139),ft(n,8),n.gzhead)ft(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),ft(n,n.gzhead.time&255),ft(n,n.gzhead.time>>8&255),ft(n,n.gzhead.time>>16&255),ft(n,n.gzhead.time>>24&255),ft(n,n.level===9?2:n.strategy>=hf||n.level<2?4:0),ft(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(ft(n,n.gzhead.extra.length&255),ft(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=Sn(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=tm;else if(ft(n,0),ft(n,0),ft(n,0),ft(n,0),ft(n,0),ft(n,n.level===9?2:n.strategy>=hf||n.level<2?4:0),ft(n,Ij),n.status=Go,yr(t),n.pending!==0)return n.last_flush=-1,Cn}if(n.status===tm){if(n.gzhead.extra){let i=n.pending,s=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+s>n.pending_buf_size;){let a=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+a),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>i&&(t.adler=Sn(t.adler,n.pending_buf,n.pending-i,i)),n.gzindex+=a,yr(t),n.pending!==0)return n.last_flush=-1,Cn;i=0,s-=a}let o=new Uint8Array(n.gzhead.extra);n.pending_buf.set(o.subarray(n.gzindex,n.gzindex+s),n.pending),n.pending+=s,n.gzhead.hcrc&&n.pending>i&&(t.adler=Sn(t.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=nm}if(n.status===nm){if(n.gzhead.name){let i=n.pending,s;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(t.adler=Sn(t.adler,n.pending_buf,n.pending-i,i)),yr(t),n.pending!==0)return n.last_flush=-1,Cn;i=0}n.gzindex<n.gzhead.name.length?s=n.gzhead.name.charCodeAt(n.gzindex++)&255:s=0,ft(n,s)}while(s!==0);n.gzhead.hcrc&&n.pending>i&&(t.adler=Sn(t.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=rm}if(n.status===rm){if(n.gzhead.comment){let i=n.pending,s;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(t.adler=Sn(t.adler,n.pending_buf,n.pending-i,i)),yr(t),n.pending!==0)return n.last_flush=-1,Cn;i=0}n.gzindex<n.gzhead.comment.length?s=n.gzhead.comment.charCodeAt(n.gzindex++)&255:s=0,ft(n,s)}while(s!==0);n.gzhead.hcrc&&n.pending>i&&(t.adler=Sn(t.adler,n.pending_buf,n.pending-i,i))}n.status=im}if(n.status===im){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(yr(t),n.pending!==0))return n.last_flush=-1,Cn;ft(n,t.adler&255),ft(n,t.adler>>8&255),t.adler=0}if(n.status=Go,yr(t),n.pending!==0)return n.last_flush=-1,Cn}if(t.avail_in!==0||n.lookahead!==0||e!==Qs&&n.status!==cu){let i=n.level===0?Px(n,e):n.strategy===hf?Mj(n,e):n.strategy===mj?Pj(n,e):uu[n.level].func(n,e);if((i===ha||i===Dc)&&(n.status=cu),i===Xn||i===ha)return t.avail_out===0&&(n.last_flush=-1),Cn;if(i===Bc&&(e===fj?lj(n):e!==A_&&(Q0(n,0,0,!1),e===hj&&(Bs(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),yr(t),t.avail_out===0))return n.last_flush=-1,Cn}return e!==$r?Cn:n.wrap<=0?x_:(n.wrap===2?(ft(n,t.adler&255),ft(n,t.adler>>8&255),ft(n,t.adler>>16&255),ft(n,t.adler>>24&255),ft(n,t.total_in&255),ft(n,t.total_in>>8&255),ft(n,t.total_in>>16&255),ft(n,t.total_in>>24&255)):(Xc(n,t.adler>>>16),Xc(n,t.adler&65535)),yr(t),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?Cn:x_)},Uj=t=>{if(Rl(t))return Ci;const e=t.state.status;return t.state=null,e===Go?Yo(t,dj):Cn},zj=(t,e)=>{let n=e.length;if(Rl(t))return Ci;const r=t.state,i=r.wrap;if(i===2||i===1&&r.status!==wc||r.lookahead)return Ci;if(i===1&&(t.adler=rl(t.adler,e,n,0)),r.wrap=0,n>=r.w_size){i===0&&(Bs(r.head),r.strstart=0,r.block_start=0,r.insert=0);let c=new Uint8Array(r.w_size);c.set(e.subarray(n-r.w_size,n),0),e=c,n=r.w_size}const s=t.avail_in,o=t.next_in,a=t.input;for(t.avail_in=n,t.next_in=0,t.input=e,_c(r);r.lookahead>=Qe;){let c=r.strstart,u=r.lookahead-(Qe-1);do r.ins_h=eo(r,r.ins_h,r.window[c+Qe-1]),r.prev[c&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=c,c++;while(--u);r.strstart=c,r.lookahead=Qe-1,_c(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=Qe-1,r.match_available=0,t.next_in=o,t.input=a,t.avail_in=s,r.wrap=i,Cn};var Hj=$j,Wj=Bx,jj=Lx,Kj=Mx,Vj=Dj,qj=Fj,Gj=Uj,Yj=zj,Zj="pako deflate (from Nodeca project)",Au={deflateInit:Hj,deflateInit2:Wj,deflateReset:jj,deflateResetKeep:Kj,deflateSetHeader:Vj,deflate:qj,deflateEnd:Gj,deflateSetDictionary:Yj,deflateInfo:Zj};const Xj=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Jj=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const n=e.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const r in n)Xj(n,r)&&(t[r]=n[r])}}return t},Qj=t=>{let e=0;for(let r=0,i=t.length;r<i;r++)e+=t[r].length;const n=new Uint8Array(e);for(let r=0,i=0,s=t.length;r<s;r++){let o=t[r];n.set(o,i),i+=o.length}return n},Ud={assign:Jj,flattenChunks:Qj};let Dx=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Dx=!1}const il=new Uint8Array(256);for(let t=0;t<256;t++)il[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;il[254]=il[254]=1;var eK=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,n,r,i,s,o=t.length,a=0;for(i=0;i<o;i++)n=t.charCodeAt(i),(n&64512)===55296&&i+1<o&&(r=t.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),a+=n<128?1:n<2048?2:n<65536?3:4;for(e=new Uint8Array(a),s=0,i=0;s<a;i++)n=t.charCodeAt(i),(n&64512)===55296&&i+1<o&&(r=t.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?e[s++]=n:n<2048?(e[s++]=192|n>>>6,e[s++]=128|n&63):n<65536?(e[s++]=224|n>>>12,e[s++]=128|n>>>6&63,e[s++]=128|n&63):(e[s++]=240|n>>>18,e[s++]=128|n>>>12&63,e[s++]=128|n>>>6&63,e[s++]=128|n&63);return e};const tK=(t,e)=>{if(e<65534&&t.subarray&&Dx)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let n="";for(let r=0;r<e;r++)n+=String.fromCharCode(t[r]);return n};var nK=(t,e)=>{const n=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let r,i;const s=new Array(n*2);for(i=0,r=0;r<n;){let o=t[r++];if(o<128){s[i++]=o;continue}let a=il[o];if(a>4){s[i++]=65533,r+=a-1;continue}for(o&=a===2?31:a===3?15:7;a>1&&r<n;)o=o<<6|t[r++]&63,a--;if(a>1){s[i++]=65533;continue}o<65536?s[i++]=o:(o-=65536,s[i++]=55296|o>>10&1023,s[i++]=56320|o&1023)}return tK(s,i)},rK=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let n=e-1;for(;n>=0&&(t[n]&192)===128;)n--;return n<0||n===0?e:n+il[t[n]]>e?n:e},sl={string2buf:eK,buf2string:nK,utf8border:rK};function iK(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var $x=iK;const Fx=Object.prototype.toString,{Z_NO_FLUSH:sK,Z_SYNC_FLUSH:oK,Z_FULL_FLUSH:aK,Z_FINISH:cK,Z_OK:Ph,Z_STREAM_END:uK,Z_DEFAULT_COMPRESSION:lK,Z_DEFAULT_STRATEGY:fK,Z_DEFLATED:hK}=xl;function y1(t){this.options=Ud.assign({level:lK,method:hK,chunkSize:16384,windowBits:15,memLevel:8,strategy:fK},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new $x,this.strm.avail_out=0;let n=Au.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(n!==Ph)throw new Error(bc[n]);if(e.header&&Au.deflateSetHeader(this.strm,e.header),e.dictionary){let r;if(typeof e.dictionary=="string"?r=sl.string2buf(e.dictionary):Fx.call(e.dictionary)==="[object ArrayBuffer]"?r=new
vendor: 4,255 bytes, line 39
39Uint8Array(e.dictionary):r=e.dictionary,n=Au.deflateSetDictionary(this.strm,r),n!==Ph)throw new Error(bc[n]);this._dict_set=!0}}y1.prototype.push=function(t,e){const n=this.strm,r=this.options.chunkSize;let i,s;if(this.ended)return!1;for(e===~~e?s=e:s=e===!0?cK:sK,typeof t=="string"?n.input=sl.string2buf(t):Fx.call(t)==="[object ArrayBuffer]"?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(s===oK||s===aK)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(i=Au.deflate(n,s),i===uK)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=Au.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Ph;if(n.avail_out===0){this.onData(n.output);continue}if(s>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0};y1.prototype.onData=function(t){this.chunks.push(t)};y1.prototype.onEnd=function(t){t===Ph&&(this.result=Ud.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};const df=16209,dK=16191;var pK=function(e,n){let r,i,s,o,a,c,u,l,h,p,g,y,w,k,T,C,O,I,N,F,L,D,H,z;const K=e.state;r=e.next_in,H=e.input,i=r+(e.avail_in-5),s=e.next_out,z=e.output,o=s-(n-e.avail_out),a=s+(e.avail_out-257),c=K.dmax,u=K.wsize,l=K.whave,h=K.wnext,p=K.window,g=K.hold,y=K.bits,w=K.lencode,k=K.distcode,T=(1<<K.lenbits)-1,C=(1<<K.distbits)-1;e:do{y<15&&(g+=H[r++]<<y,y+=8,g+=H[r++]<<y,y+=8),O=w[g&T];t:for(;;){if(I=O>>>24,g>>>=I,y-=I,I=O>>>16&255,I===0)z[s++]=O&65535;else if(I&16){N=O&65535,I&=15,I&&(y<I&&(g+=H[r++]<<y,y+=8),N+=g&(1<<I)-1,g>>>=I,y-=I),y<15&&(g+=H[r++]<<y,y+=8,g+=H[r++]<<y,y+=8),O=k[g&C];n:for(;;){if(I=O>>>24,g>>>=I,y-=I,I=O>>>16&255,I&16){if(F=O&65535,I&=15,y<I&&(g+=H[r++]<<y,y+=8,y<I&&(g+=H[r++]<<y,y+=8)),F+=g&(1<<I)-1,F>c){e.msg="invalid distance too far back",K.mode=df;break e}if(g>>>=I,y-=I,I=s-o,F>I){if(I=F-I,I>l&&K.sane){e.msg="invalid distance too far back",K.mode=df;break e}if(L=0,D=p,h===0){if(L+=u-I,I<N){N-=I;do z[s++]=p[L++];while(--I);L=s-F,D=z}}else if(h<I){if(L+=u+h-I,I-=h,I<N){N-=I;do z[s++]=p[L++];while(--I);if(L=0,h<N){I=h,N-=I;do z[s++]=p[L++];while(--I);L=s-F,D=z}}}else if(L+=h-I,I<N){N-=I;do z[s++]=p[L++];while(--I);L=s-F,D=z}for(;N>2;)z[s++]=D[L++],z[s++]=D[L++],z[s++]=D[L++],N-=3;N&&(z[s++]=D[L++],N>1&&(z[s++]=D[L++]))}else{L=s-F;do z[s++]=z[L++],z[s++]=z[L++],z[s++]=z[L++],N-=3;while(N>2);N&&(z[s++]=z[L++],N>1&&(z[s++]=z[L++]))}}else if(I&64){e.msg="invalid distance code",K.mode=df;break e}else{O=k[(O&65535)+(g&(1<<I)-1)];continue n}break}}else if(I&64)if(I&32){K.mode=dK;break e}else{e.msg="invalid literal/length code",K.mode=df;break e}else{O=w[(O&65535)+(g&(1<<I)-1)];continue t}break}}while(r<i&&s<a);N=y>>3,r-=N,y-=N<<3,g&=(1<<y)-1,e.next_in=r,e.next_out=s,e.avail_in=r<i?5+(i-r):5-(r-i),e.avail_out=s<a?257+(a-s):257-(s-a),K.hold=g,K.bits=y};const Ma=15,T_=852,O_=592,I_=0,bg=1,C_=2,gK=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),mK=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),yK=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),vK=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),bK=(t,e,n,r,i,s,o,a)=>{const c=a.bits;let u=0,l=0,h=0,p=0,g=0,y=0,w=0,k=0,T=0,C=0,O,I,N,F,L,D=null,H;const z=new Uint16Array(Ma+1),K=new Uint16Array(Ma+1);let _=null,m,f,d;for(u=0;u<=Ma;u++)z[u]=0;for(l=0;l<r;l++)z[e[n+l]]++;for(g=c,p=Ma;p>=1&&z[p]===0;p--);if(g>p&&(g=p),p===0)return i[s++]=1<<24|64<<16|0,i[s++]=1<<24|64<<16|0,a.bits=1,0;for(h=1;h<p&&z[h]===0;h++);for(g<h&&(g=h),k=1,u=1;u<=Ma;u++)if(k<<=1,k-=z[u],k<0)return-1;if(k>0&&(t===I_||p!==1))return-1;for(K[1]=0,u=1;u<Ma;u++)K[u+1]=K[u]+z[u];for(l=0;l<r;l++)e[n+l]!==0&&(o[K[e[n+l]]++]=l);if(t===I_?(D=_=o,H=20):t===bg?(D=gK,_=mK,H=257):(D=yK,_=vK,H=0),C=0,l=0,u=h,L=s,y=g,w=0,N=-1,T=1<<g,F=T-1,t===bg&&T>T_||t===C_&&T>O_)return 1;for(;;){m=u-w,o[l]+1<H?(f=0,d=o[l]):o[l]>=H?(f=_[o[l]-H],d=D[o[l]-H]):(f=32+64,d=0),O=1<<u-w,I=1<<y,h=I;
vendor: 13,829 bytes, line 39
39do I-=O,i[L+(C>>w)+I]=m<<24|f<<16|d|0;while(I!==0);for(O=1<<u-1;C&O;)O>>=1;if(O!==0?(C&=O-1,C+=O):C=0,l++,--z[u]===0){if(u===p)break;u=e[n+o[l]]}if(u>g&&(C&F)!==N){for(w===0&&(w=g),L+=h,y=u-w,k=1<<y;y+w<p&&(k-=z[y+w],!(k<=0));)y++,k<<=1;if(T+=1<<y,t===bg&&T>T_||t===C_&&T>O_)return 1;N=C&F,i[N]=g<<24|y<<16|L-s|0}}return C!==0&&(i[L+C]=u-w<<24|64<<16|0),a.bits=g,0};var xu=bK;const wK=0,Ux=1,zx=2,{Z_FINISH:N_,Z_BLOCK:_K,Z_TREES:pf,Z_OK:da,Z_STREAM_END:kK,Z_NEED_DICT:SK,Z_STREAM_ERROR:qr,Z_DATA_ERROR:Hx,Z_MEM_ERROR:Wx,Z_BUF_ERROR:EK,Z_DEFLATED:P_}=xl,zd=16180,M_=16181,L_=16182,B_=16183,D_=16184,$_=16185,F_=16186,U_=16187,z_=16188,H_=16189,Mh=16190,Gi=16191,wg=16192,W_=16193,_g=16194,j_=16195,K_=16196,V_=16197,q_=16198,gf=16199,mf=16200,G_=16201,Y_=16202,Z_=16203,X_=16204,J_=16205,kg=16206,Q_=16207,ek=16208,Lt=16209,jx=16210,Kx=16211,AK=852,xK=592,RK=15,TK=RK,tk=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function OK(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Ra=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<zd||e.mode>Kx?1:0},Vx=t=>{if(Ra(t))return qr;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=zd,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(AK),e.distcode=e.distdyn=new Int32Array(xK),e.sane=1,e.back=-1,da},qx=t=>{if(Ra(t))return qr;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,Vx(t)},Gx=(t,e)=>{let n;if(Ra(t))return qr;const r=t.state;return e<0?(n=0,e=-e):(n=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?qr:(r.window!==null&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,qx(t))},Yx=(t,e)=>{if(!t)return qr;const n=new OK;t.state=n,n.strm=t,n.window=null,n.mode=zd;const r=Gx(t,e);return r!==da&&(t.state=null),r},IK=t=>Yx(t,TK);let nk=!0,Sg,Eg;const CK=t=>{if(nk){Sg=new Int32Array(512),Eg=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(xu(Ux,t.lens,0,288,Sg,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;xu(zx,t.lens,0,32,Eg,0,t.work,{bits:5}),nk=!1}t.lencode=Sg,t.lenbits=9,t.distcode=Eg,t.distbits=5},Zx=(t,e,n,r)=>{let i;const s=t.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),r>=s.wsize?(s.window.set(e.subarray(n-s.wsize,n),0),s.wnext=0,s.whave=s.wsize):(i=s.wsize-s.wnext,i>r&&(i=r),s.window.set(e.subarray(n-r,n-r+i),s.wnext),r-=i,r?(s.window.set(e.subarray(n-r,n),0),s.wnext=r,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=i))),0},NK=(t,e)=>{let n,r,i,s,o,a,c,u,l,h,p,g,y,w,k=0,T,C,O,I,N,F,L,D;const H=new Uint8Array(4);let z,K;const _=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Ra(t)||!t.output||!t.input&&t.avail_in!==0)return qr;n=t.state,n.mode===Gi&&(n.mode=wg),o=t.next_out,i=t.output,c=t.avail_out,s=t.next_in,r=t.input,a=t.avail_in,u=n.hold,l=n.bits,h=a,p=c,D=da;e:for(;;)switch(n.mode){case zd:if(n.wrap===0){n.mode=wg;break}for(;l<16;){if(a===0)break e;a--,u+=r[s++]<<l,l+=8}if(n.wrap&2&&u===35615){n.wbits===0&&(n.wbits=15),n.check=0,H[0]=u&255,H[1]=u>>>8&255,n.check=Sn(n.check,H,2,0),u=0,l=0,n.mode=M_;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((u&255)<<8)+(u>>8))%31){t.msg="incorrect header check",n.mode=Lt;break}if((u&15)!==P_){t.msg="unknown compression method",n.mode=Lt;break}if(u>>>=4,l-=4,L=(u&15)+8,n.wbits===0&&(n.wbits=L),L>15||L>n.wbits){t.msg="invalid window size",n.mode=Lt;break}n.dmax=1<<n.wbits,n.flags=0,t.adler=n.check=1,n.mode=u&512?H_:Gi,u=0,l=0;break;case M_:for(;l<16;){if(a===0)break e;a--,u+=r[s++]<<l,l+=8}if(n.flags=u,(n.flags&255)!==P_){t.msg="unknown compression method",n.mode=Lt;break}if(n.flags&57344){t.msg="unknown header flags set",n.mode=Lt;break}n.head&&(n.head.text=u>>8&1),n.flags&512&&n.wrap&4&&(H[0]=u&255,H[1]=u>>>8&255,n.check=Sn(n.check,H,2,0)),u=0,l=0,n.mode=L_;case L_:for(;l<32;){if(a===0)break e;a--,u+=r[s++]<<l,l+=8}n.head&&(n.head.time=u),n.flags&512&&n.wrap&4&&(H[0]=u&255,H[1]=u>>>8&255,H[2]=u>>>16&255,H[3]=u>>>24&255,n.check=Sn(n.check,H,4,0)),u=0,l=0,n.mode=B_;case B_:for(;l<16;){if(a===0)break e;a--,u+=r[s++]<<l,l+=8}n.head&&(n.head.xflags=u&255,n.head.os=u>>8),n.flags&512&&n.wrap&4&&(H[0]=u&255,H[1]=u>>>8&255,n.check=Sn(n.check,H,2,0)),u=0,l=0,n.mode=D_;case D_:if(n.flags&1024){for(;l<16;){if(a===0)break e;a--,u+=r[s++]<<l,l+=8}n.length=u,n.head&&(n.head.extra_len=u),n.flags&512&&n.wrap&4&&(H[0]=u&255,H[1]=u>>>8&255,n.check=Sn(n.check,H,2,0)),u=0,l=0}else n.head&&(n.head.extra=null);n.mode=$_;case $_:if(n.flags&1024&&(g=n.length,g>a&&(g=a),g&&(n.head&&(L=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(s,s+g),L)),n.flags&512&&n.wrap&4&&(n.check=Sn(n.check,r,g,s)),a-=g,s+=g,n.length-=g),n.length))break e;n.length=0,n.mode=F_;case F_:if(n.flags&2048){if(a===0)break e;g=0;do L=r[s+g++],n.head&&L&&n.length<65536&&(n.head.name+=String.fromCharCode(L));while(L&&g<a);if(n.flags&512&&n.wrap&4&&(n.check=Sn(n.check,r,g,s)),a-=g,s+=g,L)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=U_;case U_:if(n.flags&4096){if(a===0)break e;g=0;do L=r[s+g++],n.head&&L&&n.length<65536&&(n.head.comment+=String.fromCharCode(L));while(L&&g<a);if(n.flags&512&&n.wrap&4&&(n.check=Sn(n.check,r,g,s)),a-=g,s+=g,L)break e}else n.head&&(n.head.comment=null);n.mode=z_;case z_:if(n.flags&512){for(;l<16;){if(a===0)break e;a--,u+=r[s++]<<l,l+=8}if(n.wrap&4&&u!==(n.check&65535)){t.msg="header crc mismatch",n.mode=Lt;break}u=0,l=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=Gi;break;case H_:for(;l<32;){if(a===0)break e;a--,u+=r[s++]<<l,l+=8}t.adler=n.check=tk(u),u=0,l=0,n.mode=Mh;case Mh:if(n.havedict===0)return t.next_out=o,t.avail_out=c,t.next_in=s,t.avail_in=a,n.hold=u,n.bits=l,SK;t.adler=n.check=1,n.mode=Gi;case Gi:if(e===_K||e===pf)break e;case wg:if(n.last){u>>>=l&7,l-=l&7,n.mode=kg;break}for(;l<3;){if(a===0)break e;a--,u+=r[s++]<<l,l+=8}switch(n.last=u&1,u>>>=1,l-=1,u&3){case 0:n.mode=W_;break;case 1:if(CK(n),n.mode=gf,e===pf){u>>>=2,l-=2;break e}break;case 2:n.mode=K_;break;case 3:t.msg="invalid block type",n.mode=Lt}u>>>=2,l-=2;break;case W_:for(u>>>=l&7,l-=l&7;l<32;){if(a===0)break e;a--,u+=r[s++]<<l,l+=8}if((u&65535)!==(u>>>16^65535)){t.msg="invalid stored block lengths",n.mode=Lt;break}if(n.length=u&65535,u=0,l=0,n.mode=_g,e===pf)break e;case _g:n.mode=j_;case j_:if(g=n.length,g){if(g>a&&(g=a),g>c&&(g=c),g===0)break e;i.set(r.subarray(s,s+g),o),a-=g,s+=g,c-=g,o+=g,n.length-=g;break}n.mode=Gi;break;case K_:for(;l<14;){if(a===0)break e;a--,u+=r[s++]<<l,l+=8}if(n.nlen=(u&31)+257,u>>>=5,l-=5,n.ndist=(u&31)+1,u>>>=5,l-=5,n.ncode=(u&15)+4,u>>>=4,l-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=Lt;break}n.have=0,n.mode=V_;case V_:for(;n.have<n.ncode;){for(;l<3;){if(a===0)break e;a--,u+=r[s++]<<l,l+=8}n.lens[_[n.have++]]=u&7,u>>>=3,l-=3}for(;n.have<19;)n.lens[_[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,z={bits:n.lenbits},D=xu(wK,n.lens,0,19,n.lencode,0,n.work,z),n.lenbits=z.bits,D){t.msg="invalid code lengths set",n.mode=Lt;break}n.have=0,n.mode=q_;case q_:for(;n.have<n.nlen+n.ndist;){for(;k=n.lencode[u&(1<<n.lenbits)-1],T=k>>>24,C=k>>>16&255,O=k&65535,!(T<=l);){if(a===0)break e;a--,u+=r[s++]<<l,l+=8}if(O<16)u>>>=T,l-=T,n.lens[n.have++]=O;else{if(O===16){for(K=T+2;l<K;){if(a===0)break e;a--,u+=r[s++]<<l,l+=8}if(u>>>=T,l-=T,n.have===0){t.msg="invalid bit length repeat",n.mode=Lt;break}L=n.lens[n.have-1],g=3+(u&3),u>>>=2,l-=2}else if(O===17){for(K=T+3;l<K;){if(a===0)break e;a--,u+=r[s++]<<l,l+=8}u>>>=T,l-=T,L=0,g=3+(u&7),u>>>=3,l-=3}else{for(K=T+7;l<K;){if(a===0)break e;a--,u+=r[s++]<<l,l+=8}u>>>=T,l-=T,L=0,g=11+(u&127),u>>>=7,l-=7}if(n.have+g>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=Lt;break}for(;g--;)n.lens[n.have++]=L}}if(n.mode===Lt)break;if(n.lens[256]===0){t.msg="invalid code -- missing end-of-block",n.mode=Lt;break}if(n.lenbits=9,z={bits:n.lenbits},D=xu(Ux,n.lens,0,n.nlen,n.lencode,0,n.work,z),n.lenbits=z.bits,D){t.msg="invalid literal/lengths set",n.mode=Lt;break}if(n.distbits=6,n.distcode=n.distdyn,z={bits:n.distbits},D=xu(zx,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,z),n.distbits=z.bits,D){t.msg="invalid distances set",n.mode=Lt;break}if(n.mode=gf,e===pf)break e;case gf:n.mode=mf;case mf:if(a>=6&&c>=258){t.next_out=o,t.avail_out=c,t.next_in=s,t.avail_in=a,n.hold=u,n.bits=l,pK(t,p),o=t.next_out,i=t.output,c=t.avail_out,s=t.next_in,r=t.input,a=t.avail_in,u=n.hold,l=n.bits,n.mode===Gi&&(n.back=-1);break}for(n.back=0;k=n.lencode[u&(1<<n.lenbits)-1],T=k>>>24,C=k>>>16&255,O=k&65535,!(T<=l);){if(a===0)break e;a--,u+=r[s++]<<l,l+=8}if(C&&!(C&240)){for(I=T,N=C,F=O;k=n.lencode[F+((u&(1<<I+N)-1)>>I)],T=k>>>24,C=k>>>16&255,O=k&65535,!(I+T<=l);){if(a===0)break e;a--,u+=r[s++]<<l,l+=8}u>>>=I,l-=I,n.back+=I}if(u>>>=T,l-=T,n.back+=T,n.length=O,C===0){n.mode=J_;break}if(C&32){n.back=-1,n.mode=Gi;break}if(C&64){t.msg="invalid literal/length code",n.mode=Lt;break}n.extra=C&15,n.mode=G_;case G_:if(n.extra){for(K=n.extra;l<K;){if(a===0)break e;a--,u+=r[s++]<<l,l+=8}n.length+=u&(1<<n.extra)-1,u>>>=n.extra,l-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=Y_;case Y_:for(;k=n.distcode[u&(1<<n.distbits)-1],T=k>>>24,C=k>>>16&255,O=k&65535,!(T<=l);){if(a===0)break e;a--,u+=r[s++]<<l,l+=8}if(!(C&240)){for(I=T,N=C,F=O;k=n.distcode[F+((u&(1<<I+N)-1)>>I)],T=k>>>24,C=k>>>16&255,O=k&65535,!(I+T<=l);){if(a===0)break e;a--,u+=r[s++]<<l,l+=8}u>>>=I,l-=I,n.back+=I}if(u>>>=T,l-=T,n.back+=T,C&64){t.msg="invalid distance code",n.mode=Lt;break}n.offset=O,n.extra=C&15,n.mode=Z_;case Z_:if(n.extra){for(K=n.extra;l<K;){if(a===0)break e;a--,u+=r[s++]<<l,l+=8}n.offset+=u&(1<<n.extra)-1,u>>>=n.extra,l-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=Lt;break}n.mode=X_;case X_:if(c===0)break e;if(g=p-c,n.offset>g){if(g=n.offset-g,g>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=Lt;break}g>n.wnext?(g-=n.wnext,y=n.wsize-g):y=n.wnext-g,g>n.length&&(g=n.length),w=n.window}else w=i,y=o-n.offset,g=n.length;g>c&&(g=c),c-=g,n.length-=g;do i[o++]=w[y++];while(--g);n.length===0&&(n.mode=mf);break;case J_:if(c===0)break e;i[o++]=n.length,c--,n.mode=mf;break;case kg:if(n.wrap){for(;l<32;){if(a===0)break e;a--,u|=r[s++]<<l,l+=8}if(p-=c,t.total_out+=p,n.total+=p,n.wrap&4&&p&&(t.adler=n.check=n.flags?Sn(n.check,i,p,o-p):rl(n.check,i,p,o-p)),p=c,n.wrap&4&&(n.flags?u:tk(u))!==n.check){t.msg="incorrect data check",n.mode=Lt;break}u=0,l=0}n.mode=Q_;case Q_:if(n.wrap&&n.flags){for(;l<32;){if(a===0)break e;a--,u+=r[s++]<<l,l+=8}if(n.wrap&4&&u!==(n.total&4294967295)){t.msg="incorrect length check",n.mode=Lt;break}u=0,l=0}n.mode=ek;case ek:D=kK;break e;case Lt:D=Hx;break e;case jx:return Wx;case Kx:default:return qr}return t.next_out=o,t.avail_out=c,t.next_in=s,t.avail_in=a,n.hold=u,n.bits=l,(n.wsize||p!==t.avail_out&&n.mode<Lt&&(n.mode<kg||e!==N_))&&Zx(t,t.output,t.next_out,p-t.avail_out),h-=t.avail_in,p-=t.avail_out,t.total_in+=h,t.total_out+=p,n.total+=p,n.wrap&4&&p&&(t.adler=n.check=n.flags?Sn(n.check,i,p,t.next_out-p):rl(n.check,i,p,t.next_out-p)),t.data_type=n.bits+(n.last?64:0)+(n.mode===Gi?128:0)+(n.mode===gf||n.mode===_g?256:0),(h===0&&p===0||e===N_)&&D===da&&(D=EK),D},PK=t=>{if(Ra(t))return qr;let e=t.state;return e.window&&(e.window=null),t.state=null,da},MK=(t,e)=>{if(Ra(t))return qr;const n=t.state;return n.wrap&2?(n.head=e,e.done=!1,da):qr},LK=(t,e)=>{const n=e.length;let r,i,s;return Ra(t)||(r=t.state,r.wrap!==0&&r.mode!==Mh)?qr:r.mode===Mh&&(i=1,i=rl(i,e,n,0),i!==r.check)?Hx:(s=Zx(t,e,n,n),s?(r.mode=jx,Wx):(r.havedict=1,da))};var BK=qx,DK=Gx,$K=Vx,FK=IK,UK=Yx,zK=NK,HK=PK,WK=MK,jK=LK,KK="pako inflate (from Nodeca project)",ns={inflateReset:BK,inflateReset2:DK,inflateResetKeep:$K,inflateInit:FK,inflateInit2:UK,inflate:zK,inflateEnd:HK,inflateGetHeader:WK,inflateSetDictionary:jK,inflateInfo:KK};function VK(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var qK=VK;const Xx=Object.prototype.toString,{Z_NO_FLUSH:GK,Z_FINISH:YK,Z_OK:ol,Z_STREAM_END:Ag,Z_NEED_DICT:xg,Z_STREAM_ERROR:ZK,Z_DATA_ERROR:rk,Z_MEM_ERROR:XK}=xl;function Tl(t){this.options=Ud.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new $x,this.strm.avail_out=0;let n=ns.inflateInit2(this.strm,e.windowBits);if(n!==ol)throw new Error(bc[n]);if(this.header=new qK,ns.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=sl.string2buf(e.dictionary):Xx.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=ns.inflateSetDictionary(this.strm,e.dictionary),n!==ol)))throw new Error(bc[n])}Tl.prototype.push=function(t,e){const n=this.strm,r=this.options.chunkSize,i=this.options.dictionary;let s,o,a;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?YK:GK,Xx.call(t)==="[object ArrayBuffer]"?n.input=new
39Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),s=ns.inflate(n,o),s===xg&&i&&(s=ns.inflateSetDictionary(n,i),s===ol?s=ns.inflate(n,o):s===rk&&(s=xg));n.avail_in>0&&s===Ag&&n.state.wrap>0&&t[n.next_in]!==0;)ns.inflateReset(n),s=ns.inflate(n,o);switch(s){case ZK:case rk:case xg:case XK:return this.onEnd(s),this.ended=!0,!1}if(a=n.avail_out,n.next_out&&(n.avail_out===0||s===Ag))if(this.options.to==="string"){let c=sl.utf8border(n.output,n.next_out),u=n.next_out-c,l=sl.buf2string(n.output,c);n.next_out=u,n.avail_out=r-u,u&&n.output.set(n.output.subarray(c,c+u),0),this.onData(l)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(s===ol&&a===0)){if(s===Ag)return s=ns.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(n.avail_in===0)break}}return!0};Tl.prototype.onData=function(t){this.chunks.push(t)};Tl.prototype.onEnd=function(t){t===ol&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Ud.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function v1(t,e){const n=new Tl(e);if(n.push(t),n.err)throw n.msg||bc[n.err];return n.result}function JK(t,e){return e=e||{},e.raw=!0,v1(t,e)}var QK=Tl,eV=v1,tV=JK,nV=v1,rV=xl,iV={Inflate:QK,inflate:eV,inflateRaw:tV,ungzip:nV,constants:rV};const{Inflate:RX,inflate:sV,inflateRaw:TX,ungzip:OX}=iV;var oV=sV;function aV(t,e){return Array.apply(0,new Array(Math.ceil(t.length/e))).map((n,r)=>t.slice(r*e,(r+1)*e))}const Ro=t=>"version"in t;function cV(t){return t.reduce((e,n)=>e+n.toString(16).padStart(2,"0"),"0x")}function uV(t){t.indexOf("0x")===0&&(t=t.substr(2)),t.length%2===1&&(t="0"+t);let e=t.match(/.{2}/g);return e===null?ne.Buffer.from([]):ne.Buffer.from(e.map(n=>parseInt(n,16)))}var lV=Object.freeze({__proto__:null,encode:cV,decode:uV});function Jx(t){return new TextDecoder("utf-8").decode(t)}function fV(t){return new TextEncoder().encode(t)}var hV=Object.freeze({__proto__:null,decode:Jx,encode:fV});function om(t){return jt.encode(t)}function dV(t){return jt.decode(t)}var pV=Object.freeze({__proto__:null,encode:om,decode:dV});function gV(t){return t.toString("base64")}function b1(t){return ne.Buffer.from(t,"base64")}var mV=Object.freeze({__proto__:null,encode:gV,decode:b1}),yV=Object.freeze({__proto__:null,hex:lV,utf8:hV,bs58:pV,base64:mV});function Ls(t){return"accounts"in t}async function vV(t){const e=(await ue.findProgramAddress([],t))[0];return await ue.createWithSeed(e,bV(),t)}function bV(){return"anchor:idl"}const wV=He.struct([He.publicKey("authority"),He.vecU8("data")]);function _V(t){return wV.decode(t)}function kV(t){const e=["name","path","account","relations","generic"],n=s=>s.split(".").map(o=>xW(o,{locale:!1})).join("."),r=s=>{for(const o in s){const a=s[o];e.includes(o)?s[o]=Array.isArray(a)?a.map(n):n(a):typeof a=="object"&&r(a)}},i=structuredClone(t);return r(i),i}function ja(t,e,n,r){return t!=null&&t.length?t[0].name?n(t):r(t):e()}function Qx(t){const e=new Map;return t.errors&&t.errors.forEach(n=>{var r;let i=(r=n.msg)!==null&&r!==void 0?r:n.name;e.set(n.code,i)}),e}function eR(t,...e){if(t.args.length!=e.length)throw new Error("Invalid argument length");const n={};let r=0;return t.args.forEach(i=>{n[i.name]=e[r],r+=1}),n}function w1(t,e={}){t.forEach(n=>{if(Ls(n))w1(n.accounts,e[n.name]);else if(!e[n.name])throw new Error(`Account \`${n.name}\` not provided.`)})}function Or(t){return t instanceof ue?t:new ue(t)}class SV extends TypeError{constructor(e,n){let r;const{message:i,...s}=e,{path:o}=e,a=o.length===0?i:"At path: "+o.join(".")+" -- "+i;super(a),this.value=void 0,this.key=void 0,this.type=void 0,this.refinement=void 0,this.path=void 0,this.branch=void 0,this.failures=void 0,Object.assign(this,s),this.name=this.constructor.name,this.failures=()=>{var c;return(c=r)!=null?c:r=[e,...n()]}}}function EV(t){return tc(t)&&typeof t[Symbol.iterator]=="function"}function tc(t){return typeof t=="object"&&t!=null}function lo(t){return typeof t=="string"?JSON.stringify(t):""+t}function AV(t){const{done:e,value:n}=t.next();return e?void 0:n}function xV(t,e,n,r){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:i,branch:s}=e,{type:o}=n,{refinement:a,message:c="Expected a value of type `"+o+"`"+(a?" with refinement `"+a+"`":"")+", but received: `"+lo(r)+"`"}=t;return{value:r,type:o,refinement:a,key:i[i.length-1],path:i,branch:s,...t,message:c}}function*ik(t,e,n,r){EV(t)||(t=[t]);for(const i of t){const s=xV(i,e,n,r);s&&(yield s)}}function*_1(t,e,n){n===void 0&&(n={});const{path:r=[],branch:i=[t],coerce:s=!1,mask:o=!1}=n,a={path:r,branch:i};if(s&&(t=e.coercer(t,a),o&&e.type!=="type"&&tc(e.schema)&&tc(t)&&!Array.isArray(t)))for(const u in t)e.schema[u]===void 0&&delete t[u];let c=!0;for(const u of e.validator(t,a))c=!1,yield[u,void 0];for(let[u,l,h]of e.entries(t,a)){const p=_1(l,h,{path:u===void 0?r:[...r,u],branch:u===void 0?i:[...i,l],coerce:s,mask:o});for(const g of p)g[0]?(c=!1,yield[g[0],void 0]):s&&(l=g[1],u===void 0?t=l:t instanceof Map?t.set(u,l):t instanceof Set?t.add(l):tc(t)&&(t[u]=l))}if(c)for(const u of e.refiner(t,a))c=!1,yield[u,void 0];c&&(yield[void 0,t])}class mo{constructor(e){this.TYPE=void 0,this.type=void 0,this.schema=void 0,this.coercer=void 0,this.validator=void 0,this.refiner=void 0,this.entries=void 0;const{type:n,schema:r,validator:i,refiner:s,coercer:o=c=>c,entries:a=function*(){}}=e;this.type=n,this.schema=r,this.entries=a,this.coercer=o,i?this.validator=(c,u)=>{const l=i(c,u);return ik(l,u,this,c)}:this.validator=()=>[],s?this.refiner=(c,u)=>{const l=s(c,u);return ik(l,u,this,c)}:this.refiner=()=>[]}assert(e){return RV(e,this)}create(e){return k1(e,this)}is(e){return tR(e,this)}mask(e){return TV(e,this)}validate(e,n){return n===void 0&&(n={}),Ol(e,this,n)}}function RV(t,e){const n=Ol(t,e);if(n[0])throw n[0]}function k1(t,e){const n=Ol(t,e,{coerce:!0});if(n[0])throw n[0];return n[1]}function TV(t,e){const n=Ol(t,e,{coerce:!0,mask:!0});if(n[0])throw n[0];return n[1]}function tR(t,e){return!Ol(t,e)[0]}function Ol(t,e,n){n===void 0&&(n={});const r=_1(t,e,n),i=AV(r);return i[0]?[new SV(i[0],function*(){for(const o of r)o[0]&&(yield o[0])}),void 0]:[void 0,i[1]]}function Il(t,e){return new mo({type:t,schema:null,validator:e})}function OV(){return Il("any",()=>!0)}function Rg(t){return new mo({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[n,r]of e.entries())yield[n,r,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||"Expected an array value, but received: "+lo(e)}})}function IV(){return Il("boolean",t=>typeof t=="boolean")}function sk(t){const e=lo(t),n=typeof t;return new mo({type:"literal",schema:n==="string"||n==="number"||n==="boolean"?t:null,validator(r){return r===t||"Expected the literal `"+e+"`, but received: "+lo(r)}})}function yf(t){return new mo({...t,validator:(e,n)=>e===null||t.validator(e,n),refiner:(e,n)=>e===null||t.refiner(e,n)})}function qf(){return Il("number",t=>typeof t=="number"&&!isNaN(t)||"Expected a number, but received: "+lo(t))}function Gf(t){return new mo({...t,validator:(e,n)=>e===void 0||t.validator(e,n),refiner:(e,n)=>e===void 0||t.refiner(e,n)})}function Zo(){return Il("string",t=>typeof t=="string"||"Expected a string, but received: "+lo(t))}function to(t){const e=Object.keys(t);return new mo({type:"type",schema:t,*entries(n){if(tc(n))for(const r of e)yield[r,n[r],t[r]]},validator(n){return tc(n)||"Expected an object, but received: "+lo(n)}})}function nR(t){const e=t.map(n=>n.type).join(" | ");return new mo({type:"union",schema:null,coercer(n,r){return(t.find(s=>
39{const[o]=s.validate(n,{coerce:!0});return!o})||S1()).coercer(n,r)},validator(n,r){const i=[];for(const s of t){const[...o]=_1(n,s,r),[a]=o;if(a[0])for(const[c]of o)c&&i.push(c);else return[]}return["Expected the value to satisfy a union of `"+e+"`, but received: "+lo(n),...i]}})}function S1(){return Il("unknown",()=>!0)}function CV(t,e,n){return new mo({...t,coercer:(r,i)=>tR(r,e)?t.coercer(n(r,i),i):t.coercer(r,i)})}async function NV(t,e,n,r){t=Or(t),r||(r=al());const i=new ot;if(i.add(new vt({programId:t,keys:e??[],data:n})),r.sendAndConfirm===void 0)throw new Error("This function requires 'Provider.sendAndConfirm' to be implemented.");return await r.sendAndConfirm(i,[])}const ok=99;async function PV(t,e,n){return(await E1(t,e,n)).map(i=>i?{publicKey:i.publicKey,account:i.account}:null)}async function E1(t,e,n){if(e.length<=ok)return await ak(t,e,n);{const r=aV(e,ok);return(await Promise.all(r.map(s=>ak(t,s,n)))).flat()}}async function ak(t,e,n){const r=n??t.commitment,{value:i,context:s}=await t.getMultipleAccountsInfoAndContext(e,r);return i.map((a,c)=>a===null?null:{publicKey:e[c],account:a,context:s})}async function rR(t,e,n,r,i){var s;n&&n.length>0&&e.sign(...n);const o=e._compile(),a=o.serialize(),u=e._serialize(a).toString("base64"),l={encoding:"base64",commitment:r??t.commitment};if(i){const y=(Array.isArray(i)?i:o.nonProgramIds()).map(w=>w.toBase58());l.accounts={encoding:"base64",addresses:y}}n&&n.length>0&&(l.sigVerify=!0);const h=[u,l],p=await t._rpcRequest("simulateTransaction",h),g=k1(p,DV);if("error"in g){let y;if("data"in g.error&&(y=(s=g.error.data)===null||s===void 0?void 0:s.logs,y&&Array.isArray(y))){const w=` 40 `,k=w+y.join(w);console.error(g.error.message,k)}throw new mc("failed to simulate transaction: "+g.error.message,y)}return g.result}function MV(t){return CV(iR(t),LV,e=>"error"in e?e:{...e,result:k1(e.result,t)})}const LV=iR(S1());function iR(t){return nR([to({jsonrpc:sk("2.0"),id:Zo(),result:t}),to({jsonrpc:sk("2.0"),id:Zo(),error:to({code:S1(),message:Zo(),data:Gf(OV())})})])}function BV(t){return MV(to({context:to({slot:qf()}),value:t}))}const DV=BV(to({err:yf(nR([to({}),Zo()])),logs:yf(Rg(Zo())),accounts:Gf(yf(Rg(yf(to({executable:IV(),owner:Zo(),lamports:qf(),data:Rg(Zo()),rentEpoch:Gf(qf())}))))),unitsConsumed:Gf(qf())}));var $V=Object.freeze({__proto__:null,invoke:NV,getMultipleAccounts:PV,getMultipleAccountsAndContext:E1,simulateTransaction:rR});let sR=class am{constructor(e,n,r=am.defaultOptions()){this.connection=e,this.wallet=n,this.opts=r,this.publicKey=n==null?void 0:n.publicKey}static defaultOptions(){return{preflightCommitment:"processed",commitment:"processed"}}static local(e,n=am.defaultOptions()){throw new Error("Provider local is not available on browser.")}static env(){throw new Error("Provider env is not available on browser.")}async sendAndConfirm(e,n,r){var i,s,o,a;if(r===void 0&&(r=this.opts),Ro(e))n&&e.sign(n);else if(e.feePayer=(i=e.feePayer)!==null&&i!==void 0?i:this.wallet.publicKey,e.recentBlockhash=(await this.connection.getLatestBlockhash(r.preflightCommitment)).blockhash,n)for(const u of n)e.partialSign(u);e=await this.wallet.signTransaction(e);const c=e.serialize();try{return await ck(this.connection,c,r)}catch(u){if(u instanceof cm){const l=om(Ro(e)?((s=e.signatures)===null||s===void 0?void 0:s[0])||new Uint8Array:(o=e.signature)!==null&&o!==void 0?o:new Uint8Array),h=Ro(e)?0:void 0,p=await this.connection.getTransaction(l,{commitment:"confirmed",maxSupportedTransactionVersion:h});if(p){const g=(a=p.meta)===null||a===void 0?void 0:a.logMessages;throw g?new mc(u.message,g):u}else throw u}else throw u}}async sendAll(e,n){var r,i,s;n===void 0&&(n=this.opts);const o=(await this.connection.getLatestBlockhash(n.preflightCommitment)).blockhash;let a=e.map(l=>{var h,p;if(Ro(l.tx)){let g=l.tx;return l.signers&&g.sign(l.signers),g}else{let g=l.tx,y=(h=l.signers)!==null&&h!==void 0?h:[];return g.feePayer=(p=g.feePayer)!==null&&p!==void 0?p:this.wallet.publicKey,g.recentBlockhash=o,y.forEach(w=>{g.partialSign(w)}),g}});const c=await this.wallet.signAllTransactions(a),u=[];for(let l=0;l<a.length;l+=1){const h=c[l],p=h.serialize();try{u.push(await ck(this.connection,p,n))}catch(g){if(g instanceof cm){const y=om(Ro(h)?((r=h.signatures)===null||r===void 0?void 0:r[0])||new Uint8Array:(i=h.signature)!==null&&i!==void 0?i:new Uint8Array),w=Ro(h)?0:void 0,k=await this.connection.getTransaction(y,{commitment:"confirmed",maxSupportedTransactionVersion:w});if(k){const T=(s=k.meta)===null||s===void 0?void 0:s.logMessages;throw T?new mc(g.message,T):g}else throw g}else throw g}}return u}async simulate(e,n,r,i){let s=(await this.connection.getLatestBlockhash(r??this.connection.commitment)).blockhash,o;if(Ro(e)?(n&&n.length>0&&(e.sign(n),e=await this.wallet.signTransaction(e)),o=await this.connection.simulateTransaction(e,{commitment:r})):(e.feePayer=e.feePayer||this.wallet.publicKey,e.recentBlockhash=s,n&&n.length>0&&(e=await this.wallet.signTransaction(e)),o=await rR(this.connection,e,
40n,r,i)),o.value.err)throw new FV(o.value);return o.value}};class FV extends Error{constructor(e,n){super(n),this.simulationResponse=e}}async function ck(t,e,n){const r=n?{skipPreflight:n.skipPreflight,preflightCommitment:n.preflightCommitment||n.commitment,maxRetries:n.maxRetries,minContextSlot:n.minContextSlot}:{};let i;const s=Date.now();for(;Date.now()-s<6e4;)try{const o=await t.sendRawTransaction(e,r);if(n!=null&&n.blockhash)if(r.maxRetries===0){const a=AbortSignal.timeout(15e3);i=(await t.confirmTransaction({abortSignal:a,signature:o,...n.blockhash},n&&n.commitment)).value}else i=(await t.confirmTransaction({signature:o,...n.blockhash},n&&n.commitment)).value;else i=(await t.confirmTransaction(o,n&&n.commitment)).value;if(i.err)throw new cm(`Raw transaction ${o} failed (${JSON.stringify(i)})`);return o}catch(o){if(o.name==="TimeoutError")continue;throw o}throw Error("Transaction failed to confirm in 60s")}class cm extends Error{constructor(e){super(e)}}function UV(t){um=t}function al(){return um===null?sR.local():um}let um=null;var zV=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof ia<"u"?ia:typeof self<"u"?self:{};function HV(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var X={};Object.defineProperty(X,"__esModule",{value:!0});var oR=X.ANCHOR_ERROR__REQUIRE_EQ_VIOLATED=nT=X.ANCHOR_ERROR__REQUIRE_VIOLATED=tT=X.ANCHOR_ERROR__CONSTRAINT_MINT_TRANSFER_HOOK_EXTENSION_PROGRAM_ID=eT=X.ANCHOR_ERROR__CONSTRAINT_MINT_TRANSFER_HOOK_EXTENSION_AUTHORITY=QR=X.ANCHOR_ERROR__CONSTRAINT_MINT_TRANSFER_HOOK_EXTENSION=JR=X.ANCHOR_ERROR__CONSTRAINT_MINT_PERMANENT_DELEGATE_EXTENSION_DELEGATE=XR=X.ANCHOR_ERROR__CONSTRAINT_MINT_PERMANENT_DELEGATE_EXTENSION=ZR=X.ANCHOR_ERROR__CONSTRAINT_MINT_CLOSE_AUTHORITY_EXTENSION_AUTHORITY=YR=X.ANCHOR_ERROR__CONSTRAINT_MINT_CLOSE_AUTHORITY_EXTENSION=GR=X.ANCHOR_ERROR__CONSTRAINT_MINT_METADATA_POINTER_EXTENSION_METADATA_ADDRESS=qR=X.ANCHOR_ERROR__CONSTRAINT_MINT_METADATA_POINTER_EXTENSION_AUTHORITY=VR=X.ANCHOR_ERROR__CONSTRAINT_MINT_METADATA_POINTER_EXTENSION=KR=X.ANCHOR_ERROR__CONSTRAINT_MINT_GROUP_MEMBER_POINTER_EXTENSION_MEMBER_ADDRESS=jR=X.ANCHOR_ERROR__CONSTRAINT_MINT_GROUP_MEMBER_POINTER_EXTENSION_AUTHORITY=WR=X.ANCHOR_ERROR__CONSTRAINT_MINT_GROUP_MEMBER_POINTER_EXTENSION=HR=X.ANCHOR_ERROR__CONSTRAINT_MINT_GROUP_POINTER_EXTENSION_GROUP_ADDRESS=zR=X.ANCHOR_ERROR__CONSTRAINT_MINT_GROUP_POINTER_EXTENSION_AUTHORITY=UR=X.ANCHOR_ERROR__CONSTRAINT_MINT_GROUP_POINTER_EXTENSION=FR=X.ANCHOR_ERROR__CONSTRAINT_ASSOCIATED_TOKEN_TOKEN_PROGRAM=$R=X.ANCHOR_ERROR__CONSTRAINT_MINT_TOKEN_PROGRAM=DR=X.ANCHOR_ERROR__CONSTRAINT_TOKEN_TOKEN_PROGRAM=BR=X.ANCHOR_ERROR__CONSTRAINT_ACCOUNT_IS_NONE=LR=X.ANCHOR_ERROR__CONSTRAINT_SPACE=MR=X.ANCHOR_ERROR__CONSTRAINT_MINT_DECIMALS=PR=X.ANCHOR_ERROR__CONSTRAINT_MINT_FREEZE_AUTHORITY=NR=X.ANCHOR_ERROR__CONSTRAINT_MINT_MINT_AUTHORITY=CR=X.ANCHOR_ERROR__CONSTRAINT_TOKEN_OWNER=IR=X.ANCHOR_ERROR__CONSTRAINT_TOKEN_MINT=OR=X.ANCHOR_ERROR__CONSTRAINT_ZERO=TR=X.ANCHOR_ERROR__CONSTRAINT_ADDRESS=RR=X.ANCHOR_ERROR__CONSTRAINT_CLOSE=xR=X.ANCHOR_ERROR__CONSTRAINT_ASSOCIATED_INIT=AR=X.ANCHOR_ERROR__CONSTRAINT_ASSOCIATED=ER=X.ANCHOR_ERROR__CONSTRAINT_STATE=SR=X.ANCHOR_ERROR__CONSTRAINT_EXECUTABLE=kR=X.ANCHOR_ERROR__CONSTRAINT_SEEDS=_R=X.ANCHOR_ERROR__CONSTRAINT_RENT_EXEMPT=wR=X.ANCHOR_ERROR__CONSTRAINT_OWNER=bR=X.ANCHOR_ERROR__CONSTRAINT_RAW=vR=X.ANCHOR_ERROR__CONSTRAINT_SIGNER=yR=X.ANCHOR_ERROR__CONSTRAINT_HAS_ONE=mR=X.ANCHOR_ERROR__CONSTRAINT_MUT=gR=X.ANCHOR_ERROR__EVENT_INSTRUCTION_STUB=pR=X.ANCHOR_ERROR__IDL_ACCOUNT_NOT_EMPTY=dR=X.ANCHOR_ERROR__IDL_INSTRUCTION_INVALID_PROGRAM=hR=X.ANCHOR_ERROR__IDL_INSTRUCTION_STUB=fR=X.ANCHOR_ERROR__INSTRUCTION_DID_NOT_SERIALIZE=lR=X.ANCHOR_ERROR__INSTRUCTION_DID_NOT_DESERIALIZE=uR=X.ANCHOR_ERROR__INSTRUCTION_FALLBACK_NOT_FOUND=cR=X.ANCHOR_ERROR__INSTRUCTION_MISSING=void 0,aR=X.ANCHOR_ERROR__DEPRECATED=TT=X.ANCHOR_ERROR__INVALID_NUMERIC_CONVERSION=RT=X.ANCHOR_ERROR__TRYING_TO_INIT_PAYER_AS_PROGRAM_ACCOUNT=xT=X.ANCHOR_ERROR__DECLARED_PROGRAM_ID_MISMATCH=AT=X.ANCHOR_ERROR__ACCOUNT_DUPLICATE_REALLOCS=ET=X.ANCHOR_ERROR__ACCOUNT_REALLOC_EXCEEDS_LIMIT=ST=X.ANCHOR_ERROR__ACCOUNT_SYSVAR_MISMATCH=kT=X.ANCHOR_ERROR__ACCOUNT_NOT_ASSOCIATED_TOKEN_ACCOUNT=_T=X.ANCHOR_ERROR__ACCOUNT_NOT_PROGRAM_DATA=wT=X.ANCHOR_ERROR__ACCOUNT_NOT_INITIALIZED=bT=X.ANCHOR_ERROR__ACCOUNT_NOT_SYSTEM_OWNED=vT=X.ANCHOR_ERROR__ACCOUNT_NOT_SIGNER=yT=X.ANCHOR_ERROR__INVALID_PROGRAM_EXECUTABLE=mT=X.ANCHOR_ERROR__INVALID_PROGRAM_ID=gT=X.ANCHOR_ERROR__ACCOUNT_OWNED_BY_WRONG_PROGRAM=pT=X.ANCHOR_ERROR__ACCOUNT_NOT_MUTABLE=dT=X.ANCHOR_ERROR__ACCOUNT_NOT_ENOUGH_KEYS=hT=X.ANCHOR_ERROR__ACCOUNT_DID_NOT_SERIALIZE=fT=X.ANCHOR_ERROR__ACCOUNT_DID_NOT_DESERIALIZE=lT=X.ANCHOR_ERROR__ACCOUNT_DISCRIMINATOR_MISMATCH=uT=X.ANCHOR_ERROR__ACCOUNT_DISCRIMINATOR_NOT_FOUND=cT=X.ANCHOR_ERROR__ACCOUNT_DISCRIMINATOR_ALREADY_SET
40=aT=X.ANCHOR_ERROR__REQUIRE_GTE_VIOLATED=oT=X.ANCHOR_ERROR__REQUIRE_GT_VIOLATED=sT=X.ANCHOR_ERROR__REQUIRE_KEYS_NEQ_VIOLATED=iT=X.ANCHOR_ERROR__REQUIRE_NEQ_VIOLATED=rT=X.ANCHOR_ERROR__REQUIRE_KEYS_EQ_VIOLATED=void 0,cR=X.ANCHOR_ERROR__INSTRUCTION_MISSING=100,uR=X.ANCHOR_ERROR__INSTRUCTION_FALLBACK_NOT_FOUND=101,lR=X.ANCHOR_ERROR__INSTRUCTION_DID_NOT_DESERIALIZE=102,fR=X.ANCHOR_ERROR__INSTRUCTION_DID_NOT_SERIALIZE=103,hR=X.ANCHOR_ERROR__IDL_INSTRUCTION_STUB=1e3,dR=X.ANCHOR_ERROR__IDL_INSTRUCTION_INVALID_PROGRAM=1001,pR=X.ANCHOR_ERROR__IDL_ACCOUNT_NOT_EMPTY=1002,gR=X.ANCHOR_ERROR__EVENT_INSTRUCTION_STUB=1500,mR=X.ANCHOR_ERROR__CONSTRAINT_MUT=2e3,yR=X.ANCHOR_ERROR__CONSTRAINT_HAS_ONE=2001,vR=X.ANCHOR_ERROR__CONSTRAINT_SIGNER=2002,bR=X.ANCHOR_ERROR__CONSTRAINT_RAW=2003,wR=X.ANCHOR_ERROR__CONSTRAINT_OWNER=2004,_R=X.ANCHOR_ERROR__CONSTRAINT_RENT_EXEMPT=2005,kR=X.ANCHOR_ERROR__CONSTRAINT_SEEDS=2006,SR=X.ANCHOR_ERROR__CONSTRAINT_EXECUTABLE=2007,ER=X.ANCHOR_ERROR__CONSTRAINT_STATE=2008,AR=X.ANCHOR_ERROR__CONSTRAINT_ASSOCIATED=2009,xR=X.ANCHOR_ERROR__CONSTRAINT_ASSOCIATED_INIT=2010,RR=X.ANCHOR_ERROR__CONSTRAINT_CLOSE=2011,TR=X.ANCHOR_ERROR__CONSTRAINT_ADDRESS=2012,OR=X.ANCHOR_ERROR__CONSTRAINT_ZERO=2013,IR=X.ANCHOR_ERROR__CONSTRAINT_TOKEN_MINT=2014,CR=X.ANCHOR_ERROR__CONSTRAINT_TOKEN_OWNER=2015,NR=X.ANCHOR_ERROR__CONSTRAINT_MINT_MINT_AUTHORITY=2016,PR=X.ANCHOR_ERROR__CONSTRAINT_MINT_FREEZE_AUTHORITY=2017,MR=X.ANCHOR_ERROR__CONSTRAINT_MINT_DECIMALS=2018,LR=X.ANCHOR_ERROR__CONSTRAINT_SPACE=2019,BR=X.ANCHOR_ERROR__CONSTRAINT_ACCOUNT_IS_NONE=2020,DR=X.ANCHOR_ERROR__CONSTRAINT_TOKEN_TOKEN_PROGRAM=2021,$R=X.ANCHOR_ERROR__CONSTRAINT_MINT_TOKEN_PROGRAM=2022,FR=X.ANCHOR_ERROR__CONSTRAINT_ASSOCIATED_TOKEN_TOKEN_PROGRAM=2023,UR=X.ANCHOR_ERROR__CONSTRAINT_MINT_GROUP_POINTER_EXTENSION=2024,zR=X.ANCHOR_ERROR__CONSTRAINT_MINT_GROUP_POINTER_EXTENSION_AUTHORITY=2025,HR=X.ANCHOR_ERROR__CONSTRAINT_MINT_GROUP_POINTER_EXTENSION_GROUP_ADDRESS=2026,WR=X.ANCHOR_ERROR__CONSTRAINT_MINT_GROUP_MEMBER_POINTER_EXTENSION=2027,jR=X.ANCHOR_ERROR__CONSTRAINT_MINT_GROUP_MEMBER_POINTER_EXTENSION_AUTHORITY=2028,KR=X.ANCHOR_ERROR__CONSTRAINT_MINT_GROUP_MEMBER_POINTER_EXTENSION_MEMBER_ADDRESS=2029,VR=X.ANCHOR_ERROR__CONSTRAINT_MINT_METADATA_POINTER_EXTENSION=2030,qR=X.ANCHOR_ERROR__CONSTRAINT_MINT_METADATA_POINTER_EXTENSION_AUTHORITY=2031,GR=X.ANCHOR_ERROR__CONSTRAINT_MINT_METADATA_POINTER_EXTENSION_METADATA_ADDRESS=2032,YR=X.ANCHOR_ERROR__CONSTRAINT_MINT_CLOSE_AUTHORITY_EXTENSION=2033,ZR=X.ANCHOR_ERROR__CONSTRAINT_MINT_CLOSE_AUTHORITY_EXTENSION_AUTHORITY=2034,XR=X.ANCHOR_ERROR__CONSTRAINT_MINT_PERMANENT_DELEGATE_EXTENSION=2035,JR=X.ANCHOR_ERROR__CONSTRAINT_MINT_PERMANENT_DELEGATE_EXTENSION_DELEGATE=2036,QR=X.ANCHOR_ERROR__CONSTRAINT_MINT_TRANSFER_HOOK_EXTENSION=2037,eT=X.ANCHOR_ERROR__CONSTRAINT_MINT_TRANSFER_HOOK_EXTENSION_AUTHORITY=2038,tT=X.ANCHOR_ERROR__CONSTRAINT_MINT_TRANSFER_HOOK_EXTENSION_PROGRAM_ID=2039,nT=X.ANCHOR_ERROR__REQUIRE_VIOLATED=2500;oR=X.ANCHOR_ERROR__REQUIRE_EQ_VIOLATED=2501;var rT=X.ANCHOR_ERROR__REQUIRE_KEYS_EQ_VIOLATED=2502,iT=X.ANCHOR_ERROR__REQUIRE_NEQ_VIOLATED=2503,sT=X.ANCHOR_ERROR__REQUIRE_KEYS_NEQ_VIOLATED=2504,oT=X.ANCHOR_ERROR__REQUIRE_GT_VIOLATED=2505,aT=X.ANCHOR_ERROR__REQUIRE_GTE_VIOLATED=2506,cT=X.ANCHOR_ERROR__ACCOUNT_DISCRIMINATOR_ALREADY_SET=3e3,uT=X.ANCHOR_ERROR__ACCOUNT_DISCRIMINATOR_NOT_FOUND=3001,lT=X.ANCHOR_ERROR__ACCOUNT_DISCRIMINATOR_MISMATCH=3002,fT=X.ANCHOR_ERROR__ACCOUNT_DID_NOT_DESERIALIZE=3003,hT=X.ANCHOR_ERROR__ACCOUNT_DID_NOT_SERIALIZE=3004,dT=X.ANCHOR_ERROR__ACCOUNT_NOT_ENOUGH_KEYS=3005,pT=X.ANCHOR_ERROR__ACCOUNT_NOT_MUTABLE=3006,gT=X.ANCHOR_ERROR__ACCOUNT_OWNED_BY_WRONG_PROGRAM=3007,mT=X.ANCHOR_ERROR__INVALID_PROGRAM_ID=3008,yT=X.ANCHOR_ERROR__INVALID_PROGRAM_EXECUTABLE=3009,vT=X.ANCHOR_ERROR__ACCOUNT_NOT_SIGNER=3010,bT=X.ANCHOR_ERROR__ACCOUNT_NOT_SYSTEM_OWNED=3011,wT=X.ANCHOR_ERROR__ACCOUNT_NOT_INITIALIZED=3012,_T=X.ANCHOR_ERROR__ACCOUNT_NOT_PROGRAM_DATA=3013,kT=X.ANCHOR_ERROR__ACCOUNT_NOT_ASSOCIATED_TOKEN_ACCOUNT=3014,ST=X.ANCHOR_ERROR__ACCOUNT_SYSVAR_MISMATCH=3015,ET=X.ANCHOR_ERROR__ACCOUNT_REALLOC_EXCEEDS_LIMIT=3016,AT=X.ANCHOR_ERROR__ACCOUNT_DUPL
40ICATE_REALLOCS=3017,xT=X.ANCHOR_ERROR__DECLARED_PROGRAM_ID_MISMATCH=4100,RT=X.ANCHOR_ERROR__TRYING_TO_INIT_PAYER_AS_PROGRAM_ACCOUNT=4101,TT=X.ANCHOR_ERROR__INVALID_NUMERIC_CONVERSION=4102;aR=X.ANCHOR_ERROR__DEPRECATED=5e3;const WV=new Set(["debug-logs"]),OT=new Map;function jV(t){if(!WV.has(t))throw new Error("Invalid feature");OT.set(t,!0)}function A1(t){return OT.get(t)!==void 0}var KV=Object.freeze({__proto__:null,set:jV,isSet:A1});class Qi extends Error{constructor(e){super(e),this.name="IdlError"}}class $c{constructor(e){this.stack=e}static parse(e){var n;const r=/^Program (\w*) invoke/,i=/^Program \w* success/,s=[];for(let o=0;o<e.length;o++){if(i.exec(e[o])){s.pop();continue}const a=(n=r.exec(e[o]))===null||n===void 0?void 0:n[1];a&&s.push(new ue(a))}return new $c(s)}}class nc extends Error{constructor(e,n,r,i,s,o){super(r.join(` 41`).replace("Program log: ","")),this.errorLogs=r,this.logs=i,this.error={errorCode:e,errorMessage:n,comparedValues:o,origin:s},this._programErrorStack=$c.parse(i)}static parse(e){if(!e)return null;const n=e.findIndex(p=>p.startsWith("Program log: AnchorError"));if(n===-1)return null;const r=e[n],i=[r];let s;if(n+1<e.length){if(e[n+1]==="Program log: Left:"){const p=/^Program log: (.*)$/,g=p.exec(e[n+2])[1],y=p.exec(e[n+4])[1];s=[new ue(g),new ue(y)],i.push(...e.slice(n+1,n+5))}else if(e[n+1].startsWith("Program log: Left:")){const p=/^Program log: (Left|Right): (.*)$/,g=p.exec(e[n+1])[2],y=p.exec(e[n+2])[2];i.push(...e.slice(n+1,n+3)),s=[g,y]}}const a=/^Program log: AnchorError occurred\. Error Code: (.*)\. Error Number: (\d*)\. Error Message: (.*)\./.exec(r),u=/^Program log: AnchorError thrown in (.*):(\d*)\. Error Code: (.*)\. Error Number: (\d*)\. Error Message: (.*)\./.exec(r),h=/^Program log: AnchorError caused by account: (.*)\. Error Code: (.*)\. Error Number: (\d*)\. Error Message: (.*)\./.exec(r);if(a){const[p,g,y]=a.slice(1,4),w={code:p,number:parseInt(g)};return new nc(w,y,i,e,void 0,s)}else if(u){const[p,g,y,w,k]=u.slice(1,6),T={code:y,number:parseInt(w)},C={file:p,line:parseInt(g)};return new nc(T,k,i,e,C,s)}else if(h){const[p,g,y,w]=h.slice(1,5),k=p,T={code:g,number:parseInt(y)};return new nc(T,w,i,e,k,s)}else return null}get program(){return this._programErrorStack.stack[this._programErrorStack.stack.length-1]}get programErrorStack(){return this._programErrorStack.stack}toString(){return this.message}}class cl extends Error{constructor(e,n,r){super(),this.code=e,this.msg=n,this.logs=r,r&&(this._programErrorStack=$c.parse(r))}static parse(e,n){const r=e.toString();let i;if(r.includes("custom program error:")){let a=r.split("custom program error: ");if(a.length!==2)return null;i=a[1]}else{const a=r.match(/"Custom":([0-9]+)}/g);if(!a||a.length>1)return null;i=a[0].match(/([0-9]+)/g)[0]}let s;try{s=parseInt(i)}catch{return null}let o=n.get(s);return o!==void 0?new cl(s,o,e.logs):(o=IT.get(s),o!==void 0?new cl(s,o,e.logs):null)}get program(){var e;return(e=this._programErrorStack)===null||e===void 0?void 0:e.stack[this._programErrorStack.stack.length-1]}get programErrorStack(){var e;return(e=this._programErrorStack)===null||e===void 0?void 0:e.stack}toString(){return this.msg}}function x1(t,e){A1("debug-logs")&&console.log("Translating error:",t);const n=nc.parse(t.logs);if(n)return n;const r=cl.parse(t,e);if(r)return r;if(t.logs){const i={get:function(s,o){return o==="programErrorStack"?s.programErrorStack.stack:o==="program"?s.programErrorStack.stack[t.programErrorStack.stack.length-1]:Reflect.get(...arguments)}};return t.programErrorStack=$c.parse(t.logs),new Proxy(t,i)}return t}const ge={InstructionMissing:cR,InstructionFallbackNotFound:uR,InstructionDidNotDeserialize:lR,InstructionDidNotSerialize:fR,IdlInstructionStub:hR,IdlInstructionInvalidProgram:dR,IdlAccountNotEmpty:pR,EventInstructionStub:gR,ConstraintMut:mR,ConstraintHasOne:yR,ConstraintSigner:vR,ConstraintRaw:bR,ConstraintOwner:wR,ConstraintRentExempt:_R,ConstraintSeeds:kR,ConstraintExecutable:SR,ConstraintState:ER,ConstraintAssociated:AR,ConstraintAssociatedInit:xR,ConstraintClose:RR,ConstraintAddress:TR,ConstraintZero:OR,ConstraintTokenMint:IR,ConstraintTokenOwner:CR,ConstraintMintMintAuthority:NR,ConstraintMintFreezeAuthority:PR,ConstraintMintDecimals:MR,ConstraintSpace:LR,ConstraintAccountIsNone:BR,ConstraintTokenTokenProgram:DR,ConstraintMintTokenProgram:$R,ConstraintAssociatedTokenTokenProgram:FR,ConstraintMintGroupPointerExtension:UR,ConstraintMintGroupPointerExtensionAuthority:zR,ConstraintMintGroupPointerExtensionGroupAddress:HR,ConstraintMintGroupMemberPointerExtension:WR,ConstraintMintGroupMemberPointerExtensionAuthority:jR,ConstraintMintGroupMemberPointerExtensionMemberAddress:KR,ConstraintMintMetadataPointerExtension:VR,ConstraintMintMetadataPointerExtensionAuthority:qR,ConstraintMintMetadataPointerExtensionMetadataAddress:GR,ConstraintMintCloseAuthorityExtension:YR,ConstraintMintCloseAuthorityExtensionAuthority:ZR,ConstraintMintPermanentDelegateExtension:XR,ConstraintMintPermanentDelegateExtensionDelegate:JR,ConstraintMintTransferHookExtension:QR,ConstraintMintTransferHookExtensionAuthority:eT,ConstraintMintTransferHookExtensionProgramId:tT,RequireViolated:nT,RequireEqViolated:oR,RequireKeysEqViolated:rT,RequireNeqViolated:iT,RequireKeysNeqViolated:sT,RequireGtViolated:oT,RequireGteViolated:aT,AccountDiscriminatorAlreadySet:cT,AccountDiscriminatorNotFound:uT,AccountDiscriminatorMismatch:lT,AccountDidNotDeserialize:fT,AccountDidNotSerialize:hT,AccountNotEnoughKeys:dT,AccountNotMutable:pT,AccountOwnedByWrongProgram:gT,InvalidProgramId:mT,InvalidProgramExecutable:yT,AccountNotSigner:vT,AccountNotSystemOwned:bT,AccountNotInitialized:wT,AccountNotProgramData:_T,AccountNotAssociatedTokenAccount:kT,AccountSysvarMismatch:ST,AccountReallocExceedsLimit:ET,AccountDuplicateReallocs:AT,DeclaredProgramIdMismatch:xT,TryingToInitPayerAsProgramAccount:RT,InvalidNumericConversion:TT,Deprecated:aR}
41,IT=new Map([[ge.InstructionMissing,"Instruction discriminator not provided"],[ge.InstructionFallbackNotFound,"Fallback functions are not supported"],[ge.InstructionDidNotDeserialize,"The program could not deserialize the given instruction"],[ge.InstructionDidNotSerialize,"The program could not serialize the given instruction"],[ge.IdlInstructionStub,"The program was compiled without idl instructions"],[ge.IdlInstructionInvalidProgram,"The transaction was given an invalid program for the IDL instruction"],[ge.IdlAccountNotEmpty,"IDL account must be empty in order to resize, try closing first"],[ge.EventInstructionStub,"The program was compiled without `event-cpi` feature"],[ge.ConstraintMut,"A mut constraint was violated"],[ge.ConstraintHasOne,"A has one constraint was violated"],[ge.ConstraintSigner,"A signer constraint was violated"],[ge.ConstraintRaw,"A raw constraint was violated"],[ge.ConstraintOwner,"An owner constraint was violated"],[ge.ConstraintRentExempt,"A rent exemption constraint was violated"],[ge.ConstraintSeeds,"A seeds constraint was violated"],[ge.ConstraintExecutable,"An executable constraint was violated"],[ge.ConstraintState,"Deprecated Error, feel free to replace with something else"],[ge.ConstraintAssociated,"An associated constraint was violated"],[ge.ConstraintAssociatedInit,"An associated init constraint was violated"],[ge.ConstraintClose,"A close constraint was violated"],[ge.ConstraintAddress,"An address constraint was violated"],[ge.ConstraintZero,"Expected zero account discriminant"],[ge.ConstraintTokenMint,"A token mint constraint was violated"],[ge.ConstraintTokenOwner,"A token owner constraint was violated"],[ge.ConstraintMintMintAuthority,"A mint mint authority constraint was violated"],[ge.ConstraintMintFreezeAuthority,"A mint freeze authority constraint was violated"],[ge.ConstraintMintDecimals,"A mint decimals constraint was violated"],[ge.ConstraintSpace,"A space constraint was violated"],[ge.ConstraintAccountIsNone,"A required account for the constraint is None"],[ge.ConstraintTokenTokenProgram,"A token account token program constraint was violated"],[ge.ConstraintMintTokenProgram,"A mint token program constraint was violated"],[ge.ConstraintAssociatedTokenTokenProgram,"An associated token account token program constraint was violated"],[ge.ConstraintMintGroupPointerExtension,"A group pointer extension constraint was violated"],[ge.ConstraintMintGroupPointerExtensionAuthority,"A group pointer extension authority constraint was violated"],[ge.ConstraintMintGroupPointerExtensionGroupAddress,"A group pointer extension group address constraint was violated"],[ge.ConstraintMintGroupMemberPointerExtension,"A group member pointer extension constraint was violated"],[ge.ConstraintMintGroupMemberPointerExtensionAuthority,"A group member pointer extension authority constraint was violated"],[ge.ConstraintMintGroupMemberPointerExtensionMemberAddress,"A group member pointer extension group address constraint was violated"],[ge.ConstraintMintMetadataPointerExtension,"A metadata pointer extension constraint was violated"],[ge.ConstraintMintMetadataPointerExtensionAuthority,"A metadata pointer extension authority constraint was violated"],[ge.ConstraintMintMetadataPointerExtensionMetadataAddress,"A metadata pointer extension metadata address constraint was violated"],[ge.ConstraintMintCloseAuthorityExtension,"A close authority constraint was violated"],[ge.ConstraintMintCloseAuthorityExtensionAuthority,"A close authority extension authority constraint was violated"],[ge.ConstraintMintPermanentDelegateExtension,"A permanent delegate extension constraint was violated"],[ge.ConstraintMintPermanentDelegateExtensionDelegate,"A permanent delegate extension delegate constraint was violated"],[ge.ConstraintMintTransferHookExtension,"A transfer hook extension constraint was violated"],[ge.ConstraintMintTransferHookExtensionAuthority,"A transfer hook extension authority constraint was violated"],[ge.ConstraintMintTransferHookExtensionProgramId,"A transfer hook extension transfer hook program id constraint was violated"],[ge.RequireViolated,"A require expression was violated"],[ge.RequireEqViolated,"A require_eq expression was violated"],[ge.RequireKeysEqViolated,"A require_keys_eq expression was violated"],[ge.RequireNeqViolated,"A require_neq expression was violated"],[ge.RequireKeysNeqViolated,"A require_keys_neq expression was violated"],[ge.RequireGtViolated,"A require_gt expression was violated"],[ge.RequireGteViolated,"A require_gte expression was violated"],[ge.AccountDiscriminatorAlreadySet,"The account discriminator was already set on this account"],[ge.A
41ccountDiscriminatorNotFound,"No discriminator was found on the account"],[ge.AccountDiscriminatorMismatch,"Account discriminator did not match what was expected"],[ge.AccountDidNotDeserialize,"Failed to deserialize the account"],[ge.AccountDidNotSerialize,"Failed to serialize the account"],[ge.AccountNotEnoughKeys,"Not enough account keys given to the instruction"],[ge.AccountNotMutable,"The given account is not mutable"],[ge.AccountOwnedByWrongProgram,"The given account is owned by a different program than expected"],[ge.InvalidProgramId,"Program ID was not as expected"],[ge.InvalidProgramExecutable,"Program account is not executable"],[ge.AccountNotSigner,"The given account did not sign"],[ge.AccountNotSystemOwned,"The given account is not owned by the system program"],[ge.AccountNotInitialized,"The program expected this account to be already initialized"],[ge.AccountNotProgramData,"The given account is not a program data account"],[ge.AccountNotAssociatedTokenAccount,"The given account is not the associated token account"],[ge.AccountSysvarMismatch,"The given public key does not match the required sysvar"],[ge.AccountReallocExceedsLimit,"The account reallocation exceeds the MAX_PERMITTED_DATA_INCREASE limit"],[ge.AccountDuplicateReallocs,"The account was duplicated for more than one reallocation"],[ge.DeclaredProgramIdMismatch,"The declared program id does not match the actual program id"],[ge.TryingToInitPayerAsProgramAccount,"You cannot/should not initialize the payer account as a program account"],[ge.InvalidNumericConversion,"The program could not perform the numeric conversion, out of range integral type conversion attempted"],[ge.Deprecated,"The API being used is deprecated and should no longer be used"]]);class Je{static fieldLayout(e,n=[],r){const i=e.name;switch(e.type){case"bool":return He.bool(i);case"u8":return He.u8(i);case"i8":return He.i8(i);case"u16":return He.u16(i);case"i16":return He.i16(i);case"u32":return He.u32(i);case"i32":return He.i32(i);case"f32":return He.f32(i);case"u64":return He.u64(i);case"i64":return He.i64(i);case"f64":return He.f64(i);case"u128":return He.u128(i);case"i128":return He.i128(i);case"u256":return He.u256(i);case"i256":return He.i256(i);case"bytes":return He.vecU8(i);case"string":return He.str(i);case"pubkey":return He.publicKey(i);default:{if("option"in e.type)return He.option(Je.fieldLayout({type:e.type.option},n,r),i);if("vec"in e.type)return He.vec(Je.fieldLayout({type:e.type.vec},n,r),i);if("array"in e.type){let[s,o]=e.type.array;return o=Je.resolveArrayLen(o,r),He.array(Je.fieldLayout({type:s},n,r),o,i)}if("defined"in e.type){if(!n)throw new Qi("User defined types not provided");const s=e.type.defined.name,o=n.find(a=>a.name===s);if(!o)throw new Qi(`Type not found: ${e.name}`);return Je.typeDefLayout({typeDef:o,types:n,genericArgs:r??e.type.defined.generics,name:i})}if("generic"in e.type){const s=r==null?void 0:r.at(0);if((s==null?void 0:s.kind)!=="type")throw new Qi(`Invalid generic field: ${e.name}`);return Je.fieldLayout({...e,type:s.type},n)}throw new Qi(`Not yet implemented: ${JSON.stringify(e.type)}`)}}}static typeDefLayout({typeDef:e,types:n,name:r,genericArgs:i}){switch(e.type.kind){case"struct":{const s=ja(e.type.fields,()=>[],o=>o.map(a=>{const c=i&&Je.resolveGenericArgs({type:a.type,typeDef:e,genericArgs:i});return Je.fieldLayout(a,n,c)}),o=>o.map((a,c)=>{const u=i&&Je.resolveGenericArgs({type:a,typeDef:e,genericArgs:i});return Je.fieldLayout({name:c.toString(),type:a},n,u)}));return He.struct(s,r)}case"enum":{const s=e.type.variants.map(o=>{const a=ja(o.fields,()=>[],c=>c.map(u=>{const l=i&&Je.resolveGenericArgs({type:u.type,typeDef:e,genericArgs:i});return Je.fieldLayout(u,n,l)}),c=>c.map((u,l)=>{const h=i&&Je.resolveGenericArgs({type:u,typeDef:e,genericArgs:i});return Je.fieldLayout({name:l.toString(),type:u},n,h)}));return He.struct(a,o.name)});return r!==void 0?He.rustEnum(s).replicate(r):He.rustEnum(s,r)}case"type":return Je.fieldLayout({type:e.type.alias,name:r},n)}}static typeSize(e,n,r){var i;switch(e){case"bool":return 1;case"u8":return 1;case"i8":return 1;case"i16":return 2;case"u16":return 2;case"u32":return 4;case"i32":return 4;case"f32":return 4;case"u64":return 8;case"i64":return 8;case"f64":return 8;case"u128":return 16;case"i128":return 16;case"u256":return 32;case"i256":return 32;case"bytes":return 1;case"string":return 1;case"pubkey":return 32;default:if("option"in e)return 1+Je.typeSize(e.option,n,r);if("coption"in e)return 4+Je.typeSize(e.coption,n,r);if("vec"in e)return 1;if("array"in e){let[s,o]=e.array;
41return o=Je.resolveArrayLen(o,r),Je.typeSize(s,n,r)*o}if("defined"in e){const s=(i=n.types)===null||i===void 0?void 0:i.find(a=>a.name===e.defined.name);if(!s)throw new Qi(`Type not found: ${JSON.stringify(e)}`);const o=a=>{const c=r??e.defined.generics,u=c&&Je.resolveGenericArgs({type:a,typeDef:s,genericArgs:c});return Je.typeSize(a,n,u)};switch(s.type.kind){case"struct":return ja(s.type.fields,()=>[0],a=>a.map(c=>o(c.type)),a=>a.map(c=>o(c))).reduce((a,c)=>a+c,0);case"enum":{const a=s.type.variants.map(c=>ja(c.fields,()=>[0],u=>u.map(l=>o(l.type)),u=>u.map(l=>o(l))).reduce((u,l)=>u+l,0));return Math.max(...a)+1}case"type":return Je.typeSize(s.type.alias,n,r)}}if("generic"in e){const s=r==null?void 0:r.at(0);if((s==null?void 0:s.kind)!=="type")throw new Qi(`Invalid generic: ${e.generic}`);return Je.typeSize(s.type,n,r)}throw new Error(`Invalid type ${JSON.stringify(e)}`)}}static resolveArrayLen(e,n){if(typeof e=="number")return e;if(n){const r=n.find(i=>i.kind==="const");(r==null?void 0:r.kind)==="const"&&(e=+r.value)}if(typeof e!="number")throw new Qi("Generic array length did not resolve");return e}static resolveGenericArgs({type:e,typeDef:n,genericArgs:r,isDefined:i}){if(typeof e!="object")return null;for(const s in n.generics){const o=n.generics[s];if("generic"in e&&o.name===e.generic)return[r[s]];if("option"in e){const a=Je.resolveGenericArgs({type:e.option,typeDef:n,genericArgs:r,isDefined:i});if(!a||!i)return a;if(a[0].kind==="type")return[{kind:"type",type:{option:a[0].type}}]}if("vec"in e){const a=Je.resolveGenericArgs({type:e.vec,typeDef:n,genericArgs:r,isDefined:i});if(!a||!i)return a;if(a[0].kind==="type")return[{kind:"type",type:{vec:a[0].type}}]}if("array"in e){const[a,c]=e.array,u=typeof c=="object",l=Je.resolveGenericArgs({type:a,typeDef:n,genericArgs:r,isDefined:i})||[];if(u){const h=n.generics.findIndex(p=>p.name===c.generic);h!==-1&&l.push(r[h])}if(l.length>0){if(!i)return l;if(l[0].kind==="type"&&l[1].kind==="const")return[{kind:"type",type:{array:[l[0].type,+l[1].value]}}]}if(u&&o.name===c.generic){const h=r[s];return i?[{kind:"type",type:{array:[a,+h.value]}}]:[h]}return null}if("defined"in e)return e.defined.generics?e.defined.generics.flatMap(a=>{switch(a.kind){case"type":return Je.resolveGenericArgs({type:a.type,typeDef:n,genericArgs:r,isDefined:!0});case"const":return[a]}}).filter(a=>a!==null):null}return null}}class CT{constructor(e){this.idl=e;const n=e.instructions.map(r=>{const i=r.name,s=r.args.map(a=>Je.fieldLayout(a,e.types)),o=He.struct(s,i);return[i,{discriminator:r.discriminator,layout:o}]});this.ixLayouts=new Map(n)}encode(e,n){const r=ne.Buffer.alloc(1e3),i=this.ixLayouts.get(e);if(!i)throw new Error(`Unknown method: ${e}`);const s=i.layout.encode(n,r),o=r.slice(0,s);return ne.Buffer.concat([ne.Buffer.from(i.discriminator),o])}decode(e,n="hex"){typeof e=="string"&&(e=n==="hex"?ne.Buffer.from(e,"hex"):jt.decode(e));for(const[r,i]of this.ixLayouts){const s=e.subarray(0,i.discriminator.length);if(s.equals(ne.Buffer.from(i.discriminator)))return{name:r,data:i.layout.decode(e.subarray(s.length))}}return null}format(e,n){return gr.format(e,n,this.idl)}}class gr{static format(e,n,r){const i=r.instructions.find(c=>e.name===c.name);if(!i)return console.error("Invalid instruction given"),null;const s=i.args.map(c=>({name:c.name,type:gr.formatIdlType(c.type),data:gr.formatIdlData(c,e.data[c.name],r.types)})),o=gr.flattenIdlAccounts(i.accounts),a=n.map((c,u)=>u<o.length?{name:o[u].name,...c}:{name:void 0,...c});return{args:s,accounts:a}}static formatIdlType(e){if(typeof e=="string")return e;if("option"in e)return`Option<${this.formatIdlType(e.option)}>`;if("coption"in e)return`COption<${this.formatIdlType(e.coption)}>`;if("vec"in e)return`Vec<${this.formatIdlType(e.vec)}>`;if("array"in e)return`Array<${e.array[0]}; ${e.array[1]}>`;if("defined"in e){const n=e.defined.name;if(e.defined.generics){const r=e.defined.generics.map(i=>{switch(i.kind){case"type":return gr.formatIdlType(i.type);case"const":return i.value}}).join(", ");return`${n}<${r}>`}return n}throw new Error(`Unknown IDL type: ${e}`)}static formatIdlData(e,n,r){if(typeof e.type=="string")return n.toString();if("vec"in e.type)return"["+n.map(i=>this.formatIdlData({name:"",type:e.type.vec},i,r)).join(", ")+"]";if("option"in e.type)return n===null?"null":this.formatIdlData({name:"",type:e.type.option},n,r);if("defined"in e.type){if(!r)throw new Error("User defined types not provided");const i=e.type.defined.name,s=r.find(o=>o.name===i);if(!s)throw new Error(`Type not found: ${i}`);return gr.formatIdlDataDefined(s,n,r)}return"unknown"}static formatIdlDataDefined(e,n,r){switch(e.type.kind){case"struct":return"{ "+ja(e.type.fields,()=>"",i=>Object.entries(n).map(([s,o])=>{const a=i.find(c=>c.name===s);if(!a)throw new Error(`Field not found: ${s}`);return s+": "+gr.formatIdlData(a,o,r)}).join(", "),i=>Object.entries(n).map(([s,o])=>s+": "+gr.formatIdlData({name:"",type:i[s]},o,r)).join(", "))+" }";case"enum":{const i=Object.keys(n)[0],s=e.type.variants.find(a=>a.name===i);if(!s)throw new Error(`Unable to find variant: ${i}`);const o=n[i];
41return ja(s.fields,()=>i,a=>{const c=Object.keys(o).map(u=>{const l=o[u],h=a.find(p=>p.name===u);if(!h)throw new Error(`Field not found: ${u}`);return u+": "+gr.formatIdlData(h,l,r)}).join(", ");return`${i} { ${c} }`},a=>{const c=Object.entries(o).map(([u,l])=>u+": "+gr.formatIdlData({name:"",type:a[u]},l,r)).join(", ");return`${i} { ${c} }`})}case"type":return gr.formatIdlType(e.type.alias)}}static flattenIdlAccounts(e,n){return e.map(r=>{const i=VV(r.name);if(r.hasOwnProperty("accounts")){const s=n?`${n} > ${i}`:i;return gr.flattenIdlAccounts(r.accounts,s)}else return{...r,name:n?`${n} > ${i}`:i}}).flat()}}function VV(t){const e=t.replace(/([A-Z])/g," $1");return e.charAt(0).toUpperCase()+e.slice(1)}class NT{constructor(e){if(this.idl=e,!e.accounts){this.accountLayouts=new Map;return}const n=e.types;if(!n)throw new Error("Accounts require `idl.types`");const r=e.accounts.map(i=>{const s=n.find(o=>o.name===i.name);if(!s)throw new Error(`Account not found: ${i.name}`);return[i.name,{discriminator:i.discriminator,layout:Je.typeDefLayout({typeDef:s,types:n})}]});this.accountLayouts=new Map(r)}async encode(e,n){const r=ne.Buffer.alloc(1e3),i=this.accountLayouts.get(e);if(!i)throw new Error(`Unknown account: ${e}`);const s=i.layout.encode(n,r),o=r.slice(0,s),a=this.accountDiscriminator(e);return ne.Buffer.concat([a,o])}decode(e,n){const r=this.accountDiscriminator(e);if(r.compare(n.slice(0,r.length)))throw new Error("Invalid account discriminator");return this.decodeUnchecked(e,n)}decodeAny(e){for(const[n,r]of this.accountLayouts)if(e.subarray(0,r.discriminator.length).equals(ne.Buffer.from(r.discriminator)))return this.decodeUnchecked(n,e);throw new Error("Account not found")}decodeUnchecked(e,n){const r=this.accountDiscriminator(e),i=n.subarray(r.length),s=this.accountLayouts.get(e);if(!s)throw new Error(`Unknown account: ${e}`);return s.layout.decode(i)}memcmp(e,n){const r=this.accountDiscriminator(e);return{offset:0,bytes:jt.encode(n?ne.Buffer.concat([r,n]):r)}}size(e){return this.accountDiscriminator(e).length+Je.typeSize({defined:{name:e}},this.idl)}accountDiscriminator(e){var n;const r=(n=this.idl.accounts)===null||n===void 0?void 0:n.find(i=>i.name===e);if(!r)throw new Error(`Account not found: ${e}`);return ne.Buffer.from(r.discriminator)}}class PT{constructor(e){if(!e.events){this.layouts=new Map;return}const n=e.types;if(!n)throw new Error("Events require `idl.types`");const r=e.events.map(i=>{const s=n.find(o=>o.name===i.name);if(!s)throw new Error(`Event not found: ${i.name}`);return[i.name,{discriminator:i.discriminator,layout:Je.typeDefLayout({typeDef:s,types:n})}]});this.layouts=new Map(r)}decode(e){let n;try{n=b1(e)}catch{return null}for(const[r,i]of this.layouts){const s=n.subarray(0,i.discriminator.length);if(s.equals(ne.Buffer.from(i.discriminator)))return{name:r,data:i.layout.decode(n.subarray(s.length))}}return null}}class qV{constructor(e){const n=e.types;if(!n){this.typeLayouts=new Map;return}const r=n.filter(i=>!i.generics).map(i=>[i.name,Je.typeDefLayout({typeDef:i,types:n})]);this.typeLayouts=new Map(r)}encode(e,n){const r=ne.Buffer.alloc(1e3),i=this.typeLayouts.get(e);if(!i)throw new Error(`Unknown type: ${e}`);const s=i.encode(n,r);return r.slice(0,s)}decode(e,n){const r=this.typeLayouts.get(e);if(!r)throw new Error(`Unknown type: ${e}`);return r.decode(n)}}class R1{constructor(e){this.instruction=new CT(e),this.accounts=new NT(e),this.events=new PT(e),this.types=new qV(e)}}class hr{constructor(e,n){if(!Number.isInteger(e))throw new TypeError("span must be an integer");this.span=e,this.property=n}makeDestinationObject(){return{}}decode(e,n){throw new Error("Layout is abstract")}encode(e,n,r){throw new Error("Layout is abstract")}getSpan(e,n){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(e){const n=Object.create(this.constructor.prototype);return Object.assign(n,this),n.property=e,n}fromArray(e){}}var Hd=hr;function GV(t,e){return e.property?t+"["+e.property+"]":t}class Xo extends hr{isCount(){throw new Error("ExternalLayout is abstract")}}class MT extends Xo{constructor(e,n,r){if(!(e instanceof hr))throw new TypeError("layout must be a Layout");if(n===void 0)n=0;else if(!Number.isInteger(n))throw new TypeError("offset must be integer or undefined");super(e.span,r||e.property),this.layout=e,this.offset=n}isCount(){return this.layout instanceof Wd||this.layout instanceof LT}decode(e,n){return n===void 0&&(n=0),this.layout.decode(e,n+this.offset)}encode(e,n,r){return r===void 0&&(r=0),this.layout.encode(e,n,r+this.offset)}}class Wd extends hr{constructor(e,n){if(super(e,n),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,n){return n===void 0&&(n=0),e.readUIntLE(n,this.span)}encode(e,n,r){return r===void 0&&(r=0),n.writeUIntLE(e,r,this.span),this.span}}class LT extends hr{constructor(e,n){if(super(e,n),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,n){return n===void 0&&(n=0),e.readUIntBE(n,this.span)}encode(e,n,r){return r===void 0&&(r=0),n.writeUIntBE(e,r,this.span),this.span}}const lm=Math.pow(2,32);function BT(t){const e=Math.floor(t/lm),n=t-e*lm;return{hi32:e,lo32:n}}function DT(t,e){return t*lm+e}class YV extends hr{constructor(e){super(8,e)}decode(e,n){n===void 0&&(n=0);const r=e.readUInt32LE(n),i=e.readUInt32LE(n+4);return DT(i,r)}encode(e,n,r){r===void 0&&(r=0);const i=BT(e);return n.writeUInt32LE(i.lo32,r),n.writeUInt32LE(i.hi32,r+4),8}}class ZV extends hr{constructor(e){super(8,e)}decode(e,n){n===void 0&&(n=0);const r=e.readUInt32LE(n),i=e.readInt32LE(n+4);return DT(i,r)}encode(e,n,r){r===void 0&&(r=0);const i=BT(e);return n.writeUInt32LE(i.lo32,r),n.writeInt32LE(i.hi32,r+4),8}}class XV extends hr{constructor(e,n,r){if(!(Array.isArray(e)&&e.reduce((s,o)=>s&&o instanceof hr,!0)))throw new TypeError("fields must be array of Layout instances");typeof n=="boolean"&&r===void 0&&(r=n,n=void 0);for(const s of e)if(0>s.span&&s.property===void 0)throw new Error("fields cannot contain unnamed variable-length layout");let i=-1;try{i=e.reduce((s,o)=>s+o.getSpan(),0)}catch{}super(i,n),this.fields=e,this.decodePrefixes=!!r}getSpan(e,n){if(0<=this.span)return this.span;n===void 0&&(n=0);let r=0;try{r=this.fields.reduce((i,s)=>
41{const o=s.getSpan(e,n);return n+=o,i+o},0)}catch{throw new RangeError("indeterminate span")}return r}decode(e,n){n===void 0&&(n=0);const r=this.makeDestinationObject();for(const i of this.fields)if(i.property!==void 0&&(r[i.property]=i.decode(e,n)),n+=i.getSpan(e,n),this.decodePrefixes&&e.length===n)break;return r}encode(e,n,r){r===void 0&&(r=0);const i=r;let s=0,o=0;for(const a of this.fields){let c=a.span;if(o=0<c?c:0,a.property!==void 0){const u=e[a.property];u!==void 0&&(o=a.encode(u,n,r),0>c&&(c=a.getSpan(n,r)))}s=r,r+=c}return s+o-i}fromArray(e){const n=this.makeDestinationObject();for(const r of this.fields)r.property!==void 0&&0<e.length&&(n[r.property]=e.shift());return n}layoutFor(e){if(typeof e!="string")throw new TypeError("property must be string");for(const n of this.fields)if(n.property===e)return n}offsetOf(e){if(typeof e!="string")throw new TypeError("property must be string");let n=0;for(const r of this.fields){if(r.property===e)return n;0>r.span?n=-1:0<=n&&(n+=r.span)}}}class $T{constructor(e){this.property=e}decode(){throw new Error("UnionDiscriminator is abstract")}encode(){throw new Error("UnionDiscriminator is abstract")}}class uk extends $T{constructor(e,n){if(!(e instanceof Xo&&e.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");super(n||e.property||"variant"),this.layout=e}decode(e,n){return this.layout.decode(e,n)}encode(e,n,r){return this.layout.encode(e,n,r)}}class FT extends hr{constructor(e,n,r){const i=e instanceof Wd||e instanceof LT;if(i)e=new uk(new MT(e));else if(e instanceof Xo&&e.isCount())e=new uk(e);else if(!(e instanceof $T))throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(n===void 0&&(n=null),!(n===null||n instanceof hr))throw new TypeError("defaultLayout must be null or a Layout");if(n!==null){if(0>n.span)throw new Error("defaultLayout must have constant span");n.property===void 0&&(n=n.replicate("content"))}let s=-1;n&&(s=n.span,0<=s&&i&&(s+=e.layout.span)),super(s,r),this.discriminator=e,this.usesPrefixDiscriminator=i,this.defaultLayout=n,this.registry={};let o=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(a){return o(a)},this.configGetSourceVariant=function(a){o=a.bind(this)}}getSpan(e,n){if(0<=this.span)return this.span;n===void 0&&(n=0);const r=this.getVariant(e,n);if(!r)throw new Error("unable to determine span for unrecognized variant");return r.getSpan(e,n)}defaultGetSourceVariant(e){if(e.hasOwnProperty(this.discriminator.property)){if(this.defaultLayout&&e.hasOwnProperty(this.defaultLayout.property))return;const n=this.registry[e[this.discriminator.property]];if(n&&(!n.layout||e.hasOwnProperty(n.property)))return n}else for(const n in this.registry){const r=this.registry[n];if(e.hasOwnProperty(r.property))return r}throw new Error("unable to infer src variant")}decode(e,n){n===void 0&&(n=0);let r;const i=this.discriminator,s=i.decode(e,n);let o=this.registry[s];if(o===void 0){let a=0;o=this.defaultLayout,this.usesPrefixDiscriminator&&(a=i.layout.span),r=this.makeDestinationObject(),r[i.property]=s,r[o.property]=this.defaultLayout.decode(e,n+a)}else r=o.decode(e,n);return r}encode(e,n,r){r===void 0&&(r=0);const i=this.getSourceVariant(e);if(i===void 0){const s=this.discriminator,o=this.defaultLayout;let a=0;return this.usesPrefixDiscriminator&&(a=s.layout.span),s.encode(e[s.property],n,r),a+o.encode(e[o.property],n,r+a)}return i.encode(e,n,r)}addVariant(e,n,r){const i=new JV(this,e,n,r);return this.registry[e]=i,i}getVariant(e,n){let r=e;return ne.Buffer.isBuffer(e)&&(n===void 0&&(n=0),r=this.discriminator.decode(e,n)),this.registry[r]}}class JV extends hr{constructor(e,n,r,i){if(!(e instanceof FT))throw new TypeError("union must be a Union");if(!Number.isInteger(n)||0>n)throw new TypeError("variant must be a (non-negative) integer");if(typeof r=="string"&&i===void 0&&(i=r,r=null),r){if(!(r instanceof hr))throw new TypeError("layout must be a Layout");if(e.defaultLayout!==null&&0<=r.span&&r.span>e.defaultLayout.span)throw new Error("variant span exceeds span of containing union");
41if(typeof i!="string")throw new TypeError("variant must have a String property")}let s=e.span;0>e.span&&(s=r?r.span:0,0<=s&&e.usesPrefixDiscriminator&&(s+=e.discriminator.layout.span)),super(s,i),this.union=e,this.variant=n,this.layout=r||null}getSpan(e,n){if(0<=this.span)return this.span;n===void 0&&(n=0);let r=0;return this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),r+this.layout.getSpan(e,n+r)}decode(e,n){const r=this.makeDestinationObject();if(n===void 0&&(n=0),this!==this.union.getVariant(e,n))throw new Error("variant mismatch");let i=0;return this.union.usesPrefixDiscriminator&&(i=this.union.discriminator.layout.span),this.layout?r[this.property]=this.layout.decode(e,n+i):this.property?r[this.property]=!0:this.union.usesPrefixDiscriminator&&(r[this.union.discriminator.property]=this.variant),r}encode(e,n,r){r===void 0&&(r=0);let i=0;if(this.union.usesPrefixDiscriminator&&(i=this.union.discriminator.layout.span),this.layout&&!e.hasOwnProperty(this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,n,r);let s=i;if(this.layout&&(this.layout.encode(e[this.property],n,r+i),s+=this.layout.getSpan(n,r+i),0<=this.union.span&&s>this.union.span))throw new Error("encoded variant overruns containing union");return s}fromArray(e){if(this.layout)return this.layout.fromArray(e)}}class QV extends hr{constructor(e,n){if(!(e instanceof Xo&&e.isCount()||Number.isInteger(e)&&0<=e))throw new TypeError("length must be positive integer or an unsigned integer ExternalLayout");let r=-1;e instanceof Xo||(r=e),super(r,n),this.length=e}getSpan(e,n){let r=this.span;return 0>r&&(r=this.length.decode(e,n)),r}decode(e,n){n===void 0&&(n=0);let r=this.span;return 0>r&&(r=this.length.decode(e,n)),e.slice(n,n+r)}encode(e,n,r){let i=this.length;if(this.length instanceof Xo&&(i=e.length),!(ne.Buffer.isBuffer(e)&&i===e.length))throw new TypeError(GV("Blob.encode",this)+" requires (length "+i+") Buffer as src");if(r+i>n.length)throw new RangeError("encoding overruns Buffer");return n.write(e.toString("hex"),r,i,"hex"),this.length instanceof Xo&&this.length.encode(i,n,r),i}}var eq=(t,e,n)=>new MT(t,e,n),tq=t=>new Wd(1,t),as=t=>new Wd(4,t),nq=t=>new YV(t),ms=t=>new ZV(t),kn=(t,e,n)=>new XV(t,e,n),UT=(t,e,n)=>new FT(t,e,n),Cl=(t,e)=>new QV(t,e);class rq{constructor(e){}encode(e,n){switch(e){case"createAccount":return sq(n);case"assign":return oq(n);case"transfer":return aq(n);case"createAccountWithSeed":return cq(n);case"advanceNonceAccount":return lq(n);case"withdrawNonceAccount":return fq(n);case"initializeNonceAccount":return uq(n);case"authorizeNonceAccount":return hq(n);case"allocate":return dq(n);case"allocateWithSeed":return pq(n);case"assignWithSeed":return gq(n);case"transferWithSeed":return mq(n);default:throw new Error(`Invalid instruction: ${e}`)}}encodeState(e,n){throw new Error("System does not have state")}}class iq extends Hd{constructor(e){super(-1,e),this.property=e,this.layout=kn([as("length"),as("lengthPadding"),Cl(eq(as(),-8),"chars")],this.property)}encode(e,n,r=0){if(e==null)return this.layout.span;const i={chars:ne.Buffer.from(e,"utf8")};return this.layout.encode(i,n,r)}decode(e,n=0){return this.layout.decode(e,n).chars.toString()}getSpan(e,n=0){return as().span+as().span+new Ei(new Uint8Array(e).slice(n,n+4),10,"le").toNumber()}}function jd(t){return new iq(t)}function Gr(t){return Cl(32,t)}function sq({lamports:t,space:e,owner:n}){return Yr({createAccount:{lamports:t,space:e,owner:n.toBuffer()}})}function oq({owner:t}){return Yr({assign:{owner:t.toBuffer()}})}function aq({lamports:t}){return Yr({transfer:{lamports:t}})}function cq({base:t,seed:e,lamports:n,space:r,owner:i}){return Yr({createAccountWithSeed:{base:t.toBuffer(),seed:e,lamports:n,space:r,owner:i.toBuffer()}},Tn.getVariant(3).span+e.length)}function uq({authorized:t}){return Yr({initializeNonceAccount:{authorized:t.toBuffer()}})}function lq({authorized:t}){return Yr({advanceNonceAccount:{authorized:t.toBuffer()}})}function fq({lamports:t}){return Yr({withdrawNonceAccount:{lamports:t}})}function hq({authorized:t}){return Yr({authorizeNonceAccount:{authorized:t.toBuffer()}})}function dq({space:t}){return Yr({allocate:{space:t}})}
41function pq({base:t,seed:e,space:n,owner:r}){return Yr({allocateWithSeed:{base:t.toBuffer(),seed:e,space:n,owner:r.toBuffer()}},Tn.getVariant(9).span+e.length)}function gq({base:t,seed:e,owner:n}){return Yr({assignWithSeed:{base:t.toBuffer(),seed:e,owner:n.toBuffer()}},Tn.getVariant(10).span+e.length)}function mq({lamports:t,seed:e,owner:n}){return Yr({transferWithSeed:{lamports:t,seed:e,owner:n.toBuffer()}},Tn.getVariant(11).span+e.length)}const Tn=UT(as("instruction"));Tn.addVariant(0,kn([ms("lamports"),ms("space"),Gr("owner")]),"createAccount");Tn.addVariant(1,kn([Gr("owner")]),"assign");Tn.addVariant(2,kn([ms("lamports")]),"transfer");Tn.addVariant(3,kn([Gr("base"),jd("seed"),ms("lamports"),ms("space"),Gr("owner")]),"createAccountWithSeed");Tn.addVariant(4,kn([Gr("authorized")]),"advanceNonceAccount");Tn.addVariant(5,kn([ms("lamports")]),"withdrawNonceAccount");Tn.addVariant(6,kn([Gr("authorized")]),"initializeNonceAccount");Tn.addVariant(7,kn([Gr("authorized")]),"authorizeNonceAccount");Tn.addVariant(8,kn([ms("space")]),"allocate");Tn.addVariant(9,kn([Gr("base"),jd("seed"),ms("space"),Gr("owner")]),"allocateWithSeed");Tn.addVariant(10,kn([Gr("base"),jd("seed"),Gr("owner")]),"assignWithSeed");Tn.addVariant(11,kn([ms("lamports"),jd("seed"),Gr("owner")]),"transferWithSeed");function Yr(t,e){const n=ne.Buffer.alloc(e??yq),r=Tn.encode(t,n);return e===void 0?n.slice(0,r):n}const yq=Math.max(...Object.values(Tn.registry).map(t=>t.span));class vq{constructor(e){this.idl=e}async encode(e,n){switch(e){case"nonce":{const r=ne.Buffer.alloc(Zu),i=zT.encode(n,r);return r.slice(0,i)}default:throw new Error(`Invalid account name: ${e}`)}}decode(e,n){return this.decodeUnchecked(e,n)}decodeUnchecked(e,n){switch(e){case"nonce":return bq(n);default:throw new Error(`Invalid account name: ${e}`)}}memcmp(e,n){switch(e){case"nonce":return{dataSize:Zu};default:throw new Error(`Invalid account name: ${e}`)}}size(e){return Je.typeSize({defined:{name:e}},this.idl)}}function bq(t){return zT.decode(t)}class wq extends Hd{constructor(e,n,r,i){super(e.span,i),this.layout=e,this.decoder=n,this.encoder=r}decode(e,n){return this.decoder(this.layout.decode(e,n))}encode(e,n,r){return this.layout.encode(this.encoder(e),n,r)}getSpan(e,n){return this.layout.getSpan(e,n)}}function lk(t){return new wq(Cl(32),e=>new ue(e),e=>e.toBuffer(),t)}const zT=kn([as("version"),as("state"),lk("authorizedPubkey"),lk("nonce"),kn([nq("lamportsPerSignature")],"feeCalculator")]);class _q{constructor(e){}decode(e){throw new Error("System program does not have events")}}class kq{constructor(e){}encode(e,n){throw new Error("System does not have user-defined types")}decode(e,n){throw new Error("System does not have user-defined types")}}class HT{constructor(e){this.instruction=new rq(e),this.accounts=new vq(e),this.events=new _q(e),this.types=new kq(e)}}function Sq(t){return new TextDecoder().decode(qu(t))}var Eq=Object.freeze({__proto__:null,hash:Sq});function Aq(t,e,n){const r=ne.Buffer.concat([t.toBuffer(),ne.Buffer.from(e),n.toBuffer()]);return new ue(qu(r))}var xq=Object.freeze({__proto__:null,createWithSeedSync:Aq});const WT=new ue("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),jT=new ue("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");function Rq({mint:t,owner:e}){return ue.findProgramAddressSync([e.toBuffer(),WT.toBuffer(),t.toBuffer()],jT)[0]}var Tq=Object.freeze({__proto__:null,TOKEN_PROGRAM_ID:WT,ASSOCIATED_PROGRAM_ID:jT,associatedAddress:Rq}),fm={exports:{}};(function(t,e){var n=typeof self<"u"?self:zV,r=function(){function s(){this.fetch=!1,this.DOMException=n.DOMException}return s.prototype=n,new s}();(function(s){(function(o){var a={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function c(f){return f&&DataView.prototype.isPrototypeOf(f)}if(a.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array
41]"],l=ArrayBuffer.isView||function(f){return f&&u.indexOf(Object.prototype.toString.call(f))>-1};function h(f){if(typeof f!="string"&&(f=String(f)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(f))throw new TypeError("Invalid character in header field name");return f.toLowerCase()}function p(f){return typeof f!="string"&&(f=String(f)),f}function g(f){var d={next:function(){var v=f.shift();return{done:v===void 0,value:v}}};return a.iterable&&(d[Symbol.iterator]=function(){return d}),d}function y(f){this.map={},f instanceof y?f.forEach(function(d,v){this.append(v,d)},this):Array.isArray(f)?f.forEach(function(d){this.append(d[0],d[1])},this):f&&Object.getOwnPropertyNames(f).forEach(function(d){this.append(d,f[d])},this)}y.prototype.append=function(f,d){f=h(f),d=p(d);var v=this.map[f];this.map[f]=v?v+", "+d:d},y.prototype.delete=function(f){delete this.map[h(f)]},y.prototype.get=function(f){return f=h(f),this.has(f)?this.map[f]:null},y.prototype.has=function(f){return this.map.hasOwnProperty(h(f))},y.prototype.set=function(f,d){this.map[h(f)]=p(d)},y.prototype.forEach=function(f,d){for(var v in this.map)this.map.hasOwnProperty(v)&&f.call(d,this.map[v],v,this)},y.prototype.keys=function(){var f=[];return this.forEach(function(d,v){f.push(v)}),g(f)},y.prototype.values=function(){var f=[];return this.forEach(function(d){f.push(d)}),g(f)},y.prototype.entries=function(){var f=[];return this.forEach(function(d,v){f.push([v,d])}),g(f)},a.iterable&&(y.prototype[Symbol.iterator]=y.prototype.entries);function w(f){if(f.bodyUsed)return Promise.reject(new TypeError("Already read"));f.bodyUsed=!0}function k(f){return new Promise(function(d,v){f.onload=function(){d(f.result)},f.onerror=function(){v(f.error)}})}function T(f){var d=new FileReader,v=k(d);return d.readAsArrayBuffer(f),v}function C(f){var d=new FileReader,v=k(d);return d.readAsText(f),v}function O(f){for(var d=new Uint8Array(f),v=new Array(d.length),b=0;b<d.length;b++)v[b]=String.fromCharCode(d[b]);return v.join("")}function I(f){if(f.slice)return f.slice(0);var d=new Uint8Array(f.byteLength);return d.set(new Uint8Array(f)),d.buffer}function N(){return this.bodyUsed=!1,this._initBody=function(f){this._bodyInit=f,f?typeof f=="string"?this._bodyText=f:a.blob&&Blob.prototype.isPrototypeOf(f)?this._bodyBlob=f:a.formData&&FormData.prototype.isPrototypeOf(f)?this._bodyFormData=f:a.searchParams&&URLSearchParams.prototype.isPrototypeOf(f)?this._bodyText=f.toString():a.arrayBuffer&&a.blob&&c(f)?(this._bodyArrayBuffer=I(f.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(f)||l(f))?this._bodyArrayBuffer=I(f):this._bodyText=f=Object.prototype.toString.call(f):this._bodyText="",this.headers.get("content-type")||(typeof f=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):a.searchParams&&URLSearchParams.prototype.isPrototypeOf(f)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a.blob&&(this.blob=function(){var f=w(this);if(f)return f;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?w(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(T)}),this.text=function(){var f=w(this);if(f)return f;if(this._bodyBlob)return C(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(O(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a.formData&&(this.formData=function(){return this.text().then(H)}),this.json=function(){return this.text().then(JSON.parse)},this}var F=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function L(f){var d=f.toUpperCase();return F.indexOf(d)>-1?d:f}function D(f,d){d=d||{};var v=d.body;if(f instanceof D){if(f.bodyUsed)throw new TypeError("Already read");this.url=f.url,this.credentials=f.credentials,d.headers||(this.headers=new y(f.headers)),this.method=f.method,this.mode=f.mode,this.signal=f.
41signal,!v&&f._bodyInit!=null&&(v=f._bodyInit,f.bodyUsed=!0)}else this.url=String(f);if(this.credentials=d.credentials||this.credentials||"same-origin",(d.headers||!this.headers)&&(this.headers=new y(d.headers)),this.method=L(d.method||this.method||"GET"),this.mode=d.mode||this.mode||null,this.signal=d.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&v)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(v)}D.prototype.clone=function(){return new D(this,{body:this._bodyInit})};function H(f){var d=new FormData;return f.trim().split("&").forEach(function(v){if(v){var b=v.split("="),E=b.shift().replace(/\+/g," "),x=b.join("=").replace(/\+/g," ");d.append(decodeURIComponent(E),decodeURIComponent(x))}}),d}function z(f){var d=new y,v=f.replace(/\r?\n[\t ]+/g," ");return v.split(/\r?\n/).forEach(function(b){var E=b.split(":"),x=E.shift().trim();if(x){var M=E.join(":").trim();d.append(x,M)}}),d}N.call(D.prototype);function K(f,d){d||(d={}),this.type="default",this.status=d.status===void 0?200:d.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in d?d.statusText:"OK",this.headers=new y(d.headers),this.url=d.url||"",this._initBody(f)}N.call(K.prototype),K.prototype.clone=function(){return new K(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new y(this.headers),url:this.url})},K.error=function(){var f=new K(null,{status:0,statusText:""});return f.type="error",f};var _=[301,302,303,307,308];K.redirect=function(f,d){if(_.indexOf(d)===-1)throw new RangeError("Invalid status code");return new K(null,{status:d,headers:{location:f}})},o.DOMException=s.DOMException;try{new o.DOMException}catch{o.DOMException=function(d,v){this.message=d,this.name=v;var b=Error(d);this.stack=b.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function m(f,d){return new Promise(function(v,b){var E=new D(f,d);if(E.signal&&E.signal.aborted)return b(new o.DOMException("Aborted","AbortError"));var x=new XMLHttpRequest;function M(){x.abort()}x.onload=function(){var P={status:x.status,statusText:x.statusText,headers:z(x.getAllResponseHeaders()||"")};P.url="responseURL"in x?x.responseURL:P.headers.get("X-Request-URL");var S="response"in x?x.response:x.responseText;v(new K(S,P))},x.onerror=function(){b(new TypeError("Network request failed"))},x.ontimeout=function(){b(new TypeError("Network request failed"))},x.onabort=function(){b(new o.DOMException("Aborted","AbortError"))},x.open(E.method,E.url,!0),E.credentials==="include"?x.withCredentials=!0:E.credentials==="omit"&&(x.withCredentials=!1),"responseType"in x&&a.blob&&(x.responseType="blob"),E.headers.forEach(function(P,S){x.setRequestHeader(S,P)}),E.signal&&(E.signal.addEventListener("abort",M),x.onreadystatechange=function(){x.readyState===4&&E.signal.removeEventListener("abort",M)}),x.send(typeof E._bodyInit>"u"?null:E._bodyInit)})}return m.polyfill=!0,s.fetch||(s.fetch=m,s.Headers=y,s.Request=D,s.Response=K),o.Headers=y,o.Request=D,o.Response=K,o.fetch=m,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e})(fm,fm.exports);var Oq=HV(fm.exports);async function Iq(t,e,n=5){const r=`https://api.apr.dev/api/v0/program/${e.toString()}/latest?limit=${n}`,[i,s]=await Promise.all([KT(t,e),Oq(r)]),o=(await s.json()).filter(c=>!c.aborted&&c.state==="Built"&&c.verified==="Verified");if(o.length===0)return null;const a=o[0];return i.slot.toNumber()!==a.verified_slot?null:a}async function KT(t,e){const n=await t.getAccountInfo(e);if(n===null)throw new Error("program account not found");const{program:r}=hm(n.data),i=await t.getAccountInfo(r.programdataAddress);if(i===null)throw new Error("program data account not found");const{programData:s}=hm(i.data);return s}const Cq=He.rustEnum([He.struct([],"uninitialized"),He.struct([He.option(He.publicKey(),"authorityAddress")],"buffer"),He.struct([He.publicKey("programdataAddress")],"program"),He.struct([He.u64("slot"),He.option(He.publicKey(),"upgradeAuthorityAddress")],"programData")],void 0,He.u32());function hm(t){return Cq.decode(t)}var Nq=Object.freeze({__proto__:null,verifiedBuild:Iq,fetchData:KT,decodeUpgradeableLoaderState:hm}),Pq=Object.freeze({__proto__:null,sha256:Eq,rpc:$V,publicKey:xq,bytes:yV,token:Tq,features:KV,registry:Nq});const dm="Program log: ",VT="Program data: ",Mq=dm.length,Lq=VT.length;class qT{constructor(e,n,r){this._programId=e,this._provider=n,this._eventParser=new ds(e,r),this._eventCallbacks=new Map,this._eventListeners=new Map,this._listenerIdCount=0}
41addEventListener(e,n,r){var i;let s=this._listenerIdCount;return this._listenerIdCount+=1,this._eventListeners.has(e)||this._eventListeners.set(e,[]),this._eventListeners.set(e,((i=this._eventListeners.get(e))!==null&&i!==void 0?i:[]).concat(s)),this._eventCallbacks.set(s,[e,n]),this._onLogsSubscriptionId!==void 0||(this._onLogsSubscriptionId=this._provider.connection.onLogs(this._programId,(o,a)=>{if(!o.err)for(const c of this._eventParser.parseLogs(o.logs)){const u=this._eventListeners.get(c.name);u&&u.forEach(l=>{const h=this._eventCallbacks.get(l);if(h){const[,p]=h;p(c.data,a.slot,o.signature)}})}},r)),s}async removeEventListener(e){const n=this._eventCallbacks.get(e);if(!n)throw new Error(`Event listener ${e} doesn't exist!`);const[r]=n;let i=this._eventListeners.get(r);if(!i)throw new Error(`Event listeners don't exist for ${r}!`);if(this._eventCallbacks.delete(e),i=i.filter(s=>s!==e),this._eventListeners.set(r,i),i.length===0&&this._eventListeners.delete(r),this._eventCallbacks.size===0){if(this._eventListeners.size!==0)throw new Error(`Expected event listeners size to be 0 but got ${this._eventListeners.size}`);this._onLogsSubscriptionId!==void 0&&(await this._provider.connection.removeOnLogsListener(this._onLogsSubscriptionId),this._onLogsSubscriptionId=void 0)}}}class ds{constructor(e,n){this.coder=n,this.programId=e}*parseLogs(e,n=!1){const r=new Dq([...e]),i=new Bq,s=r.next();if(s===null)return;const o=ds.INVOKE_RE.exec(s);if(!o||o[2]!==ds.ROOT_DEPTH)throw new Error(`Unexpected first log line: ${s}`);for(i.push(o[1]);r.peek()!==null;){const a=r.next();if(a===null)break;let[c,u,l]=this.handleLog(i,a,n);if(c&&(yield c),u&&i.push(u),l){i.pop();const h=r.peek();if(h&&h.endsWith("invoke [1]")){const p=ds.INVOKE_RE.exec(h);p&&i.push(p[1])}}}}handleLog(e,n,r){return e.stack.length>0&&e.program()===this.programId.toString()?this.handleProgramLog(n,r):[null,...this.handleSystemLog(n)]}handleProgramLog(e,n){if(e.startsWith(dm)||e.startsWith(VT)){const r=e.startsWith(dm)?e.slice(Mq):e.slice(Lq),i=this.coder.events.decode(r);if(n&&i===null)throw new Error(`Unable to decode event ${r}`);return[i,null,!1]}else return[null,...this.handleSystemLog(e)]}handleSystemLog(e){return e.startsWith(`Program ${this.programId.toString()} log:`)?[this.programId.toString(),!1]:e.includes("invoke")&&!e.endsWith("[1]")?["cpi",!1]:/^Program ([1-9A-HJ-NP-Za-km-z]+) success$/.test(e)?[null,!0]:[null,!1]}}ds.INVOKE_RE=/^Program ([1-9A-HJ-NP-Za-km-z]+) invoke \[(\d+)\]$/;ds.ROOT_DEPTH="1";class Bq{constructor(){this.stack=[]}program(){if(!this.stack.length)throw new Error("Expected the stack to have elements");return this.stack[this.stack.length-1]}push(e){this.stack.push(e)}pop(){if(!this.stack.length)throw new Error("Expected the stack to have elements");this.stack.pop()}}class Dq{constructor(e){this.logs=e,this.logs=this.logs.filter(n=>n.startsWith("Program "))}next(){if(this.logs.length===0)return null;let e=this.logs[0];return this.logs=this.logs.slice(1),e}peek(){return this.logs.length>0?this.logs[0]:null}}function Nl(t,e){var n,r;let i={};const s=t.args?t.args.length:0;if(e.length>s){if(e.length!==s+1)throw new Error(`provided too many arguments ${e} to instruction ${t==null?void 0:t.name} expecting: ${(r=(n=t.args)===null||n===void 0?void 0:n.map(o=>o.name))!==null&&r!==void 0?r:[]}`);i=e.pop()}return[e,i]}class Lh{static build(e,n,r){if(e.name==="_inner")throw new Qi("the _inner name is reserved");const i=(...s)=>{const[o,a]=Nl(e,[...s]);w1(e.accounts,a.accounts),$q(e,...s);const c=i.accounts(a.accounts);return a.remainingAccounts!==void 0&&c.push(...a.remainingAccounts),A1("debug-logs")&&console.log("Outgoing account metas:",c),new vt({keys:c,programId:r,data:n(e.name,eR(e,...o))})};return i.accounts=s=>Lh.accountsArray(s,e.accounts,r,e.name),i}static accountsArray(e,n,r,i){return e?n.map(s=>{if(Ls(s)){const l=e[s.name];return Lh.accountsArray(l,s.accounts,r,i).flat()}let o;try{o=Or(e[s.name])}catch{throw new Error(`Wrong input type for account "${s.name}" in the instruction accounts object${i!==void 0?' for instruction "'+i+'"':""}. Expected PublicKey or string.`)}const a=s.optional&&o.equals(r),c=!!(s.writable&&!a),u=!!(s.signer&&!a);return{pubkey:o,isWritable:c,isSigner:u}}).flat():[]}}function $q(t,...e){}class Fq{static build(e,n){return(...i)=>{var s,o,a;const[,c]=Nl(e,[...i]),u=new ot;if(c.preInstructions&&c.instructions)throw new Error("instructions is deprecated, use preInstructions");
41return(s=c.preInstructions)===null||s===void 0||s.forEach(l=>u.add(l)),(o=c.instructions)===null||o===void 0||o.forEach(l=>u.add(l)),u.add(n(...i)),(a=c.postInstructions)===null||a===void 0||a.forEach(l=>u.add(l)),u}}}class Uq{static build(e,n,r,i){return async(...o)=>{var a;const c=n(...o),[,u]=Nl(e,[...o]);if(i.sendAndConfirm===void 0)throw new Error("This function requires 'Provider.sendAndConfirm' to be implemented.");try{return await i.sendAndConfirm(c,(a=u.signers)!==null&&a!==void 0?a:[],u.options)}catch(l){throw x1(l,r)}}}}class zq{static build(e,n,r,i){var s;return((s=e.accounts)!==null&&s!==void 0?s:[]).reduce((o,a)=>(o[a.name]=new GT(e,a,r,i,n),o),{})}}class GT{get size(){return this._size}get programId(){return this._programId}get provider(){return this._provider}get coder(){return this._coder}constructor(e,n,r,i,s){this._idlAccount=n,this._programId=r,this._provider=i??al(),this._coder=s??new R1(e),this._size=this._coder.accounts.size(n.name)}async fetchNullable(e,n){const{data:r}=await this.fetchNullableAndContext(e,n);return r}async fetchNullableAndContext(e,n){const r=await this.getAccountInfoAndContext(e,n),{value:i,context:s}=r;return{data:i&&i.data.length!==0?this._coder.accounts.decode(this._idlAccount.name,i.data):null,context:s}}async fetch(e,n){const{data:r}=await this.fetchNullableAndContext(e,n);if(r===null)throw new Error(`Account does not exist or has no data ${e.toString()}`);return r}async fetchAndContext(e,n){const{data:r,context:i}=await this.fetchNullableAndContext(e,n);if(r===null)throw new Error(`Account does not exist ${e.toString()}`);return{data:r,context:i}}async fetchMultiple(e,n){return(await this.fetchMultipleAndContext(e,n)).map(i=>i?i.data:null)}async fetchMultipleAndContext(e,n){return(await E1(this._provider.connection,e.map(i=>Or(i)),n)).map(i=>{if(i==null)return null;const{account:s,context:o}=i;return{data:this._coder.accounts.decode(this._idlAccount.name,s.data),context:o}})}async all(e){const n=this.coder.accounts.memcmp(this._idlAccount.name,e instanceof ne.Buffer?e:void 0),r=[];return(n==null?void 0:n.offset)!=null&&(n==null?void 0:n.bytes)!=null&&r.push({memcmp:{offset:n.offset,bytes:n.bytes}}),(n==null?void 0:n.dataSize)!=null&&r.push({dataSize:n.dataSize}),(await this._provider.connection.getProgramAccounts(this._programId,{commitment:this._provider.connection.commitment,filters:[...r,...Array.isArray(e)?e:[]]})).map(({pubkey:s,account:o})=>({publicKey:s,account:this._coder.accounts.decode(this._idlAccount.name,o.data)}))}subscribe(e,n){const r=Jc.get(e.toString());if(r)return r.ee;const i=new GE;e=Or(e);const s=this._provider.connection.onAccountChange(e,o=>{const a=this._coder.accounts.decode(this._idlAccount.name,o.data);i.emit("change",a)},n);return Jc.set(e.toString(),{ee:i,listener:s}),i}async unsubscribe(e){let n=Jc.get(e.toString());if(!n){console.warn("Address is not subscribed");return}Jc&&await this._provider.connection.removeAccountChangeListener(n.listener).then(()=>{Jc.delete(e.toString())}).catch(console.error)}async createInstruction(e,n){const r=this.size;if(this._provider.publicKey===void 0)throw new Error("This function requires the Provider interface implementor to have a 'publicKey' field.");return Zn.createAccount({fromPubkey:this._provider.publicKey,newAccountPubkey:e.publicKey,space:n??r,lamports:await this._provider.connection.getMinimumBalanceForRentExemption(n??r),programId:this._programId})}async getAccountInfo(e,n){return await this._provider.connection.getAccountInfo(Or(e),n)}async getAccountInfoAndContext(e,n){return await this._provider.connection.getAccountInfoAndContext(Or(e),n)}}const Jc=new Map;class Hq{static build(e,n,r,i,s,o,a){return async(...u)=>{var l;const h=n(...u),[,p]=Nl(e,[...u]);let g;if(i.simulate===void 0)throw new Error("This function requires 'Provider.simulate' to be implemented.");try{g=await i.simulate(h,p.signers,(l=p.options)===null||l===void 0?void 0:l.commitment)}catch(k){throw x1(k,r)}if(g===void 0)throw new Error("Unable to simulate transaction");const y=g.logs;if(!y)throw new Error("Simulated logs not found");const w=[];if(a.events){let k=new ds(o,s);for(const T of k.parseLogs(y))w.push(T)}return{events:w,raw:y}}}}function Tg(t){return new YT(Cl(8),e=>jq.fromBuffer(e),e=>e.toBuffer(),t)}function vf(t){return new YT(Cl(32),e=>new ue(e),e=>e.toBuffer(),t)}function Og(t,e){return new Wq(t,e)}class YT extends Hd{constructor(e,n,r,i){super(e.span,i),this.layout=e,this.decoder=n,this.encoder=r}decode(e,n){return this.decoder(this.layout.decode(e,n))}encode(e,n,r){return this.layout.encode(this.encoder(e),n,r)}getSpan(e,n){return this.layout.getSpan(e,n)}}class Wq extends Hd{constructor(e,n){super(-1,n),this.layout=e,this.discriminator=as()}
41encode(e,n,r=0){return e==null?this.layout.span+this.discriminator.encode(0,n,r):(this.discriminator.encode(1,n,r),this.layout.encode(e,n,r+4)+4)}decode(e,n=0){const r=this.discriminator.decode(e,n);if(r===0)return null;if(r===1)return this.layout.decode(e,n+4);throw new Error("Invalid coption "+this.layout.property)}getSpan(e,n=0){return this.layout.getSpan(e,n+4)+4}}let jq=class ZT extends Ei{toBuffer(){const e=super.toArray().reverse(),n=ne.Buffer.from(e);if(n.length===8)return n;if(n.length>=8)throw new Error("u64 too large");const r=ne.Buffer.alloc(8);return n.copy(r),r}static fromBuffer(e){if(e.length!==8)throw new Error(`Invalid buffer length: ${e.length}`);return new ZT([...e].reverse().map(n=>`00${n.toString(16)}`.slice(-2)).join(""),16)}};const Kq=kn([vf("mint"),vf("owner"),Tg("amount"),Og(vf(),"delegate"),(t=>{const e=UT(tq("discriminator"),null,t);return e.addVariant(0,kn([]),"uninitialized"),e.addVariant(1,kn([]),"initialized"),e.addVariant(2,kn([]),"frozen"),e})("state"),Og(Tg(),"isNative"),Tg("delegatedAmount"),Og(vf(),"closeAuthority")]);function Vq(t){return Kq.decode(t)}class qq{constructor(e,n,r,i,s,o,a,c){this._args=e,this._accounts=n,this._provider=r,this._programId=i,this._idlIx=s,this._idlTypes=a,this._customResolver=c,this._accountStore=new Gq(r,o,i)}args(e){this._args=e}async resolve(){this.resolveEventCpi(this._idlIx.accounts),this.resolveConst(this._idlIx.accounts);let e=0;for(;await this.resolvePdasAndRelations(this._idlIx.accounts)+await this.resolveCustom()>0;)if(e++,e===16){const n=o=>Ls(o)?o.accounts.some(n):!!(o.address||o.pda||o.relations),r=(o,a=[],c=[])=>{for(const u of o)Ls(u)?c.push(...r(u.accounts,[...a,u.name])):c.push([...a,u.name]);return c},i=this._idlIx.accounts.filter(n),s=r(i).filter(o=>!this.get(o)).map(o=>o.reduce((a,c)=>a+"."+c)).map(o=>`\`${o}\``).join(", ");throw new Error(["Reached maximum depth for account resolution.",`Unresolved accounts: ${s}`].join(" "))}}resolveOptionals(e){Object.assign(this._accounts,this.resolveOptionalsHelper(e,this._idlIx.accounts))}get(e){const n=e.reduce((r,i)=>r&&r[i],this._accounts);if(n&&n.toBase58)return n}set(e,n){let r=this._accounts;e.forEach((i,s)=>{var o;s===e.length-1&&(r[i]=n),r[i]=(o=r[i])!==null&&o!==void 0?o:{},r=r[i]})}resolveOptionalsHelper(e,n){const r={};for(const i of n){const s=i.name,o=e[s];o!==void 0&&(JT(o)?Ls(i)?r[s]=this.resolveOptionalsHelper(o,i.accounts):r[s]=QT(o,!0):o!==null?r[s]=Or(o):i.optional&&(r[s]=this._programId))}return r}async resolveCustom(){if(this._customResolver){const{accounts:e,resolved:n}=await this._customResolver({args:this._args,accounts:this._accounts,provider:this._provider,programId:this._programId,idlIx:this._idlIx});return this._accounts=e,n}return 0}resolveEventCpi(e,n=[]){for(const r in e){const i=e[r];Ls(i)&&this.resolveEventCpi(i.accounts,[...n,i.name]);const s=+r+1;if(s===e.length)return;const o=e[r].name,a=e[s].name;if(o==="eventAuthority"&&a==="program"){const c=[...n,o],u=[...n,a];this.get(c)||this.set(c,ue.findProgramAddressSync([ne.Buffer.from("__event_authority")],this._programId)[0]),this.get(u)||this.set(u,this._programId);return}}}resolveConst(e,n=[]){for(const r of e){const i=r.name;if(Ls(r))this.resolveConst(r.accounts,[...n,i]);else{const s=r;if((s.signer||s.address)&&!this.get([...n,i])){if(s.signer){if(!this._provider.publicKey)throw new Error("This function requires the `Provider` interface implementor to have a `publicKey` field.");this.set([...n,i],this._provider.publicKey)}s.address&&this.set([...n,i],Or(s.address))}}}}async resolvePdasAndRelations(e,n=[]){let r=0;for(const i of e){const s=i.name;if(Ls(i))r+=await this.resolvePdasAndRelations(i.accounts,[...n,s]);else{const o=i;if((o.pda||o.relations)&&!this.get([...n,s])){r++;try{if(o.pda){const a=await Promise.all(o.pda.seeds.map(l=>this.toBuffer(l,n)));if(a.some(l=>!l))continue;const c=await this.parseProgramId(o,n),[u]=ue.findProgramAddressSync(a,c);this.set([...n,s],u)}}catch{}try{if(o.relations){const a=this.get([...n,o.relations[0]]);if(a){const c=await this._accountStore.fetchAccount({publicKey:a});this.set([...n,s],c[s])}}}catch{}}}}return r}async parseProgramId(e,n=[]){var r;if(!(!((r=e.pda)===null||r===void 0)&&r.program))return this._programId;const i=await this.toBuffer(e.pda.program,n);if(!i)throw new Error(`Program seed not resolved: ${e.name}`);return new ue(i)}async toBuffer(e,n=[]){switch(e.kind){case"const":return this.toBufferConst(e);case"arg":return await this.toBufferArg(e);case"account":return await this.toBufferAccount(e,n);default:throw new Error(`Unexpected seed: ${e}`)}}toBufferConst(e){return this.toBufferValue("bytes",e.value)}async toBufferArg(e){const[n,...r]=e.path.split("."),i=this._idlIx.args.findIndex(a=>a.name===n);if(i===-1)throw new Error(`Unable to find argument for seed: ${n}`);const s=r.reduce((a,c)=>(a??{})[c],this._args[i]);if(s===void 0)return;const o=this.getType(this._idlIx.args[i].type,r);return this.toBufferValue(o,s)}async toBufferAccount(e,n=[]){const[r,...i]=e.path.split("."),s=this.get([...n,r]);if(!s)return;if(!i.length)return this.toBufferValue("pubkey",s);if(!e.account)throw new Error(`Seed account is required in order to resolve type: ${e.path}`);let a=await this._accountStore.fetchAccount({publicKey:s,name:e.account}),c=i;for(;c.length>0;)a=a[c[0]],c=c.slice(1);if(a===void 0)return;const u=this.getType({defined:{name:e.account}},i);return this.toBufferValue(u,a)}toBufferValue(e,n){switch(e){case"u8":case"i8":return ne.Buffer.from([n]);case"u16":case"i16":return new Ei(n).toArrayLike(ne.Buffer,"le",2);case"u32":case"i32":return new Ei(n).toArrayLike(ne.Buffer,"le",4);case"u64":case"i64":return new Ei(n).toArrayLike(ne.Buffer,"le",8);case"u128":case"i128":return new Ei(n).toArrayLike(ne.Buffer,"le",16);case"u256":case"i256":return new Ei(n).toArrayLike(ne.Buffer,"le",32);case"string":return ne.Buffer.from(n);case"pubkey":return n.toBuffer();case"bytes":return ne.Buffer.from(n);default:if(e!=null&&e.array)return ne.Buffer.from(n);throw new Error(`Unexpected seed type: ${e}`)}}getType(e,n=[]){var r;const i=(r=e==null?void 0:e.defined)===null||r===void 0?void 0:r.name;if(i){if(i==="tokenAccount")switch(n.at(0)){case"mint":case"owner":return"pubkey";case"amount":case"delagatedAmount":return"u64";default:throw new Error(`Unknown token account path: ${n}`)}const s=this._idlTypes.find(l=>
41l.name===i);if(!s)throw new Error(`Type not found: ${i}`);const[o,...a]=n,u=s.type.fields.find(l=>l.name===o);if(!u)throw new Error(`Field not found: ${o}`);return this.getType(u.type,a)}return e}}class Gq{constructor(e,n,r){this._provider=e,this._cache=new Map,this._idls={},this._idls[r.toBase58()]=n}async fetchAccount({publicKey:e,name:n}){const r=e.toBase58();if(!this._cache.has(r)){const i=await this._provider.connection.getAccountInfo(e);if(i===null)throw new Error(`Account not found: ${r}`);if(n==="tokenAccount"){const s=Vq(i.data);this._cache.set(r,s)}else{const s=await this.getAccountsNs(i.owner);if(s){const o=Object.values(s)[0];if(o){const a=o.coder.accounts.decodeAny(i.data);this._cache.set(r,a)}}}}return this._cache.get(r)}async getAccountsNs(e){const n=e.toBase58();if(!this._idls[n]){const r=await Bh.fetchIdl(e,this._provider);if(r){const i=new Bh(r,this._provider);this._idls[n]=i.account}}return this._idls[n]}}class XT{static build(e,n,r,i,s,o,a,c,u,l,h){return(...p)=>new Yq(p,i,s,o,a,c,e,n,r,u,l,h)}}function JT(t){return typeof t=="object"&&t!==null&&!("_bn"in t)}function QT(t,e){const n={};for(const r in t){const i=t[r];if(i===null){if(e)throw new Error("Failed to resolve optionals due to IDL type mismatch with input accounts!");continue}n[r]=JT(i)?QT(i,!0):Or(i)}return n}class Yq{constructor(e,n,r,i,s,o,a,c,u,l,h,p){this._args=e,this._ixFn=n,this._txFn=r,this._rpcFn=i,this._simulateFn=s,this._viewFn=o,this._accounts={},this._remainingAccounts=[],this._signers=[],this._preInstructions=[],this._postInstructions=[],this._resolveAccounts=!0,this._accountsResolver=new qq(e,this._accounts,a,c,u,l,h,p)}args(e){this._args=e,this._accountsResolver.args(e)}accounts(e){return this.accountsPartial(e)}accountsPartial(e){return this._resolveAccounts=!0,this._accountsResolver.resolveOptionals(e),this}accountsStrict(e){return this._resolveAccounts=!1,this._accountsResolver.resolveOptionals(e),this}signers(e){return this._signers=this._signers.concat(e),this}remainingAccounts(e){return this._remainingAccounts=this._remainingAccounts.concat(e),this}preInstructions(e,n=!1){return n?this._preInstructions=e.concat(this._preInstructions):this._preInstructions=this._preInstructions.concat(e),this}postInstructions(e){return this._postInstructions=this._postInstructions.concat(e),this}async pubkeys(){return this._resolveAccounts&&await this._accountsResolver.resolve(),this._accounts}async instruction(){return this._resolveAccounts&&await this._accountsResolver.resolve(),this._ixFn(...this._args,{accounts:this._accounts,signers:this._signers,remainingAccounts:this._remainingAccounts,preInstructions:this._preInstructions,postInstructions:this._postInstructions})}async transaction(){return this._resolveAccounts&&await this._accountsResolver.resolve(),this._txFn(...this._args,{accounts:this._accounts,signers:this._signers,remainingAccounts:this._remainingAccounts,preInstructions:this._preInstructions,postInstructions:this._postInstructions})}async simulate(e){return this._resolveAccounts&&await this._accountsResolver.resolve(),this._simulateFn(...this._args,{accounts:this._accounts,signers:this._signers,remainingAccounts:this._remainingAccounts,preInstructions:this._preInstructions,postInstructions:this._postInstructions,options:e})}async view(e){if(this._resolveAccounts&&await this._accountsResolver.resolve(),!this._viewFn)throw new Error(["Method does not support views.","The instruction should return a value, and its accounts must be read-only"].join(" "));return this._viewFn(...this._args,{accounts:this._accounts,signers:this._signers,remainingAccounts:this._remainingAccounts,preInstructions:this._preInstructions,postInstructions:this._postInstructions,options:e})}async rpc(e){return this._resolveAccounts&&await this._accountsResolver.resolve(),this._rpcFn(...this._args,{accounts:this._accounts,signers:this._signers,remainingAccounts:this._remainingAccounts,preInstructions:this._preInstructions,postInstructions:this._postInstructions,options:e})}async rpcAndKeys(e){return{signature:await this.rpc(e),pubkeys:await this.pubkeys()}}async prepare(){return{instruction:await this.instruction(),signers:this._signers,pubkeys:await this.pubkeys()}}}class Zq{static build(e,n,r,i){const s=n.accounts.find(c=>c.writable),o=!!n.returns;return s||!o?void 0:async(...c)=>{let u=await r(...c);const l=`Program return: ${e} `;let h=u.raw.find(w=>w.startsWith(l));if(!h)throw new Error("View expected return log");let p=b1(h.slice(l.length)),g=n.returns;if(!g)throw new Error("View expected return type");return Je.fieldLayout({type:g},i.types).decode(p)}}}class Xq{static build(e,n,r,i,s){const o={},a={},c={},u={},l={},h={},p=Qx(e),g=e.accounts?zq.build(e,n,r,i):{};return e.instructions.forEach(y=>{const w=Lh.build(y,(F,L)=>n.instruction.encode(F,L),r),k=Fq.build(y,w),T=Uq.build(y,k,p,i),C=Hq.build(y,k,p,i,n,r,e),O=Zq.build(r,y,C,e),I=XT.build(i,r,y,w,k,T,C,O,g,e.types||[],s==null?void 0:s(y)),N=y.name;a[N]=w,c[N]=k,o[N]=T,u[N]=C,l[N]=I,O&&(h[N]=O)}),[o,a,c,g,u,l,h]}}let Bh=class pm{get programId(){return this._programId}get idl(){return this._idl}get rawIdl(){return this._rawIdl}get coder(){return this._coder}get provider(){return this._provider}constructor(e,n=al(),r,i){this._idl=kV(e),this._rawIdl=e,this._provider=n,this._programId=Or(e.address),this._coder=r??new R1(this._idl),this._events=new qT(this._programId,n,this._coder);const[s,o,a,c,u,l,h]=Xq.build(this._idl,this._coder,this._programId,n,i);this.rpc=s,this.instruction=o,this.transaction=a,this.account=c,this.simulate=u,this.methods=l,this.views=h}static async at(e,n){const r=Or(e),i=await pm.fetchIdl(r,n);if(!i)throw new Error(`IDL not found for program: ${e.toString()}`);return new pm(i,n)}static async fetchIdl(e,n){n=n??al();const r=Or(e),i=await vV(r),s=await n.connection.getAccountInfo(i);if(!s)return null;let o=_V(s.data.slice(8));const a=oV(o.data);return JSON.parse(Jx(a))}addEventListener(e,n,r){return this._events.addEventListener(e,n,r)}async removeEventListener(e){return await this._events.removeEventListener(e)}};new ue("11111111111111111111111111111111");function Jq(t){return new Bh(eO,t,Qq())}function Qq(){return new HT(eO)}const eO={address:"11111111111111111111111111111111",metadata:{name:"systemProgram",version:"0.1.0",spec:"0.1.0"},instructions:[{name:"advanceNonceAccount",discriminator:[4,0,0,0],accounts:[{name:"nonce",writable:!0},{name:"recentBlockhashes"},{name:"authorized",signer:!0}],args:[{name:"authorized",type:"pubkey"}]},{name:"allocate",discriminator:[8,0,0,0],accounts:[{name:"pubkey",writable:!0,signer:!0}],args:[{name:"space",type:"u64"}]},{name:"allocateWithSeed",discriminator:[9,0,0,0],accounts:[{name:"account",writable:!0},{name:"base",signer:!0}],args:[{name:"base",type:"pubkey"},{name:"seed",type:"string"},{name:"space",type:"u64"},{name:"owner",type:"pubkey"}]},{name:"assign",discriminator:[1,0,0,0],accounts:[{name:"pubkey",writable:!0,signer:!0}],args:[{name:"owner",type:"pubkey"}]},{name:"assignWithSeed",discriminator:[10,0,0,0],accounts:[{name:"account",writable:!0},{name:"base",signer:!0}],args:[{name:"base",type:"pubkey"},{name:"seed",type:"string"},{name:"owner",type:"pubkey"}]},{name:"authorizeNonceAccount",discriminator:[7,0,0,0],accounts:[{name:"nonce",writable:!0},{name:"authorized",signer:!0}],args:[{name:"authorized",type:"pubkey"}]},{name:"createAccount",discriminator:[0,0,0,0],accounts:[{name:"from",writable:!0,signer:!0},{name:"to",writable:!0,signer:!0}],args:[{name:"lamports",type:"u64"},{name:"space",type:"u64"},{name:"owner",type:"pubkey"}]},{name:"createAccountWithSeed",discriminator:[3,0,0,0],accounts:[{name:"from",writable:!0,signer:!0},{name:"to",writable:!0},{name:"base",signer:!0}],args:[{name:"base",type:"pubkey"},{name:"seed",type:"string"},{name:"lamports",type:"u64"},{name:"space",type:"u64"},{name:"owner",type:"pubkey"}]},{name:"initializeNonceAccount",discriminator:[6,0,0,0],accounts:[{name:"nonce",writable:!0,signer:!0},{name:"recentBlockhashes"},{name:"rent",address:"SysvarRent111111111111111111111111111111111"}],args:[{name:"authorized",type:"pubkey"}]},{name:"transfer",discriminator:[2,0,0,0],accounts:[{name:"from",writable:!0,signer:!0},{name:"to",writable:!0}],args:[{name:"lamports",type:"u64"}]},{name:"transferWithSeed",discriminator:[11,0,0,0],accounts:[{name:"from",writable:!0},{name:"base",signer:!0},{name:"to",writable:!0}],args:[{name:"lamports",type:"u64"},{name:"seed",type:"string"},{name:"owner",type:"pubkey"}]},{name:"withdrawNonceAccount",discriminator:[5,0,0,0],accounts:[{name:"nonce",writable:!0},{name:"to",writable:!0},{name:"recentBlockhashes"},{name:"rent",address:"SysvarRent111111111111111111111111111111111"},{name:"authorized",signer:!0}],args:[{name:"lamports",type:"u64"}]}],accounts:[{name:"nonce",discriminator:[]}],types:[{name:"feeCalculator",type:{kind:"struct",fields:[{name:"lamportsPerSignature",type:"u64"}]}},{name:"nonce",type:{kind:"struct",fields:[{name:"version",type:"u32"},{name:"state",type:"u32"},{name:"authorizedPubkey",type:"pubkey"},{name:"nonce",type:"pubkey"},{name:"feeCalculator",type:{defined:{name:"feeCalculator"}}}]}}]};class eG{static system(e){return Jq(e)}}const tG=Object.freeze(Object.defineProperty({__proto__:null,AccountClient:GT,AnchorError:nc,AnchorProvider:sR,BN:Ei,BorshAccountsCoder:NT,BorshCoder:R1,BorshEventCoder:PT,BorshInstructionCoder:CT,EventManager:qT,EventParser:ds,IdlError:Qi,LangErrorCode:ge,LangErrorMessage:IT,MethodsBuilderFactory:XT,Native:eG,Program:Bh,ProgramError:cl,ProgramErrorStack:$c,SystemCoder:HT,getProvider:al,parseIdlErrors:Qx,setProvider:UV,splitArgsAndCtx:Nl,toInstruction:eR,translateAddress:Or,translateError:x1,utils:Pq,validateAccounts:w1,web3:j2},Symbol.toStringTag,{value:"Module"})),ls=new ue("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");new ue("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb");const lu=new ue("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");new ue("So11111111111111111111111111111111111111112");new ue("9pan9bMn5HatX4EJdBwg9VgCa7Uz5HL8N1m5D3NdXejP");const T1=t=>{const e=t.decode.bind(t),n=t.encode.bind(t);return{decode:e,encode:n}},nG=t=>e=>{const n=kt(t,e),{encode:r,decode:i}=T1(n),s=n;return s.decode=(o,a)=>{const c=i(o,a);return WA(ne.Buffer.from(c))},s.encode=(o,a,c)=>{const u=Wy(o,t);return r(u,a,c)},s},Yf=nG(8),tO=t=>{const e=Ge(t),{encode:n,decode:r}=T1(e),i=e;return i.decode=(s,o)=>!!r(s,o),i.encode=(s,o,a)=>{const c=Number(s);return n(c,o,a)},i},Nn=t=>{const e=kt(32,t),{encode:n,decode:r}=T1(e),i=e;return i.decode=(s,o)=>{const a=r(s,o);return new ue(a)},i.encode=(s,o,a)=>{const c=s.toBuffer();return n(c,o,a)},i};
41class Pl extends Error{constructor(e){super(e)}}class nO extends Pl{constructor(){super(...arguments),this.name="TokenAccountNotFoundError"}}class rG extends Pl{constructor(){super(...arguments),this.name="TokenInvalidAccountError"}}class rO extends Pl{constructor(){super(...arguments),this.name="TokenInvalidAccountOwnerError"}}class Ru extends Pl{constructor(){super(...arguments),this.name="TokenInvalidAccountSizeError"}}class iG extends Pl{constructor(){super(...arguments),this.name="TokenInvalidMintError"}}var Dh;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Mint=1]="Mint",t[t.Account=2]="Account"})(Dh||(Dh={}));const iO=1,sG=Ae([Ge("m"),Ge("n"),tO("isInitialized"),Nn("signer1"),Nn("signer2"),Nn("signer3"),Nn("signer4"),Nn("signer5"),Nn("signer6"),Nn("signer7"),Nn("signer8"),Nn("signer9"),Nn("signer10"),Nn("signer11")]),sO=sG.span;var $h;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initialized=1]="Initialized",t[t.Frozen=2]="Frozen"})($h||($h={}));const oO=Ae([Nn("mint"),Nn("owner"),Yf("amount"),Se("delegateOption"),Nn("delegate"),Ge("state"),Se("isNativeOption"),Yf("isNative"),Yf("delegatedAmount"),Se("closeAuthorityOption"),Nn("closeAuthority")]),Ds=oO.span;async function oG(t,e,n,r=ls){const i=await t.getAccountInfo(e,n);return aG(e,i,r)}function aG(t,e,n=ls){if(!e)throw new nO;if(!e.owner.equals(n))throw new rO;if(e.data.length<Ds)throw new Ru;const r=oO.decode(e.data.slice(0,Ds));let i=ne.Buffer.alloc(0);if(e.data.length>Ds){if(e.data.length===sO)throw new Ru;if(e.data[Ds]!=Dh.Account)throw new rG;i=e.data.slice(Ds+iO)}return{address:t,mint:r.mint,owner:r.owner,amount:r.amount,delegate:r.delegateOption?r.delegate:null,delegatedAmount:r.delegatedAmount,isInitialized:r.state!==$h.Uninitialized,isFrozen:r.state===$h.Frozen,isNative:!!r.isNativeOption,rentExemptReserve:r.isNativeOption?r.isNative:null,closeAuthority:r.closeAuthorityOption?r.closeAuthority:null,tlvData:i}}const aO=Ae([Se("mintAuthorityOption"),Nn("mintAuthority"),Yf("supply"),Ge("decimals"),tO("isInitialized"),Se("freezeAuthorityOption"),Nn("freezeAuthority")]),Ig=aO.span;async function cO(t,e,n,r=ls){const i=await t.getAccountInfo(e,n);return cG(e,i,r)}function cG(t,e,n=ls){if(!e)throw new nO;if(!e.owner.equals(n))throw new rO;if(e.data.length<Ig)throw new Ru;const r=aO.decode(e.data.slice(0,Ig));let i=ne.Buffer.alloc(0);if(e.data.length>Ig){if(e.data.length<=Ds)throw new Ru;if(e.data.length===sO)throw new Ru;if(e.data[Ds]!=Dh.Mint)throw new iG;i=e.data.slice(Ds+iO)}return{address:t,mintAuthority:r.mintAuthorityOption?r.mintAuthority:null,supply:r.supply,decimals:r.decimals,isInitialized:r.isInitialized,freezeAuthority:r.freezeAuthorityOption?r.freezeAuthority:null,tlvData:i}}const uG="G2HTbxYa9XpiZviwnjtTrPCpfRxT8c6L9BvvJFo59ESx",lG={name:"synthetic_staking_2",version:"2.0.0",spec:"0.1.0",description:"Synthetic Staking V2 Protocol by Synatra"},fG=[{name:"create_pool",discriminator:[233,146,209,142,207,104,64,188],accounts:[{name:"signer",writable:!0,signer:!0},{name:"global",writable:!0,pda:{seeds:[{kind:"const",value:[103,108,111,98,97,108]}]}},{name:"pool",writable:!0,pda:{seeds:[{kind:"const",value:[102,111,114,109,97,116,33,32,40,34,112,111,111,108,45,123,125,34,44,32,103,108,111,98,97,108]}]}},{name:"receipt_token",writable:!0},{name:"token_program",address:"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"},{name:"system_program",address:"11111111111111111111111111111111"}],args:[{name:"manager",type:"pubkey"},{name:"oracle",type:"pubkey"},{name:"stake_token",type:"pubkey"},{name:"stake_rate",type:"u64"},{name:"unstake_rate",type:"u64"},{name:"receipt_max_supply",type:"u64"},{name:"nonce",type:"u64"}]},{name:"fulfill_sol",discriminator:[164,135,8,46,164,192,220,22],accounts:[{name:"signer",writable:!0,signer:!0},{name:"pool",writable:!0,pda:{seeds:[{kind:"const",value:[102,111,114,109,97,116,33,32,40,34,112,111,111,108,45,123,125,34,44,32,112,111,111,108]}]}},{name:"claim_record",writable:!0},{name:"claimer",writable:!0},{name:"system_program",address:"11111111111111111111111111111111"}],args:[]},{name:"fulfill_token",discriminator:[218,198,12,160,224,222,129,123],accounts:[{name:"signer",writable:!0,signer:!0},{name:"pool",writable:!0,pda:{seeds:[{kind:"const",value:[102,111,114,109,97,116,33,32,40,34,112,111,111,108,45,123,125,34,44,32,112,111,111,108]}]}},{name:"claim_record",writable:!0},{name:"stake_token",writable:!0},{name:"claimer"},{name:"fulfiller_stake_ata",writable:!0,pda:{seeds:[{kind:"account",path:"signer"},{kind:"const",value:[6,221,246,225,215,101,161,147,217,203,225,70,206,235,121,172,28,180,133,237,95,91,55,145,58,140,245,133,12
416,255,0,169]},{kind:"account",path:"stake_token"}],program:{kind:"const",value:[140,151,37,143,78,36,137,241,187,61,16,41,20,142,13,131,11,90,19,153,218,255,16,132,4,142,123,216,219,233,248,89]}}},{name:"claimer_stake_ata",writable:!0,pda:{seeds:[{kind:"account",path:"claimer"},{kind:"const",value:[6,221,246,225,215,101,161,147,217,203,225,70,206,235,121,172,28,180,133,237,95,91,55,145,58,140,245,133,126,255,0,169]},{kind:"account",path:"stake_token"}],program:{kind:"const",value:[140,151,37,143,78,36,137,241,187,61,16,41,20,142,13,131,11,90,19,153,218,255,16,132,4,142,123,216,219,233,248,89]}}},{name:"associated_token_program",address:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"},{name:"token_program",address:"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"},{name:"system_program",address:"11111111111111111111111111111111"}],args:[]},{name:"initialize",discriminator:[175,175,109,31,13,152,155,237],accounts:[{name:"signer",writable:!0,signer:!0},{name:"global",writable:!0,pda:{seeds:[{kind:"const",value:[103,108,111,98,97,108]}]}},{name:"system_program",address:"11111111111111111111111111111111"}],args:[{name:"admin",type:"pubkey"},{name:"count",type:"u64"},{name:"allow_public_pool_creation",type:"bool"}]},{name:"set_rates",discriminator:[53,124,188,253,56,211,29,2],accounts:[{name:"signer",signer:!0},{name:"pool",writable:!0,pda:{seeds:[{kind:"const",value:[102,111,114,109,97,116,33,32,40,34,112,111,111,108,45,123,125,34,44,32,112,111,111,108]}]}}],args:[{name:"stake_rate",type:"u64"},{name:"unstake_rate",type:"u64"}]},{name:"stake_sol",discriminator:[200,38,157,155,245,57,236,168],accounts:[{name:"signer",writable:!0,signer:!0},{name:"payer",writable:!0,signer:!0},{name:"pool",writable:!0,pda:{seeds:[{kind:"const",value:[102,111,114,109,97,116,33,32,40,34,112,111,111,108,45,123,125,34,44,32,112,111,111,108]}]}},{name:"receipt_token",writable:!0},{name:"user_receipt_ata",writable:!0,pda:{seeds:[{kind:"account",path:"signer"},{kind:"const",value:[6,221,246,225,215,101,161,147,217,203,225,70,206,235,121,172,28,180,133,237,95,91,55,145,58,140,245,133,126,255,0,169]},{kind:"account",path:"receipt_token"}],program:{kind:"const",value:[140,151,37,143,78,36,137,241,187,61,16,41,20,142,13,131,11,90,19,153,218,255,16,132,4,142,123,216,219,233,248,89]}}},{name:"associated_token_program",address:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"},{name:"token_program",address:"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"},{name:"system_program",address:"11111111111111111111111111111111"}],args:[{name:"amount",type:"u64"}]},{name:"stake_token",discriminator:[191,127,193,101,37,96,87,211],accounts:[{name:"signer",writable:!0,signer:!0},{name:"payer",writable:!0,signer:!0},{name:"pool",pda:{seeds:[{kind:"const",value:[102,111,114,109,97,116,33,32,40,34,112,111,111,108,45,123,125,34,44,32,112,111,111,108]}]}},{name:"stake_token",writable:!0},{name:"receipt_token",writable:!0},{name:"user_stake_ata",writable:!0,pda:{seeds:[{kind:"account",path:"signer"},{kind:"const",value:[6,221,246,225,215,101,161,147,217,203,225,70,206,235,121,172,28,180,133,237,95,91,55,145,58,140,245,133,126,255,0,169]},{kind:"account",path:"stake_token"}],program:{kind:"const",value:[140,151,37,143,78,36,137,241,187,61,16,41,20,142,13,131,11,90,19,153,218,255,16,132,4,142,123,216,219,233,248,89]}}},{name:"user_receipt_ata",writable:!0,pda:{seeds:[{kind:"account",path:"signer"},{kind:"const",value:[6,221,246,225,215,101,161,147,217,203,225,70,206,235,121,172,28,180,133,237,95,91,55,145,58,140,245,133,126,255,0,169]},{kind:"account",path:"receipt_token"}],program:{kind:"const",value:[140,151,37,143,78,36,137,241,187,61,16,41,20,142,13,131,11,90,19,153,218,255,16,132,4,142,123,216,219,233,248,89]}}},{name:"pool_stake_ata",writable:!0,pda:{seeds:[{kind:"account",path:"pool"},{kind:"const",value:[6,221,246,225,215,101,161,147,217,203,225,70,206,235,121,172,28,180,133,237,95,91,55,145,58,140,245,133,126,255,0,169]},{kind:"account",path:"stake_token"}],program:{kind:"const",value:[140,151,37,143,78,36,137,241,187,61,16,41,20,142,13,131,11,90,19,153,218,255,16,132,4,142,123,216,219,233,248,89]}}},{name:"associated_token_program",address:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"},{name:"token_program",address:"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"},{name:"system_program",address:"11111111111111111111111111111111"}],args:[{name:"amount",type:"u64"}]},{name:"unstake",discriminator:[90,95,107,42,205,124,50,225],accounts:[{name:"signer",writable:!0,signer:!0},{name:"payer",writable:!0,signer:!0},{name:"pool",writable:!0,pda:{seeds:[{kind:"const",value:[102,111,114,109,97,116,33,32,40,34,112,111,111,108,45,123,125,34,44,32,112,111,111,108]}]}},{name:"receipt_token",writable:!0},{name:"user_receipt_ata",writable:!0,pda:{seeds:[{kind:"account",path:"signer"},{kind:"const",value:[6,221,246,225,215,101,161,147,217,203,225,70,206,235,121,172,28,180,133,237,95,91,55,145,58,140,245,133,12
416,255,0,169]},{kind:"account",path:"receipt_token"}],program:{kind:"const",value:[140,151,37,143,78,36,137,241,187,61,16,41,20,142,13,131,11,90,19,153,218,255,16,132,4,142,123,216,219,233,248,89]}}},{name:"claim_record",writable:!0,pda:{seeds:[{kind:"const",value:[102,111,114,109,97,116,33,32,40,34,99,108,97,105,109,45,123,125,45,123,125,34,44,32,112,111,111,108]}]}},{name:"associated_token_program",address:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"},{name:"token_program",address:"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"},{name:"system_program",address:"11111111111111111111111111111111"}],args:[{name:"receipt_amount",type:"u64"}]},{name:"update_limit",discriminator:[181,75,36,52,69,92,90,65],accounts:[{name:"manager",signer:!0},{name:"pool",writable:!0,pda:{seeds:[{kind:"const",value:[102,111,114,109,97,116,33,32,40,34,112,111,111,108,45,123,125,34,44,32,112,111,111,108]}]}}],args:[{name:"new_limit",type:"u64"}]},{name:"withdraw_sol",discriminator:[145,131,74,136,65,137,42,38],accounts:[{name:"manager",writable:!0,signer:!0},{name:"pool",writable:!0,pda:{seeds:[{kind:"const",value:[102,111,114,109,97,116,33,32,40,34,112,111,111,108,45,123,125,34,44,32,112,111,111,108]}]}},{name:"destination",writable:!0},{name:"system_program",address:"11111111111111111111111111111111"}],args:[{name:"amount",type:"u64"}]},{name:"withdraw_token",discriminator:[136,235,181,5,101,109,57,81],accounts:[{name:"manager",writable:!0,signer:!0},{name:"pool",pda:{seeds:[{kind:"const",value:[102,111,114,109,97,116,33,32,40,34,112,111,111,108,45,123,125,34,44,32,112,111,111,108]}]}},{name:"token",writable:!0},{name:"destination"},{name:"pool_ata",writable:!0,pda:{seeds:[{kind:"account",path:"pool"},{kind:"const",value:[6,221,246,225,215,101,161,147,217,203,225,70,206,235,121,172,28,180,133,237,95,91,55,145,58,140,245,133,126,255,0,169]},{kind:"account",path:"token"}],program:{kind:"const",value:[140,151,37,143,78,36,137,241,187,61,16,41,20,142,13,131,11,90,19,153,218,255,16,132,4,142,123,216,219,233,248,89]}}},{name:"destination_ata",writable:!0,pda:{seeds:[{kind:"account",path:"destination"},{kind:"const",value:[6,221,246,225,215,101,161,147,217,203,225,70,206,235,121,172,28,180,133,237,95,91,55,145,58,140,245,133,126,255,0,169]},{kind:"account",path:"token"}],program:{kind:"const",value:[140,151,37,143,78,36,137,241,187,61,16,41,20,142,13,131,11,90,19,153,218,255,16,132,4,142,123,216,219,233,248,89]}}},{name:"associated_token_program",address:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"},{name:"token_program",address:"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"},{name:"system_program",address:"11111111111111111111111111111111"}],args:[{name:"amount",type:"u64"}]}],hG=[{name:"ClaimRecord",discriminator:[57,229,0,9,65,62,96,7]},{name:"Global",discriminator:[167,232,232,177,200,108,114,127]},{name:"Pool",discriminator:[241,154,109,4,17,177,109,188]}],dG=[{code:6e3,name:"Initialized",msg:"Already initialized"},{code:6001,name:"MaxSupplyExceeded",msg:"Max supply is exceeded"},{code:6002,name:"InvalidRange",msg:"Exchange rates out of range"},{code:6003,name:"NotEnoughBalance",msg:"Pool does not contain enough balance"},{code:6004,name:"Unauthorized",msg:"Not an authorized signer"},{code:6005,name:"UnauthorizedMintAuthority",msg:"Invalid mint authority"}],pG=[{name:"ClaimRecord",type:{kind:"struct",fields:[{name:"pool_id",type:"u64"},{name:"claimer",type:"pubkey"},{name:"nonce",type:"u64"},{name:"receipt_amount",type:"u64"},{name:"unstake_rate",type:"u64"},{name:"fulfilled",type:"bool"}]}},{name:"Global",type:{kind:"struct",fields:[{name:"admin",type:"pubkey"},{name:"count",type:"u64"},{name:"allow_public_pool_creation",type:"bool"}]}},{name:"Pool",type:{kind:"struct",fields:[{name:"id",type:"u64"},{name:"manager",type:"pubkey"},{name:"oracle",type:"pubkey"},{name:"stake_token",type:"pubkey"},{name:"receipt_token",type:"pubkey"},{name:"stake_rate",type:"u64"},{name:"unstake_rate",type:"u64"},{name:"receipt_max_supply",type:"u64"},{name:"nonce",type:"u64"}]}}],gG={address:uG,metadata:lG,instructions:fG,accounts:hG,errors:dG,types:pG},{Program:mG,web3:yG,setProvider:vG,AnchorProvider:bG,BN:Cg}
41=tG,{ComputeBudgetProgram:wG,SystemProgram:Ng,PublicKey:Pg,Connection:_G}=yG,kG="So11111111111111111111111111111111111111111";class SG{constructor(e,n,r,i=0){this.programPublicKey=new Pg(e),this.connection=new _G(n),this.provider=new bG(this.connection,{},{commitment:"confirmed"}),this.program=new mG({...gG,address:e},this.provider),this.priorityFeeMicroLamports=i,this.globalPublicKey=this._getPda("global"),this.userPublicKey=void 0,vG(this.provider),this.synatraUrl=r,this.axios=VE.create({headers:{"Access-Control-Allow-Origin":"*","Content-Type":"application/json"},timeout:2e3})}setWallet(e){this.provider.wallet=e,this.userPublicKey=e.publicKey}removeWallet(){this.provider.wallet={},this.userPublicKey=void 0}setPriorityFee(e){this.priorityFeeMicroLamports=e}_addPriorityFee(){return wG.setComputeUnitPrice({microLamports:this.priorityFeeMicroLamports})}_getPda(e){const n=new TextEncoder,[r,i]=Pg.findProgramAddressSync([n.encode(e)],this.programPublicKey);return r}_getAta(e,n){const[r,i]=Pg.findProgramAddressSync([e.toBuffer(),ls.toBuffer(),n.toBuffer()],lu);return r}_getPoolPublicKey(e){return this._getPda(`pool-${e}`)}async getGlobal(){const e=await this.program.account.global.fetch(this.globalPublicKey);return e.count=e.count.toNumber(),e}async getPool(e){const n=this._getPoolPublicKey(e);let r=null;try{r=await this.program.account.pool.fetch(n),r.id=Number(r.id),r.stakeRate=Number(r.stakeRate),r.unstakeRate=Number(r.unstakeRate),r.nonce=Number(r.nonce)}catch(i){console.error("pool not found:",i)}return r}_getClaimRecordPublicKey(e,n){return this._getPda(`claim-${e}-${n}`)}async getClaimRecord(e,n){const r=this._getClaimRecordPublicKey(e,n);let i;try{i=await this.program.account.claimRecord.fetch(r)}catch(s){return console.error("claim record not found",s),{}}return i.poolId=i.poolId.toNumber(),i.nonce=i.nonce.toNumber(),i.receiptAmount=i.receiptAmount.toNumber(),i.unstakeRate=i.unstakeRate.toNumber(),i}async getCurrentSupply(e){const n=await cO(this.connection,e);return parseInt(n.supply)}async stake(e,n){const r=this._getPoolPublicKey(e),{stakeToken:i,receiptToken:s}=await this.getPool(e),o=this._getAta(this.userPublicKey,s);if(i.toString()===kG)return this.program.methods.stakeSol(new Cg(n)).accounts({signer:this.userPublicKey,payer:this.userPublicKey,pool:r,receiptToken:s,userReceiptAta:o,associatedTokenProgram:lu,tokenProgram:ls,systemProgram:Ng.programId}).preInstructions(this._addPriorityFee()).rpc();const a=this._getAta(this.userPublicKey,i),c=this._getAta(r,i);return this.program.methods.stakeToken(new Cg(n)).accounts({signer:this.userPublicKey,payer:this.userPublicKey,pool:r,stakeToken:i,receiptToken:s,userStakeAta:a,userReceiptAta:o,poolStakeAta:c,associatedTokenProgram:lu,tokenProgram:ls,systemProgram:Ng.programId}).preInstructions(this._addPriorityFee()).rpc()}async unstake(e,n){const r=this._getPoolPublicKey(e),{receiptToken:i,nonce:s}=await this.getPool(e),o=this._getClaimRecordPublicKey(e,s),a=this._getAta(this.userPublicKey,i);return this.program.methods.unstake(new Cg(n)).accounts({signer:this.userPublicKey,payer:this.userPublicKey,pool:r,receiptToken:i,userReceiptAta:a,claimRecord:o,associatedTokenProgram:lu,tokenProgram:ls,systemProgram:Ng.programId}).preInstructions(this._addPriorityFee()).rpc()}async getClaims(){if(!this.synatraUrl)return[];const{data:e}=await this.axios.get(`${this.synatraUrl}/claims/users/${this.userPublicKey.toString()}`);return e}async getPools(){try{const{data:n}=await this.axios.get(`${this.synatraUrl}/pools`);return n}catch(n){console.log("Could not retrieve pool data:",n)}return await Promise.all([0,1].map(async n=>{const r=await this.getPool(n);return r.maxSupply=Number(r.receiptMaxSupply),r.stakeTokenMint=r.stakeToken.toString(),r.receiptTokenMint=r.receiptToken.toString(),r.currentSupply=await this.getCurrentSupply(r.receiptToken),delete r.receiptMaxSupply,delete r.stakeToken,delete r.receiptToken,delete r.manager,delete r.oracle,r}))}async getStats(){if(!this.synatraUrl)return[];const{data:e}=await this.axios.get(`${this.synatraUrl}/stats/pools`);return e}
41async getPrices(){if(!this.synatraUrl)return null;const{data:e}=await this.axios.get(`${this.synatraUrl}/history/floors/pools`);return e}}class EG{constructor(e){this.connection=new L2(e)}_getAta(e,n){const[r,i]=ue.findProgramAddressSync([e.toBuffer(),ls.toBuffer(),n.toBuffer()],lu);return r}async getBalance(e){return this.connection.getBalance(new ue(e))}async getTokenBalance(e,n){const r=new ue(e),i=new ue(n),s=this._getAta(r,i);let o=0;try{const a=await oG(this.connection,s);o=parseInt(a.amount)}finally{return o}}async getTokenSupply(e){const n=new ue(e),r=await cO(this.connection,n);return parseInt(r.supply)}}const Ml={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},kc={LIGHT:"light",DARK:"dark",COLORED:"colored",AUTO:"auto"},Qn={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},AG={BOUNCE:"bounce",SLIDE:"slide",FLIP:"flip",ZOOM:"zoom"},uO={dangerouslyHTMLString:!1,multiple:!0,position:Ml.TOP_RIGHT,autoClose:5e3,transition:"bounce",hideProgressBar:!1,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,className:"",bodyClassName:"",style:{},progressClassName:"",progressStyle:{},role:"alert",theme:"light"},xG={rtl:!1,newestOnTop:!1,toastClassName:""},lO={...uO,...xG};({...uO,type:Qn.DEFAULT});var pt=(t=>(t[t.COLLAPSE_DURATION=300]="COLLAPSE_DURATION",t[t.DEBOUNCE_DURATION=50]="DEBOUNCE_DURATION",t.CSS_NAMESPACE="Toastify",t))(pt||{}),gm=(t=>(t.ENTRANCE_ANIMATION_END="d",t))(gm||{});const RG={enter:"Toastify--animate Toastify__bounce-enter",exit:"Toastify--animate Toastify__bounce-exit",appendPosition:!0},TG={enter:"Toastify--animate Toastify__slide-enter",exit:"Toastify--animate Toastify__slide-exit",appendPosition:!0},OG={enter:"Toastify--animate Toastify__zoom-enter",exit:"Toastify--animate Toastify__zoom-exit"},IG={enter:"Toastify--animate Toastify__flip-enter",exit:"Toastify--animate Toastify__flip-exit"};function fO(t){let e=RG;if(!t||typeof t=="string")switch(t){case"flip":e=IG;break;case"zoom":e=OG;break;case"slide":e=TG;break}else e=t;return e}function CG(t){return t.containerId||String(t.position)}const Kd="will-unmount";function NG(t=Ml.TOP_RIGHT){return!!document.querySelector(".".concat(pt.CSS_NAMESPACE,"__toast-container--").concat(t))}function PG(t=Ml.TOP_RIGHT){return"".concat(pt.CSS_NAMESPACE,"__toast-container--").concat(t)}function MG(t,e,n=!1){const r=["".concat(pt.CSS_NAMESPACE,"__toast-container"),"".concat(pt.CSS_NAMESPACE,"__toast-container--").concat(t),n?"".concat(pt.CSS_NAMESPACE,"__toast-container--rtl"):null].filter(Boolean).join(" ");return rc(e)?e({position:t,rtl:n,defaultClassName:r}):"".concat(r," ").concat(e||"")}function LG(t){var e;const{position:n,containerClassName:r,rtl:i=!1,style:s={}}=t,o=pt.CSS_NAMESPACE,a=PG(n),c=document.querySelector(".".concat(o)),u=document.querySelector(".".concat(a)),l=!!u&&!((e=u.className)!=null&&e.includes(Kd)),h=c||document.createElement("div"),p=document.createElement("div");p.className=MG(n,r,i),p.dataset.testid="".concat(pt.CSS_NAMESPACE,"__toast-container--").concat(n),p.id=CG(t);for(const g in s)if(Object.prototype.hasOwnProperty.call(s,g)){const y=s[g];p.style[g]=y}return c||(h.className=pt.CSS_NAMESPACE,document.body.appendChild(h)),l||h.appendChild(p),p}function mm(t){var e,n,r;const i=typeof t=="string"?t:((e=t.currentTarget)==null?void 0:e.id)||((n=t.target)==null?void 0:n.id),s=document.getElementById(i);s&&s.removeEventListener("animationend",mm,!1);try{ul[i].unmount(),(r=document.getElementById(i))==null||r.remove(),delete ul[i],delete Pn[i]}catch{}}const ul=vs({});function BG(t,e){const n=document.getElementById(String(e));n&&(ul[n.id]=t)}function ym(t,e=!0){const n=String(t);if(!ul[n])return;const r=document.getElementById(n);r&&r.classList.add(Kd),e?($G(t),r&&r.addEventListener("animationend",mm,!1)):mm(n),$i.items=$i.items.filter(i=>i.containerId!==t)}function DG(t){for(const e in ul)ym(e,t);$i.items=[]}function hO(t,e){const n=document.getElementById(t.toastId);if(n){let r=t;r={...r,...fO(r.transition)};const i=r.appendPosition?"".concat(r.exit,"--").concat(r.position):r.exit;n.className+=" ".concat(i),e&&e(n)}}function $G(t){for(const e in Pn)if(e===t)for(const n of Pn[e]||[])hO(n)}function FG(t){const e=Ll().find(n=>n.toastId===t);return e==null?void 0:e.containerId}function O1(t){return document.getElementById(t)}function UG(t){const e=O1(t.containerId);return e&&e.classList.contains(Kd)}function fk(t){var e;const n=oc(t.content)?Be(t.content.props):null;return n??Be((e=t.data)!=null?e:{})}function zG(t){return t?$i.items.filter(e=>e.containerId===t).length>0:$i.items.length>0}function HG(){if($i.items.length>0){const t=$i.items.shift();Zf(t==null?void 0:t.toastContent,t==null?void 0:t.toastProps)}}const Pn=vs({}),$i=vs({items:[]});function Ll(){const t=Be(Pn);return Object.values(t).reduce((e,n)=>[...e,...n],[])}function WG(t){return Ll().find(e=>e.toastId===t)}function Zf(t,e={}){if(UG(e)){const n=O1(e.containerId);n&&n.addEventListener("animationend",vm.bind(null,t,e),!1)}else vm(t,e)}function vm(t,e={}){const n=O1(e.containerId);n&&n.removeEventListener("animationend",vm.bind(null,t,e),!1);const r=Pn[e.containerId]||[],i=r.length>0;if(!i&&!NG(e.position)){const s=LG(e),o=Xm(cY,e);o.mount(s),BG(o,s.id)}i&&(e.position=r[0].position),ho(()=>{e.updateId?Pi.update(e):Pi.add(t,e)})}const Pi={add(t,e){const{containerId:n=""}=e;n&&(Pn[n]=Pn[n]||[],Pn[n].find(r=>r.toastId===e.toastId)||setTimeout(()=>{var r,i;e.newestOnTop?(r=Pn[n])==null||r.unshift(e):(i=Pn[n])==null||i.push(e),e.onOpen&&e.onOpen(fk(e))},e.delay||0))},remove(t){if(t){const e=FG(t);if(e){const n=Pn[e];let r=n.find(i=>i.toastId===t);Pn[e]=n.filter(i=>i.toastId!==t),!Pn[e].length&&!zG(e)&&ym(e,!1),HG(),ho(()=>{r!=null&&r.onClose&&(r.onClose(fk(r)),r=void 0)})}}},update(t={}){const{containerId:e=""}=t;if(e&&t.updateId){Pn[e]=Pn[e]||[];const n=Pn[e].find(r=>r.toastId===t.toastId);n&&setTimeout(()=>{for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){const i=t[r];n[r]=i}},t.delay||0)}},clear(t,e=!0){t?ym(t,e):DG(e)},dismissCallback(t){var e;const n=(e=t.currentTarget)==null?void 0:e.id,r=document.getElementById(n);
41r&&(r.removeEventListener("animationend",Pi.dismissCallback,!1),setTimeout(()=>{Pi.remove(n)}))},dismiss(t){if(t){const e=Ll();for(const n of e)if(n.toastId===t){hO(n,r=>{r.addEventListener("animationend",Pi.dismissCallback,!1)});break}}}},dO=vs({}),Fh=vs({});function pO(){return Math.random().toString(36).substring(2,9)}function jG(t){return typeof t=="number"&&!isNaN(t)}function bm(t){return typeof t=="string"}function rc(t){return typeof t=="function"}function Vd(...t){return hi(...t)}function Xf(t){return typeof t=="object"&&(!!(t!=null&&t.render)||!!(t!=null&&t.setup)||typeof(t==null?void 0:t.type)=="object")}function KG(t={}){dO["".concat(pt.CSS_NAMESPACE,"-default-options")]=t}function VG(){return dO["".concat(pt.CSS_NAMESPACE,"-default-options")]||lO}function qG(){return document.documentElement.classList.contains("dark")?"dark":"light"}var Jf=(t=>(t[t.Enter=0]="Enter",t[t.Exit=1]="Exit",t))(Jf||{});const gO={containerId:{type:[String,Number],required:!1,default:""},clearOnUrlChange:{type:Boolean,required:!1,default:!0},dangerouslyHTMLString:{type:Boolean,required:!1,default:!1},multiple:{type:Boolean,required:!1,default:!0},limit:{type:Number,required:!1,default:void 0},position:{type:String,required:!1,default:Ml.TOP_LEFT},bodyClassName:{type:String,required:!1,default:""},autoClose:{type:[Number,Boolean],required:!1,default:!1},closeButton:{type:[Boolean,Function,Object],required:!1,default:void 0},transition:{type:[String,Object],required:!1,default:"bounce"},hideProgressBar:{type:Boolean,required:!1,default:!1},pauseOnHover:{type:Boolean,required:!1,default:!0},pauseOnFocusLoss:{type:Boolean,required:!1,default:!0},closeOnClick:{type:Boolean,required:!1,default:!0},progress:{type:Number,required:!1,default:void 0},progressClassName:{type:String,required:!1,default:""},toastStyle:{type:Object,required:!1,default(){return{}}},progressStyle:{type:Object,required:!1,default(){return{}}},role:{type:String,required:!1,default:"alert"},theme:{type:String,required:!1,default:kc.AUTO},content:{type:[String,Object,Function],required:!1,default:""},toastId:{type:[String,Number],required:!1,default:""},data:{type:[Object,String],required:!1,default(){return{}}},type:{type:String,required:!1,default:Qn.DEFAULT},icon:{type:[Boolean,String,Number,Object,Function],required:!1,default:void 0},delay:{type:Number,required:!1,default:void 0},onOpen:{type:Function,required:!1,default:void 0},onClose:{type:Function,required:!1,default:void 0},onClick:{type:Function,required:!1,default:void 0},isLoading:{type:Boolean,required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},toastClassName:{type:String,required:!1,default:""},updateId:{type:[String,Number],required:!1,default:""}},GG={autoClose:{type:[Number,Boolean],required:!0},isRunning:{type:Boolean,required:!1,default:void 0},type:{type:String,required:!1,default:Qn.DEFAULT},theme:{type:String,required:!1,default:kc.AUTO},hide:{type:Boolean,required:!1,default:void 0},className:{type:[String,Function],required:!1,default:""},controlledProgress:{type:Boolean,required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:void 0},isIn:{type:Boolean,required:!1,default:void 0},progress:{type:Number,required:!1,default:void 0},closeToast:{type:Function,required:!1,default:void 0}},YG=dr({name:"ProgressBar",props:GG,setup(t,{attrs:e}){const n=ct(),r=Ve(()=>t.hide?"true":"false"),i=Ve(()=>({...e.style||{},animationDuration:"".concat(t.autoClose===!0?5e3:t.autoClose,"ms"),animationPlayState:t.isRunning?"running":"paused",opacity:t.hide?0:1,transform:t.controlledProgress?"scaleX(".concat(t.progress,")"):"none"})),s=Ve(()=>["".concat(pt.CSS_NAMESPACE,"__progress-bar"),t.controlledProgress?"".concat(pt.CSS_NAMESPACE,"__progress-bar--controlled"):"".concat(pt.CSS_NAMESPACE,"__progress-bar--animated"),"".concat(pt.CSS_NAMESPACE,"__progress-bar-theme--").concat(t.theme),"".concat(pt.CSS_NAMESPACE,"__progress-bar--").concat(t.type),t.rtl?"".concat(pt.CSS_NAMESPACE,"__progress-bar--rtl"):null].filter(Boolean).join(" ")),o=Ve(()=>"".concat(s.value," ").concat((e==null?void 0:e.class)||"")),a=()=>{n.value&&(n.value.onanimationend=null,n.value.ontransitionend=null)},c=()=>{t.isIn&&t.closeToast&&t.autoClose!==!1&&(t.closeToast(),a())},u=Ve(()=>t.controlledProgress?null:c),l=Ve(()=>t.controlledProgress?c:null);return oi(()=>
41{n.value&&(a(),n.value.onanimationend=u.value,n.value.ontransitionend=l.value)}),()=>Pe("div",{ref:n,role:"progressbar","aria-hidden":r.value,"aria-label":"notification timer",class:o.value,style:i.value},null)}}),ZG=dr({name:"CloseButton",inheritAttrs:!1,props:{theme:{type:String,required:!1,default:kc.AUTO},type:{type:String,required:!1,default:kc.LIGHT},ariaLabel:{type:String,required:!1,default:"close"},closeToast:{type:Function,required:!1,default:void 0}},setup(t){return()=>Pe("button",{class:"".concat(pt.CSS_NAMESPACE,"__close-button ").concat(pt.CSS_NAMESPACE,"__close-button--").concat(t.theme),type:"button",onClick:e=>{e.stopPropagation(),t.closeToast&&t.closeToast(e)},"aria-label":t.ariaLabel},[Pe("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},[Pe("path",{"fill-rule":"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"},null)])])}}),qd=({theme:t,type:e,path:n,...r})=>Pe("svg",hi({viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":"var(--toastify-icon-color-".concat(e,")")},r),[Pe("path",{d:n},null)]);function XG(t){return Pe(qd,hi(t,{path:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}),null)}function JG(t){return Pe(qd,hi(t,{path:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}),null)}function QG(t){return Pe(qd,hi(t,{path:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}),null)}function eY(t){return Pe(qd,hi(t,{path:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}),null)}function tY(){return Pe("div",{class:"".concat(pt.CSS_NAMESPACE,"__spinner")},null)}const wm={info:JG,warning:XG,success:QG,error:eY,spinner:tY},nY=t=>t in wm;function rY({theme:t,type:e,isLoading:n,icon:r}){let i;const s={theme:t,type:e};return n?i=wm.spinner():r===!1?i=void 0:Xf(r)?i=Be(r):rc(r)?i=r(s):oc(r)?i=gs(r,s):bm(r)||jG(r)?i=r:nY(e)&&(i=wm[e](s)),i}const iY=()=>{};function sY(t,e,n=pt.COLLAPSE_DURATION){const{scrollHeight:r,style:i}=t,s=n;requestAnimationFrame(()=>{i.minHeight="initial",i.height=r+"px",i.transition="all ".concat(s,"ms"),requestAnimationFrame(()=>{i.height="0",i.padding="0",i.margin="0",setTimeout(e,s)})})}function oY(t){const e=ct(!1),n=ct(!1),r=ct(!1),i=ct(Jf.Enter),s=vs({...t,appendPosition:t.appendPosition||!1,collapse:typeof t.collapse>"u"?!0:t.collapse,collapseDuration:t.collapseDuration||pt.COLLAPSE_DURATION}),o=s.done||iY,a=Ve(()=>s.appendPosition?"".concat(s.enter,"--").concat(s.position):s.enter),c=Ve(()=>s.appendPosition?"".concat(s.exit,"--").concat(s.position):s.exit),u=Ve(()=>t.pauseOnHover?{onMouseenter:k,onMouseleave:w}:{});function l(){const C=a.value.split(" ");p().addEventListener(gm.ENTRANCE_ANIMATION_END,w,{once:!0});const O=N=>{const F=p();N.target===F&&(F.dispatchEvent(new Event(gm.ENTRANCE_ANIMATION_END)),F.removeEventListener("animationend",O),F.removeEventListener("animationcancel",O),i.value===Jf.Enter&&N.type!=="animationcancel"&&F.classList.remove(...C))},I=()=>{const N=p();N.classList.add(...C),N.addEventListener("animationend",O),N.addEventListener("animationcancel",O)};t.pauseOnFocusLoss&&g(),I()}function h(){if(!p())return;const C=()=>{const I=p();
41I.removeEventListener("animationend",C),s.collapse?sY(I,o,s.collapseDuration):o()},O=()=>{const I=p();i.value=Jf.Exit,I&&(I.className+=" ".concat(c.value),I.addEventListener("animationend",C))};n.value||(r.value?C():setTimeout(O))}function p(){return t.toastRef.value}function g(){document.hasFocus()||k(),window.addEventListener("focus",w),window.addEventListener("blur",k)}function y(){window.removeEventListener("focus",w),window.removeEventListener("blur",k)}function w(){(!t.loading.value||t.isLoading===void 0)&&(e.value=!0)}function k(){e.value=!1}function T(C){C&&(C.stopPropagation(),C.preventDefault()),n.value=!1}return oi(h),oi(()=>{const C=Ll();n.value=C.findIndex(O=>O.toastId===s.toastId)>-1}),oi(()=>{t.isLoading!==void 0&&(t.loading.value?k():w())}),xc(l),pl(()=>{t.pauseOnFocusLoss&&y()}),{isIn:n,isRunning:e,hideToast:T,eventHandlers:u}}const aY=dr({name:"ToastItem",inheritAttrs:!1,props:gO,setup(t){const e=ct(),n=Ve(()=>!!t.isLoading),r=Ve(()=>t.progress!==void 0&&t.progress!==null),i=Ve(()=>rY(t)),s=Ve(()=>["".concat(pt.CSS_NAMESPACE,"__toast"),"".concat(pt.CSS_NAMESPACE,"__toast-theme--").concat(t.theme),"".concat(pt.CSS_NAMESPACE,"__toast--").concat(t.type),t.rtl?"".concat(pt.CSS_NAMESPACE,"__toast--rtl"):void 0,t.toastClassName||""].filter(Boolean).join(" ")),{isRunning:o,isIn:a,hideToast:c,eventHandlers:u}=oY({toastRef:e,loading:n,done:()=>{Pi.remove(t.toastId)},...fO(t.transition),...t});return()=>Pe("div",hi({id:t.toastId,class:s.value,style:t.toastStyle||{},ref:e,"data-testid":"toast-item-".concat(t.toastId),onClick:l=>{t.closeOnClick&&c(),t.onClick&&t.onClick(l)}},u.value),[Pe("div",{role:t.role,"data-testid":"toast-body",class:"".concat(pt.CSS_NAMESPACE,"__toast-body ").concat(t.bodyClassName||"")},[i.value!=null&&Pe("div",{"data-testid":"toast-icon-".concat(t.type),class:["".concat(pt.CSS_NAMESPACE,"__toast-icon"),t.isLoading?"":"".concat(pt.CSS_NAMESPACE,"--animate-icon ").concat(pt.CSS_NAMESPACE,"__zoom-enter")].join(" ")},[Xf(i.value)?ii(Be(i.value),{theme:t.theme,type:t.type}):rc(i.value)?i.value({theme:t.theme,type:t.type}):i.value]),Pe("div",{"data-testid":"toast-content"},[Xf(t.content)?ii(Be(t.content),{toastProps:Be(t),closeToast:c,data:t.data}):rc(t.content)?t.content({toastProps:Be(t),closeToast:c,data:t.data}):t.dangerouslyHTMLString?ii("div",{innerHTML:t.content}):t.content])]),(t.closeButton===void 0||t.closeButton===!0)&&Pe(ZG,{theme:t.theme,closeToast:l=>{l.stopPropagation(),l.preventDefault(),c()}},null),Xf(t.closeButton)?ii(Be(t.closeButton),{closeToast:c,type:t.type,theme:t.theme}):rc(t.closeButton)?t.closeButton({closeToast:c,type:t.type,theme:t.theme}):null,Pe(YG,{className:t.progressClassName,style:t.progressStyle,rtl:t.rtl,theme:t.theme,isIn:a.value,type:t.type,hide:t.hideProgressBar,isRunning:o.value,autoClose:t.autoClose,controlledProgress:r.value,progress:t.progress,closeToast:t.isLoading?void 0:c},null)])}});let Tu=0;function mO(){typeof window>"u"||(Tu&&window.cancelAnimationFrame(Tu),Tu=window.requestAnimationFrame(mO),Fh.lastUrl!==window.location.href&&(Fh.lastUrl=window.location.href,Pi.clear()))}const cY=dr({name:"ToastifyContainer",inheritAttrs:!1,props:gO,setup(t){const e=Ve(()=>t.containerId),n=Ve(()=>Pn[e.value]||[]),r=Ve(()=>n.value.filter(i=>i.position===t.position));return xc(()=>{typeof window<"u"&&t.clearOnUrlChange&&window.requestAnimationFrame(mO)}),pl(()=>{typeof window<"u"&&Tu&&(window.cancelAnimationFrame(Tu),Fh.lastUrl="")}),()=>Pe(Ct,null,[r.value.map(i=>{const{toastId:s=""}=i;return Pe(aY,hi({key:s},i),null)})])}});let Mg=!1;function yO(){const t=[];return Ll().forEach(e=>{const n=document.getElementById(e.containerId);n&&!n.classList.contains(Kd)&&t.push(e)}),t}function uY(t){const e=yO().length,n=t??0;return n>0&&e+$i.items.length>=n}function lY(t){uY(t.limit)&&!t.updateId&&$i.items.push({toastId:t.toastId,containerId:t.containerId,toastContent:t.content,toastProps:t})}function yo(t,e,n={}){if(Mg)return;n=Vd(VG(),{type:e}
41,Be(n)),(!n.toastId||typeof n.toastId!="string"&&typeof n.toastId!="number")&&(n.toastId=pO()),n={...n,content:t,containerId:n.containerId||String(n.position)};const r=Number(n==null?void 0:n.progress);return r<0&&(n.progress=0),r>1&&(n.progress=1),n.theme==="auto"&&(n.theme=qG()),lY(n),Fh.lastUrl=window.location.href,n.multiple?$i.items.length?n.updateId&&Zf(t,n):Zf(t,n):(Mg=!0,St.clearAll(void 0,!1),setTimeout(()=>{Zf(t,n)},0),setTimeout(()=>{Mg=!1},390)),n.toastId}const St=(t,e)=>yo(t,Qn.DEFAULT,e);St.info=(t,e)=>yo(t,Qn.DEFAULT,{...e,type:Qn.INFO});St.error=(t,e)=>yo(t,Qn.DEFAULT,{...e,type:Qn.ERROR});St.warning=(t,e)=>yo(t,Qn.DEFAULT,{...e,type:Qn.WARNING});St.warn=St.warning;St.success=(t,e)=>yo(t,Qn.DEFAULT,{...e,type:Qn.SUCCESS});St.loading=(t,e)=>yo(t,Qn.DEFAULT,Vd(e,{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1}));St.dark=(t,e)=>yo(t,Qn.DEFAULT,Vd(e,{theme:kc.DARK}));St.remove=t=>{t?Pi.dismiss(t):Pi.clear()};St.clearAll=(t,e)=>{Pi.clear(t,e)};St.isActive=t=>{let e=!1;return e=yO().findIndex(n=>n.toastId===t)>-1,e};St.update=(t,e={})=>{setTimeout(()=>{const n=WG(t);if(n){const r=Be(n),{content:i}=r,s={...r,...e,toastId:e.toastId||t,updateId:pO()},o=s.render||i;delete s.render,yo(o,s.type,s)}},0)};St.done=t=>{St.update(t,{isLoading:!1,progress:1})};St.promise=fY;function fY(t,{pending:e,error:n,success:r},i){let s;e&&(s=bm(e)?St.loading(e,i):St.loading(e.render,{...i,...e}));const o={isLoading:void 0,autoClose:null,closeOnClick:null,closeButton:null,draggable:null,delay:100},a=(u,l,h)=>{if(l==null){St.remove(s);return}const p={type:u,...o,...i,data:h},g=bm(l)?{render:l}:l;return s?St.update(s,{...p,...g,isLoading:!1,autoClose:!0}):St(g.render,{...p,...g,isLoading:!1,autoClose:!0}),h},c=rc(t)?t():t;return c.then(u=>{a("success",r,u)}).catch(u=>{a("error",n,u)}),c}St.POSITION=Ml;St.THEME=kc;St.TYPE=Qn;St.TRANSITIONS=AG;const vO={install(t,e={}){hY(e)}};typeof window<"u"&&(window.Vue3Toastify=vO);function hY(t={}){const e=Vd(lO,t);KG(e)}const dY="/assets/synatra.png";const pY="synatfE5AvWtbDT9sSvDsF9gmeqR9qeq3FA84bhxWur",_m="https://api.synatra.xyz/rpc",gY="https://api.synatra.xyz";console.log("RPC_URL:",JSON.stringify(_m));const Lg=1e5,Bg={SOL:"So11111111111111111111111111111111111111111",ySOL:"yso11zxLbHA3wBJ9HAtVu6wnesqz9A2qxnhxanasZ4N",USDC:"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",yUSD:"yUSDX7W89jXWn4zzDPLnhykDymSjQSmpaJ8e4fjC1fg"},mY={components:{Switch:WN,Claims:mP,Priority:EP,SocialBar:IP,Swap:l6,Stats:wM,Rain:m6,Waves:k6,Wallet:vW,TokenSwitch:Qm,PriceChart:Q5},setup(){return console.info("v2.01"),{wallet:mW(),synatra:new SG(pY,_m,gY,0),solana:new EG(_m),jup:new qE}},async mounted(){this.synatra.setPriorityFee(this.priorityFeeMicroLamports),this.refreshAll(),setInterval((()=>{if(this.skipInterval){this.skipInterval=!1;return}this.refreshAll()}).bind(this),15e3),window.addEventListener("resize",this.checkScreenWidth),this.checkScreenWidth()},unmounted(){window.removeEventListener("resize",this.checkScreenWidth)},computed:{activePool(){return this.pools[this.activePoolId]||{}},activeStats(){const t={};return Object.assign(t,this.stats[this.activePoolId]||{}),Object.assign(t,this.activePool),t},exchangeRate(){const t=this.activePool.stakeRate,e=this.activePool.unstakeRate;return t?{deposit:t/Lg,withdraw:e/Lg}:{deposit:1/0,withdraw:0}},apy(){const t=this.activePool.apy;return t?t/Lg:0},nonce(){return this.activePool.nonce||0},maxSupply(){return this.activePool.maxSupply||0},currentSupply(){return this.activePool.currentSupply||0},tokenChoices(){return this.pools.map(t=>({id:t.id,name:this.unstake?t.receiptToken:t.stakeToken,logo:this.unstake?`/assets/${t.receiptToken}.png`:`/assets/${t.stakeToken}.png`}))},swapSettings(){const{stakeToken:t,receiptToken:e,stakeTokenMint:n,receiptTokenMint:r,decimals:i}=this.activePool,s=this.balance[t],o=this.balance[e],a=`/assets/${t}.png`,c=`/assets/${e}.png`;return this.unstake?{action:"unstake",depositToken:e,withdrawToken:t,depositTokenMint:r,withdrawTokenMint:n,depositTokenBalance:o,exchangeRate:this.exchangeRate.withdraw,maxPriorityFee:this.maxPriorityFee,callToAction:`Deposit ${e}`,buttonTitle:`Withdraw ${t}`,formNotice:"Withdraw takes up to 24 hours to fulfill.",capacity:1/0,depositLogo:c,withdrawLogo:a,decimals:i,tokenChoices:this.tokenChoices}:{action:"stake",depositToken:t,withdrawToken:e,depositTokenMint:n,withdrawTokenMint:r,depositTokenBalance:s,withdrawTokenApy:this.apy,exchangeRate:1/this.exchangeRate.deposit,maxPriorityFee:this.maxPriorityFee,callToAction:`Deposit ${t}`,buttonTitle:`Deposit ${t}`,formNotice:this.capacity?`Available capacity: ${this.capacity/Math.pow(10,i)} ${e}`:"ð« No Capacity Available",capacity:this.capacity,depositLogo:a,withdrawLogo:c,decimals:i,tokenChoices:this.tokenChoices}},capacity(){const t=this.maxSupply-this.currentSupply;return t<1e3?0:t},address(){return this.wallet&&this.wallet.publicKey?this.wallet.publicKey.toString():""},priorityFeeMicroLamports(){return this.priority==="Low"?1e6:this.priority==="High"?5e6:this.priority==="Turbo"?9e6:0},maxPriorityFee(){return this.priorityFeeMicroLamports*1.4/W2}},watch:{async address(){this.refreshAll()}},data(){return{unstake:!1,activePoolId:0,balance:{SOL:0,ySOL:0,USDC:0,yUSD:0},pools:[{address:"2wMDWx7a1PpbrsnNAHGJLPMgRs7H3pcYxqmmkQrzLxHg",id:0,stakeToken:"SOL",stakeTokenMint:"So11111111111111111111111111111111111111112",receiptToken:"ySOL",receiptTokenMint:"yso11zxLbHA3wBJ9HAtVu6wnesqz9A2qxnhxanasZ4N",decimals:9},{address:"Fm8E4fEAiRraWP2EhMfycyYzYdvNgzQiKUwhxCCUB4ho",id:1,stakeToken:"USDC",stakeTokenMint:"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",receiptToken:"yUSD",receiptTokenMint:"yUSDX7W89jXWn4zzDPLnhykDymSjQSmpaJ8e4fjC1fg",decimals:6}],priority:"Low",claims:[],stats:[],prices:[],showStats:!1,showPrices:!1,skipInterval:!1,showRain:!1,screenWidth:340}},methods:{toggleTab(){this.unstake=!this.unstake},async toggleStats(){this.showStats=!this.showStats,this.showStats&&(this.showPrices=!1)},async togglePrices(){this.showPrices=!this.showPrices,this.showPrices&&(this.showStats=!1)},async getBalances(){if(!this.address){this.balance.SOL=0,this.balance.ySOL=0,this.balance.USDC=0,this.balance.yUSD=0;return}const t=Bg.ySOL,e=Bg.USDC,n=Bg.yUSD,[r,i,s,o]=await Promise.all([this.solana.getBalance(this.address),this.solana.getTokenBalance(this.address,t),this.solana.getTokenBalance(this.address,e),this.solana.getTokenBalance(this.address,n)]);this.balance={SOL:r,ySOL:i,USDC:s,yUSD:o}},async refreshAll(){this.address?this.synatra.setWallet(this.wallet):this.synatra.removeWallet();const t=[this.refreshPools(),this.getClaims()];this.stats.length||t.push(this.getStats()),this.prices.length||(console.log("...getting prices"),t.push(this.getPrices())),await Promise.all(t),await this.getBalances()},async getStats(){let t;try{t=await this.synatra.getStats(),t&&(this.stats=t)}catch(e){console.log(e)}return t},async getPrices(){let t;try{t=await this.synatra.getPrices(),t&&(this.prices=Object.values(t))}catch(e){console.log(e)}return t},async refreshPools(){const t=await this.synatra.getPools();for(const e of t){if(e.id===void 0||!this.pools[e.id])continue;const n=Object.fromEntries(Object.entries(e).filter(([,r])=>r!==null));Object.assign(this.pools[e.id],n)}},async getClaims(){if(!this.address){this.claims=[];return}this.claims=await this.synatra.getClaims()},async handleStake(t){const e=this.synatra.stake(this.activePoolId,t);this.notify(e),await e,this.balance[this.activePool.stakeToken]-=t,setTimeout(this.refreshPools,1500),setTimeout(this.getClaims,1500),this.skipInterval=!0},async handleUnstake(t){const e=this.synatra.unstake(this.activePoolId,t);this.notify(e),await e,this.balance[this.activePool.receiptToken]-=t,setTimeout(this.refreshPools,1500),setTimeout(this.getClaims,1500),this.skipInterval=!0},updatePriority(t){this.priority=t,this.synatra.setPriorityFee(this.priorityFeeMicroLamports)},setPool(t){this.activePoolId=t},maybeRain(){Math.random()<.02&&(this.showRain=!0)},checkScreenWidth(){this.screenWidth=window.innerWidth},closeStats(){this.showStats=!1},closePrices(){this.showPrices=!1},notify(t){St.promise(t,{pending:"Transaction pending",success:{render(e){const n=`https://solscan.io/tx/${e.data}`;return ii("a",{href:n,target:"_blank",style:{display:"block",color:"white",textDecoration:"none"}},["Transaction confirmed",ii("div",{href:n,style:{fontSize:"14px"}},[n.slice(0,30)+"..."])])}},error:"Transaction failed"},{position:St.POSITION.BOTTOM_LEFT})}}},yY=t=>(ya("data-v-f2d1a5ad"),t=t(),va(),t),vY={class:"top-bar"},bY={class:"social-bar"},wY={class:"wallet"},_Y={class:"center-column"},kY={class:"center-row"},SY={class:"copyright"}
41,EY=yY(()=>ee("img",{class:"logo",src:dY},null,-1)),AY={class:"fs-12"},xY={class:"swimmer"};function RY(t,e,n,r,i,s){const o=mt("SocialBar"),a=mt("Claims"),c=mt("Wallet"),u=mt("Switch"),l=mt("TokenSwitch"),h=mt("Priority"),p=mt("PriceChart"),g=mt("Stats"),y=mt("Swap"),w=mt("Rain"),k=mt("Waves"),T=jm("tooltip");return he(),Ee(Ct,null,[ee("main",{onClick:e[2]||(e[2]=(...C)=>s.maybeRain&&s.maybeRain(...C))},[ee("div",vY,[ee("div",bY,[Pe(o)]),ee("div",wY,[i.prices.length?(he(),Ee("i",{key:0,class:"fa-solid fa-chart-line icon-link",onClick:e[0]||(e[0]=(...C)=>s.togglePrices&&s.togglePrices(...C))})):xt("",!0),i.stats.length?(he(),Ee("i",{key:1,class:"fa-solid fa-chart-simple icon-link",onClick:e[1]||(e[1]=(...C)=>s.toggleStats&&s.toggleStats(...C))})):xt("",!0),i.claims.length?(he(),gn(a,{key:2,claims:i.claims,pools:i.pools},null,8,["claims","pools"])):xt("",!0),Pe(c)])]),ee("div",_Y,[kr(Pe(u,{onToggle:s.toggleTab},null,8,["onToggle"]),[[T,"Deposit or withdraw from a pool"]]),ee("div",kY,[kr(Pe(l,{choices:s.tokenChoices,onToggleSwitch:s.setPool},null,8,["choices","onToggleSwitch"]),[[T,`Select pool to ${s.swapSettings.action}`]]),kr(Pe(h,{"onUpdate:selected":s.updatePriority},null,8,["onUpdate:selected"]),[[T,"Set higher to increase odds of tx confirmation"]])]),i.showPrices&&i.prices.length?(he(),gn(p,{key:0,prices:i.prices,pool:s.activePool,onClose:s.closePrices},null,8,["prices","pool","onClose"])):i.showStats&&i.stats.length?(he(),gn(g,{key:1,stats:s.activeStats,onClose:s.closeStats},null,8,["stats","onClose"])):(he(),gn(y,{key:2,settings:s.swapSettings,onStake:s.handleStake,onUnstake:s.handleUnstake,onDropdown:s.setPool},null,8,["settings","onStake","onUnstake","onDropdown"])),ee("div",SY,[EY,kr((he(),Ee("p",AY,[Qr("Built by Synatra")])),[[T,"we love solana"]])])])]),i.showRain&&i.screenWidth>=340?(he(),gn(w,{key:0})):xt("",!0),i.screenWidth>=340?(he(),gn(k,{key:1})):xt("",!0),kr(ee("div",xY,null,512),[[T,"splash splash"]])],64)}const TY=wn(mY,[["render",RY],["__scopeId","data-v-f2d1a5ad"]]),OY=["top","right","bottom","left"],hk=["start","end"],dk=OY.reduce((t,e)=>t.concat(e,e+"-"+hk[0],e+"-"+hk[1]),[]),Jo=Math.min,No=Math.max,IY={left:"r
41ight",right:"left",bottom:"top",top:"bottom"},CY={start:"end",end:"start"};function km(t,e,n){return No(t,Jo(e,n))}function Ta(t,e){return typeof t=="function"?t(e):t}function Fi(t){return t.split("-")[0]}function ui(t){return t.split("-")[1]}function bO(t){return t==="x"?"y":"x"}function I1(t){return t==="y"?"height":"width"}function pa(t){return["top","bottom"].includes(Fi(t))?"y":"x"}function C1(t){return bO(pa(t))}function wO(t,e,n){n===void 0&&(n=!1);const r=ui(t),i=C1(t),s=I1(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=zh(o)),[o,zh(o)]}function NY(t){const e=zh(t);return[Uh(t),e,Uh(e)]}function Uh(t){return t.replace(/start|end/g,e=>CY[e])}function PY(t,e,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?s:o;default:return[]}}function MY(t,e,n,r){const i=ui(t);let s=PY(Fi(t),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(Uh)))),s}function zh(t){return t.replace(/left|right|bottom|top/g,e=>IY[e])}function LY(t){return{top:0,right:0,bottom:0,left:0,...t}}function _O(t){return typeof t!="number"?LY(t):{top:t,right:t,bottom:t,left:t}}function Ou(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function pk(t,e,n){let{reference:r,floating:i}=t;const s=pa(e),o=C1(e),a=I1(o),c=Fi(e),u=s==="y",l=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,p=r[a]/2-i[a]/2;let g;switch(c){case"top":g={x:l,y:r.y-i.height};break;case"bottom":g={x:l,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:h};break;case"left":g={x:r.x-i.width,y:h};break;default:g={x:r.x,y:r.y}}switch(ui(e)){case"start":g[o]-=p*(n&&u?-1:1);break;case"end":g[o]+=p*(n&&u?-1:1);break}return g}const BY=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:l,y:h}=pk(u,r,c),p=r,g={},y=0;for(let w=0;w<a.length;w++){const{name:k,fn:T}=a[w],{x:C,y:O,data:I,reset:N}=await T({x:l,y:h,initialPlacement:r,placement:p,strategy:i,middlewareData:g,rects:u,platform:o,elements:{reference:t,floating:e}});l=C??l,h=O??h,g={...g,[k]:{...g[k],...I}},N&&y<=50&&(y++,typeof N=="object"&&(N.placement&&(p=N.placement),N.rects&&(u=N.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):N.rects),{x:l,y:h}=pk(u,p,c)),w=-1)}return{x:l,y:h,placement:p,strategy:i,middlewareData:g}};async function Gd(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:c}=t,{boundary:u="clippingAncestors",rootBoundary:l="viewport",elementContext:h="floating",altBoundary:p=!1,padding:g=0}=Ta(e,t),y=_O(g),k=a[p?h==="floating"?"reference":"floating":h],T=Ou(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(k)))==null||n?k:k.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:l,strategy:c})),C=h==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,O=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),I=await(s.isElement==null?void 0:s.isElement(O))?await(s.getScale==null?void 0:s.getScale(O))||{x:1,y:1}:{x:1,y:1},N=Ou(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:C,offsetParent:O,strategy:c}):C);return{top:(T.top-N.top+y.top)/I.y,bottom:(N.bottom-T.bottom+y.bottom)/I.y,left:(T.left-N.left+y.left)/I.x,right:(N.right-T.right+y.right)/I.x}}const DY=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:c}=e,{element:u,padding:l=0}=Ta(t,e)||{};if(u==null)return{};const h=_O(l),p={x:n,y:r},g=C1(i),y=I1(g),w=await o.getDimensions(u),k=g==="y",T=k?"top":"left",C=k?"bottom":"right",O=k?"clientHeight":"clientWidth",I=s.reference[y]+s.reference[g]-p[g]-s.floating[y],N=p[g]-s.reference[g],F=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let L=F?F[O]:0;
41(!L||!await(o.isElement==null?void 0:o.isElement(F)))&&(L=a.floating[O]||s.floating[y]);const D=I/2-N/2,H=L/2-w[y]/2-1,z=Jo(h[T],H),K=Jo(h[C],H),_=z,m=L-w[y]-K,f=L/2-w[y]/2+D,d=km(_,f,m),v=!c.arrow&&ui(i)!=null&&f!==d&&s.reference[y]/2-(f<_?z:K)-w[y]/2<0,b=v?f<_?f-_:f-m:0;return{[g]:p[g]+b,data:{[g]:d,centerOffset:f-d-b,...v&&{alignmentOffset:b}},reset:v}}});function $Y(t,e,n){return(t?[...n.filter(i=>ui(i)===t),...n.filter(i=>ui(i)!==t)]:n.filter(i=>Fi(i)===i)).filter(i=>t?ui(i)===t||(e?Uh(i)!==i:!1):!0)}const FY=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,r,i;const{rects:s,middlewareData:o,placement:a,platform:c,elements:u}=e,{crossAxis:l=!1,alignment:h,allowedPlacements:p=dk,autoAlignment:g=!0,...y}=Ta(t,e),w=h!==void 0||p===dk?$Y(h||null,g,p):p,k=await Gd(e,y),T=((n=o.autoPlacement)==null?void 0:n.index)||0,C=w[T];if(C==null)return{};const O=wO(C,s,await(c.isRTL==null?void 0:c.isRTL(u.floating)));if(a!==C)return{reset:{placement:w[0]}};const I=[k[Fi(C)],k[O[0]],k[O[1]]],N=[...((r=o.autoPlacement)==null?void 0:r.overflows)||[],{placement:C,overflows:I}],F=w[T+1];if(F)return{data:{index:T+1,overflows:N},reset:{placement:F}};const L=N.map(z=>{const K=ui(z.placement);return[z.placement,K&&l?z.overflows.slice(0,2).reduce((_,m)=>_+m,0):z.overflows[0],z.overflows]}).sort((z,K)=>z[1]-K[1]),H=((i=L.filter(z=>z[2].slice(0,ui(z[0])?2:3).every(K=>K<=0))[0])==null?void 0:i[0])||L[0][0];return H!==a?{data:{index:T+1,overflows:N},reset:{placement:H}}:{}}}},UY=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:c,elements:u}=e,{mainAxis:l=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:w=!0,...k}=Ta(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const T=Fi(i),C=pa(a),O=Fi(a)===a,I=await(c.isRTL==null?void 0:c.isRTL(u.floating)),N=p||(O||!w?[zh(a)]:NY(a)),F=y!=="none";!p&&F&&N.push(...MY(a,w,y,I));const L=[a,...N],D=await Gd(e,k),H=[];let z=((r=s.flip)==null?void 0:r.overflows)||[];if(l&&H.push(D[T]),h){const f=wO(i,o,I);H.push(D[f[0]],D[f[1]])}if(z=[...z,{placement:i,overflows:H}],!H.every(f=>f<=0)){var K,_;const f=(((K=s.flip)==null?void 0:K.index)||0)+1,d=L[f];if(d)return{data:{index:f,overflows:z},reset:{placement:d}};let v=(_=z.filter(b=>b.overflows[0]<=0).sort((b,E)=>b.overflows[1]-E.overflows[1])[0])==null?void 0:_.placement;if(!v)switch(g){case"bestFit":{var m;const b=(m=z.filter(E=>{if(F){const x=pa(E.placement);return x===C||x==="y"}return!0}).map(E=>[E.placement,E.overflows.filter(x=>x>0).reduce((x,M)=>x+M,0)]).sort((E,x)=>E[1]-x[1])[0])==null?void 0:m[0];b&&(v=b);break}case"initialPlacement":v=a;break}if(i!==v)return{reset:{placement:v}}}return{}}}};async function zY(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Fi(n),a=ui(n),c=pa(n)==="y",u=["left","top"].includes(o)?-1:1,l=s&&c?-1:1,h=Ta(e,t);let{mainAxis:p,crossAxis:g,alignmentAxis:y}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...h};return a&&typeof y=="number"&&(g=a==="end"?y*-1:y),c?{x:g*l,y:p*u}:{x:p*u,y:g*l}}const HY=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=e,c=await zY(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:o}}}}},WY=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:k=>{let{x:T,y:C}=k;return{x:T,y:C}}},...c}=Ta(t,e),u={x:n,y:r},l=await Gd(e,c),h=pa(Fi(i)),p=bO(h);let g=u[p],y=u[h];if(s){const k=p==="y"?"top":"left",T=p==="y"?"bottom":"right",C=g+l[k],O=g-l[T];g=km(C,g,O)}if(o){const k=h==="y"?"top":"left",T=h==="y"?"bottom":"right",C=y+l[k],O=y-l[T];y=km(C,y,O)}const w=a.fn({...e,[p]:g,[h]:y});return{...w,data:{x:w.x-n,y:w.y-r}}}}},jY=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:i,elements:s}=e,{apply:o=()=>{},...a}=Ta(t,e),c=await Gd(e,a),u=Fi(n),l=ui(n),h=pa(n)==="y",{width:p,height:g}=r.floating;let y,w;u==="top"||u==="bottom"?(y=u,w=l===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(w=u,y=l==="end"?"top":"bottom");const k=g-c.top-c.bottom,T=p-c.left-c.right,C=Jo(g-c[y],k),O=Jo(p-c[w],T),I=!e.middlewareData.shift;let N=C,F=O;if(h?F=l||I?Jo(O,T):T:N=l||I?Jo(C,k):k,I&&!l){const D=No(c.left,0),H=No(c.right,0),z=No(c.top,0),K=No(c.bottom,0);h?F=p-2*(D!==0||H!==0?D+H:No(c.left,c.right)):N=g-2*(z!==0||K!==0?z+K:No(c.top,c.bottom))}await o({...e,availableWidth:F,availableHeight:N});const L=await i.getDimensions(s.floating);return p!==L.width||g!==L.height?{reset:{rects:!0}}:{}}}};function zr(t){var e;return((e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Mi(t){return zr(t).getComputedStyle(t)}const gk=Math.min,Iu=Math.max,Hh=Math.round;function kO(t){const e=Mi(t);let n=parseFloat(e.width),r=parseFloat(e.height);const i=t.offsetWidth,s=t.offsetHeight,o=Hh(n)!==i||Hh(r)!==s;return o&&(n=i,r=s),{width:n,height:r,fallback:o}}
41function fo(t){return EO(t)?(t.nodeName||"").toLowerCase():""}let bf;function SO(){if(bf)return bf;const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?(bf=t.brands.map(e=>e.brand+"/"+e.version).join(" "),bf):navigator.userAgent}function Li(t){return t instanceof zr(t).HTMLElement}function no(t){return t instanceof zr(t).Element}function EO(t){return t instanceof zr(t).Node}function mk(t){return typeof ShadowRoot>"u"?!1:t instanceof zr(t).ShadowRoot||t instanceof ShadowRoot}function Yd(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=Mi(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function KY(t){return["table","td","th"].includes(fo(t))}function Sm(t){const e=/firefox/i.test(SO()),n=Mi(t),r=n.backdropFilter||n.WebkitBackdropFilter;return n.transform!=="none"||n.perspective!=="none"||!!r&&r!=="none"||e&&n.willChange==="filter"||e&&!!n.filter&&n.filter!=="none"||["transform","perspective"].some(i=>n.willChange.includes(i))||["paint","layout","strict","content"].some(i=>{const s=n.contain;return s!=null&&s.includes(i)})}function AO(){return!/^((?!chrome|android).)*safari/i.test(SO())}function N1(t){return["html","body","#document"].includes(fo(t))}function xO(t){return no(t)?t:t.contextElement}const RO={x:1,y:1};function ic(t){const e=xO(t);if(!Li(e))return RO;const n=e.getBoundingClientRect(),{width:r,height:i,fallback:s}=kO(e);let o=(s?Hh(n.width):n.width)/r,a=(s?Hh(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),a&&Number.isFinite(a)||(a=1),{x:o,y:a}}function ll(t,e,n,r){var i,s;e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),a=xO(t);let c=RO;e&&(r?no(r)&&(c=ic(r)):c=ic(t));const u=a?zr(a):window,l=!AO()&&n;
41let h=(o.left+(l&&((i=u.visualViewport)==null?void 0:i.offsetLeft)||0))/c.x,p=(o.top+(l&&((s=u.visualViewport)==null?void 0:s.offsetTop)||0))/c.y,g=o.width/c.x,y=o.height/c.y;if(a){const w=zr(a),k=r&&no(r)?zr(r):r;let T=w.frameElement;for(;T&&r&&k!==w;){const C=ic(T),O=T.getBoundingClientRect(),I=getComputedStyle(T);O.x+=(T.clientLeft+parseFloat(I.paddingLeft))*C.x,O.y+=(T.clientTop+parseFloat(I.paddingTop))*C.y,h*=C.x,p*=C.y,g*=C.x,y*=C.y,h+=O.x,p+=O.y,T=zr(T).frameElement}}return{width:g,height:y,top:p,right:h+g,bottom:p+y,left:h,x:h,y:p}}function ro(t){return((EO(t)?t.ownerDocument:t.document)||window.document).documentElement}function Zd(t){return no(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function TO(t){return ll(ro(t)).left+Zd(t).scrollLeft}function fl(t){if(fo(t)==="html")return t;const e=t.assignedSlot||t.parentNode||mk(t)&&t.host||ro(t);return mk(e)?e.host:e}function OO(t){const e=fl(t);return N1(e)?e.ownerDocument.body:Li(e)&&Yd(e)?e:OO(e)}function Wh(t,e){var n;e===void 0&&(e=[]);const r=OO(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),s=zr(r);return i?e.concat(s,s.visualViewport||[],Yd(r)?r:[]):e.concat(r,Wh(r))}function yk(t,e,n){return e==="viewport"?Ou(function(r,i){const s=zr(r),o=ro(r),a=s.visualViewport;let c=o.clientWidth,u=o.clientHeight,l=0,h=0;if(a){c=a.width,u=a.height;const p=AO();(p||!p&&i==="fixed")&&(l=a.offsetLeft,h=a.offsetTop)}return{width:c,height:u,x:l,y:h}}(t,n)):no(e)?Ou(function(r,i){const s=ll(r,!0,i==="fixed"),o=s.top+r.clientTop,a=s.left+r.clientLeft,c=Li(r)?ic(r):{x:1,y:1};return{width:r.clientWidth*c.x,height:r.clientHeight*c.y,x:a*c.x,y:o*c.y}}(e,n)):Ou(function(r){const i=ro(r),s=Zd(r),o=r.ownerDocument.body,a=Iu(i.scrollWidth,i.clientWidth,o.scrollWidth,o.clientWidth),c=Iu(i.scrollHeight,i.clientHeight,o.scrollHeight,o.clientHeight);let u=-s.scrollLeft+TO(r);const l=-s.scrollTop;return Mi(o).direction==="rtl"&&(u+=Iu(i.clientWidth,o.clientWidth)-a),{width:a,height:c,x:u,y:l}}(ro(t)))}function vk(t){return Li(t)&&Mi(t).position!=="fixed"?t.offsetParent:null}function bk(t){const e=zr(t);let n=vk(t);for(;n&&KY(n)&&Mi(n).position==="static";)n=vk(n);return n&&(fo(n)==="html"||fo(n)==="body"&&Mi(n).position==="static"&&!Sm(n))?e:n||function(r){let i=fl(r);for(;Li(i)&&!N1(i);){if(Sm(i))return i;i=fl(i)}return null}(t)||e}function VY(t,e,n){const r=Li(e),i=ro(e),s=ll(t,!0,n==="fixed",e);let o={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(r||!r&&n!=="fixed")if((fo(e)!=="body"||Yd(i))&&(o=Zd(e)),Li(e)){const c=ll(e,!0);a.x=c.x+e.clientLeft,a.y=c.y+e.clientTop}else i&&(a.x=TO(i));return{x:s.left+o.scrollLeft-a.x,y:s.top+o.scrollTop-a.y,width:s.width,height:s.height}}const qY={getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=n==="clippingAncestors"?function(u,l){const h=l.get(u);if(h)return h;let p=Wh(u).filter(k=>no(k)&&fo(k)!=="body"),g=null;const y=Mi(u).position==="fixed";let w=y?fl(u):u;for(;no(w)&&!N1(w);){const k=Mi(w),T=Sm(w);(y?T||g:T||k.position!=="static"||!g||!["absolute","fixed"].includes(g.position))?g=k:p=p.filter(C=>C!==w),w=fl(w)}return l.set(u,p),p}(e,this._c):[].concat(n),o=[...s,r],a=o[0],c=o.reduce((u,l)=>{const h=yk(e,l,i);return u.top=Iu(h.top,u.top),u.right=gk(h.right,u.right),u.bottom=gk(h.bottom,u.bottom),u.left=Iu(h.left,u.left),u},yk(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:n,strategy:r}=t;const i=Li(n),s=ro(n);if(n===s)return e;let o={scrollLeft:0,scrollTop:0},a={x:1,y:1};const c={x:0,y:0};if((i||!i&&r!=="fixed")&&((fo(n)!=="body"||Yd(s))&&(o=Zd(n)),Li(n))){const u=ll(n);a=ic(n),c.x=u.x+n.clientLeft,c.y=u.y+n.clientTop}return{width:e.width*a.x,height:e.height*a.y,x:e.x*a.x-o.scrollLeft*a.x+c.x,y:e.y*a.y-o.scrollTop*a.y+c.y}},isElement:no,getDimensions:function(t){return Li(t)?kO(t):t.getBoundingClientRect()},getOffsetParent:bk,getDocumentElement:ro,getScale:ic,async getElementRects(t){let{reference:e,floating:n,strategy:r}=t;const i=this.getOffsetParent||bk,s=this.getDimensions;return{reference:VY(e,await i(n),r),floating:{x:0,y:0,...await s(n)}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>Mi(t).direction==="rtl"},GY=(t,e,n)=>{const r=new Map,i={platform:qY,...n},s={...i.platform,_c:r};return BY(t,e,{...i,platform:s})};function IO(t,e){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(typeof e[n]=="object"&&t[n]?IO(t[n],e[n]):t[n]=e[n])}const li={disabled:!1,distance:5,skidding:0,container:"body",boundary:void 0,instantMove:!1,disposeTimeout:150,popperTriggers:[],strategy:"absolute",preventOverflow:!0,flip:!0,shift:!0,overflowPadding:0,arrowPadding:0,arrowOverflow:!0,autoHideOnMousedown:!1,themes:{tooltip:{placement:"top",triggers:["hover","focus","touch"],hideTriggers:t=>[...t,"click"],delay:{show:200,hide:0},handleResize:!1,html:!1,loadingContent:"..."},dropdown:{placement:"bottom",triggers:["click"],delay:0,handleResize:!0,autoHide:!0},menu:{$extend:"dropdown",triggers:["hover","focus"],popperTriggers:["hover"],delay:{show:0,hide:400}}}};function hl(t,e){let n=li.themes[t]||{},r;do r=n[e],typeof r>"u"?n.$extend?n=li.themes[n.$extend]||{}:(n=null,r=li[e]):n=null;while(n);return r}
41function YY(t){const e=[t];let n=li.themes[t]||{};do n.$extend&&!n.$resetCss?(e.push(n.$extend),n=li.themes[n.$extend]||{}):n=null;while(n);return e.map(r=>`v-popper--theme-${r}`)}function wk(t){const e=[t];let n=li.themes[t]||{};do n.$extend?(e.push(n.$extend),n=li.themes[n.$extend]||{}):n=null;while(n);return e}let Sc=!1;if(typeof window<"u"){Sc=!1;try{const t=Object.defineProperty({},"passive",{get(){Sc=!0}});window.addEventListener("test",null,t)}catch{}}let CO=!1;typeof window<"u"&&typeof navigator<"u"&&(CO=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream);const NO=["auto","top","bottom","left","right"].reduce((t,e)=>t.concat([e,`${e}-start`,`${e}-end`]),[]),_k={hover:"mouseenter",focus:"focus",click:"click",touch:"touchstart",pointer:"pointerdown"},kk={hover:"mouseleave",focus:"blur",click:"click",touch:"touchend",pointer:"pointerup"};function Sk(t,e){const n=t.indexOf(e);n!==-1&&t.splice(n,1)}function Dg(){return new Promise(t=>requestAnimationFrame(()=>{requestAnimationFrame(t)}))}const ni=[];let To=null;const Ek={};function Ak(t){let e=Ek[t];return e||(e=Ek[t]=[]),e}let Em=function(){};typeof window<"u"&&(Em=window.Element);function nt(t){return function(e){return hl(e.theme,t)}}const $g="__floating-vue__popper",PO=()=>dr({name:"VPopper",provide(){return{[$g]:{parentPopper:this}}},inject:{[$g]:{default:null}},props:{theme:{type:String,required:!0},targetNodes:{type:Function,required:!0},referenceNode:{type:Function,default:null},popperNode:{type:Function,required:!0},shown:{type:Boolean,default:!1},showGroup:{type:String,default:null},ariaId:{default:null},disabled:{type:Boolean,default:nt("disabled")},positioningDisabled:{type:Boolean,default:nt("positioningDisabled")},placement:{type:String,default:nt("placement"),validator:t=>NO.includes(t)},delay:{type:[String,Number,Object],default:nt("delay")},distance:{type:[Number,String],default:nt("distance")},skidding:{type:[Number,String],default:nt("skidding")},triggers:{type:Array,default:nt("triggers")},showTriggers:{type:[Array,Function],default:nt("showTriggers")},hideTriggers:{type:[Array,Function],default:nt("hideTriggers")},popperTriggers:{type:Array,default:nt("popperTriggers")},popperShowTriggers:{type:[Array,Function],default:nt("popperShowTriggers")},popperHideTriggers:{type:[Array,Function],default:nt("popperHideTriggers")},container:{type:[String,Object,Em,Boolean],default:nt("container")},boundary:{type:[String,Em],default:nt("boundary")},strategy:{type:String,validator:t=>["absolute","fixed"].includes(t),default:nt("strategy")},autoHide:{type:[Boolean,Function],default:nt("autoHide")},handleResize:{type:Boolean,default:nt("handleResize")},instantMove:{type:Boolean,default:nt("instantMove")},eagerMount:{type:Boolean,default:nt("eagerMount")},popperClass:{type:[String,Array,Object],default:nt("popperClass")},computeTransformOrigin:{type:Boolean,default:nt("computeTransformOrigin")},autoMinSize:{type:Boolean,default:nt("autoMinSize")},autoSize:{type:[Boolean,String],default:nt("autoSize")},autoMaxSize:{type:Boolean,default:nt("autoMaxSize")},autoBoundaryMaxSize:{type:Boolean,default:nt("autoBoundaryMaxSize")},preventOverflow:{type:Boolean,default:nt("preventOverflow")},overflowPadding:{type:[Number,String],default:nt("overflowPadding")},arrowPadding:{type:[Number,String],default:nt("arrowPadding")},arrowOverflow:{type:Boolean,default:nt("arrowOverflow")},flip:{type:Boolean,default:nt("flip")},shift:{type:Boolean,default:nt("shift")},shiftCrossAxis:{type:Boolean,default:nt("shiftCrossAxis")},noAutoFocus:{type:Boolean,default:nt("noAutoFocus")},disposeTimeout:{type:Number,default:nt("disposeTimeout")}},emits:{show:()=>!0,hide:()=>!0,"update:shown":t=>!0,"apply-show":()=>!0,"apply-hide":()=>!0,"close-group":()=>!0,"close-directive":()=>!0,"auto-hide":()=>!0,resize:()=>!0},data(){return{isShown:!1,isMounted:!1,skipTransition:!1,classes:{showFrom:!1,showTo:!1,hideFrom:!1,hideTo:!0},result:{x:0,y:0,placement:"",strategy:this.strategy,arrow:{x:0,y:0,centerOffset:0},transformOrigin:null},randomId:`popper_${[Math.random(),Date.now()].map(t=>t.toString(36).substring(2,10)).join("_")}`,shownChildren:new Set,lastAutoHide:!0,pendingHide:!1,containsGlobalTarget:!1,isDisposed:!0,mouseDownContains:!1}
41},computed:{popperId(){return this.ariaId!=null?this.ariaId:this.randomId},shouldMountContent(){return this.eagerMount||this.isMounted},slotData(){return{popperId:this.popperId,isShown:this.isShown,shouldMountContent:this.shouldMountContent,skipTransition:this.skipTransition,autoHide:typeof this.autoHide=="function"?this.lastAutoHide:this.autoHide,show:this.show,hide:this.hide,handleResize:this.handleResize,onResize:this.onResize,classes:{...this.classes,popperClass:this.popperClass},result:this.positioningDisabled?null:this.result,attrs:this.$attrs}},parentPopper(){var t;return(t=this[$g])==null?void 0:t.parentPopper},hasPopperShowTriggerHover(){var t,e;return((t=this.popperTriggers)==null?void 0:t.includes("hover"))||((e=this.popperShowTriggers)==null?void 0:e.includes("hover"))}},watch:{shown:"$_autoShowHide",disabled(t){t?this.dispose():this.init()},async container(){this.isShown&&(this.$_ensureTeleport(),await this.$_computePosition())},triggers:{handler:"$_refreshListeners",deep:!0},positioningDisabled:"$_refreshListeners",...["placement","distance","skidding","boundary","strategy","overflowPadding","arrowPadding","preventOverflow","shift","shiftCrossAxis","flip"].reduce((t,e)=>(t[e]="$_computePosition",t),{})},created(){this.autoMinSize&&console.warn('[floating-vue] `autoMinSize` option is deprecated. Use `autoSize="min"` instead.'),this.autoMaxSize&&console.warn("[floating-vue] `autoMaxSize` option is deprecated. Use `autoBoundaryMaxSize` instead.")},mounted(){this.init(),this.$_detachPopperNode()},activated(){this.$_autoShowHide()},deactivated(){this.hide()},beforeUnmount(){this.dispose()},methods:{show({event:t=null,skipDelay:e=!1,force:n=!1}={}){var r,i;(r=this.parentPopper)!=null&&r.lockedChild&&this.parentPopper.lockedChild!==this||(this.pendingHide=!1,(n||!this.disabled)&&(((i=this.parentPopper)==null?void 0:i.lockedChild)===this&&(this.parentPopper.lockedChild=null),this.$_scheduleShow(t,e),this.$emit("show"),this.$_showFrameLocked=!0,requestAnimationFrame(()=>{this.$_showFrameLocked=!1})),this.$emit("update:shown",!0))},hide({event:t=null,skipDelay:e=!1}={}){var n;if(!this.$_hideInProgress){if(this.shownChildren.size>0){this.pendingHide=!0;return}if(this.hasPopperShowTriggerHover&&this.$_isAimingPopper()){this.parentPopper&&(this.parentPopper.lockedChild=this,clearTimeout(this.parentPopper.lockedChildTimer),this.parentPopper.lockedChildTimer=setTimeout(()=>{this.parentPopper.lockedChild===this&&(this.parentPopper.lockedChild.hide({skipDelay:e}),this.parentPopper.lockedChild=null)},1e3));return}((n=this.parentPopper)==null?void 0:n.lockedChild)===this&&(this.parentPopper.lockedChild=null),this.pendingHide=!1,this.$_scheduleHide(t,e),this.$emit("hide"),this.$emit("update:shown",!1)}},init(){var t;this.isDisposed&&(this.isDisposed=!1,this.isMounted=!1,this.$_events=[],this.$_preventShow=!1,this.$_referenceNode=((t=this.referenceNode)==null?void 0:t.call(this))??this.$el,this.$_targetNodes=this.targetNodes().filter(e=>e.nodeType===e.ELEMENT_NODE),this.$_popperNode=this.popperNode(),this.$_innerNode=this.$_popperNode.querySelector(".v-popper__inner"),this.$_arrowNode=this.$_popperNode.querySelector(".v-popper__arrow-container"),this.$_swapTargetAttrs("title","data-original-title"),this.$_detachPopperNode(),this.triggers.length&&this.$_addEventListeners(),this.shown&&this.show())},dispose(){this.isDisposed||(this.isDisposed=!0,this.$_removeEventListeners(),this.hide({skipDelay:!0}),this.$_detachPopperNode(),this.isMounted=!1,this.isShown=!1,this.$_updateParentShownChildren(!1),this.$_swapTargetAttrs("data-original-title","title"))},async onResize(){this.isShown&&(await this.$_computePosition(),this.$emit("resize"))},async $_computePosition(){if(this.isDisposed||this.positioningDisabled)return;const t={strategy:this.strategy,middleware:[]};(this.distance||this.skidding)&&t.middleware.push(HY({mainAxis:this.distance,crossAxis:this.skidding}));const e=this.placement.startsWith("auto");if(e?t.middleware.push(FY({alignment:this.placement.split("-")[1]??""})):t.placement=this.placement,this.preventOverflow&&(this.shift&&t.middleware.push(WY({padding:this.overflowPadding,boun
41dary:this.boundary,crossAxis:this.shiftCrossAxis})),!e&&this.flip&&t.middleware.push(UY({padding:this.overflowPadding,boundary:this.boundary}))),t.middleware.push(DY({element:this.$_arrowNode,padding:this.arrowPadding})),this.arrowOverflow&&t.middleware.push({name:"arrowOverflow",fn:({placement:r,rects:i,middlewareData:s})=>{let o;const{centerOffset:a}=s.arrow;return r.startsWith("top")||r.startsWith("bottom")?o=Math.abs(a)>i.reference.width/2:o=Math.abs(a)>i.reference.height/2,{data:{overflow:o}}}}),this.autoMinSize||this.autoSize){const r=this.autoSize?this.autoSize:this.autoMinSize?"min":null;t.middleware.push({name:"autoSize",fn:({rects:i,placement:s,middlewareData:o})=>{var a;if((a=o.autoSize)!=null&&a.skip)return{};let c,u;return s.startsWith("top")||s.startsWith("bottom")?c=i.reference.width:u=i.reference.height,this.$_innerNode.style[r==="min"?"minWidth":r==="max"?"maxWidth":"width"]=c!=null?`${c}px`:null,this.$_innerNode.style[r==="min"?"minHeight":r==="max"?"maxHeight":"height"]=u!=null?`${u}px`:null,{data:{skip:!0},reset:{rects:!0}}}})}(this.autoMaxSize||this.autoBoundaryMaxSize)&&(this.$_innerNode.style.maxWidth=null,this.$_innerNode.style.maxHeight=null,t.middleware.push(jY({boundary:this.boundary,padding:this.overflowPadding,apply:({availableWidth:r,availableHeight:i})=>{this.$_innerNode.style.maxWidth=r!=null?`${r}px`:null,this.$_innerNode.style.maxHeight=i!=null?`${i}px`:null}})));const n=await GY(this.$_referenceNode,this.$_popperNode,t);Object.assign(this.result,{x:n.x,y:n.y,placement:n.placement,strategy:n.strategy,arrow:{...n.middlewareData.arrow,...n.middlewareData.arrowOverflow}})},$_scheduleShow(t,e=!1){if(this.$_updateParentShownChildren(!0),this.$_hideInProgress=!1,clearTimeout(this.$_scheduleTimer),To&&this.instantMove&&To.instantMove&&To!==this.parentPopper){To.$_applyHide(!0),this.$_applyShow(!0);return}e?this.$_applyShow():this.$_scheduleTimer=setTimeout(this.$_applyShow.bind(this),this.$_computeDelay("show"))},$_scheduleHide(t,e=!1){if(this.shownChildren.size>0){this.pendingHide=!0;return}this.$_updateParentShownChildren(!1),this.$_hideInProgress=!0,clearTimeout(this.$_scheduleTimer),this.isShown&&(To=this),e?this.$_applyHide():this.$_scheduleTimer=setTimeout(this.$_applyHide.bind(this),this.$_computeDelay("hide"))},$_computeDelay(t){const e=this.delay;return parseInt(e&&e[t]||e||0)},async $_applyShow(t=!1){clearTimeout(this.$_disposeTimer),clearTimeout(this.$_scheduleTimer),this.skipTransition=t,!this.isShown&&(this.$_ensureTeleport(),await Dg(),await this.$_computePosition(),await this.$_applyShowEffect(),this.positioningDisabled||this.$_registerEventListeners([...Wh(this.$_referenceNode),...Wh(this.$_popperNode)],"scroll",()=>{this.$_computePosition()}))},async $_applyShowEffect(){if(this.$_hideInProgress)return;if(this.computeTransformOrigin){const e=this.$_referenceNode.getBoundingClientRect(),n=this.$_popperNode.querySelector(".v-popper__wrapper"),r=n.parentNode.getBoundingClientRect(),i=e.x+e.width/2-(r.left+n.offsetLeft),s=e.y+e.height/2-(r.top+n.offsetTop);this.result.transformOrigin=`${i}px ${s}px`}this.isShown=!0,this.$_applyAttrsToTarget({"aria-describedby":this.popperId,"data-popper-shown":""});const t=this.showGroup;if(t){let e;for(let n=0;n<ni.length;n++)e=ni[n],e.showGroup!==t&&(e.hide(),e.$emit("close-group"))}ni.push(this),document.body.classList.add("v-popper--some-open");for(const e of wk(this.theme))Ak(e).push(this),document.body.classList.add(`v-popper--some-open--${e}`);this.$emit("apply-show"),this.classes.showFrom=!0,this.classes.showTo=!1,this.classes.hideFrom=!1,this.classes.hideTo=!1,await Dg(),this.classes.showFrom=!1,this.classes.showTo=!0,this.noAutoFocus||this.$_popperNode.focus()},async $_applyHide(t=!1){if(this.shownChildren.size>0){this.pendingHide=!0,this.$_hideInProgress=!1;return}if(clearTimeout(this.$_scheduleTimer),!this.isShown)return;this.skipTransition=t,Sk(ni,this),ni.length===0&&document.body.classList.remove("v-popper--some-open");for(const n of wk(this.theme)){const r=Ak(n);Sk(r,this),r.length===0&&document.body.classList.remove(`v-popper--some-open--${n}`)}To===this&&(To=null),this.isShown=!1,this.$_applyAttrsToTarget({"aria-describedby":void 0,"data-popper-shown":void 0}),clearTimeout(this.$_disposeTimer);const e=this.disposeTimeout;e!==null&&(this.$_disposeTimer=setTimeout(()=>{this.$_popperNode&&(this.$_detachPopperNode(),this.isMounted=!1)},e)),this.$_removeEventListeners("scroll"),this.$emit("apply-hide"),this.classes.showFrom=!1,this.classes.showTo=!1,this.classes.hideFrom=!0,this.classes.hideTo=!1,await Dg(),this.classes.hideFrom=!1,this.classes.hideTo=!0},$_autoShowHide(){this.shown?this.show():this.hide()},$_ensureTeleport(){if(this.isDisposed)return;let t=this.container;if(typeof t=="string"?t=window.document.querySelector(t):t===!1&&(t=this.$_targetNodes[0].parentNode),!t)throw new Error("No container for popover: "+this.container);t.appendChild(this.$_popperNode),this.isMounted=!0},$_addEventListeners(){const t=n=>{this.isShown&&!this.$_hideInProgress||(n.usedByTooltip=!0,!this.$_preventShow&&this.show({event:n}))};this.$_registerTriggerListeners(this.$_targetNodes,_k,this.triggers,this.showTriggers,t),this.$_registerTriggerListeners([this.$_popperNode],_k,this.popperTriggers,this.popperShowTriggers,t);const e=n=>{n.usedByTooltip||this.hide({event:n})};this.$_registerTriggerListeners(this.$_targetNodes,kk,this.triggers,this.hideTriggers,e),this.$_registerTriggerListeners([this.$_popperNode],kk,this.popperTriggers,this.popperHideTriggers,e)},$_registerEventListeners(t,e,n){this.$_events.push({targetNodes:t,eventType:e,handler:n}),t.forEach(r=>r.addEventListener(e,n,Sc?{passive:!0}:void 0))},$_registerTriggerListeners(t,e,n,r,i){let s=n;
41r!=null&&(s=typeof r=="function"?r(s):r),s.forEach(o=>{const a=e[o];a&&this.$_registerEventListeners(t,a,i)})},$_removeEventListeners(t){const e=[];this.$_events.forEach(n=>{const{targetNodes:r,eventType:i,handler:s}=n;!t||t===i?r.forEach(o=>o.removeEventListener(i,s)):e.push(n)}),this.$_events=e},$_refreshListeners(){this.isDisposed||(this.$_removeEventListeners(),this.$_addEventListeners())},$_handleGlobalClose(t,e=!1){this.$_showFrameLocked||(this.hide({event:t}),t.closePopover?this.$emit("close-directive"):this.$emit("auto-hide"),e&&(this.$_preventShow=!0,setTimeout(()=>{this.$_preventShow=!1},300)))},$_detachPopperNode(){this.$_popperNode.parentNode&&this.$_popperNode.parentNode.removeChild(this.$_popperNode)},$_swapTargetAttrs(t,e){for(const n of this.$_targetNodes){const r=n.getAttribute(t);r&&(n.removeAttribute(t),n.setAttribute(e,r))}},$_applyAttrsToTarget(t){for(const e of this.$_targetNodes)for(const n in t){const r=t[n];r==null?e.removeAttribute(n):e.setAttribute(n,r)}},$_updateParentShownChildren(t){let e=this.parentPopper;for(;e;)t?e.shownChildren.add(this.randomId):(e.shownChildren.delete(this.randomId),e.pendingHide&&e.hide()),e=e.parentPopper},$_isAimingPopper(){const t=this.$_referenceNode.getBoundingClientRect();if(Cu>=t.left&&Cu<=t.right&&Nu>=t.top&&Nu<=t.bottom){const e=this.$_popperNode.getBoundingClientRect(),n=Cu-Ns,r=Nu-Ps,i=e.left+e.width/2-Ns+(e.top+e.height/2)-Ps+e.width+e.height,s=Ns+n*i,o=Ps+r*i;return wf(Ns,Ps,s,o,e.left,e.top,e.left,e.bottom)||wf(Ns,Ps,s,o,e.left,e.top,e.right,e.top)||wf(Ns,Ps,s,o,e.right,e.top,e.right,e.bottom)||wf(Ns,Ps,s,o,e.left,e.bottom,e.right,e.bottom)}return!1}},render(){return this.$slots.default(this.slotData)}});if(typeof document<"u"&&typeof window<"u"){if(CO){const t=Sc?{passive:!0,capture:!0}:!0;document.addEventListener("touchstart",e=>xk(e,!0),t),document.addEventListener("touchend",e=>Rk(e,!0),t)}else window.addEventListener("mousedown",t=>xk(t,!1),!0),window.addEventListener("click",t=>Rk(t,!1),!0);window.addEventListener("resize",XY)}function xk(t,e){if(li.autoHideOnMousedown)MO(t,e);else for(let n=0;n<ni.length;n++){const r=ni[n];try{r.mouseDownContains=r.popperNode().contains(t.target)}catch{}}}function Rk(t,e){li.autoHideOnMousedown||MO(t,e)}function MO(t,e){const n={};for(let r=ni.length-1;r>=0;r--){const i=ni[r];try{const s=i.containsGlobalTarget=i.mouseDownContains||i.popperNode().contains(t.target);i.pendingHide=!1,requestAnimationFrame(()=>{if(i.pendingHide=!1,!n[i.randomId]&&Tk(i,s,t)){if(i.$_handleGlobalClose(t,e),!t.closeAllPopover&&t.closePopover&&s){let a=i.parentPopper;for(;a;)n[a.randomId]=!0,a=a.parentPopper;return}let o=i.parentPopper;for(;o&&Tk(o,o.containsGlobalTarget,t);)o.$_handleGlobalClose(t,e),o=o.parentPopper}})}catch{}}}function Tk(t,e,n){return n.closeAllPopover||n.closePopover&&e||ZY(t,n)&&!e}function ZY(t,e){if(typeof t.autoHide=="function"){const n=t.autoHide(e);return t.lastAutoHide=n,n}return t.autoHide}function XY(){for(let t=0;t<ni.length;t++)ni[t].$_computePosition()}let Ns=0,Ps=0,Cu=0,Nu=0;typeof window<"u"&&window.addEventListener("mousemove",t=>{Ns=Cu,Ps=Nu,Cu=t.clientX,Nu=t.clientY},Sc?{passive:!0}:void 0);function wf(t,e,n,r,i,s,o,a){const c=((o-i)*(e-s)-(a-s)*(t-i))/((a-s)*(n-t)-(o-i)*(r-e)),u=((n-t)*(e-s)-(r-e)*(t-i))/((a-s)*(n-t)-(o-i)*(r-e));return c>=0&&c<=1&&u>=0&&u<=1}const JY={extends:PO()},Xd=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n};function QY(t,e,n,r,i,s){return he(),Ee("div",{ref:"reference",class:Kt(["v-popper",{"v-popper--shown":t.slotData.isShown}])},[Gn(t.$slots,"default",Dr(Sr(t.slotData)))],2)}const eZ=Xd(JY,[["render",QY]]);function tZ(){var t=window.navigator.userAgent,e=t.indexOf("MSIE ");if(e>0)return parseInt(t.substring(e+5,t.indexOf(".",e)),10);var n=t.indexOf("Trident/");if(n>0){var r=t.indexOf("rv:");return parseInt(t.substring(r+3,t.indexOf(".",r)),10)}var i=t.indexOf("Edge/");return i>0?parseInt(t.substring(i+5,t.indexOf(".",i)),10):-1}let Qf;function Am(){Am.init||(Am.init=!0,Qf=tZ()!==-1)}var Jd={name:"ResizeObserver",props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:["notify"],mounted(){Am(),ho(()=>{this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitOnMount&&this.emitSize()});const t=document.createElement("object");this._resizeObject=t,t.setAttribute("aria-hidden","true"),t.setAttribute("tabindex",-1),t.onload=this.addResizeHandlers,t.type="text/html",Qf&&this.$el.appendChild(t),t.data="about:blank",Qf||this.$el.appendChild(t)},beforeUnmount(){this.removeResizeHandlers()},methods:{compareAndNotify(){(!this.ignoreWidth&&this._w!==this.$el.offsetWidth||!this.ignoreHeight&&this._h!==this.$el.offsetHeight)&&(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitSize())},emitSize(){this.$emit("notify",{width:this._w,height:this._h})},addResizeHandlers(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers(){this._resizeObject&&this._resizeObject.onload&&(!Qf&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};const nZ=sC();ya("data-v-b329ee4c");const rZ={class:"resize-observer",tabindex:"-1"};va();const iZ=nZ((t,e,n,r,i,s)=>(he(),gn("div",rZ)));Jd.render=iZ;Jd.__scopeId="data-v-b329ee4c";Jd.__file="src/components/ResizeObserver.vue";const LO=(t="theme")=>({computed:{themeClass(){return YY(this[t])}}}),sZ=dr({name:"VPopperContent",components:{ResizeObserver:Jd},mixins:[LO()],props:{popperId:String,theme:String,shown:Boolean,mounted:Boolean,skipTransition:Boolean,autoHide:Boolean,handleResize:Boolean,classes:Object,result:Object},emits:["hide","resize"],methods:{toPx(t){return t!=null&&!isNaN(t)?`${t}px`:null}}}
41),oZ=["id","aria-hidden","tabindex","data-popper-placement"],aZ={ref:"inner",class:"v-popper__inner"},cZ=ee("div",{class:"v-popper__arrow-outer"},null,-1),uZ=ee("div",{class:"v-popper__arrow-inner"},null,-1),lZ=[cZ,uZ];function fZ(t,e,n,r,i,s){const o=mt("ResizeObserver");return he(),Ee("div",{id:t.popperId,ref:"popover",class:Kt(["v-popper__popper",[t.themeClass,t.classes.popperClass,{"v-popper__popper--shown":t.shown,"v-popper__popper--hidden":!t.shown,"v-popper__popper--show-from":t.classes.showFrom,"v-popper__popper--show-to":t.classes.showTo,"v-popper__popper--hide-from":t.classes.hideFrom,"v-popper__popper--hide-to":t.classes.hideTo,"v-popper__popper--skip-transition":t.skipTransition,"v-popper__popper--arrow-overflow":t.result&&t.result.arrow.overflow,"v-popper__popper--no-positioning":!t.result}]]),style:Ir(t.result?{position:t.result.strategy,transform:`translate3d(${Math.round(t.result.x)}px,${Math.round(t.result.y)}px,0)`}:void 0),"aria-hidden":t.shown?"false":"true",tabindex:t.autoHide?0:void 0,"data-popper-placement":t.result?t.result.placement:void 0,onKeyup:e[2]||(e[2]=LN(a=>t.autoHide&&t.$emit("hide"),["esc"]))},[ee("div",{class:"v-popper__backdrop",onClick:e[0]||(e[0]=a=>t.autoHide&&t.$emit("hide"))}),ee("div",{class:"v-popper__wrapper",style:Ir(t.result?{transformOrigin:t.result.transformOrigin}:void 0)},[ee("div",aZ,[t.mounted?(he(),Ee(Ct,{key:0},[ee("div",null,[Gn(t.$slots,"default")]),t.handleResize?(he(),gn(o,{key:0,onNotify:e[1]||(e[1]=a=>t.$emit("resize",a))})):xt("",!0)],64)):xt("",!0)],512),ee("div",{ref:"arrow",class:"v-popper__arrow-container",style:Ir(t.result?{left:t.toPx(t.result.arrow.x),top:t.toPx(t.result.arrow.y)}:void 0)},lZ,4)],4)],46,oZ)}const BO=Xd(sZ,[["render",fZ]]),DO={methods:{show(...t){return this.$refs.popper.show(...t)},hide(...t){return this.$refs.popper.hide(...t)},dispose(...t){return this.$refs.popper.dispose(...t)},onResize(...t){return this.$refs.popper.onResize(...t)}}};let xm=function(){};typeof window<"u"&&(xm=window.Element);const hZ=dr({name:"VPopperWrapper",components:{Popper:eZ,PopperContent:BO},mixins:[DO,LO("finalTheme")],props:{theme:{type:String,default:null},referenceNode:{type:Function,default:null},shown:{type:Boolean,default:!1},showGroup:{type:String,default:null},ariaId:{default:null},disabled:{type:Boolean,default:void 0},positioningDisabled:{type:Boolean,default:void 0},placement:{type:String,default:void 0},delay:{type:[String,Number,Object],default:void 0},distance:{type:[Number,String],default:void 0},skidding:{type:[Number,String],default:void 0},triggers:{type:Array,default:void 0},showTriggers:{type:[Array,Function],default:void 0},hideTriggers:{type:[Array,Function],default:void 0},popperTriggers:{type:Array,default:void 0},popperShowTriggers:{type:[Array,Function],default:void 0},popperHideTriggers:{type:[Array,Function],default:void 0},container:{type:[String,Object,xm,Boolean],default:void 0},boundary:{type:[String,xm],default:void 0},strategy:{type:String,default:void 0},autoHide:{type:[Boolean,Function],default:void 0},handleResize:{type:Boolean,default:void 0},instantMove:{type:Boolean,default:void 0},eagerMount:{type:Boolean,default:void 0},popperClass:{type:[String,Array,Object],default:void 0},computeTransformOrigin:{type:Boolean,default:void 0},autoMinSize:{type:Boolean,default:void 0},autoSize:{type:[Boolean,String],default:void 0},autoMaxSize:{type:Boolean,default:void 0},autoBoundaryMaxSize:{type:Boolean,default:void 0},preventOverflow:{type:Boolean,default:void 0},overflowPadding:{type:[Number,String],default:void 0},arrowPadding:{type:[Number,String],default:void 0},arrowOverflow:{type:Boolean,default:void 0},flip:{type:Boolean,default:void 0},shift:{type:Boolean,default:void 0},shiftCrossAxis:{type:Boolean,default:void 0},noAutoFocus:{type:Boolean,default:void 0},disposeTimeout:{type:Number,default:void 0}},emits:{show:()=>!0,hide:()=>!0,"update:shown":t=>!0,"apply-show":()=>!0,"apply-hide":()=>!0,"close-group":()=>!0,"close-directive":()=>!0,"auto-hide":()=>!0,resize:()=>!0},computed:{finalTheme(){return this.theme??this.$options.vPopperTheme}},methods:{getTargetNodes(){return Array.from(this.$el.children).filter(t=>t!==this.$refs.popperContent.$el)}}});function dZ(t,e,n,r,i,s){const o=mt("PopperContent"),a=mt("Popper");return he(),gn(a,hi({ref:"popper"},t.$props,{theme:t.finalTheme,"target-nodes":t.getTargetNodes,"popper-node":()=>t.$refs.popperContent.$el,class:[t.themeClass],onShow:e[0]||(e[0]=()=>t.$emit("show")),onHide:e[1]||(e[1]=()=>t.$emit("hide")),"onUpdate:shown":e[2]||(e[2]=c=>t.$emit("update:shown",c)),onApplyShow:e[3]||(e[3]=()=>t.$emit("apply-show")),onApplyHide:e[4]||(e[4]=()=>t.$emit("apply-hide")),onCloseGroup:e[5]||(e[5]=()=>t.$emit("close-group")),onCloseDirective:e[6]||(e[6]=()=>
41t.$emit("close-directive")),onAutoHide:e[7]||(e[7]=()=>t.$emit("auto-hide")),onResize:e[8]||(e[8]=()=>t.$emit("resize"))}),{default:Ii(({popperId:c,isShown:u,shouldMountContent:l,skipTransition:h,autoHide:p,show:g,hide:y,handleResize:w,onResize:k,classes:T,result:C})=>[Gn(t.$slots,"default",{shown:u,show:g,hide:y}),Pe(o,{ref:"popperContent","popper-id":c,theme:t.finalTheme,shown:u,mounted:l,"skip-transition":h,"auto-hide":p,"handle-resize":w,classes:T,result:C,onHide:y,onResize:k},{default:Ii(()=>[Gn(t.$slots,"popper",{shown:u,hide:y})]),_:2},1032,["popper-id","theme","shown","mounted","skip-transition","auto-hide","handle-resize","classes","result","onHide","onResize"])]),_:3},16,["theme","target-nodes","popper-node","class"])}const P1=Xd(hZ,[["render",dZ]]),pZ={...P1,name:"VDropdown",vPopperTheme:"dropdown"},gZ={...P1,name:"VMenu",vPopperTheme:"menu"},mZ={...P1,name:"VTooltip",vPopperTheme:"tooltip"},yZ=dr({name:"VTooltipDirective",components:{Popper:PO(),PopperContent:BO},mixins:[DO],inheritAttrs:!1,props:{theme:{type:String,default:"tooltip"},html:{type:Boolean,default:t=>hl(t.theme,"html")},content:{type:[String,Number,Function],default:null},loadingContent:{type:String,default:t=>hl(t.theme,"loadingContent")},targetNodes:{type:Function,required:!0}},data(){return{asyncContent:null}},computed:{isContentAsync(){return typeof this.content=="function"},loading(){return this.isContentAsync&&this.asyncContent==null},finalContent(){return this.isContentAsync?this.loading?this.loadingContent:this.asyncContent:this.content}},watch:{content:{handler(){this.fetchContent(!0)},immediate:!0},async finalContent(){await this.$nextTick(),this.$refs.popper.onResize()}},created(){this.$_fetchId=0},methods:{fetchContent(t){if(typeof this.content=="function"&&this.$_isShown&&(t||!this.$_loading&&this.asyncContent==null)){this.asyncContent=null,this.$_loading=!0;const e=++this.$_fetchId,n=this.content(this);n.then?n.then(r=>this.onResult(e,r)):this.onResult(e,n)}},onResult(t,e){t===this.$_fetchId&&(this.$_loading=!1,this.asyncContent=e)},onShow(){this.$_isShown=!0,this.fetchContent()},onHide(){this.$_isShown=!1}}}),vZ=["innerHTML"],bZ=["textContent"];function wZ(t,e,n,r,i,s){const o=mt("PopperContent"),a=mt("Popper");return he(),gn(a,hi({ref:"popper"},t.$attrs,{theme:t.theme,"target-nodes":t.targetNodes,"popper-node":()=>t.$refs.popperContent.$el,onApplyShow:t.onShow,onApplyHide:t.onHide}),{default:Ii(({popperId:c,isShown:u,shouldMountContent:l,skipTransition:h,autoHide:p,hide:g,handleResize:y,onResize:w,classes:k,result:T})=>[Pe(o,{ref:"popperContent",class:Kt({"v-popper--tooltip-loading":t.loading}),"popper-id":c,theme:t.theme,shown:u,mounted:l,"skip-transition":h,"auto-hide":p,"handle-resize":y,classes:k,result:T,onHide:g,onResize:w},{default:Ii(()=>[t.html?(he(),Ee("div",{key:0,innerHTML:t.finalContent},null,8,vZ)):(he(),Ee("div",{key:1,textContent:Oe(t.finalContent)},null,8,bZ))]),_:2},1032,["class","popper-id","theme","shown","mounted","skip-transition","auto-hide","handle-resize","classes","result","onHide","onResize"])]),_:1},16,["theme","target-nodes","popper-node","onApplyShow","onApplyHide"])}const _Z=Xd(yZ,[["render",wZ]]),$O="v-popper--has-tooltip";function kZ(t,e){let n=t.placement;if(!n&&e)for(const r of NO)e[r]&&(n=r);return n||(n=hl(t.theme||"tooltip","placement")),n}function FO(t,e,n){let r;const i=typeof e;return i==="string"?r={content:e}:e&&i==="object"?r=e:r={content:!1},r.placement=kZ(r,n),r.targetNodes=()=>[t],r.referenceNode=()=>t,r}let Fg,dl,SZ=0;function EZ(){if(Fg)return;dl=ct([]),Fg=Xm({name:"VTooltipDirectiveApp",setup(){return{directives:dl}},render(){return this.directives.map(e=>ii(_Z,{...e.options,shown:e.shown||e.options.shown,key:e.id}))},devtools:{hide:!0}});const t=document.createElement("div");document.body.appendChild(t),Fg.mount(t)}function AZ(t,e,n){EZ();const r=ct(FO(t,e,n)),i=ct(!1),s={id:SZ++,options:r,shown:i};return dl.value.push(s),t.classList&&t.classList.add($O),t.$_popper={options:r,item:s,show(){i.value=!0},hide(){i.value=!1}}}function UO(t){if(t.$_popper){const e=dl.value.indexOf(t.$_popper.item);e!==-1&&dl.value.splice(e,1),delete t.$_popper,delete t.$_popperOldShown,delete t.$_popperMountTarget}t.classList&&t.classList.remove($O)}function Ok(t,{value:e,modifiers:n}){const r=FO(t,e,n);if(!r.content||hl(r.theme||"tooltip","disabled"))UO(t);else{let i;t.$_popper?(i=t.$_popper,i.options.value=r):i=AZ(t,e,n),typeof e.shown<"u"&&e.shown!==t.$_popperOldShown&&(t.$_popperOldShown=e.shown,e.shown?i.show():i.hide())}}
41const xZ={beforeMount:Ok,updated:Ok,beforeUnmount(t){UO(t)}};function Ik(t){t.addEventListener("mousedown",jh),t.addEventListener("click",jh),t.addEventListener("touchstart",zO,Sc?{passive:!0}:!1)}function Ck(t){t.removeEventListener("mousedown",jh),t.removeEventListener("click",jh),t.removeEventListener("touchstart",zO),t.removeEventListener("touchend",HO),t.removeEventListener("touchcancel",WO)}function jh(t){const e=t.currentTarget;t.closePopover=!e.$_vclosepopover_touch,t.closeAllPopover=e.$_closePopoverModifiers&&!!e.$_closePopoverModifiers.all}function zO(t){if(t.changedTouches.length===1){const e=t.currentTarget;e.$_vclosepopover_touch=!0;const n=t.changedTouches[0];e.$_vclosepopover_touchPoint=n,e.addEventListener("touchend",HO),e.addEventListener("touchcancel",WO)}}function HO(t){const e=t.currentTarget;if(e.$_vclosepopover_touch=!1,t.changedTouches.length===1){const n=t.changedTouches[0],r=e.$_vclosepopover_touchPoint;t.closePopover=Math.abs(n.screenY-r.screenY)<20&&Math.abs(n.screenX-r.screenX)<20,t.closeAllPopover=e.$_closePopoverModifiers&&!!e.$_closePopoverModifiers.all}}function WO(t){const e=t.currentTarget;e.$_vclosepopover_touch=!1}const RZ={beforeMount(t,{value:e,modifiers:n}){t.$_closePopoverModifiers=n,(typeof e>"u"||e)&&Ik(t)},updated(t,{value:e,oldValue:n,modifiers:r}){t.$_closePopoverModifiers=r,e!==n&&(typeof e>"u"||e?Ik(t):Ck(t))},beforeUnmount(t){Ck(t)}};function TZ(t,e={}){t.$_vTooltipInstalled||(t.$_vTooltipInstalled=!0,IO(li,e),t.directive("tooltip",xZ),t.directive("close-popper",RZ),t.component("VTooltip",mZ),t.component("VDropdown",pZ),t.component("VMenu",gZ))}const OZ={version:"5.2.2",install:TZ,options:li};const IZ={wallets:[],autoConnect:!0},Qd=Xm(TY);Qd.use(yW,IZ);Qd.use(vO,{autoClose:4e5,theme:"dark"});Qd.use(OZ,{container:".center-column"});Qd.mount("#app");
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.