PageSourceSearch

https://billsonchain.io/_next/static/chunks/0o05~st~btxd-.js

js billsonchain.io collected 2026-10-08 01:33:17 UTC 418,615 bytes, 485 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,8341,(t,e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={cancelIdleCallback:function(){return s},requestIdleCallback:function(){return o}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let o="u">typeof self&&self.requestIdleCallback&&self.requestIdleCallback.bind(window)||function(t){let e=Date.now();return self.setTimeout(function(){t({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-e))}})},1)},s="u">typeof self&&self.cancelIdleCallback&&self.cancelIdleCallback.bind(window)||function(t){return clearTimeout(t)};("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),e.exports=r.default)},79520,(t,e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return w},handleClientScriptLoad:function(){return m},initScriptLoader:function(){return y}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let o=t.r(55682),s=t.r(90809),a=t.r(43476),l=o._(t.r(74080)),u=s._(t.r(71645)),c=t.r(42732),h=t.r(22737),f=t.r(8341),d=new Map,p=new Set,g=t=>{let{src:e,id:r,onLoad:n=()=>{},onReady:i=null,dangerouslySetInnerHTML:o,children:s="",strategy:a="afterInteractive",onError:u,stylesheets:c}=t,f=r||e;if(f&&p.has(f))return;if(d.has(e)){p.add(f),d.get(e).then(n,u);return}let g=()=>{i&&i(),p.add(f)},m=document.createElement("script"),y=new Promise((t,e)=>{m.addEventListener("load",function(e){t(),n&&n.call(this,e),g()}),m.addEventListener("error",function(t){e(t)})}).catch(function(t){u&&u(t)});o?(m.innerHTML=o.__html||"",g()):s?(m.textContent="string"==typeof s?s:Array.isArray(s)?s.join(""):"",g()):e&&(m.src=e,d.set(e,y)),(0,h.setAttributesFromProps)(m,t),"worker"===a&&m.setAttribute("type","text/partytown"),m.setAttribute("data-nscript",a),c&&(t=>{if(l.default.preinit)return t.forEach(t=>{l.default.preinit(t,{as:"style"})});if("u">typeof window){let e=document.head;t.forEach(t=>{let r=document.createElement("link");r.type="text/css",r.rel="stylesheet",r.href=t,e.appendChild(r)})}})(c),document.body.appendChild(m)};function m(t){let{strategy:e="afterInteractive"}=t;"lazyOnload"===e?window.addEventListener("load",()=>{(0,f.requestIdleCallback)(()=>g(t))}):g(t)}function y(t){t.forEach(m),[...document.querySelectorAll('[data-nscript="beforeInteractive"]'),...document.querySelectorAll('[data-nscript="beforePageRender"]')].forEach(t=>{let e=t.id||t.getAttribute("src");p.add(e)})}function b(t){let{id:e,src:r="",onLoad:n=()=>{},onReady:i=null,strategy:o="afterInteractive",onError:s,stylesheets:h,...d}=t,{updateScripts:m,scripts:y,getIsSsr:b,appDir:w,nonce:v}=(0,u.useContext)(c.HeadManagerContext);v=d.nonce||v;let x=(0,u.useRef)(!1);(0,u.useEffect)(()=>{let t=e||r;x.current||(i&&t&&p.has(t)&&i(),x.current=!0)},[i,e,r]);let E=(0,u.useRef)(!1);if((0,u.useEffect)(()=>{if(!E.current){if("afterInteractive"===o)g(t);else"lazyOnload"===o&&("complete"===document.readyState?(0,f.requestIdleCallback)(()=>g(t)):window.addEventListener("load",()=>{(0,f.requestIdleCallback)(()=>g(t))}));E.current=!0}},[t,o]),("beforeInteractive"===o||"worker"===o)&&(m?(y[o]=(y[o]||[]).concat([{id:e,src:r,onLoad:n,onReady:i,onError:s,...d,nonce:v}]),m(y)):b&&b()?p.add(e||r):b&&!b()&&g({...t,nonce:v})),w){if(h&&h.forEach(t=>{l.default.preinit(t,{as:"style"})}),"beforeInteractive"===o)if(!r)return d.dangerouslySetInnerHTML&&(d.children=d.dangerouslySetInnerHTML.__html,delete d.dangerouslySetInnerHTML),(0,a.jsx)("script",{nonce:v,dangerouslySetInnerHTML:{__html:`(self.__next_s=self.__next_s||[]).push(${JSON.stringify([0,{...d,id:e}])})`}});else return l.default.preload(r,d.integrity?{as:"script",integrity:d.integrity,nonce:v,crossOrigin:d.crossOrigin}:{as:"script",nonce:v,crossOrigin:d.crossOrigin}),(0,a.jsx)("script",{nonce:v,dangerouslySetInnerHTML:{__html:`(self.__next_s=self.__next_s||[]).push(${JSON.stringify([r,{...d,id:e}])})`}});"afterInteractive"===o&&r&&l.default.preload(r,d.integrity?{as:"script",integrity:d.integrity,nonce:v,crossOrigin:d.crossOrigin}:{as:"script",nonce:v,crossOrigin:d.crossOrigin})}return null}Object.defineProperty(b,"__nextScript",{value:!0});let w=b;("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esMo
1dule",{value:!0}),Object.assign(r.default,r),e.exports=r.default)},34582,(t,e,r)=>{"use strict";r.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return(r+n)*3/4-n},r.toByteArray=function(t){var e,r,n=u(t),s=n[0],a=n[1],l=new o((s+a)*3/4-a),c=0,h=a>0?s-4:s;for(r=0;r<h;r+=4)e=i[t.charCodeAt(r)]<<18|i[t.charCodeAt(r+1)]<<12|i[t.charCodeAt(r+2)]<<6|i[t.charCodeAt(r+3)],l[c++]=e>>16&255,l[c++]=e>>8&255,l[c++]=255&e;return 2===a&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,l[c++]=255&e),1===a&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,l[c++]=e>>8&255,l[c++]=255&e),l},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],s=0,a=r-i;s<a;s+=16383)o.push(function(t,e,r){for(var i,o=[],s=e;s<r;s+=3)i=(t[s]<<16&0xff0000)+(t[s+1]<<8&65280)+(255&t[s+2]),o.push(n[i>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return o.join("")}(t,s,s+16383>a?a:s+16383));return 1===i?o.push(n[(e=t[r-1])>>2]+n[e<<4&63]+"=="):2===i&&o.push(n[(e=(t[r-2]<<8)+t[r-1])>>10]+n[e>>4&63]+n[e<<2&63]+"="),o.join("")};for(var n=[],i=[],o="u">typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=s.length;a<l;++a)n[a]=s[a],i[s.charCodeAt(a)]=a;function u(t){var e=t.length;if(e%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");-1===r&&(r=e);var n=r===e?0:4-r%4;return[r,n]}i[45]=62,i[95]=63},38492,(t,e,r)=>{r.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,l=(1<<a)-1,u=l>>1,c=-7,h=r?i-1:0,f=r?-1:1,d=t[e+h];for(h+=f,o=d&(1<<-c)-1,d>>=-c,c+=a;c>0;o=256*o+t[e+h],h+=f,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+t[e+h],h+=f,c-=8);if(0===o)o=1-u;else{if(o===l)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=u}return(d?-1:1)*s*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var s,a,l,u=8*o-i-1,c=(1<<u)-1,h=c>>1,f=5960464477539062e-23*(23===i),d=n?0:o-1,p=n?1:-1,g=+(e<0||0===e&&1/e<0);for(isNaN(e=Math.abs(e))||e===1/0?(a=+!!isNaN(e),s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+h>=1?e+=f/l:e+=f*Math.pow(2,1-h),e*l>=2&&(s++,l/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(e*l-1)*Math.pow(2,i),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;t[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;t[r+d]=255&s,d+=p,s/=256,u-=8);t[r+d-p]|=128*g}},43943,(t,e,r)=>{"use strict";let n=t.r(34582),i=t.r(38492),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function s(t){if(t>0x7fffffff)throw RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,a.prototype),e}function a(t,e,r){if("number"==typeof t){if("string"==typeof e)throw TypeError('The "string" argument must be of type string. Received type number');return c(t)}return l(t,e,r)}function l(t,e,r){if("string"==typeof t){var n=t,i=e;if(("string"!=typeof i||""===i)&&(i="utf8"),!a.isEncoding(i))throw TypeError("Unknown encoding: "+i);let r=0|p(n,i),o=s(r),l=o.write(n,i);return l!==r&&(o=o.slice(0,l)),o}if(ArrayBuffer.isView(t)){var o=t;if(N(o,Uint8Array)){let t=new Uint8Array(o);return f(t.buffer,t.byteOffset,t.byteLength)}return h(o)}if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(N(t,ArrayBuffer)||t&&N(t.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(N(t,SharedArrayBuffer)||t&&N(t.buffer,SharedArrayBuffer)))return f(t,e,r);if("number"==typeof t)throw TypeError('The "value" argument must not be of type number. Received type number');let l=t.valueOf&&t.valueOf();if(null!=l&&l!==t)return a.from(l,e,r);let u=function(t){if(a.isBuffer(t)){let e=0|d(t.length),r=s(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||function(t){return t!=t}(t.length)?s(0):h(t):"Buffer"===t.type&&Array.isArray(t.data)?h(t.data):void 0}(t);if(u)return u;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return a.from(t[Symbol.toPrimitive]("string"),e,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function u(t){if("number"!=typeof t)throw TypeError('"size" argument must be of type number');
vendor: 62,107 bytes, line 1
1if(t<0)throw RangeError('The value "'+t+'" is invalid for option "size"')}function c(t){return u(t),s(t<0?0:0|d(t))}function h(t){let e=t.length<0?0:0|d(t.length),r=s(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function f(t,e,r){let n;if(e<0||t.byteLength<e)throw RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),a.prototype),n}function d(t){if(t>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|t}function p(t,e){if(a.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||N(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return O(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return P(t).length;default:if(i)return n?-1:O(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){let i=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(e>>>=0)))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,r){let n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=e;n<r;++n)i+=z[t[n]];return i}(this,e,r);case"utf8":case"utf-8":return w(this,e,r);case"ascii":return function(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}(this,e,r);case"latin1":case"binary":return function(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}(this,e,r);case"base64":var o,s,a;return o=this,s=e,a=r,0===s&&a===o.length?n.fromByteArray(o):n.fromByteArray(o.slice(s,a));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(t,e,r){let n=t.slice(e,r),i="";for(let t=0;t<n.length-1;t+=2)i+=String.fromCharCode(n[t]+256*n[t+1]);return i}(this,e,r);default:if(i)throw TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function m(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}function y(t,e,r,n,i){var o;if(0===t.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(o=r*=1)!=o&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length)if(i)return -1;else r=t.length-1;else if(r<0)if(!i)return -1;else r=0;if("string"==typeof e&&(e=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,i);if("number"==typeof e){if(e&=255,"function"==typeof Uint8Array.prototype.indexOf)if(i)return Uint8Array.prototype.indexOf.call(t,e,r);else return Uint8Array.prototype.lastIndexOf.call(t,e,r);return b(t,[e],r,n,i)}throw TypeError("val must be string, number or Buffer")}function b(t,e,r,n,i){let o,s=1,a=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return -1;s=2,a/=2,l/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let n=-1;for(o=r;o<a;o++)if(u(t,o)===u(e,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===l)return n*s}else -1!==n&&(o-=o-n),n=-1}else for(r+l>a&&(r=a-l),o=r;o>=0;o--){let r=!0;for(let n=0;n<l;n++)if(u(t,o+n)!==u(e,n)){r=!1;break}if(r)return o}return -1}function w(t,e,r){r=Math.min(t.length,r);let n=[],i=e;for(;i<r;){let e=t[i],o=null,s=e>239?4:e>223?3:e>191?2:1;if(i+s<=r){let r,n,a,l;switch(s){case 1:e<128&&(o=e);break;case 2:(192&(r=t[i+1]))==128&&(l=(31&e)<<6|63&r)>127&&(o=l);break;case 3:r=t[i+1],n=t[i+2],(192&r)==128&&(192&n)==128&&(l=(15&e)<<12|(63&r)<<6|63&n)>2047&&(l<55296||l>57343)&&(o=l);break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],(192&r)==128&&(192&n)==128&&(192&a)==128&&(l=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a)>65535&&l<1114112&&(o=l)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}var o=n;let s=o.length;if(s<=4096)return String.fromCharCode.apply(String,o);let a="",l=0;for(;l<s;)a+=String.fromCharCode.apply(String,o.slice(l,l+=4096));return a}function v(t,e,r){if(t%1!=0||t<0)throw RangeError("offset is not uint");if(t+e>r)throw RangeError("Trying to access beyond buffer length")}function x(t,e,r,n,i,o){if(!a.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw RangeError('"value" argument is out of bounds');if(r+n>t.length)throw RangeError("Index out of range")}function E(t,e,r,n,i){C(e,n,i,t,r,7);let o=Number(e&BigInt(0xffffffff));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(0xffffffff));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function S(t,e,r,n,i){C(e,n,i,t,r,7);let o=Number(e&BigInt(0xffffffff));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(0xffffffff));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function k(t,e,r,n,i,o){if(r+n>t.length||r<0)throw RangeError("Index out of range")}function A(t,e,r,n,o){return e*=1,r>>>=0,o||k(t,e,r,4,34028234663852886e22,-34028234663852886e22),i.write(t,e,r,n,23,4),r+4}function I(t,e,r,n,o){return e*=1,r>>>=0,o||k(t,e,r,8,17976931348623157e292,-17976931348623157e292),i.write(t,e,r,n,52,8),r+8}r.Buffer=a,r.SlowBuffer=function(t){return+t!=t&&(t=0),a.alloc(+t)},r.INSPECT_MAX_BYTES=50,r.kMaxLength=0x7fffffff,a.TYPED_ARRAY_SUPPORT=function(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),!a.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(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}}),a.poolSize=8192,a.from=function(t,e,r){return l(t,e,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(t,e,r){return(u(t),t<=0)?s(t):void 0!==e?"string"==typeof r?s(t).fill(e,r):s(t).fill(e):s(t)},a.allocUnsafe=function(t){return c(t)},a.allocUnsafeSlow=function(t){return c(t)},a.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==a.prototype},a.compare=function(t,e){if(N(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),N(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(t)||!a.isBuffer(e))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:+(n<r)},a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(t,e){let r;if(!Array.isArray(t))throw TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);if(void 0===e)for(r=0,e=0;r<t.length;++r)e+=t[r].length;let n=a.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){let e=t[r];if(N(e,Uint8Array))i+e.length>n.length?(a.isBuffer(e)||(e=a.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else if(a.isBuffer(e))e.copy(n,i);else throw TypeError('"list" argument must be an Array of Buffers');i+=e.length}return n},a.byteLength=p,a.prototype._isBuffer=!0,a.prototype.swap16=function(){let t=this.length;if(t%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)m(this,e,e+1);return this},a.prototype.swap32=function(){let t=this.length;if(t%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},a.prototype.swap64=function(){let t=this.length;if(t%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},a.prototype.toString=function(){let t=this.length;return 0===t?"":0==arguments.length?w(this,0,t):g.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(t){if(!a.isBuffer(t))throw TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){let t="",e=r.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},o&&(a.prototype[o]=a.prototype.inspect),a.prototype.compare=function(t,e,r,n,i){if(N(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(t))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return -1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;let o=i-n,s=r-e,l=Math.min(o,s),u=this.slice(n,i),c=t.slice(e,r);for(let t=0;t<l;++t)if(u[t]!==c[t]){o=u[t],s=c[t];break}return o<s?-1:+(s<o)},a.prototype.includes=function(t,e,r){return -1!==this.indexOf(t,e,r)},a.prototype.indexOf=function(t,e,r){return y(this,t,e,r,!0)},a.prototype.lastIndexOf=function(t,e,r){return y(this,t,e,r,!1)},a.prototype.write=function(t,e,r,n){var i,o,s,a,l,u,c,h;if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else if(isFinite(e))e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let f=this.length-e;if((void 0===r||r>f)&&(r=f),t.length>0&&(r<0||e<0)||e>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let d=!1;for(;;)switch(n){case"hex":return function(t,e,r,n){let i;r=Number(r)||0;let o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;let s=e.length;for(n>s/2&&(n=s/2),i=0;i<n;++i){var a;let n=parseInt(e.substr(2*i,2),16);if((a=n)!=a)break;t[r+i]=n}return i}(this,t,e,r);case"utf8":case"utf-8":return i=e,o=r,U(O(t,this.length-i),this,i,o);case"ascii":case"latin1":case"binary":return s=e,a=r,U(function(t){let e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(t),this,s,a);case"base64":return l=e,u=r,U(P(t),this,l,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c=e,h=r,U(function(t,e){let r,n,i=[];for(let o=0;o<t.length&&!((e-=2)<0);++o)n=(r=t.charCodeAt(o))>>8,i.push(r%256),i.push(n);return i}(t,this.length-c),this,c,h);default:if(d)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),d=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},a.prototype.slice=function(t,e){let r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);let n=this.subarray(t,e);return Object.setPrototypeOf(n,a.prototype),n},a.prototype.readUintLE=a.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return n},a.prototype.readUintBE=a.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},a.prototype.readUint8=a.prototype.readUInt8=function(t,e){return t>>>=0,e||v(t,1,this.length),this[t]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(t,e){return t>>>=0,e||v(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(t,e){return t>>>=0,e||v(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(t,e){return t>>>=0,e||v(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+0x1000000*this[t+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(t,e){return t>>>=0,e||v(t,4,this.length),0x1000000*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readBigUInt64LE=q(function(t){T(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&L(t,this.length-8);let n=e+256*this[++t]+65536*this[++t]+0x1000000*this[++t],i=this[++t]+256*this[++t]+65536*this[++t]+0x1000000*r;return BigInt(n)+(BigInt(i)<<BigInt(32))}),a.prototype.readBigUInt64BE=q(function(t){T(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&L(t,this.length-8);let n=0x1000000*e+65536*this[++t]+256*this[++t]+this[++t],i=0x1000000*this[++t]+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)}),a.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},a.prototype.readInt8=function(t,e){return(t>>>=0,e||v(t,1,this.length),128&this[t])?-((255-this[t]+1)*1):this[t]},a.prototype.readInt16LE=function(t,e){t>>>=0,e||v(t,2,this.length);let r=this[t]|this[t+1]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt16BE=function(t,e){t>>>=0,e||v(t,2,this.length);let r=this[t+1]|this[t]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt32LE=function(t,e){return t>>>=0,e||v(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return t>>>=0,e||v(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readBigInt64LE=q(function(t){T(t>>>=0,"offset");let e=this[t],r=this[t+7];return(void 0===e||void 0===r)&&L(t,this.length-8),(BigInt(this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24))<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+0x1000000*this[++t])}),a.prototype.readBigInt64BE=q(function(t){T(t>>>=0,"offset");let e=this[t],r=this[t+7];return(void 0===e||void 0===r)&&L(t,this.length-8),(BigInt((e<<24)+65536*this[++t]+256*this[++t]+this[++t])<<BigInt(32))+BigInt(0x1000000*this[++t]+65536*this[++t]+256*this[++t]+r)}),a.prototype.readFloatLE=function(t,e){return t>>>=0,e||v(t,4,this.length),i.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return t>>>=0,e||v(t,4,this.length),i.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return t>>>=0,e||v(t,8,this.length),i.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return t>>>=0,e||v(t,8,this.length),i.read(this,t,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(t,e,r,n){if(t*=1,e>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;x(this,t,e,r,n,0)}let i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(t,e,r,n){if(t*=1,e>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;x(this,t,e,r,n,0)}let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},a.prototype.writeUint8=a.prototype.writeUInt8=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,1,255,0),this[e]=255&t,e+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,4,0xffffffff,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,4,0xffffffff,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeBigUInt64LE=q(function(t,e=0){return E(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=q(function(t,e=0){return S(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(t,e,r,n){if(t*=1,e>>>=0,!n){let n=Math.pow(2,8*r-1);x(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/o|0)-s&255;return e+r},a.prototype.writeIntBE=function(t,e,r,n){if(t*=1,e>>>=0,!n){let n=Math.pow(2,8*r-1);x(this,t,e,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o|0)-s&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeInt16BE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeInt32LE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,4,0x7fffffff,-0x80000000),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},a.prototype.writeInt32BE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,4,0x7fffffff,-0x80000000),t<0&&(t=0xffffffff+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeBigInt64LE=q(function(t,e=0){return E(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=q(function(t,e=0){return S(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeFloatLE=function(t,e,r){return A(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return A(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return I(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return I(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,n){if(!a.isBuffer(t))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r||0===t.length||0===this.length)return 0;if(e<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);let i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},a.prototype.fill=function(t,e,r,n){let i;if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===t.length){let e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw RangeError("Out of range index");if(r<=e)return this;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{let o=a.isBuffer(t)?t:a.from(t,n),s=o.length;if(0===s)throw TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=o[i%s]}return this};let B={};function _(t,e,r){B[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function M(t){let e="",r=t.length,n=+("-"===t[0]);for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function C(t,e,r,n,i,o){if(t>r||t<e){let n,i="bigint"==typeof e?"n":"";throw n=o>3?0===e||e===BigInt(0)?`>= 0${i} and < 2${i} ** ${(o+1)*8}${i}`:`>= -(2${i} ** ${(o+1)*8-1}${i}) and < 2 ** ${(o+1)*8-1}${i}`:`>= ${e}${i} and <= ${r}${i}`,new B.ERR_OUT_OF_RANGE("value",n,t)}T(i,"offset"),(void 0===n[i]||void 0===n[i+o])&&L(i,n.length-(o+1))}function T(t,e){if("number"!=typeof t)throw new B.ERR_INVALID_ARG_TYPE(e,"number",t)}function L(t,e,r){if(Math.floor(t)!==t)throw T(t,r),new B.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE(r||"offset",`>= ${+!!r} and <= ${e}`,t)}_("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),_("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError),_("ERR_OUT_OF_RANGE",function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>0x100000000?i=M(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=M(i)),i+="n"),n+=` It must be ${e}. Received ${i}`},RangeError);let R=/[^+/0-9A-Za-z-_]/g;function O(t,e){let r;e=e||1/0;let n=t.length,i=null,o=[];for(let s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319||s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return o}function P(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(R,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function U(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length)&&!(i>=t.length);++i)e[i+r]=t[i];return i}function N(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}let z=function(){let t="0123456789abcdef",e=Array(256);for(let r=0;r<16;++r){let n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function q(t){return"u"<typeof BigInt?D:t}function D(){throw Error("BigInt not supported")}},59341,(t,e,r)=>{!function(t,e){"use strict";function r(t,e){if(!t)throw Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function i(t,e,r){if(i.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&(("le"===e||"be"===e)&&(r=e,e=10),this._init(t||0,e||10,r||"be"))}t.exports=i,i.BN=i,i.wordSize=26;try{c="u">typeof window&&void 0!==window.Buffer?window.Buffer:void 0}catch(t){}function o(t,e){var n=t.charCodeAt(e);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+t)}function s(t,e,r){var n=o(t,r);return r-1>=e&&(n|=o(t,r-1)<<4),n}function a(t,e,n,i){for(var o=0,s=0,a=Math.min(t.length,n),l=e;l<a;l++){var u=t.charCodeAt(l)-48;o*=i,s=u>=49?u-49+10:u>=17?u-17+10:u,r(u>=0&&s<i,"Invalid character"),o+=s}return o}function l(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(i.isBN=function(t){return t instanceof i||null!==t&&"object"==typeof t&&t.constructor.wordSize===i.wordSize&&Array.isArray(t.words)},i.max=function(t,e){return t.cmp(e)>0?t:e},i.min=function(t,e){return 0>t.cmp(e)?t:e},i.prototype._init=function(t,e,n){if("number"==typeof t)return this._initNumber(t,e,n);if("object"==typeof t)return this._initArray(t,e,n);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,n):(this._parseBase(t,e,i),"le"===n&&this._initArray(this.toArray(),e,n)))},i.prototype._initNumber=function(t,e,n){t<0&&(this.negative=1,t=-t),t<0x4000000?(this.words=[0x3ffffff&t],this.length=1):t<0x10000000000000?(this.words=[0x3ffffff&t,t/0x4000000&0x3ffffff],this.length=2):(r(t<0x20000000000000),this.words=[0x3ffffff&t,t/0x4000000&0x3ffffff,1],this.length=3),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initArray=function(t,e,n){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=Array(this.length);for(var i,o,s=0;s<this.length;s++)this.words[s]=0;var a=0;if("be"===n)for(s=t.length-1,i=0;s>=0;s-=3)o=t[s]|t[s-1]<<8|t[s-2]<<16,this.words[i]|=o<<a&0x3ffffff,this.words[i+1]=o>>>26-a&0x3ffffff,(a+=24)>=26&&(a-=26,i++);else if("le"===n)for(s=0,i=0;s<t.length;s+=3)o=t[s]|t[s+1]<<8|t[s+2]<<16,this.words[i]|=o<<a&0x3ffffff,this.words[i+1]=o>>>26-a&0x3ffffff,(a+=24)>=26&&(a-=26,i++);return this._strip()},i.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=Array(this.length);for(var n,i=0;i<this.length;i++)this.words[i]=0;var o=0,a=0;if("be"===r)for(i=t.length-1;i>=e;i-=2)n=s(t,e,i)<<o,this.words[a]|=0x3ffffff&n,o>=18?(o-=18,a+=1,this.words[a]|=n>>>26):o+=8;else for(i=(t.length-e)%2==0?e+1:e;i<t.length;i+=2)n=s(t,e,i)<<o,this.words[a]|=0x3ffffff&n,o>=18?(o-=18,a+=1,this.words[a]|=n>>>26):o+=8;this._strip()},i.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=0x3ffffff;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,l=Math.min(o,o-s)+r,u=0,c=r;c<l;c+=n)u=a(t,c,c+n,e),this.imuln(i),this.words[0]+u<0x4000000?this.words[0]+=u:this._iaddn(u);if(0!==s){var h=1;for(u=a(t,c,t.length,e),c=0;c<s;c++)h*=e;this.imuln(h),this.words[0]+u<0x4000000?this.words[0]+=u:this._iaddn(u)}this._strip()},i.prototype.copy=function(t){t.words=Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},i.prototype._move=function(t){l(t,this)},i.prototype.clone=function(){var t=new i(null);return this.copy(t),t},i.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"u">typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=u}catch(t){i.prototype.inspect=u}else i.prototype.inspect=u;function u(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var c,h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,0x2000000,0x290d741,0x1000000,0x2e90edd,0x39aa400,0x267bf47,0x1000000,0x290d741,1e7,0x12959c3,0x222c000,0x3bd7765,7529536,0xadcea1,0x1000000,0x1704f61,0x206fc40,0x2cddcf9,64e6,4084101,5153632,6436343,7962624,9765625,0xb54ba0,0xdaf26b,0x1069c00,0x138f9ad,243e5,0x1b4d89f,0x2000000,0x25528a1,0x2b54a20,0x3216b93,0x39aa400];function p(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=0x3ffffff&s,l=s/0x4000000|0;r.words[0]=a;for(var u=1;u<n;u++){for(var c=l>>>26,h=0x3ffffff&l,f=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=f;d++){var p=u-d|0;c+=(s=(i=0|t.words[p])*(o=0|e.words[d])+h)/0x4000000|0,h=0x3ffffff&s}r.words[u]=0|h,l=0|c}return 0!==l?r.words[u]=0|l:r.length--,r._strip()}i.prototype.toString=function(t,e){if(e=0|e||1,16===(t=t||10)||"hex"===t){for(var n="",i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],l=((a<<i|o)&0xffffff).toString(16);o=a>>>24-i&0xffffff,(i+=2)>=26&&(i-=26,s--),n=0!==o||s!==this.length-1?h[6-l.length]+l+n:l+n}for(0!==o&&(n=o.toString(16)+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var u=f[t],c=d[t];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modrn(c).toString(t);n=(p=p.idivn(c)).isZero()?g+n:h[u-g.length]+g+n}for(this.isZero()&&(n="0"+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=0x4000000*this.words[1]:3===this.length&&1===this.words[2]?t+=0x10000000000000+0x4000000*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16,2)},c&&(i.prototype.toBuffer=function(t,e){return this.toArrayLike(c,t,e)}),i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},i.prototype.toArrayLike=function(t,e,n){this._strip();var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0");var s=t.allocUnsafe?t.allocUnsafe(o):new t(o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,i),s},i.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r++]=255&s,r<t.length&&(t[r++]=s>>8&255),r<t.length&&(t[r++]=s>>16&255),6===o?(r<t.length&&(t[r++]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r<t.length)for(t[r++]=n;r<t.length;)t[r++]=0},i.prototype._toArrayLikeBE=function(t,e){for(var r=t.length-1,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r--]=255&s,r>=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return(8191&e)==0&&(r+=13,e>>>=13),(127&e)==0&&(r+=7,e>>>=7),(15&e)==0&&(r+=4,e>>>=4),(3&e)==0&&(r+=2,e>>>=2),(1&e)==0&&r++,r},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return(this.length-1)*26+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},i.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},i.prototype.ior=function(t){return r((this.negative|t.negative)==0),this.iuor(t)},i.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this._strip()},i.prototype.iand=function(t){return r((this.negative|t.negative)==0),this.iuand(t)},i.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){this.length>t.length?(e=this,r=t):(e=t,r=this);for(var e,r,n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this._strip()},i.prototype.ixor=function(t){return r((this.negative|t.negative)==0),this.iuxor(t)},i.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),n=t%26;this._expand(e),n>0&&e--;for(var i=0;i<e;i++)this.words[i]=0x3ffffff&~this.words[i];for(n>0&&(this.words[i]=~this.words[i]&0x3ffffff>>26-n,i++);i<this.length;i++)this.words[i]=0;return this._strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var n=t/26|0,i=t%26;return this._expand(n+1),e?this.words[n]=this.words[n]|1<<i:this.words[n]=this.words[n]&~(1<<i),this._strip()},i.prototype.iadd=function(t){if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var e,r,n,i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=0x3ffffff&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=0x3ffffff&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},i.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e,r,n=this.iadd(t);return t.negative=1,n._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(e=this,r=t):(e=t,r=this);for(var o=0,s=0;s<r.length;s++)o=(n=(0|e.words[s])-(0|r.words[s])+o)>>26,this.words[s]=0x3ffffff&n;for(;0!==o&&s<e.length;s++)o=(n=(0|e.words[s])+o)>>26,this.words[s]=0x3ffffff&n;if(0===o&&s<e.length&&e!==this)for(;s<e.length;s++)this.words[s]=e.words[s];return this.length=Math.max(this.length,s),e!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(t){return this.clone().isub(t)};var g=function(t,e,r){var n,i,o,s=t.words,a=e.words,l=r.words,u=0,c=0|s[0],h=8191&c,f=c>>>13,d=0|s[1],p=8191&d,g=d>>>13,m=0|s[2],y=8191&m,b=m>>>13,w=0|s[3],v=8191&w,x=w>>>13,E=0|s[4],S=8191&E,k=E>>>13,A=0|s[5],I=8191&A,B=A>>>13,_=0|s[6],M=8191&_,C=_>>>13,T=0|s[7],L=8191&T,R=T>>>13,O=0|s[8],P=8191&O,U=O>>>13,N=0|s[9],z=8191&N,q=N>>>13,D=0|a[0],W=8191&D,F=D>>>13,j=0|a[1],K=8191&j,H=j>>>13,V=0|a[2],$=8191&V,Z=V>>>13,G=0|a[3],Y=8191&G,Q=G>>>13,J=0|a[4],X=8191&J,tt=J>>>13,te=0|a[5],tr=8191&te,tn=te>>>13,ti=0|a[6],to=8191&ti,ts=ti>>>13,ta=0|a[7],tl=8191&ta,tu=ta>>>13,tc=0|a[8],th=8191&tc,tf=tc>>>13,td=0|a[9],tp=8191&td,tg=td>>>13;r.negative=t.negative^e.negative,r.length=19,n=Math.imul(h,W);var tm=(u+n|0)+((8191&(i=(i=Math.imul(h,F))+Math.imul(f,W)|0))<<13)|0;u=((o=Math.imul(f,F))+(i>>>13)|0)+(tm>>>26)|0,tm&=0x3ffffff,n=Math.imul(p,W),i=(i=Math.imul(p,F))+Math.imul(g,W)|0,o=Math.imul(g,F),n=n+Math.imul(h,K)|0;var ty=(u+n|0)+((8191&(i=(i=i+Math.imul(h,H)|0)+Math.imul(f,K)|0))<<13)|0;u=((o=o+Math.imul(f,H)|0)+(i>>>13)|0)+(ty>>>26)|0,ty&=0x3ffffff,n=Math.imul(y,W),i=(i=Math.imul(y,F))+Math.imul(b,W)|0,o=Math.imul(b,F),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(g,K)|0,o=o+Math.imul(g,H)|0,n=n+Math.imul(h,$)|0;var tb=(u+n|0)+((8191&(i=(i=i+Math.imul(h,Z)|0)+Math.imul(f,$)|0))<<13)|0;u=((o=o+Math.imul(f,Z)|0)+(i>>>13)|0)+(tb>>>26)|0,tb&=0x3ffffff,n=Math.imul(v,W),i=(i=Math.imul(v,F))+Math.imul(x,W)|0,o=Math.imul(x,F),n=n+Math.imul(y,K)|0,i=(i=i+Math.imul(y,H)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,H)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(g,$)|0,o=o+Math.imul(g,Z)|0,n=n+Math.imul(h,Y)|0;var tw=(u+n|0)+((8191&(i=(i=i+Math.imul(h,Q)|0)+Math.imul(f,Y)|0))<<13)|0;u=((o=o+Math.imul(f,Q)|0)+(i>>>13)|0)+(tw>>>26)|0,tw&=0x3ffffff,n=Math.imul(S,W),i=(i=Math.imul(S,F))+Math.imul(k,W)|0,o=Math.imul(k,F),n=n+Math.imul(v,K)|0,i=(i=i+Math.imul(v,H)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,H)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,Z)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(g,Y)|0,o=o+Math.imul(g,Q)|0,n=n+Math.imul(h,X)|0;var tv=(u+n|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(f,X)|0))<<13)|0;u=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(tv>>>26)|0,tv&=0x3ffffff,n=Math.imul(I,W),i=(i=Math.imul(I,F))+Math.imul(B,W)|0,o=Math.imul(B,F),n=n+Math.imul(S,K)|0,i=(i=i+Math.imul(S,H)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,H)|0,n=n+Math.imul(v,$)|0,i=(i=i+Math.imul(v,Z)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,Z)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,Q)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,Q)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(g,X)|0,o=o+Math.imul(g,tt)|0,n=n+Math.imul(h,tr)|0;var tx=(u+n|0)+((8191&(i=(i=i+Math.imul(h,tn)|0)+Math.imul(f,tr)|0))<<13)|0;u=((o=o+Math.imul(f,tn)|0)+(i>>>13)|0)+(tx>>>26)|0,tx&=0x3ffffff,n=Math.imul(M,W),i=(i=Math.imul(M,F))+Math.imul(C,W)|0,o=Math.imul(C,F),n=n+Math.imul(I,K)|0,i=(i=i+Math.imul(I,H)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,H)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,Z)|0,n=n+Math.imul(v,Y)|0,i=(i=i+Math.imul(v,Q)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,Q)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,tt)|0,n=n+Math.imul(p,tr)|0,i=(i=i+Math.imul(p,tn)|0)+Math.imul(g,tr)|0,o=o+Math.imul(g,tn)|0,n=n+Math.imul(h,to)|0;var tE=(u+n|0)+((8191&(i=(i=i+Math.imul(h,ts)|0)+Math.imul(f,to)|0))<<13)|0;u=((o=o+Math.imul(f,ts)|0)+(i>>>13)|0)+(tE>>>26)|0,tE&=0x3ffffff,n=Math.imul(L,W),i=(i=Math.imul(L,F))+Math.imul(R,W)|0,o=Math.imul(R,F),n=n+Math.imul(M,K)|0,i=(i=i+Math.imul(M,H)|0)+Math.imul(C,K)|0,o=o+Math.imul(C,H)|0,n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,Z)|0)+Math.imul(B,$)|0,o=o+Math.imul(B,Z)|0,n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,Q)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,Q)|0,n=n+Math.imul(v,X)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(y,tr)|0,i=(i=i+Math.imul(y,tn)|0)+Math.imul(b,tr)|0,o=o+Math.imul(b,tn)|0,n=n+Math.imul(p,to)|0,i=(i=i+Math.imul(p,ts)|0)+Math.imul(g,to)|0,o=o+Math.imul(g,ts)|0,n=n+Math.imul(h,tl)|0;var tS=(u+n|0)+((8191&(i=(i=i+Math.imul(h,tu)|0)+Math.imul(f,tl)|0))<<13)|0;u=((o=o+Math.imul(f,tu)|0)+(i>>>13)|0)+(tS>>>26)|0,tS&=0x3ffffff,n=Math.imul(P,W),i=(i=Math.imul(P,F))+Math.imul(U,W)|0,o=Math.imul(U,F),n=n+Math.imul(L,K)|0,i=(i=i+Math.imul(L,H)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,H)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,Z)|0)+Math.imul(C,$)|0,o=o+Math.imul(C,Z)|0,n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,Q)|0)+Math.imul(B,Y)|0,o=o+Math.imul(B,Q)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(v,tr)|0,i=(i=i+Math.imul(v,tn)|0)+Math.imul(x,tr)|0,o=o+Math.imul(x,tn)|0,n=n+Math.imul(y,to)|0,i=(i=i+Math.imul(y,ts)|0)+Math.imul(b,to)|0,o=o+Math.imul(b,ts)|0,n=n+Math.imul(p,tl)|0,i=(i=i+Math.imul(p,tu)|0)+Math.imul(g,tl)|0,o=o+Math.imul(g,tu)|0,n=n+Math.imul(h,th)|0;var tk=(u+n|0)+((8191&(i=(i=i+Math.imul(h,tf)|0)+Math.imul(f,th)|0))<<13)|0;u=((o=o+Math.imul(f,tf)|0)+(i>>>13)|0)+(tk>>>26)|0,tk&=0x3ffffff,n=Math.imul(z,W),i=(i=Math.imul(z,F))+Math.imul(q,W)|0,o=Math.imul(q,F),n=n+Math.imul(P,K)|0,i=(i=i+Math.imul(P,H)|0)+Math.imul(U,K)|0,o=o+Math.imul(U,H)|0,n=n+Math.imul(L,$)|0,i=(i=i+Math.imul(L,Z)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,Z)|0,n=n+Math.imul(M,Y)|0,i=(i=i+Math.imul(M,Q)|0)+Math.imul(C,Y)|0,o=o+Math.imul(C,Q)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,tt)|0,n=n+Math.imul(S,tr)|0,i=(i=i+Math.imul(S,tn)|0)+Math.imul(k,tr)|0,o=o+Math.imul(k,tn)|0,n=n+Math.imul(v,to)|0,i=(i=i+Math.imul(v,ts)|0)+Math.imul(x,to)|0,o=o+Math.imul(x,ts)|0,n=n+Math.imul(y,tl)|0,i=(i=i+Math.imul(y,tu)|0)+Math.imul(b,tl)|0,o=o+Math.imul(b,tu)|0,n=n+Math.imul(p,th)|0,i=(i=i+Math.imul(p,tf)|0)+Math.imul(g,th)|0,o=o+Math.imul(g,tf)|0,n=n+Math.imul(h,tp)|0;var tA=(u+n|0)+((8191&(i=(i=i+Math.imul(h,tg)|0)+Math.imul(f,tp)|0))<<13)|0;u=((o=o+Math.imul(f,tg)|0)+(i>>>13)|0)+(tA>>>26)|0,tA&=0x3ffffff,n=Math.imul(z,K),i=(i=Math.imul(z,H))+Math.imul(q,K)|0,o=Math.imul(q,H),n=n+Math.imul(P,$)|0,i=(i=i+Math.imul(P,Z)|0)+Math.imul(U,$)|0,o=o+Math.imul(U,Z)|0,n=n+Math.imul(L,Y)|0,i=(i=i+Math.imul(L,Q)|0)+Math.imul(R,Y)|0,o=o+Math.imul(R,Q)|0,n=n+Math.imul(M,X)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(C,X)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(I,tr)|0,i=(i=i+Math.imul(I,tn)|0)+Math.imul(B,tr)|0,o=o+Math.imul(B,tn)|0,n=n+Math.imul(S,to)|0,i=(i=i+Math.imul(S,ts)|0)+Math.imul(k,to)|0,o=o+Math.imul(k,ts)|0,n=n+Math.imul(v,tl)|0,i=(i=i+Math.imul(v,tu)|0)+Math.imul(x,tl)|0,o=o+Math.imul(x,tu)|0,n=n+Math.imul(y,th)|0,i=(i=i+Math.imul(y,tf)|0)+Math.imul(b,th)|0,o=o+Math.imul(b,tf)|0,n=n+Math.imul(p,tp)|0;var tI=(u+n|0)+((8191&(i=(i=i+Math.imul(p,tg)|0)+Math.imul(g,tp)|0))<<13)|0;u=((o=o+Math.imul(g,tg)|0)+(i>>>13)|0)+(tI>>>26)|0,tI&=0x3ffffff,n=Math.imul(z,$),i=(i=Math.imul(z,Z))+Math.imul(q,$)|0,o=Math.imul(q,Z),n=n+Math.imul(P,Y)|0,i=(i=i+Math.imul(P,Q)|0)+Math.imul(U,Y)|0,o=o+Math.imul(U,Q)|0,n=n+Math.imul(L,X)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(M,tr)|0,i=(i=i+Math.imul(M,tn)|0)+Math.imul(C,tr)|0,o=o+Math.imul(C,tn)|0,n=n+Math.imul(I,to)|0,i=(i=i+Math.imul(I,ts)|0)+Math.imul(B,to)|0,o=o+Math.imul(B,ts)|0,n=n+Math.imul(S,tl)|0,i=(i=i+Math.imul(S,tu)|0)+Math.imul(k,tl)|0,o=o+Math.imul(k,tu)|0,n=n+Math.imul(v,th)|0,i=(i=i+Math.imul(v,tf)|0)+Math.imul(x,th)|0,o=o+Math.imul(x,tf)|0,n=n+Math.imul(y,tp)|0;var tB=(u+n|0)+((8191&(i=(i=i+Math.imul(y,tg)|0)+Math.imul(b,tp)|0))<<13)|0;u=((o=o+Math.imul(b,tg)|0)+(i>>>13)|0)+(tB>>>26)|0,tB&=0x3ffffff,n=Math.imul(z,Y),i=(i=Math.imul(z,Q))+Math.imul(q,Y)|0,o=Math.imul(q,Q),n=n+Math.imul(P,X)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(U,X)|0,o=o+Math.imul(U,tt)|0,n=n+Math.imul(L,tr)|0,i=(i=i+Math.imul(L,tn)|0)+Math.imul(R,tr)|0,o=o+Math.imul(R,tn)|0,n=n+Math.imul(M,to)|0,i=(i=i+Math.imul(M,ts)|0)+Math.imul(C,to)|0,o=o+Math.imul(C,ts)|0,n=n+Math.imul(I,tl)|0,i=(i=i+Math.imul(I,tu)|0)+Math.imul(B,tl)|0,o=o+Math.imul(B,tu)|0,n=n+Math.imul(S,th)|0,i=(i=i+Math.imul(S,tf)|0)+Math.imul(k,th)|0,o=o+Math.imul(k,tf)|0,n=n+Math.imul(v,tp)|0;var t_=(u+n|0)+((8191&(i=(i=i+Math.imul(v,tg)|0)+Math.imul(x,tp)|0))<<13)|0;u=((o=o+Math.imul(x,tg)|0)+(i>>>13)|0)+(t_>>>26)|0,t_&=0x3ffffff,n=Math.imul(z,X),i=(i=Math.imul(z,tt))+Math.imul(q,X)|0,o=Math.imul(q,tt),n=n+Math.imul(P,tr)|0,i=(i=i+Math.imul(P,tn)|0)+Math.imul(U,tr)|0,o=o+Math.imul(U,tn)|0,n=n+Math.imul(L,to)|0,i=(i=i+Math.imul(L,ts)|0)+Math.imul(R,to)|0,o=o+Math.imul(R,ts)|0,n=n+Math.imul(M,tl)|0,i=(i=i+Math.imul(M,tu)|0)+Math.imul(C,tl)|0,o=o+Math.imul(C,tu)|0,n=n+Math.imul(I,th)|0,i=(i=i+Math.imul(I,tf)|0)+Math.imul(B,th)|0,o=o+Math.imul(B,tf)|0,n=n+Math.imul(S,tp)|0;var tM=(u+n|0)+((8191&(i=(i=i+Math.imul(S,tg)|0)+Math.imul(k,tp)|0))<<13)|0;u=((o=o+Math.imul(k,tg)|0)+(i>>>13)|0)+(tM>>>26)|0,tM&=0x3ffffff,n=Math.imul(z,tr),i=(i=Math.imul(z,tn))+Math.imul(q,tr)|0,o=Math.imul(q,tn),n=n+Math.imul(P,to)|0,i=(i=i+Math.imul(P,ts)|0)+Math.imul(U,to)|0,o=o+Math.imul(U,ts)|0,n=n+Math.imul(L,tl)|0,i=(i=i+Math.imul(L,tu)|0)+Math.imul(R,tl)|0,o=o+Math.imul(R,tu)|0,n=n+Math.imul(M,th)|0,i=(i=i+Math.imul(M,tf)|0)+Math.imul(C,th)|0,o=o+Math.imul(C,tf)|0,n=n+Math.imul(I,tp)|0;var tC=(u+n|0)+((8191&(i=(i=i+Math.imul(I,tg)|0)+Math.imul(B,tp)|0))<<13)|0;u=((o=o+Math.imul(B,tg)|0)+(i>>>13)|0)+(tC>>>26)|0,tC&=0x3ffffff,n=Math.imul(z,to),i=(i=Math.imul(z,ts))+Math.imul(q,to)|0,o=Math.imul(q,ts),n=n+Math.imul(P,tl)|0,i=(i=i+Math.imul(P,tu)|0)+Math.imul(U,tl)|0,o=o+Math.imul(U,tu)|0,n=n+Math.imul(L,th)|0,i=(i=i+Math.imul(L,tf)|0)+Math.imul(R,th)|0,o=o+Math.imul(R,tf)|0,n=n+Math.imul(M,tp)|0;var tT=(u+n|0)+((8191&(i=(i=i+Math.imul(M,tg)|0)+Math.imul(C,tp)|0))<<13)|0;u=((o=o+Math.imul(C,tg)|0)+(i>>>13)|0)+(tT>>>26)|0,tT&=0x3ffffff,n=Math.imul(z,tl),i=(i=Math.imul(z,tu))+Math.imul(q,tl)|0,o=Math.imul(q,tu),n=n+Math.imul(P,th)|0,i=(i=i+Math.imul(P,tf)|0)+Math.imul(U,th)|0,o=o+Math.imul(U,tf)|0,n=n+Math.imul(L,tp)|0;var tL=(u+n|0)+((8191&(i=(i=i+Math.imul(L,tg)|0)+Math.imul(R,tp)|0))<<13)|0;u=((o=o+Math.imul(R,tg)|0)+(i>>>13)|0)+(tL>>>26)|0,tL&=0x3ffffff,n=Math.imul(z,th),i=(i=Math.imul(z,tf))+Math.imul(q,th)|0,o=Math.imul(q,tf),n=n+Math.imul(P,tp)|0;var tR=(u+n|0)+((8191&(i=(i=i+Math.imul(P,tg)|0)+Math.imul(U,tp)|0))<<13)|0;u=((o=o+Math.imul(U,tg)|0)+(i>>>13)|0)+(tR>>>26)|0,tR&=0x3ffffff,n=Math.imul(z,tp);var tO=(u+n|0)+((8191&(i=(i=Math.imul(z,tg))+Math.imul(q,tp)|0))<<13)|0;return u=((o=Math.imul(q,tg))+(i>>>13)|0)+(tO>>>26)|0,tO&=0x3ffffff,l[0]=tm,l[1]=ty,l[2]=tb,l[3]=tw,l[4]=tv,l[5]=tx,l[6]=tE,l[7]=tS,l[8]=tk,l[9]=tA,l[10]=tI,l[11]=tB,l[12]=t_,l[13]=tM,l[14]=tC,l[15]=tT,l[16]=tL,l[17]=tR,l[18]=tO,0!==u&&(l[19]=u,r.length++),r};function m(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=0x3ffffff&n,l=Math.min(o,e.length-1),u=Math.max(0,o-t.length+1);u<=l;u++){var c=o-u,h=(0|t.words[c])*(0|e.words[u]),f=0x3ffffff&h;s=s+(h/0x4000000|0)|0,a=0x3ffffff&(f=f+a|0),i+=(s=s+(f>>>26)|0)>>>26,s&=0x3ffffff}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function y(t,e){this.x=t,this.y=e}Math.imul||(g=p),i.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return 10===this.length&&10===t.length?r=g(this,t,e):n<63?r=p(this,t,e):r=m(this,t,e),r},y.prototype.makeRBT=function(t){for(var e=Array(t),r=i.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},y.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},y.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},y.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,l=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),c=0;c<i;c+=a)for(var h=l,f=u,d=0;d<s;d++){var p=r[c+d],g=n[c+d],m=r[c+d+s],y=n[c+d+s],b=h*m-f*y;y=h*y+f*m,m=b,r[c+d]=p+m,n[c+d]=g+y,r[c+d+s]=p-m,n[c+d+s]=g-y,d!==a&&(b=l*h-u*f,f=l*f+u*h,h=b)}},y.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},y.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},y.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=0x3ffffff&i,r=i<0x4000000?0:i/0x4000000|0}return t},y.prototype.convert13b=function(t,e,n,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],n[2*s]=8191&o,o>>>=13,n[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)n[s]=0;r(0===o),r((-8192&o)==0)},y.prototype.stub=function(t){for(var e=Array(t),r=0;r<t;r++)e[r]=0;return e},y.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=Array(n),a=Array(n),l=Array(n),u=Array(n),c=Array(n),h=Array(n),f=r.words;f.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,u,n),this.transform(s,o,a,l,n,i),this.transform(u,o,c,h,n,i);for(var d=0;d<n;d++){var p=a[d]*c[d]-l[d]*h[d];l[d]=a[d]*h[d]+l[d]*c[d],a[d]=p}return this.conjugate(a,l,n),this.transform(a,l,f,o,n,i),this.conjugate(f,o,n),this.normalize13b(f,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r._strip()},i.prototype.mul=function(t){var e=new i(null);return e.words=Array(this.length+t.length),this.mulTo(t,e)},i.prototype.mulf=function(t){var e=new i(null);return e.words=Array(this.length+t.length),m(this,t,e)},i.prototype.imul=function(t){return this.clone().mulTo(t,this)},i.prototype.imuln=function(t){var e=t<0;e&&(t=-t),r("number"==typeof t),r(t<0x4000000);for(var n=0,i=0;i<this.length;i++){var o=(0|this.words[i])*t,s=(0x3ffffff&o)+(0x3ffffff&n);n>>=26,n+=(o/0x4000000|0)+(s>>>26),this.words[i]=0x3ffffff&s}return 0!==n&&(this.words[i]=n,this.length++),0===t&&(this.length=1,this._normSign()),e?this.ineg():this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=t.words[n]>>>i&1}return e}(t);if(0===e.length)return new i(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var o=r.sqr();n<e.length;n++,o=o.sqr())0!==e[n]&&(r=r.mul(o));return r},i.prototype.iushln=function(t){r("number"==typeof t&&t>=0);var e,n=t%26,i=(t-n)/26,o=0x3ffffff>>>26-n<<26-n;if(0!==n){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,l=(0|this.words[e])-a<<n;this.words[e]=l|s,s=a>>>26-n}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this._strip()},i.prototype.ishln=function(t){return r(0===this.negative),this.iushln(t)},i.prototype.iushrn=function(t,e,n){r("number"==typeof t&&t>=0);var i=e?(e-e%26)/26:0,o=t%26,s=Math.min((t-o)/26,this.length),a=0x3ffffff^0x3ffffff>>>o<<o;if(i-=s,i=Math.max(0,i),n){for(var l=0;l<s;l++)n.words[l]=this.words[l];n.length=s}if(0===s);else if(this.length>s)for(this.length-=s,l=0;l<this.length;l++)this.words[l]=this.words[l+s];else this.words[0]=0,this.length=1;var u=0;for(l=this.length-1;l>=0&&(0!==u||l>=i);l--){var c=0|this.words[l];this.words[l]=u<<26-o|c>>>o,u=c&a}return n&&0!==u&&(n.words[n.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(t,e,n){return r(0===this.negative),this.iushrn(t,e,n)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26;return!(this.length<=n)&&!!(this.words[n]&1<<e)},i.prototype.imaskn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26;return(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)?this:(0!==e&&n++,this.length=Math.min(n,this.length),0!==e&&(this.words[this.length-1]&=0x3ffffff^0x3ffffff>>>e<<e),0===this.length&&(this.words[0]=0,this.length=1),this._strip())},i.prototype.maskn=function(t){return this.clone().imaskn(t)},i.prototype.iaddn=function(t){return(r("number"==typeof t),r(t<0x4000000),t<0)?this.isubn(-t):0!==this.negative?(1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0):(this.negative=0,this.isubn(t),this.negative=1),this):this._iaddn(t)},i.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=0x4000000;e++)this.words[e]-=0x4000000,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(r("number"==typeof t),r(t<0x4000000),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=0x4000000,this.words[e+1]-=1;return this._strip()},i.prototype.addn=function(t){return this.clone().iaddn(t)},i.prototype.subn=function(t){return this.clone().isubn(t)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(t,e,n){var i,o,s=t.length+n;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+n])+a;var l=(0|t.words[i])*e;o-=0x3ffffff&l,a=(o>>26)-(l/0x4000000|0),this.words[i+n]=0x3ffffff&o}for(;i<this.length-n;i++)a=(o=(0|this.words[i+n])+a)>>26,this.words[i+n]=0x3ffffff&o;if(0===a)return this._strip();for(r(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=0x3ffffff&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(t,e){var r,n=this.length-t.length,o=this.clone(),s=t,a=0|s.words[s.length-1];0!=(n=26-this._countBits(a))&&(s=s.ushln(n),o.iushln(n),a=0|s.words[s.length-1]);var l=o.length-s.length;if("mod"!==e){(r=new i(null)).length=l+1,r.words=Array(r.length);for(var u=0;u<r.length;u++)r.words[u]=0}var c=o.clone()._ishlnsubmul(s,1,l);0===c.negative&&(o=c,r&&(r.words[l]=1));for(var h=l-1;h>=0;h--){var f=(0|o.words[s.length+h])*0x4000000+(0|o.words[s.length+h-1]);for(f=Math.min(f/a|0,0x3ffffff),o._ishlnsubmul(s,f,h);0!==o.negative;)f--,o.negative=0,o._ishlnsubmul(s,1,h),o.isZero()||(o.negative^=1);r&&(r.words[h]=f)}return r&&r._strip(),o._strip(),"div"!==e&&0!==n&&o.iushrn(n),{div:r||null,mod:o}},i.prototype.divmod=function(t,e,n){var o,s,a;return(r(!t.isZero()),this.isZero())?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(o=a.div.neg()),"div"!==e&&(s=a.mod.neg(),n&&0!==s.negative&&s.iadd(t)),{div:o,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(o=a.div.neg()),{div:o,mod:a.mod}):(this.negative&t.negative)!=0?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),n&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||0>this.cmp(t)?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modrn(t.words[0]))}:this._wordDiv(t,e)},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=e.mod.abs(),n=t.abs().iushrn(1),o=1&t.words[0],s=r.cmp(n);if(s<0||1===o&&0===s)return e.div;var a=new i(1);return a.negative=this.negative^t.negative,e.div.iadd(a)},i.prototype.modrn=function(t){var e=t<0;e&&(t=-t),r(t<=0x3ffffff);for(var n=0x4000000%t,i=0,o=this.length-1;o>=0;o--)i=(n*i+(0|this.words[o]))%t;return e?-i:i},i.prototype.modn=function(t){return this.modrn(t)},i.prototype.idivn=function(t){var e=t<0;e&&(t=-t),r(t<=0x3ffffff);for(var n=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+0x4000000*n;this.words[i]=o/t|0,n=o%t}return this._strip(),e?this.ineg():this},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o=new i(1),s=new i(0),a=new i(0),l=new i(1),u=0;e.isEven()&&n.isEven();)e.iushrn(1),n.iushrn(1),++u;for(var c=n.clone(),h=e.clone();!e.isZero();){for(var f=0,d=1;(e.words[0]&d)==0&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(c),s.isub(h)),o.iushrn(1),s.iushrn(1);for(var p=0,g=1;(n.words[0]&g)==0&&p<26;++p,g<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(a.isOdd()||l.isOdd())&&(a.iadd(c),l.isub(h)),a.iushrn(1),l.iushrn(1);e.cmp(n)>=0?(e.isub(n),o.isub(a),s.isub(l)):(n.isub(e),a.isub(o),l.isub(s))}return{a:a,b:l,gcd:n.iushln(u)}},i.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e,n=this,o=t.clone();n=0!==n.negative?n.umod(t):n.clone();for(var s=new i(1),a=new i(0),l=o.clone();n.cmpn(1)>0&&o.cmpn(1)>0;){for(var u=0,c=1;(n.words[0]&c)==0&&u<26;++u,c<<=1);if(u>0)for(n.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);for(var h=0,f=1;(o.words[0]&f)==0&&h<26;++h,f<<=1);if(h>0)for(o.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(l),a.iushrn(1);n.cmp(o)>=0?(n.isub(o),s.isub(a)):(o.isub(n),a.isub(s))}return 0>(e=0===n.cmpn(1)?s:a).cmpn(0)&&e.iadd(t),e},i.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return(1&this.words[0])==0},i.prototype.isOdd=function(){return(1&this.words[0])==1},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,n=(t-e)/26,i=1<<e;if(this.length<=n)return this._expand(n+1),this.words[n]|=i,this;for(var o=i,s=n;0!==o&&s<this.length;s++){var a=0|this.words[s];a+=o,o=a>>>26,a&=0x3ffffff,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,n=t<0;if(0!==this.negative&&!n)return -1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)e=1;else{n&&(t=-t),r(t<=0x3ffffff,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},i.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return -1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},i.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return -1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return -1===this.cmpn(t)},i.prototype.lt=function(t){return -1===this.cmp(t)},i.prototype.lten=function(t){return 0>=this.cmpn(t)},i.prototype.lte=function(t){return 0>=this.cmp(t)},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new k(t)},i.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var b={k256:null,p224:null,p192:null,p25519:null};function w(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function x(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function A(t){k.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}w.prototype._tmp=function(){var t=new i(null);return t.words=Array(Math.ceil(this.n/13)),t},w.prototype.ireduce=function(t){var e,r=t;do this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength();while(e>this.n)var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(t,e){t.iushrn(this.n,0,e)},w.prototype.imulK=function(t){return t.imul(this.k)},n(v,w),v.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n<r;
1n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9){t.words[0]=0,t.length=1;return}var i=t.words[9];for(n=10,e.words[e.length++]=4194303&i;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(4194303&o)<<4|i>>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=0x3ffffff&e,e=64*n+(e/0x4000000|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(x,w),n(E,w),n(S,w),S.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=(0|t.words[r])*19+e,i=0x3ffffff&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){var e;if(b[t])return b[t];if("k256"===t)e=new v;else if("p224"===t)e=new x;else if("p192"===t)e=new E;else if("p25519"===t)e=new S;else throw Error("Unknown prime "+t);return b[t]=e,e},k.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},k.prototype._verify2=function(t,e){r((t.negative|e.negative)==0,"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},k.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(l(t,t.umod(this.m)._forceRed(this)),t)},k.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},k.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r},k.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},k.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},k.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},k.prototype.isqr=function(t){return this.imul(t,t.clone())},k.prototype.sqr=function(t){return this.mul(t,t)},k.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var n=this.m.add(new i(1)).iushrn(2);return this.pow(t,n)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new i(1).toRed(this),l=a.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new i(2*c*c).toRed(this);0!==this.pow(c,u).cmp(l);)c.redIAdd(l);for(var h=this.pow(c,o),f=this.pow(t,o.addn(1).iushrn(1)),d=this.pow(t,o),p=s;0!==d.cmp(a);){for(var g=d,m=0;0!==g.cmp(a);m++)g=g.redSqr();r(m<p);var y=this.pow(h,new i(1).iushln(p-m-1));f=f.redMul(y),h=y.redSqr(),d=d.redMul(h),p=m}return f},k.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},k.prototype.pow=function(t,e){if(e.isZero())return new i(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=Array(16);r[0]=new i(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var o=r[0],s=0,a=0,l=e.bitLength()%26;for(0===l&&(l=26),n=e.length-1;n>=0;n--){for(var u=e.words[n],c=l-1;c>=0;c--){var h=u>>c&1;if(o!==r[0]&&(o=this.sqr(o)),0===h&&0===s){a=0;continue}s<<=1,s|=h,(4==++a||0===n&&0===c)&&(o=this.mul(o,r[s]),a=0,s=0)}l=26}return o},k.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},k.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new A(t)},n(A,k),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):0>i.cmpn(0)&&(o=i.iadd(this.m)),o._forceRed(this)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):0>o.cmpn(0)&&(s=o.iadd(this.m)),s._forceRed(this)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,t.e)},42524,(t,e,r)=>{var n=t.r(43943),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,r),r.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw TypeError("Argument must be a number");return n.SlowBuffer(t)}},50889,(t,e,r)=>{"use strict";var n=t.r(42524).Buffer;e.exports=function(t){if(t.length>=255)throw TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var i=0;i<t.length;
vendor: 6,021 bytes, line 1
1i++){var o=t.charAt(i),s=o.charCodeAt(0);if(255!==e[s])throw TypeError(o+" is ambiguous");e[s]=i}var a=t.length,l=t.charAt(0),u=Math.log(a)/Math.log(256),c=Math.log(256)/Math.log(a);function h(t){if("string"!=typeof t)throw TypeError("Expected String");if(0===t.length)return n.alloc(0);for(var r=0,i=0,o=0;t[r]===l;)i++,r++;for(var s=(t.length-r)*u+1>>>0,c=new Uint8Array(s);r<t.length;){var h=t.charCodeAt(r);if(h>255)return;var f=e[h];if(255===f)return;for(var d=0,p=s-1;(0!==f||d<o)&&-1!==p;p--,d++)f+=a*c[p]>>>0,c[p]=f%256>>>0,f=f/256>>>0;if(0!==f)throw Error("Non-zero carry");o=d,r++}for(var g=s-o;g!==s&&0===c[g];)g++;var m=n.allocUnsafe(i+(s-g));m.fill(0,0,i);for(var y=i;g!==s;)m[y++]=c[g++];return m}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=n.from(e)),!n.isBuffer(e))throw TypeError("Expected Buffer");if(0===e.length)return"";for(var r=0,i=0,o=0,s=e.length;o!==s&&0===e[o];)o++,r++;for(var u=(s-o)*c+1>>>0,h=new Uint8Array(u);o!==s;){for(var f=e[o],d=0,p=u-1;(0!==f||d<i)&&-1!==p;p--,d++)f+=256*h[p]>>>0,h[p]=f%a>>>0,f=f/a>>>0;if(0!==f)throw Error("Non-zero carry");i=d,o++}for(var g=u-i;g!==u&&0===h[g];)g++;for(var m=l.repeat(r);g<u;++g)m+=t.charAt(h[g]);return m},decodeUnsafe:h,decode:function(t){var e=h(t);if(e)return e;throw Error("Non-base"+a+" character")}}}},54611,(t,e,r)=>{e.exports=t.r(50889)("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},72766,(t,e,r)=>{"use strict";function n(t,e,r){return e<=t&&t<=r}function i(t){if(void 0===t)return{};if(t===Object(t))return t;throw TypeError("Could not convert argument to dictionary")}function o(t){this.tokens=[].slice.call(t)}function s(t,e){if(t)throw TypeError("Decoder error");return e||65533}o.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():-1},prepend:function(t){if(Array.isArray(t))for(;t.length;)this.tokens.unshift(t.pop());else this.tokens.unshift(t)},push:function(t){if(Array.isArray(t))for(;t.length;)this.tokens.push(t.shift());else this.tokens.push(t)}};var a="utf-8";function l(t,e){if(!(this instanceof l))return new l(t,e);if((t=void 0!==t?String(t).toLowerCase():a)!==a)throw Error("Encoding not supported. Only utf-8 is supported");e=i(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})}function u(t,e){if(!(this instanceof u))return new u(t,e);if((t=void 0!==t?String(t).toLowerCase():a)!==a)throw Error("Encoding not supported. Only utf-8 is supported");e=i(e),this._streaming=!1,this._encoder=null,this._options={fatal:!!e.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}function c(t){var e=t.fatal,r=0,i=0,o=0,a=128,l=191;this.handler=function(t,u){if(-1===u&&0!==o)return o=0,s(e);if(-1===u)return -1;if(0===o){if(n(u,0,127))return u;if(n(u,194,223))o=1,r=u-192;else if(n(u,224,239))224===u&&(a=160),237===u&&(l=159),o=2,r=u-224;else{if(!n(u,240,244))return s(e);240===u&&(a=144),244===u&&(l=143),o=3,r=u-240}return r<<=6*o,null}if(!n(u,a,l))return r=o=i=0,a=128,l=191,t.prepend(u),s(e);if(a=128,l=191,i+=1,r+=u-128<<6*(o-i),i!==o)return null;var c=r;return r=o=i=0,c}}function h(t){t.fatal,this.handler=function(t,e){if(-1===e)return -1;if(n(e,0,127))return e;n(e,128,2047)?(r=1,i=192):n(e,2048,65535)?(r=2,i=224):n(e,65536,1114111)&&(r=3,i=240);for(var r,i,o=[(e>>6*r)+i];r>0;){var s=e>>6*(r-1);o.push(128|63&s),r-=1}return o}}l.prototype={decode:function(t,e){r="object"==typeof t&&t instanceof ArrayBuffer?new Uint8Array(t):"object"==typeof t&&"buffer"in t&&t.buffer instanceof ArrayBuffer?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(0),e=i(e),this._streaming||(this._decoder=new c({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!e.stream;for(var r,n,s=new o(r),a=[];!s.endOfStream()&&-1!==(n=this._decoder.handler(s,s.read()));)null!==n&&(Array.isArray(n)?a.push.apply(a,n):a.push(n));if(!this._streaming){do{if(-1===(n=this._decoder.handler(s,s.read())))break;if(null===n)continue;Array.isArray(n)?a.push.apply(a,n):a.push(n)}while(!s.endOfStream())this._decoder=null}!a.length||-1===["utf-8"].indexOf(this.encoding)||this._ignoreBOM||this._BOMseen||(65279===a[0]?(this._BOMseen=!0,a.shift()):this._BOMseen=!0);for(var l="",u=0;u<a.length;++u){var h=a[u];h<=65535?l+=String.fromCharCode(h):(h-=65536,l+=String.fromCharCode((h>>10)+55296,(1023&h)+56320))}return l}},u.prototype={encode:function(t,e){t=t?String(t):"",e=i(e),this._streaming||(this._encoder=new h(this._options)),this._streaming=!!e.stream;for(var r,n=[],s=new o(function(t){for(var e=String(t),r=e.length,n=0,i=[];n<r;){var o=e.charCodeAt(n);if(o<55296||o>57343)i.push(o);else if(56320<=o&&o<=57343)i.push(65533);else if(55296<=o&&o<=56319)if(n===r-1)i.push(65533);else{var s=t.charCodeAt(n+1);if(56320<=s&&s<=57343){var a=1023&o,l=1023&s;i.push(65536+(a<<10)+l),n+=1}else i.push(65533)}n+=1}return i}(t));!s.endOfStream()&&-1!==(r=this._encoder.handler(s,s.read()));)Array.isArray(r)?n.push.apply(n,r):n.push(r);if(!this._streaming){for(;-1!==(r=this._encoder.handler(s,s.read()));)Array.isArray(r)?n.push.apply(n,r):n.push(r);this._encoder=null}return new Uint8Array(n)}},r.TextEncoder=u,r.TextDecoder=l},54119,(t,e,r)=>{"use strict";var n=t.i(67034),i=t.e&&t.e.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=t.e&&t.e.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=t.e&&t.e.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;
1a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},a=t.e&&t.e.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&i(e,t,r);return o(e,t),e},l=t.e&&t.e.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0}),r.deserializeUnchecked=r.deserialize=r.serialize=r.BinaryReader=r.BinaryWriter=r.BorshError=r.baseDecode=r.baseEncode=void 0;let u=l(t.r(59341)),c=l(t.r(54611)),h=a(t.r(72766)),f=new("function"!=typeof TextDecoder?h.TextDecoder:TextDecoder)("utf-8",{fatal:!0});r.baseEncode=function(t){return"string"==typeof t&&(t=n.Buffer.from(t,"utf8")),c.default.encode(n.Buffer.from(t))},r.baseDecode=function(t){return n.Buffer.from(c.default.decode(t))};class d extends Error{constructor(t){super(t),this.fieldPath=[],this.originalMessage=t}addToFieldPath(t){this.fieldPath.splice(0,0,t),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}r.BorshError=d;class p{constructor(){this.buf=n.Buffer.alloc(1024),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=n.Buffer.concat([this.buf,n.Buffer.alloc(1024)]))}writeU8(t){this.maybeResize(),this.buf.writeUInt8(t,this.length),this.length+=1}writeU16(t){this.maybeResize(),this.buf.writeUInt16LE(t,this.length),this.length+=2}writeU32(t){this.maybeResize(),this.buf.writeUInt32LE(t,this.length),this.length+=4}writeU64(t){this.maybeResize(),this.writeBuffer(n.Buffer.from(new u.default(t).toArray("le",8)))}writeU128(t){this.maybeResize(),this.writeBuffer(n.Buffer.from(new u.default(t).toArray("le",16)))}writeU256(t){this.maybeResize(),this.writeBuffer(n.Buffer.from(new u.default(t).toArray("le",32)))}writeU512(t){this.maybeResize(),this.writeBuffer(n.Buffer.from(new u.default(t).toArray("le",64)))}writeBuffer(t){this.buf=n.Buffer.concat([n.Buffer.from(this.buf.subarray(0,this.length)),t,n.Buffer.alloc(1024)]),this.length+=t.length}writeString(t){this.maybeResize();let e=n.Buffer.from(t,"utf8");this.writeU32(e.length),this.writeBuffer(e)}writeFixedArray(t){this.writeBuffer(n.Buffer.from(t))}writeArray(t,e){for(let r of(this.maybeResize(),this.writeU32(t.length),t))this.maybeResize(),e(r)}toArray(){return this.buf.subarray(0,this.length)}}function g(t,e,r){let n=r.value;r.value=function(...t){try{return n.apply(this,t)}catch(t){if(t instanceof RangeError&&["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(t.code)>=0)throw new d("Reached the end of buffer when deserializing");throw t}}}r.BinaryWriter=p;class m{constructor(t){this.buf=t,this.offset=0}readU8(){let t=this.buf.readUInt8(this.offset);return this.offset+=1,t}readU16(){let t=this.buf.readUInt16LE(this.offset);return this.offset+=2,t}readU32(){let t=this.buf.readUInt32LE(this.offset);return this.offset+=4,t}readU64(){let t=this.readBuffer(8);return new u.default(t,"le")}readU128(){let t=this.readBuffer(16);return new u.default(t,"le")}readU256(){let t=this.readBuffer(32);return new u.default(t,"le")}readU512(){let t=this.readBuffer(64);return new u.default(t,"le")}readBuffer(t){if(this.offset+t>this.buf.length)throw new d(`Expected buffer length ${t} isn't within bounds`);let e=this.buf.slice(this.offset,this.offset+t);return this.offset+=t,e}readString(){let t=this.readU32(),e=this.readBuffer(t);try{return f.decode(e)}catch(t){throw new d(`Error decoding UTF-8 string: ${t}`)}}readFixedArray(t){return new Uint8Array(this.readBuffer(t))}readArray(t){let e=this.readU32(),r=[];for(let n=0;n<e;++n)r.push(t());return r}}function y(t){return t.charAt(0).toUpperCase()+t.slice(1)}function b(t,e,r,n,i){try{if("string"==typeof n)i[`write${y(n)}`](r);else if(n instanceof Array)if("number"==typeof n[0]){if(r.length!==n[0])throw new d(`Expecting byte array of length ${n[0]}, but got ${r.length} bytes`);i.writeFixedArray(r)}else if(2===n.length&&"number"==typeof n[1]){if(r.length!==n[1])throw new d(`Expecting byte array of length ${n[1]}, but got ${r.length} bytes`);for(let e=0;e<n[1];e++)b(t,null,r[e],n[0],i)}else i.writeArray(r,r=>{b(t,e,r,n[0],i)});else if(void 0!==n.kind)switch(n.kind){case"option":null==r?i.writeU8(0):(i.writeU8(1),b(t,e,r,n.type,i));break;case"map":i.writeU32(r.size),r.forEach((r,o)=>{b(t,e,o,n.key,i),b(t,e,r,n.value,i)});break;default:throw new d(`FieldType ${n} unrecognized`)}else w(t,r,i)}catch(t){throw t instanceof d&&t.addToFieldPath(e),t}}function w(t,e,r){if("function"==typeof e.borshSerialize)return void e.borshSerialize(r);let n=t.get(e.constructor);if(!n)throw new d(`Class ${e.constructor.name} is missing in schema`);if("struct"===n.kind)n.fields.map(([n,i])=>{b(t,n,e[n],i,r)});else if("enum"===n.kind){let i=e[n.field];for(let o=0;o<n.values.length;++o){let[s,a]=n.values[o];if(s===i){r.writeU8(o),b(t,s,e[s],a,r);break}}}else throw new d(`Unexpected schema kind: ${n.kind} for ${e.constructor.name}`)}function v(t,e,r,n){try{if("string"==typeof r)return n[`read${y(r)}`]();if(r instanceof Array)if("number"==typeof r[0])return n.readFixedArray(r[0]);else{if("number"!=typeof r[1])return n.readArray(()=>
1v(t,e,r[0],n));let i=[];for(let e=0;e<r[1];e++)i.push(v(t,null,r[0],n));return i}if("option"===r.kind){if(n.readU8())return v(t,e,r.type,n);return}if("map"===r.kind){let i=new Map,o=n.readU32();for(let s=0;s<o;s++){let o=v(t,e,r.key,n),s=v(t,e,r.value,n);i.set(o,s)}return i}return x(t,r,n)}catch(t){throw t instanceof d&&t.addToFieldPath(e),t}}function x(t,e,r){if("function"==typeof e.borshDeserialize)return e.borshDeserialize(r);let n=t.get(e);if(!n)throw new d(`Class ${e.name} is missing in schema`);if("struct"===n.kind){let n={};for(let[i,o]of t.get(e).fields)n[i]=v(t,i,o,r);return new e(n)}if("enum"===n.kind){let i=r.readU8();if(i>=n.values.length)throw new d(`Enum index: ${i} is out of range`);let[o,s]=n.values[i],a=v(t,o,s,r);return new e({[o]:a})}throw new d(`Unexpected schema kind: ${n.kind} for ${e.constructor.name}`)}s([g],m.prototype,"readU8",null),s([g],m.prototype,"readU16",null),s([g],m.prototype,"readU32",null),s([g],m.prototype,"readU64",null),s([g],m.prototype,"readU128",null),s([g],m.prototype,"readU256",null),s([g],m.prototype,"readU512",null),s([g],m.prototype,"readString",null),s([g],m.prototype,"readFixedArray",null),s([g],m.prototype,"readArray",null),r.BinaryReader=m,r.serialize=function(t,e,r=p){let n=new r;return w(t,e,n),n.toArray()},r.deserialize=function(t,e,r,n=m){let i=new n(r),o=x(t,e,i);if(i.offset<r.length)throw new d(`Unexpected ${r.length-i.offset} bytes after deserialized data`);return o},r.deserializeUnchecked=function(t,e,r,n=m){return x(t,e,new n(r))}},44610,(t,e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.s16=r.s8=r.nu64be=r.u48be=r.u40be=r.u32be=r.u24be=r.u16be=r.nu64=r.u48=r.u40=r.u32=r.u24=r.u16=r.u8=r.offset=r.greedy=r.Constant=r.UTF8=r.CString=r.Blob=r.Boolean=r.BitField=r.BitStructure=r.VariantLayout=r.Union=r.UnionLayoutDiscriminator=r.UnionDiscriminator=r.Structure=r.Sequence=r.DoubleBE=r.Double=r.FloatBE=r.Float=r.NearInt64BE=r.NearInt64=r.NearUInt64BE=r.NearUInt64=r.IntBE=r.Int=r.UIntBE=r.UInt=r.OffsetLayout=r.GreedyCount=r.ExternalLayout=r.bindConstructorLayout=r.nameWithProperty=r.Layout=r.uint8ArrayToBuffer=r.checkUint8Array=void 0,r.constant=r.utf8=r.cstr=r.blob=r.unionLayoutDiscriminator=r.union=r.seq=r.bits=r.struct=r.f64be=r.f64=r.f32be=r.f32=r.ns64be=r.s48be=r.s40be=r.s32be=r.s24be=r.s16be=r.ns64=r.s48=r.s40=r.s32=r.s24=void 0;let n=t.r(43943);function i(t){if(!(t instanceof Uint8Array))throw TypeError("b must be a Uint8Array")}function o(t){return i(t),n.Buffer.from(t.buffer,t.byteOffset,t.length)}r.checkUint8Array=i,r.uint8ArrayToBuffer=o;class s{constructor(t,e){if(!Number.isInteger(t))throw TypeError("span must be an integer");this.span=t,this.property=e}makeDestinationObject(){return{}}getSpan(t,e){if(0>this.span)throw RangeError("indeterminate span");return this.span}replicate(t){let e=Object.create(this.constructor.prototype);return Object.assign(e,this),e.property=t,e}fromArray(t){}}function a(t,e){return e.property?t+"["+e.property+"]":t}r.Layout=s,r.nameWithProperty=a,r.bindConstructorLayout=function(t,e){if("function"!=typeof t)throw TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(t,"layout_"))throw Error("Class is already bound to a layout");if(!(e&&e instanceof s))throw TypeError("layout must be a Layout");if(Object.prototype.hasOwnProperty.call(e,"boundConstructor_"))throw Error("layout is already bound to a constructor");t.layout_=e,e.boundConstructor_=t,e.makeDestinationObject=()=>new t,Object.defineProperty(t.prototype,"encode",{value(t,r){return e.encode(this,t,r)},writable:!0}),Object.defineProperty(t,"decode",{value:(t,r)=>e.decode(t,r),writable:!0})};class l extends s{isCount(){throw Error("ExternalLayout is abstract")}}r.ExternalLayout=l;class u extends l{constructor(t=1,e){if(!Number.isInteger(t)||0>=t)throw TypeError("elementSpan must be a (positive) integer");super(-1,e),this.elementSpan=t}isCount(){return!0}decode(t,e=0){return i(t),Math.floor((t.length-e)/this.elementSpan)}encode(t,e,r){return 0}}r.GreedyCount=u;class c extends l{constructor(t,e=0,r){if(!(t instanceof s))throw TypeError("layout must be a Layout");if(!Number.isInteger(e))throw TypeError("offset must be integer or undefined");super(t.span,r||t.property),this.layout=t,this.offset=e}isCount(){return this.layout instanceof h||this.layout instanceof f}decode(t,e=0){return this.layout.decode(t,e+this.offset)}encode(t,e,r=0){return this.layout.encode(t,e,r+this.offset)}}r.OffsetLayout=c;class h extends s{constructor(t,e){if(super(t,e),6<this.span)throw RangeError("span must not exceed 6 bytes")}decode(t,e=0){return o(t).readUIntLE(e,this.span)}encode(t,e,r=0){return o(e).writeUIntLE(t,r,this.span),this.span}}r.UInt=h;class f extends s{constructor(t,e){if(super(t,e),6<this.span)throw RangeError("span must not exceed 6 bytes")}decode(t,e=0){return o(t).readUIntBE(e,this.span)}encode(t,e,r=0){return o(e).writeUIntBE(t,r,this.span),this.span}}r.UIntBE=f;class d extends s{constructor(t,e){if(super(t,e),6<this.span)throw RangeError("span must not exceed 6 bytes")}decode(t,e=0){return o(t).readIntLE(e,this.span)}encode(t,e,r=0){return o(e).writeIntLE(t,r,this.span),this.span}}r.Int=d;class p extends s{constructor(t,e){if(super(t,e),6<this.span)throw RangeError("span must not exceed 6 bytes")}decode(t,e=0){return o(t).readIntBE(e,this.span)}encode(t,e,r=0){return o(e).writeIntBE(t,r,this.span),this.span}}function g(t){let e=Math.floor(t/0x100000000);return{hi32:e,lo32:t-0x100000000*e}}function m(t,e){return 0x100000000*t+e}r.IntBE=p;class y extends s{constructor(t){super(8,t)}decode(t,e=0){let r=o(t),n=r.readUInt32LE(e);return m(r.readUInt32LE(e+4),n)}encode(t,e,r=0){let n=g(t),i=o(e);return i.writeUInt32LE(n.lo32,r),i.writeUInt32LE(n.hi32,r+4),8}}r.NearUInt64=y;class b extends s{constructor(t){super(8,t)}decode(t,e=0){let r=o(t);return m(r.readUInt32BE(e),r.readUInt32BE(e+4))}encode(t,e,r=0){let n=g(t),i=o(e);return i.writeUInt32BE(n.hi32,r),i.writeUInt32BE(n.lo32,r+4),8}}r.NearUInt64BE=b;class w extends s{constructor(t){super(8,t)}decode(t,e=0){let r=o(t),n=r.readUInt32LE(e);return m(r.readInt32LE(e+4),n)}encode(t,e,r=0){let n=g(t),i=o(e);return i.writeUInt32LE(n.lo32,r),i.writeInt32LE(n.hi32,r+4),8}}r.NearInt64=w;class v extends s{constructor(t){super(8,t)}decode(t,e=0){let r=o(t);return m(r.readInt32BE(e),r.readUInt32BE(e+4))}encode(t,e,r=0){let n=g(t),i=o(e);return i.writeInt32BE(n.hi32,r),i.writeUInt32BE(n.lo32,r+4),8}}r.NearInt64BE=v;class x extends s{constructor(t){super(4,t)}decode(t,e=0){return o(t).readFloatLE(e)}encode(t,e,r=0){return o(e).writeFloatLE(t,r),4}}r.Float=x;class E extends s{constructor(t){super(4,t)}decode(t,e=0){return o(t).readFloatBE(e)}encode(t,e,r=0){return o(e).writeFloatBE(t,r),4}}r.FloatBE=E;class S extends s{constructor(t){super(8,t)}decode(t,e=0){return o(t).readDoubleLE(e)}encode(t,e,r=0){return o(e).writeDoubleLE(t,r),8}}r.Double=S;class k extends s{constructor(t){super(8,t)}decode(t,e=0){return o(t).readDoubleBE(e)}encode(t,e,r=0){return o(e).writeDoubleBE(t,r),8}}r.DoubleBE=k;class A extends s{constructor(t,e,r){if(!(t instanceof s))throw TypeError("elementLayout must be a Layout");if(!(e instanceof l&&e.isCount()||Number.isInteger(e)&&0<=e))throw TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let n=-1;e instanceof l||!(0<t.span)||(n=e*t.span),super(n,r),this.elementLayout=t,this.count=e}getSpan(t,e=0){if(0<=this.span)return this.span;let r=0,n=this.count;if(n instanceof l&&(n=n.decode(t,e)),0<this.elementLayout.span)r=n*this.elementLayout.span;else{let i=0;for(;i<n;)r+=this.elementLayout.getSpan(t,e+r),++i}return r}decode(t,e=0){let r=[],n=0,i=this.count;for(i instanceof l&&(i=i.decode(t,e));n<i;)r.push(this.elementLayout.decode(t,e)),e+=this.elementLayout.getSpan(t,e),n+=1;return r}encode(t,e,r=0){let n=this.elementLayout,i=t.reduce((t,i)=>t+n.encode(i,e,r+t),0);return this.count instanceof l&&this.count.encode(t.length,e,r),i}}r.Sequence=A;class I extends s{constructor(t,e,r){if(!(Array.isArray(t)&&t.reduce((t,e)=>t&&e instanceof s,!0)))throw TypeError("fields must be array of Layout instances");for(const n of("boolean"==typeof e&&void 0===r&&(r=e,e=void 0),t))if(0>
1n.span&&void 0===n.property)throw Error("fields cannot contain unnamed variable-length layout");let n=-1;try{n=t.reduce((t,e)=>t+e.getSpan(),0)}catch(t){}super(n,e),this.fields=t,this.decodePrefixes=!!r}getSpan(t,e=0){if(0<=this.span)return this.span;let r=0;try{r=this.fields.reduce((r,n)=>{let i=n.getSpan(t,e);return e+=i,r+i},0)}catch(t){throw RangeError("indeterminate span")}return r}decode(t,e=0){i(t);let r=this.makeDestinationObject();for(let n of this.fields)if(void 0!==n.property&&(r[n.property]=n.decode(t,e)),e+=n.getSpan(t,e),this.decodePrefixes&&t.length===e)break;return r}encode(t,e,r=0){let n=r,i=0,o=0;for(let n of this.fields){let s=n.span;if(o=0<s?s:0,void 0!==n.property){let i=t[n.property];void 0!==i&&(o=n.encode(i,e,r),0>s&&(s=n.getSpan(e,r)))}i=r,r+=s}return i+o-n}fromArray(t){let e=this.makeDestinationObject();for(let r of this.fields)void 0!==r.property&&0<t.length&&(e[r.property]=t.shift());return e}layoutFor(t){if("string"!=typeof t)throw TypeError("property must be string");for(let e of this.fields)if(e.property===t)return e}offsetOf(t){if("string"!=typeof t)throw TypeError("property must be string");let e=0;for(let r of this.fields){if(r.property===t)return e;0>r.span?e=-1:0<=e&&(e+=r.span)}}}r.Structure=I;class B{constructor(t){this.property=t}decode(t,e){throw Error("UnionDiscriminator is abstract")}encode(t,e,r){throw Error("UnionDiscriminator is abstract")}}r.UnionDiscriminator=B;class _ extends B{constructor(t,e){if(!(t instanceof l&&t.isCount()))throw TypeError("layout must be an unsigned integer ExternalLayout");super(e||t.property||"variant"),this.layout=t}decode(t,e){return this.layout.decode(t,e)}encode(t,e,r){return this.layout.encode(t,e,r)}}r.UnionLayoutDiscriminator=_;class M extends s{constructor(t,e,r){let n;if(t instanceof h||t instanceof f)n=new _(new c(t));else if(t instanceof l&&t.isCount())n=new _(t);else if(t instanceof B)n=t;else throw TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(void 0===e&&(e=null),!(null===e||e instanceof s))throw TypeError("defaultLayout must be null or a Layout");if(null!==e){if(0>e.span)throw Error("defaultLayout must have constant span");void 0===e.property&&(e=e.replicate("content"))}let i=-1;e&&0<=(i=e.span)&&(t instanceof h||t instanceof f)&&(i+=n.layout.span),super(i,r),this.discriminator=n,this.usesPrefixDiscriminator=t instanceof h||t instanceof f,this.defaultLayout=e,this.registry={};let o=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(t){return o(t)},this.configGetSourceVariant=function(t){o=t.bind(this)}}getSpan(t,e=0){if(0<=this.span)return this.span;let r=this.getVariant(t,e);if(!r)throw Error("unable to determine span for unrecognized variant");return r.getSpan(t,e)}defaultGetSourceVariant(t){if(Object.prototype.hasOwnProperty.call(t,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(t,this.defaultLayout.property))return;let e=this.registry[t[this.discriminator.property]];if(e&&(!e.layout||e.property&&Object.prototype.hasOwnProperty.call(t,e.property)))return e}else for(let e in this.registry){let r=this.registry[e];if(r.property&&Object.prototype.hasOwnProperty.call(t,r.property))return r}throw Error("unable to infer src variant")}decode(t,e=0){let r,n=this.discriminator,i=n.decode(t,e),o=this.registry[i];if(void 0===o){let o=this.defaultLayout,s=0;this.usesPrefixDiscriminator&&(s=n.layout.span),(r=this.makeDestinationObject())[n.property]=i,r[o.property]=o.decode(t,e+s)}else r=o.decode(t,e);return r}encode(t,e,r=0){let n=this.getSourceVariant(t);if(void 0===n){let n=this.discriminator,i=this.defaultLayout,o=0;return this.usesPrefixDiscriminator&&(o=n.layout.span),n.encode(t[n.property],e,r),o+i.encode(t[i.property],e,r+o)}return n.encode(t,e,r)}addVariant(t,e,r){let n=new C(this,t,e,r);return this.registry[t]=n,n}getVariant(t,e=0){let r;return r=t instanceof Uint8Array?this.discriminator.decode(t,e):t,this.registry[r]}}r.Union=M;class C extends s{constructor(t,e,r,n){if(!(t instanceof M))throw TypeError("union must be a Union");if(!Number.isInteger(e)||0>e)throw TypeError("variant must be a (non-negative) integer");if("string"==typeof r&&void 0===n&&(n=r,r=null),r){if(!(r instanceof s))throw TypeError("layout must be a Layout");
1if(null!==t.defaultLayout&&0<=r.span&&r.span>t.defaultLayout.span)throw Error("variant span exceeds span of containing union");if("string"!=typeof n)throw TypeError("variant must have a String property")}let i=t.span;0>t.span&&0<=(i=r?r.span:0)&&t.usesPrefixDiscriminator&&(i+=t.discriminator.layout.span),super(i,n),this.union=t,this.variant=e,this.layout=r||null}getSpan(t,e=0){if(0<=this.span)return this.span;let r=0;this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span);let n=0;return this.layout&&(n=this.layout.getSpan(t,e+r)),r+n}decode(t,e=0){let r=this.makeDestinationObject();if(this!==this.union.getVariant(t,e))throw Error("variant mismatch");let n=0;return this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),this.layout?r[this.property]=this.layout.decode(t,e+n):this.property?r[this.property]=!0:this.union.usesPrefixDiscriminator&&(r[this.union.discriminator.property]=this.variant),r}encode(t,e,r=0){let n=0;if(this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(t,this.property))throw TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,e,r);let i=n;if(this.layout&&(this.layout.encode(t[this.property],e,r+n),i+=this.layout.getSpan(e,r+n),0<=this.union.span&&i>this.union.span))throw Error("encoded variant overruns containing union");return i}fromArray(t){if(this.layout)return this.layout.fromArray(t)}}function T(t){return 0>t&&(t+=0x100000000),t}r.VariantLayout=C;class L extends s{constructor(t,e,r){if(!(t instanceof h||t instanceof f))throw TypeError("word must be a UInt or UIntBE layout");if("string"==typeof e&&void 0===r&&(r=e,e=!1),4<t.span)throw RangeError("word cannot exceed 32 bits");super(t.span,r),this.word=t,this.msb=!!e,this.fields=[];let n=0;this._packedSetValue=function(t){return n=T(t),this},this._packedGetValue=function(){return n}}decode(t,e=0){let r=this.makeDestinationObject(),n=this.word.decode(t,e);for(let e of(this._packedSetValue(n),this.fields))void 0!==e.property&&(r[e.property]=e.decode(t));return r}encode(t,e,r=0){let n=this.word.decode(e,r);for(let e of(this._packedSetValue(n),this.fields))if(void 0!==e.property){let r=t[e.property];void 0!==r&&e.encode(r)}return this.word.encode(this._packedGetValue(),e,r)}addField(t,e){let r=new R(this,t,e);return this.fields.push(r),r}addBoolean(t){let e=new O(this,t);return this.fields.push(e),e}fieldFor(t){if("string"!=typeof t)throw TypeError("property must be string");for(let e of this.fields)if(e.property===t)return e}}r.BitStructure=L;class R{constructor(t,e,r){if(!(t instanceof L))throw TypeError("container must be a BitStructure");if(!Number.isInteger(e)||0>=e)throw TypeError("bits must be positive integer");const n=8*t.span,i=t.fields.reduce((t,e)=>t+e.bits,0);if(e+i>n)throw Error("bits too long for span remainder ("+(n-i)+" of "+n+" remain)");this.container=t,this.bits=e,this.valueMask=(1<<e)-1,32===e&&(this.valueMask=0xffffffff),this.start=i,this.container.msb&&(this.start=n-i-e),this.wordMask=T(this.valueMask<<this.start),this.property=r}decode(t,e){return T(this.container._packedGetValue()&this.wordMask)>>>this.start}encode(t){if("number"!=typeof t||!Number.isInteger(t)||t!==T(t&this.valueMask))throw TypeError(a("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);let e=this.container._packedGetValue(),r=T(t<<this.start);this.container._packedSetValue(T(e&~this.wordMask)|r)}}r.BitField=R;class O extends R{constructor(t,e){super(t,1,e)}decode(t,e){return!!super.decode(t,e)}encode(t){"boolean"==typeof t&&(t*=1),super.encode(t)}}r.Boolean=O;class P extends s{constructor(t,e){if(!(t instanceof l&&t.isCount()||Number.isInteger(t)&&0<=t))throw TypeError("length must be positive integer or an unsigned integer ExternalLayout");let r=-1;t instanceof l||(r=t),super(r,e),this.length=t}getSpan(t,e){let r=this.span;return 0>r&&(r=this.length.decode(t,e)),r}decode(t,e=0){let r=this.span;return 0>r&&(r=this.length.decode(t,e)),o(t).slice(e,e+r)}encode(t,e,r){let n=this.length;if(this.length instanceof l&&(n=t.length),!(t instanceof Uint8Array&&n===t.length))throw TypeError(a("Blob.encode",this)+" requires (length "+n+") Uint8Array as src");if(r+n>e.length)throw RangeError("encoding overruns Uint8Array");let i=o(t);return o(e).write(i.toString("hex"),r,n,"hex"),this.length instanceof l&&this.length.encode(n,e,r),n}}r.Blob=P;class U extends s{constructor(t){super(-1,t)}getSpan(t,e=0){i(t);let r=e;for(;r<t.length&&0!==t[r];)r+=1;return 1+r-e}decode(t,e=0){let r=this.getSpan(t,e);return o(t).slice(e,e+r-1).toString("utf-8")}encode(t,e,r=0){"string"!=typeof t&&(t=String(t));let i=n.Buffer.from(t,"utf8"),s=i.length;if(r+s>e.length)throw RangeError("encoding overruns Buffer");let a=o(e);return i.copy(a,r),a[r+s]=0,s+1}}r.CString=U;class N extends s{constructor(t,e){if("string"==typeof t&&void 0===e&&(e=t,t=void 0),void 0===t)t=-1;else if(!Number.isInteger(t))throw TypeError("maxSpan must be an integer");super(-1,e),this.maxSpan=t}getSpan(t,e=0){return i(t),t.length-e}decode(t,e=0){let r=this.getSpan(t,e);if(0<=this.maxSpan&&this.maxSpan<r)throw RangeError("text length exceeds maxSpan");return o(t).slice(e,e+r).toString("utf-8")}encode(t,e,r=0){"string"!=typeof t&&(t=String(t));let i=n.Buffer.from(t,"utf8"),s=i.length;if(0<=this.maxSpan&&this.maxSpan<s)throw RangeError("text length exceeds maxSpan");if(r+s>e.length)throw RangeError("encoding overruns Buffer");return i.copy(o(e),r),s}}r.UTF8=N;class z extends s{constructor(t,e){super(0,e),this.value=t}decode(t,e){return this.value}encode(t,e,r){return 0}}r.Constant=z,r.greedy=(t,e)=>new u(t,e),r.offset=(t,e,r)=>new c(t,e,r),r.u8=t=>new h(1,t),r.u16=t=>new h(2,t),r.u24=t=>new h(3,t),r.u32=t=>new h(4,t),r.u40=t=>new h(5,t),r.u48=t=>new h(6,t),r.nu64=t=>new y(t),r.u16be=t=>new f(2,t),r.u24be=t=>new f(3,t),r.u32be=t=>new f(4,t),r.u40be=t=>new f(5,t),r.u48be=t=>new f(6,t),r.nu64be=t=>new b(t),r.s8=t=>new d(1,t),r.s16=t=>new d(2,t),r.s24=t=>new d(3,t),r.s32=t=>new d(4,t),r.s40=t=>new d(5,t),r.s48=t=>new d(6,t),r.ns64=t=>new w(t),r.s16be=t=>new p(2,t),r.s24be=t=>new p(3,t),r.s32be=t=>new p(4,t),r.s40be=t=>new p(5,t),r.s48be=t=>new p(6,t),r.ns64be=t=>new v(t),r.f32=t=>new x(t),r.f32be=t=>new E(t),r.f64=t=>new S(t),r.f64be=t=>new k(t),r.struct=(t,e,r)=>new I(t,e,r),r.bits=(t,e,r)=>new L(t,e,r),r.seq=(t,e,r)=>new A(t,e,r),r.union=(t,e,r)=>new M(t,e,r),r.unionLayoutDiscriminator=(t,e)=>new _(t,e),r.blob=(t,e)=>new P(t,e),r.cstr=t=>new U(t),r.utf8=(t,e)=>new N(t,e),r.constant=(t,e)=>new z(t,e)},37342,t=>{"use strict";t.s([],48636),t.i(48636);var e,r,n,i=new Uint8Array(16);function o(){if(!e&&!(e="u">typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"u">typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return e(i)}let s=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,a=function(t){return"string"==typeof t&&s.test(t)};for(var l=[],u=0;u<256;++u)l.push((u+256).toString(16).substr(1));let c=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(l[t[e+0]]+l[t[e+1]]+l[t[e+2]]+l[t[e+3]]+"-"+l[t[e+4]]+l[t[e+5]]+"-"+l[t[e+6]]+l[t[e+7]]+"-"+l[t[e+8]]+l[t[e+9]]+"-"+l[t[e+10]]+l[t[e+11]]+l[t[e+12]]+l[t[e+13]]+l[t[e+14]]+l[t[e+15]]).toLowerCase();
1if(!a(r))throw TypeError("Stringified UUID is invalid");return r};var h=0,f=0;let d=function(t){if(!a(t))throw TypeError("Invalid UUID");var e,r=new Uint8Array(16);return r[0]=(e=parseInt(t.slice(0,8),16))>>>24,r[1]=e>>>16&255,r[2]=e>>>8&255,r[3]=255&e,r[4]=(e=parseInt(t.slice(9,13),16))>>>8,r[5]=255&e,r[6]=(e=parseInt(t.slice(14,18),16))>>>8,r[7]=255&e,r[8]=(e=parseInt(t.slice(19,23),16))>>>8,r[9]=255&e,r[10]=(e=parseInt(t.slice(24,36),16))/0x10000000000&255,r[11]=e/0x100000000&255,r[12]=e>>>24&255,r[13]=e>>>16&255,r[14]=e>>>8&255,r[15]=255&e,r};function p(t,e,r){function n(t,n,i,o){if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r));return e}(t)),"string"==typeof n&&(n=d(n)),16!==n.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var s=new Uint8Array(16+t.length);if(s.set(n),s.set(t,n.length),(s=r(s))[6]=15&s[6]|e,s[8]=63&s[8]|128,i){o=o||0;for(var a=0;a<16;++a)i[o+a]=s[a];return i}return c(s)}try{n.name=t}catch(t){}return n.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",n.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",n}function g(t){return(t+64>>>9<<4)+14+1}function m(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}function y(t,e,r,n,i,o){var s;return m((s=m(m(e,t),m(n,o)))<<i|s>>>32-i,r)}function b(t,e,r,n,i,o,s){return y(e&r|~e&n,t,e,i,o,s)}function w(t,e,r,n,i,o,s){return y(e&n|r&~n,t,e,i,o,s)}function v(t,e,r,n,i,o,s){return y(e^r^n,t,e,i,o,s)}function x(t,e,r,n,i,o,s){return y(r^(e|~n),t,e,i,o,s)}var E=p("v3",48,function(t){if("string"==typeof t){var e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(var r=0;r<e.length;++r)t[r]=e.charCodeAt(r)}return function(t){for(var e=[],r=32*t.length,n="0123456789abcdef",i=0;i<r;i+=8){var o=t[i>>5]>>>i%32&255,s=parseInt(n.charAt(o>>>4&15)+n.charAt(15&o),16);e.push(s)}return e}(function(t,e){t[e>>5]|=128<<e%32,t[g(e)-1]=e;for(var r=0x67452301,n=-0x10325477,i=-0x67452302,o=0x10325476,s=0;s<t.length;s+=16){var a=r,l=n,u=i,c=o;r=b(r,n,i,o,t[s],7,-0x28955b88),o=b(o,r,n,i,t[s+1],12,-0x173848aa),i=b(i,o,r,n,t[s+2],17,0x242070db),n=b(n,i,o,r,t[s+3],22,-0x3e423112),r=b(r,n,i,o,t[s+4],7,-0xa83f051),o=b(o,r,n,i,t[s+5],12,0x4787c62a),i=b(i,o,r,n,t[s+6],17,-0x57cfb9ed),n=b(n,i,o,r,t[s+7],22,-0x2b96aff),r=b(r,n,i,o,t[s+8],7,0x698098d8),o=b(o,r,n,i,t[s+9],12,-0x74bb0851),i=b(i,o,r,n,t[s+10],17,-42063),n=b(n,i,o,r,t[s+11],22,-0x76a32842),r=b(r,n,i,o,t[s+12],7,0x6b901122),o=b(o,r,n,i,t[s+13],12,-0x2678e6d),i=b(i,o,r,n,t[s+14],17,-0x5986bc72),n=b(n,i,o,r,t[s+15],22,0x49b40821),r=w(r,n,i,o,t[s+1],5,-0x9e1da9e),o=w(o,r,n,i,t[s+6],9,-0x3fbf4cc0),i=w(i,o,r,n,t[s+11],14,0x265e5a51),n=w(n,i,o,r,t[s],20,-0x16493856),r=w(r,n,i,o,t[s+5],5,-0x29d0efa3),o=w(o,r,n,i,t[s+10],9,0x2441453),i=w(i,o,r,n,t[s+15],14,-0x275e197f),n=w(n,i,o,r,t[s+4],20,-0x182c0438),r=w(r,n,i,o,t[s+9],5,0x21e1cde6),o=w(o,r,n,i,t[s+14],9,-0x3cc8f82a),i=w(i,o,r,n,t[s+3],14,-0xb2af279),n=w(n,i,o,r,t[s+8],20,0x455a14ed),r=w(r,n,i,o,t[s+13],5,-0x561c16fb),o=w(o,r,n,i,t[s+2],9,-0x3105c08),i=w(i,o,r,n,t[s+7],14,0x676f02d9),n=w(n,i,o,r,t[s+12],20,-0x72d5b376),r=v(r,n,i,o,t[s+5],4,-378558),o=v(o,r,n,i,t[s+8],11,-0x788e097f),i=v(i,o,r,n,t[s+11],16,0x6d9d6122),n=v(n,i,o,r,t[s+14],23,-0x21ac7f4),r=v(r,n,i,o,t[s+1],4,-0x5b4115bc),o=v(o,r,n,i,t[s+4],11,0x4bdecfa9),i=v(i,o,r,n,t[s+7],16,-0x944b4a0),n=v(n,i,o,r,t[s+10],23,-0x41404390),r=v(r,n,i,o,t[s+13],4,0x289b7ec6),o=v(o,r,n,i,t[s],11,-0x155ed806),i=v(i,o,r,n,t[s+3],16,-0x2b10cf7b),n=v(n,i,o,r,t[s+6],23,0x4881d05),r=v(r,n,i,o,t[s+9],4,-0x262b2fc7),o=v(o,r,n,i,t[s+12],11,-0x1924661b),i=v(i,o,r,n,t[s+15],16,0x1fa27cf8),n=v(n,i,o,r,t[s+2],23,-0x3b53a99b),r=x(r,n,i,o,t[s],6,-0xbd6ddbc),o=x(o,r,n,i,t[s+7],10,0x432aff97),i=x(i,o,r,n,t[s+14],15,-0x546bdc59),n=x(n,i,o,r,t[s+5],21,-0x36c5fc7),r=x(r,n,i,o,t[s+12],6,0x655b59c3),o=x(o,r,n,i,t[s+3],10,-0x70f3336e),i=x(i,o,r,n,t[s+10],15,-1051523),n=x(n,i,o,r,t[s+1],21,-0x7a7ba22f),r=x(r,n,i,o,t[s+8],6,0x6fa87e4f),o=x(o,r,n,i,t[s+15],10,-0x1d31920),i=x(i,o,r,n,t[s+6],15,-0x5cfebcec),n=x(n,i,o,r,t[s+13],21,0x4e0811a1),r=x(r,n,i,o,t[s+4],6,-0x8ac817e),o=x(o,r,n,i,t[s+11],10,-0x42c50dcb),i=x(i,o,r,n,t[s+2],15,0x2ad7d2bb),n=x(n,i,o,r,t[s+9],21,-0x14792c6f),r=m(r,a),n=m(n,l),i=m(i,u),o=m(o,c)}return[r,n,i,o]}(function(t){if(0===t.length)return[];for(var e=8*t.length,r=new Uint32Array(g(e)),n=0;n<e;n+=8)r[n>>5]|=(255&t[n/8])<<n%32;return r}(t),8*t.length))});function S(t,e){return t<<e|t>>>32-e}var k=p("v5",80,function(t){var e=[0x5a827999,0x6ed9eba1,0x8f1bbcdc,0xca62c1d6],r=[0x67452301,0xefcdab89,0x98badcfe,0x10325476,0xc3d2e1f0];if("string"==typeof t){var n=unescape(encodeURIComponent(t));t=[];for(var i=0;i<n.length;++i)t.push(n.charCodeAt(i))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);for(var o=Math.ceil((t.length/4+2)/16),s=Array(o),a=0;a<o;++a){for(var l=new Uint32Array(16),u=0;u<16;++u)l[u]=t[64*a+4*u]<<24|t[64*a+4*u+1]<<16|t[64*a+4*u+2]<<8|t[64*a+4*u+3];s[a]=l}s[o-1][14]=(t.length-1)*8/0x100000000,s[o-1][14]=Math.floor(s[o-1][14]),s[o-1][15]=(t.length-1)*8|0;for(var c=0;c<o;++c){for(var h=new Uint32Array(80),f=0;f<16;++f)h[f]=s[c][f];for(var d=16;d<80;++d)h[d]=S(h[d-3]^h[d-8]^h[d-14]^h[d-16],1);for(var p=r[0],g=r[1],m=r[2],y=r[3],b=r[4],w=0;w<80;++w){var v=Math.floor(w/20),x=S(p,5)+function(t,e,r,n){switch(t){case 0:return e&r^~e&n;case 1:case 3:return e^r^n;case 2:return e&r^e&n^r&n}}(v,g,m,y)+b+e[v]+h[w]>>>0;b=y,y=m,m=S(g,30)>>>0,g=p,p=x}r[0]=r[0]+p>>>0,r[1]=r[1]+g>>>0,r[2]=r[2]+m>>>0,r[3]=r[3]+y>>>0,r[4]=r[4]+b>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]});t.s(["NIL",0,"00000000-0000-0000-0000-000000000000","parse",0,d,"stringify",0,c,"v1",0,function(t,e,
1i){var s=e&&i||0,a=e||Array(16),l=(t=t||{}).node||r,u=void 0!==t.clockseq?t.clockseq:n;if(null==l||null==u){var d=t.random||(t.rng||o)();null==l&&(l=r=[1|d[0],d[1],d[2],d[3],d[4],d[5]]),null==u&&(u=n=(d[6]<<8|d[7])&16383)}var p=void 0!==t.msecs?t.msecs:Date.now(),g=void 0!==t.nsecs?t.nsecs:f+1,m=p-h+(g-f)/1e4;if(m<0&&void 0===t.clockseq&&(u=u+1&16383),(m<0||p>h)&&void 0===t.nsecs&&(g=0),g>=1e4)throw Error("uuid.v1(): Can't create more than 10M uuids/sec");h=p,f=g,n=u;var y=((0xfffffff&(p+=122192928e5))*1e4+g)%0x100000000;a[s++]=y>>>24&255,a[s++]=y>>>16&255,a[s++]=y>>>8&255,a[s++]=255&y;var b=p/0x100000000*1e4&0xfffffff;a[s++]=b>>>8&255,a[s++]=255&b,a[s++]=b>>>24&15|16,a[s++]=b>>>16&255,a[s++]=u>>>8|128,a[s++]=255&u;for(var w=0;w<6;++w)a[s+w]=l[w];return e||c(a)},"v3",0,E,"v4",0,function(t,e,r){var n=(t=t||{}).random||(t.rng||o)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){r=r||0;for(var i=0;i<16;++i)e[r+i]=n[i];return e}return c(n)},"v5",0,k,"validate",0,a,"version",0,function(t){if(!a(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}],37342)},43173,(t,e,r)=>{"use strict";let n=t.r(37342).v4;e.exports=function(t,e,r,i){if("string"!=typeof t)throw TypeError(t+" must be a string");let o="number"==typeof(i=i||{}).version?i.version:2;if(1!==o&&2!==o)throw TypeError(o+" must be 1 or 2");let s={method:t};if(2===o&&(s.jsonrpc="2.0"),e){if("object"!=typeof e&&!Array.isArray(e))throw TypeError(e+" must be an object, array or omitted");s.params=e}return void 0===r?s.id=("function"==typeof i.generator?i.generator:function(){return n()})(s,i):2===o&&null===r?i.notificationIdNull&&(s.id=null):s.id=r,s}},78217,(t,e,r)=>{"use strict";let n=t.r(37342).v4,i=t.r(43173),o=function(t,e){if(!(this instanceof o))return new o(t,e);e||(e={}),this.options={reviver:void 0!==e.reviver?e.reviver:null,replacer:void 0!==e.replacer?e.replacer:null,generator:void 0!==e.generator?e.generator:function(){return n()},version:void 0!==e.version?e.version:2,notificationIdNull:"boolean"==typeof e.notificationIdNull&&e.notificationIdNull},this.callServer=t};e.exports=o,o.prototype.request=function(t,e,r,n){let o,s=this,a=null,l=Array.isArray(t)&&"function"==typeof e;if(1===this.options.version&&l)throw TypeError("JSON-RPC 1.0 does not support batching");let u=!l&&t&&"object"==typeof t&&"function"==typeof e;if(l||u)n=e,a=t;else{"function"==typeof r&&(n=r,r=void 0);let o="function"==typeof n;try{a=i(t,e,r,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(t){if(o)return void n(t);throw t}if(!o)return a}try{o=JSON.stringify(a,this.options.replacer)}catch(t){n(t);return}return this.callServer(o,function(t,e){s._parseResponse(t,e,n)}),a},o.prototype._parseResponse=function(t,e,r){let n;if(t)return void r(t);if(!e)return void r();try{n=JSON.parse(e,this.options.reviver)}catch(t){r(t);return}if(3===r.length)if(!Array.isArray(n))return void r(null,n.error,n.result);else{let t=function(t){return void 0!==t.error};r(null,n.filter(t),n.filter(function(e){return!t(e)}));return}r(null,n)}},38750,(t,e,r)=>{e.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},87201,(t,e,r)=>{let n,i=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];r.getSymbolSize=function(t){if(!t)throw Error('"version" cannot be null or undefined');if(t<1||t>40)throw Error('"version" should be in range from 1 to 40');return 4*t+17},r.getSymbolTotalCodewords=function(t){return i[t]},r.getBCHDigit=function(t){let e=0;for(;0!==t;)e++,t>>>=1;return e},r.setToSJISFunction=function(t){if("function"!=typeof t)throw Error('"toSJISFunc" is not a valid function.');n=t},r.isKanjiModeEnabled=function(){return void 0!==n},r.toSJIS=function(t){return n(t)}},73133,(t,e,r)=>{r.L={bit:1},r.M={bit:0},r.Q={bit:3},r.H={bit:2},r.isValid=function(t){return t&&void 0!==t.bit&&t.bit>=0&&t.bit<4},r.from=function(t,e){if(r.isValid(t))return t;try{if("string"!=typeof t)throw Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return r.L;case"m":case"medium":return r.M;case"q":case"quartile":return r.Q;case"h":case"high":return r.H;default:throw Error("Unknown EC Level: "+t)}}catch(t){return e}}},73666,(t,e,r)=>{function n(){this.buffer=[],this.length=0}n.prototype={get:function(t){let e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)==1},put:function(t,e){for(let r=0;r<e;r++)this.putBit((t>>>e-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){let e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}},e.exports=n},11421,(t,e,r)=>{function n(t){if(!t||t<1)throw Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}n.prototype.set=function(t,e,r,n){let i=t*this.size+e;this.data[i]=r,n&&(this.reservedBit[i]=!0)},n.prototype.get=function(t,e){return this.data[t*this.size+e]},n.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},n.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]},e.exports=n},20637,(t,e,r)=>{let n=t.r(87201).getSymbolSize;r.getRowColCoords=function(t){if(1===t)return[];let e=Math.floor(t/7)+2,r=n(t),i=145===r?26:2*Math.ceil((r-13)/(2*e-2)),o=[r-7];for(let t=1;t<e-1;t++)o[t]=o[t-1]-i;return o.push(6),o.reverse()},r.getPositions=function(t){let e=[],n=r.getRowColCoords(t),i=n.length;for(let t=0;t<i;t++)for(let r=0;r<i;r++)(0!==t||0!==r)&&(0!==t||r!==i-1)&&(t!==i-1||0!==r)&&e.push([n[t],n[r]]);return e}},14002,(t,e,r)=>{let n=t.r(87201).getSymbolSize;r.getPositions=function(t){let e=n(t);return[[0,0],[e-7,0],[0,e-7]]}},37692,(t,e,r)=>{r.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};r.isValid=function(t){return null!=t&&""!==t&&!isNaN(t)&&t>=0&&t<=7},r.from=function(t){return r.isValid(t)?parseInt(t,10):void 0},r.getPenaltyN1=function(t){let e=t.size,r=0,n=0,i=0,o=null,s=null;for(let a=0;a<e;a++){n=i=0,o=s=null;for(let l=0;l<e;l++){let e=t.get(a,l);e===o?n++:(n>=5&&(r+=3+(n-5)),o=e,n=1),(e=t.get(l,a))===s?i++:(i>=5&&(r+=3+(i-5)),s=e,i=1)}n>=5&&(r+=3+(n-5)),i>=5&&(r+=3+(i-5))}return r},r.getPenaltyN2=function(t){let e=t.size,r=0;for(let n=0;n<e-1;n++)for(let i=0;i<e-1;i++){let e=t.get(n,i)+t.get(n,i+1)+t.get(n+1,i)+t.get(n+1,i+1);(4===e||0===e)&&r++}return 3*r},r.getPenaltyN3=function(t){let e=t.size,r=0,n=0,i=0;for(let o=0;o<e;o++){n=i=0;for(let s=0;s<e;s++)n=n<<1&2047|t.get(o,s),s>=10&&(1488===n||93===n)&&r++,i=i<<1&2047|t.get(s,o),s>=10&&(1488===i||93===i)&&r++}return 40*r},r.getPenaltyN4=function(t){let e=0,r=t.data.length;for(let n=0;n<r;n++)e+=t.data[n];return 10*Math.abs(Math.ceil(100*e/r/5)-10)}
1,r.applyMask=function(t,e){let n=e.size;for(let i=0;i<n;i++)for(let o=0;o<n;o++)e.isReserved(o,i)||e.xor(o,i,function(t,e,n){switch(t){case r.Patterns.PATTERN000:return(e+n)%2==0;case r.Patterns.PATTERN001:return e%2==0;case r.Patterns.PATTERN010:return n%3==0;case r.Patterns.PATTERN011:return(e+n)%3==0;case r.Patterns.PATTERN100:return(Math.floor(e/2)+Math.floor(n/3))%2==0;case r.Patterns.PATTERN101:return e*n%2+e*n%3==0;case r.Patterns.PATTERN110:return(e*n%2+e*n%3)%2==0;case r.Patterns.PATTERN111:return(e*n%3+(e+n)%2)%2==0;default:throw Error("bad maskPattern:"+t)}}(t,o,i))},r.getBestMask=function(t,e){let n=Object.keys(r.Patterns).length,i=0,o=1/0;for(let s=0;s<n;s++){e(s),r.applyMask(s,t);let n=r.getPenaltyN1(t)+r.getPenaltyN2(t)+r.getPenaltyN3(t)+r.getPenaltyN4(t);r.applyMask(s,t),n<o&&(o=n,i=s)}return i}},48125,(t,e,r)=>{let n=t.r(73133),i=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],o=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];r.getBlocksCount=function(t,e){switch(e){case n.L:return i[(t-1)*4+0];case n.M:return i[(t-1)*4+1];case n.Q:return i[(t-1)*4+2];case n.H:return i[(t-1)*4+3];default:return}},r.getTotalCodewordsCount=function(t,e){switch(e){case n.L:return o[(t-1)*4+0];case n.M:return o[(t-1)*4+1];case n.Q:return o[(t-1)*4+2];case n.H:return o[(t-1)*4+3];default:return}}},54232,(t,e,r)=>{let n=new Uint8Array(512),i=new Uint8Array(256),o=1;for(let t=0;t<255;t++)n[t]=o,i[o]=t,256&(o<<=1)&&(o^=285);for(let t=255;t<512;t++)n[t]=n[t-255];r.log=function(t){if(t<1)throw Error("log("+t+")");return i[t]},r.exp=function(t){return n[t]},r.mul=function(t,e){return 0===t||0===e?0:n[i[t]+i[e]]}},50677,(t,e,r)=>{let n=t.r(54232);r.mul=function(t,e){let r=new Uint8Array(t.length+e.length-1);for(let i=0;i<t.length;i++)for(let o=0;o<e.length;o++)r[i+o]^=n.mul(t[i],e[o]);return r},r.mod=function(t,e){let r=new Uint8Array(t);for(;r.length-e.length>=0;){let t=r[0];for(let i=0;i<e.length;i++)r[i]^=n.mul(e[i],t);let i=0;for(;i<r.length&&0===r[i];)i++;r=r.slice(i)}return r},r.generateECPolynomial=function(t){let e=new Uint8Array([1]);for(let i=0;i<t;i++)e=r.mul(e,new Uint8Array([1,n.exp(i)]));return e}},62458,(t,e,r)=>{let n=t.r(50677);function i(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}i.prototype.initialize=function(t){this.degree=t,this.genPoly=n.generateECPolynomial(this.degree)},i.prototype.encode=function(t){if(!this.genPoly)throw Error("Encoder not initialized");let e=new Uint8Array(t.length+this.degree);e.set(t);let r=n.mod(e,this.genPoly),i=this.degree-r.length;if(i>0){let t=new Uint8Array(this.degree);return t.set(r,i),t}return r},e.exports=i},67483,(t,e,r)=>{r.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}},96592,(t,e,r)=>{let n="[0-9]+",i="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+",o="(?:(?![A-Z0-9 $%*+\\-./:]|"+(i=i.replace(/u/g,"\\u"))+")(?:.|[\r\n]))+";r.KANJI=RegExp(i,"g"),r.BYTE_KANJI=RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),r.BYTE=RegExp(o,"g"),r.NUMERIC=RegExp(n,"g"),r.ALPHANUMERIC=RegExp("[A-Z $%*+\\-./:]+","g");let s=RegExp("^"+i+"$"),a=RegExp("^"+n+"$"),l=RegExp("^[A-Z0-9 $%*+\\-./:]+$");r.testKanji=function(t){return s.test(t)},r.testNumeric=function(t){return a.test(t)},r.testAlphanumeric=function(t){return l.test(t)}},50882,(t,e,r)=>{let n=t.r(67483),i=t.r(96592);r.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},r.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},r.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},r.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},r.MIXED={bit:-1},r.getCharCountIndicator=function(t,e){if(!t.ccBits)throw Error("Invalid mode: "+t);if(!n.isValid(e))throw Error("Invalid version: "+e);return e>=1&&e<10?t.ccBits[0]:e<27?t.ccBits[1]:t.ccBits[2]}
1,r.getBestModeForData=function(t){return i.testNumeric(t)?r.NUMERIC:i.testAlphanumeric(t)?r.ALPHANUMERIC:i.testKanji(t)?r.KANJI:r.BYTE},r.toString=function(t){if(t&&t.id)return t.id;throw Error("Invalid mode")},r.isValid=function(t){return t&&t.bit&&t.ccBits},r.from=function(t,e){if(r.isValid(t))return t;try{if("string"!=typeof t)throw Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return r.NUMERIC;case"alphanumeric":return r.ALPHANUMERIC;case"kanji":return r.KANJI;case"byte":return r.BYTE;default:throw Error("Unknown mode: "+t)}}catch(t){return e}}},93547,(t,e,r)=>{let n=t.r(87201),i=t.r(48125),o=t.r(73133),s=t.r(50882),a=t.r(67483),l=n.getBCHDigit(7973);function u(t,e){return s.getCharCountIndicator(t,e)+4}r.from=function(t,e){return a.isValid(t)?parseInt(t,10):e},r.getCapacity=function(t,e,r){if(!a.isValid(t))throw Error("Invalid QR Code version");void 0===r&&(r=s.BYTE);let o=(n.getSymbolTotalCodewords(t)-i.getTotalCodewordsCount(t,e))*8;if(r===s.MIXED)return o;let l=o-u(r,t);switch(r){case s.NUMERIC:return Math.floor(l/10*3);case s.ALPHANUMERIC:return Math.floor(l/11*2);case s.KANJI:return Math.floor(l/13);case s.BYTE:default:return Math.floor(l/8)}},r.getBestVersionForData=function(t,e){let n,i=o.from(e,o.M);if(Array.isArray(t)){if(t.length>1){for(let e=1;e<=40;e++)if(function(t,e){let r=0;return t.forEach(function(t){let n=u(t.mode,e);r+=n+t.getBitsLength()}),r}(t,e)<=r.getCapacity(e,i,s.MIXED))return e;return}if(0===t.length)return 1;n=t[0]}else n=t;return function(t,e,n){for(let i=1;i<=40;i++)if(e<=r.getCapacity(i,n,t))return i}(n.mode,n.getLength(),i)},r.getEncodedBits=function(t){if(!a.isValid(t)||t<7)throw Error("Invalid QR Code version");let e=t<<12;for(;n.getBCHDigit(e)-l>=0;)e^=7973<<n.getBCHDigit(e)-l;return t<<12|e}},57655,(t,e,r)=>{let n=t.r(87201),i=n.getBCHDigit(1335);r.getEncodedBits=function(t,e){let r=t.bit<<3|e,o=r<<10;for(;n.getBCHDigit(o)-i>=0;)o^=1335<<n.getBCHDigit(o)-i;return(r<<10|o)^21522}},94097,(t,e,r)=>{let n=t.r(50882);function i(t){this.mode=n.NUMERIC,this.data=t.toString()}i.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){let e,r;for(e=0;e+3<=this.data.length;e+=3)r=parseInt(this.data.substr(e,3),10),t.put(r,10);let n=this.data.length-e;n>0&&(r=parseInt(this.data.substr(e),10),t.put(r,3*n+1))},e.exports=i},12553,(t,e,r)=>{let n=t.r(50882),i=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function o(t){this.mode=n.ALPHANUMERIC,this.data=t}o.getBitsLength=function(t){return 11*Math.floor(t/2)+t%2*6},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(t){let e;for(e=0;e+2<=this.data.length;e+=2){let r=45*i.indexOf(this.data[e]);r+=i.indexOf(this.data[e+1]),t.put(r,11)}this.data.length%2&&t.put(i.indexOf(this.data[e]),6)},e.exports=o},82257,(t,e,r)=>{let n=t.r(50882);function i(t){this.mode=n.BYTE,"string"==typeof t?this.data=new TextEncoder().encode(t):this.data=new Uint8Array(t)}i.getBitsLength=function(t){return 8*t},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){for(let e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8)},e.exports=i},22644,(t,e,r)=>{let n=t.r(50882),i=t.r(87201);function o(t){this.mode=n.KANJI,this.data=t}o.getBitsLength=function(t){return 13*t},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let r=i.toSJIS(this.data[e]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw Error("Invalid SJIS character: "+this.data[e]+"\nMake sure your charset is UTF-8");r=(r>>>8&255)*192+(255&r),t.put(r,13)}},e.exports=o},45953,(t,e,r)=>{"use strict";var n={single_source_shortest_paths:function(t,e,r){var i,o,s,a,l,u,c,h={},f={};f[e]=0;var d=n.PriorityQueue.make();for(d.push(e,0);!d.empty();)for(s in o=(i=d.pop()).value,a=i.cost,l=t[o]||{})l.hasOwnProperty(s)&&(u=a+l[s],c=f[s],(void 0===f[s]||c>u)&&(f[s]=u,d.push(s,u),h[s]=o));if(void 0!==r&&void 0===f[r])throw Error("Could not find a path from "+e+" to "+r+".");return h},extract_shortest_path_from_predecessor_list:function(t,e){for(var r=[],n=e;n;)r.push(n),t[n],n=t[n];return r.reverse(),r},find_path:function(t,e,r){var i=n.single_source_shortest_paths(t,e,r);return n.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(t){var e,r=n.PriorityQueue,i={};for(e in t=t||{},r)r.hasOwnProperty(e)&&(i[e]=r[e]);return i.queue=[],i.sorter=t.sorter||r.default_sorter,i},default_sorter:function(t,e){return t.cost-e.cost},push:function(t,e){this.queue.push({value:t,cost:e}),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};e.exports=n},97930,(t,e,r)=>{let n=t.r(50882),i=t.r(94097),o=t.r(12553),s=t.r(82257),a=t.r(22644),l=t.r(96592),u=t.r(87201),c=t.r(45953);function h(t){return unescape(encodeURIComponent(t)).length}function f(t,e,r){let n,i=[];for(;null!==(n=t.exec(r));)i.push({data:n[0],index:n.index,mode:e,length:n[0].length});return i}function d(t){let e,r,i=f(l.NUMERIC,n.NUMERIC,t),o=f(l.ALPHANUMERIC,n.ALPHANUMERIC,t);return u.isKanjiModeEnabled()?(e=f(l.BYTE,n.BYTE,t),r=f(l.KANJI,n.KANJI,t)):(e=f(l.BYTE_KANJI,n.BYTE,t),r=[]),i.concat(o,e,r).sort(function(t,e){return t.index-e.index}).map(function(t){return{data:t.data,mode:t.mode,length:t.length}})}function p(t,e){switch(e){case n.NUMERIC:return i.getBitsLength(t);case n.ALPHANUMERIC:return o.getBitsLength(t);case n.KANJI:return a.getBitsLength(t);case n.BYTE:return s.getBitsLength(t)}}function g(t,e){let r,l=n.getBestModeForData(t);
vendor: 5,743 bytes, line 1
1if((r=n.from(e,l))!==n.BYTE&&r.bit<l.bit)throw Error('"'+t+'" cannot be encoded with mode '+n.toString(r)+".\n Suggested mode is: "+n.toString(l));switch(r===n.KANJI&&!u.isKanjiModeEnabled()&&(r=n.BYTE),r){case n.NUMERIC:return new i(t);case n.ALPHANUMERIC:return new o(t);case n.KANJI:return new a(t);case n.BYTE:return new s(t)}}r.fromArray=function(t){return t.reduce(function(t,e){return"string"==typeof e?t.push(g(e,null)):e.data&&t.push(g(e.data,e.mode)),t},[])},r.fromString=function(t,e){let i=function(t,e){let r={},i={start:{}},o=["start"];for(let s=0;s<t.length;s++){let a=t[s],l=[];for(let t=0;t<a.length;t++){let u=a[t],c=""+s+t;l.push(c),r[c]={node:u,lastCount:0},i[c]={};for(let t=0;t<o.length;t++){let s=o[t];r[s]&&r[s].node.mode===u.mode?(i[s][c]=p(r[s].lastCount+u.length,u.mode)-p(r[s].lastCount,u.mode),r[s].lastCount+=u.length):(r[s]&&(r[s].lastCount=u.length),i[s][c]=p(u.length,u.mode)+4+n.getCharCountIndicator(u.mode,e))}}o=l}for(let t=0;t<o.length;t++)i[o[t]].end=0;return{map:i,table:r}}(function(t){let e=[];for(let r=0;r<t.length;r++){let i=t[r];switch(i.mode){case n.NUMERIC:e.push([i,{data:i.data,mode:n.ALPHANUMERIC,length:i.length},{data:i.data,mode:n.BYTE,length:i.length}]);break;case n.ALPHANUMERIC:e.push([i,{data:i.data,mode:n.BYTE,length:i.length}]);break;case n.KANJI:e.push([i,{data:i.data,mode:n.BYTE,length:h(i.data)}]);break;case n.BYTE:e.push([{data:i.data,mode:n.BYTE,length:h(i.data)}])}}return e}(d(t,u.isKanjiModeEnabled())),e),o=c.find_path(i.map,"start","end"),s=[];for(let t=1;t<o.length-1;t++)s.push(i.table[o[t]].node);return r.fromArray(s.reduce(function(t,e){let r=t.length-1>=0?t[t.length-1]:null;return r&&r.mode===e.mode?t[t.length-1].data+=e.data:t.push(e),t},[]))},r.rawSplit=function(t){return r.fromArray(d(t,u.isKanjiModeEnabled()))}},30671,(t,e,r)=>{let n=t.r(87201),i=t.r(73133),o=t.r(73666),s=t.r(11421),a=t.r(20637),l=t.r(14002),u=t.r(37692),c=t.r(48125),h=t.r(62458),f=t.r(93547),d=t.r(57655),p=t.r(50882),g=t.r(97930);function m(t,e,r){let n,i,o=t.size,s=d.getEncodedBits(e,r);for(n=0;n<15;n++)i=(s>>n&1)==1,n<6?t.set(n,8,i,!0):n<8?t.set(n+1,8,i,!0):t.set(o-15+n,8,i,!0),n<8?t.set(8,o-n-1,i,!0):n<9?t.set(8,15-n-1+1,i,!0):t.set(8,15-n-1,i,!0);t.set(o-8,8,1,!0)}r.create=function(t,e){let r,d;if(void 0===t||""===t)throw Error("No input text");let y=i.M;return void 0!==e&&(y=i.from(e.errorCorrectionLevel,i.M),r=f.from(e.version),d=u.from(e.maskPattern),e.toSJISFunc&&n.setToSJISFunction(e.toSJISFunc)),function(t,e,r,i){let d;if(Array.isArray(t))d=g.fromArray(t);else if("string"==typeof t){let n=e;if(!n){let e=g.rawSplit(t);n=f.getBestVersionForData(e,r)}d=g.fromString(t,n||40)}else throw Error("Invalid data");let y=f.getBestVersionForData(d,r);if(!y)throw Error("The amount of data is too big to be stored in a QR Code");if(e){if(e<y)throw Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+y+".\n")}else e=y;let b=function(t,e,r){let i=new o;r.forEach(function(e){i.put(e.mode.bit,4),i.put(e.getLength(),p.getCharCountIndicator(e.mode,t)),e.write(i)});let s=(n.getSymbolTotalCodewords(t)-c.getTotalCodewordsCount(t,e))*8;for(i.getLengthInBits()+4<=s&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(0);let a=(s-i.getLengthInBits())/8;for(let t=0;t<a;t++)i.put(t%2?17:236,8);return function(t,e,r){let i,o,s=n.getSymbolTotalCodewords(e),a=s-c.getTotalCodewordsCount(e,r),l=c.getBlocksCount(e,r),u=s%l,f=l-u,d=Math.floor(s/l),p=Math.floor(a/l),g=p+1,m=d-p,y=new h(m),b=0,w=Array(l),v=Array(l),x=0,E=new Uint8Array(t.buffer);for(let t=0;t<l;t++){let e=t<f?p:g;w[t]=E.slice(b,b+e),v[t]=y.encode(w[t]),b+=e,x=Math.max(x,e)}let S=new Uint8Array(s),k=0;for(i=0;i<x;i++)for(o=0;o<l;o++)i<w[o].length&&(S[k++]=w[o][i]);for(i=0;i<m;i++)for(o=0;o<l;o++)S[k++]=v[o][i];return S}(i,t,e)}(e,r,d),w=new s(n.getSymbolSize(e));!function(t,e){let r=t.size,n=l.getPositions(e);for(let e=0;e<n.length;e++){let i=n[e][0],o=n[e][1];for(let e=-1;e<=7;e++)if(!(i+e<=-1)&&!(r<=i+e))for(let n=-1;n<=7;n++)o+n<=-1||r<=o+n||(e>=0&&e<=6&&(0===n||6===n)||n>=0&&n<=6&&(0===e||6===e)||e>=2&&e<=4&&n>=2&&n<=4?t.set(i+e,o+n,!0,!0):t.set(i+e,o+n,!1,!0))}}(w,e);let v=w.size;for(let t=8;t<v-8;t++){let e=t%2==0;w.set(t,6,e,!0),w.set(6,t,e,!0)}return!function(t,e){let r=a.getPositions(e);for(let e=0;e<r.length;e++){let n=r[e][0],i=r[e][1];for(let e=-2;e<=2;e++)for(let r=-2;r<=2;r++)-2===e||2===e||-2===r||2===r||0===e&&0===r?t.set(n+e,i+r,!0,!0):t.set(n+e,i+r,!1,!0)}}(w,e),m(w,r,0),e>=7&&function(t,e){let r,n,i,o=t.size,s=f.getEncodedBits(e);for(let e=0;e<18;e++)r=Math.floor(e/3),n=e%3+o-8-3,i=(s>>e&1)==1,t.set(r,n,i,!0),t.set(n,r,i,!0)}(w,e),!function(t,e){let r=t.size,n=-1,i=r-1,o=7,s=0;for(let a=r-1;a>0;a-=2)for(6===a&&a--;;){for(let r=0;r<2;r++)if(!t.isReserved(i,a-r)){let n=!1;s<e.length&&(n=(e[s]>>>o&1)==1),t.set(i,a-r,n),-1==--o&&(s++,o=7)}if((i+=n)<0||r<=i){i-=n,n=-n;break}}}(w,b),isNaN(i)&&(i=u.getBestMask(w,m.bind(null,w,r))),u.applyMask(i,w),m(w,r,i),{modules:w,version:e,errorCorrectionLevel:r,maskPattern:i,segments:d}}(t,r,y,d)}},25950,(t,e,r)=>{function n(t){if("number"==typeof t&&(t=t.toString()),"string"!=typeof t)throw Error("Color should be defined as hex string");let e=t.slice().replace("#","").split("");if(e.length<3||5===e.length||e.length>8)throw Error("Invalid hex color: "+t);(3===e.length||4===e.length)&&(e=Array.prototype.concat.apply([],e.map(function(t){return[t,t]}))),6===e.length&&e.push("F","F");let r=parseInt(e.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+e.slice(0,6).join("")}}r.getOptions=function(t){t||(t={}),t.color||(t.color={});let e=void 0===t.margin||null===t.margin||t.margin<0?4:t.margin,r=t.width&&t.width>=21?t.width:void 0,i=t.scale||4;
1return{width:r,scale:r?4:i,margin:e,color:{dark:n(t.color.dark||"#000000ff"),light:n(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}},r.getScale=function(t,e){return e.width&&e.width>=t+2*e.margin?e.width/(t+2*e.margin):e.scale},r.getImageWidth=function(t,e){let n=r.getScale(t,e);return Math.floor((t+2*e.margin)*n)},r.qrToImageData=function(t,e,n){let i=e.modules.size,o=e.modules.data,s=r.getScale(i,n),a=Math.floor((i+2*n.margin)*s),l=n.margin*s,u=[n.color.light,n.color.dark];for(let e=0;e<a;e++)for(let r=0;r<a;r++){let c=(e*a+r)*4,h=n.color.light;e>=l&&r>=l&&e<a-l&&r<a-l&&(h=u[+!!o[Math.floor((e-l)/s)*i+Math.floor((r-l)/s)]]),t[c++]=h.r,t[c++]=h.g,t[c++]=h.b,t[c]=h.a}}},63037,(t,e,r)=>{let n=t.r(25950);r.render=function(t,e,r){var i;let o=r,s=e;void 0!==o||e&&e.getContext||(o=e,e=void 0),e||(s=function(){try{return document.createElement("canvas")}catch(t){throw Error("You need to specify a canvas element")}}()),o=n.getOptions(o);let a=n.getImageWidth(t.modules.size,o),l=s.getContext("2d"),u=l.createImageData(a,a);return n.qrToImageData(u.data,t,o),i=s,l.clearRect(0,0,i.width,i.height),i.style||(i.style={}),i.height=a,i.width=a,i.style.height=a+"px",i.style.width=a+"px",l.putImageData(u,0,0),s},r.renderToDataURL=function(t,e,n){let i=n;void 0!==i||e&&e.getContext||(i=e,e=void 0),i||(i={});let o=r.render(t,e,i),s=i.type||"image/png",a=i.rendererOpts||{};return o.toDataURL(s,a.quality)}},10891,(t,e,r)=>{let n=t.r(25950);function i(t,e){let r=t.a/255,n=e+'="'+t.hex+'"';return r<1?n+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function o(t,e,r){let n=t+e;return void 0!==r&&(n+=" "+r),n}r.render=function(t,e,r){let s=n.getOptions(e),a=t.modules.size,l=t.modules.data,u=a+2*s.margin,c=s.color.light.a?"<path "+i(s.color.light,"fill")+' d="M0 0h'+u+"v"+u+'H0z"/>':"",h="<path "+i(s.color.dark,"stroke")+' d="'+function(t,e,r){let n="",i=0,s=!1,a=0;for(let l=0;l<t.length;l++){let u=Math.floor(l%e),c=Math.floor(l/e);u||s||(s=!0),t[l]?(a++,l>0&&u>0&&t[l-1]||(n+=s?o("M",u+r,.5+c+r):o("m",i,0),i=0,s=!1),u+1<e&&t[l+1]||(n+=o("h",a),a=0)):i++}return n}(l,a,s.margin)+'"/>',f='<svg xmlns="http://www.w3.org/2000/svg" '+(s.width?'width="'+s.width+'" height="'+s.width+'" ':"")+('viewBox="0 0 '+u+" ")+u+'" shape-rendering="crispEdges">'+c+h+"</svg>\n";return"function"==typeof r&&r(null,f),f}},73134,(t,e,r)=>{let n=t.r(38750),i=t.r(30671),o=t.r(63037),s=t.r(10891);function a(t,e,r,o,s){let a=[].slice.call(arguments,1),l=a.length,u="function"==typeof a[l-1];if(!u&&!n())throw Error("Callback required as last argument");if(u){if(l<2)throw Error("Too few arguments provided");2===l?(s=r,r=e,e=o=void 0):3===l&&(e.getContext&&void 0===s?(s=o,o=void 0):(s=o,o=r,r=e,e=void 0))}else{if(l<1)throw Error("Too few arguments provided");return 1===l?(r=e,e=o=void 0):2!==l||e.getContext||(o=r,r=e,e=void 0),new Promise(function(n,s){try{let s=i.create(r,o);n(t(s,e,o))}catch(t){s(t)}})}try{let n=i.create(r,o);s(null,t(n,e,o))}catch(t){s(t)}}r.create=i.create,r.toCanvas=a.bind(null,o.render),r.toDataURL=a.bind(null,o.renderToDataURL),r.toString=a.bind(null,function(t,e,r){return s.render(t,r)})},28739,t=>{"use strict";let e,r,n,i,o;var s,a,l,u,c,h,f,d,p,g,m,y,b,w,v,x,E,S,k,A,I,B,_,M,C,T,L,R,O,P=t.i(43476),U=t.i(19273),N=t.i(86491),z=t.i(40143),q=t.i(15823),D=class extends q.Subscribable{constructor(t={}){super(),this.config=t,this.#t=new Map}#t;build(t,e,r){let n=e.queryKey,i=e.queryHash??(0,U.hashQueryKeyByOptions)(n,e),o=this.get(i);return o||(o=new N.Query({client:t,queryKey:n,queryHash:i,options:t.defaultQueryOptions(e),state:r,defaultOptions:t.getQueryDefaults(n)}),this.add(o)),o}add(t){this.#t.has(t.queryHash)||(this.#t.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){let e=this.#t.get(t.queryHash);
1e&&(t.destroy(),e===t&&this.#t.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){z.notifyManager.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#t.get(t)}getAll(){return[...this.#t.values()]}find(t){let e={exact:!0,...t};return this.getAll().find(t=>(0,U.matchQuery)(e,t))}findAll(t={}){let e=this.getAll();return Object.keys(t).length>0?e.filter(e=>(0,U.matchQuery)(t,e)):e}notify(t){z.notifyManager.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){z.notifyManager.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){z.notifyManager.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},W=t.i(14272),F=q,j=class extends F.Subscribable{constructor(t={}){super(),this.config=t,this.#e=new Set,this.#r=new Map,this.#n=0}#e;#r;#n;build(t,e,r){let n=new W.Mutation({client:t,mutationCache:this,mutationId:++this.#n,options:t.defaultMutationOptions(e),state:r});return this.add(n),n}add(t){this.#e.add(t);let e=K(t);if("string"==typeof e){let r=this.#r.get(e);r?r.push(t):this.#r.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#e.delete(t)){let e=K(t);if("string"==typeof e){let r=this.#r.get(e);if(r)if(r.length>1){let e=r.indexOf(t);-1!==e&&r.splice(e,1)}else r[0]===t&&this.#r.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){let e=K(t);if("string"!=typeof e)return!0;{let r=this.#r.get(e),n=r?.find(t=>"pending"===t.state.status);return!n||n===t}}runNext(t){let e=K(t);if("string"!=typeof e)return Promise.resolve();{let r=this.#r.get(e)?.find(e=>
1e!==t&&e.state.isPaused);return r?.continue()??Promise.resolve()}}clear(){z.notifyManager.batch(()=>{this.#e.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#e.clear(),this.#r.clear()})}getAll(){return Array.from(this.#e)}find(t){let e={exact:!0,...t};return this.getAll().find(t=>(0,U.matchMutation)(e,t))}findAll(t={}){return this.getAll().filter(e=>(0,U.matchMutation)(t,e))}notify(t){z.notifyManager.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){let t=this.getAll().filter(t=>t.state.isPaused);return z.notifyManager.batch(()=>Promise.all(t.map(t=>t.continue().catch(U.noop))))}};function K(t){return t.options.scope?.id}var H=t.i(75555),V=t.i(14448),$=class{#i;#o;#s;#a;#l;#u;#c;#h;constructor(t={}){this.#i=t.queryCache||new D,this.#o=t.mutationCache||new j,this.#s=t.defaultOptions||{},this.#a=new Map,this.#l=new Map,this.#u=0}mount(){this.#u++,1===this.#u&&(this.#c=H.focusManager.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#i.onFocus())}),this.#h=V.onlineManager.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#i.onOnline())}))}unmount(){this.#u--,0===this.#u&&(this.#c?.(),this.#c=void 0,this.#h?.(),this.#h=void 0)}isFetching(t){return this.#i.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#o.findAll({...t,status:"pending"}).length}getQueryData(t){let e=this.defaultQueryOptions({queryKey:t});return this.#i.get(e.queryHash)?.state.data}ensureQueryData(t){let e=this.defaultQueryOptions(t),r=this.#i.build(this,e),n=r.state.data;return void 0===n?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime((0,U.resolveStaleTime)(e.staleTime,r))&&this.prefetchQuery(e),Promise.resolve(n))}getQueriesData(t){return this.#i.findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(t,e,r){let n=this.defaultQueryOptions({queryKey:t}),i=this.#i.get(n.queryHash),o=i?.state.data,s=(0,U.functionalUpdate)(e,o);if(void 0!==s)return this.#i.build(this,n).setData(s,{...r,manual:!0})}setQueriesData(t,e,r){return z.notifyManager.batch(()=>this.#i.findAll(t).map(({queryKey:t})=>[t,this.setQueryData(t,e,r)]))}getQueryState(t){let e=this.defaultQueryOptions({queryKey:t});return this.#i.get(e.queryHash)?.state}removeQueries(t){let e=this.#i;z.notifyManager.batch(()=>{e.findAll(t).forEach(t=>{e.remove(t)})})}resetQueries(t,e){let r=this.#i;return z.notifyManager.batch(()=>(r.findAll(t).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){let r={revert:!0,...e};return Promise.all(z.notifyManager.batch(()=>this.#i.findAll(t).map(t=>t.cancel(r)))).then(U.noop).catch(U.noop)}invalidateQueries(t,e={}){return z.notifyManager.batch(()=>(this.#i.findAll(t).forEach(t=>{t.invalidate()}),t?.refetchType==="none")?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e))}refetchQueries(t,e={}){let r={...e,cancelRefetch:e.cancelRefetch??!0};return Promise.all(z.notifyManager.batch(()=>this.#i.findAll(t).filter(t=>!t.isDisabled()&&!t.isStatic()).map(t=>{let e=t.fetch(void 0,r);return r.throwOnError||(e=e.catch(U.noop)),"paused"===t.state.fetchStatus?Promise.resolve():e}))).then(U.noop)}fetchQuery(t){let e=this.defaultQueryOptions(t);void 0===e.retry&&(e.retry=!1);let r=this.#i.build(this,e);return r.isStaleByTime((0,U.resolveStaleTime)(e.staleTime,r))?r.fetch(e):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(U.noop).catch(U.noop)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(U.noop).catch(U.noop)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return V.onlineManager.isOnline()?this.#o.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#i}getMutationCache(){return this.#o}getDefaultOptions(){return this.#s}setDefaultOptions(t){this.#s=t}setQueryDefaults(t,e){this.#a.set((0,U.hashKey)(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){let e=[...this.#a.values()],r={};return e.forEach(e=>{(0,U.partialMatchKey)(t,e.queryKey)&&Object.assign(r,e.defaultOptions)}),r}setMutationDefaults(t,e){this.#l.set((0,U.hashKey)(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){let e=[...this.#l.values()],r={};
1return e.forEach(e=>{(0,U.partialMatchKey)(t,e.mutationKey)&&Object.assign(r,e.defaultOptions)}),r}defaultQueryOptions(t){if(t._defaulted)return t;let e={...this.#s.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=(0,U.hashQueryKeyByOptions)(e.queryKey,e)),void 0===e.refetchOnReconnect&&(e.refetchOnReconnect="always"!==e.networkMode),void 0===e.throwOnError&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===U.skipToken&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#s.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#i.clear(),this.#o.clear()}},Z=t.i(12598),G=t.i(71645);t.i(47167);var Y=t.i(43943);let Q="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function J(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}function X(t){if(!Number.isSafeInteger(t)||t<0)throw Error("positive integer expected, got "+t)}function tt(t,...e){if(!J(t))throw Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw Error("Uint8Array expected of length "+e+", got length="+t.length)}function te(t){if("function"!=typeof t||"function"!=typeof t.create)throw Error("Hash should be wrapped by utils.createHasher");X(t.outputLen),X(t.blockLen)}function tr(t,e=!0){if(t.destroyed)throw Error("Hash instance has been destroyed");if(e&&t.finished)throw Error("Hash#digest() has already been called")}function tn(t,e){tt(t);let r=e.outputLen;if(t.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}function ti(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function to(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function ts(t,e){return t<<32-e|t>>>e}let ta=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0]?t=>t:function(t){for(let r=0;r<t.length;r++){var e;t[r]=(e=t[r])<<24&0xff000000|e<<8&0xff0000|e>>>8&65280|e>>>24&255}return t},tl="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,tu=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function tc(t){if(tt(t),tl)return t.toHex();let e="";for(let r=0;r<t.length;r++)e+=tu[t[r]];return e}function th(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:void 0}function tf(t){if("string"!=typeof t)throw Error("hex string expected, got "+typeof t);if(tl)return Uint8Array.fromHex(t);let e=t.length,r=e/2;if(e%2)throw Error("hex string expected, got unpadded hex of length "+e);let n=new Uint8Array(r);for(let e=0,i=0;e<r;e++,i+=2){let r=th(t.charCodeAt(i)),o=th(t.charCodeAt(i+1));if(void 0===r||void 0===o)throw Error('hex string expected, got non-hex character "'+(t[i]+t[i+1])+'" at index '+i);n[e]=16*r+o}return n}function td(t){if("string"!=typeof t)throw Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function tp(t){return"string"==typeof t&&(t=td(t)),tt(t),t}function tg(...t){let e=0;for(let r=0;r<t.length;r++){let n=t[r];tt(n),e+=n.length}let r=new Uint8Array(e);for(let e=0,n=0;e<t.length;e++){let i=t[e];r.set(i,n),n+=i.length}return r}class tm{}function ty(t){let e=e=>t().update(tp(e)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function tb(t=32){if(Q&&"function"==typeof Q.getRandomValues)return Q.getRandomValues(new Uint8Array(t));if(Q&&"function"==typeof Q.randomBytes)return Uint8Array.from(Q.randomBytes(t));throw Error("crypto.getRandomValues must be defined")}class tw extends tm{constructor(t,e,r,n){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=e,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(t),this.view=to(this.buffer)}update(t){tr(this),tt(t=tp(t));let{view:e,buffer:r,blockLen:n}=this,i=t.length;for(let o=0;o<i;){let s=Math.min(n-this.pos,i-o);if(s===n){let e=to(t);for(;n<=i-o;o+=n)this.process(e,o);continue}r.set(t.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===n&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){tr(this),tn(t,this),this.finished=!0;let{buffer:e,view:r,blockLen:n,isLE:i}=this,{pos:o}=this;e[o++]=128,ti(this.buffer.subarray(o)),this.padOffset>n-o&&(this.process(r,0),o=0);for(let t=o;t<n;t++)e[t]=0;!function(t,e,r,n){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,r,n);let i=BigInt(32),o=BigInt(0xffffffff),s=Number(r>>i&o),a=Number(r&o),l=4*!!n,u=4*!n;t.setUint32(e+l,s,n),t.setUint32(e+u,a,n)}(r,n-8,BigInt(8*this.length),i),this.process(r,0);let s=to(t),a=this.outputLen;if(a%4)throw Error("_sha2: outputLen should be aligned to 32bit");let l=a/4,u=this.get();if(l>u.length)throw Error("_sha2: outputLen bigger than state");for(let t=0;t<l;t++)s.setUint32(4*t,u[t],i)}digest(){let{buffer:t,outputLen:e}=this;this.digestInto(t);let r=t.slice(0,e);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:e,buffer:r,length:n,finished:i,destroyed:o,pos:s}=this;return t.destroyed=o,t.finished=i,t.length=n,t.pos=s,n%e&&t.buffer.set(r),t}clone(){return this._cloneInto()}}
1let tv=Uint32Array.from([0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),tx=Uint32Array.from([0xc1059ed8,0x367cd507,0x3070dd17,0xf70e5939,0xffc00b31,0x68581511,0x64f98fa7,0xbefa4fa4]),tE=Uint32Array.from([0xcbbb9d5d,0xc1059ed8,0x629a292a,0x367cd507,0x9159015a,0x3070dd17,0x152fecd8,0xf70e5939,0x67332667,0xffc00b31,0x8eb44a87,0x68581511,0xdb0c2e0d,0x64f98fa7,0x47b5481d,0xbefa4fa4]),tS=Uint32Array.from([0x6a09e667,0xf3bcc908,0xbb67ae85,0x84caa73b,0x3c6ef372,0xfe94f82b,0xa54ff53a,0x5f1d36f1,0x510e527f,0xade682d1,0x9b05688c,0x2b3e6c1f,0x1f83d9ab,0xfb41bd6b,0x5be0cd19,0x137e2179]),tk=BigInt(0x100000000-1),tA=BigInt(32);function tI(t,e=!1){let r=t.length,n=new Uint32Array(r),i=new Uint32Array(r);for(let o=0;o<r;o++){let{h:r,l:s}=function(t,e=!1){return e?{h:Number(t&tk),l:Number(t>>tA&tk)}:{h:0|Number(t>>tA&tk),l:0|Number(t&tk)}}(t[o],e);[n[o],i[o]]=[r,s]}return[n,i]}let tB=(t,e,r)=>t>>>r,t_=(t,e,r)=>t<<32-r|e>>>r,tM=(t,e,r)=>t>>>r|e<<32-r,tC=(t,e,r)=>t<<32-r|e>>>r,tT=(t,e,r)=>t<<64-r|e>>>r-32,tL=(t,e,r)=>t>>>r-32|e<<64-r;function tR(t,e,r,n){let i=(e>>>0)+(n>>>0);return{h:t+r+(i/0x100000000|0)|0,l:0|i}}let tO=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),tP=(t,e,r,n)=>e+r+n+(t/0x100000000|0)|0,tU=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),tN=(t,e,r,n,i)=>e+r+n+i+(t/0x100000000|0)|0,tz=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),tq=(t,e,r,n,i,o)=>e+r+n+i+o+(t/0x100000000|0)|0,tD=Uint32Array.from([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),tW=new Uint32Array(64);class tF extends tw{constructor(t=32){super(64,t,8,!1),this.A=0|tv[0],this.B=0|tv[1],this.C=0|tv[2],this.D=0|tv[3],this.E=0|tv[4],this.F=0|tv[5],this.G=0|tv[6],this.H=0|tv[7]}get(){let{A:t,B:e,C:r,D:n,E:i,F:o,G:s,H:a}=this;return[t,e,r,n,i,o,s,a]}set(t,e,r,n,i,o,s,a){this.A=0|t,this.B=0|e,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|o,this.G=0|s,this.H=0|a}process(t,e){for(let r=0;r<16;r++,e+=4)tW[r]=t.getUint32(e,!1);for(let t=16;t<64;t++){let e=tW[t-15],r=tW[t-2],n=ts(e,7)^ts(e,18)^e>>>3,i=ts(r,17)^ts(r,19)^r>>>10;tW[t]=i+tW[t-7]+n+tW[t-16]|0}let{A:r,B:n,C:i,D:o,E:s,F:a,G:l,H:u}=this;for(let t=0;t<64;t++){var c,h,f,d;let e=u+(ts(s,6)^ts(s,11)^ts(s,25))+((c=s)&a^~c&l)+tD[t]+tW[t]|0,p=(ts(r,2)^ts(r,13)^ts(r,22))+((h=r)&(f=n)^h&(d=i)^f&d)|0;u=l,l=a,a=s,s=o+e|0,o=i,i=n,n=r,r=e+p|0}r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,o=o+this.D|0,s=s+this.E|0,a=a+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(r,n,i,o,s,a,l,u)}roundClean(){ti(tW)}destroy(){this.set(0,0,0,0,0,0,0,0),ti(this.buffer)}}let tj=tI(["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
15771202a","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))),tK=tj[0],tH=tj[1],tV=new Uint32Array(80),t$=new Uint32Array(80);class tZ extends tw{constructor(t=64){super(128,t,16,!1),this.Ah=0|tS[0],this.Al=0|tS[1],this.Bh=0|tS[2],this.Bl=0|tS[3],this.Ch=0|tS[4],this.Cl=0|tS[5],this.Dh=0|tS[6],this.Dl=0|tS[7],this.Eh=0|tS[8],this.El=0|tS[9],this.Fh=0|tS[10],this.Fl=0|tS[11],this.Gh=0|tS[12],this.Gl=0|tS[13],this.Hh=0|tS[14],this.Hl=0|tS[15]}get(){let{Ah:t,Al:e,Bh:r,Bl:n,Ch:i,Cl:o,Dh:s,Dl:a,Eh:l,El:u,Fh:c,Fl:h,Gh:f,Gl:d,Hh:p,Hl:g}=this;return[t,e,r,n,i,o,s,a,l,u,c,h,f,d,p,g]}set(t,e,r,n,i,o,s,a,l,u,c,h,f,d,p,g){this.Ah=0|t,this.Al=0|e,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|o,this.Dh=0|s,this.Dl=0|a,this.Eh=0|l,this.El=0|u,this.Fh=0|c,this.Fl=0|h,this.Gh=0|f,this.Gl=0|d,this.Hh=0|p,this.Hl=0|g}process(t,e){for(let r=0;r<16;r++,e+=4)tV[r]=t.getUint32(e),t$[r]=t.getUint32(e+=4);for(let t=16;t<80;t++){let e=0|tV[t-15],r=0|t$[t-15],n=tM(e,r,1)^tM(e,r,8)^tB(e,r,7),i=tC(e,r,1)^tC(e,r,8)^t_(e,r,7),o=0|tV[t-2],s=0|t$[t-2],a=tM(o,s,19)^tT(o,s,61)^tB(o,s,6),l=tU(i,tC(o,s,19)^tL(o,s,61)^t_(o,s,6),t$[t-7],t$[t-16]),u=tN(l,n,a,tV[t-7],tV[t-16]);tV[t]=0|u,t$[t]=0|l}let{Ah:r,Al:n,Bh:i,Bl:o,Ch:s,Cl:a,Dh:l,Dl:u,Eh:c,El:h,Fh:f,Fl:d,Gh:p,Gl:g,Hh:m,Hl:y}=this;for(let t=0;t<80;t++){let e=tM(c,h,14)^tM(c,h,18)^tT(c,h,41),b=tC(c,h,14)^tC(c,h,18)^tL(c,h,41),w=c&f^~c&p,v=tz(y,b,h&d^~h&g,tH[t],t$[t]),x=tq(v,m,e,w,tK[t],tV[t]),E=0|v,S=tM(r,n,28)^tT(r,n,34)^tT(r,n,39),k=tC(r,n,28)^tL(r,n,34)^tL(r,n,39),A=r&i^r&s^i&s,I=n&o^n&a^o&a;m=0|p,y=0|g,p=0|f,g=0|d,f=0|c,d=0|h,({h:c,l:h}=tR(0|l,0|u,0|x,0|E)),l=0|s,u=0|a,s=0|i,a=0|o,i=0|r,o=0|n;let B=tO(E,k,I);r=tP(B,x,S,A),n=0|B}({h:r,l:n}=tR(0|this.Ah,0|this.Al,0|r,0|n)),({h:i,l:o}=tR(0|this.Bh,0|this.Bl,0|i,0|o)),({h:s,l:a}=tR(0|this.Ch,0|this.Cl,0|s,0|a)),({h:l,l:u}=tR(0|this.Dh,0|this.Dl,0|l,0|u)),({h:c,l:h}=tR(0|this.Eh,0|this.El,0|c,0|h)),({h:f,l:d}=tR(0|this.Fh,0|this.Fl,0|f,0|d)),({h:p,l:g}=tR(0|this.Gh,0|this.Gl,0|p,0|g)),({h:m,l:y}=tR(0|this.Hh,0|this.Hl,0|m,0|y)),this.set(r,n,i,o,s,a,l,u,c,h,f,d,p,g,m,y)}roundClean(){ti(tV,t$)}destroy(){ti(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}let tG=ty(()=>new tF),tY=ty(()=>new tZ),tQ=BigInt(0),tJ=BigInt(1);function tX(t,e=""){if("boolean"!=typeof t)throw Error((e&&`"${e}"`)+"expected boolean, got type="+typeof t);return t}function t0(t,e,r=""){let n=J(t),i=t?.length,o=void 0!==e;if(!n||o&&i!==e)throw Error((r&&`"${r}" `)+"expected Uint8Array"+(o?` of length ${e}`:"")+", got "+(n?`length=${i}`:`type=${typeof t}`));return t}function t1(t){let e=t.toString(16);return 1&e.length?"0"+e:e}function t2(t){if("string"!=typeof t)throw Error("hex string expected, got "+typeof t);return""===t?tQ:BigInt("0x"+t)}function t6(t){return t2(tc(t))}function t5(t){return tt(t),t2(tc(Uint8Array.from(t).reverse()))}function t3(t,e){return tf(t.toString(16).padStart(2*e,"0"))}function t8(t,e){return t3(t,e).reverse()}function t4(t,e,r){let n;if("string"==typeof e)try{n=tf(e)}catch(e){throw Error(t+" must be hex string or Uint8Array, cause: "+e)}else if(J(e))n=Uint8Array.from(e);else throw Error(t+" must be hex string or Uint8Array");let i=n.length;if("number"==typeof r&&i!==r)throw Error(t+" of length "+r+" expected, got "+i);return n}function t7(t){return Uint8Array.from(t)}let t9=t=>"bigint"==typeof t&&tQ<=t;function et(t,e,r,n){var i,o,s;if(i=e,o=r,s=n,!(t9(i)&&t9(o)&&t9(s))||!(o<=i)||!(i<s))throw Error("expected valid "+t+": "+r+" <= n < "+n+", got "+e)}function ee(t){let e;for(e=0;t>tQ;t>>=tJ,e+=1);return e}let er=t=>(tJ<<BigInt(t))-tJ;function en(t,e,r={}){if(!t||"object"!=typeof t)throw Error("expected valid options object");function n(e,r,n){let i=t[e];if(n&&void 0===i)return;let o=typeof i;if(o!==r||null===i)throw Error(`param "${e}
1" is invalid: expected ${r}, got ${o}`)}Object.entries(e).forEach(([t,e])=>n(t,e,!1)),Object.entries(r).forEach(([t,e])=>n(t,e,!0))}let ei=()=>{throw Error("not implemented")};function eo(t){let e=new WeakMap;return(r,...n)=>{let i=e.get(r);if(void 0!==i)return i;let o=t(r,...n);return e.set(r,o),o}}let es=BigInt(0),ea=BigInt(1),el=BigInt(2),eu=BigInt(3),ec=BigInt(4),eh=BigInt(5),ef=BigInt(7),ed=BigInt(8),ep=BigInt(9),eg=BigInt(16);function em(t,e){let r=t%e;return r>=es?r:e+r}function ey(t,e,r){let n=t;for(;e-- >es;)n*=n,n%=r;return n}function eb(t,e){if(t===es)throw Error("invert: expected non-zero number");if(e<=es)throw Error("invert: expected positive modulus, got "+e);let r=em(t,e),n=e,i=es,o=ea,s=ea,a=es;for(;r!==es;){let t=n/r,e=n%r,l=i-s*t,u=o-a*t;n=r,r=e,i=s,o=a,s=l,a=u}if(n!==ea)throw Error("invert: does not exist");return em(i,e)}function ew(t,e,r){if(!t.eql(t.sqr(e),r))throw Error("Cannot find square root")}function ev(t,e){let r=(t.ORDER+ea)/ec,n=t.pow(e,r);return ew(t,n,e),n}function ex(t,e){let r=(t.ORDER-eh)/ed,n=t.mul(e,el),i=t.pow(n,r),o=t.mul(e,i),s=t.mul(t.mul(o,el),i),a=t.mul(o,t.sub(s,t.ONE));return ew(t,a,e),a}function eE(t){if(t<eu)throw Error("sqrt is not defined for small field");let e=t-ea,r=0;for(;e%el===es;)e/=el,r++;let n=el,i=eM(t);for(;1===eB(i,n);)if(n++>1e3)throw Error("Cannot find square root: probably non-prime P");if(1===r)return ev;let o=i.pow(n,e),s=(e+ea)/el;return function(t,n){if(t.is0(n))return n;if(1!==eB(t,n))throw Error("Cannot find square root");let i=r,a=t.mul(t.ONE,o),l=t.pow(n,e),u=t.pow(n,s);for(;!t.eql(l,t.ONE);){if(t.is0(l))return t.ZERO;let e=1,r=t.sqr(l);for(;!t.eql(r,t.ONE);)if(e++,r=t.sqr(r),e===i)throw Error("Cannot find square root");let n=ea<<BigInt(i-e-1),o=t.pow(a,n);i=e,a=t.sqr(o),l=t.mul(l,a),u=t.mul(u,o)}return u}}let eS=(t,e)=>(em(t,e)&ea)===ea,ek=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function eA(t){return en(t,ek.reduce((t,e)=>(t[e]="function",t),{ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"})),t}function eI(t,e,r=!1){let n=Array(e.length).fill(r?t.ZERO:void 0),i=e.reduce((e,r,i)=>t.is0(r)?e:(n[i]=e,t.mul(e,r)),t.ONE),o=t.inv(i);return e.reduceRight((e,r,i)=>t.is0(r)?e:(n[i]=t.mul(e,n[i]),t.mul(e,r)),o),n}function eB(t,e){let r=(t.ORDER-ea)/el,n=t.pow(e,r),i=t.eql(n,t.ONE),o=t.eql(n,t.ZERO),s=t.eql(n,t.neg(t.ONE));if(!i&&!o&&!s)throw Error("invalid Legendre symbol result");return i?1:o?0:-1}function e_(t,e){void 0!==e&&X(e);let r=void 0!==e?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function eM(t,e,r=!1,n={}){let i,o,s,a;if(t<=es)throw Error("invalid field: expected ORDER > 0, got "+t);let l=!1;if("object"==typeof e&&null!=e){if(n.sqrt||r)throw Error("cannot specify opts in two arguments");e.BITS&&(o=e.BITS),e.sqrt&&(s=e.sqrt),"boolean"==typeof e.isLE&&(r=e.isLE),"boolean"==typeof e.modFromBytes&&(l=e.modFromBytes),a=e.allowedLengths}else"number"==typeof e&&(o=e),n.sqrt&&(s=n.sqrt);let{nBitLength:u,nByteLength:c}=e_(t,o);if(c>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let h=Object.freeze({ORDER:t,isLE:r,BITS:u,BYTES:c,MASK:er(u),ZERO:es,ONE:ea,allowedLengths:a,create:e=>em(e,t),isValid:e=>{if("bigint"!=typeof e)throw Error("invalid field element: expected bigint, got "+typeof e);return es<=e&&e<t},is0:t=>t===es,isValidNot0:t=>!h.is0(t)&&h.isValid(t),isOdd:t=>(t&ea)===ea,neg:e=>em(-e,t),eql:(t,e)=>t===e,sqr:e=>em(e*e,t),add:(e,r)=>em(e+r,t),sub:(e,r)=>em(e-r,t),mul:(e,r)=>em(e*r,t),pow:(t,e)=>(function(t,e,r){if(r<es)throw Error("invalid exponent, negatives unsupported");if(r===es)return t.ONE;if(r===ea)return e;let n=t.ONE,i=e;for(;r>es;)r&ea&&(n=t.mul(n,i)),i=t.sqr(i),r>>=ea;return n})(h,t,e),div:(e,r)=>em(e*eb(r,t),t),sqrN:t=>t*t,addN:(t,e)=>t+e,subN:(t,e)=>t-e,mulN:(t,e)=>t*e,inv:e=>eb(e,t),sqrt:s||(e=>(i||(i=function(t){if(t%ec===eu)return ev;if(t%ed===eh)return ex;if(t%eg===ep){let e,r,n,i,o,s;return e=eM(t),n=(r=eE(t))(e,e.neg(e.ONE)),i=r(e,n),o=r(e,e.neg(n)),s=(t+ef)/eg,(t,e)=>{let r=t.pow(e,s),a=t.mul(r,n),l=t.mul(r,i),u=t.mul(r,o),c=t.eql(t.sqr(a),e),h=t.eql(t.sqr(l),e);r=t.cmov(r,a,c),a=t.cmov(u,l,h);let f=t.eql(t.sqr(a),e),d=t.cmov(r,a,f);return ew(t,d,e),d}}return eE(t)}(t)),i(h,e))),toBytes:t=>r?t8(t,c):t3(t,c),fromBytes:(e,n=!0)=>
vendor: 4,465 bytes, line 1
1{if(a){if(!a.includes(e.length)||e.length>c)throw Error("Field.fromBytes: expected "+a+" bytes, got "+e.length);let t=new Uint8Array(c);t.set(e,r?0:t.length-e.length),e=t}if(e.length!==c)throw Error("Field.fromBytes: expected "+c+" bytes, got "+e.length);let i=r?t5(e):t6(e);if(l&&(i=em(i,t)),!n&&!h.isValid(i))throw Error("invalid field element: outside of range 0..ORDER");return i},invertBatch:t=>eI(h,t),cmov:(t,e,r)=>r?e:t});return Object.freeze(h)}function eC(t){if("bigint"!=typeof t)throw Error("field order must be bigint");return Math.ceil(t.toString(2).length/8)}function eT(t){let e=eC(t);return e+Math.ceil(e/2)}let eL=BigInt(0),eR=BigInt(1);function eO(t,e){let r=e.negate();return t?r:e}function eP(t,e){let r=eI(t.Fp,e.map(t=>t.Z));return e.map((e,n)=>t.fromAffine(e.toAffine(r[n])))}function eU(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw Error("invalid window size, expected [1.."+e+"], got W="+t)}function eN(t,e){eU(t,e);let r=Math.ceil(e/t)+1,n=2**(t-1),i=2**t;return{windows:r,windowSize:n,mask:er(t),maxNumber:i,shiftBy:BigInt(t)}}function ez(t,e,r){let{windowSize:n,mask:i,maxNumber:o,shiftBy:s}=r,a=Number(t&i),l=t>>s;a>n&&(a-=o,l+=eR);let u=e*n,c=u+Math.abs(a)-1,h=0===a;return{nextN:l,offset:c,isZero:h,isNeg:a<0,isNegF:e%2!=0,offsetF:u}}let eq=new WeakMap,eD=new WeakMap;function eW(t){return eD.get(t)||1}function eF(t){if(t!==eL)throw Error("invalid wNAF")}class ej{constructor(t,e){this.BASE=t.BASE,this.ZERO=t.ZERO,this.Fn=t.Fn,this.bits=e}_unsafeLadder(t,e,r=this.ZERO){let n=t;for(;e>eL;)e&eR&&(r=r.add(n)),n=n.double(),e>>=eR;return r}precomputeWindow(t,e){let{windows:r,windowSize:n}=eN(e,this.bits),i=[],o=t,s=o;for(let t=0;t<r;t++){s=o,i.push(s);for(let t=1;t<n;t++)s=s.add(o),i.push(s);o=s.double()}return i}wNAF(t,e,r){if(!this.Fn.isValid(r))throw Error("invalid scalar");let n=this.ZERO,i=this.BASE,o=eN(t,this.bits);for(let t=0;t<o.windows;t++){let{nextN:s,offset:a,isZero:l,isNeg:u,isNegF:c,offsetF:h}=ez(r,t,o);r=s,l?i=i.add(eO(c,e[h])):n=n.add(eO(u,e[a]))}return eF(r),{p:n,f:i}}wNAFUnsafe(t,e,r,n=this.ZERO){let i=eN(t,this.bits);for(let t=0;t<i.windows&&r!==eL;t++){let{nextN:o,offset:s,isZero:a,isNeg:l}=ez(r,t,i);if(r=o,!a){let t=e[s];n=n.add(l?t.negate():t)}}return eF(r),n}getPrecomputes(t,e,r){let n=eq.get(e);return n||(n=this.precomputeWindow(e,t),1!==t&&("function"==typeof r&&(n=r(n)),eq.set(e,n))),n}cached(t,e,r){let n=eW(t);return this.wNAF(n,this.getPrecomputes(n,t,r),e)}unsafe(t,e,r,n){let i=eW(t);return 1===i?this._unsafeLadder(t,e,n):this.wNAFUnsafe(i,this.getPrecomputes(i,t,r),e,n)}createCache(t,e){eU(e,this.bits),eD.set(t,e),eq.delete(t)}hasCache(t){return 1!==eW(t)}}function eK(t,e,r,n){if(!Array.isArray(r))throw Error("array expected");r.forEach((e,r)=>{if(!(e instanceof t))throw Error("invalid point at index "+r)});if(!Array.isArray(n))throw Error("array of scalars expected");n.forEach((t,r)=>{if(!e.isValid(t))throw Error("invalid scalar at index "+r)});let i=r.length,o=n.length;if(i!==o)throw Error("arrays of points and scalars must have equal length");let s=t.ZERO,a=ee(BigInt(i)),l=1;a>12?l=a-3:a>4?l=a-2:a>0&&(l=2);let u=er(l),c=Array(Number(u)+1).fill(s),h=Math.floor((e.BITS-1)/l)*l,f=s;for(let t=h;t>=0;t-=l){c.fill(s);for(let e=0;e<o;e++){let i=Number(n[e]>>BigInt(t)&u);c[i]=c[i].add(r[e])}let e=s;for(let t=c.length-1,r=s;t>0;t--)r=r.add(c[t]),e=e.add(r);if(f=f.add(e),0!==t)for(let t=0;t<l;t++)f=f.double()}return f}function eH(t,e,r){if(!e)return eM(t,{isLE:r});if(e.ORDER!==t)throw Error("Field.ORDER must match order: Fp == p, Fn == n");return eA(e),e}function eV(t,e,r={},n){if(void 0===n&&(n="edwards"===t),!e||"object"!=typeof e)throw Error(`expected valid ${t} CURVE object`);for(let t of["p","n","h"]){let r=e[t];if(!("bigint"==typeof r&&r>eL))throw Error(`CURVE.${t} must be positive bigint`)}let i=eH(e.p,r.Fp,n),o=eH(e.n,r.Fn,n);for(let r of["Gx","Gy","a","weierstrass"===t?"b":"d"])if(!i.isValid(e[r]))throw Error(`CURVE.${r} must be valid field element of CURVE.Fp`);return{CURVE:e=Object.freeze(Object.assign({},e)),Fp:i,Fn:o}}let e$=BigInt(0),eZ=BigInt(1),eG=BigInt(2),eY=BigInt(8);class eQ{constructor(t){this.ep=t}static fromBytes(t){ei()}static fromHex(t){ei()}get x(){return this.toAffine().x}get y(){return this.toAffine().y}clearCofactor(){return this}assertValidity(){this.ep.assertValidity()}toAffine(t){return this.ep.toAffine(t)}toHex(){return tc(this.toBytes())}toString(){return this.toHex()}isTorsionFree(){return!0}isSmallOrder(){return!1}
1add(t){return this.assertSame(t),this.init(this.ep.add(t.ep))}subtract(t){return this.assertSame(t),this.init(this.ep.subtract(t.ep))}multiply(t){return this.init(this.ep.multiply(t))}multiplyUnsafe(t){return this.init(this.ep.multiplyUnsafe(t))}double(){return this.init(this.ep.double())}negate(){return this.init(this.ep.negate())}precompute(t,e){return this.init(this.ep.precompute(t,e))}toRawBytes(){return this.toBytes()}}function eJ(t,e){if(eX(t),eX(e),t<0||t>=1<<8*e)throw Error("invalid I2OSP input: "+t);let r=Array.from({length:e}).fill(0);for(let n=e-1;n>=0;n--)r[n]=255&t,t>>>=8;return new Uint8Array(r)}function eX(t){if(!Number.isSafeInteger(t))throw Error("number expected")}function e0(t){if(!J(t)&&"string"!=typeof t)throw Error("DST must be Uint8Array or string");return"string"==typeof t?td(t):t}function e1(t,e,r){var n;let i;en(r,{p:"bigint",m:"number",k:"number",hash:"function"});let{p:o,k:s,m:a,hash:l,expand:u,DST:c}=r;if(!("function"==typeof(n=r.hash)&&Number.isSafeInteger(n.outputLen)))throw Error("expected valid hash");tt(t),eX(e);let h=Math.ceil((o.toString(2).length+s)/8),f=e*a*h;if("xmd"===u)i=function(t,e,r,n){tt(t),eX(r),(e=e0(e)).length>255&&(e=n(tg(td("H2C-OVERSIZE-DST-"),e)));let{outputLen:i,blockLen:o}=n,s=Math.ceil(r/i);if(r>65535||s>255)throw Error("expand_message_xmd: invalid lenInBytes");let a=tg(e,eJ(e.length,1)),l=eJ(0,o),u=eJ(r,2),c=Array(s),h=n(tg(l,t,u,eJ(0,1),a));c[0]=n(tg(h,eJ(1,1),a));for(let t=1;t<=s;t++){let e=[function(t,e){let r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t[n]^e[n];return r}(h,c[t-1]),eJ(t+1,1),a];c[t]=n(tg(...e))}return tg(...c).slice(0,r)}(t,c,f,l);else if("xof"===u)i=function(t,e,r,n,i){if(tt(t),eX(r),(e=e0(e)).length>255){let t=Math.ceil(2*n/8);e=i.create({dkLen:t}).update(td("H2C-OVERSIZE-DST-")).update(e).digest()}if(r>65535||e.length>255)throw Error("expand_message_xof: invalid lenInBytes");return i.create({dkLen:r}).update(t).update(eJ(r,2)).update(e).update(eJ(e.length,1)).digest()}(t,c,f,s,l);else if("_internal_pass"===u)i=t;else throw Error('expand must be "xmd" or "xof"');let d=Array(e);for(let t=0;t<e;t++){let e=Array(a);for(let r=0;r<a;r++){let n=h*(r+t*a),s=i.subarray(n,n+h);e[r]=em(t6(s),o)}d[t]=e}return d}let e2=td("HashToScalar-");function e6(t,e,r){if("function"!=typeof e)throw Error("mapToCurve() must be defined");function n(r){return t.fromAffine(e(r))}function i(e){let r=e.clearCofactor();return r.equals(t.ZERO)?t.ZERO:(r.assertValidity(),r)}return{defaults:r,hashToCurve(t,e){let o=e1(t,2,Object.assign({},r,e)),s=n(o[0]),a=n(o[1]);return i(s.add(a))},encodeToCurve(t,e){let o=r.encodeDST?{DST:r.encodeDST}:{};return i(n(e1(t,1,Object.assign({},r,o,e))[0]))},mapToCurve(t){if(!Array.isArray(t))throw Error("expected array of bigints");for(let e of t)if("bigint"!=typeof e)throw Error("expected array of bigints");return i(n(t))},hashToScalar:(e,n)=>e1(e,1,Object.assign({},r,{p:t.Fn.ORDER,m:1,DST:e2},n))[0][0]}}BigInt(0),BigInt(1),BigInt(2);let e5=BigInt(0),e3=BigInt(1),e8=BigInt(2),e4=BigInt(3),e7=BigInt(5),e9=BigInt(8),rt=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),re={p:rt,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:e9,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")},rr=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function rn(t,e){var r;let n,i,o,s,a,l,u,c,h,f,d,p,g,m,y=em(e*e*e,rt),b=(r=t*em(y*y*e,rt),n=BigInt(10),i=BigInt(20),o=BigInt(40),s=BigInt(80),l=ey(a=r*r%rt*r%rt,e8,rt)*a%rt,u=ey(l,e3,rt)*r%rt,c=ey(u,e7,rt)*u%rt,h=ey(c,n,rt)*c%rt,f=ey(h,i,rt)*h%rt,d=ey(f,o,rt)*f%rt,p=ey(d,s,rt)*d%rt,g=ey(p,s,rt)*d%rt,m=ey(g,n,rt)*c%rt,{pow_p_5_8:ey(m,e8,rt)*r%rt,b2:a}).pow_p_5_8,w=em(t*y*b,rt),v=em(e*w*w,rt),x=w,E=em(w*rr,rt),S=v===t,k=v===em(-t,rt),A=v===em(-t*rr,rt);return S&&(w=x),(k||A)&&(w=E),eS(w,rt)&&(w=em(-w,rt)),{isValid:S||k,value:w}}let ri=eM(re.p,{isLE:!0}),ro=eM(re.n,{isLE:!0}),rs=function(t){let e,r,n,i,{CURVE:o,curveOpts:s,hash:a,eddsaOpts:l}=(e={a:t.a,d:t.d,p:t.Fp.ORDER,n:t.n,h:t.h,Gx:t.Gx,Gy:t.Gy},r={Fp:t.Fp,Fn:eM(e.n,t.nBitLength,!0),uvRatio:t.uvRatio},n={randomBytes:t.randomBytes,adjustScalarBytes:t.adjustScalarBytes,domain:t.domain,prehash:t.prehash,mapToCurve:t.mapToCurve},{CURVE:e,curveOpts:r,hash:t.hash,eddsaOpts:n}),u=function(t,e,r={}){if("function"!=typeof e)throw Error('"hash" function param is required');en(r,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",mapToCurve:"function"});let{prehash:n}=r,{BASE:i,Fp:o,Fn:s}=t,a=r.randomBytes||tb,l=r.adjustScalarBytes||(t=>t),u=r.domain||((t,e,r)=>{if(tX(r,"phflag"),e.length||r)throw Error("Contexts/pre-hash are not supported");return t});function c(t){return s.create(t5(t))}function h(t){var r;
1let n,o,s,a,u,{head:h,prefix:f,scalar:d}=(r=t4("private key",r=t,n=m.secretKey),s=l((o=t4("hashed private key",e(r),2*n)).slice(0,n)),a=o.slice(n,2*n),u=c(s),{head:s,prefix:a,scalar:u}),p=i.multiply(d),g=p.toBytes();return{head:h,prefix:f,scalar:d,point:p,pointBytes:g}}function f(t){return h(t).pointBytes}function d(t=Uint8Array.of(),...r){return c(e(u(tg(...r),t4("context",t),!!n)))}let p={zip215:!0},g=o.BYTES,m={secretKey:g,publicKey:g,signature:2*g,seed:g};function y(t=a(m.seed)){return t0(t,m.seed,"seed")}let b={getExtendedPublicKey:h,randomSecretKey:y,isValidSecretKey:function(t){return J(t)&&t.length===s.BYTES},isValidPublicKey:function(e,r){try{return!!t.fromBytes(e,r)}catch(t){return!1}},toMontgomery(e){let{y:r}=t.fromBytes(e),n=m.publicKey,i=32===n;if(!i&&57!==n)throw Error("only defined for 25519 and 448");let s=i?o.div(eZ+r,eZ-r):o.div(r-eZ,r+eZ);return o.toBytes(s)},toMontgomerySecret(t){let r=m.secretKey;return t0(t,r),l(e(t.subarray(0,r))).subarray(0,r)},randomPrivateKey:y,precompute:(e=8,r=t.BASE)=>r.precompute(e,!1)};return Object.freeze({keygen:function(t){let e=b.randomSecretKey(t);return{secretKey:e,publicKey:f(e)}},getPublicKey:f,sign:function(t,e,r={}){t=t4("message",t),n&&(t=n(t));let{prefix:o,scalar:a,pointBytes:l}=h(e),u=d(r.context,o,t),c=i.multiply(u).toBytes(),f=d(r.context,c,l,t),p=s.create(u+f*a);if(!s.isValid(p))throw Error("sign failed: invalid s");return t0(tg(c,s.toBytes(p)),m.signature,"result")},verify:function(e,r,o,s=p){let a,l,u,{context:c,zip215:h}=s,f=m.signature;e=t4("signature",e,f),r=t4("message",r),o=t4("publicKey",o,m.publicKey),void 0!==h&&tX(h,"zip215"),n&&(r=n(r));let g=f/2,y=e.subarray(0,g),b=t5(e.subarray(g,f));try{a=t.fromBytes(o,h),l=t.fromBytes(y,h),u=i.multiplyUnsafe(b)}catch(t){return!1}if(!h&&a.isSmallOrder())return!1;let w=d(c,l.toBytes(),a.toBytes(),r);return l.add(a.multiplyUnsafe(w)).subtract(u).clearCofactor().is0()},utils:b,Point:t,lengths:m})}(function(t,e={}){var r,n;let i,o,s,a,l,u=eV("edwards",t,e,e.FpFnLE),{Fp:c,Fn:h}=u,f=u.CURVE,{h:d}=f;en(e,{},{uvRatio:"function"});let p=eG<<BigInt(8*h.BYTES)-eZ,g=e.uvRatio||((t,e)=>{try{return{isValid:!0,value:c.sqrt(c.div(t,e))}}catch(t){return{isValid:!1,value:e$}}});if(r=f.Gx,n=f.Gy,i=c.sqr(r),o=c.sqr(n),s=c.add(c.mul(f.a,i),o),a=c.add(c.ONE,c.mul(f.d,c.mul(i,o))),!c.eql(s,a))throw Error("bad curve params: generator point");function m(t,e,r=!1){return et("coordinate "+t,e,r?eZ:e$,p),e}function y(t){if(!(t instanceof v))throw Error("ExtendedPoint expected")}let b=eo((t,e)=>{let r,n,{X:i,Y:o,Z:s}=t,a=t.is0();null==e&&(e=a?eY:c.inv(s));let l=(r=i*e,c.create(r)),u=(n=o*e,c.create(n)),h=c.mul(s,e);if(a)return{x:e$,y:eZ};if(h!==eZ)throw Error("invZ was invalid");return{x:l,y:u}}),w=eo(t=>{let e,r,n,i,o,s,a,l,u,h,d,p,{a:g,d:m}=f;if(t.is0())throw Error("bad point: ZERO");let{X:y,Y:b,Z:w,T:v}=t,x=(e=y*y,c.create(e)),E=(r=b*b,c.create(r)),S=(n=w*w,c.create(n)),k=(i=S*S,c.create(i));if(a=S*(o=x*g,s=c.create(o)+E,c.create(s)),c.create(a)!==(h=k+(u=m*(l=x*E,c.create(l)),c.create(u)),c.create(h)))throw Error("bad point: equation left != right (1)");if(d=y*b,c.create(d)!==(p=w*v,c.create(p)))throw Error("bad point: equation left != right (2)");return!0});class v{constructor(t,e,r,n){this.X=m("x",t),this.Y=m("y",e),this.Z=m("z",r,!0),this.T=m("t",n),Object.freeze(this)}static CURVE(){return f}static fromAffine(t){let e;if(t instanceof v)throw Error("extended point not allowed");let{x:r,y:n}=t||{};return m("x",r),m("y",n),new v(r,n,eZ,(e=r*n,c.create(e)))}static fromBytes(t,e=!1){let r,n,i,o,s=c.BYTES,{a,d:l}=f;t=t7(t0(t,s,"point")),tX(e,"zip215");let u=t7(t),h=t[s-1];u[s-1]=-129&h;let d=t5(u);et("point.y",d,e$,e?p:c.ORDER);let m=(r=d*d,c.create(r)),{isValid:y,value:b}=g((n=m-eZ,c.create(n)),(i=l*m-a,c.create(i)));if(!y)throw Error("bad point: invalid y coordinate");let w=(b&eZ)===eZ,x=(128&h)!=0;if(!e&&b===e$&&x)throw Error("bad point: x=0 and x_0=1");return x!==w&&(o=-b,b=c.create(o)),v.fromAffine({x:b,y:d})}static fromHex(t,e=!1){return v.fromBytes(t4("point",t),e)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(t=8,e=!0){return x.createCache(this,t),e||this.multiply(eG),this}assertValidity(){w(this)}equals(t){let e,r,n,i;y(t);let{X:o,Y:s,Z:a}=this,{X:l,Y:u,Z:h}
1=t,f=(e=o*h,c.create(e)),d=(r=l*a,c.create(r)),p=(n=s*h,c.create(n)),g=(i=u*a,c.create(i));return f===d&&p===g}is0(){return this.equals(v.ZERO)}negate(){let t,e;return new v((t=-this.X,c.create(t)),this.Y,this.Z,(e=-this.T,c.create(e)))}double(){let t,e,r,n,i,o,s,a,l,u,h,{a:d}=f,{X:p,Y:g,Z:m}=this,y=(t=p*p,c.create(t)),b=(e=g*g,c.create(e)),w=(n=eG*(r=m*m,c.create(r)),c.create(n)),x=(i=d*y,c.create(i)),E=p+g,S=(o=E*E,s=c.create(o)-y-b,c.create(s)),k=x+b,A=k-w,I=x-b,B=(a=S*A,c.create(a)),_=(l=k*I,c.create(l)),M=(u=S*I,c.create(u));return new v(B,_,(h=A*k,c.create(h)),M)}add(t){let e,r,n,i,o,s,a,l,u,h;y(t);let{a:d,d:p}=f,{X:g,Y:m,Z:b,T:w}=this,{X:x,Y:E,Z:S,T:k}=t,A=(e=g*x,c.create(e)),I=(r=m*E,c.create(r)),B=(n=w*p*k,c.create(n)),_=(i=b*S,c.create(i)),M=(o=(g+m)*(x+E)-A-I,c.create(o)),C=_-B,T=_+B,L=(s=I-d*A,c.create(s)),R=(a=M*C,c.create(a)),O=(l=T*L,c.create(l)),P=(u=M*L,c.create(u));return new v(R,O,(h=C*T,c.create(h)),P)}subtract(t){return this.add(t.negate())}multiply(t){if(!h.isValidNot0(t))throw Error("invalid scalar: expected 1 <= sc < curve.n");let{p:e,f:r}=x.cached(this,t,t=>eP(v,t));return eP(v,[e,r])[0]}multiplyUnsafe(t,e=v.ZERO){if(!h.isValid(t))throw Error("invalid scalar: expected 0 <= sc < curve.n");return t===e$?v.ZERO:this.is0()||t===eZ?this:x.unsafe(this,t,t=>eP(v,t),e)}isSmallOrder(){return this.multiplyUnsafe(d).is0()}isTorsionFree(){return x.unsafe(this,f.n).is0()}toAffine(t){return b(this,t)}clearCofactor(){return d===eZ?this:this.multiplyUnsafe(d)}toBytes(){let{x:t,y:e}=this.toAffine(),r=c.toBytes(e);return r[r.length-1]|=t&eZ?128:0,r}toHex(){return tc(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get ex(){return this.X}get ey(){return this.Y}get ez(){return this.Z}get et(){return this.T}static normalizeZ(t){return eP(v,t)}static msm(t,e){return eK(v,h,t,e)}_setWindowSize(t){this.precompute(t)}toRawBytes(){return this.toBytes()}}v.BASE=new v(f.Gx,f.Gy,eZ,(l=f.Gx*f.Gy,c.create(l))),v.ZERO=new v(e$,eZ,eZ,e$),v.Fp=c,v.Fn=h;let x=new ej(v,h.BITS);return v.BASE.precompute(8),v}(o,s),a,l);return i=u.Point,Object.assign({},u,{ExtendedPoint:i,CURVE:t,nBitLength:i.Fn.BITS,nByteLength:i.Fn.BYTES})}({...re,Fp:ri,hash:tY,adjustScalarBytes:function(t){return t[0]&=248,t[31]&=127,t[31]|=64,t},uvRatio:rn}),ra=(rt+e4)/e9,rl=ri.pow(e8,ra),ru=ri.sqrt(ri.neg(ri.ONE)),rc=function(t,e){if(!t.isOdd)throw Error("Field doesn't have isOdd");let r=t.sqrt(e);return t.isOdd(r)?t.neg(r):r}(ri,ri.neg(BigInt(486664)));e6(rs.Point,t=>(function(t){let e,r,n,i,o,s,a,l,u,c,h,f,d,p,g,m,y,b,w,v,x,E,S,{xMn:k,xMd:A,yMn:I,yMd:B}=(e=(rt-e7)/e9,r=BigInt(486662),n=ri.sqr(t),n=ri.mul(n,e8),i=ri.add(n,ri.ONE),o=ri.neg(r),s=ri.sqr(i),a=ri.mul(s,i),l=ri.mul(n,r),l=ri.mul(l,o),l=ri.add(l,s),l=ri.mul(l,o),u=ri.sqr(a),s=ri.sqr(u),u=ri.mul(u,a),u=ri.mul(u,l),s=ri.mul(s,u),c=ri.pow(s,e),c=ri.mul(c,u),h=ri.mul(c,ru),s=ri.sqr(c),s=ri.mul(s,a),f=ri.eql(s,l),d=ri.cmov(h,c,f),p=ri.mul(o,n),g=ri.mul(c,t),g=ri.mul(g,rl),m=ri.mul(g,ru),y=ri.mul(l,n),s=ri.sqr(g),s=ri.mul(s,a),b=ri.eql(s,y),w=ri.cmov(m,g,b),s=ri.sqr(d),s=ri.mul(s,a),v=ri.eql(s,l),x=ri.cmov(p,o,v),E=ri.cmov(w,d,v),S=ri.isOdd(E),{xMn:x,xMd:i,yMn:E=ri.cmov(E,ri.neg(E),v!==S),yMd:e3}),_=ri.mul(k,B);_=ri.mul(_,rc);let M=ri.mul(A,I),C=ri.sub(k,A),T=ri.add(k,A),L=ri.mul(M,T),R=ri.eql(L,ri.ZERO);_=ri.cmov(_,ri.ZERO,R),M=ri.cmov(M,ri.ONE,R),C=ri.cmov(C,ri.ONE,R),T=ri.cmov(T,ri.ONE,R);let[O,P]=eI(ri,[M,T],!0);return{x:ri.mul(_,O),y:ri.mul(C,P)}})(t[0]),{DST:"edwards25519_XMD:SHA-512_ELL2_RO_",encodeDST:"edwards25519_XMD:SHA-512_ELL2_NU_",p:rt,m:1,k:128,expand:"xmd",hash:tY});let rh=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),rf=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),rd=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),rp=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),rg=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),rm=t=>rs.Point.Fp.create(t5(t)&rg);function ry(t){let e,r,n,i,o,s,a,l,u,c,h,f,d,p,g,{d:m}=re,y=(e=rr*t*t,ri.create(e)),b=(r=(y+e3)*rd,ri.create(r)),w=BigInt(-1),v=(i=(w-m*y)*(n=y+m,ri.create(n)),ri.create(i)),{isValid:x,value:E}=rn(b,v),S=(o=E*t,ri.create(o));eS(S,rt)||(s=-S,S=ri.create(s)),x||(E=S),x||(w=y);let k=(a=w*(y-e3)*rp-v,ri.create(a)),A=E*E,I=(l=(E+E)*v,ri.create(l)),B=(u=k*rh,ri.create(u)),_=(c=e3-A,ri.create(c)),M=(h=e3+A,ri.create(h));return new rs.Point((f=I*M,ri.create(f)),(d=_*B,ri.create(d)),(p=B*M,ri.create(p)),(g=I*_,ri.create(g)))}class rb extends eQ{constructor(t){super(t)}static fromAffine(t){return new rb(rs.Point.fromAffine(t))}assertSame(t){if(!(t instanceof rb))throw Error("RistrettoPoint expected")}init(t){return new rb(t)}static hashToCurve(t){var e;let r,n;return tt(e=t4("ristrettoHash",t,64),64),r=ry(rm(e.subarray(0,32))),n=ry(rm(e.subarray(32,64))),new rb(r.add(n))}static fromBytes(t){let e,r,n,i,o,s,a,l,u,c,h,f,d;tt(t,32);let{a:p,d:g}=re,m=rm(t);if(!function(t,e){if(t.length!==e.length)return!1;let r=0;for(let n=0;n<t.length;n++)r|=t[n]^e[n];return 0===r}(ri.toBytes(m),t)||eS(m,rt))throw Error("invalid ristretto255 encoding 1");let y=(e=m*m,ri.create(e)),b=(r=e3+p*y,ri.create(r)),w=(n=e3-p*y,ri.create(n)),v=(i=b*b,ri.create(i)),x=(o=w*w,ri.create(o)),E=(s=p*g*v-x,ri.create(s)),{isValid:S,value:k}
1=(a=E*x,rn(e3,ri.create(a))),A=(l=k*w,ri.create(l)),I=(u=k*A*E,ri.create(u)),B=(c=(m+m)*A,ri.create(c));eS(B,rt)&&(h=-B,B=ri.create(h));let _=(f=b*I,ri.create(f)),M=(d=B*_,ri.create(d));if(!S||eS(M,rt)||_===e5)throw Error("invalid ristretto255 encoding 2");return new rb(new rs.Point(B,_,e3,M))}static fromHex(t){return rb.fromBytes(t4("ristrettoHex",t,32))}static msm(t,e){return eK(rb,rs.Point.Fn,t,e)}toBytes(){let t,e,r,n,i,o,s,a,l,u,c,h,f,{X:d,Y:p,Z:g,T:m}=this.ep,y=(t=g+p,r=ri.create(t)*(e=g-p,ri.create(e)),ri.create(r)),b=(n=d*p,ri.create(n)),{value:w}=(o=y*(i=b*b,ri.create(i)),rn(e3,ri.create(o))),v=(s=w*y,ri.create(s)),x=(a=w*b,ri.create(a)),E=(l=v*x*m,ri.create(l));if(eS(m*E,rt)){let t,e,r=(t=p*rr,ri.create(t)),n=(e=d*rr,ri.create(e));d=r,p=n,f=ri.create(v*rf)}else f=x;eS(d*E,rt)&&(u=-p,p=ri.create(u));let S=(c=(g-p)*f,ri.create(c));return eS(S,rt)&&(h=-S,S=ri.create(h)),ri.toBytes(S)}equals(t){let e,r,n,i;this.assertSame(t);let{X:o,Y:s}=this.ep,{X:a,Y:l}=t.ep,u=(e=o*l,ri.create(e)===(r=s*a,ri.create(r))),c=(n=s*l,ri.create(n)===(i=o*a,ri.create(i)));return u||c}is0(){return this.equals(rb.ZERO)}}rb.BASE=new rb(rs.Point.BASE),rb.ZERO=new rb(rs.Point.ZERO),rb.Fp=ri,rb.Fn=ro;var rw=t.i(59341),rv=t.i(54611),rx=t.i(54119),rE=t.i(44610);function rS([t,e]){return`${t}=${function t(e){return Array.isArray(e)?"%5B"+e.map(t).join("%2C%20")+"%5D":"bigint"==typeof e?`${e}n`:encodeURIComponent(String(null!=e&&null===Object.getPrototypeOf(e)?{...e}:e))}(e)}`}var rk=class extends Error{cause=this.cause;context;constructor(...[t,e]){let r,n;if(e){const{cause:t,...i}=e;t&&(n={cause:t}),Object.keys(i).length>0&&(r=i)}super(function(t,e={}){{let r=`Solana error #${t}; Decode this error by running \`npx @solana/errors decode -- ${t}`;return Object.keys(e).length&&(r+=` '${btoa(Object.entries(e).map(rS).join("&"))}'`),`${r}\``}}(t,r),n),this.context={__code:t,...r},this.name="SolanaError"}};function rA(t){return"fixedSize"in t&&"number"==typeof t.fixedSize}var rI=((s=rI||{})[s.Little=0]="Little",s[s.Big=1]="Big",s);function rB(t){return t?.endian!==1}class r_ extends TypeError{constructor(t,e){let r;const{message:n,explanation:i,...o}=t,{path:s}=t,a=0===s.length?n:`At path: ${s.join(".")} -- ${n}`;super(i??a),null!=i&&(this.cause=a),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>r??(r=[t,...e()])}}function rM(t){return"object"==typeof t&&null!=t}function rC(t){return rM(t)&&!Array.isArray(t)}function rT(t){return"symbol"==typeof t?t.toString():"string"==typeof t?JSON.stringify(t):`${t}`}function*rL(t,e,r,n){var i;for(let o of(rM(i=t)&&"function"==typeof i[Symbol.iterator]||(t=[t]),t)){let t=function(t,e,r,n){if(!0===t)return;!1===t?t={}:"string"==typeof t&&(t={message:t});let{path:i,branch:o}=e,{type:s}=r,{refinement:a,message:l=`Expected a value of type \`${s}\`${a?` with refinement \`${a}\``:""}, but received: \`${rT(n)}\``}=t;return{value:n,type:s,refinement:a,key:i[i.length-1],path:i,branch:o,...t,message:l}}(o,e,r,n);t&&(yield t)}}function*rR(t,e,r={}){let{path:n=[],branch:i=[t],coerce:o=!1,mask:s=!1}=r,a={path:n,branch:i,mask:s};o&&(t=e.coercer(t,a));let l="valid";for(let n of e.validator(t,a))n.explanation=r.message,l="not_valid",yield[n,void 0];for(let[u,c,h]of e.entries(t,a))for(let e of rR(c,h,{path:void 0===u?n:[...n,u],branch:void 0===u?i:[...i,c],coerce:o,mask:s,message:r.message}))e[0]?(l=null!=e[0].refinement?"not_refined":"not_valid",yield[e[0],void 0]):o&&(c=e[1],void 0===u?t=c:t instanceof Map?t.set(u,c):t instanceof Set?t.add(c):rM(t)&&(void 0!==c||u in t)&&(t[u]=c));if("not_valid"!==l)for(let n of e.refiner(t,a))n.explanation=r.message,l="not_refined",yield[n,void 0];"valid"===l&&(yield[void 0,t])}class rO{constructor(t){const{type:e,schema:r,validator:n,refiner:i,coercer:o=t=>t,entries:s=function*(){}}=t;this.type=e,this.schema=r,this.entries=s,this.coercer=o,n?this.validator=(t,e)=>rL(n(t,e),e,this,t):this.validator=()=>[],i?this.refiner=(t,e)=>rL(i(t,e),e,this,t):this.refiner=()=>[]}assert(t,e){var r=t,n=this,i=e;let o=rU(r,n,{message:i});if(o[0])throw o[0]}create(t,e){return rP(t,this,e)}is(t){var e,r;return e=t,r=this,!rU(e,r)[0]}mask(t,e){var r=t,n=this,i=e;let o=rU(r,n,{coerce:!0,mask:!0,message:i});if(!o[0])return o[1];throw o[0]}validate(t,e={}){return rU(t,this,e)}}function rP(t,e,r){let n=rU(t,e,{coerce:!0,message:r});if(!n[0])return n[1];throw n[0]}function rU(t,e,r={}){let n=rR(t,e,r),i=function(t){let{done:e,value:r}=t.next();return e?void 0:r}(n);return i[0]?[new r_(i[0],function*(){for(let t of n)t[0]&&(yield t[0])}),void 0]:[void 0,i[1]]}function rN(t,e){return new rO({type:t,schema:null,validator:e})}function rz(t){return new rO({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(let[r,n]of e.entries())yield[r,n,t]},coercer:t=>Array.isArray(t)?t.slice():t,validator:t=>Array.isArray(t)||`Expected an array value, but received: ${rT(t)}`})}function rq(){return rN("boolean",t=>"boolean"==typeof t)}function rD(t){return rN("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${rT(e)}`)}function rW(t){let e=rT(t),r=typeof t;return new rO({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?t:null,validator:r=>r===t||`Expected the literal \`${e}\`, but received: ${rT(r)}`})}function rF(t){return new rO({...t,validator:(e,r)=>null===e||t.validator(e,r),refiner:(e,r)=>null===e||t.refiner(e,r)})}function rj(){return rN("number",t=>"number"==typeof t&&!isNaN(t)||`Expected a number, but received: ${rT(t)}`)}function rK(t){return new rO({...t,validator:(e,r)=>void 0===e||t.validator(e,r),refiner:(e,r)=>void 0===e||t.refiner(e,r)})}function rH(t,e){return new rO({type:"record",schema:null,*entries(r){if(rM(r))for(let n in r){let i=r[n];yield[n,n,t],yield[n,i,e]}},validator:t=>rC(t)||`Expected an object, but received: ${rT(t)}`,coercer:t=>rC(t)?{...t}:t})}function rV(){return rN("string",t=>"string"==typeof t||`Expected a string, but received: ${rT(t)}`)}function r$(t){let e=rN("never",()=>!1);return new rO({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){let n=Math.max(t.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],t[i]||e]}},validator:t=>Array.isArray(t)||`Expected an array, but received: ${rT(t)}`,coercer:t=>Array.isArray(t)?t.slice():t})}function rZ(t){let e=Object.keys(t);return new rO({type:"type",schema:t,*entries(r){if(rM(r))for(let n of e)yield[n,r[n],t[n]]},validator:t=>rC(t)||`Expected an object, but received: ${rT(t)}`,coercer:t=>rC(t)?{...t}:t})}function rG(t){let e=t.map(t=>t.type).join(" | ");return new rO({type:"union",schema:null,coercer(e,r){for(let n of t){let[t,i]=n.validate(e,{coerce:!0,mask:r.mask});if(!t)return i}return e},validator(r,n){let i=[];for(let e of t){let[...t]=rR(r,e,n),[o]=t;if(!o[0])return[];for(let[e]of t)e&&i.push(e)}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${rT(r)}`,...i]}})}function rY(){return rN("unknown",()=>!0)}function rQ(t,e,r){return new rO({...t,coercer:(n,i)=>rU(n,e)[0]?t.coercer(n,i):t.coercer(r(n,i),i)})}var rJ=t.i(78217),rX=t.i(95932),r0=t.i(78492),r0=r0,r1=class extends r0.default{socket;constructor(t,e){super(),this.socket=new window.WebSocket(t,e.protocols),this.socket.onopen=()=>
vendor: 4,391 bytes, line 1
1this.emit("open"),this.socket.onmessage=t=>this.emit("message",t.data),this.socket.onerror=t=>this.emit("error",t),this.socket.onclose=t=>{this.emit("close",t.code,t.reason)}}send(t,e,r){let n=r||e;try{this.socket.send(t),n()}catch(t){n(t)}}close(t,e){this.socket.close(t,e)}addEventListener(t,e,r){this.socket.addEventListener(t,e,r)}},r2=class{encode(t){return JSON.stringify(t)}decode(t){return JSON.parse(t)}},r6=class extends r0.default{address;rpc_id;queue;options;autoconnect;ready;reconnect;reconnect_timer_id;reconnect_interval;max_reconnects;rest_options;current_reconnects;generate_request_id;socket;webSocketFactory;dataPack;constructor(t,e="ws://localhost:8080",{autoconnect:r=!0,reconnect:n=!0,reconnect_interval:i=1e3,max_reconnects:o=5,...s}={},a,l){super(),this.webSocketFactory=t,this.queue={},this.rpc_id=0,this.address=e,this.autoconnect=r,this.ready=!1,this.reconnect=n,this.reconnect_timer_id=void 0,this.reconnect_interval=i,this.max_reconnects=o,this.rest_options=s,this.current_reconnects=0,this.generate_request_id=a||(()=>"number"==typeof this.rpc_id?++this.rpc_id:Number(this.rpc_id)+1),l?this.dataPack=l:this.dataPack=new r2,this.autoconnect&&this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}connect(){this.socket||this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}call(t,e,r,n){return n||"object"!=typeof r||(n=r,r=null),new Promise((i,o)=>{if(!this.ready)return o(Error("socket not ready"));let s=this.generate_request_id(t,e);this.socket.send(this.dataPack.encode({jsonrpc:"2.0",method:t,params:e||void 0,id:s}),n,t=>{if(t)return o(t);this.queue[s]={promise:[i,o]},r&&(this.queue[s].timeout=setTimeout(()=>{delete this.queue[s],o(Error("reply timeout"))},r))})})}async login(t){let e=await this.call("rpc.login",t);if(!e)throw Error("authentication failed");return e}async listMethods(){return await this.call("__listMethods")}notify(t,e){return new Promise((r,n)=>{if(!this.ready)return n(Error("socket not ready"));this.socket.send(this.dataPack.encode({jsonrpc:"2.0",method:t,params:e}),t=>{if(t)return n(t);r()})})}async subscribe(t){"string"==typeof t&&(t=[t]);let e=await this.call("rpc.on",t);if("string"==typeof t&&"ok"!==e[t])throw Error("Failed subscribing to an event '"+t+"' with: "+e[t]);return e}async unsubscribe(t){"string"==typeof t&&(t=[t]);let e=await this.call("rpc.off",t);if("string"==typeof t&&"ok"!==e[t])throw Error("Failed unsubscribing from an event with: "+e);return e}close(t,e){this.socket&&this.socket.close(t||1e3,e)}setAutoReconnect(t){this.reconnect=t}setReconnectInterval(t){this.reconnect_interval=t}setMaxReconnects(t){this.max_reconnects=t}getCurrentReconnects(){return this.current_reconnects}getMaxReconnects(){return this.max_reconnects}isReconnecting(){return void 0!==this.reconnect_timer_id}willReconnect(){return this.reconnect&&(0===this.max_reconnects||this.current_reconnects<this.max_reconnects)}_connect(t,e){clearTimeout(this.reconnect_timer_id),this.socket=this.webSocketFactory(t,e),this.socket.addEventListener("open",()=>{this.ready=!0,this.emit("open"),this.current_reconnects=0}),this.socket.addEventListener("message",({data:t})=>{t instanceof ArrayBuffer&&(t=Y.Buffer.from(t).toString());try{t=this.dataPack.decode(t)}catch(t){return}if(t.notification&&this.listeners(t.notification).length){if(!Object.keys(t.params).length)return this.emit(t.notification);let e=[t.notification];if(t.params.constructor===Object)e.push(t.params);else for(let r=0;r<t.params.length;r++)e.push(t.params[r]);return Promise.resolve().then(()=>{this.emit.apply(this,e)})}if(!this.queue[t.id])return t.method?Promise.resolve().then(()=>{this.emit(t.method,t?.params)}):void 0;"error"in t=="result"in t&&this.queue[t.id].promise[1](Error('Server response malformed. Response must include either "result" or "error", but not both.')),this.queue[t.id].timeout&&clearTimeout(this.queue[t.id].timeout),t.error?this.queue[t.id].promise[1](t.error):this.queue[t.id].promise[0](t.result),delete this.queue[t.id]}),this.socket.addEventListener("error",t=>this.emit("error",t)),this.socket.addEventListener("close",({code:r,reason:n})=>{this.ready&&setTimeout(()=>
1this.emit("close",r,n),0),this.ready=!1,this.socket=void 0,1e3!==r&&(this.current_reconnects++,this.reconnect&&(this.max_reconnects>this.current_reconnects||0===this.max_reconnects)?this.reconnect_timer_id=setTimeout(()=>this._connect(t,e),this.reconnect_interval):this.reconnect&&this.max_reconnects>0&&this.current_reconnects>=this.max_reconnects&&setTimeout(()=>this.emit("max_reconnects_reached",r,n),1))})}};let r5=BigInt(0),r3=BigInt(1),r8=BigInt(2),r4=BigInt(7),r7=BigInt(256),r9=BigInt(113),nt=[],ne=[],nr=[];for(let t=0,e=r3,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],nt.push(2*(5*n+r)),ne.push((t+1)*(t+2)/2%64);let i=r5;for(let t=0;t<7;t++)(e=(e<<r3^(e>>r4)*r9)%r7)&r8&&(i^=r3<<(r3<<BigInt(t))-r3);nr.push(i)}let nn=tI(nr,!0),ni=nn[0],no=nn[1],ns=(t,e,r)=>r>32?e<<r-32|t>>>64-r:t<<r|e>>>32-r,na=(t,e,r)=>r>32?t<<r-32|e>>>64-r:e<<r|t>>>32-r;class nl extends tm{constructor(t,e,r,n=!1,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=e,this.outputLen=r,this.enableXOF=n,this.rounds=i,X(r),!(0<t&&t<200))throw Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=function(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}(this.state)}clone(){return this._cloneInto()}keccak(){ta(this.state32),function(t,e=24){let r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let e=0;e<10;e++)r[e]=t[e]^t[e+10]^t[e+20]^t[e+30]^t[e+40];for(let e=0;e<10;e+=2){let n=(e+8)%10,i=(e+2)%10,o=r[i],s=r[i+1],a=ns(o,s,1)^r[n],l=na(o,s,1)^r[n+1];for(let r=0;r<50;r+=10)t[e+r]^=a,t[e+r+1]^=l}let e=t[2],i=t[3];for(let r=0;r<24;r++){let n=ne[r],o=ns(e,i,n),s=na(e,i,n),a=nt[r];e=t[a],i=t[a+1],t[a]=o,t[a+1]=s}for(let e=0;e<50;e+=10){for(let n=0;n<10;n++)r[n]=t[e+n];for(let n=0;n<10;n++)t[e+n]^=~r[(n+2)%10]&r[(n+4)%10]}t[0]^=ni[n],t[1]^=no[n]}ti(r)}(this.state32,this.rounds),ta(this.state32),this.posOut=0,this.pos=0}update(t){tr(this),tt(t=tp(t));let{blockLen:e,state:r}=this,n=t.length;for(let i=0;i<n;){let o=Math.min(e-this.pos,n-i);for(let e=0;e<o;e++)r[this.pos++]^=t[i++];this.pos===e&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:e,pos:r,blockLen:n}=this;t[r]^=e,(128&e)!=0&&r===n-1&&this.keccak(),t[n-1]^=128,this.keccak()}writeInto(t){tr(this,!1),tt(t),this.finish();let e=this.state,{blockLen:r}=this;for(let n=0,i=t.length;n<i;){this.posOut>=r&&this.keccak();let o=Math.min(r-this.posOut,i-n);t.set(e.subarray(this.posOut,this.posOut+o),n),this.posOut+=o,n+=o}return t}xofInto(t){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return X(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(tn(t,this),this.finished)throw Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,ti(this.state)}_cloneInto(t){let{blockLen:e,suffix:r,outputLen:n,rounds:i,enableXOF:o}=this;return t||(t=new nl(e,r,n,o,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=r,t.outputLen=n,t.enableXOF=o,t.destroyed=this.destroyed,t}}let nu=ty(()=>new nl(136,1,32));class nc extends tm{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,te(t);const r=tp(e);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const n=this.blockLen,i=new Uint8Array(n);i.set(r.length>n?t.create().update(r).digest():r);for(let t=0;t<i.length;t++)i[t]^=54;this.iHash.update(i),this.oHash=t.create();for(let t=0;t<i.length;t++)i[t]^=106;this.oHash.update(i),ti(i)}update(t){return tr(this),this.iHash.update(t),this}digestInto(t){tr(this),tt(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:e,iHash:r,finished:n,destroyed:i,blockLen:o,outputLen:s}=this;return t.finished=n,t.destroyed=i,t.blockLen=o,t.outputLen=s,t.oHash=e._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}let nh=(t,e,r)=>new nc(t,e).update(r).digest();nh.create=(t,e)=>new nc(t,e);let nf=(t,e)=>(t+(t>=0?e:-e)/nb)/e;
1function nd(t){if(!["compact","recovered","der"].includes(t))throw Error('Signature format must be "compact", "recovered", or "der"');return t}function np(t,e){let r={};for(let n of Object.keys(e))r[n]=void 0===t[n]?e[n]:t[n];return tX(r.lowS,"lowS"),tX(r.prehash,"prehash"),void 0!==r.format&&nd(r.format),r}let ng={Err:class extends Error{constructor(t=""){super(t)}},_tlv:{encode:(t,e)=>{let{Err:r}=ng;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(1&e.length)throw new r("tlv.encode: unpadded data");let n=e.length/2,i=t1(n);if(i.length/2&128)throw new r("tlv.encode: long form length too big");let o=n>127?t1(i.length/2|128):"";return t1(t)+o+i+e},decode(t,e){let{Err:r}=ng,n=0;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(e.length<2||e[n++]!==t)throw new r("tlv.decode: wrong tlv");let i=e[n++],o=0;if(128&i){let t=127&i;if(!t)throw new r("tlv.decode(long): indefinite length not supported");if(t>4)throw new r("tlv.decode(long): byte length is too big");let s=e.subarray(n,n+t);if(s.length!==t)throw new r("tlv.decode: length bytes not complete");if(0===s[0])throw new r("tlv.decode(long): zero leftmost byte");for(let t of s)o=o<<8|t;if(n+=t,o<128)throw new r("tlv.decode(long): not minimal encoding")}else o=i;let s=e.subarray(n,n+o);if(s.length!==o)throw new r("tlv.decode: wrong value length");return{v:s,l:e.subarray(n+o)}}},_int:{encode(t){let{Err:e}=ng;if(t<nm)throw new e("integer: negative integers are not allowed");let r=t1(t);if(8&Number.parseInt(r[0],16)&&(r="00"+r),1&r.length)throw new e("unexpected DER parsing assertion: unpadded hex");return r},decode(t){let{Err:e}=ng;if(128&t[0])throw new e("invalid signature integer: negative");if(0===t[0]&&!(128&t[1]))throw new e("invalid signature integer: unnecessary leading zero");return t6(t)}},toSig(t){let{Err:e,_int:r,_tlv:n}=ng,i=t4("signature",t),{v:o,l:s}=n.decode(48,i);if(s.length)throw new e("invalid signature: left bytes after parsing");let{v:a,l:l}=n.decode(2,o),{v:u,l:c}=n.decode(2,l);if(c.length)throw new e("invalid signature: left bytes after parsing");return{r:r.decode(a),s:r.decode(u)}},hexFromSig(t){let{_tlv:e,_int:r}=ng,n=e.encode(2,r.encode(t.r)),i=e.encode(2,r.encode(t.s));return e.encode(48,n+i)}},nm=BigInt(0),ny=BigInt(1),nb=BigInt(2),nw=BigInt(3),nv=BigInt(4);function nx(t,e){let r,{BYTES:n}=t;if("bigint"==typeof e)r=e;else{let i=t4("private key",e);try{r=t.fromBytes(i)}catch(t){throw Error(`invalid private key: expected ui8a of size ${n}, got ${typeof e}`)}}if(!t.isValidNot0(r))throw Error("invalid private key: out of range [1..N-1]");return r}function nE(t){return Uint8Array.of(t?2:3)}function nS(t,e){return{secretKey:e.BYTES,publicKey:1+t.BYTES,publicKeyUncompressed:1+2*t.BYTES,publicKeyHasPrefix:!0,signature:2*e.BYTES}}let nk={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},nA={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},nI=BigInt(0),nB=BigInt(2),n_=eM(nk.p,{sqrt:function(t){let e=nk.p,r=BigInt(3),n=BigInt(6),i=BigInt(11),o=BigInt(22),s=BigInt(23),a=BigInt(44),l=BigInt(88),u=t*t*t%e,c=u*u*t%e,h=ey(c,r,e)*c%e,f=ey(h,r,e)*c%e,d=ey(f,nB,e)*u%e,p=ey(d,i,e)*d%e,g=ey(p,o,e)*p%e,m=ey(g,a,e)*g%e,y=ey(m,l,e)*m%e,b=ey(y,a,e)*g%e,w=ey(b,r,e)*c%e,v=ey(w,s,e)*p%e,x=ey(v,n,e)*u%e,E=ey(x,nB,e);if(!n_.eql(n_.sqr(E),t))throw Error("Cannot find square root");return E}}),nM=(a={...nk,Fp:n_,lowS:!0,endo:nA},{...(n=t=>(function(t){let e,{CURVE:r,curveOpts:n,hash:i,ecdsaOpts:o}=function(t){let e,r,n,i,{CURVE:o,curveOpts:s}=(e={a:t.a,b:t.b,p:t.Fp.ORDER,n:t.n,h:t.h,Gx:t.Gx,Gy:t.Gy},r=t.Fp,n=t.allowedPrivateKeyLengths?Array.from(new Set(t.allowedPrivateKeyLengths.map(t=>Math.ceil(t/2)))):void 0,i={Fp:r,Fn:eM(e.n,{BITS:t.nBitLength,allowedLengths:n,modFromBytes:t.wrapPrivateKey}),allowInfinityPoint:t.allowInfinityPoint,endo:t.endo,isTorsionFree:t.isTorsionFree,clearCofactor:t.clearCofactor,fromBytes:t.fromBytes,toBytes:t.toBytes},{CURVE:e,curveOpts:i}),a={hmac:t.hmac,randomBytes:t.randomBytes,lowS:t.lowS,bits2int:t.bits2int,bits2int_modN:t.bits2int_modN};return{CURVE:o,curveOpts:s,hash:t.hash,ecdsaOpts:a}}(t),s=function(t,e,r={}){te(e),en(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});let n=r.randomBytes||tb,i=r.hmac||((t,...r)=>nh(e,t,tg(...r))),{Fp:o,Fn:s}=t,{ORDER:a,BITS:l}=s,{keygen:u,getPublicKey:c,getSharedSecret:h,utils:f,lengths:d}=function(t,e={}){let{Fn:r}=t,n=e.randomBytes||tb,i=Object.assign(nS(t.Fp,r),{seed:eT(r.ORDER)});function o(t){try{return!!nx(r,t)}catch(t){return!1}}function s(t=n(i.seed)){return function(t,e,r=!1){let n=t.length,i=eC(e),o=eT(e);
vendor: 11,092 bytes, line 1
1if(n<16||n<o||n>1024)throw Error("expected "+o+"-1024 bytes of input, got "+n);let s=em(r?t5(t):t6(t),e-ea)+ea;return r?t8(s,i):t3(s,i)}(t0(t,i.seed,"seed"),r.ORDER)}function a(e,n=!0){return t.BASE.multiply(nx(r,e)).toBytes(n)}function l(e){if("bigint"==typeof e)return!1;if(e instanceof t)return!0;let{secretKey:n,publicKey:o,publicKeyUncompressed:s}=i;if(r.allowedLengths||n===o)return;let a=t4("key",e).length;return a===o||a===s}return Object.freeze({getPublicKey:a,getSharedSecret:function(e,n,i=!0){if(!0===l(e))throw Error("first arg must be private key");if(!1===l(n))throw Error("second arg must be public key");let o=nx(r,e);return t.fromHex(n).multiply(o).toBytes(i)},keygen:function(t){let e=s(t);return{secretKey:e,publicKey:a(e)}},Point:t,utils:{isValidSecretKey:o,isValidPublicKey:function(e,r){let{publicKey:n,publicKeyUncompressed:o}=i;try{let i=e.length;if(!0===r&&i!==n||!1===r&&i!==o)return!1;return!!t.fromBytes(e)}catch(t){return!1}},randomSecretKey:s,isValidPrivateKey:o,randomPrivateKey:s,normPrivateKeyToScalar:t=>nx(r,t),precompute:(e=8,r=t.BASE)=>r.precompute(e,!1)},lengths:i})}(t,r),p={prehash:!1,lowS:"boolean"==typeof r.lowS&&r.lowS,format:void 0,extraEntropy:!1},g="compact";function m(t,e){if(!s.isValidNot0(e))throw Error(`invalid signature ${t}: out of range 1..Point.Fn.ORDER`);return e}class y{constructor(t,e,r){this.r=m("r",t),this.s=m("s",e),null!=r&&(this.recovery=r),Object.freeze(this)}static fromBytes(t,e=g){var r,n;let i,o;if(r=t,nd(n=e),o=d.signature,t0(r,"compact"===n?o:"recovered"===n?o+1:void 0,`${n} signature`),"der"===e){let{r:e,s:r}=ng.toSig(t0(t));return new y(e,r)}"recovered"===e&&(i=t[0],e="compact",t=t.subarray(1));let a=s.BYTES,l=t.subarray(0,a),u=t.subarray(a,2*a);return new y(s.fromBytes(l),s.fromBytes(u),i)}static fromHex(t,e){return this.fromBytes(tf(t),e)}addRecoveryBit(t){return new y(this.r,this.s,t)}recoverPublicKey(e){let r=o.ORDER,{r:n,s:i,recovery:l}=this;if(null==l||![0,1,2,3].includes(l))throw Error("recovery id invalid");if(a*nb<r&&l>1)throw Error("recovery id is ambiguous for h>1 curve");let u=2===l||3===l?n+a:n;if(!o.isValid(u))throw Error("recovery id 2 or 3 invalid");let c=o.toBytes(u),h=t.fromBytes(tg(nE((1&l)==0),c)),f=s.inv(u),d=w(t4("msgHash",e)),p=s.create(-d*f),g=s.create(i*f),m=t.BASE.multiplyUnsafe(p).add(h.multiplyUnsafe(g));if(m.is0())throw Error("point at infinify");return m.assertValidity(),m}hasHighS(){return this.s>a>>ny}toBytes(t=g){if(nd(t),"der"===t)return tf(ng.hexFromSig(this));let e=s.toBytes(this.r),r=s.toBytes(this.s);if("recovered"===t){if(null==this.recovery)throw Error("recovery bit must be present");return tg(Uint8Array.of(this.recovery),e,r)}return tg(e,r)}toHex(t){return tc(this.toBytes(t))}assertValidity(){}static fromCompact(t){return y.fromBytes(t4("sig",t),"compact")}static fromDER(t){return y.fromBytes(t4("sig",t),"der")}normalizeS(){return this.hasHighS()?new y(this.r,s.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return tc(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return tc(this.toBytes("compact"))}}let b=r.bits2int||function(t){if(t.length>8192)throw Error("input is too large");let e=t6(t),r=8*t.length-l;return r>0?e>>BigInt(r):e},w=r.bits2int_modN||function(t){return s.create(b(t))},v=er(l);function x(t){return et("num < 2^"+l,t,nm,v),s.toBytes(t)}function E(t,r){return t0(t,void 0,"message"),r?t0(e(t),void 0,"prehashed message"):t}return Object.freeze({keygen:u,getPublicKey:c,getSharedSecret:h,utils:f,lengths:d,Point:t,sign:function(r,o,l={}){let{seed:u,k2sig:c}=function(e,r,i){if(["recovered","canonical"].some(t=>t in i))throw Error("sign() legacy options not supported");let{lowS:o,prehash:l,extraEntropy:u}=np(i,p),c=w(e=E(e,l)),h=nx(s,r),f=[x(h),x(c)];if(null!=u&&!1!==u){let t=!0===u?n(d.secretKey):u;f.push(t4("extraEntropy",t))}return{seed:tg(...f),k2sig:function(e){let r=b(e);if(!s.isValidNot0(r))return;let n=s.inv(r),i=t.BASE.multiply(r).toAffine(),l=s.create(i.x);if(l===nm)return;let u=s.create(n*s.create(c+l*h));if(u===nm)return;let f=2*(i.x!==l)|Number(i.y&ny),d=u;return o&&u>a>>ny&&(d=s.neg(u),f^=1),new y(l,d,f)}}}(r=t4("message",r),o,l);return(function(t,e,r){if("number"!=typeof t||t<2)throw Error("hashLen must be a number");if("number"!=typeof e||e<2)throw Error("qByteLen must be a number");if("function"!=typeof r)throw Error("hmacFn must be a function");let n=t=>new Uint8Array(t),i=n(t),o=n(t),s=0,a=()=>{i.fill(1),o.fill(0),s=0},l=(...t)=>r(o,i,...t),u=(t=n(0))=>{(o=l(Uint8Array.of(0),t),i=l(),0!==t.length)&&(o=l(Uint8Array.of(1),t),i=l())},c=()=>{if(s++>=1e3)throw Error("drbg: tried 1000 values");let t=0,r=[];for(;t<e;){let e=(i=l()).slice();r.push(e),t+=i.length}return tg(...r)};return(t,e)=>{let r;for(a(),u(t);!(r=e(c()));)u();return a(),r}})(e.outputLen,s.BYTES,i)(u,c)},verify:function(e,r,n,i={}){let{lowS:o,prehash:a,format:l}=np(i,p);if(n=t4("publicKey",n),r=E(t4("message",r),a),"strict"in i)throw Error("options.strict was renamed to lowS");let u=void 0===l?function(t){let e,r="string"==typeof t||J(t),n=!r&&null!==t&&"object"==typeof t&&"bigint"==typeof t.r&&"bigint"==typeof t.s;if(!r&&!n)throw Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(n)e=new y(t.r,t.s);else if(r){try{e=y.fromBytes(t4("sig",t),"der")}catch(t){if(!(t instanceof ng.Err))throw t}if(!e)try{e=y.fromBytes(t4("sig",t),"compact")}catch(t){return!1}}return!!e&&e}(e):y.fromBytes(t4("sig",e),l);if(!1===u)return!1;try{let e=t.fromBytes(n);if(o&&u.hasHighS())return!1;let{r:i,s:a}=u,l=w(r),c=s.inv(a),h=s.create(l*c),f=s.create(i*c),d=t.BASE.multiplyUnsafe(h).add(e.multiplyUnsafe(f));if(d.is0())return!1;return s.create(d.x)===i}catch(t){return!1}},recoverPublicKey:function(t,e,r={}){let{prehash:n}=np(r,p);return e=E(e,n),y.fromBytes(t,"recovered").recoverPublicKey(e).toBytes()},Signature:y,hash:e})}(function(t,e={}){let r=eV("weierstrass",t,e),{Fp:n,Fn:i}=r,o=r.CURVE,{h:s,n:a}=o;en(e,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});let{endo:l}=e;if(l&&(!n.is0(o.a)||"bigint"!=typeof l.beta||!Array.isArray(l.basises)))throw Error('invalid endo: expected "beta": bigint and "basises": array');let u=nS(n,i);function c(){if(!n.isOdd)throw Error("compression is not supported: Field does not have .isOdd()")}let h=e.toBytes||function(t,e,r){let{x:i,y:o}=e.toAffine(),s=n.toBytes(i);return(tX(r,"isCompressed"),r)?(c(),tg(nE(!n.isOdd(o)),s)):tg(Uint8Array.of(4),s,n.toBytes(o))},f=e.fromBytes||function(t){t0(t,void 0,"Point");let{publicKey:e,publicKeyUncompressed:r}=u,i=t.length,o=t[0],s=t.subarray(1);if(i===e&&(2===o||3===o)){let t,e=n.fromBytes(s);if(!n.isValid(e))throw Error("bad point: is not on curve, wrong x");let r=d(e);try{t=n.sqrt(r)}catch(t){throw Error("bad point: is not on curve, sqrt error"+(t instanceof Error?": "+t.message:""))}return c(),(1&o)==1!==n.isOdd(t)&&(t=n.neg(t)),{x:e,y:t}}if(i===r&&4===o){let t=n.BYTES,e=n.fromBytes(s.subarray(0,t)),r=n.fromBytes(s.subarray(t,2*t));if(!p(e,r))throw Error("bad point: is not on curve");return{x:e,y:r}}throw Error(`bad point: got length ${i}, expected compressed=${e} or uncompressed=${r}`)};function d(t){let e=n.sqr(t),r=n.mul(e,t);return n.add(n.add(r,n.mul(t,o.a)),o.b)}function p(t,e){let r=n.sqr(e),i=d(t);return n.eql(r,i)}if(!p(o.Gx,o.Gy))throw Error("bad curve params: generator point");let g=n.mul(n.pow(o.a,nw),nv),m=n.mul(n.sqr(o.b),BigInt(27));if(n.is0(n.add(g,m)))throw Error("bad curve params: a or b");function y(t,e,r=!1){if(!n.isValid(e)||r&&n.is0(e))throw Error(`bad point coordinate ${t}`);return e}function b(t){if(!(t instanceof S))throw Error("ProjectivePoint expected")}function w(t){if(!l||!l.basises)throw Error("no endo");return function(t,e,r){let[[n,i],[o,s]]=e,a=nf(s*t,r),l=nf(-i*t,r),u=t-a*n-l*o,c=-a*i-l*s,h=u<nm,f=c<nm;h&&(u=-u),f&&(c=-c);let d=er(Math.ceil(ee(r)/2))+ny;if(u<nm||u>=d||c<nm||c>=d)throw Error("splitScalar (endomorphism): failed, k="+t);return{k1neg:h,k1:u,k2neg:f,k2:c}}(t,l.basises,i.ORDER)}let v=eo((t,e)=>{let{X:r,Y:i,Z:o}=t;if(n.eql(o,n.ONE))return{x:r,y:i};let s=t.is0();null==e&&(e=s?n.ONE:n.inv(o));let a=n.mul(r,e),l=n.mul(i,e),u=n.mul(o,e);if(s)return{x:n.ZERO,y:n.ZERO};if(!n.eql(u,n.ONE))throw Error("invZ was invalid");return{x:a,y:l}}),x=eo(t=>{if(t.is0()){if(e.allowInfinityPoint&&!n.is0(t.Y))return;throw Error("bad point: ZERO")}let{x:r,y:i}=t.toAffine();if(!n.isValid(r)||!n.isValid(i))throw Error("bad point: x or y not field elements");if(!p(r,i))throw Error("bad point: equation left != right");if(!t.isTorsionFree())throw Error("bad point: not in prime-order subgroup");return!0});function E(t,e,r,i,o){return r=new S(n.mul(r.X,t),r.Y,r.Z),e=eO(i,e),r=eO(o,r),e.add(r)}class S{constructor(t,e,r){this.X=y("x",t),this.Y=y("y",e,!0),this.Z=y("z",r),Object.freeze(this)}static CURVE(){return o}static fromAffine(t){let{x:e,y:r}=t||{};if(!t||!n.isValid(e)||!n.isValid(r))throw Error("invalid affine point");if(t instanceof S)throw Error("projective point not allowed");return n.is0(e)&&n.is0(r)?S.ZERO:new S(e,r,n.ONE)}static fromBytes(t){let e=S.fromAffine(f(t0(t,void 0,"point")));return e.assertValidity(),e}static fromHex(t){return S.fromBytes(t4("pointHex",t))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(t=8,e=!0){return A.createCache(this,t),e||this.multiply(nw),this}assertValidity(){x(this)}hasEvenY(){let{y:t}=this.toAffine();if(!n.isOdd)throw Error("Field doesn't support isOdd");return!n.isOdd(t)}equals(t){b(t);let{X:e,Y:r,Z:i}=this,{X:o,Y:s,Z:a}=t,l=n.eql(n.mul(e,a),n.mul(o,i)),u=n.eql(n.mul(r,a),n.mul(s,i));return l&&u}negate(){return new S(this.X,n.neg(this.Y),this.Z)}double(){let{a:t,b:e}=o,r=n.mul(e,nw),{X:i,Y:s,Z:a}=this,l=n.ZERO,u=n.ZERO,c=n.ZERO,h=n.mul(i,i),f=n.mul(s,s),d=n.mul(a,a),p=n.mul(i,s);return p=n.add(p,p),c=n.mul(i,a),c=n.add(c,c),l=n.mul(t,c),u=n.mul(r,d),u=n.add(l,u),l=n.sub(f,u),u=n.add(f,u),u=n.mul(l,u),l=n.mul(p,l),c=n.mul(r,c),d=n.mul(t,d),p=n.sub(h,d),p=n.mul(t,p),p=n.add(p,c),c=n.add(h,h),h=n.add(c,h),h=n.add(h,d),h=n.mul(h,p),u=n.add(u,h),d=n.mul(s,a),d=n.add(d,d),h=n.mul(d,p),l=n.sub(l,h),c=n.mul(d,f),c=n.add(c,c),new S(l,u,c=n.add(c,c))}add(t){b(t);let{X:e,Y:r,Z:i}=this,{X:s,Y:a,Z:l}=t,u=n.ZERO,c=n.ZERO,h=n.ZERO,f=o.a,d=n.mul(o.b,nw),p=n.mul(e,s),g=n.mul(r,a),m=n.mul(i,l),y=n.add(e,r),w=n.add(s,a);y=n.mul(y,w),w=n.add(p,g),y=n.sub(y,w),w=n.add(e,i);let v=n.add(s,l);return w=n.mul(w,v),v=n.add(p,m),w=n.sub(w,v),v=n.add(r,i),u=n.add(a,l),v=n.mul(v,u),u=n.add(g,m),v=n.sub(v,u),h=n.mul(f,w),u=n.mul(d,m),h=n.add(u,h),u=n.sub(g,h),h=n.add(g,h),c=n.mul(u,h),g=n.add(p,p),g=n.add(g,p),m=n.mul(f,m),w=n.mul(d,w),g=n.add(g,m),m=n.sub(p,m),m=n.mul(f,m),w=n.add(w,m),p=n.mul(g,w),c=n.add(c,p),p=n.mul(v,w),u=n.mul(y,u),u=n.sub(u,p),p=n.mul(y,g),h=n.mul(v,h),new S(u,c,h=n.add(h,p))}subtract(t){return this.add(t.negate())}is0(){return this.equals(S.ZERO)}multiply(t){let r,n,{endo:o}=e;if(!i.isValidNot0(t))throw Error("invalid scalar: out of range");let s=t=>
1A.cached(this,t,t=>eP(S,t));if(o){let{k1neg:e,k1:i,k2neg:a,k2:l}=w(t),{p:u,f:c}=s(i),{p:h,f:f}=s(l);n=c.add(f),r=E(o.beta,u,h,e,a)}else{let{p:e,f:i}=s(t);r=e,n=i}return eP(S,[r,n])[0]}multiplyUnsafe(t){let{endo:r}=e;if(!i.isValid(t))throw Error("invalid scalar: out of range");if(t===nm||this.is0())return S.ZERO;if(t===ny)return this;if(A.hasCache(this))return this.multiply(t);if(!r)return A.unsafe(this,t);{let{k1neg:e,k1:n,k2neg:i,k2:o}=w(t),{p1:s,p2:a}=function(t,e,r,n){let i=e,o=t.ZERO,s=t.ZERO;for(;r>eL||n>eL;)r&eR&&(o=o.add(i)),n&eR&&(s=s.add(i)),i=i.double(),r>>=eR,n>>=eR;return{p1:o,p2:s}}(S,this,n,o);return E(r.beta,s,a,e,i)}}multiplyAndAddUnsafe(t,e,r){let n=this.multiplyUnsafe(e).add(t.multiplyUnsafe(r));return n.is0()?void 0:n}toAffine(t){return v(this,t)}isTorsionFree(){let{isTorsionFree:t}=e;return s===ny||(t?t(S,this):A.unsafe(this,a).is0())}clearCofactor(){let{clearCofactor:t}=e;return s===ny?this:t?t(S,this):this.multiplyUnsafe(s)}isSmallOrder(){return this.multiplyUnsafe(s).is0()}toBytes(t=!0){return tX(t,"isCompressed"),this.assertValidity(),h(S,this,t)}toHex(t=!0){return tc(this.toBytes(t))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(t=!0){return this.toBytes(t)}_setWindowSize(t){this.precompute(t)}static normalizeZ(t){return eP(S,t)}static msm(t,e){return eK(S,i,t,e)}static fromPrivateKey(t){return S.BASE.multiply(nx(i,t))}}S.BASE=new S(o.Gx,o.Gy,n.ONE),S.ZERO=new S(n.ZERO,n.ONE,n.ZERO),S.Fp=n,S.Fn=i;let k=i.BITS,A=new ej(S,e.endo?Math.ceil(k/2):k);return S.BASE.precompute(8),S}(r,n),i,o);return e=s.Point,Object.assign({},s,{ProjectivePoint:e,CURVE:Object.assign({},t,e_(e.Fn.ORDER,e.Fn.BITS))})})({...a,hash:t}))(tG),create:n});nM.Point;let nC=(i=[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(t=>t.map(t=>BigInt(t))).map(t=>Array.from(t).reverse()),(t,e)=>{let[r,n,o,s]=i.map(e=>e.reduce((e,r)=>n_.add(n_.mul(e,t),r))),[a,l]=eI(n_,[n,s],!0);return t=n_.mul(r,a),e=n_.mul(e,n_.mul(o,l)),{x:t,y:e}}),nT=function(t,e){eA(t);let{A:r,B:n,Z:i}=e;if(!t.isValid(r)||!t.isValid(n)||!t.isValid(i))throw Error("mapToCurveSimpleSWU: invalid opts");let o=function(t,e){let r=t.ORDER,n=nm;for(let t=r-ny;t%nb===nm;t/=nb)n+=ny;let i=n,o=nb<<i-ny-ny,s=o*nb,a=(r-ny)/s,l=(a-ny)/nb,u=s-ny,c=t.pow(e,a),h=t.pow(e,(a+ny)/nb),f=(e,r)=>{let n=c,s=t.pow(r,u),a=t.sqr(s);a=t.mul(a,r);let f=t.mul(e,a);f=t.pow(f,l),f=t.mul(f,s),s=t.mul(f,r),a=t.mul(f,e);let d=t.mul(a,s);f=t.pow(d,o);let p=t.eql(f,t.ONE);s=t.mul(a,h),f=t.mul(d,n),a=t.cmov(s,a,p),d=t.cmov(f,d,p);for(let e=i;e>ny;e--){let r=e-nb;r=nb<<r-ny;let i=t.pow(d,r),o=t.eql(i,t.ONE);s=t.mul(a,n),n=t.mul(n,n),i=t.mul(d,n),a=t.cmov(s,a,o),d=t.cmov(i,d,o)}return{isValid:p,value:a}};if(t.ORDER%nv===nw){let r=(t.ORDER-nw)/nv,n=t.sqrt(t.neg(e));f=(e,i)=>{let o=t.sqr(i),s=t.mul(e,i);o=t.mul(o,s);let a=t.pow(o,r);a=t.mul(a,s);let l=t.mul(a,n),u=t.mul(t.sqr(a),i),c=t.eql(u,e),h=t.cmov(l,a,c);return{isValid:c,value:h}}}return f}(t,i);if(!t.isOdd)throw Error("Field does not have .isOdd()");return e=>{let s,a,l,u,c,h,f,d;s=t.sqr(e),s=t.mul(s,i),a=t.sqr(s),a=t.add(a,s),l=t.add(a,t.ONE),l=t.mul(l,n),u=t.cmov(i,t.neg(a),!t.eql(a,t.ZERO)),u=t.mul(u,r),a=t.sqr(l),h=t.sqr(u),c=t.mul(h,r),a=t.add(a,c),a=t.mul(a,l),h=t.mul(h,u),c=t.mul(h,n),a=t.add(a,c),f=t.mul(s,l);let{isValid:p,value:g}=o(a,h);d=t.mul(s,e),d=t.mul(d,g),f=t.cmov(f,l,p),d=t.cmov(d,g,p);let m=t.isOdd(e)===t.isOdd(d);d=t.cmov(t.neg(d),d,m);let y=eI(t,[u],!0)[0];return{x:f=t.mul(f,y),y:d}}}(n_,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:n_.create(BigInt("-11"))});e6(nM.Point,t=>{let{x:e,y:r}
1=nT(n_.create(t[0]));return nC(e,r)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:n_.ORDER,m:1,k:128,expand:"xmd",hash:tG}),rs.utils.randomPrivateKey;let nL=()=>{let t=rs.utils.randomPrivateKey(),e=nR(t),r=new Uint8Array(64);return r.set(t),r.set(e,32),{publicKey:e,secretKey:r}},nR=rs.getPublicKey;function nO(t){try{return rs.ExtendedPoint.fromHex(t),!0}catch{return!1}}let nP=(t,e)=>rs.sign(t,e.slice(0,32)),nU=rs.verify,nN=t=>Y.Buffer.isBuffer(t)?t:t instanceof Uint8Array?Y.Buffer.from(t.buffer,t.byteOffset,t.byteLength):Y.Buffer.from(t);class nz{constructor(t){Object.assign(this,t)}encode(){return Y.Buffer.from((0,rx.serialize)(nq,this))}static decode(t){return(0,rx.deserialize)(nq,this,t)}static decodeUnchecked(t){return(0,rx.deserializeUnchecked)(nq,this,t)}}let nq=new Map,nD=1;class nW extends nz{constructor(t){if(super({}),this._bn=void 0,function(t){return void 0!==t._bn}(t))this._bn=t._bn;else{if("string"==typeof t){const e=rv.default.decode(t);if(32!=e.length)throw Error("Invalid public key input");this._bn=new rw.default(e)}else this._bn=new rw.default(t);if(this._bn.byteLength()>32)throw Error("Invalid public key input")}}static unique(){let t=new nW(nD);return nD+=1,new nW(t.toBuffer())}equals(t){return this._bn.eq(t._bn)}toBase58(){return rv.default.encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){let t=this.toBuffer();return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}toBuffer(){let t=this._bn.toArrayLike(Y.Buffer);if(32===t.length)return t;let e=Y.Buffer.alloc(32);return t.copy(e,32-t.length),e}get[Symbol.toStringTag](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(t,e,r){return new nW(tG(Y.Buffer.concat([t.toBuffer(),Y.Buffer.from(e),r.toBuffer()])))}static createProgramAddressSync(t,e){let r=Y.Buffer.alloc(0);t.forEach(function(t){if(t.length>32)throw TypeError("Max seed length exceeded");r=Y.Buffer.concat([r,nN(t)])});let n=tG(r=Y.Buffer.concat([r,e.toBuffer(),Y.Buffer.from("ProgramDerivedAddress")]));if(nO(n))throw Error("Invalid seeds, address must fall off the curve");return new nW(n)}static async createProgramAddress(t,e){return this.createProgramAddressSync(t,e)}static findProgramAddressSync(t,e){let r,n=255;for(;0!=n;){try{let i=t.concat(Y.Buffer.from([n]));r=this.createProgramAddressSync(i,e)}catch(t){if(t instanceof TypeError)throw t;n--;continue}return[r,n]}throw Error("Unable to find a viable program address nonce")}static async findProgramAddress(t,e){return this.findProgramAddressSync(t,e)}static isOnCurve(t){return nO(new nW(t).toBytes())}}nW.default=new nW("11111111111111111111111111111111"),nq.set(nW,{kind:"struct",fields:[["_bn","u256"]]}),new nW("BPFLoader1111111111111111111111111111111111");class nF extends Error{constructor(t){super(`Signature ${t} has expired: block height exceeded.`),this.signature=void 0,this.signature=t}}Object.defineProperty(nF.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});
vendor: 102,715 bytes, lines 1-7
1class nj extends Error{constructor(t,e){super(`Transaction was not confirmed in ${e.toFixed(2)} seconds. It is unknown if it succeeded or failed. Check signature ${t} using the Solana Explorer or CLI tools.`),this.signature=void 0,this.signature=t}}Object.defineProperty(nj.prototype,"name",{value:"TransactionExpiredTimeoutError"});class nK extends Error{constructor(t){super(`Signature ${t} has expired: the nonce is no longer valid.`),this.signature=void 0,this.signature=t}}Object.defineProperty(nK.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});class nH{constructor(t,e){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=t,this.accountKeysFromLookups=e}keySegments(){let t=[this.staticAccountKeys];return this.accountKeysFromLookups&&(t.push(this.accountKeysFromLookups.writable),t.push(this.accountKeysFromLookups.readonly)),t}get(t){for(let e of this.keySegments())if(t<e.length)return e[t];else t-=e.length}get length(){return this.keySegments().flat().length}compileInstructions(t){if(this.length>256)throw Error("Account index overflow encountered during compilation");let e=new Map;this.keySegments().flat().forEach((t,r)=>{e.set(t.toBase58(),r)});let r=t=>{let r=e.get(t.toBase58());if(void 0===r)throw Error("Encountered an unknown instruction account key during compilation");return r};return t.map(t=>({programIdIndex:r(t.programId),accountKeyIndexes:t.keys.map(t=>r(t.pubkey)),data:t.data}))}}let nV=(t="publicKey")=>rE.blob(32,t),n$=(t="string")=>{let e=rE.struct([rE.u32("length"),rE.u32("lengthPadding"),rE.blob(rE.offset(rE.u32(),-8),"chars")],t),r=e.decode.bind(e),n=e.encode.bind(e);return e.decode=(t,e)=>r(t,e).chars.toString(),e.encode=(t,e,r)=>n({chars:Y.Buffer.from(t,"utf8")},e,r),e.alloc=t=>rE.u32().span+rE.u32().span+Y.Buffer.from(t,"utf8").length,e};function nZ(t){let e=0,r=0;for(;;){let n=t.shift();if(e|=(127&n)<<7*r,r+=1,(128&n)==0)break}return e}function nG(t,e){let r=e;for(;;){let e=127&r;if(0==(r>>=7)){t.push(e);break}e|=128,t.push(e)}}function nY(t,e){if(!t)throw Error(e||"Assertion failed")}class nQ{constructor(t,e){this.payer=void 0,this.keyMetaMap=void 0,this.payer=t,this.keyMetaMap=e}static compile(t,e){let r=new Map,n=t=>{let e=t.toBase58(),n=r.get(e);return void 0===n&&(n={isSigner:!1,isWritable:!1,isInvoked:!1},r.set(e,n)),n},i=n(e);for(let e of(i.isSigner=!0,i.isWritable=!0,t))for(let t of(n(e.programId).isInvoked=!0,e.keys)){let e=n(t.pubkey);e.isSigner||=t.isSigner,e.isWritable||=t.isWritable}return new nQ(e,r)}getMessageComponents(){let t=[...this.keyMetaMap.entries()];nY(t.length<=256,"Max static account keys length exceeded");let e=t.filter(([,t])=>t.isSigner&&t.isWritable),r=t.filter(([,t])=>t.isSigner&&!t.isWritable),n=t.filter(([,t])=>!t.isSigner&&t.isWritable),i=t.filter(([,t])=>!t.isSigner&&!t.isWritable),o={numRequiredSignatures:e.length+r.length,numReadonlySignedAccounts:r.length,numReadonlyUnsignedAccounts:i.length};{nY(e.length>0,"Expected at least one writable signer key");let[t]=e[0];nY(t===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}return[o,[...e.map(([t])=>new nW(t)),...r.map(([t])=>new nW(t)),...n.map(([t])=>new nW(t)),...i.map(([t])=>new nW(t))]]}extractTableLookup(t){let[e,r]=this.drainKeysFoundInLookupTable(t.state.addresses,t=>!t.isSigner&&!t.isInvoked&&t.isWritable),[n,i]=this.drainKeysFoundInLookupTable(t.state.addresses,t=>!t.isSigner&&!t.isInvoked&&!t.isWritable);if(0!==e.length||0!==n.length)return[{accountKey:t.key,writableIndexes:e,readonlyIndexes:n},{writable:r,readonly:i}]}drainKeysFoundInLookupTable(t,e){let r=[],n=[];for(let[i,o]of this.keyMetaMap.entries())if(e(o)){let e=new nW(i),o=t.findIndex(t=>t.equals(e));o>=0&&(nY(o<256,"Max lookup table index exceeded"),r.push(o),n.push(e),this.keyMetaMap.delete(i))}return[r,n]}}let nJ="Reached end of buffer unexpectedly";function nX(t){if(0===t.length)throw Error(nJ);return t.shift()}function n0(t,...e){let[r]=e;if(2===e.length?r+(e[1]??0)>t.length:r>=t.length)throw Error(nJ);return t.splice(...e)}class n1{constructor(t){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=t.header,this.accountKeys=t.accountKeys.map(t=>new nW(t)),this.recentBlockhash=t.recentBlockhash,this.instructions=t.instructions,this.instructions.forEach(t=>this.indexToProgramIds.set(t.programIdIndex,this.accountKeys[t.programIdIndex]))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map(t=>({programIdIndex:t.programIdIndex,accountKeyIndexes:t.accounts,data:rv.default.decode(t.data)}))}get addressTableLookups(){return[]}getAccountKeys(){return new nH(this.staticAccountKeys)}static compile(t){let[e,r]=nQ.compile(t.instructions,t.payerKey).getMessageComponents(),n=new nH(r).compileInstructions(t.instructions).map(t=>({programIdIndex:t.programIdIndex,accounts:t.accountKeyIndexes,data:rv.default.encode(t.data)}));return new n1({header:e,accountKeys:r,recentBlockhash:t.recentBlockhash,instructions:n})}isAccountSigner(t){return t<this.header.numRequiredSignatures}isAccountWritable(t){let e=this.header.numRequiredSignatures;if(!(t>=this.header.numRequiredSignatures))return t<e-this.header.numReadonlySignedAccounts;{let r=this.accountKeys.length-e-this.header.numReadonlyUnsignedAccounts;return t-e<r}}isProgramId(t){return this.indexToProgramIds.has(t)}programIds(){return[...this.indexToProgramIds.values()]}nonProgramIds(){return this.accountKeys.filter((t,e)=>!this.isProgramId(e))}serialize(){let t=this.accountKeys.length,e=[];nG(e,t);let r=this.instructions.map(t=>{let{accounts:e,programIdIndex:r}=t,n=Array.from(rv.default.decode(t.data)),i=[];nG(i,e.length);let o=[];return nG(o,n.length),{programIdIndex:r,keyIndicesCount:Y.Buffer.from(i),keyIndices:e,dataLength:Y.Buffer.from(o),data:n}}),n=[];nG(n,r.length);let i=Y.Buffer.alloc(1232);Y.Buffer.from(n).copy(i);let o=n.length;r.forEach(t=>{let e=rE.struct([rE.u8("programIdIndex"),rE.blob(t.keyIndicesCount.length,"keyIndicesCount"),rE.seq(rE.u8("keyIndex"),t.keyIndices.length,"keyIndices"),rE.blob(t.dataLength.length,"dataLength"),rE.seq(rE.u8("userdatum"),t.data.length,"data")]).encode(t,i,o);o+=e}),i=i.slice(0,o);let s=rE.struct([rE.blob(1,"numRequiredSignatures"),rE.blob(1,"numReadonlySignedAccounts"),rE.blob(1,"numReadonlyUnsignedAccounts"),rE.blob(e.length,"keyCount"),rE.seq(nV("key"),t,"keys"),nV("recentBlockhash")]),a={numRequiredSignatures:Y.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:Y.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:Y.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:Y.Buffer.from(e),keys:this.accountKeys.map(t=>nN(t.toBytes())),recentBlockhash:rv.default.decode(this.recentBlockhash)},l=Y.Buffer.alloc(2048),u=s.encode(a,l);return i.copy(l,u),l.slice(0,u+i.length)}static from(t){let e=[...t],r=nX(e);if(r!==(127&r))throw Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");let n=nX(e),i=nX(e),o=nZ(e),s=[];for(let t=0;t<o;t++){let t=n0(e,0,32);s.push(new nW(Y.Buffer.from(t)))}let a=n0(e,0,32),l=nZ(e),u=[];for(let t=0;t<l;t++){let t=nX(e),r=nZ(e),n=n0(e,0,r),i=nZ(e),o=n0(e,0,i),s=rv.default.encode(Y.Buffer.from(o));u.push({programIdIndex:t,accounts:n,data:s})}return new n1({header:{numRequiredSignatures:r,numReadonlySignedAccounts:n,numReadonlyUnsignedAccounts:i},recentBlockhash:rv.default.encode(Y.Buffer.from(a)),accountKeys:s,instructions:u})}}class n2{constructor(t){this.header=void 0,this.staticAccountKeys=void 0,this.recentBlockhash=void 0,this.compiledInstructions=void 0,this.addressTableLookups=void 0,this.header=t.header,this.staticAccountKeys=t.staticAccountKeys,this.recentBlockhash=t.recentBlockhash,this.compiledInstructions=t.compiledInstructions,this.addressTableLookups=t.addressTableLookups}get version(){return 0}get numAccountKeysFromLookups(){let t=0;for(let e of this.addressTableLookups)t+=e.readonlyIndexes.length+e.writableIndexes.length;return t}getAccountKeys(t){let e;if(t&&"accountKeysFromLookups"in t&&t.accountKeysFromLookups){if(this.numAccountKeysFromLookups!=t.accountKeysFromLookups.writable.length+t.accountKeysFromLookups.readonly.length)throw Error("Failed to get account keys because of a mismatch in the number of account keys from lookups");e=t.accountKeysFromLookups}else if(t&&"addressLookupTableAccounts"in t&&t.addressLookupTableAccounts)e=this.resolveAddressTableLookups(t.addressLookupTableAccounts);else if(this.addressTableLookups.length>0)throw Error("Failed to get account keys because address table lookups were not resolved");return new nH(this.staticAccountKeys,e)}isAccountSigner(t){return t<this.header.numRequiredSignatures}isAccountWritable(t){let e=this.header.numRequiredSignatures,r=this.staticAccountKeys.length;if(t>=r)return t-r<this.addressTableLookups.reduce((t,e)=>t+e.writableIndexes.length,0);if(!(t>=this.header.numRequiredSignatures))return t<e-this.header.numReadonlySignedAccounts;{let n=r-e-this.header.numReadonlyUnsignedAccounts;return t-e<n}}resolveAddressTableLookups(t){let e={writable:[],readonly:[]};for(let r of this.addressTableLookups){let n=t.find(t=>t.key.equals(r.accountKey));if(!n)throw Error(`Failed to find address lookup table account for table key ${r.accountKey.toBase58()}`);for(let t of r.writableIndexes)if(t<n.state.addresses.length)e.writable.push(n.state.addresses[t]);else throw Error(`Failed to find address for index ${t} in address lookup table ${r.accountKey.toBase58()}`);for(let t of r.readonlyIndexes)if(t<n.state.addresses.length)e.readonly.push(n.state.addresses[t]);else throw Error(`Failed to find address for index ${t} in address lookup table ${r.accountKey.toBase58()}`)}return e}static compile(t){let e=nQ.compile(t.instructions,t.payerKey),r=[],n={writable:[],readonly:[]};for(let i of t.addressLookupTableAccounts||[]){let t=e.extractTableLookup(i);if(void 0!==t){let[e,{writable:i,readonly:o}]=t;r.push(e),n.writable.push(...i),n.readonly.push(...o)}}let[i,o]=e.getMessageComponents(),s=new nH(o,n).compileInstructions(t.instructions);return new n2({header:i,staticAccountKeys:o,recentBlockhash:t.recentBlockhash,compiledInstructions:s,addressTableLookups:r})}serialize(){let t=[];nG(t,this.staticAccountKeys.length);let e=this.serializeInstructions(),r=[];nG(r,this.compiledInstructions.length);let n=this.serializeAddressTableLookups(),i=[];nG(i,this.addressTableLookups.length);let o=rE.struct([rE.u8("prefix"),rE.struct([rE.u8("numRequiredSignatures"),rE.u8("numReadonlySignedAccounts"),rE.u8("numReadonlyUnsignedAccounts")],"header"),rE.blob(t.length,"staticAccountKeysLength"),rE.seq(nV(),this.staticAccountKeys.length,"staticAccountKeys"),nV("recentBlockhash"),rE.blob(r.length,"instructionsLength"),rE.blob(e.length,"serializedInstructions"),rE.blob(i.length,"addressTableLookupsLength"),rE.blob(n.length,"serializedAddressTableLookups")]),s=new Uint8Array(1232),a=o.encode({prefix:128,header:this.header,staticAccountKeysLength:new Uint8Array(t),staticAccountKeys:this.staticAccountKeys.map(t=>t.toBytes()),recentBlockhash:rv.default.decode(this.recentBlockhash),instructionsLength:new Uint8Array(r),serializedInstructions:e,addressTableLookupsLength:new Uint8Array(i),serializedAddressTableLookups:n},s);return s.slice(0,a)}serializeInstructions(){let t=0,e=new Uint8Array(1232);for(let r of this.compiledInstructions){let n=[];nG(n,r.accountKeyIndexes.length);let i=[];nG(i,r.data.length);let o=rE.struct([rE.u8("programIdIndex"),rE.blob(n.length,"encodedAccountKeyIndexesLength"),rE.seq(rE.u8(),r.accountKeyIndexes.length,"accountKeyIndexes"),rE.blob(i.length,"encodedDataLength"),rE.blob(r.data.length,"data")]);t+=o.encode({programIdIndex:r.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(n),accountKeyIndexes:r.accountKeyIndexes,encodedDataLength:new Uint8Array(i),data:r.data},e,t)}return e.slice(0,t)}serializeAddressTableLookups(){let t=0,e=new Uint8Array(1232);for(let r of this.addressTableLookups){let n=[];nG(n,r.writableIndexes.length);let i=[];nG(i,r.readonlyIndexes.length);let o=rE.struct([nV("accountKey"),rE.blob(n.length,"encodedWritableIndexesLength"),rE.seq(rE.u8(),r.writableIndexes.length,"writableIndexes"),rE.blob(i.length,"encodedReadonlyIndexesLength"),rE.seq(rE.u8(),r.readonlyIndexes.length,"readonlyIndexes")]);t+=o.encode({accountKey:r.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(n),writableIndexes:r.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(i),readonlyIndexes:r.readonlyIndexes},e,t)}return e.slice(0,t)}static deserialize(t){let e=[...t],r=nX(e),n=127&r;nY(r!==n,"Expected versioned message but received legacy message"),nY(0===n,`Expected versioned message with version 0 but found version ${n}`);let i={numRequiredSignatures:nX(e),numReadonlySignedAccounts:nX(e),numReadonlyUnsignedAccounts:nX(e)},o=[],s=nZ(e);for(let t=0;t<s;t++)o.push(new nW(n0(e,0,32)));let a=rv.default.encode(n0(e,0,32)),l=nZ(e),u=[];for(let t=0;t<l;t++){let t=nX(e),r=nZ(e),n=n0(e,0,r),i=nZ(e),o=new Uint8Array(n0(e,0,i));u.push({programIdIndex:t,accountKeyIndexes:n,data:o})}let c=nZ(e),h=[];for(let t=0;t<c;t++){let t=new nW(n0(e,0,32)),r=nZ(e),n=n0(e,0,r),i=nZ(e),o=n0(e,0,i);h.push({accountKey:t,writableIndexes:n,readonlyIndexes:o})}return new n2({header:i,staticAccountKeys:o,recentBlockhash:a,compiledInstructions:u,addressTableLookups:h})}}let n6={deserializeMessageVersion(t){let e=t[0],r=127&e;return r===e?"legacy":r},deserialize:t=>{let e=n6.deserializeMessageVersion(t);if("legacy"===e)return n1.from(t);if(0===e)return n2.deserialize(t);throw Error(`Transaction message version ${e} deserialization is not supported`)}},n5=((l={})[l.BLOCKHEIGHT_EXCEEDED=0]="BLOCKHEIGHT_EXCEEDED",l[l.PROCESSED=1]="PROCESSED",l[l.TIMED_OUT=2]="TIMED_OUT",l[l.NONCE_INVALID=3]="NONCE_INVALID",l),n3=Y.Buffer.alloc(64).fill(0);class n8{constructor(t){this.keys=void 0,this.programId=void 0,this.data=Y.Buffer.alloc(0),this.programId=t.programId,this.keys=t.keys,t.data&&(this.data=t.data)}toJSON(){return{keys:this.keys.map(({pubkey:t,isSigner:e,isWritable:r})=>({pubkey:t.toJSON(),isSigner:e,isWritable:r})),programId:this.programId.toJSON(),data:[...this.data]}}}class n4{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(t){if(this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this.minNonceContextSlot=void 0,this._message=void 0,this._json=void 0,!t)return;if(t.feePayer&&(this.feePayer=t.feePayer),t.signatures&&(this.signatures=t.signatures),Object.prototype.hasOwnProperty.call(t,"nonceInfo")){const{minContextSlot:e,nonceInfo:r}=t;this.minNonceContextSlot=e,this.nonceInfo=r}else if(Object.prototype.hasOwnProperty.call(t,"lastValidBlockHeight")){const{blockhash:e,lastValidBlockHeight:r}=t;this.recentBlockhash=e,this.lastValidBlockHeight=r}else{const{recentBlockhash:e,nonceInfo:r}=t;r&&(this.nonceInfo=r),this.recentBlockhash=e}}toJSON(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstruction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map(t=>t.toJSON()),signers:this.signatures.map(({publicKey:t})=>t.toJSON())}}add(...t){if(0===t.length)throw Error("No instructions");return t.forEach(t=>{"instructions"in t?this.instructions=this.instructions.concat(t.instructions):"data"in t&&"programId"in t&&"keys"in t?this.instructions.push(t):this.instructions.push(new n8(t))}),this}compileMessage(){let t,e,r;if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;if(this.nonceInfo?(t=this.nonceInfo.nonce,e=this.instructions[0]!=this.nonceInfo.nonceInstruction?[this.nonceInfo.nonceInstruction,...this.instructions]:this.instructions):(t=this.recentBlockhash,e=this.instructions),!t)throw Error("Transaction recentBlockhash required");if(e.length<1&&console.warn("No instructions provided"),this.feePayer)r=this.feePayer;else if(this.signatures.length>0&&this.signatures[0].publicKey)r=this.signatures[0].publicKey;else throw Error("Transaction fee payer required");for(let t=0;t<e.length;t++)if(void 0===e[t].programId)throw Error(`Transaction instruction index ${t} has undefined program id`);let n=[],i=[];e.forEach(t=>{t.keys.forEach(t=>{i.push({...t})});let e=t.programId.toString();n.includes(e)||n.push(e)}),n.forEach(t=>{i.push({pubkey:new nW(t),isSigner:!1,isWritable:!1})});let o=[];i.forEach(t=>{let e=t.pubkey.toString(),r=o.findIndex(t=>t.pubkey.toString()===e);r>-1?(o[r].isWritable=o[r].isWritable||t.isWritable,o[r].isSigner=o[r].isSigner||t.isSigner):o.push(t)}),o.sort(function(t,e){return t.isSigner!==e.isSigner?t.isSigner?-1:1:t.isWritable!==e.isWritable?t.isWritable?-1:1:t.pubkey.toBase58().localeCompare(e.pubkey.toBase58(),"en",{localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"})});let s=o.findIndex(t=>t.pubkey.equals(r));if(s>-1){let[t]=o.splice(s,1);t.isSigner=!0,t.isWritable=!0,o.unshift(t)}else o.unshift({pubkey:r,isSigner:!0,isWritable:!0});for(let t of this.signatures){let e=o.findIndex(e=>e.pubkey.equals(t.publicKey));if(e>-1)o[e].isSigner||(o[e].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 Error(`unknown signer: ${t.publicKey.toString()}`)}let a=0,l=0,u=0,c=[],h=[];o.forEach(({pubkey:t,isSigner:e,isWritable:r})=>{e?(c.push(t.toString()),a+=1,r||(l+=1)):(h.push(t.toString()),r||(u+=1))});let f=c.concat(h),d=e.map(t=>{let{data:e,programId:r}=t;return{programIdIndex:f.indexOf(r.toString()),accounts:t.keys.map(t=>f.indexOf(t.pubkey.toString())),data:rv.default.encode(e)}});return d.forEach(t=>{nY(t.programIdIndex>=0),t.accounts.forEach(t=>nY(t>=0))}),new n1({header:{numRequiredSignatures:a,numReadonlySignedAccounts:l,numReadonlyUnsignedAccounts:u},accountKeys:f,recentBlockhash:t,instructions:d})}_compile(){let t=this.compileMessage(),e=t.accountKeys.slice(0,t.header.numRequiredSignatures);return this.signatures.length===e.length&&this.signatures.every((t,r)=>e[r].equals(t.publicKey))?t:(this.signatures=e.map(t=>({signature:null,publicKey:t})),t)}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(t){return(await t.getFeeForMessage(this.compileMessage())).value}setSigners(...t){if(0===t.length)throw Error("No signers");let e=new Set;this.signatures=t.filter(t=>{let r=t.toString();return!e.has(r)&&(e.add(r),!0)}).map(t=>({signature:null,publicKey:t}))}sign(...t){if(0===t.length)throw Error("No signers");let e=new Set,r=[];for(let n of t){let t=n.publicKey.toString();e.has(t)||(e.add(t),r.push(n))}this.signatures=r.map(t=>({signature:null,publicKey:t.publicKey}));let n=this._compile();this._partialSign(n,...r)}partialSign(...t){if(0===t.length)throw Error("No signers");let e=new Set,r=[];for(let n of t){let t=n.publicKey.toString();e.has(t)||(e.add(t),r.push(n))}let n=this._compile();this._partialSign(n,...r)}_partialSign(t,...e){let r=t.serialize();e.forEach(t=>{let e=nP(r,t.secretKey);this._addSignature(t.publicKey,nN(e))})}addSignature(t,e){this._compile(),this._addSignature(t,e)}_addSignature(t,e){nY(64===e.length);let r=this.signatures.findIndex(e=>t.equals(e.publicKey));if(r<0)throw Error(`unknown signer: ${t.toString()}`);this.signatures[r].signature=Y.Buffer.from(e)}verifySignatures(t=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),t)}_getMessageSignednessErrors(t,e){let r={};for(let{signature:n,publicKey:i}of this.signatures)null===n?e&&(r.missing||=[]).push(i):nU(n,t,i.toBytes())||(r.invalid||=[]).push(i);return r.invalid||r.missing?r:void 0}serialize(t){let{requireAllSignatures:e,verifySignatures:r}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},t),n=this.serializeMessage();if(r){let t=this._getMessageSignednessErrors(n,e);if(t){let e="Signature verification failed.";throw t.invalid&&(e+=`
2Invalid signature for public key${1===t.invalid.length?"":"(s)"} [\`${t.invalid.map(t=>t.toBase58()).join("`, `")}\`].`),t.missing&&(e+=`
3Missing signature for public key${1===t.missing.length?"":"(s)"} [\`${t.missing.map(t=>t.toBase58()).join("`, `")}\`].`),Error(e)}}return this._serialize(n)}_serialize(t){let{signatures:e}=this,r=[];nG(r,e.length);let n=r.length+64*e.length+t.length,i=Y.Buffer.alloc(n);return nY(e.length<256),Y.Buffer.from(r).copy(i,0),e.forEach(({signature:t},e)=>{null!==t&&(nY(64===t.length,"signature has invalid length"),Y.Buffer.from(t).copy(i,r.length+64*e))}),t.copy(i,r.length+64*e.length),nY(i.length<=1232,`Transaction too large: ${i.length} > 1232`),i}get keys(){return nY(1===this.instructions.length),this.instructions[0].keys.map(t=>t.pubkey)}get programId(){return nY(1===this.instructions.length),this.instructions[0].programId}get data(){return nY(1===this.instructions.length),this.instructions[0].data}static from(t){let e=[...t],r=nZ(e),n=[];for(let t=0;t<r;t++){let t=n0(e,0,64);n.push(rv.default.encode(Y.Buffer.from(t)))}return n4.populate(n1.from(e),n)}static populate(t,e=[]){let r=new n4;return r.recentBlockhash=t.recentBlockhash,t.header.numRequiredSignatures>0&&(r.feePayer=t.accountKeys[0]),e.forEach((e,n)=>{let i={signature:e==rv.default.encode(n3)?null:rv.default.decode(e),publicKey:t.accountKeys[n]};r.signatures.push(i)}),t.instructions.forEach(e=>{let n=e.accounts.map(e=>{let n=t.accountKeys[e];return{pubkey:n,isSigner:r.signatures.some(t=>t.publicKey.toString()===n.toString())||t.isAccountSigner(e),isWritable:t.isAccountWritable(e)}});r.instructions.push(new n8({keys:n,programId:t.accountKeys[e.programIdIndex],data:rv.default.decode(e.data)}))}),r._message=t,r._json=r.toJSON(),r}}class n7{get version(){return this.message.version}constructor(t,e){if(this.signatures=void 0,this.message=void 0,void 0!==e)nY(e.length===t.header.numRequiredSignatures,"Expected signatures length to be equal to the number of required signatures"),this.signatures=e;else{const e=[];for(let r=0;r<t.header.numRequiredSignatures;r++)e.push(new Uint8Array(64));this.signatures=e}this.message=t}serialize(){let t=this.message.serialize(),e=[];nG(e,this.signatures.length);let r=rE.struct([rE.blob(e.length,"encodedSignaturesLength"),rE.seq(((t="signature")=>rE.blob(64,t))(),this.signatures.length,"signatures"),rE.blob(t.length,"serializedMessage")]),n=new Uint8Array(2048),i=r.encode({encodedSignaturesLength:new Uint8Array(e),signatures:this.signatures,serializedMessage:t},n);return n.slice(0,i)}static deserialize(t){let e=[...t],r=[],n=nZ(e);for(let t=0;t<n;t++)r.push(new Uint8Array(n0(e,0,64)));return new n7(n6.deserialize(new Uint8Array(e)),r)}sign(t){let e=this.message.serialize(),r=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures);for(let n of t){let t=r.findIndex(t=>t.equals(n.publicKey));nY(t>=0,`Cannot sign with non signer key ${n.publicKey.toBase58()}`),this.signatures[t]=nP(e,n.secretKey)}}addSignature(t,e){nY(64===e.byteLength,"Signature must be 64 bytes long");let r=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex(e=>e.equals(t));nY(r>=0,`Can not add signature; \`${t.toBase58()}\` is not required to sign this transaction`),this.signatures[r]=e}}let n9=new nW("SysvarC1ock11111111111111111111111111111111");new nW("SysvarEpochSchedu1e111111111111111111111111"),new nW("Sysvar1nstructions1111111111111111111111111");let it=new nW("SysvarRecentB1ockHashes11111111111111111111"),ie=new nW("SysvarRent111111111111111111111111111111111");new nW("SysvarRewards111111111111111111111111111111"),new nW("SysvarS1otHashes111111111111111111111111111"),new nW("SysvarS1otHistory11111111111111111111111111");let ir=new nW("SysvarStakeHistory1111111111111111111111111");class ii extends Error{constructor({action:t,signature:e,transactionMessage:r,logs:n}){let i;const o=n?`Logs: 
4${JSON.stringify(n.slice(-10),null,2)}. `:"",s="\nCatch the `SendTransactionError` and call `getLogs()` on it for full details.";switch(t){case"send":i=`Transaction ${e} resulted in an error. 
5${r}. `+o+s;break;case"simulate":i=`Simulation failed. 
6Message: ${r}. 
7`+o+s;break;default:i=`Unknown action '${(t=>t)(t)}'`}super(i),this.signature=void 0,this.transactionMessage=void 0,this.transactionLogs=void 0,this.signature=e,this.transactionMessage=r,this.transactionLogs=n||void 0}get transactionError(){return{message:this.transactionMessage,logs:Array.isArray(this.transactionLogs)?this.transactionLogs:void 0}}get logs(){let t=this.transactionLogs;if(null==t||"object"!=typeof t||!("then"in t))return t}async getLogs(t){return Array.isArray(this.transactionLogs)||(this.transactionLogs=new Promise((e,r)=>{t.getTransaction(this.signature).then(t=>{if(t&&t.meta&&t.meta.logMessages){let r=t.meta.logMessages;this.transactionLogs=r,e(r)}else r(Error("Log messages not found"))}).catch(r)})),await this.transactionLogs}}class io extends Error{constructor({code:t,message:e,data:r},n){super(null!=n?`${n}: ${e}`:e),this.code=void 0,this.data=void 0,this.code=t,this.data=r,this.name="SolanaJSONRPCError"}}async function is(t,e,r,n){let i,o=n&&{skipPreflight:n.skipPreflight,preflightCommitment:n.preflightCommitment||n.commitment,maxRetries:n.maxRetries,minContextSlot:n.minContextSlot},s=await t.sendTransaction(e,r,o);if(null!=e.recentBlockhash&&null!=e.lastValidBlockHeight)i=(await t.confirmTransaction({abortSignal:n?.abortSignal,signature:s,blockhash:e.recentBlockhash,lastValidBlockHeight:e.lastValidBlockHeight},n&&n.commitment)).value;else if(null!=e.minNonceContextSlot&&null!=e.nonceInfo){let{nonceInstruction:r}=e.nonceInfo,o=r.keys[0].pubkey;i=(await t.confirmTransaction({abortSignal:n?.abortSignal,minContextSlot:e.minNonceContextSlot,nonceAccountPubkey:o,nonceValue:e.nonceInfo.nonce,signature:s},n&&n.commitment)).value}else n?.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."),i=(await t.confirmTransaction(s,n&&n.commitment)).value;if(i.err){if(null!=s)throw new ii({action:"send",signature:s,transactionMessage:`Status: (${JSON.stringify(i)})`});throw Error(`Transaction ${s} failed (${JSON.stringify(i)})`)}return s}function ia(t){return new Promise(e=>setTimeout(e,t))}function il(t,e){let r=t.layout.span>=0?t.layout.span:function t(e,r){let n=e=>{if(e.span>=0)return e.span;if("function"==typeof e.alloc)return e.alloc(r[e.property]);if("count"in e&&"elementLayout"in e){let t=r[e.property];if(Array.isArray(t))return t.length*n(e.elementLayout)}else if("fields"in e)return t({layout:e},r[e.property]);return 0},i=0;return e.layout.fields.forEach(t=>{i+=n(t)}),i}(t,e),n=Y.Buffer.alloc(r),i=Object.assign({instruction:t.index},e);return t.layout.encode(i,n),n}let iu=rE.nu64("lamportsPerSignature"),ic=rE.struct([rE.u32("version"),rE.u32("state"),nV("authorizedPubkey"),nV("nonce"),rE.struct([iu],"feeCalculator")]),ih=ic.span;class id{constructor(t){this.authorizedPubkey=void 0,this.nonce=void 0,this.feeCalculator=void 0,this.authorizedPubkey=t.authorizedPubkey,this.nonce=t.nonce,this.feeCalculator=t.feeCalculator}static fromAccountData(t){let e=ic.decode(nN(t),0);return new id({authorizedPubkey:new nW(e.authorizedPubkey),nonce:new nW(e.nonce).toString(),feeCalculator:e.feeCalculator})}}function ip(t){let e=(0,rE.blob)(8,t),r=e.decode.bind(e),n=e.encode.bind(e),i=((t={})=>(function(t,e){if(rA(t)!==rA(e))throw new rk(8078004);if(rA(t)&&rA(e)&&t.fixedSize!==e.fixedSize)throw new rk(8078005,{decoderFixedSize:e.fixedSize,encoderFixedSize:t.fixedSize});if(!rA(t)&&!rA(e)&&t.maxSize!==e.maxSize)throw new rk(8078006,{decoderMaxSize:e.maxSize,encoderMaxSize:t.maxSize});return{...e,...t,decode:e.decode,encode:t.encode,read:e.read,write:t.write}})(((t={})=>{var e,r;return Object.freeze({...r={fixedSize:(e={config:t,name:"u64",range:[0n,BigInt("0xffffffffffffffff")],set:(t,e,r)=>t.setBigUint64(0,BigInt(e),r),size:8}).size,write(t,r,n){e.range&&function(t,e,r,n){if(n<e||n>r)throw new rk(8078011,{codecDescription:t,max:r,min:e,value:n})}(e.name,e.range[0],e.range[1],t);let i=new ArrayBuffer(e.size);return e.set(new DataView(i),t,rB(e.config)),r.set(new Uint8Array(i),n),n+e.size}},encode:t=>{let e=new Uint8Array("fixedSize"in r?r.fixedSize:r.getSizeFromValue(t));return r.write(t,e,0),e}})})(t),((t={})=>{var e,r;return Object.freeze({...r={fixedSize:(e={config:t,get:(t,e)=>t.getBigUint64(0,e),name:"u64",size:8}).size,read(t,r=0){var n,i,o;let s,a;!function(t,e,r=0){if(e.length-r<=0)throw new rk(8078e3,{codecDescription:t})}(e.name,t,r),function(t,e,r,n=0){let i=r.length-n;if(i<e)throw new rk(8078001,{bytesLength:i,codecDescription:t,expected:e})}(e.name,e.size,t,r);let l=new DataView((n=t,i=r,o=e.size,s=n.byteOffset+(i??0),a=o??n.byteLength,n.buffer.slice(s,s+a)));return[e.get(l,rB(e.config)),r+e.size]}},decode:(t,e=0)=>r.read(t,e)[0]})})(t)))();return e.decode=(t,e)=>{let n=r(t,e);return i.decode(n)},e.encode=(t,e,r)=>n(i.encode(t),e,r),e}let ig=Object.freeze({Create:{index:0,layout:rE.struct([rE.u32("instruction"),rE.ns64("lamports"),rE.ns64("space"),nV("programId")])},Assign:{index:1,layout:rE.struct([rE.u32("instruction"),nV("programId")])},Transfer:{index:2,layout:rE.struct([rE.u32("instruction"),ip("lamports")])},CreateWithSeed:{index:3,layout:rE.struct([rE.u32("instruction"),nV("base"),n$("seed"),rE.ns64("lamports"),rE.ns64("space"),nV("programId")])},AdvanceNonceAccount:{index:4,layout:rE.struct([rE.u32("instruction")])},WithdrawNonceAccount:{index:5,layout:rE.struct([rE.u32("instruction"),rE.ns64("lamports")])},InitializeNonceAccount:{index:6,layout:rE.struct([rE.u32("instruction"),nV("authorized")])},AuthorizeNonceAccount:{index:7,layout:rE.struct([rE.u32("instruction"),nV("authorized")])},Allocate:{index:8,layout:rE.struct([rE.u32("instruction"),rE.ns64("space")])},AllocateWithSeed:{index:9,layout:rE.struct([rE.u32("instruction"),nV("base"),n$("seed"),rE.ns64("space"),nV("programId")])},AssignWithSeed:{index:10,layout:rE.struct([rE.u32("instruction"),nV("base"),n$("seed"),nV("programId")])},TransferWithSeed:{index:11,layout:rE.struct([rE.u32("instruction"),ip("lamports"),n$("seed"),nV("programId")])},UpgradeNonceAccount:{index:12,layout:rE.struct([rE.u32("instruction")])}});class im{static createAccount(t){let e=il(ig.Create,{lamports:t.lamports,space:t.space,programId:nN(t.programId.toBuffer())});return new n8({keys:[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:e})}static transfer(t){let e,r;return"basePubkey"in t?(e=il(ig.TransferWithSeed,{lamports:BigInt(t.lamports),seed:t.seed,programId:nN(t.programId.toBuffer())}),r=[{pubkey:t.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0}]):(e=il(ig.Transfer,{lamports:BigInt(t.lamports)}),r=[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0}]),new n8({keys:r,programId:this.programId,data:e})}static assign(t){let e,r;return"basePubkey"in t?(e=il(ig.AssignWithSeed,{base:nN(t.basePubkey.toBuffer()),seed:t.seed,programId:nN(t.programId.toBuffer())}),r=[{pubkey:t.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1}]):(e=il(ig.Assign,{programId:nN(t.programId.toBuffer())}),r=[{pubkey:t.accountPubkey,isSigner:!0,isWritable:!0}]),new n8({keys:r,programId:this.programId,data:e})}static createAccountWithSeed(t){let e=il(ig.CreateWithSeed,{base:nN(t.basePubkey.toBuffer()),seed:t.seed,lamports:t.lamports,space:t.space,programId:nN(t.programId.toBuffer())}),r=[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.newAccountPubkey,isSigner:!1,isWritable:!0}];return t.basePubkey.equals(t.fromPubkey)||r.push({pubkey:t.basePubkey,isSigner:!0,isWritable:!1}),new n8({keys:r,programId:this.programId,data:e})}static createNonceAccount(t){let e=new n4;"basePubkey"in t&&"seed"in t?e.add(im.createAccountWithSeed({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,basePubkey:t.basePubkey,seed:t.seed,lamports:t.lamports,space:ih,programId:this.programId})):e.add(im.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,lamports:t.lamports,space:ih,programId:this.programId}));let r={noncePubkey:t.noncePubkey,authorizedPubkey:t.authorizedPubkey};return e.add(this.nonceInitialize(r)),e}static nonceInitialize(t){let e=il(ig.InitializeNonceAccount,{authorized:nN(t.authorizedPubkey.toBuffer())});return new n8({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:it,isSigner:!1,isWritable:!1},{pubkey:ie,isSigner:!1,isWritable:!1}],programId:this.programId,data:e})}static nonceAdvance(t){let e=il(ig.AdvanceNonceAccount);return new n8({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:it,isSigner:!1,isWritable:!1},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:e})}static nonceWithdraw(t){let e=il(ig.WithdrawNonceAccount,{lamports:t.lamports});return new n8({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0},{pubkey:it,isSigner:!1,isWritable:!1},{pubkey:ie,isSigner:!1,isWritable:!1},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:e})}static nonceAuthorize(t){let e=il(ig.AuthorizeNonceAccount,{authorized:nN(t.newAuthorizedPubkey.toBuffer())});return new n8({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:e})}static allocate(t){let e,r;return"basePubkey"in t?(e=il(ig.AllocateWithSeed,{base:nN(t.basePubkey.toBuffer()),seed:t.seed,space:t.space,programId:nN(t.programId.toBuffer())}),r=[{pubkey:t.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1}]):(e=il(ig.Allocate,{space:t.space}),r=[{pubkey:t.accountPubkey,isSigner:!0,isWritable:!0}]),new n8({keys:r,programId:this.programId,data:e})}}im.programId=new nW("11111111111111111111111111111111");class iy{static getMinNumSignatures(t){return 2*(Math.ceil(t/iy.chunkSize)+1+1)}static async load(t,e,r,n,i){{let o=await t.getMinimumBalanceForRentExemption(i.length),s=await t.getAccountInfo(r.publicKey,"confirmed"),a=null;if(null!==s){if(s.executable)return console.error("Program load failed, account is already executable"),!1;s.data.length!==i.length&&(a=a||new n4).add(im.allocate({accountPubkey:r.publicKey,space:i.length})),s.owner.equals(n)||(a=a||new n4).add(im.assign({accountPubkey:r.publicKey,programId:n})),s.lamports<o&&(a=a||new n4).add(im.transfer({fromPubkey:e.publicKey,toPubkey:r.publicKey,lamports:o-s.lamports}))}else a=new n4().add(im.createAccount({fromPubkey:e.publicKey,newAccountPubkey:r.publicKey,lamports:o>0?o:1,space:i.length,programId:n}));null!==a&&await is(t,a,[e,r],{commitment:"confirmed"})}let o=rE.struct([rE.u32("instruction"),rE.u32("offset"),rE.u32("bytesLength"),rE.u32("bytesLengthPadding"),rE.seq(rE.u8("byte"),rE.offset(rE.u32(),-8),"bytes")]),s=iy.chunkSize,a=0,l=i,u=[];for(;l.length>0;){let i=l.slice(0,s),c=Y.Buffer.alloc(s+16);o.encode({instruction:0,offset:a,bytes:i,bytesLength:0,bytesLengthPadding:0},c);let h=new n4().add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0}],programId:n,data:c});u.push(is(t,h,[e,r],{commitment:"confirmed"})),t._rpcEndpoint.includes("solana.com")&&await ia(250),a+=s,l=l.slice(s)}await Promise.all(u);{let i=rE.struct([rE.u32("instruction")]),o=Y.Buffer.alloc(i.span);i.encode({instruction:1},o);let s=new n4().add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0},{pubkey:ie,isSigner:!1,isWritable:!1}],programId:n,data:o}),a="processed",l=await t.sendTransaction(s,[e,r],{preflightCommitment:a}),{context:u,value:c}=await t.confirmTransaction({signature:l,lastValidBlockHeight:s.lastValidBlockHeight,blockhash:s.recentBlockhash},a);if(c.err)throw Error(`Transaction ${l} failed (${JSON.stringify(c)})`);for(;;){try{if(await t.getSlot({commitment:a})>u.slot)break}catch{}await new Promise(t=>setTimeout(t,Math.round(200)))}}return!0}}iy.chunkSize=932,new nW("BPFLoader2111111111111111111111111111111111");var ib=(u=function(){if(d)return f;d=1;var t=Object.prototype.toString,e=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};return f=function(r){var n=function r(n,i){var o,s,a,l,u,c,h;if(!0===n)return"true";if(!1===n)return"false";switch(typeof n){case"object":if(null===n)return null;if(n.toJSON&&"function"==typeof n.toJSON)return r(n.toJSON(),i);if("[object Array]"===(h=t.call(n))){for(o=0,a="[",s=n.length-1;o<s;o++)a+=r(n[o],!0)+",";return s>-1&&(a+=r(n[o],!0)),a+"]"}if("[object Object]"!==h)return JSON.stringify(n);for(s=(l=e(n).sort()).length,a="",o=0;o<s;)void 0!==(c=r(n[u=l[o]],!1))&&(a&&(a+=","),a+=JSON.stringify(u)+":"+c),o++;return"{"+a+"}";case"function":case"undefined":return i?null:void 0;case"string":return JSON.stringify(n);default:return isFinite(n)?n:null}}(r,!1);if(void 0!==n)return""+n}}())&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u;function iw(t){let e=0;for(;t>1;)t/=2,e++;return e}class iv{constructor(t,e,r,n,i){this.slotsPerEpoch=void 0,this.leaderScheduleSlotOffset=void 0,this.warmup=void 0,this.firstNormalEpoch=void 0,this.firstNormalSlot=void 0,this.slotsPerEpoch=t,this.leaderScheduleSlotOffset=e,this.warmup=r,this.firstNormalEpoch=n,this.firstNormalSlot=i}getEpoch(t){return this.getEpochAndSlotIndex(t)[0]}getEpochAndSlotIndex(t){if(t<this.firstNormalSlot){var e;let r=iw(0===(e=t+32+1)?1:(e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,(e|=e>>32)+1))-iw(32)-1,n=this.getSlotsInEpoch(r);return[r,t-(n-32)]}{let e=t-this.firstNormalSlot,r=Math.floor(e/this.slotsPerEpoch);return[this.firstNormalEpoch+r,e%this.slotsPerEpoch]}}getFirstSlotInEpoch(t){return t<=this.firstNormalEpoch?(Math.pow(2,t)-1)*32:(t-this.firstNormalEpoch)*this.slotsPerEpoch+this.firstNormalSlot}getLastSlotInEpoch(t){return this.getFirstSlotInEpoch(t)+this.getSlotsInEpoch(t)-1}getSlotsInEpoch(t){return t<this.firstNormalEpoch?Math.pow(2,t+iw(32)):this.slotsPerEpoch}}var ix=globalThis.fetch;class iE extends r6{constructor(t,e,r){super(t=>{let r=new r1(t,{autoconnect:!0,max_reconnects:5,reconnect:!0,reconnect_interval:1e3,...e});return"socket"in r?this.underlyingSocket=r.socket:this.underlyingSocket=r,r},t,e,r),this.underlyingSocket=void 0}call(...t){let e=this.underlyingSocket?.readyState;return 1===e?super.call(...t):Promise.reject(Error("Tried to call a JSON-RPC method `"+t[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+e+")"))}notify(...t){let e=this.underlyingSocket?.readyState;return 1===e?super.notify(...t):Promise.reject(Error("Tried to send a JSON-RPC notification `"+t[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+e+")"))}}class iS{constructor(t){this.key=void 0,this.state=void 0,this.key=t.key,this.state=t.state}isActive(){let t=BigInt("0xffffffffffffffff");return this.state.deactivationSlot===t}static deserialize(t){let e=function(t,e){let r;try{r=t.layout.decode(e)}catch(t){throw Error("invalid instruction; "+t)}if(r.typeIndex!==t.index)throw Error(`invalid account data; account type mismatch ${r.typeIndex} != ${t.index}`);return r}(ik,t),r=t.length-56;nY(r>=0,"lookup table is invalid"),nY(r%32==0,"lookup table is invalid");let{addresses:n}=rE.struct([rE.seq(nV(),r/32,"addresses")]).decode(t.slice(56));return{deactivationSlot:e.deactivationSlot,lastExtendedSlot:e.lastExtendedSlot,lastExtendedSlotStartIndex:e.lastExtendedStartIndex,authority:0!==e.authority.length?new nW(e.authority[0]):void 0,addresses:n.map(t=>new nW(t))}}}let ik={index:1,layout:rE.struct([rE.u32("typeIndex"),ip("deactivationSlot"),rE.nu64("lastExtendedSlot"),rE.u8("lastExtendedStartIndex"),rE.u8(),rE.seq(nV(),rE.offset(rE.u8(),-1),"authority")])},iA=/^[^:]+:\/\/([^:[]+|\[[^\]]+\])(:\d+)?(.*)/i,iI=rQ(rD(nW),rV(),t=>new nW(t)),iB=r$([rV(),rW("base64")]),i_=rQ(rD(Y.Buffer),iB,t=>Y.Buffer.from(t[0],"base64"));function iM(t){let e,r;if("string"==typeof t)e=t;else if(t){let{commitment:n,...i}=t;e=n,r=i}return{commitment:e,config:r}}function iC(t){return t.map(t=>"memcmp"in t?{...t,memcmp:{...t.memcmp,encoding:t.memcmp.encoding??"base58"}}:t)}function iT(t){return rG([rZ({jsonrpc:rW("2.0"),id:rV(),result:t}),rZ({jsonrpc:rW("2.0"),id:rV(),error:rZ({code:rY(),message:rV(),data:rK(rN("any",()=>!0))})})])}let iL=iT(rY());function iR(t){return rQ(iT(t),iL,e=>"error"in e?e:{...e,result:rP(e.result,t)})}function iO(t){return iR(rZ({context:rZ({slot:rj()}),value:t}))}function iP(t){return rZ({context:rZ({slot:rj()}),value:t})}function iU(t,e){return 0===t?new n2({header:e.header,staticAccountKeys:e.accountKeys.map(t=>new nW(t)),recentBlockhash:e.recentBlockhash,compiledInstructions:e.instructions.map(t=>({programIdIndex:t.programIdIndex,accountKeyIndexes:t.accounts,data:rv.default.decode(t.data)})),addressTableLookups:e.addressTableLookups}):new n1(e)}let iN=rZ({foundation:rj(),foundationTerm:rj(),initial:rj(),taper:rj(),terminal:rj()}),iz=iR(rz(rF(rZ({epoch:rj(),effectiveSlot:rj(),amount:rj(),postBalance:rj(),commission:rK(rF(rj()))})))),iq=rz(rZ({slot:rj(),prioritizationFee:rj()})),iD=rZ({total:rj(),validator:rj(),foundation:rj(),epoch:rj()}),iW=rZ({epoch:rj(),slotIndex:rj(),slotsInEpoch:rj(),absoluteSlot:rj(),blockHeight:rK(rj()),transactionCount:rK(rj())}),iF=rZ({slotsPerEpoch:rj(),leaderScheduleSlotOffset:rj(),warmup:rq(),firstNormalEpoch:rj(),firstNormalSlot:rj()}),ij=rH(rV(),rz(rj())),iK=rF(rG([rZ({}),rV()])),iH=rZ({err:iK}),iV=rW("receivedSignature"),i$=rZ({"solana-core":rV(),"feature-set":rK(rj())}),iZ=rZ({program:rV(),programId:iI,parsed:rY()}),iG=rZ({programId:iI,accounts:rz(iI),data:rV()}),iY=iO(rZ({err:rF(rG([rZ({}),rV()])),logs:rF(rz(rV())),accounts:rK(rF(rz(rF(rZ({executable:rq(),owner:rV(),lamports:rj(),data:rz(rV()),rentEpoch:rK(rj())}))))),unitsConsumed:rK(rj()),returnData:rK(rF(rZ({programId:rV(),data:r$([rV(),rW("base64")])}))),innerInstructions:rK(rF(rz(rZ({index:rj(),instructions:rz(rG([iZ,iG]))}))))})),iQ=iO(rZ({byIdentity:rH(rV(),rz(rj())),range:rZ({firstSlot:rj(),lastSlot:rj()})})),iJ=iR(iN),iX=iR(iD),i0=iR(iq),i1=iR(iW),i2=iR(iF),i6=iR(ij),i5=iR(rj()),i3=iO(rZ({total:rj(),circulating:rj(),nonCirculating:rj(),nonCirculatingAccounts:rz(iI)})),i8=rZ({amount:rV(),uiAmount:rF(rj()),decimals:rj(),uiAmountString:rK(rV())}),i4=iO(rz(rZ({address:iI,amount:rV(),uiAmount:rF(rj()),decimals:rj(),uiAmountString:rK(rV())}))),i7=iO(rz(rZ({pubkey:iI,account:rZ({executable:rq(),owner:iI,lamports:rj(),data:i_,rentEpoch:rj()})}))),i9=rZ({program:rV(),parsed:rY(),space:rj()}),ot=iO(rz(rZ({pubkey:iI,account:rZ({executable:rq(),owner:iI,lamports:rj(),data:i9,rentEpoch:rj()})}))),oe=iO(rz(rZ({lamports:rj(),address:iI}))),or=rZ({executable:rq(),owner:iI,lamports:rj(),data:i_,rentEpoch:rj()}),on=rZ({pubkey:iI,account:or}),oi=rQ(rG([rD(Y.Buffer),i9]),rG([iB,i9]),t=>Array.isArray(t)?rP(t,i_):t),oo=rZ({executable:rq(),owner:iI,lamports:rj(),data:oi,rentEpoch:rj()}),os=rZ({pubkey:iI,account:oo}),oa=rZ({state:rG([rW("active"),rW("inactive"),rW("activating"),rW("deactivating")]),active:rj(),inactive:rj()}),ol=iR(rz(rZ({signature:rV(),slot:rj(),err:iK,memo:rF(rV()),blockTime:rK(rF(rj()))}))),ou=iR(rz(rZ({signature:rV(),slot:rj(),err:iK,memo:rF(rV()),blockTime:rK(rF(rj()))}))),oc=rZ({subscription:rj(),result:iP(or)}),oh=rZ({pubkey:iI,account:or}),of=rZ({subscription:rj(),result:iP(oh)}),od=rZ({parent:rj(),slot:rj(),root:rj()}),op=rZ({subscription:rj(),result:od}),og=rG([rZ({type:rG([rW("firstShredReceived"),rW("completed"),rW("optimisticConfirmation"),rW("root")]),slot:rj(),timestamp:rj()}),rZ({type:rW("createdBank"),parent:rj(),slot:rj(),timestamp:rj()}),rZ({type:rW("frozen"),slot:rj(),timestamp:rj(),stats:rZ({numTransactionEntries:rj(),numSuccessfulTransactions:rj(),numFailedTransactions:rj(),maxTransactionsPerEntry:rj()})}),rZ({type:rW("dead"),slot:rj(),timestamp:rj(),err:rV()})]),om=rZ({subscription:rj(),result:og}),oy=rZ({subscription:rj(),result:iP(rG([iH,iV]))}),ob=rZ({subscription:rj(),result:rj()}),ow=rZ({pubkey:rV(),gossip:rF(rV()),tpu:rF(rV()),rpc:rF(rV()),version:rF(rV())}),ov=rZ({votePubkey:rV(),nodePubkey:rV(),activatedStake:rj(),epochVoteAccount:rq(),epochCredits:rz(r$([rj(),rj(),rj()])),commission:rj(),lastVote:rj(),rootSlot:rF(rj())}),ox=iR(rZ({current:rz(ov),delinquent:rz(ov)})),oE=rG([rW("processed"),rW("confirmed"),rW("finalized")]),oS=rZ({slot:rj(),confirmations:rF(rj()),err:iK,confirmationStatus:rK(oE)}),ok=iO(rz(rF(oS))),oA=iR(rj()),oI=rZ({accountKey:iI,writableIndexes:rz(rj()),readonlyIndexes:rz(rj())}),oB=rZ({signatures:rz(rV()),message:rZ({accountKeys:rz(rV()),header:rZ({numRequiredSignatures:rj(),numReadonlySignedAccounts:rj(),numReadonlyUnsignedAccounts:rj()}),instructions:rz(rZ({accounts:rz(rj()),data:rV(),programIdIndex:rj()})),recentBlockhash:rV(),addressTableLookups:rK(rz(oI))})}),o_=rZ({pubkey:iI,signer:rq(),writable:rq(),source:rK(rG([rW("transaction"),rW("lookupTable")]))}),oM=rZ({accountKeys:rz(o_),signatures:rz(rV())}),oC=rZ({parsed:rY(),program:rV(),programId:iI}),oT=rZ({accounts:rz(iI),data:rV(),programId:iI}),oL=rQ(rG([oT,oC]),rG([rZ({parsed:rY(),program:rV(),programId:rV()}),rZ({accounts:rz(rV()),data:rV(),programId:rV()})]),t=>"accounts"in t?rP(t,oT):rP(t,oC)),oR=rZ({signatures:rz(rV()),message:rZ({accountKeys:rz(o_),instructions:rz(oL),recentBlockhash:rV(),addressTableLookups:rK(rF(rz(oI)))})}),oO=rZ({accountIndex:rj(),mint:rV(),owner:rK(rV()),programId:rK(rV()),uiTokenAmount:i8}),oP=rZ({writable:rz(iI),readonly:rz(iI)}),oU=rZ({err:iK,fee:rj(),innerInstructions:rK(rF(rz(rZ({index:rj(),instructions:rz(rZ({accounts:rz(rj()),data:rV(),programIdIndex:rj()}))})))),preBalances:rz(rj()),postBalances:rz(rj()),logMessages:rK(rF(rz(rV()))),preTokenBalances:rK(rF(rz(oO))),postTokenBalances:rK(rF(rz(oO))),loadedAddresses:rK(oP),computeUnitsConsumed:rK(rj()),costUnits:rK(rj())}),oN=rZ({err:iK,fee:rj(),innerInstructions:rK(rF(rz(rZ({index:rj(),instructions:rz(oL)})))),preBalances:rz(rj()),postBalances:rz(rj()),logMessages:rK(rF(rz(rV()))),preTokenBalances:rK(rF(rz(oO))),postTokenBalances:rK(rF(rz(oO))),loadedAddresses:rK(oP),computeUnitsConsumed:rK(rj()),costUnits:rK(rj())}),oz=rG([rW(0),rW("legacy")]),oq=rZ({pubkey:rV(),lamports:rj(),postBalance:rF(rj()),rewardType:rF(rV()),commission:rK(rF(rj()))}),oD=iR(rF(rZ({blockhash:rV(),previousBlockhash:rV(),parentSlot:rj(),transactions:rz(rZ({transaction:oB,meta:rF(oU),version:rK(oz)})),rewards:rK(rz(oq)),blockTime:rF(rj()),blockHeight:rF(rj())}))),oW=iR(rF(rZ({blockhash:rV(),previousBlockhash:rV(),parentSlot:rj(),rewards:rK(rz(oq)),blockTime:rF(rj()),blockHeight:rF(rj())}))),oF=iR(rF(rZ({blockhash:rV(),previousBlockhash:rV(),parentSlot:rj(),transactions:rz(rZ({transaction:oM,meta:rF(oU),version:rK(oz)})),rewards:rK(rz(oq)),blockTime:rF(rj()),blockHeight:rF(rj())}))),oj=iR(rF(rZ({blockhash:rV(),previousBlockhash:rV(),parentSlot:rj(),transactions:rz(rZ({transaction:oR,meta:rF(oN),version:rK(oz)})),rewards:rK(rz(oq)),blockTime:rF(rj()),blockHeight:rF(rj())}))),oK=iR(rF(rZ({blockhash:rV(),previousBlockhash:rV(),parentSlot:rj(),transactions:rz(rZ({transaction:oM,meta:rF(oN),version:rK(oz)})),rewards:rK(rz(oq)),blockTime:rF(rj()),blockHeight:rF(rj())}))),oH=iR(rF(rZ({blockhash:rV(),previousBlockhash:rV(),parentSlot:rj(),rewards:rK(rz(oq)),blockTime:rF(rj()),blockHeight:rF(rj())}))),oV=iR(rF(rZ({blockhash:rV(),previousBlockhash:rV(),parentSlot:rj(),transactions:rz(rZ({transaction:oB,meta:rF(oU)})),rewards:rK(rz(oq)),blockTime:rF(rj())}))),o$=iR(rF(rZ({blockhash:rV(),previousBlockhash:rV(),parentSlot:rj(),signatures:rz(rV()),blockTime:rF(rj())}))),oZ=iR(rF(rZ({slot:rj(),meta:rF(oU),blockTime:rK(rF(rj())),transaction:oB,version:rK(oz)}))),oG=iR(rF(rZ({slot:rj(),transaction:oR,meta:rF(oN),blockTime:rK(rF(rj())),version:rK(oz)}))),oY=iO(rZ({blockhash:rV(),lastValidBlockHeight:rj()})),oQ=iO(rq()),oJ=iR(rz(rZ({slot:rj(),numTransactions:rj(),numSlots:rj(),samplePeriodSecs:rj()}))),oX=iO(rF(rZ({feeCalculator:rZ({lamportsPerSignature:rj()})}))),o0=iR(rV()),o1=iR(rV()),o2=rZ({err:iK,logs:rz(rV()),signature:rV()}),o6=rZ({result:iP(o2),subscription:rj()}),o5={"solana-client":"js/1.0.0-maintenance"};class o3{constructor(t,e){let r,n,i,o,s,a;this._commitment=void 0,this._confirmTransactionInitialTimeout=void 0,this._rpcEndpoint=void 0,this._rpcWsEndpoint=void 0,this._rpcClient=void 0,this._rpcRequest=void 0,this._rpcBatchRequest=void 0,this._rpcWebSocket=void 0,this._rpcWebSocketConnected=!1,this._rpcWebSocketHeartbeat=null,this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketGeneration=0,this._disableBlockhashCaching=!1,this._pollingBlockhash=!1,this._blockhashInfo={latestBlockhash:null,lastFetch:0,transactionSignatures:[],simulatedSignatures:[]},this._nextClientSubscriptionId=0,this._subscriptionDisposeFunctionsByClientSubscriptionId={},this._subscriptionHashByClientSubscriptionId={},this._subscriptionStateChangeCallbacksByHash={},this._subscriptionCallbacksByServerSubscriptionId={},this._subscriptionsByHash={},this._subscriptionsAutoDisposedByRpc=new Set,this.getBlockHeight=(()=>{let t={};return async e=>{let{commitment:r,config:n}=iM(e),i=this._buildArgs([],r,void 0,n),o=ib(i);return t[o]=t[o]??(async()=>{try{let t=await this._rpcRequest("getBlockHeight",i),e=rP(t,iR(rj()));if("error"in e)throw new io(e.error,"failed to get block height information");return e.result}finally{delete t[o]}})(),await t[o]}})(),e&&"string"==typeof e?this._commitment=e:e&&(this._commitment=e.commitment,this._confirmTransactionInitialTimeout=e.confirmTransactionInitialTimeout,r=e.wsEndpoint,n=e.httpHeaders,i=e.fetch,o=e.fetchMiddleware,s=e.disableRetryOnRateLimit,a=e.httpAgent),this._rpcEndpoint=function(t){if(!1===/^https?:/.test(t))throw TypeError("Endpoint URL must start with `http:` or `https:`.");return t}(t),this._rpcWsEndpoint=r||function(t){let e=t.match(iA);if(null==e)throw TypeError(`Failed to validate endpoint URL \`${t}\``);let[r,n,i,o]=e,s=t.startsWith("https:")?"wss:":"ws:",a=null==i?null:parseInt(i.slice(1),10),l=null==a?"":`:${a+1}`;return`${s}//${n}${l}${o}`}(t),this._rpcClient=function(t,e,r,n,i,o){let s,a,l=r||ix;return null!=o&&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."),n&&(a=async(t,e)=>{let r=await new Promise((r,i)=>{try{n(t,e,(t,e)=>r([t,e]))}catch(t){i(t)}});return await l(...r)}),new rJ.default(async(r,n)=>{let o={method:"POST",body:r,agent:s,headers:Object.assign({"Content-Type":"application/json"},e||{},o5)};try{let e,r=5,s=500;for(;(e=a?await a(t,o):await l(t,o),429===e.status&&!0!==i)&&(r-=1,0!==r);){;console.error(`Server responded with ${e.status} ${e.statusText}.  Retrying after ${s}ms delay...`),await ia(s),s*=2}let u=await e.text();e.ok?n(null,u):n(Error(`${e.status} ${e.statusText}: ${u}`))}catch(t){t instanceof Error&&n(t)}},{})}(t,n,i,o,s,a),this._rpcRequest=function(t){return(e,r)=>new Promise((n,i)=>{t.request(e,r,(t,e)=>{t?i(t):n(e)})})}(this._rpcClient),this._rpcBatchRequest=function(t){return e=>new Promise((r,n)=>{0===e.length&&r([]);let i=e.map(e=>t.request(e.methodName,e.args));t.request(i,(t,e)=>{t?n(t):r(e)})})}(this._rpcClient),this._rpcWebSocket=new iE(this._rpcWsEndpoint,{autoconnect:!1,max_reconnects:1/0}),this._rpcWebSocket.on("open",this._wsOnOpen.bind(this)),this._rpcWebSocket.on("error",this._wsOnError.bind(this)),this._rpcWebSocket.on("close",this._wsOnClose.bind(this)),this._rpcWebSocket.on("accountNotification",this._wsOnAccountNotification.bind(this)),this._rpcWebSocket.on("programNotification",this._wsOnProgramAccountNotification.bind(this)),this._rpcWebSocket.on("slotNotification",this._wsOnSlotNotification.bind(this)),this._rpcWebSocket.on("slotsUpdatesNotification",this._wsOnSlotUpdatesNotification.bind(this)),this._rpcWebSocket.on("signatureNotification",this._wsOnSignatureNotification.bind(this)),this._rpcWebSocket.on("rootNotification",this._wsOnRootNotification.bind(this)),this._rpcWebSocket.on("logsNotification",this._wsOnLogsNotification.bind(this))}get commitment(){return this._commitment}get rpcEndpoint(){return this._rpcEndpoint}async getBalanceAndContext(t,e){let{commitment:r,config:n}=iM(e),i=this._buildArgs([t.toBase58()],r,void 0,n),o=rP(await this._rpcRequest("getBalance",i),iO(rj()));if("error"in o)throw new io(o.error,`failed to get balance for ${t.toBase58()}`);return o.result}async getBalance(t,e){return await this.getBalanceAndContext(t,e).then(t=>t.value).catch(e=>{throw Error("failed to get balance of account "+t.toBase58()+": "+e)})}async getBlockTime(t){let e=rP(await this._rpcRequest("getBlockTime",[t]),iR(rF(rj())));if("error"in e)throw new io(e.error,`failed to get block time for slot ${t}`);return e.result}async getMinimumLedgerSlot(){let t=rP(await this._rpcRequest("minimumLedgerSlot",[]),iR(rj()));if("error"in t)throw new io(t.error,"failed to get minimum ledger slot");return t.result}async getFirstAvailableBlock(){let t=rP(await this._rpcRequest("getFirstAvailableBlock",[]),i5);if("error"in t)throw new io(t.error,"failed to get first available block");return t.result}async getSupply(t){let e={};e="string"==typeof t?{commitment:t}:t?{...t,commitment:t&&t.commitment||this.commitment}:{commitment:this.commitment};let r=rP(await this._rpcRequest("getSupply",[e]),i3);if("error"in r)throw new io(r.error,"failed to get supply");return r.result}async getTokenSupply(t,e){let r=this._buildArgs([t.toBase58()],e),n=rP(await this._rpcRequest("getTokenSupply",r),iO(i8));if("error"in n)throw new io(n.error,"failed to get token supply");return n.result}async getTokenAccountBalance(t,e){let r=this._buildArgs([t.toBase58()],e),n=rP(await this._rpcRequest("getTokenAccountBalance",r),iO(i8));if("error"in n)throw new io(n.error,"failed to get token account balance");return n.result}async getTokenAccountsByOwner(t,e,r){let{commitment:n,config:i}=iM(r),o=[t.toBase58()];"mint"in e?o.push({mint:e.mint.toBase58()}):o.push({programId:e.programId.toBase58()});let s=this._buildArgs(o,n,"base64",i),a=rP(await this._rpcRequest("getTokenAccountsByOwner",s),i7);if("error"in a)throw new io(a.error,`failed to get token accounts owned by account ${t.toBase58()}`);return a.result}async getParsedTokenAccountsByOwner(t,e,r){let n=[t.toBase58()];"mint"in e?n.push({mint:e.mint.toBase58()}):n.push({programId:e.programId.toBase58()});let i=this._buildArgs(n,r,"jsonParsed"),o=rP(await this._rpcRequest("getTokenAccountsByOwner",i),ot);if("error"in o)throw new io(o.error,`failed to get token accounts owned by account ${t.toBase58()}`);return o.result}async getLargestAccounts(t){let e={...t,commitment:t&&t.commitment||this.commitment},r=e.filter||e.commitment?[e]:[],n=rP(await this._rpcRequest("getLargestAccounts",r),oe);if("error"in n)throw new io(n.error,"failed to get largest accounts");return n.result}async getTokenLargestAccounts(t,e){let r=this._buildArgs([t.toBase58()],e),n=rP(await this._rpcRequest("getTokenLargestAccounts",r),i4);if("error"in n)throw new io(n.error,"failed to get token largest accounts");return n.result}async getAccountInfoAndContext(t,e){let{commitment:r,config:n}=iM(e),i=this._buildArgs([t.toBase58()],r,"base64",n),o=rP(await this._rpcRequest("getAccountInfo",i),iO(rF(or)));if("error"in o)throw new io(o.error,`failed to get info about account ${t.toBase58()}`);return o.result}async getParsedAccountInfo(t,e){let{commitment:r,config:n}=iM(e),i=this._buildArgs([t.toBase58()],r,"jsonParsed",n),o=rP(await this._rpcRequest("getAccountInfo",i),iO(rF(oo)));if("error"in o)throw new io(o.error,`failed to get info about account ${t.toBase58()}`);return o.result}async getAccountInfo(t,e){try{return(await this.getAccountInfoAndContext(t,e)).value}catch(e){throw Error("failed to get info about account "+t.toBase58()+": "+e)}}async getMultipleParsedAccounts(t,e){let{commitment:r,config:n}=iM(e),i=t.map(t=>t.toBase58()),o=this._buildArgs([i],r,"jsonParsed",n),s=rP(await this._rpcRequest("getMultipleAccounts",o),iO(rz(rF(oo))));if("error"in s)throw new io(s.error,`failed to get info for accounts ${i}`);return s.result}async getMultipleAccountsInfoAndContext(t,e){let{commitment:r,config:n}=iM(e),i=t.map(t=>t.toBase58()),o=this._buildArgs([i],r,"base64",n),s=rP(await this._rpcRequest("getMultipleAccounts",o),iO(rz(rF(or))));if("error"in s)throw new io(s.error,`failed to get info for accounts ${i}`);return s.result}async getMultipleAccountsInfo(t,e){return(await this.getMultipleAccountsInfoAndContext(t,e)).value}async getStakeActivation(t,e,r){let{commitment:n,config:i}=iM(e),o=this._buildArgs([t.toBase58()],n,void 0,{...i,epoch:null!=r?r:i?.epoch}),s=rP(await this._rpcRequest("getStakeActivation",o),iR(oa));if("error"in s)throw new io(s.error,`failed to get Stake Activation ${t.toBase58()}`);return s.result}async getProgramAccounts(t,e){let{commitment:r,config:n}=iM(e),{encoding:i,...o}=n||{},s=this._buildArgs([t.toBase58()],r,i||"base64",{...o,...o.filters?{filters:iC(o.filters)}:null}),a=await this._rpcRequest("getProgramAccounts",s),l=rz(on),u=!0===o.withContext?rP(a,iO(l)):rP(a,iR(l));if("error"in u)throw new io(u.error,`failed to get accounts owned by program ${t.toBase58()}`);return u.result}async getParsedProgramAccounts(t,e){let{commitment:r,config:n}=iM(e),i=this._buildArgs([t.toBase58()],r,"jsonParsed",n),o=rP(await this._rpcRequest("getProgramAccounts",i),iR(rz(os)));if("error"in o)throw new io(o.error,`failed to get accounts owned by program ${t.toBase58()}`);return o.result}async confirmTransaction(t,e){let r,n;if("string"==typeof t)r=t;else{if(t.abortSignal?.aborted)return Promise.reject(t.abortSignal.reason);r=t.signature}try{n=rv.default.decode(r)}catch(t){throw Error("signature must be base58 encoded: "+r)}return(nY(64===n.length,"signature has invalid length"),"string"==typeof t)?await this.confirmTransactionUsingLegacyTimeoutStrategy({commitment:e||this.commitment,signature:r}):"lastValidBlockHeight"in t?await this.confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:e||this.commitment,strategy:t}):await this.confirmTransactionUsingDurableNonceStrategy({commitment:e||this.commitment,strategy:t})}getCancellationPromise(t){return new Promise((e,r)=>{null!=t&&(t.aborted?r(t.reason):t.addEventListener("abort",()=>{r(t.reason)}))})}getTransactionConfirmationPromise({commitment:t,signature:e}){let r,n,i=!1;return{abortConfirmation:()=>{n&&(n(),n=void 0),null!=r&&(this.removeSignatureListener(r),r=void 0)},confirmationPromise:new Promise((o,s)=>{try{r=this.onSignature(e,(t,e)=>{r=void 0,o({__type:n5.PROCESSED,response:{context:e,value:t}})},t);let a=new Promise(t=>{null==r?t():n=this._onSubscriptionStateChange(r,e=>{"subscribed"===e&&t()})});(async()=>{if(await a,i)return;let r=await this.getSignatureStatus(e);if(i||null==r)return;let{context:n,value:l}=r;if(null!=l)if(l?.err)s(l.err);else{switch(t){case"confirmed":case"single":case"singleGossip":if("processed"===l.confirmationStatus)return;break;case"finalized":case"max":case"root":if("processed"===l.confirmationStatus||"confirmed"===l.confirmationStatus)return}i=!0,o({__type:n5.PROCESSED,response:{context:n,value:l}})}})()}catch(t){s(t)}})}}async confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:t,strategy:{abortSignal:e,lastValidBlockHeight:r,signature:n}}){let i,o=!1,s=new Promise(e=>{let n=async()=>{try{return await this.getBlockHeight(t)}catch(t){return -1}};(async()=>{let t=await n();if(!o){for(;t<=r;)if(await ia(1e3),o||(t=await n(),o))return;e({__type:n5.BLOCKHEIGHT_EXCEEDED})}})()}),{abortConfirmation:a,confirmationPromise:l}=this.getTransactionConfirmationPromise({commitment:t,signature:n}),u=this.getCancellationPromise(e);try{let t=await Promise.race([u,l,s]);if(t.__type===n5.PROCESSED)i=t.response;else throw new nF(n)}finally{o=!0,a()}return i}async confirmTransactionUsingDurableNonceStrategy({commitment:t,strategy:{abortSignal:e,minContextSlot:r,nonceAccountPubkey:n,nonceValue:i,signature:o}}){let s,a=!1,l=new Promise(e=>{let o=i,s=null,l=async()=>{try{let{context:e,value:i}=await this.getNonceAndContext(n,{commitment:t,minContextSlot:r});return s=e.slot,i?.nonce}catch(t){return o}};(async()=>{if(o=await l(),!a)for(;;){if(i!==o)return void e({__type:n5.NONCE_INVALID,slotInWhichNonceDidAdvance:s});if(await ia(2e3),a||(o=await l(),a))return}})()}),{abortConfirmation:u,confirmationPromise:c}=this.getTransactionConfirmationPromise({commitment:t,signature:o}),h=this.getCancellationPromise(e);try{let e=await Promise.race([h,c,l]);if(e.__type===n5.PROCESSED)s=e.response;else{let n;for(;;){let t=await this.getSignatureStatus(o);if(null==t)break;if(t.context.slot<(e.slotInWhichNonceDidAdvance??r)){await ia(400);continue}n=t;break}if(n?.value){let e=t||"finalized",{confirmationStatus:r}=n.value;switch(e){case"processed":case"recent":if("processed"!==r&&"confirmed"!==r&&"finalized"!==r)throw new nK(o);break;case"confirmed":case"single":case"singleGossip":if("confirmed"!==r&&"finalized"!==r)throw new nK(o);break;case"finalized":case"max":case"root":if("finalized"!==r)throw new nK(o)}s={context:n.context,value:{err:n.value.err}}}else throw new nK(o)}}finally{a=!0,u()}return s}async confirmTransactionUsingLegacyTimeoutStrategy({commitment:t,signature:e}){let r,n,i=new Promise(e=>{let n=this._confirmTransactionInitialTimeout||6e4;switch(t){case"processed":case"recent":case"single":case"confirmed":case"singleGossip":n=this._confirmTransactionInitialTimeout||3e4}r=setTimeout(()=>e({__type:n5.TIMED_OUT,timeoutMs:n}),n)}),{abortConfirmation:o,confirmationPromise:s}=this.getTransactionConfirmationPromise({commitment:t,signature:e});try{let t=await Promise.race([s,i]);if(t.__type===n5.PROCESSED)n=t.response;else throw new nj(e,t.timeoutMs/1e3)}finally{clearTimeout(r),o()}return n}async getClusterNodes(){let t=rP(await this._rpcRequest("getClusterNodes",[]),iR(rz(ow)));if("error"in t)throw new io(t.error,"failed to get cluster nodes");return t.result}async getVoteAccounts(t){let e=this._buildArgs([],t),r=rP(await this._rpcRequest("getVoteAccounts",e),ox);if("error"in r)throw new io(r.error,"failed to get vote accounts");return r.result}async getSlot(t){let{commitment:e,config:r}=iM(t),n=this._buildArgs([],e,void 0,r),i=rP(await this._rpcRequest("getSlot",n),iR(rj()));if("error"in i)throw new io(i.error,"failed to get slot");return i.result}async getSlotLeader(t){let{commitment:e,config:r}=iM(t),n=this._buildArgs([],e,void 0,r),i=rP(await this._rpcRequest("getSlotLeader",n),iR(rV()));if("error"in i)throw new io(i.error,"failed to get slot leader");return i.result}async getSlotLeaders(t,e){let r=rP(await this._rpcRequest("getSlotLeaders",[t,e]),iR(rz(iI)));if("error"in r)throw new io(r.error,"failed to get slot leaders");return r.result}async getSignatureStatus(t,e){let{context:r,value:n}=await this.getSignatureStatuses([t],e);return nY(1===n.length),{context:r,value:n[0]}}async getSignatureStatuses(t,e){let r=[t];e&&r.push(e);let n=rP(await this._rpcRequest("getSignatureStatuses",r),ok);if("error"in n)throw new io(n.error,"failed to get signature status");return n.result}async getTransactionCount(t){let{commitment:e,config:r}=iM(t),n=this._buildArgs([],e,void 0,r),i=rP(await this._rpcRequest("getTransactionCount",n),iR(rj()));if("error"in i)throw new io(i.error,"failed to get transaction count");return i.result}async getTotalSupply(t){return(await this.getSupply({commitment:t,excludeNonCirculatingAccountsList:!0})).value.total}async getInflationGovernor(t){let e=this._buildArgs([],t),r=rP(await this._rpcRequest("getInflationGovernor",e),iJ);if("error"in r)throw new io(r.error,"failed to get inflation");return r.result}async getInflationReward(t,e,r){let{commitment:n,config:i}=iM(r),o=this._buildArgs([t.map(t=>t.toBase58())],n,void 0,{...i,epoch:null!=e?e:i?.epoch}),s=rP(await this._rpcRequest("getInflationReward",o),iz);if("error"in s)throw new io(s.error,"failed to get inflation reward");return s.result}async getInflationRate(){let t=rP(await this._rpcRequest("getInflationRate",[]),iX);if("error"in t)throw new io(t.error,"failed to get inflation rate");return t.result}async getEpochInfo(t){let{commitment:e,config:r}=iM(t),n=this._buildArgs([],e,void 0,r),i=rP(await this._rpcRequest("getEpochInfo",n),i1);if("error"in i)throw new io(i.error,"failed to get epoch info");return i.result}async getEpochSchedule(){let t=rP(await this._rpcRequest("getEpochSchedule",[]),i2);if("error"in t)throw new io(t.error,"failed to get epoch schedule");let e=t.result;return new iv(e.slotsPerEpoch,e.leaderScheduleSlotOffset,e.warmup,e.firstNormalEpoch,e.firstNormalSlot)}async getLeaderSchedule(){let t=rP(await this._rpcRequest("getLeaderSchedule",[]),i6);if("error"in t)throw new io(t.error,"failed to get leader schedule");return t.result}async getMinimumBalanceForRentExemption(t,e){let r=this._buildArgs([t],e),n=rP(await this._rpcRequest("getMinimumBalanceForRentExemption",r),oA);return"error"in n?(console.warn("Unable to fetch minimum balance for rent exemption"),0):n.result}async getRecentBlockhashAndContext(t){let{context:e,value:{blockhash:r}}=await this.getLatestBlockhashAndContext(t);return{context:e,value:{blockhash:r,feeCalculator:{get lamportsPerSignature(){throw Error("The capability to fetch `lamportsPerSignature` using the `getRecentBlockhash` API is no longer offered by the network. Use the `getFeeForMessage` API to obtain the fee for a given message.")},toJSON:()=>({})}}}}async getRecentPerformanceSamples(t){let e=rP(await this._rpcRequest("getRecentPerformanceSamples",t?[t]:[]),oJ);if("error"in e)throw new io(e.error,"failed to get recent performance samples");return e.result}async getFeeCalculatorForBlockhash(t,e){let r=this._buildArgs([t],e),n=rP(await this._rpcRequest("getFeeCalculatorForBlockhash",r),oX);if("error"in n)throw new io(n.error,"failed to get fee calculator");let{context:i,value:o}=n.result;return{context:i,value:null!==o?o.feeCalculator:null}}async getFeeForMessage(t,e){let r=nN(t.serialize()).toString("base64"),n=this._buildArgs([r],e),i=rP(await this._rpcRequest("getFeeForMessage",n),iO(rF(rj())));if("error"in i)throw new io(i.error,"failed to get fee for message");if(null===i.result)throw Error("invalid blockhash");return i.result}async getRecentPrioritizationFees(t){let e=t?.lockedWritableAccounts?.map(t=>t.toBase58()),r=e?.length?[e]:[],n=rP(await this._rpcRequest("getRecentPrioritizationFees",r),i0);if("error"in n)throw new io(n.error,"failed to get recent prioritization fees");return n.result}async getRecentBlockhash(t){try{return(await this.getRecentBlockhashAndContext(t)).value}catch(t){throw Error("failed to get recent blockhash: "+t)}}async getLatestBlockhash(t){try{return(await this.getLatestBlockhashAndContext(t)).value}catch(t){throw Error("failed to get recent blockhash: "+t)}}async getLatestBlockhashAndContext(t){let{commitment:e,config:r}=iM(t),n=this._buildArgs([],e,void 0,r),i=rP(await this._rpcRequest("getLatestBlockhash",n),oY);if("error"in i)throw new io(i.error,"failed to get latest blockhash");return i.result}async isBlockhashValid(t,e){let{commitment:r,config:n}=iM(e),i=this._buildArgs([t],r,void 0,n),o=rP(await this._rpcRequest("isBlockhashValid",i),oQ);if("error"in o)throw new io(o.error,"failed to determine if the blockhash `"+t+"`is valid");return o.result}async getVersion(){let t=rP(await this._rpcRequest("getVersion",[]),iR(i$));if("error"in t)throw new io(t.error,"failed to get version");return t.result}async getGenesisHash(){let t=rP(await this._rpcRequest("getGenesisHash",[]),iR(rV()));if("error"in t)throw new io(t.error,"failed to get genesis hash");return t.result}async getBlock(t,e){let{commitment:r,config:n}=iM(e),i=this._buildArgsAtLeastConfirmed([t],r,void 0,n),o=await this._rpcRequest("getBlock",i);try{switch(n?.transactionDetails){case"accounts":{let t=rP(o,oF);if("error"in t)throw t.error;return t.result}case"none":{let t=rP(o,oW);if("error"in t)throw t.error;return t.result}default:{let t=rP(o,oD);if("error"in t)throw t.error;let{result:e}=t;return e?{...e,transactions:e.transactions.map(({transaction:t,meta:e,version:r})=>({meta:e,transaction:{...t,message:iU(r,t.message)},version:r}))}:null}}}catch(t){throw new io(t,"failed to get confirmed block")}}async getParsedBlock(t,e){let{commitment:r,config:n}=iM(e),i=this._buildArgsAtLeastConfirmed([t],r,"jsonParsed",n),o=await this._rpcRequest("getBlock",i);try{switch(n?.transactionDetails){case"accounts":{let t=rP(o,oK);if("error"in t)throw t.error;return t.result}case"none":{let t=rP(o,oH);if("error"in t)throw t.error;return t.result}default:{let t=rP(o,oj);if("error"in t)throw t.error;return t.result}}}catch(t){throw new io(t,"failed to get block")}}async getBlockProduction(t){let e,r;if("string"==typeof t)r=t;else if(t){let{commitment:n,...i}=t;r=n,e=i}let n=this._buildArgs([],r,"base64",e),i=rP(await this._rpcRequest("getBlockProduction",n),iQ);if("error"in i)throw new io(i.error,"failed to get block production information");return i.result}async getTransaction(t,e){let{commitment:r,config:n}=iM(e),i=this._buildArgsAtLeastConfirmed([t],r,void 0,n),o=rP(await this._rpcRequest("getTransaction",i),oZ);if("error"in o)throw new io(o.error,"failed to get transaction");let s=o.result;return s?{...s,transaction:{...s.transaction,message:iU(s.version,s.transaction.message)}}:s}async getParsedTransaction(t,e){let{commitment:r,config:n}=iM(e),i=this._buildArgsAtLeastConfirmed([t],r,"jsonParsed",n),o=rP(await this._rpcRequest("getTransaction",i),oG);if("error"in o)throw new io(o.error,"failed to get transaction");return o.result}async getParsedTransactions(t,e){let{commitment:r,config:n}=iM(e),i=t.map(t=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([t],r,"jsonParsed",n)}));return(await this._rpcBatchRequest(i)).map(t=>{let e=rP(t,oG);if("error"in e)throw new io(e.error,"failed to get transactions");return e.result})}async getTransactions(t,e){let{commitment:r,config:n}=iM(e),i=t.map(t=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([t],r,void 0,n)}));return(await this._rpcBatchRequest(i)).map(t=>{let e=rP(t,oZ);if("error"in e)throw new io(e.error,"failed to get transactions");let r=e.result;return r?{...r,transaction:{...r.transaction,message:iU(r.version,r.transaction.message)}}:r})}async getConfirmedBlock(t,e){let r=this._buildArgsAtLeastConfirmed([t],e),n=rP(await this._rpcRequest("getBlock",r),oV);if("error"in n)throw new io(n.error,"failed to get confirmed block");let i=n.result;if(!i)throw Error("Confirmed block "+t+" not found");let o={...i,transactions:i.transactions.map(({transaction:t,meta:e})=>{let r=new n1(t.message);return{meta:e,transaction:{...t,message:r}}})};return{...o,transactions:o.transactions.map(({transaction:t,meta:e})=>({meta:e,transaction:n4.populate(t.message,t.signatures)}))}}async getBlocks(t,e,r){let n=this._buildArgsAtLeastConfirmed(void 0!==e?[t,e]:[t],r),i=rP(await this._rpcRequest("getBlocks",n),iR(rz(rj())));if("error"in i)throw new io(i.error,"failed to get blocks");return i.result}async getBlockSignatures(t,e){let r=this._buildArgsAtLeastConfirmed([t],e,void 0,{transactionDetails:"signatures",rewards:!1}),n=rP(await this._rpcRequest("getBlock",r),o$);if("error"in n)throw new io(n.error,"failed to get block");let i=n.result;if(!i)throw Error("Block "+t+" not found");return i}async getConfirmedBlockSignatures(t,e){let r=this._buildArgsAtLeastConfirmed([t],e,void 0,{transactionDetails:"signatures",rewards:!1}),n=rP(await this._rpcRequest("getBlock",r),o$);if("error"in n)throw new io(n.error,"failed to get confirmed block");let i=n.result;if(!i)throw Error("Confirmed block "+t+" not found");return i}async getConfirmedTransaction(t,e){let r=this._buildArgsAtLeastConfirmed([t],e),n=rP(await this._rpcRequest("getTransaction",r),oZ);if("error"in n)throw new io(n.error,"failed to get transaction");let i=n.result;if(!i)return i;let o=new n1(i.transaction.message),s=i.transaction.signatures;return{...i,transaction:n4.populate(o,s)}}async getParsedConfirmedTransaction(t,e){let r=this._buildArgsAtLeastConfirmed([t],e,"jsonParsed"),n=rP(await this._rpcRequest("getTransaction",r),oG);if("error"in n)throw new io(n.error,"failed to get confirmed transaction");return n.result}async getParsedConfirmedTransactions(t,e){let r=t.map(t=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([t],e,"jsonParsed")}));return(await this._rpcBatchRequest(r)).map(t=>{let e=rP(t,oG);if("error"in e)throw new io(e.error,"failed to get confirmed transactions");return e.result})}async getConfirmedSignaturesForAddress(t,e,r){let n={},i=await this.getFirstAvailableBlock();for(;!("until"in n)&&!(--e<=0)&&!(e<i);)try{let t=await this.getConfirmedBlockSignatures(e,"finalized");t.signatures.length>0&&(n.until=t.signatures[t.signatures.length-1].toString())}catch(t){if(t instanceof Error&&t.message.includes("skipped"))continue;throw t}let o=await this.getSlot("finalized");for(;!("before"in n)&&!(++r>o);)try{let t=await this.getConfirmedBlockSignatures(r);t.signatures.length>0&&(n.before=t.signatures[t.signatures.length-1].toString())}catch(t){if(t instanceof Error&&t.message.includes("skipped"))continue;throw t}return(await this.getConfirmedSignaturesForAddress2(t,n)).map(t=>t.signature)}async getConfirmedSignaturesForAddress2(t,e,r){let n=this._buildArgsAtLeastConfirmed([t.toBase58()],r,void 0,e),i=rP(await this._rpcRequest("getConfirmedSignaturesForAddress2",n),ol);if("error"in i)throw new io(i.error,"failed to get confirmed signatures for address");return i.result}async getSignaturesForAddress(t,e,r){let n=this._buildArgsAtLeastConfirmed([t.toBase58()],r,void 0,e),i=rP(await this._rpcRequest("getSignaturesForAddress",n),ou);if("error"in i)throw new io(i.error,"failed to get signatures for address");return i.result}async getAddressLookupTable(t,e){let{context:r,value:n}=await this.getAccountInfoAndContext(t,e),i=null;return null!==n&&(i=new iS({key:t,state:iS.deserialize(n.data)})),{context:r,value:i}}async getNonceAndContext(t,e){let{context:r,value:n}=await this.getAccountInfoAndContext(t,e),i=null;return null!==n&&(i=id.fromAccountData(n.data)),{context:r,value:i}}async getNonce(t,e){return await this.getNonceAndContext(t,e).then(t=>t.value).catch(e=>{throw Error("failed to get nonce for account "+t.toBase58()+": "+e)})}async requestAirdrop(t,e){let r=rP(await this._rpcRequest("requestAirdrop",[t.toBase58(),e]),o0);if("error"in r)throw new io(r.error,`airdrop to ${t.toBase58()} failed`);return r.result}async _blockhashWithExpiryBlockHeight(t){if(!t){for(;this._pollingBlockhash;)await ia(100);let t=Date.now()-this._blockhashInfo.lastFetch;if(null!==this._blockhashInfo.latestBlockhash&&!(t>=3e4))return this._blockhashInfo.latestBlockhash}return await this._pollNewBlockhash()}async _pollNewBlockhash(){this._pollingBlockhash=!0;try{let t=Date.now(),e=this._blockhashInfo.latestBlockhash,r=e?e.blockhash:null;for(let t=0;t<50;t++){let t=await this.getLatestBlockhash("finalized");if(r!==t.blockhash)return this._blockhashInfo={latestBlockhash:t,lastFetch:Date.now(),transactionSignatures:[],simulatedSignatures:[]},t;await ia(200)}throw Error(`Unable to obtain a new blockhash after ${Date.now()-t}ms`)}finally{this._pollingBlockhash=!1}}async getStakeMinimumDelegation(t){let{commitment:e,config:r}=iM(t),n=this._buildArgs([],e,"base64",r),i=rP(await this._rpcRequest("getStakeMinimumDelegation",n),iO(rj()));if("error"in i)throw new io(i.error,"failed to get stake minimum delegation");return i.result}async simulateTransaction(t,e,r){let n;if("message"in t){let n=t.serialize(),i=Y.Buffer.from(n).toString("base64");if(Array.isArray(e)||void 0!==r)throw Error("Invalid arguments");let o=e||{};o.encoding="base64","commitment"in o||(o.commitment=this.commitment),e&&"object"==typeof e&&"innerInstructions"in e&&(o.innerInstructions=e.innerInstructions);let s=[i,o],a=rP(await this._rpcRequest("simulateTransaction",s),iY);if("error"in a)throw Error("failed to simulate transaction: "+a.error.message);return a.result}if(t instanceof n4?((n=new n4).feePayer=t.feePayer,n.instructions=t.instructions,n.nonceInfo=t.nonceInfo,n.signatures=t.signatures):(n=n4.populate(t))._message=n._json=void 0,void 0!==e&&!Array.isArray(e))throw Error("Invalid arguments");if(n.nonceInfo&&e)n.sign(...e);else{let t=this._disableBlockhashCaching;for(;;){let r=await this._blockhashWithExpiryBlockHeight(t);if(n.lastValidBlockHeight=r.lastValidBlockHeight,n.recentBlockhash=r.blockhash,!e)break;if(n.sign(...e),!n.signature)throw Error("!signature");let i=n.signature.toString("base64");if(this._blockhashInfo.simulatedSignatures.includes(i)||this._blockhashInfo.transactionSignatures.includes(i))t=!0;else{this._blockhashInfo.simulatedSignatures.push(i);break}}}let i=n._compile(),o=i.serialize(),s=n._serialize(o).toString("base64"),a={encoding:"base64",commitment:this.commitment};r&&(a.accounts={encoding:"base64",addresses:(Array.isArray(r)?r:i.nonProgramIds()).map(t=>t.toBase58())}),e&&(a.sigVerify=!0),e&&"object"==typeof e&&"innerInstructions"in e&&(a.innerInstructions=e.innerInstructions);let l=[s,a],u=rP(await this._rpcRequest("simulateTransaction",l),iY);if("error"in u){let t;if("data"in u.error&&(t=u.error.data.logs)&&Array.isArray(t)){let e="\n    ",r=e+t.join(e);console.error(u.error.message,r)}throw new ii({action:"simulate",signature:"",transactionMessage:u.error.message,logs:t})}return u.result}async sendTransaction(t,e,r){if("version"in t){if(e&&Array.isArray(e))throw Error("Invalid arguments");let r=t.serialize();return await this.sendRawTransaction(r,e)}if(void 0===e||!Array.isArray(e))throw Error("Invalid arguments");if(t.nonceInfo)t.sign(...e);else{let r=this._disableBlockhashCaching;for(;;){let n=await this._blockhashWithExpiryBlockHeight(r);if(t.lastValidBlockHeight=n.lastValidBlockHeight,t.recentBlockhash=n.blockhash,t.sign(...e),!t.signature)throw Error("!signature");let i=t.signature.toString("base64");if(this._blockhashInfo.transactionSignatures.includes(i))r=!0;else{this._blockhashInfo.transactionSignatures.push(i);break}}}let n=t.serialize();return await this.sendRawTransaction(n,r)}async sendRawTransaction(t,e){let r=nN(t).toString("base64");return await this.sendEncodedTransaction(r,e)}async sendEncodedTransaction(t,e){let r={encoding:"base64"},n=e&&e.skipPreflight,i=!0===n?"processed":e&&e.preflightCommitment||this.commitment;e&&null!=e.maxRetries&&(r.maxRetries=e.maxRetries),e&&null!=e.minContextSlot&&(r.minContextSlot=e.minContextSlot),n&&(r.skipPreflight=n),i&&(r.preflightCommitment=i);let o=[t,r],s=rP(await this._rpcRequest("sendTransaction",o),o1);if("error"in s){let t;throw"data"in s.error&&(t=s.error.data.logs),new ii({action:n?"send":"simulate",signature:"",transactionMessage:s.error.message,logs:t})}return s.result}_wsOnOpen(){this._rpcWebSocketConnected=!0,this._rpcWebSocketHeartbeat=setInterval(()=>{(async()=>{try{await this._rpcWebSocket.notify("ping")}catch{}})()},5e3),this._updateSubscriptions()}_wsOnError(t){this._rpcWebSocketConnected=!1,console.error("ws error:",t.message)}_wsOnClose(t){(this._rpcWebSocketConnected=!1,this._rpcWebSocketGeneration=(this._rpcWebSocketGeneration+1)%Number.MAX_SAFE_INTEGER,this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null),this._rpcWebSocketHeartbeat&&(clearInterval(this._rpcWebSocketHeartbeat),this._rpcWebSocketHeartbeat=null),1e3===t)?this._updateSubscriptions():(this._subscriptionCallbacksByServerSubscriptionId={},Object.entries(this._subscriptionsByHash).forEach(([t,e])=>{this._setSubscription(t,{...e,state:"pending"})}))}_setSubscription(t,e){let r=this._subscriptionsByHash[t]?.state;if(this._subscriptionsByHash[t]=e,r!==e.state){let r=this._subscriptionStateChangeCallbacksByHash[t];r&&r.forEach(t=>{try{t(e.state)}catch{}})}}_onSubscriptionStateChange(t,e){let r=this._subscriptionHashByClientSubscriptionId[t];if(null==r)return()=>{};let n=this._subscriptionStateChangeCallbacksByHash[r]||=new Set;return n.add(e),()=>{n.delete(e),0===n.size&&delete this._subscriptionStateChangeCallbacksByHash[r]}}async _updateSubscriptions(){if(0===Object.keys(this._subscriptionsByHash).length){this._rpcWebSocketConnected&&(this._rpcWebSocketConnected=!1,this._rpcWebSocketIdleTimeout=setTimeout(()=>{this._rpcWebSocketIdleTimeout=null;try{this._rpcWebSocket.close()}catch(t){t instanceof Error&&console.log(`Error when closing socket connection: ${t.message}`)}},500));return}if(null!==this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketConnected=!0),!this._rpcWebSocketConnected)return void this._rpcWebSocket.connect();let t=this._rpcWebSocketGeneration,e=()=>t===this._rpcWebSocketGeneration;await Promise.all(Object.keys(this._subscriptionsByHash).map(async t=>{let r=this._subscriptionsByHash[t];if(void 0!==r)switch(r.state){case"pending":case"unsubscribed":if(0===r.callbacks.size){delete this._subscriptionsByHash[t],"unsubscribed"===r.state&&delete this._subscriptionCallbacksByServerSubscriptionId[r.serverSubscriptionId],await this._updateSubscriptions();return}await (async()=>{let{args:n,method:i}=r;try{this._setSubscription(t,{...r,state:"subscribing"});let e=await this._rpcWebSocket.call(i,n);this._setSubscription(t,{...r,serverSubscriptionId:e,state:"subscribed"}),this._subscriptionCallbacksByServerSubscriptionId[e]=r.callbacks,await this._updateSubscriptions()}catch(o){if(console.error(`Received ${o instanceof Error?"":"JSON-RPC "}error calling \`${i}\``,{args:n,error:o}),!e())return;this._setSubscription(t,{...r,state:"pending"}),await this._updateSubscriptions()}})();break;case"subscribed":0===r.callbacks.size&&await (async()=>{let{serverSubscriptionId:n,unsubscribeMethod:i}=r;if(this._subscriptionsAutoDisposedByRpc.has(n))this._subscriptionsAutoDisposedByRpc.delete(n);else{this._setSubscription(t,{...r,state:"unsubscribing"}),this._setSubscription(t,{...r,state:"unsubscribing"});try{await this._rpcWebSocket.call(i,[n])}catch(n){if(n instanceof Error&&console.error(`${i} error:`,n.message),!e())return;this._setSubscription(t,{...r,state:"subscribed"}),await this._updateSubscriptions();return}}this._setSubscription(t,{...r,state:"unsubscribed"}),await this._updateSubscriptions()})()}}))}_handleServerNotification(t,e){let r=this._subscriptionCallbacksByServerSubscriptionId[t];void 0!==r&&r.forEach(t=>{try{t(...e)}catch(t){console.error(t)}})}_wsOnAccountNotification(t){let{result:e,subscription:r}=rP(t,oc);this._handleServerNotification(r,[e.value,e.context])}_makeSubscription(t,e){let r=this._nextClientSubscriptionId++,n=ib([t.method,e]),i=this._subscriptionsByHash[n];return void 0===i?this._subscriptionsByHash[n]={...t,args:e,callbacks:new Set([t.callback]),state:"pending"}:i.callbacks.add(t.callback),this._subscriptionHashByClientSubscriptionId[r]=n,this._subscriptionDisposeFunctionsByClientSubscriptionId[r]=async()=>{delete this._subscriptionDisposeFunctionsByClientSubscriptionId[r],delete this._subscriptionHashByClientSubscriptionId[r];let e=this._subscriptionsByHash[n];nY(void 0!==e,`Could not find a \`Subscription\` when tearing down client subscription #${r}`),e.callbacks.delete(t.callback),await this._updateSubscriptions()},this._updateSubscriptions(),r}onAccountChange(t,e,r){let{commitment:n,config:i}=iM(r),o=this._buildArgs([t.toBase58()],n||this._commitment||"finalized","base64",i);return this._makeSubscription({callback:e,method:"accountSubscribe",unsubscribeMethod:"accountUnsubscribe"},o)}async removeAccountChangeListener(t){await this._unsubscribeClientSubscription(t,"account change")}_wsOnProgramAccountNotification(t){let{result:e,subscription:r}=rP(t,of);this._handleServerNotification(r,[{accountId:e.value.pubkey,accountInfo:e.value.account},e.context])}onProgramAccountChange(t,e,r,n){let{commitment:i,config:o}=iM(r),s=this._buildArgs([t.toBase58()],i||this._commitment||"finalized","base64",o||(n?{filters:iC(n)}:void 0));return this._makeSubscription({callback:e,method:"programSubscribe",unsubscribeMethod:"programUnsubscribe"},s)}async removeProgramAccountChangeListener(t){await this._unsubscribeClientSubscription(t,"program account change")}onLogs(t,e,r){let n=this._buildArgs(["object"==typeof t?{mentions:[t.toString()]}:t],r||this._commitment||"finalized");return this._makeSubscription({callback:e,method:"logsSubscribe",unsubscribeMethod:"logsUnsubscribe"},n)}async removeOnLogsListener(t){await this._unsubscribeClientSubscription(t,"logs")}_wsOnLogsNotification(t){let{result:e,subscription:r}=rP(t,o6);this._handleServerNotification(r,[e.value,e.context])}_wsOnSlotNotification(t){let{result:e,subscription:r}=rP(t,op);this._handleServerNotification(r,[e])}onSlotChange(t){return this._makeSubscription({callback:t,method:"slotSubscribe",unsubscribeMethod:"slotUnsubscribe"},[])}async removeSlotChangeListener(t){await this._unsubscribeClientSubscription(t,"slot change")}_wsOnSlotUpdatesNotification(t){let{result:e,subscription:r}=rP(t,om);this._handleServerNotification(r,[e])}onSlotUpdate(t){return this._makeSubscription({callback:t,method:"slotsUpdatesSubscribe",unsubscribeMethod:"slotsUpdatesUnsubscribe"},[])}async removeSlotUpdateListener(t){await this._unsubscribeClientSubscription(t,"slot update")}async _unsubscribeClientSubscription(t,e){let r=this._subscriptionDisposeFunctionsByClientSubscriptionId[t];r?await r():console.warn(`Ignored unsubscribe request because an active subscription with id \`${t}\` for '${e}' events could not be found.`)}_buildArgs(t,e,r,n){let i=e||this._commitment;if(i||r||n){let e={};r&&(e.encoding=r),i&&(e.commitment=i),n&&(e=Object.assign(e,n)),t.push(e)}return t}_buildArgsAtLeastConfirmed(t,e,r,n){let i=e||this._commitment;if(i&&!["confirmed","finalized"].includes(i))throw Error("Using Connection with default commitment: `"+this._commitment+"`, but method requires at least `confirmed`");return this._buildArgs(t,e,r,n)}_wsOnSignatureNotification(t){let{result:e,subscription:r}=rP(t,oy);"receivedSignature"!==e.value&&this._subscriptionsAutoDisposedByRpc.add(r),this._handleServerNotification(r,"receivedSignature"===e.value?[{type:"received"},e.context]:[{type:"status",result:e.value},e.context])}onSignature(t,e,r){let n=this._buildArgs([t],r||this._commitment||"finalized"),i=this._makeSubscription({callback:(t,r)=>{if("status"===t.type){e(t.result,r);try{this.removeSignatureListener(i)}catch(t){}}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},n);return i}onSignatureWithOptions(t,e,r){let{commitment:n,...i}={...r,commitment:r&&r.commitment||this._commitment||"finalized"},o=this._buildArgs([t],n,void 0,i),s=this._makeSubscription({callback:(t,r)=>{e(t,r);try{this.removeSignatureListener(s)}catch(t){}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},o);return s}async removeSignatureListener(t){await this._unsubscribeClientSubscription(t,"signature result")}_wsOnRootNotification(t){let{result:e,subscription:r}=rP(t,ob);this._handleServerNotification(r,[e])}onRootChange(t){return this._makeSubscription({callback:t,method:"rootSubscribe",unsubscribeMethod:"rootUnsubscribe"},[])}async removeRootChangeListener(t){await this._unsubscribeClientSubscription(t,"root change")}}class o8{constructor(t){this._keypair=void 0,this._keypair=t??nL()}static generate(){return new o8(nL())}static fromSecretKey(t,e){if(64!==t.byteLength)throw Error("bad secret key size");let r=t.slice(32,64);if(!e||!e.skipValidation){let e=nR(t.slice(0,32));for(let t=0;t<32;t++)if(r[t]!==e[t])throw Error("provided secretKey is invalid")}return new o8({publicKey:r,secretKey:t})}static fromSeed(t){let e=nR(t),r=new Uint8Array(64);return r.set(t),r.set(e,32),new o8({publicKey:e,secretKey:r})}get publicKey(){return new nW(this._keypair.publicKey)}get secretKey(){return new Uint8Array(this._keypair.secretKey)}}Object.freeze({CreateLookupTable:{index:0,layout:rE.struct([rE.u32("instruction"),ip("recentSlot"),rE.u8("bumpSeed")])},FreezeLookupTable:{index:1,layout:rE.struct([rE.u32("instruction")])},ExtendLookupTable:{index:2,layout:rE.struct([rE.u32("instruction"),ip(),rE.seq(nV(),rE.offset(rE.u32(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:rE.struct([rE.u32("instruction")])},CloseLookupTable:{index:4,layout:rE.struct([rE.u32("instruction")])}}),new nW("AddressLookupTab1e1111111111111111111111111"),Object.freeze({RequestUnits:{index:0,layout:rE.struct([rE.u8("instruction"),rE.u32("units"),rE.u32("additionalFee")])},RequestHeapFrame:{index:1,layout:rE.struct([rE.u8("instruction"),rE.u32("bytes")])},SetComputeUnitLimit:{index:2,layout:rE.struct([rE.u8("instruction"),rE.u32("units")])},SetComputeUnitPrice:{index:3,layout:rE.struct([rE.u8("instruction"),ip("microLamports")])}}),new nW("ComputeBudget111111111111111111111111111111");let o4=rE.struct([rE.u8("numSignatures"),rE.u8("padding"),rE.u16("signatureOffset"),rE.u16("signatureInstructionIndex"),rE.u16("publicKeyOffset"),rE.u16("publicKeyInstructionIndex"),rE.u16("messageDataOffset"),rE.u16("messageDataSize"),rE.u16("messageInstructionIndex")]);class o7{static createInstructionWithPublicKey(t){let{publicKey:e,message:r,signature:n,instructionIndex:i}=t;nY(32===e.length,`Public Key must be 32 bytes but received ${e.length} bytes`),nY(64===n.length,`Signature must be 64 bytes but received ${n.length} bytes`);let o=o4.span,s=o+e.length,a=s+n.length,l=Y.Buffer.alloc(a+r.length),u=null==i?65535:i;return o4.encode({numSignatures:1,padding:0,signatureOffset:s,signatureInstructionIndex:u,publicKeyOffset:o,publicKeyInstructionIndex:u,messageDataOffset:a,messageDataSize:r.length,messageInstructionIndex:u},l),l.fill(e,o),l.fill(n,s),l.fill(r,a),new n8({keys:[],programId:o7.programId,data:l})}static createInstructionWithPrivateKey(t){let{privateKey:e,message:r,instructionIndex:n}=t;nY(64===e.length,`Private key must be 64 bytes but received ${e.length} bytes`);try{let t=o8.fromSecretKey(e),i=t.publicKey.toBytes(),o=nP(r,t.secretKey);return this.createInstructionWithPublicKey({publicKey:i,message:r,signature:o,instructionIndex:n})}catch(t){throw Error(`Error creating instruction; ${t}`)}}}o7.programId=new nW("Ed25519SigVerify111111111111111111111111111"),nM.utils.isValidPrivateKey;let o9=nM.getPublicKey,st=rE.struct([rE.u8("numSignatures"),rE.u16("signatureOffset"),rE.u8("signatureInstructionIndex"),rE.u16("ethAddressOffset"),rE.u8("ethAddressInstructionIndex"),rE.u16("messageDataOffset"),rE.u16("messageDataSize"),rE.u8("messageInstructionIndex"),rE.blob(20,"ethAddress"),rE.blob(64,"signature"),rE.u8("recoveryId")]);class se{static publicKeyToEthAddress(t){nY(64===t.length,`Public key must be 64 bytes but received ${t.length} bytes`);try{return Y.Buffer.from(nu(nN(t))).slice(-20)}catch(t){throw Error(`Error constructing Ethereum address: ${t}`)}}static createInstructionWithPublicKey(t){let{publicKey:e,message:r,signature:n,recoveryId:i,instructionIndex:o}=t;return se.createInstructionWithEthAddress({ethAddress:se.publicKeyToEthAddress(e),message:r,signature:n,recoveryId:i,instructionIndex:o})}static createInstructionWithEthAddress(t){let e,{ethAddress:r,message:n,signature:i,recoveryId:o,instructionIndex:s=0}=t;nY(20===(e="string"==typeof r?r.startsWith("0x")?Y.Buffer.from(r.substr(2),"hex"):Y.Buffer.from(r,"hex"):r).length,`Address must be 20 bytes but received ${e.length} bytes`);let a=12+e.length,l=a+i.length+1,u=Y.Buffer.alloc(st.span+n.length);return st.encode({numSignatures:1,signatureOffset:a,signatureInstructionIndex:s,ethAddressOffset:12,ethAddressInstructionIndex:s,messageDataOffset:l,messageDataSize:n.length,messageInstructionIndex:s,signature:nN(i),ethAddress:nN(e),recoveryId:o},u),u.fill(nN(n),st.span),new n8({keys:[],programId:se.programId,data:u})}static createInstructionWithPrivateKey(t){let{privateKey:e,message:r,instructionIndex:n}=t;nY(32===e.length,`Private key must be 32 bytes but received ${e.length} bytes`);try{var i;let t,o=nN(e),s=o9(o,!1).slice(1),[a,l]=(i=Y.Buffer.from(nu(nN(r))),[(t=nM.sign(i,o)).toCompactRawBytes(),t.recovery]);return this.createInstructionWithPublicKey({publicKey:s,message:r,signature:a,recoveryId:l,instructionIndex:n})}catch(t){throw Error(`Error creating instruction; ${t}`)}}}se.programId=new nW("KeccakSecp256k11111111111111111111111111111");let sr=new nW("StakeConfig11111111111111111111111111111111");class sn{constructor(t,e,r){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=t,this.epoch=e,this.custodian=r}}sn.default=new sn(0,0,nW.default);let si=Object.freeze({Initialize:{index:0,layout:rE.struct([rE.u32("instruction"),((t="authorized")=>rE.struct([nV("staker"),nV("withdrawer")],t))(),((t="lockup")=>rE.struct([rE.ns64("unixTimestamp"),rE.ns64("epoch"),nV("custodian")],t))()])},Authorize:{index:1,layout:rE.struct([rE.u32("instruction"),nV("newAuthorized"),rE.u32("stakeAuthorizationType")])},Delegate:{index:2,layout:rE.struct([rE.u32("instruction")])},Split:{index:3,layout:rE.struct([rE.u32("instruction"),rE.ns64("lamports")])},Withdraw:{index:4,layout:rE.struct([rE.u32("instruction"),rE.ns64("lamports")])},Deactivate:{index:5,layout:rE.struct([rE.u32("instruction")])},Merge:{index:7,layout:rE.struct([rE.u32("instruction")])},AuthorizeWithSeed:{index:8,layout:rE.struct([rE.u32("instruction"),nV("newAuthorized"),rE.u32("stakeAuthorizationType"),n$("authoritySeed"),nV("authorityOwner")])}});Object.freeze({Staker:{index:0},Withdrawer:{index:1}});class so{static initialize(t){let{stakePubkey:e,authorized:r,lockup:n}=t,i=n||sn.default,o=il(si.Initialize,{authorized:{staker:nN(r.staker.toBuffer()),withdrawer:nN(r.withdrawer.toBuffer())},lockup:{unixTimestamp:i.unixTimestamp,epoch:i.epoch,custodian:nN(i.custodian.toBuffer())}});return new n8({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:ie,isSigner:!1,isWritable:!1}],programId:this.programId,data:o})}static createAccountWithSeed(t){let e=new n4;e.add(im.createAccountWithSeed({fromPubkey:t.fromPubkey,newAccountPubkey:t.stakePubkey,basePubkey:t.basePubkey,seed:t.seed,lamports:t.lamports,space:this.space,programId:this.programId}));let{stakePubkey:r,authorized:n,lockup:i}=t;return e.add(this.initialize({stakePubkey:r,authorized:n,lockup:i}))}static createAccount(t){let e=new n4;e.add(im.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.stakePubkey,lamports:t.lamports,space:this.space,programId:this.programId}));let{stakePubkey:r,authorized:n,lockup:i}=t;return e.add(this.initialize({stakePubkey:r,authorized:n,lockup:i}))}static delegate(t){let{stakePubkey:e,authorizedPubkey:r,votePubkey:n}=t,i=il(si.Delegate);return new n4().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!1},{pubkey:n9,isSigner:!1,isWritable:!1},{pubkey:ir,isSigner:!1,isWritable:!1},{pubkey:sr,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static authorize(t){let{stakePubkey:e,authorizedPubkey:r,newAuthorizedPubkey:n,stakeAuthorizationType:i,custodianPubkey:o}=t,s=il(si.Authorize,{newAuthorized:nN(n.toBuffer()),stakeAuthorizationType:i.index}),a=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n9,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}];return o&&a.push({pubkey:o,isSigner:!0,isWritable:!1}),new n4().add({keys:a,programId:this.programId,data:s})}static authorizeWithSeed(t){let{stakePubkey:e,authorityBase:r,authoritySeed:n,authorityOwner:i,newAuthorizedPubkey:o,stakeAuthorizationType:s,custodianPubkey:a}=t,l=il(si.AuthorizeWithSeed,{newAuthorized:nN(o.toBuffer()),stakeAuthorizationType:s.index,authoritySeed:n,authorityOwner:nN(i.toBuffer())}),u=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1},{pubkey:n9,isSigner:!1,isWritable:!1}];return a&&u.push({pubkey:a,isSigner:!0,isWritable:!1}),new n4().add({keys:u,programId:this.programId,data:l})}static splitInstruction(t){let{stakePubkey:e,authorizedPubkey:r,splitStakePubkey:n,lamports:i}=t,o=il(si.Split,{lamports:i});return new n8({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static split(t,e){let r=new n4;return r.add(im.createAccount({fromPubkey:t.authorizedPubkey,newAccountPubkey:t.splitStakePubkey,lamports:e,space:this.space,programId:this.programId})),r.add(this.splitInstruction(t))}static splitWithSeed(t,e){let{stakePubkey:r,authorizedPubkey:n,splitStakePubkey:i,basePubkey:o,seed:s,lamports:a}=t,l=new n4;return l.add(im.allocate({accountPubkey:i,basePubkey:o,seed:s,space:this.space,programId:this.programId})),e&&e>0&&l.add(im.transfer({fromPubkey:t.authorizedPubkey,toPubkey:i,lamports:e})),l.add(this.splitInstruction({stakePubkey:r,authorizedPubkey:n,splitStakePubkey:i,lamports:a}))}static merge(t){let{stakePubkey:e,sourceStakePubKey:r,authorizedPubkey:n}=t,i=il(si.Merge);return new n4().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:n9,isSigner:!1,isWritable:!1},{pubkey:ir,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static withdraw(t){let{stakePubkey:e,authorizedPubkey:r,toPubkey:n,lamports:i,custodianPubkey:o}=t,s=il(si.Withdraw,{lamports:i}),a=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:n9,isSigner:!1,isWritable:!1},{pubkey:ir,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return o&&a.push({pubkey:o,isSigner:!0,isWritable:!1}),new n4().add({keys:a,programId:this.programId,data:s})}static deactivate(t){let{stakePubkey:e,authorizedPubkey:r}=t,n=il(si.Deactivate);return new n4().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n9,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:n})}}so.programId=new nW("Stake11111111111111111111111111111111111111"),so.space=200;let ss=Object.freeze({InitializeAccount:{index:0,layout:rE.struct([rE.u32("instruction"),((t="voteInit")=>rE.struct([nV("nodePubkey"),nV("authorizedVoter"),nV("authorizedWithdrawer"),rE.u8("commission")],t))()])},Authorize:{index:1,layout:rE.struct([rE.u32("instruction"),nV("newAuthorized"),rE.u32("voteAuthorizationType")])},Withdraw:{index:3,layout:rE.struct([rE.u32("instruction"),rE.ns64("lamports")])},UpdateValidatorIdentity:{index:4,layout:rE.struct([rE.u32("instruction")])},AuthorizeWithSeed:{index:10,layout:rE.struct([rE.u32("instruction"),((t="voteAuthorizeWithSeedArgs")=>rE.struct([rE.u32("voteAuthorizationType"),nV("currentAuthorityDerivedKeyOwnerPubkey"),n$("currentAuthorityDerivedKeySeed"),nV("newAuthorized")],t))()])}});Object.freeze({Voter:{index:0},Withdrawer:{index:1}});class sa{static initializeAccount(t){let{votePubkey:e,nodePubkey:r,voteInit:n}=t,i=il(ss.InitializeAccount,{voteInit:{nodePubkey:nN(n.nodePubkey.toBuffer()),authorizedVoter:nN(n.authorizedVoter.toBuffer()),authorizedWithdrawer:nN(n.authorizedWithdrawer.toBuffer()),commission:n.commission}});return new n8({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:ie,isSigner:!1,isWritable:!1},{pubkey:n9,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static createAccount(t){let e=new n4;return e.add(im.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.votePubkey,lamports:t.lamports,space:this.space,programId:this.programId})),e.add(this.initializeAccount({votePubkey:t.votePubkey,nodePubkey:t.voteInit.nodePubkey,voteInit:t.voteInit}))}static authorize(t){let{votePubkey:e,authorizedPubkey:r,newAuthorizedPubkey:n,voteAuthorizationType:i}=t,o=il(ss.Authorize,{newAuthorized:nN(n.toBuffer()),voteAuthorizationType:i.index});return new n4().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n9,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static authorizeWithSeed(t){let{currentAuthorityDerivedKeyBasePubkey:e,currentAuthorityDerivedKeyOwnerPubkey:r,currentAuthorityDerivedKeySeed:n,newAuthorizedPubkey:i,voteAuthorizationType:o,votePubkey:s}=t,a=il(ss.AuthorizeWithSeed,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:nN(r.toBuffer()),currentAuthorityDerivedKeySeed:n,newAuthorized:nN(i.toBuffer()),voteAuthorizationType:o.index}});return new n4().add({keys:[{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:n9,isSigner:!1,isWritable:!1},{pubkey:e,isSigner:!0,isWritable:!1}],programId:this.programId,data:a})}static withdraw(t){let{votePubkey:e,authorizedWithdrawerPubkey:r,lamports:n,toPubkey:i}=t,o=il(ss.Withdraw,{lamports:n});return new n4().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static safeWithdraw(t,e,r){if(t.lamports>e-r)throw Error("Withdraw will leave vote account with insufficient funds.");return sa.withdraw(t)}static updateValidatorIdentity(t){let{votePubkey:e,authorizedWithdrawerPubkey:r,nodePubkey:n}=t,i=il(ss.UpdateValidatorIdentity);return new n4().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}}sa.programId=new nW("Vote111111111111111111111111111111111111111"),sa.space=3762,new nW("Va1idator1nfo111111111111111111111111111111"),rZ({name:rV(),website:rK(rV()),details:rK(rV()),iconUrl:rK(rV()),keybaseUsername:rK(rV())}),new nW("Vote111111111111111111111111111111111111111"),rE.struct([nV("nodePubkey"),nV("authorizedWithdrawer"),rE.u8("commission"),rE.nu64(),rE.seq(rE.struct([rE.nu64("slot"),rE.u32("confirmationCount")]),rE.offset(rE.u32(),-8),"votes"),rE.u8("rootSlotValid"),rE.nu64("rootSlot"),rE.nu64(),rE.seq(rE.struct([rE.nu64("epoch"),nV("authorizedVoter")]),rE.offset(rE.u32(),-8),"authorizedVoters"),rE.struct([rE.seq(rE.struct([nV("authorizedPubkey"),rE.nu64("epochOfLastAuthorizedSwitch"),rE.nu64("targetEpoch")]),32,"buf"),rE.nu64("idx"),rE.u8("isEmpty")],"priorVoters"),rE.nu64(),rE.seq(rE.struct([rE.nu64("epoch"),rE.nu64("credits"),rE.nu64("prevCredits")]),rE.offset(rE.u32(),-8),"epochCredits"),rE.struct([rE.nu64("slot"),rE.nu64("timestamp")],"lastTimestamp")]);let sl=(0,G.createContext)({}),su=({children:t,endpoint:e,config:r={commitment:"confirmed"}})=>{let n=(0,G.useMemo)(()=>new o3(e,r),[e,r]);return G.default.createElement(sl.Provider,{value:{connection:n}},t)};var sc=rX;
7class sh extends Error{constructor(t,e){super(t),this.error=e}}class sf extends sh{constructor(){super(...arguments),this.name="WalletNotReadyError"}}class sd extends sh{constructor(){super(...arguments),this.name="WalletConfigError"}}class sp extends sh{constructor(){super(...arguments),this.name="WalletConnectionError"}}class sg extends sh{constructor(){super(...arguments),this.name="WalletDisconnectedError"}}class sm extends sh{constructor(){super(...arguments),this.name="WalletDisconnectionError"}}class sy extends sh{constructor(){super(...arguments),this.name="WalletAccountError"}}class sb extends sh{constructor(){super(...arguments),this.name="WalletPublicKeyError"}}class sw extends sh{constructor(){super(...arguments),this.name="WalletNotConnectedError"}}class sv extends sh{constructor(){super(...arguments),this.name="WalletSendTransactionError"}}class sx extends sh{constructor(){super(...arguments),this.name="WalletSignTransactionError"}}class sE extends sh{constructor(){super(...arguments),this.name="WalletSignMessageError"}}class sS extends sh{constructor(){super(...arguments),this.name="WalletSignInError"}}(c=p||(p={})).Installed="Installed",c.NotDetected="NotDetected",c.Loadable="Loadable",c.Unsupported="Unsupported";class sk extends sc.default{get connected(){return!!this.publicKey}async autoConnect(){await this.connect()}async prepareTransaction(t,e,r={}){let n=this.publicKey;if(!n)throw new sw;return t.feePayer=t.feePayer||n,t.recentBlockhash=t.recentBlockhash||(await e.getLatestBlockhash({commitment:r.preflightCommitment,minContextSlot:r.minContextSlot})).blockhash,t}}function sA(t){return"version"in t}class sI extends sk{async sendTransaction(t,e,r={}){let n=!0;try{if(sA(t)){if(!this.supportedTransactionVersions)throw new sv("Sending versioned transactions isn't supported by this wallet");if(!this.supportedTransactionVersions.has(t.version))throw new sv(`Sending transaction version ${t.version} isn't supported by this wallet`);try{let n=(t=await this.signTransaction(t)).serialize();return await e.sendRawTransaction(n,r)}catch(t){if(t instanceof sx)throw n=!1,t;throw new sv(t?.message,t)}}try{let{signers:n,...i}=r;t=await this.prepareTransaction(t,e,i),n?.length&&t.partialSign(...n);let o=(t=await this.signTransaction(t)).serialize();return await e.sendRawTransaction(o,i)}catch(t){if(t instanceof sx)throw n=!1,t;throw new sv(t?.message,t)}}catch(t){throw n&&this.emit("error",t),t}}async signAllTransactions(t){for(let e of t)if(sA(e)){if(!this.supportedTransactionVersions)throw new sx("Signing versioned transactions isn't supported by this wallet");if(!this.supportedTransactionVersions.has(e.version))throw new sx(`Signing transaction version ${e.version} isn't supported by this wallet`)}let e=[];for(let r of t)e.push(await this.signTransaction(r));return e}}class sB extends sI{}class s_ extends sB{}let sM="solana:signAndSendTransaction",sC="solana:signIn",sT="solana:signMessage",sL="solana:signTransaction";function sR([t,e]){return`${t}=${function t(e){return Array.isArray(e)?"%5B"+e.map(t).join("%2C%20")+"%5D":"bigint"==typeof e?`${e}n`:encodeURIComponent(String(null!=e&&null===Object.getPrototypeOf(e)?{...e}:e))}(e)}`}var sO=class extends Error{cause=this.cause;context;constructor(...[t,e]){let r,n;e&&Object.entries(Object.getOwnPropertyDescriptors(e)).forEach(([e,i])=>{"cause"===e?n={cause:i.value}:(void 0===r&&(r={__code:t}),Object.defineProperty(r,e,i))}),super(function(t,e={}){{let r=`Solana error #${t}; Decode this error by running \`npx @solana/errors decode -- ${t}`;return Object.keys(e).length&&(r+=` '${btoa(Object.entries(e).map(sR).join("&"))}'`),`${r}\``}}(t,r),n),this.context=Object.freeze(void 0===r?{__code:t}:r),this.name="SolanaError"}};function sP(t){return Object.freeze({...t,encode:e=>{let r=new Uint8Array("fixedSize"in t?t.fixedSize:t.getSizeFromValue(e));return t.write(e,r,0),r}})}function sU(t){return Object.freeze({...t,decode:(e,r=0)=>t.read(e,r)[0]})}function sN(t,e){let[r,n]=t.split(RegExp(`((?!${e}).*)`));return[r,n]}function sz(t,e){let r=BigInt(e.length),n=0n;for(let i of t)n*=r,n+=BigInt(e.indexOf(i));return n}var sq="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",sD="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
7+/",sW=()=>sU({read:(t,e=0)=>[btoa(String.fromCharCode(...t.slice(e))),t.length]}),sF=globalThis.TextDecoder,sj=globalThis.TextEncoder,sK=()=>{let t;return sP({getSizeFromValue:e=>(t||=new sj).encode(e).length,write:(e,r,n)=>{let i=(t||=new sj).encode(e);return r.set(i,n),n+i.length}})};function sH(t,e){let r=sW().decode(t);return e?r.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""):r}function sV(t){return sP({getSizeFromValue:t=>{try{return atob(t).length}catch{throw new sO(8078012,{alphabet:sD,base:64,value:t})}},write(t,e,r){try{let n=atob(t).split("").map(t=>t.charCodeAt(0));return e.set(n,r),n.length+r}catch{throw new sO(8078012,{alphabet:sD,base:64,value:t})}}}).encode(t)}function s$(t){return sU({read(t,e){let r=0===e||e<=-t.byteLength?t:t.slice(e);if(0===r.length)return["",0];let n=r.findIndex(t=>0!==t);n=-1===n?r.length:n;let i=sq[0].repeat(n);return n===r.length?[i,t.length]:[i+function(t,e){let r=BigInt(e.length),n=[];for(;t>0n;)n.unshift(e[Number(t%r)]),t/=r;return n.join("")}(r.slice(n).reduce((t,e)=>256n*t+BigInt(e),0n),sq),t.length]}}).decode(t)}function sZ(t){return sV(t)}let sG="solana:mainnet";Event,new WeakMap;RegExp("^(?<domain>[^\\n]+?) wants you to sign in with your Solana account:\\n(?<address>[^\\n]+)(?:\\n|$)(?:\\n(?<statement>[\\S\\s]*?)(?:\\n|$))??(?:\\nURI: (?<uri>[^\\n]+))?(?:\\nVersion: (?<version>[^\\n]+))?(?:\\nChain ID: (?<chainId>[^\\n]+))?(?:\\nNonce: (?<nonce>[^\\n]+))?(?:\\nIssued At: (?<issuedAt>[^\\n]+))?(?:\\nExpiration Time: (?<expirationTime>[^\\n]+))?(?:\\nNot Before: (?<notBefore>[^\\n]+))?(?:\\nRequest ID: (?<requestId>[^\\n]+))?(?:\\nResources:(?<resources>(?:\\n- [^\\n]+)*))?\\n*$");let sY="ERROR_FORBIDDEN_WALLET_BASE_URL",sQ="ERROR_SESSION_CLOSED",sJ="ERROR_LOOPBACK_ACCESS_BLOCKED",sX="ERROR_ASSOCIATION_CANCELLED";var s0=class extends Error{data;code;constructor(...t){const[e,r,n]=t;super(r),this.code=e,this.data=n,this.name="SolanaMobileWalletAdapterError"}},s1=class extends Error{data;code;jsonRpcMessageId;constructor(...t){const[e,r,n,i]=t;super(n),this.code=r,this.data=i,this.jsonRpcMessageId=e,this.name="SolanaMobileWalletAdapterProtocolError"}};async function s2(t,e){let r=await crypto.subtle.exportKey("raw",t),n=await crypto.subtle.sign({hash:"SHA-256",name:"ECDSA"},e,r),i=new Uint8Array(r.byteLength+n.byteLength);return i.set(new Uint8Array(r),0),i.set(new Uint8Array(n),r.byteLength),i}let s6="solana:cloneAuthorization";async function s5(t,e,r){var n;let i=t.domain??window.location.host,o=e.accounts[0].address,s=(n=function(t){let e=`${t.domain} wants you to sign in with your Solana account:
8`;e+=`${t.address}`,t.statement&&(e+=`
9
10${t.statement}`);let r=[];if(t.uri&&r.push(`URI: ${t.uri}`),t.version&&r.push(`Version: ${t.version}`),t.chainId&&r.push(`Chain ID: ${t.chainId}`),t.nonce&&r.push(`Nonce: ${t.nonce}`),t.issuedAt&&r.push(`Issued At: ${t.issuedAt}`),t.expirationTime&&r.push(`Expiration Time: ${t.expirationTime}`),t.notBefore&&r.push(`Not Before: ${t.notBefore}`),t.requestId&&r.push(`Request ID: ${t.requestId}`),t.resources)for(let e of(r.push("Resources:"),t.resources))r.push(`- ${e}`);return r.length&&(e+=`
11
12${r.join("\n")}`),e}({...t,domain:i,address:s$(sV(o))}),sW().decode(sK().encode(n))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""),a=sV((await r("sign_messages",{addresses:[o],payloads:[s]})).signed_payloads[0]),l=sH(a.slice(0,a.length-64)),u=sH(a.slice(a.length-64));return{address:o,signed_message:0==l.length?s:l,signature:u}}async function s3(t,e,r){let n=function(t){if(t>=0x100000000)throw Error("Outbound sequence number overflow. The maximum sequence number is 32-bytes.");let e=new ArrayBuffer(4);return new DataView(e).setUint32(0,t,!1),new Uint8Array(e)}(e),i=new Uint8Array(12);crypto.getRandomValues(i);let o=await crypto.subtle.encrypt(s4(n,i),r,sK().encode(t)),s=new Uint8Array(n.byteLength+i.byteLength+o.byteLength);return s.set(new Uint8Array(n),0),s.set(new Uint8Array(i),n.byteLength),s.set(new Uint8Array(o),n.byteLength+i.byteLength),s}async function s8(t,e){var r;let n,i=t.slice(0,4),o=t.slice(4,16),s=t.slice(16);return r=new Uint8Array(await crypto.subtle.decrypt(s4(i,o),e,s)),sU({read:(t,e)=>[(n||=new sF).decode(t.slice(e)).replace(/\u0000/g,""),t.length]}).decode(r)}function s4(t,e){return{additionalData:t,iv:e,name:"AES-GCM",tagLength:128}}async function s7(){return await crypto.subtle.generateKey({name:"ECDSA",namedCurve:"P-256"},!1,["sign"])}async function s9(){return await crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!1,["deriveKey","deriveBits"])}function at(t){if(t<49152||t>65535)throw new s0("ERROR_ASSOCIATION_PORT_OUT_OF_RANGE",`Association port number must be between 49152 and 65535. ${t} given.`,{port:t});return t}function ae(t){return t.replace(/(^\/+|\/+$)/g,"").split("/")}async function ar(t,e,r,n=["v1"]){let i=at(e),o=sH(new Uint8Array(await crypto.subtle.exportKey("raw",t))),s=function(t,e){let r=null;if(e){try{r=new URL(e)}catch{}if(r?.protocol!=="https:")throw new s0(sY,"Base URLs supplied by wallets must be valid `https` URLs")}return r||=new URL("solana-wallet:/"),new URL(t.startsWith("/")?t:[...ae(r.pathname),...ae(t)].join("/"),r)}("v1/associate/local",r);return s.searchParams.set("association",o.replace(/[/+=]/g,t=>({"/":"_","+":"-","=":"."})[t])),s.searchParams.set("port",`${i}
12`),n.forEach(t=>{s.searchParams.set("v",t)}),s}async function an(t,e){return s3(JSON.stringify(t),t.id,e)}async function ai(t,e){let r=JSON.parse(await s8(t,e));if(Object.hasOwnProperty.call(r,"error"))throw new s1(r.id,r.error.code,r.error.message);return r}async function ao(t,e,r){let[n,i]=await Promise.all([crypto.subtle.exportKey("raw",e),crypto.subtle.importKey("raw",t.slice(0,65),{name:"ECDH",namedCurve:"P-256"},!1,[])]),o=await crypto.subtle.deriveBits({name:"ECDH",public:i},r,256),s=await crypto.subtle.importKey("raw",o,"HKDF",!1,["deriveKey"]);return await crypto.subtle.deriveKey({name:"HKDF",hash:"SHA-256",salt:new Uint8Array(n),info:new Uint8Array},s,{name:"AES-GCM",length:128},!1,["encrypt","decrypt"])}async function as(t,e){let r=JSON.parse(await s8(t,e)),n="legacy";if(Object.hasOwnProperty.call(r,"v"))switch(r.v){case 1:case"1":case"v1":n="v1";break;case"legacy":n="legacy";break;default:throw new s0("ERROR_INVALID_PROTOCOL_VERSION",`Unknown/unsupported protocol version: ${r.v}`)}return{protocol_version:n}}let aa=null;async function al(t){if("https:"===t.protocol)window.location.assign(t);else try{switch(1*(-1===navigator.userAgent.indexOf("Firefox/"))){case 0:null==aa&&((aa=document.createElement("iframe")).style.display="none",document.body.appendChild(aa)),aa.contentWindow.location.href=t.toString();break;case 1:{let e=new Promise((t,e)=>{function r(){clearTimeout(i),window.removeEventListener("blur",n)}function n(){r(),t()}window.addEventListener("blur",n);let i=setTimeout(()=>{r(),e()},3e3)});window.location.assign(t),await e}}}catch{throw new s0("ERROR_WALLET_NOT_FOUND","Found no installed wallet that supports the mobile wallet protocol.")}}async function au(t,e){let r=at(49152+Math.floor(16384*Math.random()));return await al(await ar(t,r,e)),r}let ac=[150,150,200,500,500,750,750,1e3];function ah(t){return new DataView(t).getUint32(0,!1)}async function af(t){let e,r,n,i;if("u"<typeof window||!0!==window.isSecureContext)throw new s0("ERROR_SECURE_CONTEXT_REQUIRED","The mobile wallet adapter protocol must be used in a secure context (`https`).");let o=await s7(),s=`ws://localhost:${await au(o.publicKey,t?.baseUri)}/solana-wallet`,a=(i=[...ac],()=>i.length>1?i.shift():i[0]),l=1,u=0,c={__type:"disconnected"},h=!1;return{close:()=>{r.close(),n()},wallet:new Promise((t,i)=>{let f,d,p={},g=async()=>{if("connecting"!==c.__type)return void console.warn(`Expected adapter state to be \`connecting\` at the moment the websocket opens. Got \`${c.__type}\`.`);r.removeEventListener("open",g);let{associationKeypair:t}=c,e=await s9();r.send(await s2(e.publicKey,t.privateKey)),c={__type:"hello_req_sent",associationPublicKey:t.publicKey,ecdhPrivateKey:e.privateKey}},m=t=>{t.wasClean?c={__type:"disconnected"}:i(new s0(sQ,`The wallet session dropped unexpectedly (${t.code}: ${t.reason}).`,{closeEvent:t})),f()},y=async t=>{f(),Date.now()-e>=3e4?i(new s0("ERROR_SESSION_TIMEOUT",`Failed to connect to the wallet websocket at ${s}.`)):(await new Promise(t=>{let e=a();d=window.setTimeout(t,e)}),w())},b=async e=>{let n=await e.data.arrayBuffer();switch(c.__type){case"connecting":{if(0!==n.byteLength)throw Error("Encountered unexpected message while connecting");let t=await s9();r.send(await s2(t.publicKey,o.privateKey)),c={__type:"hello_req_sent",associationPublicKey:o.publicKey,ecdhPrivateKey:t.privateKey};break}case"connected":try{let t=ah(n.slice(0,4));if(t!==u+1)throw Error("Encrypted message has invalid sequence number");u=t;let e=await ai(n,c.sharedSecret),r=p[e.id];delete p[e.id],r.resolve(e.result)}catch(t){if(t instanceof s1){let e=p[t.jsonRpcMessageId];delete p[t.jsonRpcMessageId],e.reject(t)}else throw t}break;case"hello_req_sent":{var s,a;if(0===n.byteLength){let t=await s9();r.send(await s2(t.publicKey,o.privateKey)),c={__type:"hello_req_sent",associationPublicKey:o.publicKey,ecdhPrivateKey:t.privateKey};break}let e=await ao(n,c.associationPublicKey,c.ecdhPrivateKey),f=n.slice(65),d=0!==f.byteLength?await (async()=>{let t=ah(f.slice(0,4));if(t!==u+1)throw Error("Encrypted message has invalid sequence number");return u=t,as(f,e)})():{protocol_version:"legacy"};c={__type:"connected",sharedSecret:e,sessionProperties:d};let g=(s=d.protocol_version,a=async(t,n)=>{let i=l++;return r.send(await an({id:i,jsonrpc:"2.0",method:t,params:n??{}},e)),new Promise((e,r)=>{p[i]={resolve(n){switch(t){case"authorize":case"reauthorize":{let{wallet_uri_base:t}=n;if(null!=t)try{let e;try{e=new URL(t)}catch{throw new s0(sY,"Invalid base URL supplied by wallet")}if("https:"!==e.protocol)throw new s0(sY,"Base URLs supplied by wallets must be valid `https` URLs")}catch(t){r(t);return}}}e(n)},reject:r}})},new Proxy({},{get:(t,e)=>"then"===e?null:(null==t[e]&&(t[e]=async function(t){let{method:r,params:n}=function(t,e,r){let n=e,i=t.toString().replace(/[A-Z]/g,t=>`_${t.toLowerCase()}`).toLowerCase();switch(t){case"authorize":{let t=n,{chain:e}=t;
12if("legacy"===r){switch(e){case"solana:testnet":e="testnet";break;case"solana:devnet":e="devnet";break;case"solana:mainnet":e="mainnet-beta";break;default:e=t.cluster}t.cluster=e,n=t}else{switch(e){case"testnet":case"devnet":e=`solana:${e}`;break;case"mainnet-beta":e="solana:mainnet"}t.chain=e,n=t}}case"reauthorize":{let{auth_token:t,identity:e}=n;t&&("legacy"===r?(i="reauthorize",n={auth_token:t,identity:e}):i="authorize")}}return{method:i,params:n}}(e,t,s),i=await a(r,n);return"authorize"===r&&n.sign_in_payload&&!i.sign_in_result&&(i.sign_in_result=await s5(n.sign_in_payload,i,a)),function(t,e,r){if("getCapabilities"===t)switch(r){case"legacy":{let t=["solana:signTransactions"];return!0===e.supports_clone_authorization&&t.push(s6),{...e,features:t}}case"v1":return{...e,supports_sign_and_send_transactions:!0,supports_clone_authorization:e.features.includes(s6)}}return e}(e,i,s)}),t[e]),defineProperty:()=>!1,deleteProperty:()=>!1}));h=!0;try{t(g)}catch(t){i(t)}}}};n=()=>{r.removeEventListener("message",b),f(),h||i(new s0(sQ,"The wallet session was closed before connection.",{closeEvent:new CloseEvent("socket was closed before connection")}))};let w=()=>{f&&f(),c={__type:"connecting",associationKeypair:o},void 0===e&&(e=Date.now()),(r=new WebSocket(s,["com.solana.mobilewalletadapter.v1"])).addEventListener("open",g),r.addEventListener("close",m),r.addEventListener("error",y),r.addEventListener("message",b),f=()=>{window.clearTimeout(d),r.removeEventListener("open",g),r.removeEventListener("close",m),r.removeEventListener("error",y),r.removeEventListener("message",b)}};w()})}}let ad="standard:connect",ap="standard:disconnect",ag="standard:events";t.i(73134);let am="SolanaMobileWalletAdapterDefaultAuthorizationCache",ay=`
13<div class="mobile-wallet-adapter-embedded-modal-container" role="dialog" aria-modal="true" aria-labelledby="modal-title">
14    <div data-modal-close style="position: absolute; width: 100%; height: 100%;"></div>
15	<div class="mobile-wallet-adapter-embedded-modal-card">
16		<div>
17			<button data-modal-close class="mobile-wallet-adapter-embedded-modal-close">
18				<svg width="14" height="14">
19					<path d="M 6.7125,8.3036995 1.9082,13.108199 c -0.2113,0.2112 -0.4765,0.3168 -0.7957,0.3168 -0.3192,0 -0.5844,-0.1056 -0.7958,-0.3168 C 0.1056,12.896899 0,12.631699 0,12.312499 c 0,-0.3192 0.1056,-0.5844 0.3167,-0.7958 L 5.1212,6.7124995 0.3167,1.9082 C 0.1056,1.6969 0,1.4317 0,1.1125 0,0.7933 0.1056,0.5281 0.3167,0.3167 0.5281,0.1056 0.7933,0 1.1125,0 1.4317,0 1.6969,0.1056 1.9082,0.3167 L 6.7125,5.1212 11.5167,0.3167 C 11.7281,0.1056 11.9933,0 12.3125,0 c 0.3192,0 0.5844,0.1056 0.7957,0.3167 0.2112,0.2114 0.3168,0.4766 0.3168,0.7958 0,0.3192 -0.1056,0.5844 -0.3168,0.7957 L 8.3037001,6.7124995 13.1082,11.516699 c 0.2112,0.2114 0.3168,0.4766 0.3168,0.7958 0,0.3192 -0.1056,0.5844 -0.3168,0.7957 -0.2113,0.2112 -0.4765,0.3168 -0.7957,0.3168 -0.3192,0 -0.5844,-0.1056 -0.7958,-0.3168 z" />
20				</svg>
21			</button>
22		</div>
23		<div class="mobile-wallet-adapter-embedded-modal-content"></div>
24	</div>
25</div>
26`,ab=`
27.mobile-wallet-adapter-embedded-modal-container {
28    display: flex; /* Use flexbox to center content */
29    justify-content: center; /* Center horizontally */
30    align-items: center; /* Center vertically */
31    position: fixed; /* Stay in place */
32    z-index: 2147483647; /* Sit on top */
33    left: 0;
34    top: 0;
35    width: 100%; /* Full width */
36    height: 100%; /* Full height */
37    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
38    overflow-y: auto; /* enable scrolling */
39}
40
41.mobile-wallet-adapter-embedded-modal-card {
42    display: flex;
43    flex-direction: column;
44    margin: auto 20px;
45    max-width: 780px;
46    padding: 20px;
47    border-radius: 24px;
48    background: #ffffff;
49    font-family: "Inter Tight", "PT Sans", Calibri, sans-serif;
50    transform: translateY(-200%);
51    animation: slide-in 0.5s forwards;
52}
53
54@keyframes slide-in {
55    100% { transform: translateY(0%); }
56}
57
58.mobile-wallet-adapter-embedded-modal-close {
59    display: flex;
60    align-items: center;
61    justify-content: center;
62    width: 32px;
63    height: 32px;
64    cursor: pointer;
65    background: #e4e9e9;
66    border: none;
67    border-radius: 50%;
68}
69
70.mobile-wallet-adapter-embedded-modal-close:focus-visible {
71    outline-color: red;
72}
73
74.mobile-wallet-adapter-embedded-modal-close svg {
75    fill: #546266;
76    transition: fill 200ms ease 0s;
77}
78
79.mobile-wallet-adapter-embedded-modal-close:hover svg {
80    fill: #fff;
81}
82`,aw=`
83<link rel="preconnect" href="https://fonts.googleapis.com">
84<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
85<link href="https://fonts.googleapis.com/css2?family=Inter+Tight:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet">
86`;var av=class{#f=null;#d={};#p=!1;dom=null;constructor(){this.init=this.init.bind(this),this.#f=document.getElementById("mobile-wallet-adapter-embedded-root-ui")}async init(){console.log("Injecting modal"),this.#g()}open=()=>{console.debug("Modal open"),this.#m(),this.#f&&(this.#f.style.display="flex")};close=t=>{console.debug("Modal close"),this.#y(),this.#f&&(this.#f.style.display="none"),this.#d.close?.forEach(e=>e(t))};addEventListener(t,e){return this.#d[t]?.push(e)||(this.#d[t]=[e]),()=>this.removeEventListener(t,e)}removeEventListener(t,e){this.#d[t]=this.#d[t]?.filter(t=>e!==t)}#g(){if(document.getElementById("mobile-wallet-adapter-embedded-root-ui")){this.#f||(this.#f=document.getElementById("mobile-wallet-adapter-embedded-root-ui"));return}this.#f=document.createElement("div"),this.#f.id="mobile-wallet-adapter-embedded-root-ui",this.#f.innerHTML=ay,this.#f.style.display="none";let t=this.#f.querySelector(".mobile-wallet-adapter-embedded-modal-content");t&&(t.innerHTML=this.contentHtml);let e=document.createElement("style");e.id="mobile-wallet-adapter-embedded-modal-styles",e.textContent=ab+this.contentStyles;let r=document.createElement("div");r.innerHTML=aw,this.dom=r.attachShadow({mode:"closed"}),this.dom.appendChild(e),this.dom.appendChild(this.#f),document.body.appendChild(r)}#m(){this.#f&&!this.#p&&([...this.#f.querySelectorAll("[data-modal-close]")].forEach(t=>t?.addEventListener("click",this.close)),window.addEventListener("load",this.close),document.addEventListener("keydown",this.#b),this.#p=!0)}#y(){!this.#p||(window.removeEventListener("load",this.close),document.removeEventListener("keydown",this.#b),this.#f&&([...this.#f.querySelectorAll("[data-modal-close]")].forEach(t=>t?.removeEventListener("click",this.close)),this.#p=!1))}#b=t=>{"Escape"===t.key&&this.close(t)}},ax=class extends av{contentStyles=aS;contentHtml=aE;initWithError(t){super.init(),this.populateError(t)}populateError(t){let e=this.dom?.getElementById("mobile-wallet-adapter-error-message"),r=this.dom?.getElementById("mobile-wallet-adapter-error-action");if(e){if("SolanaMobileWalletAdapterError"===t.name)switch(t.code){case"ERROR_WALLET_NOT_FOUND":e.innerHTML="To use mobile wallet adapter, you must have a compatible mobile wallet application installed on your device.",r&&r.addEventListener("click",()=>{window.location.href="https://solanamobile.com/wallets"});return;case"ERROR_BROWSER_NOT_SUPPORTED":e.innerHTML="This browser appears to be incompatible with mobile wallet adapter. Open this page in a compatible mobile browser app and try again.",r&&(r.style.display="none");return}e.innerHTML=`An unexpected error occurred: ${t.message}`}else console.log("Failed to locate error dialog element")}};let aE=`
87<svg class="mobile-wallet-adapter-embedded-modal-error-icon" xmlns="http://www.w3.org/2000/svg" height="50px" viewBox="0 -960 960 960" width="50px" fill="#000000"><path d="M 280,-80 Q 197,-80 138.5,-138.5 80,-197 80,-280 80,-363 138.5,-421.5 197,-480 280,-480 q 83,0 141.5,58.5 58.5,58.5 58.5,141.5 0,83 -58.5,141.5 Q 363,-80 280,-80 Z M 824,-120 568,-376 Q 556,-389 542.5,-402.5 529,-416 516,-428 q 38,-24 61,-64 23,-40 23,-88 0,-75 -52.5,-127.5 Q 495,-760 420,-760 345,-760 292.5,-707.5 240,-655 240,-580 q 0,6 0.5,11.5 0.5,5.5 1.5,11.5 -18,2 -39.5,8 -21.5,6 -38.5,14 -2,-11 -3,-22 -1,-11 -1,-23 0,-109 75.5,-184.5 Q 311,-840 420,-840 q 109,0 184.5,75.5 75.5,75.5 75.5,184.5 0,43 -13.5,81.5 Q 653,-460 629,-428 l 251,252 z m -615,-61 71,-71 70,71 29,-28 -71,-71 71,-71 -28,-28 -71,71 -71,-71 -28,28 71,71 -71,71 z"/></svg>
88<div class="mobile-wallet-adapter-embedded-modal-title">We can't find a wallet.</div>
89<div id="mobile-wallet-adapter-error-message" class="mobile-wallet-adapter-embedded-modal-subtitle"></div>
90<div>
91    <button data-error-action id="mobile-wallet-adapter-error-action" class="mobile-wallet-adapter-embedded-modal-error-action">
92        Find a wallet
93    </button>
94</div>
95`,aS=`
96.mobile-wallet-adapter-embedded-modal-content {
97    text-align: center;
98}
99
100.mobile-wallet-adapter-embedded-modal-error-icon {
101    margin-top: 24px;
102}
103
104.mobile-wallet-adapter-embedded-modal-title {
105    margin: 18px 100px auto 100px;
106    color: #000000;
107    font-size: 2.75em;
108    font-weight: 600;
109}
110
111.mobile-wallet-adapter-embedded-modal-subtitle {
112    margin: 30px 60px 40px 60px;
113    color: #000000;
114    font-size: 1.25em;
115    font-weight: 400;
116}
117
118.mobile-wallet-adapter-embedded-modal-error-action {
119    display: block;
120    width: 100%;
121    height: 56px;
122    /*margin-top: 40px;*/
123    font-size: 1.25em;
124    /*line-height: 24px;*/
125    /*letter-spacing: -1%;*/
126    background: #000000;
127    color: #FFFFFF;
128    border-radius: 18px;
129}
130
131/* Smaller screens */
132@media all and (max-width: 600px) {
133    .mobile-wallet-adapter-embedded-modal-title {
134        font-size: 1.5em;
135        margin-right: 12px;
136        margin-left: 12px;
137    }
138    .mobile-wallet-adapter-embedded-modal-subtitle {
139        margin-right: 12px;
140        margin-left: 12px;
141    }
142}
143`;async function ak(){if("u">typeof window){let t=window.navigator.userAgent.toLowerCase(),e=new ax;t.includes("wv")?e.initWithError({name:"SolanaMobileWalletAdapterError",code:"ERROR_BROWSER_NOT_SUPPORTED",message:""}):e.initWithError({name:"SolanaMobileWalletAdapterError",code:"ERROR_WALLET_NOT_FOUND",message:""}),e.open()}}var aA=class extends av{contentStyles=aB;contentHtml=aI;initWithCallback(t){super.init(),this.#w(t)}#w(t){let e=this.dom?.getElementById("mobile-wallet-adapter-launch-action"),r=async()=>{e?.removeEventListener("click",r),this.close(),t()};e?.addEventListener("click",r)}};let aI=`
144<svg class="mobile-wallet-adapter-embedded-modal-launch-icon" width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
145    <path d="M21.6 48C7.2 48 0 40.8 0 26.4V21.6C0 7.2 7.2 0 21.6 0H26.4C40.8 0 48 7.2 48 21.6V26.4C48 40.8 40.8 48 26.4 48H21.6Z" fill="#15994E"/>
146    <mask id="mask0_189_522" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="8" y="8" width="32" height="32">
147        <rect x="8" y="8" width="32" height="32" fill="#D9D9D9"/>
148    </mask>
149    <g mask="url(#mask0_189_522)">
150        <mask id="mask1_189_522" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="8" y="8" width="32" height="32">
151            <rect x="8" y="8" width="32" height="32" fill="#D9D9D9"/>
152        </mask>
153        <g mask="url(#mask1_189_522)">
154            <path d="M22.1092 26.1208L19.4498 23.4615C19.1736 23.1851 18.8253 23.0468 18.4048 23.0468C17.9846 23.0468 17.6363 23.1851 17.3598 23.4615C17.0836 23.7377 16.9468 24.0861 16.9495 24.5065C16.9522 24.9267 17.0916 25.275 17.3678 25.5512L21.0405 29.2238C21.3463 29.5276 21.7031 29.6795 22.1108 29.6795C22.5184 29.6795 22.8742 29.5276 23.1782 29.2238L30.5918 21.8098C30.8683 21.5336 31.0065 21.1867 31.0065 20.7692C31.0065 20.3514 30.8683 20.0044 30.5918 19.7282C30.3156 19.4517 29.9673 19.3135 29.5468 19.3135C29.1266 19.3135 28.7784 19.4517 28.5022 19.7282L22.1092 26.1208ZM23.9998 37.6042C22.113 37.6042 20.3425 37.2473 18.6885 36.5335C17.0343 35.8197 15.5954 34.8512 14.3718 33.6278C13.1485 32.4043 12.18 30.9654 11.4662 29.3112C10.7524 27.6572 10.3955 25.8867 10.3955 23.9998C10.3955 22.113 10.7524 20.3425 11.4662 18.6885C12.18 17.0343 13.1485 15.5954 14.3718 14.3718C15.5954 13.1485 17.0343 12.18 18.6885 11.4662C20.3425 10.7524 22.113 10.3955 23.9998 10.3955C25.8867 10.3955 27.6572 10.7524 29.3112 11.4662C30.9654 12.18 32.4043 13.1485 33.6278 14.3718C34.8512 15.5954 35.8197 17.0343 36.5335 18.6885C37.2473 20.3425 37.6042 22.113 37.6042 23.9998C37.6042 25.8867 37.2473 27.6572 36.5335 29.3112C35.8197 30.9654 34.8512 32.4043 33.6278 33.6278C32.4043 34.8512 30.9654 35.8197 29.3112 36.5335C27.6572 37.2473 25.8867 37.6042 23.9998 37.6042Z" fill="white"/>
155        </g>
156    </g>
157</svg>
158<div class="mobile-wallet-adapter-embedded-modal-title">Ready to connect!</div>
159<div>
160    <button data-modal-action id="mobile-wallet-adapter-launch-action" class="mobile-wallet-adapter-embedded-modal-launch-action">
161        Connect Wallet
162    </button>
163</div>
164`,aB=`
165.mobile-wallet-adapter-embedded-modal-close {
166    display: none;
167}
168.mobile-wallet-adapter-embedded-modal-content {
169    text-align: center;
170    min-width: 300px;
171}
172.mobile-wallet-adapter-embedded-modal-launch-icon {
173    margin-top: 24px;
174}
175.mobile-wallet-adapter-embedded-modal-title {
176    margin: 18px 100px 30px 100px;
177    color: #000000;
178    font-size: 2.75em;
179    font-weight: 600;
180}
181.mobile-wallet-adapter-embedded-modal-launch-action {
182    display: block;
183    width: 100%;
184    height: 56px;
185    font-size: 1.25em;
186    background: #000000;
187    color: #FFFFFF;
188    border-radius: 18px;
189}
190/* Smaller screens */
191@media all and (max-width: 600px) {
192    .mobile-wallet-adapter-embedded-modal-title {
193        font-size: 1.5em;
194        margin-right: 12px;
195        margin-left: 12px;
196    }
197}
198`;var a_=class extends av{contentStyles=aC;get contentHtml(){let t=!function(){let t="u">typeof document&&document.referrer.startsWith("android-app://");if("u"<typeof window)return t;let e=window.matchMedia("(display-mode: standalone)").matches,r=window.matchMedia("(display-mode: fullscreen)").matches,n=window.matchMedia("(display-mode: minimal-ui)").matches;return t||e||r||n}()?"Tap the lock or settings icon in the address bar to open site settings":"Long press the app icon on your home screen to open site settings";return aM.replace("{{PERMISSION_INSTRUCTION_DETAIL}}",t)}
198async init(){super.init(),this.#w()}#w(){let t=this.dom?.getElementById("mobile-wallet-adapter-launch-action"),e=async r=>{t?.removeEventListener("click",e),this.close(r)};t?.addEventListener("click",e)}};let aM=`
199<div class="mobile-wallet-adapter-embedded-modal-header">
200    Local Wallet Connection
201</div>
202<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
203    <path d="M21.6 48C7.2 48 0 40.8 0 26.4V21.6C0 7.2 7.2 0 21.6 0H26.4C40.8 0 48 7.2 48 21.6V26.4C48 40.8 40.8 48 26.4 48H21.6Z" fill="#ED1515"/>
204    <mask id="mask0_147_1364" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="8" y="8" width="32" height="32">
205        <rect x="8" y="8" width="32" height="32" fill="#D9D9D9"/>
206    </mask>
207    <g mask="url(#mask0_147_1364)">
208        <path d="M20.1398 36.2705C19.7363 36.2705 19.3508 36.1945 18.9835 36.0425C18.6162 35.8907 18.2916 35.674 18.0098 35.3922L12.6072 29.9895C12.3254 29.7077 12.1086 29.3832 11.9568 29.0158C11.8048 28.6485 11.7288 28.2631 11.7288 27.8595V20.1395C11.7288 19.736 11.8048 19.3505 11.9568 18.9832C12.1086 18.6158 12.3254 18.2913 12.6072 18.0095L18.0098 12.6068C18.2916 12.3251 18.6162 12.1083 18.9835 11.9565C19.3508 11.8045 19.7363 11.7285 20.1398 11.7285H27.8598C28.2634 11.7285 28.6488 11.8045 29.0162 11.9565C29.3835 12.1083 29.708 12.3251 29.9898 12.6068L35.3925 18.0095C35.6743 18.2913 35.891 18.6158 36.0428 18.9832C36.1948 19.3505 36.2708 19.736 36.2708 20.1395V27.8595C36.2708 28.2631 36.1948 28.6485 36.0428 29.0158C35.891 29.3832 35.6743 29.7077 35.3925 29.9895L29.9898 35.3922C29.708 35.674 29.3835 35.8907 29.0162 36.0425C28.6488 36.1945 28.2634 36.2705 27.8598 36.2705H20.1398ZM20.1732 33.2372H27.8265L33.2375 27.8262V20.1728L27.8265 14.7618H20.1732L14.7622 20.1728V27.8262L20.1732 33.2372ZM23.9998 25.9538L26.7868 28.7408C27.0473 29.0013 27.3729 29.1302 27.7638 29.1275C28.1549 29.1248 28.4807 28.9933 28.7412 28.7328C29.0016 28.4724 29.1318 28.1466 29.1318 27.7555C29.1318 27.3646 29.0016 27.039 28.7412 26.7785L25.9542 23.9995L28.7412 21.2125C29.0016 20.9521 29.1318 20.6264 29.1318 20.2355C29.1318 19.8444 29.0016 19.5186 28.7412 19.2582C28.4807 18.9977 28.1549 18.8675 27.7638 18.8675C27.3729 18.8675 27.0473 18.9977 26.7868 19.2582L23.9998 22.0452L21.2128 19.2582C20.9524 18.9977 20.628 18.8675 20.2398 18.8675C19.8514 18.8675 19.5269 18.9977 19.2665 19.2582C19.006 19.5186 18.8758 19.8444 18.8758 20.2355C18.8758 20.6264 19.006 20.9521 19.2665 21.2125L22.0455 23.9995L19.2585 26.7865C18.998 27.047 18.8692 27.3713 18.8718 27.7595C18.8745 28.148 19.006 28.4724 19.2665 28.7328C19.5269 28.9933 19.8527 29.1235 20.2438 29.1235C20.6347 29.1235 20.9604 28.9933 21.2208 28.7328L23.9998 25.9538Z" fill="black"/>
209    </g>
210</svg>
211<div class="mobile-wallet-adapter-embedded-modal-title">
212    Your wallet connection is blocked
213</div>
214<div id="mobile-wallet-adapter-local-launch-message" class="mobile-wallet-adapter-embedded-modal-subtitle">
215    Visit site settings in the address bar and allow "Apps on Device".
216</div>
217
218<div class="mobile-wallet-adapter-embedded-modal-divider"><hr></div>
219<div class="mobile-wallet-adapter-embedded-modal-footer">
220    <div class="mobile-wallet-adapter-embedded-modal-details">
221        <!-- Clickable header (label associated with the checkbox) -->
222      	<label for="collapsible-1" class="mobile-wallet-adapter-embedded-modal-details-collapsible-header">
223            <!-- Hidden checkbox to track state -->
224            <input type="checkbox" id="collapsible-1" class="mobile-wallet-adapter-embedded-modal-details-collapsible-input">
225            <span class="mobile-wallet-adapter-embedded-modal-details-collapsible-header-label">
226              See details
227            </span>
228            <svg class="mobile-wallet-adapter-embedded-modal-details-collapsible-header-icon" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
229              <mask id="mask0_147_1382" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="24">
230                <rect width="24" height="24" fill="#D9D9D9"/>
231              </mask>
232              <g mask="url(#mask0_147_1382)">
233                <path d="M11.9999 17.0811C11.8506 17.0811 11.7087 17.0563 11.5741 17.0067C11.4395 16.957 11.3162 16.8762 11.2042 16.7643L6.57924 12.1393C6.36801 11.9281 6.26656 11.66
2337 6.27489 11.3561C6.28322 11.0453 6.39301 10.7842 6.60424 10.573C6.81547 10.3618 7.08069 10.2561 7.39989 10.2561C7.71909 10.2561 7.9843 10.3618 8.19554 10.573L11.9999 14.3773L15.8292 10.548C16.0405 10.3368 16.3015 10.2353 16.6124 10.2436C16.9233 10.252 17.1843 10.3618 17.3955 10.573C17.6068 10.7842 17.7124 11.0494 17.7124 11.3686C17.7124 11.6878 17.6068 11.9531 17.3955 12.1643L12.7955 16.7643C12.6836 16.8762 12.5603 16.957 12.4257 17.0067C12.2911 17.0563 12.1492 17.0811 11.9999 17.0811Z" fill="black"/>
234              </g>
235            </svg>
236      	</label>
237        
238        <!-- Content to show/hide -->
239        <ul class="mobile-wallet-adapter-embedded-modal-details-collapsible-content">
240            <li>{{PERMISSION_INSTRUCTION_DETAIL}}</li>
241            <li>Allow "Apps on Device"</li>
242        </ul>
243    </div>
244</div>
245<div>
246    <button data-modal-action id="mobile-wallet-adapter-launch-action" class="mobile-wallet-adapter-embedded-modal-launch-action">
247        Got it
248    </button>
249</div>
250`,aC=`
251.mobile-wallet-adapter-embedded-modal-close {
252    display: none;
253}
254.mobile-wallet-adapter-embedded-modal-content {
255    text-align: center;
256}
257.mobile-wallet-adapter-embedded-modal-header {
258    margin: 18px auto 30px auto;
259    color: #7D9093;
260    font-size: 1.0em;
261    font-weight: 500;
262}
263.mobile-wallet-adapter-embedded-modal-title {
264    margin: 18px 100px auto 100px;
265    color: #000000;
266    font-size: 2.75em;
267    font-weight: 600;
268}
269.mobile-wallet-adapter-embedded-modal-subtitle {
270    margin: 12px 60px 30px 60px;
271    color: #7D9093;
272    font-size: 1.25em;
273    font-weight: 400;
274}
275.mobile-wallet-adapter-embedded-modal-details-collapsible-header {
276    display: flex;
277    flex-direction: row;
278  	justify-content: space-between;
279    margin: 10px auto 10px auto;
280    color: #000000;
281    font-size: 1.5em;
282    font-weight: 600;
283    cursor: pointer; /* Show pointer on hover */
284    transition: background 0.2s ease; /* Smooth background change */
285}
286.mobile-wallet-adapter-embedded-modal-details-collapsible-header-icon {
287  	transition: rotate 0.3s ease;
288}
289.mobile-wallet-adapter-embedded-modal-details-collapsible-input {
290  	display: none; /* Hide the checkbox */
291}
292.mobile-wallet-adapter-embedded-modal-details-collapsible-content {
293    margin: 0px auto 40px auto;
294    max-height: 0px; /* Collapse content */
295    overflow: hidden; /* Hide overflow when collapsed */
296    transition: max-height 0.3s ease; /* Smooth transition */
297}
298.mobile-wallet-adapter-embedded-modal-details-collapsible-content li {
299    margin: 20px auto;
300    color: #000000;
301    font-size: 1.25em;
302    font-weight: 400;
303    text-align: left;
304}
305/* When checkbox is checked, show content */
306.mobile-wallet-adapter-embedded-modal-details-collapsible-header:has(> input:checked) ~ .mobile-wallet-adapter-embedded-modal-details-collapsible-content {
307  	max-height: 300px;
308}
309.mobile-wallet-adapter-embedded-modal-details-collapsible-header:has(> input:checked) > .mobile-wallet-adapter-embedded-modal-details-collapsible-header-icon {
310  	rotate: 180deg;
311}
312.mobile-wallet-adapter-embedded-modal-launch-action {
313    display: block;
314    width: 100%;
315    height: 56px;
316    /*margin-top: 40px;*/
317    font-size: 1.25em;
318    /*line-height: 24px;*/
319    /*letter-spacing: -1%;*/
320    background: #000000;
321    color: #FFFFFF;
322    border-radius: 18px;
323}
324/* Smaller screens */
325@media all and (max-width: 600px) {
326    .mobile-wallet-adapter-embedded-modal-title {
327        font-size: 1.75em;
328        margin-right: 12px;
329        margin-left: 12px;
330    }
331    .mobile-wallet-adapter-embedded-modal-subtitle {
332        margin-right: 12px;
333        margin-left: 12px;
334    }
335}
336`;var aT=class extends av{contentStyles=aR;contentHtml=aL;async init(){super.init(),this.#w()}#w(){let t=this.dom?.getElementById("mobile-wallet-adapter-launch-action"),e=async()=>{t?.removeEventListener("click",e);try{await fetch("http://localhost")}catch{}this.close()};t?.addEventListener("click",e)}};let aL=`
337<div class="mobile-wallet-adapter-embedded-modal-title">Allow connections to your wallet</div>
338<div id="mobile-wallet-adapter-local-launch-message" class="mobile-wallet-adapter-embedded-modal-subtitle">
339    Tap "Allow" on the next screen
340</div>
341<svg class="mobile-wallet-adapter-embedded-modal-permission-prompt-mock" xmlns="http://www.w3.org/2000/svg" width="281" height="83" viewBox="0 0 281 83" fill="none">
342    <rect width="281" height="83" rx="22" fill="#F0F3F5"/>
343    <path d="M254.194 64L252.626 56.657H254.047L254.866 61.452L254.985 62.278H255.02L255.146 61.452L255.993 57.497H257.4L258.254 61.431L258.373 62.278H258.415L258.534 61.431L259.346 56.657H260.718L259.143 64H257.673L256.826 59.961L256.693 59.093H256.651L256.511 59.961L255.664 64H254.194Z" fill="black"/>
344    <path d="M248.837 64.231C248.147 64.231 247.54 64.07 247.017 63.748C246.495 63.426 246.086 62.978 245.792 62.404C245.498 61.83 245.351 61.1673 245.351 60.416V60.241C245.351 59.4897 245.498 58.827 245.792 58.253C246.086 57.679 246.495 57.2333 247.017 56.916C247.54 56.594 248.147 56.433 248.837 56.433C249.528 56.433 250.135 56.594 250.657 56.916C251.18 5
3447.2333 251.588 57.679 251.882 58.253C252.176 58.827 252.323 59.4897 252.323 60.241V60.416C252.323 61.1673 252.176 61.83 251.882 62.404C251.588 62.978 251.18 63.426 250.657 63.748C250.135 64.07 249.528 64.231 248.837 64.231ZM248.837 62.824C249.43 62.824 249.897 62.607 250.237 62.173C250.583 61.7343 250.755 61.1417 250.755 60.395V60.262C250.755 59.5107 250.583 58.918 250.237 58.484C249.897 58.05 249.43 57.833 248.837 57.833C248.249 57.833 247.783 58.05 247.437 58.484C247.092 58.918 246.919 59.5107 246.919 60.262V60.395C246.919 61.1417 247.092 61.7343 247.437 62.173C247.783 62.607 248.249 62.824 248.837 62.824Z" fill="black"/>
345    <path d="M242.298 64.231C241.467 64.231 240.814 63.993 240.338 63.517C239.866 63.0364 239.631 62.3737 239.631 61.529V53.78H241.178V61.389C241.178 62.3317 241.591 62.803 242.417 62.803C242.65 62.803 242.865 62.7587 243.061 62.67C243.257 62.5814 243.464 62.4367 243.684 62.236L244.538 63.377C244.225 63.6664 243.884 63.881 243.516 64.021C243.152 64.161 242.746 64.231 242.298 64.231ZM237.51 55.061V53.78H240.611V55.061H237.51Z" fill="black"/>
346    <path d="M234.463 64.231C233.633 64.231 232.979 63.993 232.503 63.517C232.032 63.0364 231.796 62.3737 231.796 61.529V53.78H233.343V61.389C233.343 62.3317 233.756 62.803 234.582 62.803C234.816 62.803 235.03 62.7587 235.226 62.67C235.422 62.5814 235.63 62.4367 235.849 62.236L236.703 63.377C236.391 63.6664 236.05 63.881 235.681 64.021C235.317 64.161 234.911 64.231 234.463 64.231ZM229.675 55.061V53.78H232.776V55.061H229.675Z" fill="black"/>
347    <path d="M221.442 64L224.557 53.976H226.132L229.233 64H227.581L225.642 56.972L225.341 55.761H225.299L225.005 56.972L223.073 64H221.442ZM222.835 61.634L223.255 60.29H227.371L227.805 61.634H222.835Z" fill="black"/>
348    <path d="M178.261 64L175.034 60.066V60.024L178.121 56.657H180.011L176.504 60.423V59.632L180.165 64H178.261ZM173.543 64V53.78H175.097V64H173.543Z" fill="#7D9093" fill-opacity="0.5"/>
349    <path d="M169.306 64.224C168.588 64.224 167.958 64.0653 167.416 63.748C166.88 63.426 166.462 62.9803 166.163 62.411C165.865 61.837 165.715 61.1673 165.715 60.402V60.248C165.715 59.4873 165.862 58.8223 166.156 58.253C166.45 57.679 166.863 57.2333 167.395 56.916C167.927 56.594 168.546 56.433 169.25 56.433C169.978 56.433 170.59 56.6056 171.084 56.951C171.579 57.2917 171.955 57.777 172.211 58.407L170.874 58.995C170.72 58.6123 170.508 58.323 170.237 58.127C169.967 57.9263 169.633 57.826 169.236 57.826C168.63 57.826 168.149 58.0383 167.794 58.463C167.444 58.883 167.269 59.4616 167.269 60.199V60.465C167.269 61.1837 167.454 61.7577 167.822 62.187C168.196 62.6163 168.69 62.831 169.306 62.831C169.712 62.831 170.06 62.733 170.349 62.537C170.639 62.341 170.877 62.0423 171.063 61.641L172.379 62.285C172.188 62.6957 171.941 63.0457 171.637 63.335C171.334 63.6243 170.986 63.846 170.594 64C170.202 64.1493 169.773 64.224 169.306 64.224Z" fill="#7D9093" fill-opacity="0.5"/>
350    <path d="M161.003 64.231C160.312 64.231 159.706 64.07 159.183 63.748C158.66 63.426 158.252 62.978 157.958 62.404C157.664 61.83 157.517 61.1673 157.517 60.416V60.241C157.517 59.4897 157.664 58.827 157.958 58.253C158.252 57.679 158.66 57.2333 159.183 56.916C159.706 56.594 160.312 56.433 161.003 56.433C161.694 56.433 162.3 56.594 162.823 56.916C163.346 57.2333 163.754 57.679 164.048 58.253C164.342 58.827 164.489 59.4897 164.489 60.241V60.416C164.489 61.1673 164.342 61.83 164.048 62.404C163.754 62.978 163.346 63.426 162.823 63.748C162.3 64.07 161.694 64.231 161.003 64.231ZM161.003 62.824C161.596 62.824 162.062 62.607 162.403 62.173C162.748 61.7343 162.921 61.1417 162.921 60.395V60.262C162.921 59.5107 162.748 58.918 162.403 58.484C162.062 58.05 161.596 57.833 161.003 57.833C160.415 57.833 159.948 58.05 159.603 58.484C159.258 58.918 159.085 59.5107 159.085 60.262V60.395C159.085 61.1417 159.258 61.7343 159.603 62.173C159.948 62.607 160.415 62.824 161.003 62.824Z" fill="#7D9093" fill-opacity="0.5"/>
351    <path d="M154.463 64.231C153.633 64.231 152.979 63.993 152.503 63.517C152.032 63.0364 151.796 62.3737 151.796 61.529V53.78H153.343V61.389C153.343 62.3317 153.756 62.803 154.582 62.803C154.816 62.803 155.03 62.7587 155.226 62.67C155.422 62.5814 155.63 62.4367 155.849 62.236L156.703 63.377C156.391 63.6664 156.05 63.881 155.681 64.021C155.317 64.161 154.911 64.231 154.463 64.231ZM149.675 55.061V53.78H152.776V55.061H149.675Z" fill="#7D9093" fill-opacity="0.5"/>
352    <path d="M142.24 64V53.976H145.544C146.421 53.976 147.112 54.1953 147.616 54.634C148.12 55.0726 148.372 55.6583 148.372 56.391V56.566C148.372 57.0886 148.246 57.5366 147.994 57.91C147.742 58.2833 147.38 58.5586 146.909 58.736V58.792C147.492 58.9226 147.947 59.2003 148.274 59.625C148.605 60.045 148.771 60.5606 148.771 61.172V61.361C148.771 61.893 148.645 62.3573 148.393 62.754C148.145 63.1506 147.795 63.4586 147.343 63.678C146.895 63.8926 146.365 64 145.754 64H142.24ZM143.794 62.656H145.5
35272C146.085 62.656 146.482 62.5253 146.762 62.264C147.042 62.0026 147.182 61.6293 147.182 61.144V60.99C147.182 60.5046 147.037 60.1313 146.748 59.87C146.463 59.604 146.05 59.471 145.509 59.471H143.36V58.183H145.32C145.791 58.183 146.153 58.064 146.405 57.826C146.657 57.588 146.783 57.2496 146.783 56.811V56.685C146.783 56.2416 146.657 55.9033 146.405 55.67C146.157 55.4366 145.796 55.32 145.32 55.32H143.794V62.656Z" fill="#7D9093" fill-opacity="0.5"/>
353    <rect x="18" y="17" width="246" height="7" rx="3.5" fill="#7D9093" fill-opacity="0.26"/>
354    <rect x="18" y="33" width="82" height="7" rx="3.5" fill="#7D9093" fill-opacity="0.26"/>
355</svg>
356<div>
357    <button data-modal-action id="mobile-wallet-adapter-launch-action" class="mobile-wallet-adapter-embedded-modal-launch-action">
358        Continue to Allow
359    </button>
360</div>
361`,aR=`
362.mobile-wallet-adapter-embedded-modal-close {
363    display: none;
364}
365.mobile-wallet-adapter-embedded-modal-content {
366    text-align: center;
367}
368.mobile-wallet-adapter-embedded-modal-title {
369    margin: 18px 100px auto 100px;
370    color: #000000;
371    font-size: 2.75em;
372    font-weight: 600;
373}
374.mobile-wallet-adapter-embedded-modal-subtitle {
375    margin: 20px 60px 40px 60px;
376    color: #7D9093;
377    font-size: 1.25em;
378    font-weight: 400;
379}
380.mobile-wallet-adapter-embedded-modal-permission-prompt-mock {
381    width: 90%;
382    height: auto;
383    margin: 0 auto 30px auto;
384    display: block;
385}
386.mobile-wallet-adapter-embedded-modal-launch-action {
387    display: block;
388    width: 100%;
389    height: 56px;
390    font-size: 1.25em;
391    background: #000000;
392    color: #FFFFFF;
393    border-radius: 18px;
394}
395/* Smaller screens */
396@media all and (max-width: 600px) {
397    .mobile-wallet-adapter-embedded-modal-title {
398        font-size: 1.5em;
399        margin-right: 12px;
400        margin-left: 12px;
401    }
402    .mobile-wallet-adapter-embedded-modal-subtitle {
403        margin-right: 12px;
404        margin-left: 12px;
405    }
406}
407`;async function aO(){if(!("u">typeof navigator&&navigator.userAgent.includes("Solana Mobile Web Shell")))try{let t=await navigator.permissions.query({name:"loopback-network"});if("granted"===t.state)return;if("denied"===t.state){let t=new a_;throw t.init(),t.open(),new s0(sJ,"Local Network Access permission denied")}if("prompt"===t.state){let e=new aT;if(await new Promise((r,n)=>{e.addEventListener("close",t=>{t&&n(new s0(sX,"Wallet connection cancelled by user",{event:t}))}),t.onchange=()=>{t.onchange=null,r(t.state)},e.init(),e.open()})!=="granted")return await aO();{let t=new aA;await new Promise((e,r)=>{t.addEventListener("close",t=>{t&&r(new s0(sX,"Wallet connection cancelled by user",{event:t}))}),t.initWithCallback(async()=>{e(!0)}),t.open()});return}}throw new s0(sJ,"Local Network Access permission unknown")}catch(t){if(t instanceof TypeError&&(t.message.includes("loopback-network")||t.message.includes("local-network-access")))return;if(t instanceof s0)throw t;throw new s0(sJ,t instanceof Error?t.message:"Local Network Access permission unknown")}}let aP=`
408<div class="mobile-wallet-adapter-embedded-loading-indicator" role="dialog" aria-modal="true" aria-labelledby="modal-title">
409    <div data-modal-close style="position: absolute; width: 100%; height: 100%;"></div>
410    <div class="mobile-wallet-adapter-embedded-loading-container">
411        <div class="mobile-wallet-adapter-embedded-loading-animation"></div>
412    </div>
413</div>
414`,aU=`
415.mobile-wallet-adapter-embedded-loading-indicator {
416    display: flex; /* Use flexbox to center content */
417    justify-content: center; /* Center horizontally */
418    align-items: start; /* Center vertically */
419    position: fixed; /* Stay in place */
420    z-index: 1; /* Sit on top */
421    left: 0;
422    top: 0;
423    width: 100%; /* Full width */
424    height: 100%; /* Full height */
425    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
426    overflow-y: auto; /* enable scrolling */
427}
428
429.mobile-wallet-adapter-embedded-loading-container {
430    display: flex;
431    margin: auto;
432}
433
434.mobile-wallet-adapter-embedded-loading-animation {
435    position: relative;
436    left: -9999px;
437    width: 10px;
438    height: 10px;
439    border-radius: 5px;
440    background-color: var(--spinner-color);
441    color: var(--spinner-color);
442    box-shadow: 9984px 0 0 0 var(--spinner-color), 
443                9999px 0 0 0 var(--spinner-color), 
444                10014px 0 0 0 var(--spinner-color);
445    animation: dot-typing 1.5s infinite linear;
446}
447
448@keyframes dot-typing {
449    0% {
450        box-shadow: 9984px 0 0 0 var(--spinner-color), 
451                    9999px 0 0 0 var(--spinner-color), 
452                    10014px 0 0 0 var(--spinner-color);
453    }
454    16.667% {
455        box-shadow: 9984px -10px 0 0 var(--spinner-color), 
456                    9999px 0 0 0 var(--spinner-color), 
457                    10014px 0 0 0 var(--spinner-color);
458    }
459    33.333% {
460        box-shadow: 9984px 0 0 0 var(--spinner-color), 
461                    9999px 0 0 0 var(--spinner-color), 
462                    10014px 0 0 0 var(--spinner-color);
463    }
464    50% {
465        box-shadow: 9984px 0 0 0 var(--spinner-color), 
466                    9999px -10px 0 0 var(--spinner-color), 
467                    10014px 0 0 0 var(--spinner-color);
468    }
469    66.667% {
470        box-shadow: 9984px 0 0 0 var(--spinner-color), 
471                    9999px 0 0 0 var(--spinner-color), 
472                    10014px 0 0 0 var(--spinner-color);
473    }
474    83.333% {
475        box-shadow: 9984px 0 0 0 var(--spinner-color), 
476                    9999px 0 0 0 var(--spinner-color), 
477                    10014px -10px 0 0 var(--spinner-color);
478    }
479    100% {
480        box-shadow: 9984px 0 0 0 var(--spinner-color), 
481                    9999px 0 0 0 var(--spinner-color), 
482                    10014px 0 0 0 var(--spinner-color);
483    }
484}
485`;var aN=class{#f=null;#d={};#p=!1;dom=null;constructor(){this.init=this.init.bind(this),this.#f=document.getElementById("mobile-wallet-adapter-embedded-root-ui")}
485async init(){console.log("Injecting modal"),this.#g()}open=()=>{console.debug("Modal open"),this.#m(),this.#f&&(this.#f.style.display="flex")};close=t=>{console.debug("Modal close"),this.#y(),this.#f&&(this.#f.style.display="none"),this.#d.close?.forEach(e=>e(t))};addEventListener(t,e){return this.#d[t]?.push(e)||(this.#d[t]=[e]),()=>this.removeEventListener(t,e)}removeEventListener(t,e){this.#d[t]=this.#d[t]?.filter(t=>e!==t)}#g(){if(this.dom)return;this.#f=document.createElement("div"),this.#f.id="mobile-wallet-adapter-embedded-root-ui",this.#f.innerHTML=aP,this.#f.style.display="none";let t=document.createElement("style");t.id="mobile-wallet-adapter-embedded-modal-styles",t.textContent=aU;let e=document.createElement("div");this.dom=e.attachShadow({mode:"closed"}),e.style.setProperty("--spinner-color","#FFFFFF"),this.dom.appendChild(t),this.dom.appendChild(this.#f),document.body.appendChild(e)}#m(){this.#f&&!this.#p&&([...this.#f.querySelectorAll("[data-modal-close]")].forEach(t=>t?.addEventListener("click",t=>{this.close(t)})),window.addEventListener("load",this.close),document.addEventListener("keydown",this.#b),this.#p=!0)}#y(){!this.#p||(window.removeEventListener("load",this.close),document.removeEventListener("keydown",this.#b),this.#f&&([...this.#f.querySelectorAll("[data-modal-close]")].forEach(t=>t?.removeEventListener("click",this.close)),this.#p=!1))}#b=t=>{"Escape"===t.key&&this.close(t)}};let az="Mobile Wallet Adapter",aq=[sM,sL,sT,sC];function aD(t){return t instanceof Error?t.message:"Unknown error"}var aW=class{#v={};#x="1.0.0";#E=az;#S="https://solanamobile.com/wallets";#k="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03IDIuNUgxN0MxNy44Mjg0IDIuNSAxOC41IDMuMTcxNTcgMTguNSA0VjIwQzE4LjUgMjAuODI4NCAxNy44Mjg0IDIxLjUgMTcgMjEuNUg3QzYuMTcxNTcgMjEuNSA1LjUgMjAuODI4NCA1LjUgMjBWNEM1LjUgMy4xNzE1NyA2LjE3MTU3IDIuNSA3IDIuNVpNMyA0QzMgMS43OTA4NiA0Ljc5MDg2IDAgNyAwSDE3QzE5LjIwOTEgMCAyMSAxLjc5MDg2IDIxIDRWMjBDMjEgMjIuMjA5MSAxOS4yMDkxIDI0IDE3IDI0SDdDNC43OTA4NiAyNCAzIDIyLjIwOTEgMyAyMFY0Wk0xMSA0LjYxNTM4QzEwLjQ0NzcgNC42MTUzOCAxMCA1LjA2MzEgMTAgNS42MTUzOFY2LjM4NDYyQzEwIDYuOTM2OSAxMC40NDc3IDcuMzg0NjIgMTEgNy4zODQ2MkgxM0MxMy41NTIzIDcuMzg0NjIgMTQgNi45MzY5IDE0IDYuMzg0NjJWNS42MTUzOEMxNCA1LjA2MzEgMTMuNTUyMyA0LjYxNTM4IDEzIDQuNjE1MzhIMTFaIiBmaWxsPSIjRENCOEZGIi8+Cjwvc3ZnPgo=";#A;#I;#B;#_=!1;#M=0;#C=[];#T;#L;#R;get version(){return this.#x}get name(){return this.#E}get url(){return this.#S}get icon(){return this.#k}get chains(){return this.#C}get features(){return{[ad]:{version:"1.0.0",connect:this.#O},[ap]:{version:"1.0.0",disconnect:this.#P},[ag]:{version:"1.0.0",on:this.#U},[sT]:{version:"1.0.0",signMessage:this.#N},[sC]:{version:"1.0.0",signIn:this.#z},...this.#L}}get accounts(){return this.#I?.accounts??[]}constructor(t){this.#B=t.authorizationCache,this.#A=t.appIdentity,this.#C=t.chains,this.#T=t.chainSelector,this.#R=t.onWalletNotFound,this.#L={[sM]:{version:"1.0.0",supportedTransactionVersions:["legacy",0],signAndSendTransaction:this.#q},[sL]:{version:"1.0.0",supportedTransactionVersions:["legacy",0],signTransaction:this.#D}}}get connected(){return!!this.#I}get isAuthorized(){return!!this.#I}get currentAuthorization(){return this.#I}get cachedAuthorizationResult(){return this.#B.get()}#U=(t,e)=>(this.#v[t]?.push(e)||(this.#v[t]=[e]),()=>this.#W(t,e));#F(t,...e){this.#v[t]?.forEach(t=>t.apply(null,e))}#W(t,e){this.#v[t]=this.#v[t]?.filter(t=>e!==t)}#O=async({silent:t}={})=>
485{if(this.#_||this.connected)return{accounts:this.accounts};this.#_=!0;try{if(t){let t=await this.#B.get();if(!t)return{accounts:this.accounts};await this.#j(t.capabilities),await this.#K(t)}else await this.#H()}catch(t){throw Error(aD(t),{cause:t})}finally{this.#_=!1}return{accounts:this.accounts}};#H=async t=>{try{let e=await this.#B.get();if(e)return this.#K(e),e;let r=await this.#T.select(this.#C);return await this.#V(async e=>{let[n,i]=await Promise.all([e.getCapabilities(),e.authorize({chain:r,identity:this.#A,sign_in_payload:t})]),o=this.#$(i.accounts),s={...i,accounts:o,chain:r,capabilities:n};return Promise.all([this.#j(n),this.#B.set(s),this.#K(s)]),s})}catch(t){throw Error(aD(t),{cause:t})}};#K=async t=>{let e=null==this.#I||this.#I?.accounts.length!==t.accounts.length||this.#I.accounts.some((e,r)=>e.address!==t.accounts[r].address);this.#I=t,e&&this.#F("change",{accounts:this.accounts})};#j=async t=>{let e=t.features.includes("solana:signTransactions"),r=t.supports_sign_and_send_transactions,n=sM in this.features!==r||sL in this.features!==e;this.#L={...(r||!r&&!e)&&{[sM]:{version:"1.0.0",supportedTransactionVersions:["legacy",0],signAndSendTransaction:this.#q}},...e&&{[sL]:{version:"1.0.0",supportedTransactionVersions:["legacy",0],signTransaction:this.#D}}},n&&this.#F("change",{features:this.features})};#Z=async(t,e,r)=>{try{let[n,i]=await Promise.all([this.#I?.capabilities??await t.getCapabilities(),t.authorize({auth_token:e,identity:this.#A,chain:r})]),o=this.#$(i.accounts),s={...i,accounts:o,chain:r,capabilities:n};Promise.all([this.#B.set(s),this.#K(s)])}catch(t){throw this.#P(),Error(aD(t),{cause:t})}};#P=async()=>{this.#B.clear(),this.#_=!1,this.#M++,this.#I=void 0,this.#F("change",{accounts:this.accounts})};#V=async t=>{let e=this.#I?.wallet_uri_base,r=e?{baseUri:e}:void 0,n=this.#M,i=new aN;try{let e,n=!0,o=await Promise.race([aO().then(async()=>{i.init();let{wallet:e,close:o}=await af(r);n=!1,i.addEventListener("close",t=>{t&&o()}),i.open();let s=await t(await e);return i.close(),o(),s}),new Promise((t,r)=>{e=setTimeout(()=>{n&&r(new s0(sX,"Wallet connection timed out",{event:void 0}))},3e4)})]);return clearTimeout(e),o}catch(t){throw i.close(),this.#M!==n&&await new Promise(()=>{}),t instanceof Error&&"SolanaMobileWalletAdapterError"===t.name&&"ERROR_WALLET_NOT_FOUND"===t.code&&await this.#R(this),t}};#G=()=>{if(!this.#I)throw Error("Wallet not connected");return{authToken:this.#I.auth_token,chain:this.#I.chain}};#$=t=>t.map(t=>{let e=sZ(t.address);return{address:s$(e),publicKey:e,label:t.label,icon:t.icon,chains:t.chains??this.#C,features:t.features??aq}});#Y=async t=>{let{authToken:e,chain:r}=this.#G();try{let n=t.map(t=>sH(t));return await this.#V(async t=>(await this.#Z(t,e,r),(await t.signTransactions({payloads:n})).signed_payloads.map(sZ)))}catch(t){throw Error(aD(t),{cause:t})}};#Q=async(t,e)=>{let{authToken:r,chain:n}=this.#G();try{return await this.#V(async i=>{let[o]=await Promise.all([i.getCapabilities(),this.#Z(i,r,n)]);if(o.supports_sign_and_send_transactions){let r=sH(t);return(await i.signAndSendTransactions({...e,payloads:[r]})).signatures.map(sZ)[0]}throw Error("connected wallet does not support signAndSendTransaction")})}catch(t){throw Error(aD(t),{cause:t})}};#q=async(...t)=>{let e=[];for(let r of t){let t=await this.#Q(r.transaction,r.options);e.push({signature:t})}return e};#D=async(...t)=>(await this.#Y(t.map(({transaction:t})=>t))).map(t=>({signedTransaction:t}));#N=async(...t)=>{let{authToken:e,chain:r}=this.#G(),n=t.map(({account:t})=>sH(new Uint8Array(t.publicKey))),i=t.map(({message:t})=>sH(t));try{return await this.#V(async t=>(await this.#Z(t,e,r),(await t.signMessages({addresses:n,payloads:i})).signed_payloads.map(sZ).map(t=>({signedMessage:t,signature:t.slice(-64)}))))}catch(t){throw Error(aD(t),{cause:t})}};#z=async(...t)=>{let e=[];
485if(!(t.length>1))return[await this.#J(t[0])];for(let r of t)e.push(await this.#J(r));return e};#J=async t=>{this.#_=!0;try{var e;let r=await this.#H({...t,domain:t?.domain??window.location.host});if(!r.sign_in_result)throw Error("Sign in failed, no sign in result returned by wallet");let n=r.sign_in_result.address,i=r.accounts.find(t=>t.address==n);return{account:{...i??{address:(e=sZ(n),s$(e))},publicKey:sZ(n),chains:i?.chains??this.#C,features:i?.features??r.capabilities.features},signedMessage:sZ(r.sign_in_result.signed_message),signature:sZ(r.sign_in_result.signature)}}catch(t){throw Error(aD(t),{cause:t})}finally{this.#_=!1}}};function aF(t){switch(t){case"mainnet-beta":return"solana:mainnet";case"testnet":return"solana:testnet";case"devnet":return"solana:devnet";default:return t}}function aj(t){return t instanceof Error?t.message:"Unknown error"}var aK=class extends s_{supportedTransactionVersions=new Set(["legacy",0]);name;icon;url;#X;#_=!1;#tt="u">typeof window&&window.isSecureContext&&"u">typeof document&&/android/i.test(navigator.userAgent)?p.Loadable:p.Unsupported;#te;#tr;#tn;#ti=async t=>{if(t.accounts&&t.accounts.length>0){this.#to();let e=await this.#te(t.accounts);e!==this.#tr&&(this.#tr=e,this.#tn=void 0,this.emit("connect",this.publicKey))}};constructor(t,e){super(),this.#te=async t=>{let r=await e.addressSelector.select(t.map(({publicKey:t})=>sH(new Uint8Array(t))));return t.find(({publicKey:t})=>sH(new Uint8Array(t))===r)??t[0]},this.#X=t,this.#X.features[ag].on("change",this.#ti),this.name=this.#X.name,this.icon=this.#X.icon,this.url=this.#X.url}get publicKey(){if(!this.#tn&&this.#tr)try{this.#tn=new nW(this.#tr.publicKey)}catch(t){throw new sb(t instanceof Error&&t?.message||"Unknown error",t)}return this.#tn??null}get connected(){return this.#X.connected}get connecting(){return this.#_}get readyState(){return this.#tt}async autoConnect_DO_NOT_USE_OR_YOU_WILL_BE_FIRED(){return await this.autoConnect()}async autoConnect(){this.#O(!0)}async connect(){this.#O()}async #O(t=!1){if(!this.connecting&&!this.connected)return await this.#ts(async()=>{if(this.#tt!==p.Installed&&this.#tt!==p.Loadable)throw new sf;this.#_=!0;try{await this.#X.features[ad].connect({silent:t})}catch(t){throw new sp(t instanceof Error&&t.message||"Unknown error",t)}finally{this.#_=!1}})}async performAuthorization(t){try{let e=await this.#X.cachedAuthorizationResult;if(e)return await this.#X.features[ad].connect({silent:!0}),e;return t?await this.#X.features[sC].signIn(t):await this.#X.features[ad].connect(),await await this.#X.cachedAuthorizationResult}catch(t){throw new sp(t instanceof Error&&t.message||"Unknown error",t)}}async disconnect(){return await this.#ts(async()=>{this.#_=!1,this.#tn=void 0,this.#tr=void 0,await this.#X.features[ap].disconnect(),this.emit("disconnect")})}async signIn(t){return this.#ts(async()=>{if(this.#tt!==p.Installed&&this.#tt!==p.Loadable)throw new sf;this.#_=!0;try{let e=await this.#X.features[sC].signIn({...t,domain:t?.domain??window.location.host});if(e.length>0)return e[0];throw Error("Sign in failed, no sign in result returned by wallet")}catch(t){throw new sp(t instanceof Error&&t.message||"Unknown error",t)}finally{this.#_=!1}})}async signMessage(t){return await this.#ts(async()=>{let e=this.#G();try{return(await this.#X.features[sT].signMessage({account:e,message:t}))[0].signature}catch(t){throw new sE(aj(t),t)}})}async sendTransaction(t,e,r){return await this.#ts(async()=>{let n=this.#G();try{if(sM in this.#X.features){let e=aF(this.#X.currentAuthorization.chain),[i]=(await this.#X.features[sM].signAndSendTransaction({account:n,transaction:t.serialize(),chain:e,options:r?{skipPreflight:r.skipPreflight,maxRetries:r.maxRetries}:void 0})).map(t=>{var e;return e=t.signature,sH(e)});return i}{let[n]=await this.#Y([t]);if("version"in n)return await e.sendTransaction(n);{let t=n.serialize();return await e.sendRawTransaction(t,{...r,preflightCommitment:function(){let t,n;switch(e.commitment){case"confirmed":case"finalized":case"processed":t=e.commitment;break;default:t="finalized"}switch(r?.preflightCommitment){case"confirmed":case"finalized":case"processed":n=r.preflightCommitment;break;case void 0:n=t;break;default:n="finalized"}return("finalized"===n?2:+("confirmed"===n))<("finalized"===t?2:+("confirmed"===t))?n:t}()})}}}catch(t){throw new sv(aj(t),t)}})}async signTransaction(t){return await this.#ts(async()=>{let[e]=await this.#Y([t]);return e})}async signAllTransactions(t){return await this.#ts(async()=>await this.#Y(t))}
485#to(){this.#tt!==p.Installed&&this.emit("readyStateChange",this.#tt=p.Installed)}#G(){if(!this.#X.isAuthorized||!this.#tr)throw new sw;return this.#tr}async #Y(t){let e=this.#G();try{if(sL in this.#X.features)return this.#X.features[sL].signTransaction(...t.map(t=>({account:e,transaction:t.serialize()}))).then(t=>t.map(t=>{let e=t.signedTransaction,r=64*e[0]+1;return"legacy"===n6.deserializeMessageVersion(e.slice(r,e.length))?n4.from(e):n7.deserialize(e)}));throw Error("Connected wallet does not support signing transactions")}catch(t){throw new sx(aj(t),t)}}async #ts(t){try{return await t()}catch(t){throw this.emit("error",t instanceof sh?t:new sh(aj(t),t)),t}}},aH=class extends aK{constructor(t){const e=aF(t.chain??t.cluster);super(new aW({appIdentity:t.appIdentity,authorizationCache:{set:t.authorizationResultCache.set,get:async()=>await t.authorizationResultCache.get(),clear:t.authorizationResultCache.clear},chains:[e],chainSelector:{select:async t=>1===t.length?t[0]:t.includes(sG)?sG:t[0]},onWalletNotFound:async()=>{t.onWalletNotFound(this)}}),{addressSelector:t.addressSelector,chain:e})}},aV=class extends aH{};async function a$(t){return ak()}let aZ=function(t){return ad in t.features&&ag in t.features&&(sM in t.features||sL in t.features)};function aG(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}}new WeakMap,new WeakMap,new WeakMap,new WeakMap,new WeakMap,new WeakMap;let aY=function(t){if(t.length>=255)throw TypeError("Alphabet too long");let e=new Uint8Array(256);for(let t=0;t<e.length;t++)e[t]=255;for(let r=0;r<t.length;r++){let n=t.charAt(r),i=n.charCodeAt(0);if(255!==e[i])throw TypeError(n+" is ambiguous");e[i]=r}let r=t.length,n=t.charAt(0),i=Math.log(r)/Math.log(256),o=Math.log(256)/Math.log(r);function s(t){if("string"!=typeof t)throw TypeError("Expected String");if(0===t.length)return new Uint8Array;let o=0,s=0,a=0;for(;t[o]===n;)s++,o++;let l=(t.length-o)*i+1>>>0,u=new Uint8Array(l);for(;o<t.length;){let n=t.charCodeAt(o);if(n>255)return;let i=e[n];if(255===i)return;let s=0;for(let t=l-1;(0!==i||s<a)&&-1!==t;t--,s++)i+=r*u[t]>>>0,u[t]=i%256>>>0,i=i/256>>>0;if(0!==i)throw Error("Non-zero carry");a=s,o++}let c=l-a;for(;c!==l&&0===u[c];)c++;let h=new Uint8Array(s+(l-c)),f=s;for(;c!==l;)h[f++]=u[c++];return h}return{encode:function(e){if(e instanceof Uint8Array||(ArrayBuffer.isView(e)?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):Array.isArray(e)&&(e=Uint8Array.from(e))),!(e instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===e.length)return"";let i=0,s=0,a=0,l=e.length;for(;a!==l&&0===e[a];)a++,i++;let u=(l-a)*o+1>>>0,c=new Uint8Array(u);for(;a!==l;){let t=e[a],n=0;for(let e=u-1;(0!==t||n<s)&&-1!==e;e--,n++)t+=256*c[e]>>>0,c[e]=t%r>>>0,t=t/r>>>0;if(0!==t)throw Error("Non-zero carry");s=n,a++}let h=u-s;for(;h!==u&&0===c[h];)h++;let f=n.repeat(i);for(;h<u;++h)f+=t.charAt(c[h]);return f},decodeUnsafe:s,decode:function(t){let e=s(t);if(e)return e;throw Error("Non-base"+r+" character")}}}("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");var aQ=function(t,e,r,n){if("a"===r&&!n)throw TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)},aJ=function(t,e,r,n,i){if("m"===n)throw TypeError("Private method is not writable");if("a"===n&&!i)throw TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r};class aX extends sk{get name(){return aQ(this,E,"f").name}get url(){return"https://github.com/solana-labs/wallet-standard"}get icon(){return aQ(this,E,"f").icon}get readyState(){return aQ(this,S,"f")}get publicKey(){return aQ(this,y,"f")}get connecting(){return aQ(this,b,"f")}get supportedTransactionVersions(){return aQ(this,x,"f")}get wallet(){return aQ(this,E,"f")}get standard(){return!0}constructor({wallet:t}){super(),g.add(this),m.set(this,void 0),y.set(this,void 0),b.set(this,void 0),w.set(this,void 0),v.set(this,void 0),x.set(this,void 0),E.set(this,void 0),S.set(this,"u"<typeof window||"u"<typeof document?p.Unsupported:p.Installed),_.set(this,t=>{if("accounts"in t){let t=aQ(this,E,"f").accounts[0];aQ(this,m,"f")&&!aQ(this,w,"f")&&t!==aQ(this,m,"f")&&(t?aQ(this,g,"m",A).call(this,t):(this.emit
485("error",new sg),aQ(this,g,"m",I).call(this)))}"features"in t&&aQ(this,g,"m",B).call(this)}),aJ(this,E,t,"f"),aJ(this,m,null,"f"),aJ(this,y,null,"f"),aJ(this,b,!1,"f"),aJ(this,w,!1,"f"),aJ(this,v,aQ(this,E,"f").features[ag].on("change",aQ(this,_,"f")),"f"),aQ(this,g,"m",B).call(this)}destroy(){aJ(this,m,null,"f"),aJ(this,y,null,"f"),aJ(this,b,!1,"f"),aJ(this,w,!1,"f");let t=aQ(this,v,"f");t&&(aJ(this,v,null,"f"),t())}async autoConnect(){return aQ(this,g,"m",k).call(this,{silent:!0})}async connect(){return aQ(this,g,"m",k).call(this)}async disconnect(){if(ap in aQ(this,E,"f").features)try{aJ(this,w,!0,"f"),await aQ(this,E,"f").features[ap].disconnect()}catch(t){this.emit("error",new sm(t?.message,t))}finally{aJ(this,w,!1,"f")}aQ(this,g,"m",I).call(this)}async sendTransaction(t,e,r={}){try{var n;let i,o=aQ(this,m,"f");if(!o)throw new sw;if(sM in aQ(this,E,"f").features)if(o.features.includes(sM))i=sM;else if(sL in aQ(this,E,"f").features&&o.features.includes(sL))i=sL;else throw new sy;else if(sL in aQ(this,E,"f").features){if(!o.features.includes(sL))throw new sy;i=sL}else throw new sd;let s=(n=e.rpcEndpoint).includes("https://api.mainnet-beta.solana.com")?sG:/\bdevnet\b/i.test(n)?"solana:devnet":/\btestnet\b/i.test(n)?"solana:testnet":/\blocalhost\b/i.test(n)||/\b127\.0\.0\.1\b/.test(n)?"solana:localnet":sG;if(!o.chains.includes(s))throw new sv;try{let n,{signers:a,...l}=r;if(sA(t)?(a?.length&&t.sign(a),n=t.serialize()):(t=await this.prepareTransaction(t,e,l),a?.length&&t.partialSign(...a),n=new Uint8Array(t.serialize({requireAllSignatures:!1,verifySignatures:!1}))),i===sM){let[t]=await aQ(this,E,"f").features[sM].signAndSendTransaction({account:o,chain:s,transaction:n,options:{preflightCommitment:aG(l.preflightCommitment||e.commitment),skipPreflight:l.skipPreflight,maxRetries:l.maxRetries,minContextSlot:l.minContextSlot}});return aY.encode(t.signature)}{let[t]=await aQ(this,E,"f").features[sL].signTransaction({account:o,chain:s,transaction:n,options:{preflightCommitment:aG(l.preflightCommitment||e.commitment),minContextSlot:l.minContextSlot}});return await e.sendRawTransaction(t.signedTransaction,{...l,preflightCommitment:aG(l.preflightCommitment||e.commitment)})}}catch(t){if(t instanceof sh)throw t;throw new sv(t?.message,t)}}catch(t){throw this.emit("error",t),t}}}m=new WeakMap,y=new WeakMap,b=new WeakMap,w=new WeakMap,v=new WeakMap,x=new WeakMap,E=new WeakMap,S=new WeakMap,_=new WeakMap,g=new WeakSet,k=async function(t){try{if(this.connected||this.connecting)return;if(aQ(this,S,"f")!==p.Installed)throw new sf;if(aJ(this,b,!0,"f"),!aQ(this,E,"f").accounts.length)try{await aQ(this,E,"f").features[ad].connect(t)}catch(t){throw new sp(t?.message,t)}let e=aQ(this,E,"f").accounts[0];if(!e)throw new sy;aQ(this,g,"m",A).call(this,e)}catch(t){throw this.emit("error",t),t}finally{aJ(this,b,!1,"f")}},A=function(t){let e;try{e=new nW(t.address)}catch(t){throw new sb(t?.message,t)}aJ(this,m,t,"f"),aJ(this,y,e,"f"),aQ(this,g,"m",B).call(this),this.emit("connect",e)},I=function(){aJ(this,m,null,"f"),aJ(this,y,null,"f"),aQ(this,g,"m",B).call(this),this.emit("disconnect")},B=function(){let t=sM in aQ(this,E,"f").features?aQ(this,E,"f").features[sM].supportedTransactionVersions:aQ(this,E,"f").features[sL].supportedTransactionVersions;aJ(this,x,!function(t,e){if(t===e)return!0;let r=t.length;if(r!==e.length)return!1;for(let n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}(t,["legacy"])?new Set(t):null,"f"),sL in aQ(this,E,"f").features&&aQ(this,m,"f")?.features.includes(sL)?(this.signTransaction=aQ(this,g,"m",M),this.signAllTransactions=aQ(this,g,"m",C)):(delete this.signTransaction,delete this.signAllTransactions),sT in aQ(this,E,"f").features&&aQ(this,m,"f")?.features.includes(sT)?this.signMessage=aQ(this,g,"m",T):delete this.signMessage,sC in aQ(this,E,"f").features?this.signIn=aQ(this,g,"m",L):delete this.signIn},M=async function(t){try{let e=aQ(this,m,"f");if(!e)throw new sw;if(!(sL in aQ(this,E,"f").features))throw new sd;if(!e.features.includes(sL))throw new sy;try{let r=(await aQ(this,E,"f").features[sL].signTransaction({account:e,transaction:sA(t)?t.serialize():new Uint8Array(t.serialize({requireAllSignatures:!1,verifySignatures:!1}))}
485))[0].signedTransaction;return sA(t)?n7.deserialize(r):n4.from(r)}catch(t){if(t instanceof sh)throw t;throw new sx(t?.message,t)}}catch(t){throw this.emit("error",t),t}},C=async function(t){try{let e=aQ(this,m,"f");if(!e)throw new sw;if(!(sL in aQ(this,E,"f").features))throw new sd;if(!e.features.includes(sL))throw new sy;try{let r=await aQ(this,E,"f").features[sL].signTransaction(...t.map(t=>({account:e,transaction:sA(t)?t.serialize():new Uint8Array(t.serialize({requireAllSignatures:!1,verifySignatures:!1}))})));return t.map((t,e)=>{let n=r[e].signedTransaction;return sA(t)?n7.deserialize(n):n4.from(n)})}catch(t){throw new sx(t?.message,t)}}catch(t){throw this.emit("error",t),t}},T=async function(t){try{let e=aQ(this,m,"f");if(!e)throw new sw;if(!(sT in aQ(this,E,"f").features))throw new sd;if(!e.features.includes(sT))throw new sy;try{return(await aQ(this,E,"f").features[sT].signMessage({account:e,message:t}))[0].signature}catch(t){throw new sE(t?.message,t)}}catch(t){throw this.emit("error",t),t}},L=async function(t={}){try{let e;if(!(sC in aQ(this,E,"f").features))throw new sd;try{[e]=await aQ(this,E,"f").features[sC].signIn(t)}catch(t){throw new sS(t?.message,t)}if(!e)throw new sS;return aQ(this,g,"m",A).call(this,e.account),e}catch(t){throw this.emit("error",t),t}};var a0=function(t,e,r,n){if("a"===r&&!n)throw TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)},a1=function(t,e,r,n,i){if("m"===n)throw TypeError("Private method is not writable");if("a"===n&&!i)throw TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r};let a2=new Set,a6={};function a5(...t){return(t=t.filter(t=>!a2.has(t))).length?(t.forEach(t=>{e=void 0,a2.add(t)}),a6.register?.forEach(e=>a4(()=>e(...t))),function(){t.forEach(t=>{e=void 0,a2.delete(t)}),a6.unregister?.forEach(e=>a4(()=>e(...t)))}):()=>{}}function a3(){return e||(e=[...a2]),e}function a8(t,e){return a6[t]?.push(e)||(a6[t]=[e]),function(){a6[t]=a6[t]?.filter(t=>e!==t)}}function a4(t){try{t()}catch(t){console.error(t)}}class a7 extends Event{get detail(){return a0(this,R,"f")}get type(){return"wallet-standard:app-ready"}constructor(t){super("wallet-standard:app-ready",{bubbles:!1,cancelable:!1,composed:!1}),R.set(this,void 0),a1(this,R,t,"f")}preventDefault(){throw Error("preventDefault cannot be called")}stopImmediatePropagation(){throw Error("stopImmediatePropagation cannot be called")}stopPropagation(){throw Error("stopPropagation cannot be called")}}function a9(t){let e=(0,G.useRef)(void 0);return void 0===e.current&&(e.current={value:t()}),e.current.value}function lt(t){return t.filter(aZ).map(t=>new aX({wallet:t}))}R=new WeakMap,(h=O||(O={}))[h.DESKTOP_WEB=0]="DESKTOP_WEB",h[h.MOBILE_WEB=1]="MOBILE_WEB";class le extends sh{constructor(){super(...arguments),this.name="WalletNotSelectedError"}}var lr=t.i(67762);function ln({children:t,wallets:e,adapter:r,isUnloadingRef:n,onAutoConnectRequest:i,onConnectError:o,onError:s,onSelectWallet:a}){let l=(0,G.useRef)(!1),[u,c]=(0,G.useState)(!1),h=(0,G.useRef)(!1),[f,d]=(0,G.useState)(!1),[g,m]=(0,G.useState)(()=>r?.publicKey??null),[y,b]=(0,G.useState)(()=>r?.connected??!1),w=(0,G.useRef)(s);(0,G.useEffect)(()=>(w.current=s,()=>{w.current=void 0}),[s]);let v=(0,G.useRef)((t,e)=>(!n.current&&(w.current?w.current(t,e):(console.error(t,e),t instanceof sf&&"u">typeof window&&e&&window.open(e.url,"_blank"))),t)),[x,E]=(0,G.useState)(()=>e.map(t=>({adapter:t,readyState:t.readyState})).filter(({readyState:t})=>t!==p.Unsupported));(0,G.useEffect)(()=>{function t(t){E(e=>{let r=e.findIndex(({adapter:t})=>t===this);if(-1===r)return e;let{adapter:n}=e[r];return[...e.slice(0,r),{adapter:n,readyState:t},...e.slice(r+1)].filter(({readyState:t})=>t!==p.Unsupported)})}return E(t=>e.map((e,r)=>{let n=t[r];return n&&n.adapter===e&&n.readyState===e.readyState?n:{adapter:e,readyState:e.readyState}}).filter(({readyState:t})=>
vendor: 4,119 bytes, line 485
485t!==p.Unsupported)),e.forEach(e=>e.on("readyStateChange",t,e)),()=>{e.forEach(e=>e.off("readyStateChange",t,e))}},[r,e]);let S=(0,G.useMemo)(()=>x.find(t=>t.adapter===r)??null,[r,x]);(0,G.useEffect)(()=>{if(!r)return;let t=t=>{m(t),l.current=!1,c(!1),b(!0),h.current=!1,d(!1)},e=()=>{n.current||(m(null),l.current=!1,c(!1),b(!1),h.current=!1,d(!1))},i=t=>{v.current(t,r)};return r.on("connect",t),r.on("disconnect",e),r.on("error",i),()=>{r.off("connect",t),r.off("disconnect",e),r.off("error",i),e()}},[r,n]);let k=(0,G.useRef)(!1);(0,G.useEffect)(()=>()=>{k.current=!1},[r]),(0,G.useEffect)(()=>{k.current||l.current||y||!i||S?.readyState!==p.Installed&&S?.readyState!==p.Loadable||(l.current=!0,c(!0),k.current=!0,async function(){try{await i()}catch{o()}finally{c(!1),l.current=!1}}())},[y,i,o,S]);let A=(0,G.useCallback)(async(t,e,n)=>{if(!r)throw v.current(new le);if(!y)throw v.current(new sw,r);return await r.sendTransaction(t,e,n)},[r,y]),I=(0,G.useMemo)(()=>r&&"signTransaction"in r?async t=>{if(!y)throw v.current(new sw,r);return await r.signTransaction(t)}:void 0,[r,y]),B=(0,G.useMemo)(()=>r&&"signAllTransactions"in r?async t=>{if(!y)throw v.current(new sw,r);return await r.signAllTransactions(t)}:void 0,[r,y]),_=(0,G.useMemo)(()=>r&&"signMessage"in r?async t=>{if(!y)throw v.current(new sw,r);return await r.signMessage(t)}:void 0,[r,y]),M=(0,G.useMemo)(()=>r&&"signIn"in r?async t=>await r.signIn(t):void 0,[r]),C=(0,G.useCallback)(async()=>{if(l.current||h.current||S?.adapter.connected)return;if(!S)throw v.current(new le);let{adapter:t,readyState:e}=S;if(e!==p.Installed&&e!==p.Loadable)throw v.current(new sf,t);l.current=!0,c(!0);try{await t.connect()}catch(t){throw o(),t}finally{c(!1),l.current=!1}},[o,S]),T=(0,G.useCallback)(async()=>{if(!h.current&&r){h.current=!0,d(!0);try{await r.disconnect()}finally{d(!1),h.current=!1}}},[r]);return G.default.createElement(lr.WalletContext.Provider,{value:{autoConnect:!!i,wallets:x,wallet:S,publicKey:g,connected:y,connecting:u,disconnecting:f,select:a,connect:C,disconnect:T,sendTransaction:A,signTransaction:I,signAllTransactions:B,signMessage:_,signIn:M}},t)}function li(t){return function({adapters:t,userAgentString:e}){return t.some(t=>t.name!==az&&t.readyState===p.Installed)?O.DESKTOP_WEB:e&&/android/i.test(e)&&!/(WebView|Version\/.+(Chrome)\/(\d+)\.(\d+)\.(\d+)\.(\d+)|; wv\).+(Chrome)\/(\d+)\.(\d+)\.(\d+)\.(\d+))/i.test(e)?O.MOBILE_WEB:O.DESKTOP_WEB}({adapters:t,userAgentString:(void 0===r&&(r=globalThis.navigator?.userAgent??null),r)})===O.MOBILE_WEB}function lo({children:t,wallets:e,autoConnect:r,localStorageKey:n="walletName",onError:i}){let s,a,l,{connection:u}=(0,G.useContext)(sl),c=function(t){var e;let r,n=a9(()=>new Set),{get:i,on:s}=a9(()=>(function(){if(o||(o=function(){if(o||(o=Object.freeze({register:a5,get:a3,on:a8}),"u"<typeof window))return o;let t=Object.freeze({register:a5});try{window.addEventListener("wallet-standard:register-wallet",({detail:e})=>e(t))}catch(t){console.error("wallet-standard:register-wallet event listener could not be added\n",t)}try{window.dispatchEvent(new a7(t))}catch(t){console.error("wallet-standard:app-ready event could not be dispatched\n",t)}return o}(),"u"<typeof window))return o;let t=window.navigator.wallets||[];if(!Array.isArray(t))return console.error("window.navigator.wallets is not an array"),o;let{register:e}=o,r=(...t)=>t.forEach(t=>a4(()=>t({register:e})));try{Object.defineProperty(window.navigator,"wallets",{value:Object.freeze({push:r})})}catch(t){return console.error("window.navigator.wallets could not be set"),o}return r(...t),o})()),[a,l]=(0,G.useState)(()=>lt(i()));(0,G.useEffect)(()=>{let t=[s("register",(...t)=>l(e=>[...e,...lt(t)])),s("unregister",(...t)=>l(e=>e.filter(e=>t.some(t=>t===e.wallet))))];return()=>t.forEach(t=>t())},[s]);let u=(e=a,r=(0,G.useRef)(void 0),(0,G.useEffect)(()=>{r.current=e}),r.current);return(0,G.useEffect)(()=>{if(!u)return;let t=new Set(a);new Set(u.filter(e=>!t.has(e))).forEach(t=>t.destroy())},[u,a]),(0,G.useEffect)(()=>()=>a.forEach(t=>t.destroy()),[]),(0,G.useMemo)(()=>[...a,...t.filter(({name:t})=>!a.some(e=>
485e.name===t)||(n.has(t)||(n.add(t),console.warn(`${t} was registered as a Standard Wallet. The Wallet Adapter for ${t} can be removed from your app.`)),!1))],[a,t,n])}(e),h=(0,G.useMemo)(()=>{var t;if(!li(c))return null;let e=c.find(t=>t.name===az);return e?e:new aV({addressSelector:{select:async t=>t[0]},appIdentity:{uri:function(){let t=globalThis.location;if(t)return`${t.protocol}//${t.host}`}()},authorizationResultCache:function(){let t;try{t=window.localStorage}catch{}return{async clear(){if(t)try{t.removeItem(am)}catch{}},async get(){if(t)try{let e=JSON.parse(t.getItem(am));if(!e||!e.accounts)return e||void 0;{let t=e.accounts.map(t=>{var e;return{...t,publicKey:"publicKey"in t?new Uint8Array(Object.values(t.publicKey)):(e=t.address,sP({getSizeFromValue:t=>{let[e,r]=sN(t,sq[0]);if(!r)return t.length;let n=sz(r,sq);return e.length+Math.ceil(n.toString(16).length/2)},write(t,e,r){if(!function(t,e,r=e){if(!e.match(RegExp(`^[${t}]*$`)))throw new sO(8078012,{alphabet:t,base:t.length,value:r})}(sq,t),""===t)return r;let[n,i]=sN(t,sq[0]);if(!i)return e.set(new Uint8Array(n.length).fill(0),r),r+n.length;let o=sz(i,sq),s=[];for(;o>0n;)s.unshift(Number(o%256n)),o/=256n;let a=[...Array(n.length).fill(0),...s];return e.set(a,r),r+a.length}}).encode(e))}});return{...e,accounts:t}}}catch{}},async set(e){if(t)try{t.setItem(am,JSON.stringify(e))}catch{}}}}(),cluster:(t=u?.rpcEndpoint)?/devnet/i.test(t)?"devnet":/testnet/i.test(t)?"testnet":"mainnet-beta":"mainnet-beta",onWalletNotFound:a$})},[c,u?.rpcEndpoint]),f=(0,G.useMemo)(()=>null==h||-1!==c.indexOf(h)?c:[h,...c],[c,h]),[d,p]=(a=(s=(0,G.useState)(()=>{try{let t=localStorage.getItem(n);if(t)return JSON.parse(t)}catch(t){"u">typeof window&&console.error(t)}return null}))[0],l=(0,G.useRef)(!0),(0,G.useEffect)(()=>{if(l.current){l.current=!1;return}try{null===a?localStorage.removeItem(n):localStorage.setItem(n,JSON.stringify(a))}catch(t){"u">typeof window&&console.error(t)}},[a,n]),s),g=(0,G.useMemo)(()=>f.find(t=>t.name===d)??null,[f,d]),m=(0,G.useCallback)(t=>{d!==t&&(g&&g.name!==az&&g.disconnect(),p(t))},[g,p,d]);(0,G.useEffect)(()=>{if(g)return g.on("disconnect",t),()=>{g.off("disconnect",t)};function t(){w.current||p(null)}},[g,c,p,d]);let y=(0,G.useRef)(!1),b=(0,G.useMemo)(()=>{if(r&&g)return async()=>{(!0===r||await r(g))&&(y.current?await g.connect():await g.autoConnect())}},[r,g]),w=(0,G.useRef)(!1);(0,G.useEffect)(()=>{if(d===az&&li(c)){w.current=!1;return}function t(){w.current=!0}return window.addEventListener("beforeunload",t),()=>{window.removeEventListener("beforeunload",t)}},[c,d]);let v=(0,G.useCallback)(()=>{g&&m(null)},[g,m]),x=(0,G.useCallback)(t=>{y.current=!0,m(t)},[m]);return G.default.createElement(ln,{wallets:f,adapter:g,isUnloadingRef:w,onAutoConnectRequest:b,onConnectError:v,onError:i,onSelectWallet:x},t)}var ls=t.i(86614),la=t.i(74080);let ll=({id:t,children:e,expanded:r=!1})=>{let n=(0,G.useRef)(null),i=(0,G.useRef)(!0);return(0,G.useLayoutEffect)(()=>{if(r){let t;(t=n.current)&&requestAnimationFrame(()=>{t.style.height=t.scrollHeight+"px"})}else{let t;(t=n.current)&&requestAnimationFrame(()=>{t.style.height=t.offsetHeight+"px",t.style.overflow="hidden",requestAnimationFrame(()=>{t.style.height="0"})})}},[r]),(0,G.useLayoutEffect)(()=>{let t=n.current;if(t)return i.current&&(e(),i.current=!1),t.addEventListener("transitionend",o),()=>t.removeEventListener("transitionend",o);function e(){t&&(t.style.overflow=r?"initial":"hidden",r&&(t.style.height="auto"))}function o(r){t&&r.target===t&&"height"===r.propertyName&&e()}},[r]),G.default.createElement("div",{className:"wallet-adapter-collapse",id:t,ref:n,role:"region",style:{height:0,transition:i.current?void 0:"height 250ms ease-out"}},e)},lu=t=>G.default.createElement("button",{className:`wallet-adapter-button ${t.className||""}`,disabled:t.disabled,style:t.style,onClick:t.onClick,tabIndex:t.tabIndex||0,type:"button"},t.startIcon&&G.default.createElement("i",{className:"wallet-adapter-button-start-icon"},t.startIcon),t.children,t.endIcon&&G.default.createElement("i",{className:"wallet-adapter-button-end-icon"},t.endIcon)),lc=({wallet:t,...e})=>t&&G.default.createElement("img",{src:t.adapter.icon,alt:`${t.adapter.name} icon`,...e}),lh=({handleClick:t,tabIndex:e,wallet:r})=>G.default.createElement("li",null,G.default.createElement(lu,{onClick:t,startIcon:G.default.createElement(lc,{wallet:r}),tabIndex:e},r.adapter.name,r.readyState===p.Installed&&G.default.createElement("span",null,"Detected"))),lf=()=>G.default.createElement("svg",{width:"97",height:"96",viewBox:"0 0 97 96",fill:"none",xmlns:"http://www.w3.org/2000/svg"},G.default.createElement("circle",{cx:"48.5",cy:"48",r:"48",fill:"url(#paint0_linear_880_5115)",fillOpacity:"0.1"}
485),G.default.createElement("circle",{cx:"48.5",cy:"48",r:"47",stroke:"url(#paint1_linear_880_5115)",strokeOpacity:"0.4",strokeWidth:"2"}),G.default.createElement("g",{clipPath:"url(#clip0_880_5115)"},G.default.createElement("path",{d:"M65.5769 28.1523H31.4231C27.6057 28.1523 24.5 31.258 24.5 35.0754V60.9215C24.5 64.7389 27.6057 67.8446 31.4231 67.8446H65.5769C69.3943 67.8446 72.5 64.7389 72.5 60.9215V35.0754C72.5 31.258 69.3943 28.1523 65.5769 28.1523ZM69.7308 52.1523H59.5769C57.2865 52.1523 55.4231 50.289 55.4231 47.9985C55.4231 45.708 57.2864 43.8446 59.5769 43.8446H69.7308V52.1523ZM69.7308 41.0754H59.5769C55.7595 41.0754 52.6539 44.1811 52.6539 47.9985C52.6539 51.8159 55.7595 54.9215 59.5769 54.9215H69.7308V60.9215C69.7308 63.2119 67.8674 65.0754 65.5769 65.0754H31.4231C29.1327 65.0754 27.2692 63.212 27.2692 60.9215V35.0754C27.2692 32.785 29.1326 30.9215 31.4231 30.9215H65.5769C67.8673 30.9215 69.7308 32.7849 69.7308 35.0754V41.0754Z",fill:"url(#paint2_linear_880_5115)"}),G.default.createElement("path",{d:"M61.4231 46.6172H59.577C58.8123 46.6172 58.1924 47.2371 58.1924 48.0018C58.1924 48.7665 58.8123 49.3863 59.577 49.3863H61.4231C62.1878 49.3863 62.8077 48.7664 62.8077 48.0018C62.8077 47.2371 62.1878 46.6172 61.4231 46.6172Z",fill:"url(#paint3_linear_880_5115)"})),G.default.createElement("defs",null,G.default.createElement("linearGradient",{id:"paint0_linear_880_5115",x1:"3.41664",y1:"98.0933",x2:"103.05",y2:"8.42498",gradientUnits:"userSpaceOnUse"},G.default.createElement("stop",{stopColor:"#9945FF"}),G.default.createElement("stop",{offset:"0.14",stopColor:"#8A53F4"}),G.default.createElement("stop",{offset:"0.42",stopColor:"#6377D6"}),G.default.createElement("stop",{offset:"0.79",stopColor:"#24B0A7"}),G.default.createElement("stop",{offset:"0.99",stopColor:"#00D18C"}),G.default.createElement("stop",{offset:"1",stopColor:"#00D18C"})),G.default.createElement("linearGradient",{id:"paint1_linear_880_5115",x1:"3.41664",y1:"98.0933",x2:"103.05",y2:"8.42498",gradientUnits:"userSpaceOnUse"},G.default.createElement("stop",{stopColor:"#9945FF"}),G.default.createElement("stop",{offset:"0.14",stopColor:"#8A53F4"}),G.default.createElement("stop",{offset:"0.42",stopColor:"#6377D6"}),G.default.createElement("stop",{offset:"0.79",stopColor:"#24B0A7"}),G.default.createElement("stop",{offset:"0.99",stopColor:"#00D18C"}),G.default.createElement("stop",{offset:"1",stopColor:"#00D18C"})),G.default.createElement("linearGradient",{id:"paint2_linear_880_5115",x1:"25.9583",y1:"68.7101",x2:"67.2337",y2:"23.7879",gradientUnits:"userSpaceOnUse"},G.default.createElement("stop",{stopColor:"#9945FF"}),G.default.createElement("stop",{offset:"0.14",stopColor:"#8A53F4"}),G.default.createElement("stop",{offset:"0.42",stopColor:"#6377D6"}),G.default.createElement("stop",{offset:"0.79",stopColor:"#24B0A7"}),G.default.createElement("stop",{offset:"0.99",stopColor:"#00D18C"}),G.default.createElement("stop",{offset:"1",stopColor:"#00D18C"})),G.default.createElement("linearGradient",{id:"paint3_linear_880_5115",x1:"58.3326",y1:"49.4467",x2:"61.0002",y2:"45.4453",gradientUnits:"userSpaceOnUse"},G.default.createElement("stop",{stopColor:"#9945FF"}),G.default.createElement("stop",{offset:"0.14",stopColor:"#8A53F4"}),G.default.createElement("stop",{offset:"0.42",stopColor:"#6377D6"}),G.default.createElement("stop",{offset:"0.79",stopColor:"#24B0A7"}),G.default.createElement("stop",{offset:"0.99",stopColor:"#00D18C"}),G.default.createElement("stop",{offset:"1",stopColor:"#00D18C"})),G.default.createElement("clipPath",{id:"clip0_880_5115"},G.default.createElement("rect",{width:"48",height:"48",fill:"white",transform:"translate(24.5 24)"}
485)))),ld=({className:t="",container:e="body"})=>{let r=(0,G.useRef)(null),{wallets:n,select:i}=(0,lr.useWallet)(),{setVisible:o}=(0,ls.useWalletModal)(),[s,a]=(0,G.useState)(!1),[l,u]=(0,G.useState)(!1),[c,h]=(0,G.useState)(null),[f,d]=(0,G.useMemo)(()=>{let t=[],e=[];for(let r of n)r.readyState===p.Installed?t.push(r):e.push(r);return t.length?[t,e]:[e,[]]},[n]),g=(0,G.useCallback)(()=>{u(!1),setTimeout(()=>o(!1),150)},[o]),m=(0,G.useCallback)(t=>{t.preventDefault(),g()},[g]),y=(0,G.useCallback)((t,e)=>{i(e),m(t)},[i,m]),b=(0,G.useCallback)(()=>a(!s),[s]),w=(0,G.useCallback)(t=>{let e=r.current;if(!e)return;let n=e.querySelectorAll("button"),i=n[0],o=n[n.length-1];t.shiftKey?document.activeElement===i&&(o.focus(),t.preventDefault()):document.activeElement===o&&(i.focus(),t.preventDefault())},[r]);return(0,G.useLayoutEffect)(()=>{let t=t=>{"Escape"===t.key?g():"Tab"===t.key&&w(t)},{overflow:e}=window.getComputedStyle(document.body);return setTimeout(()=>u(!0),0),document.body.style.overflow="hidden",window.addEventListener("keydown",t,!1),()=>{document.body.style.overflow=e,window.removeEventListener("keydown",t,!1)}},[g,w]),(0,G.useLayoutEffect)(()=>h(document.querySelector(e)),[e]),c&&(0,la.createPortal)(G.default.createElement("div",{"aria-labelledby":"wallet-adapter-modal-title","aria-modal":"true",className:`wallet-adapter-modal ${l&&"wallet-adapter-modal-fade-in"} ${t}`,ref:r,role:"dialog"},G.default.createElement("div",{className:"wallet-adapter-modal-container"},G.default.createElement("div",{className:"wallet-adapter-modal-wrapper"},G.default.createElement("button",{onClick:m,className:"wallet-adapter-modal-button-close"},G.default.createElement("svg",{width:"14",height:"14"},G.default.createElement("path",{d:"M14 12.461 8.3 6.772l5.234-5.233L12.006 0 6.772 5.234 1.54 0 0 1.539l5.234 5.233L0 12.006l1.539 1.528L6.772 8.3l5.69 5.7L14 12.461z"}))),f.length?G.default.createElement(G.default.Fragment,null,G.default.createElement("h1",{className:"wallet-adapter-modal-title"},"Connect a wallet on Solana to continue"),G.default.createElement("ul",{className:"wallet-adapter-modal-list"},f.map(t=>G.default.createElement(lh,{key:t.adapter.name,handleClick:e=>y(e,t.adapter.name),wallet:t})),d.length?G.default.createElement(ll,{expanded:s,id:"wallet-adapter-modal-collapse"},d.map(t=>G.default.createElement(lh,{key:t.adapter.name,handleClick:e=>y(e,t.adapter.name),tabIndex:s?0:-1,wallet:t}))):null),d.length?G.default.createElement("button",{className:"wallet-adapter-modal-list-more",onClick:b,tabIndex:0},G.default.createElement("span",null,s?"Less ":"More ","options"),G.default.createElement("svg",{width:"13",height:"7",viewBox:"0 0 13 7",xmlns:"http://www.w3.org/2000/svg",className:`${s?"wallet-adapter-modal-list-more-icon-rotate":""}`},G.default.createElement("path",{d:"M0.71418 1.626L5.83323 6.26188C5.91574 6.33657 6.0181 6.39652 6.13327 6.43762C6.24844 6.47872 6.37371 6.5 6.50048 6.5C6.62725 6.5 6.75252 6.47872 6.8677 6.43762C6.98287 6.39652 7.08523 6.33657 7.16774 6.26188L12.2868 1.626C12.7753 1.1835 12.3703 0.5 11.6195 0.5H1.37997C0.629216 0.5 0.224175 1.1835 0.71418 1.626Z"}))):null):G.default.createElement(G.default.Fragment,null,G.default.createElement("h1",{className:"wallet-adapter-modal-title"},"You'll need a wallet on Solana to continue"),G.default.createElement("div",{className:"wallet-adapter-modal-middle"},G.default.createElement(lf,null)),d.length?G.default.createElement(G.default.Fragment,null,G.default.createElement("button",{className:"wallet-adapter-modal-list-more",onClick:b,tabIndex:0},G.default.createElement("span",null,s?"Hide ":"Already have a wallet? View ","options"),G.default.createElement("svg",{width:"13",height:"7",viewBox:"0 0 13 7",xmlns:"http://www.w3.org/2000/svg",className:`${s?"wallet-adapter-modal-list-more-icon-rotate":""}`},G.default.createElement("path",{d:"M0.71418 1.626L5.83323 6.26188C5.91574 6.33657 6.0181 6.39652 6.13327 6.43762C6.24844 6.47872 6.37371 6.5 6.50048 6.5C6.62725 6.5 6.75252 6.47872 6.8677 6.43762C6.98287 6.39652 7.08523 6.33657 7.16774 6.26188L12.2868 1.626C12.7753 1.1835 12.3703 0.5 11.6195 0.5H1.37997C0.629216 0.5 0.224175 1.1835 0.71418 1.626Z"}))),G.default.createElement(ll,{expanded:s,id:"wallet-adapter-modal-collapse"},G.default.createElement("ul",{className:"wallet-adapter-modal-list"},d.map(t=>G.default.createElement(lh,{key:t.adapter.name,handleClick:e=>y(e,t.adapter.name),tabIndex:s?0:-1,wallet:t}))))):null))),G.default.createElement("div",{className:"wallet-adapter-modal-overlay",onMouseDown:m})),c)},lp=({children:t,...e})=>{let[r,n]=(0,G.useState)(!1);return G.default.createElement(ls.WalletModalContext.Provider,{value:{visible:r,setVisible:n}},t,r&&G.default.createElement(ld,{...e}))};function lg({children:t}){let e=(0,G.useCallback)(t=>{"WalletConnectionError"===t.name||"WalletDisconnectedError"===t.name||"WalletNotConnectedError"===t.name||t instanceof sf||t.message?.toLowerCase().includes("user rejected")||console.error("[wallet]",t.name,t.message)},[]);return(0,P.jsx)(su,{endpoint:"https://april-ybrd7e-fast-mainnet.helius-rpc.com",children:(0,P.jsx)(lo,{wallets:[],autoConnect:!0,onError:e,children:(0,P.jsx)(lp,{children:t})})})}t.s(["Providers",0,function({children:t}){let[e]=(0,G.useState)(()=>new $({defaultOptions:{queries:{staleTime:6e4,refetchOnWindowFocus:!1}}}));return(0,P.jsx)(Z.QueryClientProvider,{client:e,children:(0,P.jsx)(lg,{children:t})})}],28739)}]);

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.