From 9f7af7bf08d7ba600d1affcb5f36ea43a4a6d42e Mon Sep 17 00:00:00 2001 From: ChiefWoods <chii.yuen@hotmail.com> Date: Mon, 30 Sep 2024 23:57:36 +0800 Subject: [PATCH] Build project --- assets/index-B9_xebrr.js | 3 + assets/index-CmbStJ2c.js | 125 ++++++++++++++++++++++++ assets/index-DDrF5s2C.css | 1 + assets/index-EO_1_XDp.js | 3 + assets/index-wcjhZ_fi.js | 1 + assets/message-square-more-ddp2B-0G.svg | 1 + index.html | 14 +++ 7 files changed, 148 insertions(+) create mode 100644 assets/index-B9_xebrr.js create mode 100644 assets/index-CmbStJ2c.js create mode 100644 assets/index-DDrF5s2C.css create mode 100644 assets/index-EO_1_XDp.js create mode 100644 assets/index-wcjhZ_fi.js create mode 100644 assets/message-square-more-ddp2B-0G.svg create mode 100644 index.html diff --git a/assets/index-B9_xebrr.js b/assets/index-B9_xebrr.js new file mode 100644 index 0000000..6029497 --- /dev/null +++ b/assets/index-B9_xebrr.js @@ -0,0 +1,3 @@ +import{g as G,P as z,T as D,V as F}from"./index-CmbStJ2c.js";var B={exports:{}};(function(s){var o=Object.prototype.hasOwnProperty,r="~";function e(){}Object.create&&(e.prototype=Object.create(null),new e().__proto__||(r=!1));function t(u,i,l){this.fn=u,this.context=i,this.once=l||!1}function n(u,i,l,f,g){if(typeof l!="function")throw new TypeError("The listener must be a function");var h=new t(l,f||u,g),p=r?r+i:i;return u._events[p]?u._events[p].fn?u._events[p]=[u._events[p],h]:u._events[p].push(h):(u._events[p]=h,u._eventsCount++),u}function a(u,i){--u._eventsCount===0?u._events=new e:delete u._events[i]}function c(){this._events=new e,this._eventsCount=0}c.prototype.eventNames=function(){var i=[],l,f;if(this._eventsCount===0)return i;for(f in l=this._events)o.call(l,f)&&i.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(l)):i},c.prototype.listeners=function(i){var l=r?r+i:i,f=this._events[l];if(!f)return[];if(f.fn)return[f.fn];for(var g=0,h=f.length,p=new Array(h);g<h;g++)p[g]=f[g].fn;return p},c.prototype.listenerCount=function(i){var l=r?r+i:i,f=this._events[l];return f?f.fn?1:f.length:0},c.prototype.emit=function(i,l,f,g,h,p){var w=r?r+i:i;if(!this._events[w])return!1;var d=this._events[w],_=arguments.length,y,v;if(d.fn){switch(d.once&&this.removeListener(i,d.fn,void 0,!0),_){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,l),!0;case 3:return d.fn.call(d.context,l,f),!0;case 4:return d.fn.call(d.context,l,f,g),!0;case 5:return d.fn.call(d.context,l,f,g,h),!0;case 6:return d.fn.call(d.context,l,f,g,h,p),!0}for(v=1,y=new Array(_-1);v<_;v++)y[v-1]=arguments[v];d.fn.apply(d.context,y)}else{var x=d.length,b;for(v=0;v<x;v++)switch(d[v].once&&this.removeListener(i,d[v].fn,void 0,!0),_){case 1:d[v].fn.call(d[v].context);break;case 2:d[v].fn.call(d[v].context,l);break;case 3:d[v].fn.call(d[v].context,l,f);break;case 4:d[v].fn.call(d[v].context,l,f,g);break;default:if(!y)for(b=1,y=new Array(_-1);b<_;b++)y[b-1]=arguments[b];d[v].fn.apply(d[v].context,y)}}return!0},c.prototype.on=function(i,l,f){return n(this,i,l,f,!1)},c.prototype.once=function(i,l,f){return n(this,i,l,f,!0)},c.prototype.removeListener=function(i,l,f,g){var h=r?r+i:i;if(!this._events[h])return this;if(!l)return a(this,h),this;var p=this._events[h];if(p.fn)p.fn===l&&(!g||p.once)&&(!f||p.context===f)&&a(this,h);else{for(var w=0,d=[],_=p.length;w<_;w++)(p[w].fn!==l||g&&!p[w].once||f&&p[w].context!==f)&&d.push(p[w]);d.length?this._events[h]=d.length===1?d[0]:d:a(this,h)}return this},c.prototype.removeAllListeners=function(i){var l;return i?(l=r?r+i:i,this._events[l]&&a(this,l)):(this._events=new e,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,s.exports=c})(B);var Q=B.exports;const L=G(Q);var X=function(){var s=function(o,r){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},s(o,r)};return function(o,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");s(o,r);function e(){this.constructor=o}o.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}}(),J=function(s){X(o,s);function o(){return s!==null&&s.apply(this,arguments)||this}return o}(L);function Y(s){if(s.length>=255)throw new TypeError("Alphabet too long");for(var o=new Uint8Array(256),r=0;r<o.length;r++)o[r]=255;for(var e=0;e<s.length;e++){var t=s.charAt(e),n=t.charCodeAt(0);if(o[n]!==255)throw new TypeError(t+" is ambiguous");o[n]=e}var a=s.length,c=s.charAt(0),u=Math.log(a)/Math.log(256),i=Math.log(256)/Math.log(a);function l(h){if(h instanceof Uint8Array||(ArrayBuffer.isView(h)?h=new Uint8Array(h.buffer,h.byteOffset,h.byteLength):Array.isArray(h)&&(h=Uint8Array.from(h))),!(h instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(h.length===0)return"";for(var p=0,w=0,d=0,_=h.length;d!==_&&h[d]===0;)d++,p++;for(var y=(_-d)*i+1>>>0,v=new Uint8Array(y);d!==_;){for(var x=h[d],b=0,E=y-1;(x!==0||b<w)&&E!==-1;E--,b++)x+=256*v[E]>>>0,v[E]=x%a>>>0,x=x/a>>>0;if(x!==0)throw new Error("Non-zero carry");w=b,d++}for(var S=y-w;S!==y&&v[S]===0;)S++;for(var R=c.repeat(p);S<y;++S)R+=s.charAt(v[S]);return R}function f(h){if(typeof h!="string")throw new TypeError("Expected String");if(h.length===0)return new Uint8Array;for(var p=0,w=0,d=0;h[p]===c;)w++,p++;for(var _=(h.length-p)*u+1>>>0,y=new Uint8Array(_);h[p];){var v=o[h.charCodeAt(p)];if(v===255)return;for(var x=0,b=_-1;(v!==0||x<d)&&b!==-1;b--,x++)v+=a*y[b]>>>0,y[b]=v%256>>>0,v=v/256>>>0;if(v!==0)throw new Error("Non-zero carry");d=x,p++}for(var E=_-d;E!==_&&y[E]===0;)E++;for(var S=new Uint8Array(w+(_-E)),R=w;E!==_;)S[R++]=y[E++];return S}function g(h){var p=f(h);if(p)return p;throw new Error("Non-base"+a+" character")}return{encode:l,decodeUnsafe:f,decode:g}}var Z=Y;const ee=Z,ne="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";var te=ee(ne);const A=G(te);var re=function(){var s=function(o,r){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},s(o,r)};return function(o,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");s(o,r);function e(){this.constructor=o}o.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}}(),q=function(){return q=Object.assign||function(s){for(var o,r=1,e=arguments.length;r<e;r++){o=arguments[r];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(s[t]=o[t])}return s},q.apply(this,arguments)},W=function(s,o,r,e){function t(n){return n instanceof r?n:new r(function(a){a(n)})}return new(r||(r=Promise))(function(n,a){function c(l){try{i(e.next(l))}catch(f){a(f)}}function u(l){try{i(e.throw(l))}catch(f){a(f)}}function i(l){l.done?n(l.value):t(l.value).then(c,u)}i((e=e.apply(s,o||[])).next())})},K=function(s,o){var r={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},e,t,n,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(i){return function(l){return u([i,l])}}function u(i){if(e)throw new TypeError("Generator is already executing.");for(;a&&(a=0,i[0]&&(r=0)),r;)try{if(e=1,t&&(n=i[0]&2?t.return:i[0]?t.throw||((n=t.return)&&n.call(t),0):t.next)&&!(n=n.call(t,i[1])).done)return n;switch(t=0,n&&(i=[i[0]&2,n.value]),i[0]){case 0:case 1:n=i;break;case 4:return r.label++,{value:i[1],done:!1};case 5:r.label++,t=i[1],i=[0];continue;case 7:i=r.ops.pop(),r.trys.pop();continue;default:if(n=r.trys,!(n=n.length>0&&n[n.length-1])&&(i[0]===6||i[0]===2)){r=0;continue}if(i[0]===3&&(!n||i[1]>n[0]&&i[1]<n[3])){r.label=i[1];break}if(i[0]===6&&r.label<n[1]){r.label=n[1],n=i;break}if(n&&r.label<n[2]){r.label=n[2],r.ops.push(i);break}n[2]&&r.ops.pop(),r.trys.pop();continue}i=o.call(s,r)}catch(l){i=[6,l],t=0}finally{e=n=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}},$=function(s,o){var r=typeof Symbol=="function"&&s[Symbol.iterator];if(!r)return s;var e=r.call(s),t,n=[],a;try{for(;(o===void 0||o-- >0)&&!(t=e.next()).done;)n.push(t.value)}catch(c){a={error:c}}finally{try{t&&!t.done&&(r=e.return)&&r.call(e)}finally{if(a)throw a.error}}return n},ie=function(s){re(o,s);function o(r,e){var t=s.call(this)||this;if(t._handleMessage=function(n){if(t._injectedProvider&&n.source===window||n.origin===t._providerUrl.origin&&n.source===t._popup){if(n.data.method==="connected"){var a=new z(n.data.params.publicKey);(!t._publicKey||!t._publicKey.equals(a))&&(t._publicKey&&!t._publicKey.equals(a)&&t._handleDisconnect(),t._publicKey=a,t._autoApprove=!!n.data.params.autoApprove,t.emit("connect",t._publicKey))}else if(n.data.method==="disconnected")t._handleDisconnect();else if((n.data.result||n.data.error)&&t._responsePromises.has(n.data.id)){var c=$(t._responsePromises.get(n.data.id),2),u=c[0],i=c[1];n.data.result?u(n.data.result):i(new Error(n.data.error))}}},t._handleConnect=function(){return t._handlerAdded||(t._handlerAdded=!0,window.addEventListener("message",t._handleMessage),window.addEventListener("beforeunload",t.disconnect)),t._injectedProvider?new Promise(function(n){t._sendRequest("connect",{}),n()}):(window.name="parent",t._popup=window.open(t._providerUrl.toString(),"_blank","location,resizable,width=460,height=675"),new Promise(function(n){t.once("connect",n)}))},t._handleDisconnect=function(){t._handlerAdded&&(t._handlerAdded=!1,window.removeEventListener("message",t._handleMessage),window.removeEventListener("beforeunload",t.disconnect)),t._publicKey&&(t._publicKey=null,t.emit("disconnect")),t._responsePromises.forEach(function(n,a){var c=$(n,2);c[0];var u=c[1];t._responsePromises.delete(a),u("Wallet disconnected")})},t._sendRequest=function(n,a){return W(t,void 0,void 0,function(){var c,u=this;return K(this,function(i){if(n!=="connect"&&!this.connected)throw new Error("Wallet not connected");return c=this._nextRequestId,++this._nextRequestId,[2,new Promise(function(l,f){u._responsePromises.set(c,[l,f]),u._injectedProvider?u._injectedProvider.postMessage({jsonrpc:"2.0",id:c,method:n,params:q({network:u._network},a)}):(u._popup.postMessage({jsonrpc:"2.0",id:c,method:n,params:a},u._providerUrl.origin),u.autoApprove||u._popup.focus())})]})})},t.connect=function(){return t._popup&&t._popup.close(),t._handleConnect()},t.disconnect=function(){return W(t,void 0,void 0,function(){return K(this,function(n){switch(n.label){case 0:return this._injectedProvider?[4,this._sendRequest("disconnect",{})]:[3,2];case 1:n.sent(),n.label=2;case 2:return this._popup&&this._popup.close(),this._handleDisconnect(),[2]}})})},t.sign=function(n,a){return W(t,void 0,void 0,function(){var c,u,i;return K(this,function(l){switch(l.label){case 0:if(!(n instanceof Uint8Array))throw new Error("Data must be an instance of Uint8Array");return[4,this._sendRequest("sign",{data:n,display:a})];case 1:return c=l.sent(),u=A.decode(c.signature),i=new z(c.publicKey),[2,{signature:u,publicKey:i}]}})})},ae(r))t._injectedProvider=r;else if(oe(r))t._providerUrl=new URL(r),t._providerUrl.hash=new URLSearchParams({origin:window.location.origin,network:e}).toString();else throw new Error("provider parameter must be an injected provider or a URL string.");return t._network=e,t._publicKey=null,t._autoApprove=!1,t._popup=null,t._handlerAdded=!1,t._nextRequestId=1,t._responsePromises=new Map,t}return Object.defineProperty(o.prototype,"publicKey",{get:function(){return this._publicKey},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"connected",{get:function(){return this._publicKey!==null},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"autoApprove",{get:function(){return this._autoApprove},enumerable:!1,configurable:!0}),o}(L);function oe(s){return typeof s=="string"}function ae(s){return se(s)&&ce(s.postMessage)}function se(s){return typeof s=="object"&&s!==null}function ce(s){return typeof s=="function"}var le=function(){var s=function(o,r){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},s(o,r)};return function(o,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");s(o,r);function e(){this.constructor=o}o.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}}(),j=function(s,o,r,e){function t(n){return n instanceof r?n:new r(function(a){a(n)})}return new(r||(r=Promise))(function(n,a){function c(l){try{i(e.next(l))}catch(f){a(f)}}function u(l){try{i(e.throw(l))}catch(f){a(f)}}function i(l){l.done?n(l.value):t(l.value).then(c,u)}i((e=e.apply(s,o||[])).next())})},T=function(s,o){var r={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},e,t,n,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(i){return function(l){return u([i,l])}}function u(i){if(e)throw new TypeError("Generator is already executing.");for(;a&&(a=0,i[0]&&(r=0)),r;)try{if(e=1,t&&(n=i[0]&2?t.return:i[0]?t.throw||((n=t.return)&&n.call(t),0):t.next)&&!(n=n.call(t,i[1])).done)return n;switch(t=0,n&&(i=[i[0]&2,n.value]),i[0]){case 0:case 1:n=i;break;case 4:return r.label++,{value:i[1],done:!1};case 5:r.label++,t=i[1],i=[0];continue;case 7:i=r.ops.pop(),r.trys.pop();continue;default:if(n=r.trys,!(n=n.length>0&&n[n.length-1])&&(i[0]===6||i[0]===2)){r=0;continue}if(i[0]===3&&(!n||i[1]>n[0]&&i[1]<n[3])){r.label=i[1];break}if(i[0]===6&&r.label<n[1]){r.label=n[1],n=i;break}if(n&&r.label<n[2]){r.label=n[2],r.ops.push(i);break}n[2]&&r.ops.pop(),r.trys.pop();continue}i=o.call(s,r)}catch(l){i=[6,l],t=0}finally{e=n=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}},ue=function(s){le(o,s);function o(r,e,t){var n=s.call(this)||this;return n._instance=null,n.handleMessage=function(a){},n._sendRequest=function(a,c){return j(n,void 0,void 0,function(){var u,i;return T(this,function(l){switch(l.label){case 0:return!((u=this._instance)===null||u===void 0)&&u.sendRequest?[4,this._instance.sendRequest(a,c)]:[3,2];case 1:return[2,l.sent()];case 2:return!((i=this._instance)===null||i===void 0)&&i._sendRequest?[4,this._instance._sendRequest(a,c)]:[3,4];case 3:return[2,l.sent()];case 4:throw new Error("Unsupported version of `@project-serum/sol-wallet-adapter`")}})})},n._handleConnect=function(){n.emit("connect")},n._handleDisconnect=function(){window.clearInterval(n._pollTimer),n.emit("disconnect")},n._network=e,n._provider=t,n}return Object.defineProperty(o.prototype,"publicKey",{get:function(){return this._instance.publicKey||null},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"connected",{get:function(){return this._instance.connected||!1},enumerable:!1,configurable:!0}),o.prototype.connect=function(){return j(this,void 0,void 0,function(){var r=this;return T(this,function(e){switch(e.label){case 0:return this._instance=new ie(this._provider,this._network),this._instance.on("connect",this._handleConnect),this._instance.on("disconnect",this._handleDisconnect),this._pollTimer=window.setInterval(function(){var t,n;((n=(t=r._instance)===null||t===void 0?void 0:t._popup)===null||n===void 0?void 0:n.closed)!==!1&&r._handleDisconnect()},200),[4,this._instance.connect()];case 1:return e.sent(),[2]}})})},o.prototype.disconnect=function(){return j(this,void 0,void 0,function(){return T(this,function(r){switch(r.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return this._instance.removeAllListeners("connect"),this._instance.removeAllListeners("disconnect"),[4,this._instance.disconnect()];case 1:return r.sent(),[2]}})})},o.prototype.signTransaction=function(r){return j(this,void 0,void 0,function(){var e;return T(this,function(t){switch(t.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return[4,this._sendRequest("signTransactionV2",{transaction:A.encode(r)})];case 1:return e=t.sent().transaction,[2,A.decode(e)]}})})},o.prototype.signAllTransactions=function(r){return j(this,void 0,void 0,function(){var e;return T(this,function(t){switch(t.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return[4,this._sendRequest("signAllTransactionsV2",{transactions:r.map(function(n){return A.encode(n)})})];case 1:return e=t.sent().transactions,[2,e.map(function(n){return A.decode(n)})]}})})},o.prototype.signAndSendTransaction=function(r,e){return j(this,void 0,void 0,function(){var t;return T(this,function(n){switch(n.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return[4,this._sendRequest("signAndSendTransaction",{transaction:A.encode(r),options:e})];case 1:return t=n.sent(),[2,t.signature]}})})},o.prototype.signMessage=function(r,e){return e===void 0&&(e="hex"),j(this,void 0,void 0,function(){var t;return T(this,function(n){switch(n.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return[4,this._instance.sign(r,e)];case 1:return t=n.sent().signature,[2,Uint8Array.from(t)]}})})},o}(J);let C;const fe=new Uint8Array(16);function de(){if(!C&&(C=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!C))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return C(fe)}const m=[];for(let s=0;s<256;++s)m.push((s+256).toString(16).slice(1));function he(s,o=0){return m[s[o+0]]+m[s[o+1]]+m[s[o+2]]+m[s[o+3]]+"-"+m[s[o+4]]+m[s[o+5]]+"-"+m[s[o+6]]+m[s[o+7]]+"-"+m[s[o+8]]+m[s[o+9]]+"-"+m[s[o+10]]+m[s[o+11]]+m[s[o+12]]+m[s[o+13]]+m[s[o+14]]+m[s[o+15]]}const pe=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),V={randomUUID:pe};function ve(s,o,r){if(V.randomUUID&&!o&&!s)return V.randomUUID();s=s||{};const e=s.random||(s.rng||de)();return e[6]=e[6]&15|64,e[8]=e[8]&63|128,he(e)}var _e=function(){var s=function(o,r){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},s(o,r)};return function(o,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");s(o,r);function e(){this.constructor=o}o.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}}(),H=function(){return H=Object.assign||function(s){for(var o,r=1,e=arguments.length;r<e;r++){o=arguments[r];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(s[t]=o[t])}return s},H.apply(this,arguments)},P=function(s,o,r,e){function t(n){return n instanceof r?n:new r(function(a){a(n)})}return new(r||(r=Promise))(function(n,a){function c(l){try{i(e.next(l))}catch(f){a(f)}}function u(l){try{i(e.throw(l))}catch(f){a(f)}}function i(l){l.done?n(l.value):t(l.value).then(c,u)}i((e=e.apply(s,o||[])).next())})},M=function(s,o){var r={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},e,t,n,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(i){return function(l){return u([i,l])}}function u(i){if(e)throw new TypeError("Generator is already executing.");for(;a&&(a=0,i[0]&&(r=0)),r;)try{if(e=1,t&&(n=i[0]&2?t.return:i[0]?t.throw||((n=t.return)&&n.call(t),0):t.next)&&!(n=n.call(t,i[1])).done)return n;switch(t=0,n&&(i=[i[0]&2,n.value]),i[0]){case 0:case 1:n=i;break;case 4:return r.label++,{value:i[1],done:!1};case 5:r.label++,t=i[1],i=[0];continue;case 7:i=r.ops.pop(),r.trys.pop();continue;default:if(n=r.trys,!(n=n.length>0&&n[n.length-1])&&(i[0]===6||i[0]===2)){r=0;continue}if(i[0]===3&&(!n||i[1]>n[0]&&i[1]<n[3])){r.label=i[1];break}if(i[0]===6&&r.label<n[1]){r.label=n[1],n=i;break}if(n&&r.label<n[2]){r.label=n[2],r.ops.push(i);break}n[2]&&r.ops.pop(),r.trys.pop();continue}i=o.call(s,r)}catch(l){i=[6,l],t=0}finally{e=n=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}},N=function(s){_e(o,s);function o(r,e){var t=this,n;return t=s.call(this)||this,t._publicKey=null,t._messageHandlers={},t.handleMessage=function(a){if(t._messageHandlers[a.id]){var c=t._messageHandlers[a.id],u=c.resolve,i=c.reject;delete t._messageHandlers[a.id],a.error?i(a.error):u(a.result)}},t._sendMessage=function(a){if(!t.connected)throw new Error("Wallet not connected");return new Promise(function(c,u){var i,l,f=ve();t._messageHandlers[f]={resolve:c,reject:u},(l=(i=t._iframe)===null||i===void 0?void 0:i.contentWindow)===null||l===void 0||l.postMessage({channel:"solflareWalletAdapterToIframe",data:H({id:f},a)},"*")})},t._iframe=r,t._publicKey=new z((n=e==null?void 0:e.toString)===null||n===void 0?void 0:n.call(e)),t}return Object.defineProperty(o.prototype,"publicKey",{get:function(){return this._publicKey||null},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"connected",{get:function(){return!0},enumerable:!1,configurable:!0}),o.prototype.connect=function(){return P(this,void 0,void 0,function(){return M(this,function(r){return[2]})})},o.prototype.disconnect=function(){return P(this,void 0,void 0,function(){return M(this,function(r){switch(r.label){case 0:return[4,this._sendMessage({method:"disconnect"})];case 1:return r.sent(),[2]}})})},o.prototype.signTransaction=function(r){var e;return P(this,void 0,void 0,function(){var t,n;return M(this,function(a){switch(a.label){case 0:if(!this.connected)throw new Error("Wallet not connected");a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this._sendMessage({method:"signTransaction",params:{transaction:A.encode(r)}})];case 2:return t=a.sent(),[2,A.decode(t)];case 3:throw n=a.sent(),new Error(((e=n==null?void 0:n.toString)===null||e===void 0?void 0:e.call(n))||"Failed to sign transaction");case 4:return[2]}})})},o.prototype.signAllTransactions=function(r){var e;return P(this,void 0,void 0,function(){var t,n;return M(this,function(a){switch(a.label){case 0:if(!this.connected)throw new Error("Wallet not connected");a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this._sendMessage({method:"signAllTransactions",params:{transactions:r.map(function(c){return A.encode(c)})}})];case 2:return t=a.sent(),[2,t.map(function(c){return A.decode(c)})];case 3:throw n=a.sent(),new Error(((e=n==null?void 0:n.toString)===null||e===void 0?void 0:e.call(n))||"Failed to sign transactions");case 4:return[2]}})})},o.prototype.signAndSendTransaction=function(r,e){var t;return P(this,void 0,void 0,function(){var n,a;return M(this,function(c){switch(c.label){case 0:if(!this.connected)throw new Error("Wallet not connected");c.label=1;case 1:return c.trys.push([1,3,,4]),[4,this._sendMessage({method:"signAndSendTransaction",params:{transaction:A.encode(r),options:e}})];case 2:return n=c.sent(),[2,n];case 3:throw a=c.sent(),new Error(((t=a==null?void 0:a.toString)===null||t===void 0?void 0:t.call(a))||"Failed to sign and send transaction");case 4:return[2]}})})},o.prototype.signMessage=function(r,e){var t;return e===void 0&&(e="hex"),P(this,void 0,void 0,function(){var n,a;return M(this,function(c){switch(c.label){case 0:if(!this.connected)throw new Error("Wallet not connected");c.label=1;case 1:return c.trys.push([1,3,,4]),[4,this._sendMessage({method:"signMessage",params:{data:r,display:e}})];case 2:return n=c.sent(),[2,Uint8Array.from(A.decode(n))];case 3:throw a=c.sent(),new Error(((t=a==null?void 0:a.toString)===null||t===void 0?void 0:t.call(a))||"Failed to sign message");case 4:return[2]}})})},o}(J);function U(s){return s.version===void 0}var ye="1.4.2",we=function(){var s=function(o,r){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},s(o,r)};return function(o,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");s(o,r);function e(){this.constructor=o}o.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}}(),k=function(){return k=Object.assign||function(s){for(var o,r=1,e=arguments.length;r<e;r++){o=arguments[r];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(s[t]=o[t])}return s},k.apply(this,arguments)},I=function(s,o,r,e){function t(n){return n instanceof r?n:new r(function(a){a(n)})}return new(r||(r=Promise))(function(n,a){function c(l){try{i(e.next(l))}catch(f){a(f)}}function u(l){try{i(e.throw(l))}catch(f){a(f)}}function i(l){l.done?n(l.value):t(l.value).then(c,u)}i((e=e.apply(s,o||[])).next())})},O=function(s,o){var r={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},e,t,n,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(i){return function(l){return u([i,l])}}function u(i){if(e)throw new TypeError("Generator is already executing.");for(;a&&(a=0,i[0]&&(r=0)),r;)try{if(e=1,t&&(n=i[0]&2?t.return:i[0]?t.throw||((n=t.return)&&n.call(t),0):t.next)&&!(n=n.call(t,i[1])).done)return n;switch(t=0,n&&(i=[i[0]&2,n.value]),i[0]){case 0:case 1:n=i;break;case 4:return r.label++,{value:i[1],done:!1};case 5:r.label++,t=i[1],i=[0];continue;case 7:i=r.ops.pop(),r.trys.pop();continue;default:if(n=r.trys,!(n=n.length>0&&n[n.length-1])&&(i[0]===6||i[0]===2)){r=0;continue}if(i[0]===3&&(!n||i[1]>n[0]&&i[1]<n[3])){r.label=i[1];break}if(i[0]===6&&r.label<n[1]){r.label=n[1],n=i;break}if(n&&r.label<n[2]){r.label=n[2],r.ops.push(i);break}n[2]&&r.ops.pop(),r.trys.pop();continue}i=o.call(s,r)}catch(l){i=[6,l],t=0}finally{e=n=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}},me=function(s){var o=typeof Symbol=="function"&&Symbol.iterator,r=o&&s[o],e=0;if(r)return r.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&e>=s.length&&(s=void 0),{value:s&&s[e++],done:!s}}};throw new TypeError(o?"Object is not iterable.":"Symbol.iterator is not defined.")},be=function(s){we(o,s);function o(r){var e=s.call(this)||this;return e._network="mainnet-beta",e._provider=null,e._iframeParams={},e._adapterInstance=null,e._element=null,e._iframe=null,e._connectHandler=null,e._flutterHandlerInterval=null,e._handleEvent=function(t){var n,a,c,u;switch(t.type){case"connect_native_web":{e._collapseIframe(),e._adapterInstance=new ue(e._iframe,e._network,((n=t.data)===null||n===void 0?void 0:n.provider)||e._provider||"https://solflare.com/provider"),e._adapterInstance.on("connect",e._webConnected),e._adapterInstance.on("disconnect",e._webDisconnected),e._adapterInstance.connect(),e._setPreferredAdapter("native_web");return}case"connect":{e._collapseIframe(),e._adapterInstance=new N(e._iframe,((a=t.data)===null||a===void 0?void 0:a.publicKey)||""),e._adapterInstance.connect(),e._setPreferredAdapter((c=t.data)===null||c===void 0?void 0:c.adapter),e._connectHandler&&(e._connectHandler.resolve(),e._connectHandler=null),e.emit("connect",e.publicKey);return}case"disconnect":{e._connectHandler&&(e._connectHandler.reject(),e._connectHandler=null),e._disconnected(),e.emit("disconnect");return}case"accountChanged":{!((u=t.data)===null||u===void 0)&&u.publicKey?(e._adapterInstance=new N(e._iframe,t.data.publicKey),e._adapterInstance.connect(),e.emit("accountChanged",e.publicKey)):e.emit("accountChanged",void 0);return}case"collapse":{e._collapseIframe();return}default:return}},e._handleResize=function(t){t.resizeMode==="full"?t.params.mode==="fullscreen"?e._expandIframe():t.params.mode==="hide"&&e._collapseIframe():t.resizeMode==="coordinates"&&e._iframe&&(e._iframe.style.top=isFinite(t.params.top)?"".concat(t.params.top,"px"):"",e._iframe.style.bottom=isFinite(t.params.bottom)?"".concat(t.params.bottom,"px"):"",e._iframe.style.left=isFinite(t.params.left)?"".concat(t.params.left,"px"):"",e._iframe.style.right=isFinite(t.params.right)?"".concat(t.params.right,"px"):"",e._iframe.style.width=isFinite(t.params.width)?"".concat(t.params.width,"px"):t.params.width,e._iframe.style.height=isFinite(t.params.height)?"".concat(t.params.height,"px"):t.params.height)},e._handleMessage=function(t){var n;if(((n=t.data)===null||n===void 0?void 0:n.channel)==="solflareIframeToWalletAdapter"){var a=t.data.data||{};a.type==="event"?e._handleEvent(a.event):a.type==="resize"?e._handleResize(a):a.type==="response"&&e._adapterInstance&&e._adapterInstance.handleMessage(a)}},e._removeElement=function(){e._flutterHandlerInterval!==null&&(clearInterval(e._flutterHandlerInterval),e._flutterHandlerInterval=null),e._element&&(e._element.remove(),e._element=null)},e._removeDanglingElements=function(){var t,n,a=document.getElementsByClassName("solflare-wallet-adapter-iframe");try{for(var c=me(a),u=c.next();!u.done;u=c.next()){var i=u.value;i.parentElement&&i.remove()}}catch(l){t={error:l}}finally{try{u&&!u.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}},e._injectElement=function(){e._removeElement(),e._removeDanglingElements();var t=k(k({},e._iframeParams),{cluster:e._network||"mainnet-beta",origin:window.location.origin||"",title:document.title||"",version:1,sdkVersion:ye}),n=e._getPreferredAdapter();n&&(t.adapter=n),e._provider&&(t.provider=e._provider);var a=Object.keys(t).map(function(u){return"".concat(u,"=").concat(encodeURIComponent(t[u]))}).join("&"),c="".concat(o.IFRAME_URL,"?").concat(a);e._element=document.createElement("div"),e._element.className="solflare-wallet-adapter-iframe",e._element.innerHTML=` + <iframe src='`.concat(c,`' referrerPolicy='strict-origin-when-cross-origin' style='position: fixed; top: 0; bottom: 0; left: 0; right: 0; width: 100%; height: 100%; border: none; border-radius: 0; z-index: 99999; color-scheme: auto;' allowtransparency='true'></iframe> + `),document.body.appendChild(e._element),e._iframe=e._element.querySelector("iframe"),window.fromFlutter=e._handleMobileMessage,e._flutterHandlerInterval=setInterval(function(){window.fromFlutter=e._handleMobileMessage},100),window.addEventListener("message",e._handleMessage,!1)},e._collapseIframe=function(){e._iframe&&(e._iframe.style.top="",e._iframe.style.right="",e._iframe.style.height="2px",e._iframe.style.width="2px")},e._expandIframe=function(){e._iframe&&(e._iframe.style.top="0px",e._iframe.style.bottom="0px",e._iframe.style.left="0px",e._iframe.style.right="0px",e._iframe.style.width="100%",e._iframe.style.height="100%")},e._getPreferredAdapter=function(){return localStorage&&localStorage.getItem("solflarePreferredWalletAdapter")||null},e._setPreferredAdapter=function(t){localStorage&&t&&localStorage.setItem("solflarePreferredWalletAdapter",t)},e._clearPreferredAdapter=function(){localStorage&&localStorage.removeItem("solflarePreferredWalletAdapter")},e._webConnected=function(){e._connectHandler&&(e._connectHandler.resolve(),e._connectHandler=null),e.emit("connect",e.publicKey)},e._webDisconnected=function(){e._connectHandler&&(e._connectHandler.reject(),e._connectHandler=null),e._disconnected(),e.emit("disconnect")},e._disconnected=function(){window.removeEventListener("message",e._handleMessage,!1),e._removeElement(),e._clearPreferredAdapter(),e._adapterInstance=null},e._handleMobileMessage=function(t){var n,a;(a=(n=e._iframe)===null||n===void 0?void 0:n.contentWindow)===null||a===void 0||a.postMessage({channel:"solflareMobileToIframe",data:t},"*")},r!=null&&r.network&&(e._network=r==null?void 0:r.network),r!=null&&r.provider&&(e._provider=r==null?void 0:r.provider),r!=null&&r.params&&(e._iframeParams=k({},r==null?void 0:r.params)),e}return Object.defineProperty(o.prototype,"publicKey",{get:function(){var r;return((r=this._adapterInstance)===null||r===void 0?void 0:r.publicKey)||null},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"isConnected",{get:function(){var r;return!!(!((r=this._adapterInstance)===null||r===void 0)&&r.connected)},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"connected",{get:function(){return this.isConnected},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"autoApprove",{get:function(){return!1},enumerable:!1,configurable:!0}),o.prototype.connect=function(){return I(this,void 0,void 0,function(){var r=this;return O(this,function(e){switch(e.label){case 0:return this.connected?[2]:(this._injectElement(),[4,new Promise(function(t,n){r._connectHandler={resolve:t,reject:n}})]);case 1:return e.sent(),[2]}})})},o.prototype.disconnect=function(){return I(this,void 0,void 0,function(){return O(this,function(r){switch(r.label){case 0:return this._adapterInstance?[4,this._adapterInstance.disconnect()]:[2];case 1:return r.sent(),this._disconnected(),this.emit("disconnect"),[2]}})})},o.prototype.signTransaction=function(r){return I(this,void 0,void 0,function(){var e,t;return O(this,function(n){switch(n.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return e=U(r)?Uint8Array.from(r.serialize({verifySignatures:!1,requireAllSignatures:!1})):r.serialize(),[4,this._adapterInstance.signTransaction(e)];case 1:return t=n.sent(),[2,U(r)?D.from(t):F.deserialize(t)]}})})},o.prototype.signAllTransactions=function(r){return I(this,void 0,void 0,function(){var e,t;return O(this,function(n){switch(n.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return e=r.map(function(a){return U(a)?Uint8Array.from(a.serialize({verifySignatures:!1,requireAllSignatures:!1})):a.serialize()}),[4,this._adapterInstance.signAllTransactions(e)];case 1:if(t=n.sent(),t.length!==r.length)throw new Error("Failed to sign all transactions");return[2,t.map(function(a,c){return U(r[c])?D.from(a):F.deserialize(a)})]}})})},o.prototype.signAndSendTransaction=function(r,e){return I(this,void 0,void 0,function(){var t;return O(this,function(n){switch(n.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return t=U(r)?r.serialize({verifySignatures:!1,requireAllSignatures:!1}):r.serialize(),[4,this._adapterInstance.signAndSendTransaction(t,e)];case 1:return[2,n.sent()]}})})},o.prototype.signMessage=function(r,e){return e===void 0&&(e="utf8"),I(this,void 0,void 0,function(){return O(this,function(t){switch(t.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return[4,this._adapterInstance.signMessage(r,e)];case 1:return[2,t.sent()]}})})},o.prototype.sign=function(r,e){return e===void 0&&(e="utf8"),I(this,void 0,void 0,function(){return O(this,function(t){switch(t.label){case 0:return[4,this.signMessage(r,e)];case 1:return[2,t.sent()]}})})},o.prototype.detectWallet=function(r){var e;return r===void 0&&(r=10),I(this,void 0,void 0,function(){return O(this,function(t){return window.SolflareApp||!((e=window.solflare)===null||e===void 0)&&e.isSolflare?[2,!0]:[2,new Promise(function(n){var a,c;a=setInterval(function(){var u;(window.SolflareApp||!((u=window.solflare)===null||u===void 0)&&u.isSolflare)&&(clearInterval(a),clearTimeout(c),n(!0))},500),c=setTimeout(function(){clearInterval(a),n(!1)},r*1e3)})]})})},o.IFRAME_URL="https://connect.solflare.com/",o}(L);export{be as default}; diff --git a/assets/index-CmbStJ2c.js b/assets/index-CmbStJ2c.js new file mode 100644 index 0000000..6a04ebc --- /dev/null +++ b/assets/index-CmbStJ2c.js @@ -0,0 +1,125 @@ +var i2=Object.defineProperty;var s2=(t,e,n)=>e in t?i2(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var En=(t,e,n)=>s2(t,typeof e!="symbol"?e+"":e,n);function o2(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var Cr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ro(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ph(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var OE={exports:{}},Bh={},CE={exports:{}},et={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var qu=Symbol.for("react.element"),a2=Symbol.for("react.portal"),c2=Symbol.for("react.fragment"),l2=Symbol.for("react.strict_mode"),u2=Symbol.for("react.profiler"),d2=Symbol.for("react.provider"),f2=Symbol.for("react.context"),h2=Symbol.for("react.forward_ref"),p2=Symbol.for("react.suspense"),g2=Symbol.for("react.memo"),y2=Symbol.for("react.lazy"),X_=Symbol.iterator;function m2(t){return t===null||typeof t!="object"?null:(t=X_&&t[X_]||t["@@iterator"],typeof t=="function"?t:null)}var LE={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},DE=Object.assign,PE={};function Gc(t,e,n){this.props=t,this.context=e,this.refs=PE,this.updater=n||LE}Gc.prototype.isReactComponent={};Gc.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};Gc.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function BE(){}BE.prototype=Gc.prototype;function Rm(t,e,n){this.props=t,this.context=e,this.refs=PE,this.updater=n||LE}var Nm=Rm.prototype=new BE;Nm.constructor=Rm;DE(Nm,Gc.prototype);Nm.isPureReactComponent=!0;var J_=Array.isArray,zE=Object.prototype.hasOwnProperty,Tm={current:null},jE={key:!0,ref:!0,__self:!0,__source:!0};function UE(t,e,n){var r,i={},s=null,o=null;if(e!=null)for(r in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)zE.call(e,r)&&!jE.hasOwnProperty(r)&&(i[r]=e[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var c=Array(a),l=0;l<a;l++)c[l]=arguments[l+2];i.children=c}if(t&&t.defaultProps)for(r in a=t.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:qu,type:t,key:s,ref:o,props:i,_owner:Tm.current}}function w2(t,e){return{$$typeof:qu,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function Mm(t){return typeof t=="object"&&t!==null&&t.$$typeof===qu}function _2(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var ev=/\/+/g;function a0(t,e){return typeof t=="object"&&t!==null&&t.key!=null?_2(""+t.key):e.toString(36)}function of(t,e,n,r,i){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case qu:case a2:o=!0}}if(o)return o=t,i=i(o),t=r===""?"."+a0(o,0):r,J_(i)?(n="",t!=null&&(n=t.replace(ev,"$&/")+"/"),of(i,e,n,"",function(l){return l})):i!=null&&(Mm(i)&&(i=w2(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(ev,"$&/")+"/")+t)),e.push(i)),1;if(o=0,r=r===""?".":r+":",J_(t))for(var a=0;a<t.length;a++){s=t[a];var c=r+a0(s,a);o+=of(s,e,n,c,i)}else if(c=m2(t),typeof c=="function")for(t=c.call(t),a=0;!(s=t.next()).done;)s=s.value,c=r+a0(s,a++),o+=of(s,e,n,c,i);else if(s==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return o}function Sd(t,e,n){if(t==null)return t;var r=[],i=0;return of(t,r,"","",function(s){return e.call(n,s,i++)}),r}function v2(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var ir={current:null},af={transition:null},b2={ReactCurrentDispatcher:ir,ReactCurrentBatchConfig:af,ReactCurrentOwner:Tm};function FE(){throw Error("act(...) is not supported in production builds of React.")}et.Children={map:Sd,forEach:function(t,e,n){Sd(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return Sd(t,function(){e++}),e},toArray:function(t){return Sd(t,function(e){return e})||[]},only:function(t){if(!Mm(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};et.Component=Gc;et.Fragment=c2;et.Profiler=u2;et.PureComponent=Rm;et.StrictMode=l2;et.Suspense=p2;et.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=b2;et.act=FE;et.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var r=DE({},t.props),i=t.key,s=t.ref,o=t._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,o=Tm.current),e.key!==void 0&&(i=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(c in e)zE.call(e,c)&&!jE.hasOwnProperty(c)&&(r[c]=e[c]===void 0&&a!==void 0?a[c]:e[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){a=Array(c);for(var l=0;l<c;l++)a[l]=arguments[l+2];r.children=a}return{$$typeof:qu,type:t.type,key:i,ref:s,props:r,_owner:o}};et.createContext=function(t){return t={$$typeof:f2,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:d2,_context:t},t.Consumer=t};et.createElement=UE;et.createFactory=function(t){var e=UE.bind(null,t);return e.type=t,e};et.createRef=function(){return{current:null}};et.forwardRef=function(t){return{$$typeof:h2,render:t}};et.isValidElement=Mm;et.lazy=function(t){return{$$typeof:y2,_payload:{_status:-1,_result:t},_init:v2}};et.memo=function(t,e){return{$$typeof:g2,type:t,compare:e===void 0?null:e}};et.startTransition=function(t){var e=af.transition;af.transition={};try{t()}finally{af.transition=e}};et.unstable_act=FE;et.useCallback=function(t,e){return ir.current.useCallback(t,e)};et.useContext=function(t){return ir.current.useContext(t)};et.useDebugValue=function(){};et.useDeferredValue=function(t){return ir.current.useDeferredValue(t)};et.useEffect=function(t,e){return ir.current.useEffect(t,e)};et.useId=function(){return ir.current.useId()};et.useImperativeHandle=function(t,e,n){return ir.current.useImperativeHandle(t,e,n)};et.useInsertionEffect=function(t,e){return ir.current.useInsertionEffect(t,e)};et.useLayoutEffect=function(t,e){return ir.current.useLayoutEffect(t,e)};et.useMemo=function(t,e){return ir.current.useMemo(t,e)};et.useReducer=function(t,e,n){return ir.current.useReducer(t,e,n)};et.useRef=function(t){return ir.current.useRef(t)};et.useState=function(t){return ir.current.useState(t)};et.useSyncExternalStore=function(t,e,n){return ir.current.useSyncExternalStore(t,e,n)};et.useTransition=function(){return ir.current.useTransition()};et.version="18.3.1";CE.exports=et;var j=CE.exports;const ee=Ro(j),E2=o2({__proto__:null,default:ee},[j]);/** + * @license React + * react-jsx-runtime.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var x2=j,S2=Symbol.for("react.element"),A2=Symbol.for("react.fragment"),I2=Object.prototype.hasOwnProperty,k2=x2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,R2={key:!0,ref:!0,__self:!0,__source:!0};function WE(t,e,n){var r,i={},s=null,o=null;n!==void 0&&(s=""+n),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(o=e.ref);for(r in e)I2.call(e,r)&&!R2.hasOwnProperty(r)&&(i[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:S2,type:t,key:s,ref:o,props:i,_owner:k2.current}}Bh.Fragment=A2;Bh.jsx=WE;Bh.jsxs=WE;OE.exports=Bh;var te=OE.exports,HE={exports:{}},Dr={},$E={exports:{}},VE={};/** + * @license React + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */(function(t){function e(k,O){var B=k.length;k.push(O);e:for(;0<B;){var T=B-1>>>1,m=k[T];if(0<i(m,O))k[T]=O,k[B]=m,B=T;else break e}}function n(k){return k.length===0?null:k[0]}function r(k){if(k.length===0)return null;var O=k[0],B=k.pop();if(B!==O){k[0]=B;e:for(var T=0,m=k.length,P=m>>>1;T<P;){var ae=2*(T+1)-1,fe=k[ae],de=ae+1,Ce=k[de];if(0>i(fe,B))de<m&&0>i(Ce,fe)?(k[T]=Ce,k[de]=B,T=de):(k[T]=fe,k[ae]=B,T=ae);else if(de<m&&0>i(Ce,B))k[T]=Ce,k[de]=B,T=de;else break e}}return O}function i(k,O){var B=k.sortIndex-O.sortIndex;return B!==0?B:k.id-O.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var c=[],l=[],u=1,f=null,g=3,p=!1,_=!1,A=!1,S=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(k){for(var O=n(l);O!==null;){if(O.callback===null)r(l);else if(O.startTime<=k)r(l),O.sortIndex=O.expirationTime,e(c,O);else break;O=n(l)}}function M(k){if(A=!1,x(k),!_)if(n(c)!==null)_=!0,v(L);else{var O=n(l);O!==null&&I(M,O.startTime-k)}}function L(k,O){_=!1,A&&(A=!1,E(F),F=-1),p=!0;var B=g;try{for(x(O),f=n(c);f!==null&&(!(f.expirationTime>O)||k&&!G());){var T=f.callback;if(typeof T=="function"){f.callback=null,g=f.priorityLevel;var m=T(f.expirationTime<=O);O=t.unstable_now(),typeof m=="function"?f.callback=m:f===n(c)&&r(c),x(O)}else r(c);f=n(c)}if(f!==null)var P=!0;else{var ae=n(l);ae!==null&&I(M,ae.startTime-O),P=!1}return P}finally{f=null,g=B,p=!1}}var z=!1,D=null,F=-1,$=5,V=-1;function G(){return!(t.unstable_now()-V<$)}function W(){if(D!==null){var k=t.unstable_now();V=k;var O=!0;try{O=D(!0,k)}finally{O?N():(z=!1,D=null)}}else z=!1}var N;if(typeof b=="function")N=function(){b(W)};else if(typeof MessageChannel<"u"){var d=new MessageChannel,h=d.port2;d.port1.onmessage=W,N=function(){h.postMessage(null)}}else N=function(){S(W,0)};function v(k){D=k,z||(z=!0,N())}function I(k,O){F=S(function(){k(t.unstable_now())},O)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(k){k.callback=null},t.unstable_continueExecution=function(){_||p||(_=!0,v(L))},t.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):$=0<k?Math.floor(1e3/k):5},t.unstable_getCurrentPriorityLevel=function(){return g},t.unstable_getFirstCallbackNode=function(){return n(c)},t.unstable_next=function(k){switch(g){case 1:case 2:case 3:var O=3;break;default:O=g}var B=g;g=O;try{return k()}finally{g=B}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(k,O){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var B=g;g=k;try{return O()}finally{g=B}},t.unstable_scheduleCallback=function(k,O,B){var T=t.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?T+B:T):B=T,k){case 1:var m=-1;break;case 2:m=250;break;case 5:m=1073741823;break;case 4:m=1e4;break;default:m=5e3}return m=B+m,k={id:u++,callback:O,priorityLevel:k,startTime:B,expirationTime:m,sortIndex:-1},B>T?(k.sortIndex=B,e(l,k),n(c)===null&&k===n(l)&&(A?(E(F),F=-1):A=!0,I(M,B-T))):(k.sortIndex=m,e(c,k),_||p||(_=!0,v(L))),k},t.unstable_shouldYield=G,t.unstable_wrapCallback=function(k){var O=g;return function(){var B=g;g=O;try{return k.apply(this,arguments)}finally{g=B}}}})(VE);$E.exports=VE;var N2=$E.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var T2=j,Lr=N2;function le(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var ZE=new Set,ru={};function xa(t,e){xc(t,e),xc(t+"Capture",e)}function xc(t,e){for(ru[t]=e,t=0;t<e.length;t++)ZE.add(e[t])}var vs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Tg=Object.prototype.hasOwnProperty,M2=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,tv={},nv={};function O2(t){return Tg.call(nv,t)?!0:Tg.call(tv,t)?!1:M2.test(t)?nv[t]=!0:(tv[t]=!0,!1)}function C2(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function L2(t,e,n,r){if(e===null||typeof e>"u"||C2(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function sr(t,e,n,r,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var jn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){jn[t]=new sr(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];jn[e]=new sr(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){jn[t]=new sr(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){jn[t]=new sr(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){jn[t]=new sr(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){jn[t]=new sr(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){jn[t]=new sr(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){jn[t]=new sr(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){jn[t]=new sr(t,5,!1,t.toLowerCase(),null,!1,!1)});var Om=/[\-:]([a-z])/g;function Cm(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(Om,Cm);jn[e]=new sr(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(Om,Cm);jn[e]=new sr(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(Om,Cm);jn[e]=new sr(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){jn[t]=new sr(t,1,!1,t.toLowerCase(),null,!1,!1)});jn.xlinkHref=new sr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){jn[t]=new sr(t,1,!1,t.toLowerCase(),null,!0,!0)});function Lm(t,e,n,r){var i=jn.hasOwnProperty(e)?jn[e]:null;(i!==null?i.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(L2(e,n,i,r)&&(n=null),r||i===null?O2(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):i.mustUseProperty?t[i.propertyName]=n===null?i.type===3?!1:"":n:(e=i.attributeName,r=i.attributeNamespace,n===null?t.removeAttribute(e):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}var Ts=T2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ad=Symbol.for("react.element"),Wa=Symbol.for("react.portal"),Ha=Symbol.for("react.fragment"),Dm=Symbol.for("react.strict_mode"),Mg=Symbol.for("react.profiler"),KE=Symbol.for("react.provider"),GE=Symbol.for("react.context"),Pm=Symbol.for("react.forward_ref"),Og=Symbol.for("react.suspense"),Cg=Symbol.for("react.suspense_list"),Bm=Symbol.for("react.memo"),Us=Symbol.for("react.lazy"),YE=Symbol.for("react.offscreen"),rv=Symbol.iterator;function hl(t){return t===null||typeof t!="object"?null:(t=rv&&t[rv]||t["@@iterator"],typeof t=="function"?t:null)}var Ft=Object.assign,c0;function Nl(t){if(c0===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);c0=e&&e[1]||""}return` +`+c0+t}var l0=!1;function u0(t,e){if(!t||l0)return"";l0=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(l){var r=l}Reflect.construct(t,[],e)}else{try{e.call()}catch(l){r=l}t.call(e.prototype)}else{try{throw Error()}catch(l){r=l}t()}}catch(l){if(l&&r&&typeof l.stack=="string"){for(var i=l.stack.split(` +`),s=r.stack.split(` +`),o=i.length-1,a=s.length-1;1<=o&&0<=a&&i[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(i[o]!==s[a]){if(o!==1||a!==1)do if(o--,a--,0>a||i[o]!==s[a]){var c=` +`+i[o].replace(" at new "," at ");return t.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",t.displayName)),c}while(1<=o&&0<=a);break}}}finally{l0=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Nl(t):""}function D2(t){switch(t.tag){case 5:return Nl(t.type);case 16:return Nl("Lazy");case 13:return Nl("Suspense");case 19:return Nl("SuspenseList");case 0:case 2:case 15:return t=u0(t.type,!1),t;case 11:return t=u0(t.type.render,!1),t;case 1:return t=u0(t.type,!0),t;default:return""}}function Lg(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Ha:return"Fragment";case Wa:return"Portal";case Mg:return"Profiler";case Dm:return"StrictMode";case Og:return"Suspense";case Cg:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case GE:return(t.displayName||"Context")+".Consumer";case KE:return(t._context.displayName||"Context")+".Provider";case Pm:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Bm:return e=t.displayName||null,e!==null?e:Lg(t.type)||"Memo";case Us:e=t._payload,t=t._init;try{return Lg(t(e))}catch{}}return null}function P2(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Lg(e);case 8:return e===Dm?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function go(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function qE(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function B2(t){var e=qE(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Id(t){t._valueTracker||(t._valueTracker=B2(t))}function QE(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=qE(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function Mf(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Dg(t,e){var n=e.checked;return Ft({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function iv(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=go(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function XE(t,e){e=e.checked,e!=null&&Lm(t,"checked",e,!1)}function Pg(t,e){XE(t,e);var n=go(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?Bg(t,e.type,n):e.hasOwnProperty("defaultValue")&&Bg(t,e.type,go(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function sv(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function Bg(t,e,n){(e!=="number"||Mf(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Tl=Array.isArray;function cc(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i<n.length;i++)e["$"+n[i]]=!0;for(n=0;n<t.length;n++)i=e.hasOwnProperty("$"+t[n].value),t[n].selected!==i&&(t[n].selected=i),i&&r&&(t[n].defaultSelected=!0)}else{for(n=""+go(n),e=null,i=0;i<t.length;i++){if(t[i].value===n){t[i].selected=!0,r&&(t[i].defaultSelected=!0);return}e!==null||t[i].disabled||(e=t[i])}e!==null&&(e.selected=!0)}}function zg(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(le(91));return Ft({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function ov(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(le(92));if(Tl(n)){if(1<n.length)throw Error(le(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:go(n)}}function JE(t,e){var n=go(e.value),r=go(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),r!=null&&(t.defaultValue=""+r)}function av(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function ex(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function jg(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?ex(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var kd,tx=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,i){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,i)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(kd=kd||document.createElement("div"),kd.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=kd.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function iu(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var jl={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},z2=["Webkit","ms","Moz","O"];Object.keys(jl).forEach(function(t){z2.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),jl[e]=jl[t]})});function nx(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||jl.hasOwnProperty(t)&&jl[t]?(""+e).trim():e+"px"}function rx(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=nx(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var j2=Ft({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ug(t,e){if(e){if(j2[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(le(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(le(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(le(61))}if(e.style!=null&&typeof e.style!="object")throw Error(le(62))}}function Fg(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Wg=null;function zm(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Hg=null,lc=null,uc=null;function cv(t){if(t=Ju(t)){if(typeof Hg!="function")throw Error(le(280));var e=t.stateNode;e&&(e=Wh(e),Hg(t.stateNode,t.type,e))}}function ix(t){lc?uc?uc.push(t):uc=[t]:lc=t}function sx(){if(lc){var t=lc,e=uc;if(uc=lc=null,cv(t),e)for(t=0;t<e.length;t++)cv(e[t])}}function ox(t,e){return t(e)}function ax(){}var d0=!1;function cx(t,e,n){if(d0)return t(e,n);d0=!0;try{return ox(t,e,n)}finally{d0=!1,(lc!==null||uc!==null)&&(ax(),sx())}}function su(t,e){var n=t.stateNode;if(n===null)return null;var r=Wh(n);if(r===null)return null;n=r[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(le(231,e,typeof n));return n}var $g=!1;if(vs)try{var pl={};Object.defineProperty(pl,"passive",{get:function(){$g=!0}}),window.addEventListener("test",pl,pl),window.removeEventListener("test",pl,pl)}catch{$g=!1}function U2(t,e,n,r,i,s,o,a,c){var l=Array.prototype.slice.call(arguments,3);try{e.apply(n,l)}catch(u){this.onError(u)}}var Ul=!1,Of=null,Cf=!1,Vg=null,F2={onError:function(t){Ul=!0,Of=t}};function W2(t,e,n,r,i,s,o,a,c){Ul=!1,Of=null,U2.apply(F2,arguments)}function H2(t,e,n,r,i,s,o,a,c){if(W2.apply(this,arguments),Ul){if(Ul){var l=Of;Ul=!1,Of=null}else throw Error(le(198));Cf||(Cf=!0,Vg=l)}}function Sa(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function lx(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function lv(t){if(Sa(t)!==t)throw Error(le(188))}function $2(t){var e=t.alternate;if(!e){if(e=Sa(t),e===null)throw Error(le(188));return e!==t?null:t}for(var n=t,r=e;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return lv(i),t;if(s===r)return lv(i),e;s=s.sibling}throw Error(le(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o)throw Error(le(189))}}if(n.alternate!==r)throw Error(le(190))}if(n.tag!==3)throw Error(le(188));return n.stateNode.current===n?t:e}function ux(t){return t=$2(t),t!==null?dx(t):null}function dx(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=dx(t);if(e!==null)return e;t=t.sibling}return null}var fx=Lr.unstable_scheduleCallback,uv=Lr.unstable_cancelCallback,V2=Lr.unstable_shouldYield,Z2=Lr.unstable_requestPaint,Kt=Lr.unstable_now,K2=Lr.unstable_getCurrentPriorityLevel,jm=Lr.unstable_ImmediatePriority,hx=Lr.unstable_UserBlockingPriority,Lf=Lr.unstable_NormalPriority,G2=Lr.unstable_LowPriority,px=Lr.unstable_IdlePriority,zh=null,Ti=null;function Y2(t){if(Ti&&typeof Ti.onCommitFiberRoot=="function")try{Ti.onCommitFiberRoot(zh,t,void 0,(t.current.flags&128)===128)}catch{}}var ci=Math.clz32?Math.clz32:X2,q2=Math.log,Q2=Math.LN2;function X2(t){return t>>>=0,t===0?32:31-(q2(t)/Q2|0)|0}var Rd=64,Nd=4194304;function Ml(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Df(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,s=t.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=Ml(a):(s&=o,s!==0&&(r=Ml(s)))}else o=n&~i,o!==0?r=Ml(o):s!==0&&(r=Ml(s));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0<e;)n=31-ci(e),i=1<<n,r|=t[n],e&=~i;return r}function J2(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function eM(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,i=t.expirationTimes,s=t.pendingLanes;0<s;){var o=31-ci(s),a=1<<o,c=i[o];c===-1?(!(a&n)||a&r)&&(i[o]=J2(a,e)):c<=e&&(t.expiredLanes|=a),s&=~a}}function Zg(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function gx(){var t=Rd;return Rd<<=1,!(Rd&4194240)&&(Rd=64),t}function f0(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Qu(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-ci(e),t[e]=n}function tM(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0<n;){var i=31-ci(n),s=1<<i;e[i]=0,r[i]=-1,t[i]=-1,n&=~s}}function Um(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-ci(n),i=1<<r;i&e|t[r]&e&&(t[r]|=e),n&=~i}}var wt=0;function yx(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var mx,Fm,wx,_x,vx,Kg=!1,Td=[],Js=null,eo=null,to=null,ou=new Map,au=new Map,Hs=[],nM="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function dv(t,e){switch(t){case"focusin":case"focusout":Js=null;break;case"dragenter":case"dragleave":eo=null;break;case"mouseover":case"mouseout":to=null;break;case"pointerover":case"pointerout":ou.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":au.delete(e.pointerId)}}function gl(t,e,n,r,i,s){return t===null||t.nativeEvent!==s?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},e!==null&&(e=Ju(e),e!==null&&Fm(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function rM(t,e,n,r,i){switch(e){case"focusin":return Js=gl(Js,t,e,n,r,i),!0;case"dragenter":return eo=gl(eo,t,e,n,r,i),!0;case"mouseover":return to=gl(to,t,e,n,r,i),!0;case"pointerover":var s=i.pointerId;return ou.set(s,gl(ou.get(s)||null,t,e,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,au.set(s,gl(au.get(s)||null,t,e,n,r,i)),!0}return!1}function bx(t){var e=$o(t.target);if(e!==null){var n=Sa(e);if(n!==null){if(e=n.tag,e===13){if(e=lx(n),e!==null){t.blockedOn=e,vx(t.priority,function(){wx(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function cf(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=Gg(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);Wg=r,n.target.dispatchEvent(r),Wg=null}else return e=Ju(n),e!==null&&Fm(e),t.blockedOn=n,!1;e.shift()}return!0}function fv(t,e,n){cf(t)&&n.delete(e)}function iM(){Kg=!1,Js!==null&&cf(Js)&&(Js=null),eo!==null&&cf(eo)&&(eo=null),to!==null&&cf(to)&&(to=null),ou.forEach(fv),au.forEach(fv)}function yl(t,e){t.blockedOn===e&&(t.blockedOn=null,Kg||(Kg=!0,Lr.unstable_scheduleCallback(Lr.unstable_NormalPriority,iM)))}function cu(t){function e(i){return yl(i,t)}if(0<Td.length){yl(Td[0],t);for(var n=1;n<Td.length;n++){var r=Td[n];r.blockedOn===t&&(r.blockedOn=null)}}for(Js!==null&&yl(Js,t),eo!==null&&yl(eo,t),to!==null&&yl(to,t),ou.forEach(e),au.forEach(e),n=0;n<Hs.length;n++)r=Hs[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<Hs.length&&(n=Hs[0],n.blockedOn===null);)bx(n),n.blockedOn===null&&Hs.shift()}var dc=Ts.ReactCurrentBatchConfig,Pf=!0;function sM(t,e,n,r){var i=wt,s=dc.transition;dc.transition=null;try{wt=1,Wm(t,e,n,r)}finally{wt=i,dc.transition=s}}function oM(t,e,n,r){var i=wt,s=dc.transition;dc.transition=null;try{wt=4,Wm(t,e,n,r)}finally{wt=i,dc.transition=s}}function Wm(t,e,n,r){if(Pf){var i=Gg(t,e,n,r);if(i===null)E0(t,e,r,Bf,n),dv(t,r);else if(rM(i,t,e,n,r))r.stopPropagation();else if(dv(t,r),e&4&&-1<nM.indexOf(t)){for(;i!==null;){var s=Ju(i);if(s!==null&&mx(s),s=Gg(t,e,n,r),s===null&&E0(t,e,r,Bf,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else E0(t,e,r,null,n)}}var Bf=null;function Gg(t,e,n,r){if(Bf=null,t=zm(r),t=$o(t),t!==null)if(e=Sa(t),e===null)t=null;else if(n=e.tag,n===13){if(t=lx(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return Bf=t,null}function Ex(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(K2()){case jm:return 1;case hx:return 4;case Lf:case G2:return 16;case px:return 536870912;default:return 16}default:return 16}}var Gs=null,Hm=null,lf=null;function xx(){if(lf)return lf;var t,e=Hm,n=e.length,r,i="value"in Gs?Gs.value:Gs.textContent,s=i.length;for(t=0;t<n&&e[t]===i[t];t++);var o=n-t;for(r=1;r<=o&&e[n-r]===i[s-r];r++);return lf=i.slice(t,1<r?1-r:void 0)}function uf(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Md(){return!0}function hv(){return!1}function Pr(t){function e(n,r,i,s,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in t)t.hasOwnProperty(a)&&(n=t[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Md:hv,this.isPropagationStopped=hv,this}return Ft(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Md)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Md)},persist:function(){},isPersistent:Md}),e}var Yc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$m=Pr(Yc),Xu=Ft({},Yc,{view:0,detail:0}),aM=Pr(Xu),h0,p0,ml,jh=Ft({},Xu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vm,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==ml&&(ml&&t.type==="mousemove"?(h0=t.screenX-ml.screenX,p0=t.screenY-ml.screenY):p0=h0=0,ml=t),h0)},movementY:function(t){return"movementY"in t?t.movementY:p0}}),pv=Pr(jh),cM=Ft({},jh,{dataTransfer:0}),lM=Pr(cM),uM=Ft({},Xu,{relatedTarget:0}),g0=Pr(uM),dM=Ft({},Yc,{animationName:0,elapsedTime:0,pseudoElement:0}),fM=Pr(dM),hM=Ft({},Yc,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),pM=Pr(hM),gM=Ft({},Yc,{data:0}),gv=Pr(gM),yM={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},mM={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},wM={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _M(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=wM[t])?!!e[t]:!1}function Vm(){return _M}var vM=Ft({},Xu,{key:function(t){if(t.key){var e=yM[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=uf(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?mM[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vm,charCode:function(t){return t.type==="keypress"?uf(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?uf(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),bM=Pr(vM),EM=Ft({},jh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),yv=Pr(EM),xM=Ft({},Xu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vm}),SM=Pr(xM),AM=Ft({},Yc,{propertyName:0,elapsedTime:0,pseudoElement:0}),IM=Pr(AM),kM=Ft({},jh,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),RM=Pr(kM),NM=[9,13,27,32],Zm=vs&&"CompositionEvent"in window,Fl=null;vs&&"documentMode"in document&&(Fl=document.documentMode);var TM=vs&&"TextEvent"in window&&!Fl,Sx=vs&&(!Zm||Fl&&8<Fl&&11>=Fl),mv=" ",wv=!1;function Ax(t,e){switch(t){case"keyup":return NM.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ix(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var $a=!1;function MM(t,e){switch(t){case"compositionend":return Ix(e);case"keypress":return e.which!==32?null:(wv=!0,mv);case"textInput":return t=e.data,t===mv&&wv?null:t;default:return null}}function OM(t,e){if($a)return t==="compositionend"||!Zm&&Ax(t,e)?(t=xx(),lf=Hm=Gs=null,$a=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return Sx&&e.locale!=="ko"?null:e.data;default:return null}}var CM={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function _v(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!CM[t.type]:e==="textarea"}function kx(t,e,n,r){ix(r),e=zf(e,"onChange"),0<e.length&&(n=new $m("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var Wl=null,lu=null;function LM(t){zx(t,0)}function Uh(t){var e=Ka(t);if(QE(e))return t}function DM(t,e){if(t==="change")return e}var Rx=!1;if(vs){var y0;if(vs){var m0="oninput"in document;if(!m0){var vv=document.createElement("div");vv.setAttribute("oninput","return;"),m0=typeof vv.oninput=="function"}y0=m0}else y0=!1;Rx=y0&&(!document.documentMode||9<document.documentMode)}function bv(){Wl&&(Wl.detachEvent("onpropertychange",Nx),lu=Wl=null)}function Nx(t){if(t.propertyName==="value"&&Uh(lu)){var e=[];kx(e,lu,t,zm(t)),cx(LM,e)}}function PM(t,e,n){t==="focusin"?(bv(),Wl=e,lu=n,Wl.attachEvent("onpropertychange",Nx)):t==="focusout"&&bv()}function BM(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Uh(lu)}function zM(t,e){if(t==="click")return Uh(e)}function jM(t,e){if(t==="input"||t==="change")return Uh(e)}function UM(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var fi=typeof Object.is=="function"?Object.is:UM;function uu(t,e){if(fi(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Tg.call(e,i)||!fi(t[i],e[i]))return!1}return!0}function Ev(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function xv(t,e){var n=Ev(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Ev(n)}}function Tx(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Tx(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Mx(){for(var t=window,e=Mf();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Mf(t.document)}return e}function Km(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function FM(t){var e=Mx(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&Tx(n.ownerDocument.documentElement,n)){if(r!==null&&Km(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!t.extend&&s>r&&(i=r,r=s,s=i),i=xv(n,s);var o=xv(n,r);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>r?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var WM=vs&&"documentMode"in document&&11>=document.documentMode,Va=null,Yg=null,Hl=null,qg=!1;function Sv(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;qg||Va==null||Va!==Mf(r)||(r=Va,"selectionStart"in r&&Km(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Hl&&uu(Hl,r)||(Hl=r,r=zf(Yg,"onSelect"),0<r.length&&(e=new $m("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=Va)))}function Od(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Za={animationend:Od("Animation","AnimationEnd"),animationiteration:Od("Animation","AnimationIteration"),animationstart:Od("Animation","AnimationStart"),transitionend:Od("Transition","TransitionEnd")},w0={},Ox={};vs&&(Ox=document.createElement("div").style,"AnimationEvent"in window||(delete Za.animationend.animation,delete Za.animationiteration.animation,delete Za.animationstart.animation),"TransitionEvent"in window||delete Za.transitionend.transition);function Fh(t){if(w0[t])return w0[t];if(!Za[t])return t;var e=Za[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in Ox)return w0[t]=e[n];return t}var Cx=Fh("animationend"),Lx=Fh("animationiteration"),Dx=Fh("animationstart"),Px=Fh("transitionend"),Bx=new Map,Av="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function No(t,e){Bx.set(t,e),xa(e,[t])}for(var _0=0;_0<Av.length;_0++){var v0=Av[_0],HM=v0.toLowerCase(),$M=v0[0].toUpperCase()+v0.slice(1);No(HM,"on"+$M)}No(Cx,"onAnimationEnd");No(Lx,"onAnimationIteration");No(Dx,"onAnimationStart");No("dblclick","onDoubleClick");No("focusin","onFocus");No("focusout","onBlur");No(Px,"onTransitionEnd");xc("onMouseEnter",["mouseout","mouseover"]);xc("onMouseLeave",["mouseout","mouseover"]);xc("onPointerEnter",["pointerout","pointerover"]);xc("onPointerLeave",["pointerout","pointerover"]);xa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));xa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));xa("onBeforeInput",["compositionend","keypress","textInput","paste"]);xa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));xa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));xa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ol="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),VM=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ol));function Iv(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,H2(r,e,void 0,t),t.currentTarget=null}function zx(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],i=r.event;r=r.listeners;e:{var s=void 0;if(e)for(var o=r.length-1;0<=o;o--){var a=r[o],c=a.instance,l=a.currentTarget;if(a=a.listener,c!==s&&i.isPropagationStopped())break e;Iv(i,a,l),s=c}else for(o=0;o<r.length;o++){if(a=r[o],c=a.instance,l=a.currentTarget,a=a.listener,c!==s&&i.isPropagationStopped())break e;Iv(i,a,l),s=c}}}if(Cf)throw t=Vg,Cf=!1,Vg=null,t}function Nt(t,e){var n=e[ty];n===void 0&&(n=e[ty]=new Set);var r=t+"__bubble";n.has(r)||(jx(e,t,2,!1),n.add(r))}function b0(t,e,n){var r=0;e&&(r|=4),jx(n,t,r,e)}var Cd="_reactListening"+Math.random().toString(36).slice(2);function du(t){if(!t[Cd]){t[Cd]=!0,ZE.forEach(function(n){n!=="selectionchange"&&(VM.has(n)||b0(n,!1,t),b0(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Cd]||(e[Cd]=!0,b0("selectionchange",!1,e))}}function jx(t,e,n,r){switch(Ex(e)){case 1:var i=sM;break;case 4:i=oM;break;default:i=Wm}n=i.bind(null,e,n,t),i=void 0,!$g||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),r?i!==void 0?t.addEventListener(e,n,{capture:!0,passive:i}):t.addEventListener(e,n,!0):i!==void 0?t.addEventListener(e,n,{passive:i}):t.addEventListener(e,n,!1)}function E0(t,e,n,r,i){var s=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;o=o.return}for(;a!==null;){if(o=$o(a),o===null)return;if(c=o.tag,c===5||c===6){r=s=o;continue e}a=a.parentNode}}r=r.return}cx(function(){var l=s,u=zm(n),f=[];e:{var g=Bx.get(t);if(g!==void 0){var p=$m,_=t;switch(t){case"keypress":if(uf(n)===0)break e;case"keydown":case"keyup":p=bM;break;case"focusin":_="focus",p=g0;break;case"focusout":_="blur",p=g0;break;case"beforeblur":case"afterblur":p=g0;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=pv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=lM;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=SM;break;case Cx:case Lx:case Dx:p=fM;break;case Px:p=IM;break;case"scroll":p=aM;break;case"wheel":p=RM;break;case"copy":case"cut":case"paste":p=pM;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=yv}var A=(e&4)!==0,S=!A&&t==="scroll",E=A?g!==null?g+"Capture":null:g;A=[];for(var b=l,x;b!==null;){x=b;var M=x.stateNode;if(x.tag===5&&M!==null&&(x=M,E!==null&&(M=su(b,E),M!=null&&A.push(fu(b,M,x)))),S)break;b=b.return}0<A.length&&(g=new p(g,_,null,n,u),f.push({event:g,listeners:A}))}}if(!(e&7)){e:{if(g=t==="mouseover"||t==="pointerover",p=t==="mouseout"||t==="pointerout",g&&n!==Wg&&(_=n.relatedTarget||n.fromElement)&&($o(_)||_[bs]))break e;if((p||g)&&(g=u.window===u?u:(g=u.ownerDocument)?g.defaultView||g.parentWindow:window,p?(_=n.relatedTarget||n.toElement,p=l,_=_?$o(_):null,_!==null&&(S=Sa(_),_!==S||_.tag!==5&&_.tag!==6)&&(_=null)):(p=null,_=l),p!==_)){if(A=pv,M="onMouseLeave",E="onMouseEnter",b="mouse",(t==="pointerout"||t==="pointerover")&&(A=yv,M="onPointerLeave",E="onPointerEnter",b="pointer"),S=p==null?g:Ka(p),x=_==null?g:Ka(_),g=new A(M,b+"leave",p,n,u),g.target=S,g.relatedTarget=x,M=null,$o(u)===l&&(A=new A(E,b+"enter",_,n,u),A.target=x,A.relatedTarget=S,M=A),S=M,p&&_)t:{for(A=p,E=_,b=0,x=A;x;x=Oa(x))b++;for(x=0,M=E;M;M=Oa(M))x++;for(;0<b-x;)A=Oa(A),b--;for(;0<x-b;)E=Oa(E),x--;for(;b--;){if(A===E||E!==null&&A===E.alternate)break t;A=Oa(A),E=Oa(E)}A=null}else A=null;p!==null&&kv(f,g,p,A,!1),_!==null&&S!==null&&kv(f,S,_,A,!0)}}e:{if(g=l?Ka(l):window,p=g.nodeName&&g.nodeName.toLowerCase(),p==="select"||p==="input"&&g.type==="file")var L=DM;else if(_v(g))if(Rx)L=jM;else{L=BM;var z=PM}else(p=g.nodeName)&&p.toLowerCase()==="input"&&(g.type==="checkbox"||g.type==="radio")&&(L=zM);if(L&&(L=L(t,l))){kx(f,L,n,u);break e}z&&z(t,g,l),t==="focusout"&&(z=g._wrapperState)&&z.controlled&&g.type==="number"&&Bg(g,"number",g.value)}switch(z=l?Ka(l):window,t){case"focusin":(_v(z)||z.contentEditable==="true")&&(Va=z,Yg=l,Hl=null);break;case"focusout":Hl=Yg=Va=null;break;case"mousedown":qg=!0;break;case"contextmenu":case"mouseup":case"dragend":qg=!1,Sv(f,n,u);break;case"selectionchange":if(WM)break;case"keydown":case"keyup":Sv(f,n,u)}var D;if(Zm)e:{switch(t){case"compositionstart":var F="onCompositionStart";break e;case"compositionend":F="onCompositionEnd";break e;case"compositionupdate":F="onCompositionUpdate";break e}F=void 0}else $a?Ax(t,n)&&(F="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(F="onCompositionStart");F&&(Sx&&n.locale!=="ko"&&($a||F!=="onCompositionStart"?F==="onCompositionEnd"&&$a&&(D=xx()):(Gs=u,Hm="value"in Gs?Gs.value:Gs.textContent,$a=!0)),z=zf(l,F),0<z.length&&(F=new gv(F,t,null,n,u),f.push({event:F,listeners:z}),D?F.data=D:(D=Ix(n),D!==null&&(F.data=D)))),(D=TM?MM(t,n):OM(t,n))&&(l=zf(l,"onBeforeInput"),0<l.length&&(u=new gv("onBeforeInput","beforeinput",null,n,u),f.push({event:u,listeners:l}),u.data=D))}zx(f,e)})}function fu(t,e,n){return{instance:t,listener:e,currentTarget:n}}function zf(t,e){for(var n=e+"Capture",r=[];t!==null;){var i=t,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=su(t,n),s!=null&&r.unshift(fu(t,s,i)),s=su(t,e),s!=null&&r.push(fu(t,s,i))),t=t.return}return r}function Oa(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function kv(t,e,n,r,i){for(var s=e._reactName,o=[];n!==null&&n!==r;){var a=n,c=a.alternate,l=a.stateNode;if(c!==null&&c===r)break;a.tag===5&&l!==null&&(a=l,i?(c=su(n,s),c!=null&&o.unshift(fu(n,c,a))):i||(c=su(n,s),c!=null&&o.push(fu(n,c,a)))),n=n.return}o.length!==0&&t.push({event:e,listeners:o})}var ZM=/\r\n?/g,KM=/\u0000|\uFFFD/g;function Rv(t){return(typeof t=="string"?t:""+t).replace(ZM,` +`).replace(KM,"")}function Ld(t,e,n){if(e=Rv(e),Rv(t)!==e&&n)throw Error(le(425))}function jf(){}var Qg=null,Xg=null;function Jg(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var ey=typeof setTimeout=="function"?setTimeout:void 0,GM=typeof clearTimeout=="function"?clearTimeout:void 0,Nv=typeof Promise=="function"?Promise:void 0,YM=typeof queueMicrotask=="function"?queueMicrotask:typeof Nv<"u"?function(t){return Nv.resolve(null).then(t).catch(qM)}:ey;function qM(t){setTimeout(function(){throw t})}function x0(t,e){var n=e,r=0;do{var i=n.nextSibling;if(t.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){t.removeChild(i),cu(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);cu(e)}function no(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function Tv(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var qc=Math.random().toString(36).slice(2),xi="__reactFiber$"+qc,hu="__reactProps$"+qc,bs="__reactContainer$"+qc,ty="__reactEvents$"+qc,QM="__reactListeners$"+qc,XM="__reactHandles$"+qc;function $o(t){var e=t[xi];if(e)return e;for(var n=t.parentNode;n;){if(e=n[bs]||n[xi]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=Tv(t);t!==null;){if(n=t[xi])return n;t=Tv(t)}return e}t=n,n=t.parentNode}return null}function Ju(t){return t=t[xi]||t[bs],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Ka(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(le(33))}function Wh(t){return t[hu]||null}var ny=[],Ga=-1;function To(t){return{current:t}}function Mt(t){0>Ga||(t.current=ny[Ga],ny[Ga]=null,Ga--)}function It(t,e){Ga++,ny[Ga]=t.current,t.current=e}var yo={},Yn=To(yo),mr=To(!1),ca=yo;function Sc(t,e){var n=t.type.contextTypes;if(!n)return yo;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=e[s];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function wr(t){return t=t.childContextTypes,t!=null}function Uf(){Mt(mr),Mt(Yn)}function Mv(t,e,n){if(Yn.current!==yo)throw Error(le(168));It(Yn,e),It(mr,n)}function Ux(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(le(108,P2(t)||"Unknown",i));return Ft({},n,r)}function Ff(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||yo,ca=Yn.current,It(Yn,t),It(mr,mr.current),!0}function Ov(t,e,n){var r=t.stateNode;if(!r)throw Error(le(169));n?(t=Ux(t,e,ca),r.__reactInternalMemoizedMergedChildContext=t,Mt(mr),Mt(Yn),It(Yn,t)):Mt(mr),It(mr,n)}var es=null,Hh=!1,S0=!1;function Fx(t){es===null?es=[t]:es.push(t)}function JM(t){Hh=!0,Fx(t)}function Mo(){if(!S0&&es!==null){S0=!0;var t=0,e=wt;try{var n=es;for(wt=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}es=null,Hh=!1}catch(i){throw es!==null&&(es=es.slice(t+1)),fx(jm,Mo),i}finally{wt=e,S0=!1}}return null}var Ya=[],qa=0,Wf=null,Hf=0,Wr=[],Hr=0,la=null,ds=1,fs="";function Bo(t,e){Ya[qa++]=Hf,Ya[qa++]=Wf,Wf=t,Hf=e}function Wx(t,e,n){Wr[Hr++]=ds,Wr[Hr++]=fs,Wr[Hr++]=la,la=t;var r=ds;t=fs;var i=32-ci(r)-1;r&=~(1<<i),n+=1;var s=32-ci(e)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ds=1<<32-ci(e)+i|n<<i|r,fs=s+t}else ds=1<<s|n<<i|r,fs=t}function Gm(t){t.return!==null&&(Bo(t,1),Wx(t,1,0))}function Ym(t){for(;t===Wf;)Wf=Ya[--qa],Ya[qa]=null,Hf=Ya[--qa],Ya[qa]=null;for(;t===la;)la=Wr[--Hr],Wr[Hr]=null,fs=Wr[--Hr],Wr[Hr]=null,ds=Wr[--Hr],Wr[Hr]=null}var Tr=null,Rr=null,Lt=!1,ii=null;function Hx(t,e){var n=Zr(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletions,e===null?(t.deletions=[n],t.flags|=16):e.push(n)}function Cv(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,Tr=t,Rr=no(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,Tr=t,Rr=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=la!==null?{id:ds,overflow:fs}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=Zr(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,Tr=t,Rr=null,!0):!1;default:return!1}}function ry(t){return(t.mode&1)!==0&&(t.flags&128)===0}function iy(t){if(Lt){var e=Rr;if(e){var n=e;if(!Cv(t,e)){if(ry(t))throw Error(le(418));e=no(n.nextSibling);var r=Tr;e&&Cv(t,e)?Hx(r,n):(t.flags=t.flags&-4097|2,Lt=!1,Tr=t)}}else{if(ry(t))throw Error(le(418));t.flags=t.flags&-4097|2,Lt=!1,Tr=t}}}function Lv(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Tr=t}function Dd(t){if(t!==Tr)return!1;if(!Lt)return Lv(t),Lt=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!Jg(t.type,t.memoizedProps)),e&&(e=Rr)){if(ry(t))throw $x(),Error(le(418));for(;e;)Hx(t,e),e=no(e.nextSibling)}if(Lv(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(le(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){Rr=no(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}Rr=null}}else Rr=Tr?no(t.stateNode.nextSibling):null;return!0}function $x(){for(var t=Rr;t;)t=no(t.nextSibling)}function Ac(){Rr=Tr=null,Lt=!1}function qm(t){ii===null?ii=[t]:ii.push(t)}var eO=Ts.ReactCurrentBatchConfig;function wl(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(le(309));var r=n.stateNode}if(!r)throw Error(le(147,t));var i=r,s=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===s?e.ref:(e=function(o){var a=i.refs;o===null?delete a[s]:a[s]=o},e._stringRef=s,e)}if(typeof t!="string")throw Error(le(284));if(!n._owner)throw Error(le(290,t))}return t}function Pd(t,e){throw t=Object.prototype.toString.call(e),Error(le(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function Dv(t){var e=t._init;return e(t._payload)}function Vx(t){function e(E,b){if(t){var x=E.deletions;x===null?(E.deletions=[b],E.flags|=16):x.push(b)}}function n(E,b){if(!t)return null;for(;b!==null;)e(E,b),b=b.sibling;return null}function r(E,b){for(E=new Map;b!==null;)b.key!==null?E.set(b.key,b):E.set(b.index,b),b=b.sibling;return E}function i(E,b){return E=oo(E,b),E.index=0,E.sibling=null,E}function s(E,b,x){return E.index=x,t?(x=E.alternate,x!==null?(x=x.index,x<b?(E.flags|=2,b):x):(E.flags|=2,b)):(E.flags|=1048576,b)}function o(E){return t&&E.alternate===null&&(E.flags|=2),E}function a(E,b,x,M){return b===null||b.tag!==6?(b=M0(x,E.mode,M),b.return=E,b):(b=i(b,x),b.return=E,b)}function c(E,b,x,M){var L=x.type;return L===Ha?u(E,b,x.props.children,M,x.key):b!==null&&(b.elementType===L||typeof L=="object"&&L!==null&&L.$$typeof===Us&&Dv(L)===b.type)?(M=i(b,x.props),M.ref=wl(E,b,x),M.return=E,M):(M=mf(x.type,x.key,x.props,null,E.mode,M),M.ref=wl(E,b,x),M.return=E,M)}function l(E,b,x,M){return b===null||b.tag!==4||b.stateNode.containerInfo!==x.containerInfo||b.stateNode.implementation!==x.implementation?(b=O0(x,E.mode,M),b.return=E,b):(b=i(b,x.children||[]),b.return=E,b)}function u(E,b,x,M,L){return b===null||b.tag!==7?(b=sa(x,E.mode,M,L),b.return=E,b):(b=i(b,x),b.return=E,b)}function f(E,b,x){if(typeof b=="string"&&b!==""||typeof b=="number")return b=M0(""+b,E.mode,x),b.return=E,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Ad:return x=mf(b.type,b.key,b.props,null,E.mode,x),x.ref=wl(E,null,b),x.return=E,x;case Wa:return b=O0(b,E.mode,x),b.return=E,b;case Us:var M=b._init;return f(E,M(b._payload),x)}if(Tl(b)||hl(b))return b=sa(b,E.mode,x,null),b.return=E,b;Pd(E,b)}return null}function g(E,b,x,M){var L=b!==null?b.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return L!==null?null:a(E,b,""+x,M);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Ad:return x.key===L?c(E,b,x,M):null;case Wa:return x.key===L?l(E,b,x,M):null;case Us:return L=x._init,g(E,b,L(x._payload),M)}if(Tl(x)||hl(x))return L!==null?null:u(E,b,x,M,null);Pd(E,x)}return null}function p(E,b,x,M,L){if(typeof M=="string"&&M!==""||typeof M=="number")return E=E.get(x)||null,a(b,E,""+M,L);if(typeof M=="object"&&M!==null){switch(M.$$typeof){case Ad:return E=E.get(M.key===null?x:M.key)||null,c(b,E,M,L);case Wa:return E=E.get(M.key===null?x:M.key)||null,l(b,E,M,L);case Us:var z=M._init;return p(E,b,x,z(M._payload),L)}if(Tl(M)||hl(M))return E=E.get(x)||null,u(b,E,M,L,null);Pd(b,M)}return null}function _(E,b,x,M){for(var L=null,z=null,D=b,F=b=0,$=null;D!==null&&F<x.length;F++){D.index>F?($=D,D=null):$=D.sibling;var V=g(E,D,x[F],M);if(V===null){D===null&&(D=$);break}t&&D&&V.alternate===null&&e(E,D),b=s(V,b,F),z===null?L=V:z.sibling=V,z=V,D=$}if(F===x.length)return n(E,D),Lt&&Bo(E,F),L;if(D===null){for(;F<x.length;F++)D=f(E,x[F],M),D!==null&&(b=s(D,b,F),z===null?L=D:z.sibling=D,z=D);return Lt&&Bo(E,F),L}for(D=r(E,D);F<x.length;F++)$=p(D,E,F,x[F],M),$!==null&&(t&&$.alternate!==null&&D.delete($.key===null?F:$.key),b=s($,b,F),z===null?L=$:z.sibling=$,z=$);return t&&D.forEach(function(G){return e(E,G)}),Lt&&Bo(E,F),L}function A(E,b,x,M){var L=hl(x);if(typeof L!="function")throw Error(le(150));if(x=L.call(x),x==null)throw Error(le(151));for(var z=L=null,D=b,F=b=0,$=null,V=x.next();D!==null&&!V.done;F++,V=x.next()){D.index>F?($=D,D=null):$=D.sibling;var G=g(E,D,V.value,M);if(G===null){D===null&&(D=$);break}t&&D&&G.alternate===null&&e(E,D),b=s(G,b,F),z===null?L=G:z.sibling=G,z=G,D=$}if(V.done)return n(E,D),Lt&&Bo(E,F),L;if(D===null){for(;!V.done;F++,V=x.next())V=f(E,V.value,M),V!==null&&(b=s(V,b,F),z===null?L=V:z.sibling=V,z=V);return Lt&&Bo(E,F),L}for(D=r(E,D);!V.done;F++,V=x.next())V=p(D,E,F,V.value,M),V!==null&&(t&&V.alternate!==null&&D.delete(V.key===null?F:V.key),b=s(V,b,F),z===null?L=V:z.sibling=V,z=V);return t&&D.forEach(function(W){return e(E,W)}),Lt&&Bo(E,F),L}function S(E,b,x,M){if(typeof x=="object"&&x!==null&&x.type===Ha&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Ad:e:{for(var L=x.key,z=b;z!==null;){if(z.key===L){if(L=x.type,L===Ha){if(z.tag===7){n(E,z.sibling),b=i(z,x.props.children),b.return=E,E=b;break e}}else if(z.elementType===L||typeof L=="object"&&L!==null&&L.$$typeof===Us&&Dv(L)===z.type){n(E,z.sibling),b=i(z,x.props),b.ref=wl(E,z,x),b.return=E,E=b;break e}n(E,z);break}else e(E,z);z=z.sibling}x.type===Ha?(b=sa(x.props.children,E.mode,M,x.key),b.return=E,E=b):(M=mf(x.type,x.key,x.props,null,E.mode,M),M.ref=wl(E,b,x),M.return=E,E=M)}return o(E);case Wa:e:{for(z=x.key;b!==null;){if(b.key===z)if(b.tag===4&&b.stateNode.containerInfo===x.containerInfo&&b.stateNode.implementation===x.implementation){n(E,b.sibling),b=i(b,x.children||[]),b.return=E,E=b;break e}else{n(E,b);break}else e(E,b);b=b.sibling}b=O0(x,E.mode,M),b.return=E,E=b}return o(E);case Us:return z=x._init,S(E,b,z(x._payload),M)}if(Tl(x))return _(E,b,x,M);if(hl(x))return A(E,b,x,M);Pd(E,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,b!==null&&b.tag===6?(n(E,b.sibling),b=i(b,x),b.return=E,E=b):(n(E,b),b=M0(x,E.mode,M),b.return=E,E=b),o(E)):n(E,b)}return S}var Ic=Vx(!0),Zx=Vx(!1),$f=To(null),Vf=null,Qa=null,Qm=null;function Xm(){Qm=Qa=Vf=null}function Jm(t){var e=$f.current;Mt($f),t._currentValue=e}function sy(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function fc(t,e){Vf=t,Qm=Qa=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(gr=!0),t.firstContext=null)}function Yr(t){var e=t._currentValue;if(Qm!==t)if(t={context:t,memoizedValue:e,next:null},Qa===null){if(Vf===null)throw Error(le(308));Qa=t,Vf.dependencies={lanes:0,firstContext:t}}else Qa=Qa.next=t;return e}var Vo=null;function ew(t){Vo===null?Vo=[t]:Vo.push(t)}function Kx(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,ew(e)):(n.next=i.next,i.next=n),e.interleaved=n,Es(t,r)}function Es(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Fs=!1;function tw(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Gx(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function ws(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function ro(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,ot&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,Es(t,n)}return i=r.interleaved,i===null?(e.next=e,ew(r)):(e.next=i.next,i.next=e),r.interleaved=e,Es(t,n)}function df(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Um(t,n)}}function Pv(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=e:s=s.next=e}else i=s=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function Zf(t,e,n,r){var i=t.updateQueue;Fs=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var c=a,l=c.next;c.next=null,o===null?s=l:o.next=l,o=c;var u=t.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==o&&(a===null?u.firstBaseUpdate=l:a.next=l,u.lastBaseUpdate=c))}if(s!==null){var f=i.baseState;o=0,u=l=c=null,a=s;do{var g=a.lane,p=a.eventTime;if((r&g)===g){u!==null&&(u=u.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var _=t,A=a;switch(g=e,p=n,A.tag){case 1:if(_=A.payload,typeof _=="function"){f=_.call(p,f,g);break e}f=_;break e;case 3:_.flags=_.flags&-65537|128;case 0:if(_=A.payload,g=typeof _=="function"?_.call(p,f,g):_,g==null)break e;f=Ft({},f,g);break e;case 2:Fs=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,g=i.effects,g===null?i.effects=[a]:g.push(a))}else p={eventTime:p,lane:g,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(l=u=p,c=f):u=u.next=p,o|=g;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;g=a,a=g.next,g.next=null,i.lastBaseUpdate=g,i.shared.pending=null}}while(!0);if(u===null&&(c=f),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,e=i.shared.interleaved,e!==null){i=e;do o|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);da|=o,t.lanes=o,t.memoizedState=f}}function Bv(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var r=t[e],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(le(191,i));i.call(r)}}}var ed={},Mi=To(ed),pu=To(ed),gu=To(ed);function Zo(t){if(t===ed)throw Error(le(174));return t}function nw(t,e){switch(It(gu,e),It(pu,t),It(Mi,ed),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:jg(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=jg(e,t)}Mt(Mi),It(Mi,e)}function kc(){Mt(Mi),Mt(pu),Mt(gu)}function Yx(t){Zo(gu.current);var e=Zo(Mi.current),n=jg(e,t.type);e!==n&&(It(pu,t),It(Mi,n))}function rw(t){pu.current===t&&(Mt(Mi),Mt(pu))}var Pt=To(0);function Kf(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var A0=[];function iw(){for(var t=0;t<A0.length;t++)A0[t]._workInProgressVersionPrimary=null;A0.length=0}var ff=Ts.ReactCurrentDispatcher,I0=Ts.ReactCurrentBatchConfig,ua=0,Ut=null,yn=null,kn=null,Gf=!1,$l=!1,yu=0,tO=0;function Un(){throw Error(le(321))}function sw(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!fi(t[n],e[n]))return!1;return!0}function ow(t,e,n,r,i,s){if(ua=s,Ut=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,ff.current=t===null||t.memoizedState===null?sO:oO,t=n(r,i),$l){s=0;do{if($l=!1,yu=0,25<=s)throw Error(le(301));s+=1,kn=yn=null,e.updateQueue=null,ff.current=aO,t=n(r,i)}while($l)}if(ff.current=Yf,e=yn!==null&&yn.next!==null,ua=0,kn=yn=Ut=null,Gf=!1,e)throw Error(le(300));return t}function aw(){var t=yu!==0;return yu=0,t}function bi(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return kn===null?Ut.memoizedState=kn=t:kn=kn.next=t,kn}function qr(){if(yn===null){var t=Ut.alternate;t=t!==null?t.memoizedState:null}else t=yn.next;var e=kn===null?Ut.memoizedState:kn.next;if(e!==null)kn=e,yn=t;else{if(t===null)throw Error(le(310));yn=t,t={memoizedState:yn.memoizedState,baseState:yn.baseState,baseQueue:yn.baseQueue,queue:yn.queue,next:null},kn===null?Ut.memoizedState=kn=t:kn=kn.next=t}return kn}function mu(t,e){return typeof e=="function"?e(t):e}function k0(t){var e=qr(),n=e.queue;if(n===null)throw Error(le(311));n.lastRenderedReducer=t;var r=yn,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var a=o=null,c=null,l=s;do{var u=l.lane;if((ua&u)===u)c!==null&&(c=c.next={lane:0,action:l.action,hasEagerState:l.hasEagerState,eagerState:l.eagerState,next:null}),r=l.hasEagerState?l.eagerState:t(r,l.action);else{var f={lane:u,action:l.action,hasEagerState:l.hasEagerState,eagerState:l.eagerState,next:null};c===null?(a=c=f,o=r):c=c.next=f,Ut.lanes|=u,da|=u}l=l.next}while(l!==null&&l!==s);c===null?o=r:c.next=a,fi(r,e.memoizedState)||(gr=!0),e.memoizedState=r,e.baseState=o,e.baseQueue=c,n.lastRenderedState=r}if(t=n.interleaved,t!==null){i=t;do s=i.lane,Ut.lanes|=s,da|=s,i=i.next;while(i!==t)}else i===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function R0(t){var e=qr(),n=e.queue;if(n===null)throw Error(le(311));n.lastRenderedReducer=t;var r=n.dispatch,i=n.pending,s=e.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do s=t(s,o.action),o=o.next;while(o!==i);fi(s,e.memoizedState)||(gr=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),n.lastRenderedState=s}return[s,r]}function qx(){}function Qx(t,e){var n=Ut,r=qr(),i=e(),s=!fi(r.memoizedState,i);if(s&&(r.memoizedState=i,gr=!0),r=r.queue,cw(eS.bind(null,n,r,t),[t]),r.getSnapshot!==e||s||kn!==null&&kn.memoizedState.tag&1){if(n.flags|=2048,wu(9,Jx.bind(null,n,r,i,e),void 0,null),Nn===null)throw Error(le(349));ua&30||Xx(n,e,i)}return i}function Xx(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=Ut.updateQueue,e===null?(e={lastEffect:null,stores:null},Ut.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function Jx(t,e,n,r){e.value=n,e.getSnapshot=r,tS(e)&&nS(t)}function eS(t,e,n){return n(function(){tS(e)&&nS(t)})}function tS(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!fi(t,n)}catch{return!0}}function nS(t){var e=Es(t,1);e!==null&&li(e,t,1,-1)}function zv(t){var e=bi();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:mu,lastRenderedState:t},e.queue=t,t=t.dispatch=iO.bind(null,Ut,t),[e.memoizedState,t]}function wu(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=Ut.updateQueue,e===null?(e={lastEffect:null,stores:null},Ut.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t)),t}function rS(){return qr().memoizedState}function hf(t,e,n,r){var i=bi();Ut.flags|=t,i.memoizedState=wu(1|e,n,void 0,r===void 0?null:r)}function $h(t,e,n,r){var i=qr();r=r===void 0?null:r;var s=void 0;if(yn!==null){var o=yn.memoizedState;if(s=o.destroy,r!==null&&sw(r,o.deps)){i.memoizedState=wu(e,n,s,r);return}}Ut.flags|=t,i.memoizedState=wu(1|e,n,s,r)}function jv(t,e){return hf(8390656,8,t,e)}function cw(t,e){return $h(2048,8,t,e)}function iS(t,e){return $h(4,2,t,e)}function sS(t,e){return $h(4,4,t,e)}function oS(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function aS(t,e,n){return n=n!=null?n.concat([t]):null,$h(4,4,oS.bind(null,e,t),n)}function lw(){}function cS(t,e){var n=qr();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&sw(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function lS(t,e){var n=qr();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&sw(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function uS(t,e,n){return ua&21?(fi(n,e)||(n=gx(),Ut.lanes|=n,da|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,gr=!0),t.memoizedState=n)}function nO(t,e){var n=wt;wt=n!==0&&4>n?n:4,t(!0);var r=I0.transition;I0.transition={};try{t(!1),e()}finally{wt=n,I0.transition=r}}function dS(){return qr().memoizedState}function rO(t,e,n){var r=so(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},fS(t))hS(e,n);else if(n=Kx(t,e,n,r),n!==null){var i=tr();li(n,t,r,i),pS(n,e,r)}}function iO(t,e,n){var r=so(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(fS(t))hS(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,fi(a,o)){var c=e.interleaved;c===null?(i.next=i,ew(e)):(i.next=c.next,c.next=i),e.interleaved=i;return}}catch{}finally{}n=Kx(t,e,i,r),n!==null&&(i=tr(),li(n,t,r,i),pS(n,e,r))}}function fS(t){var e=t.alternate;return t===Ut||e!==null&&e===Ut}function hS(t,e){$l=Gf=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function pS(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Um(t,n)}}var Yf={readContext:Yr,useCallback:Un,useContext:Un,useEffect:Un,useImperativeHandle:Un,useInsertionEffect:Un,useLayoutEffect:Un,useMemo:Un,useReducer:Un,useRef:Un,useState:Un,useDebugValue:Un,useDeferredValue:Un,useTransition:Un,useMutableSource:Un,useSyncExternalStore:Un,useId:Un,unstable_isNewReconciler:!1},sO={readContext:Yr,useCallback:function(t,e){return bi().memoizedState=[t,e===void 0?null:e],t},useContext:Yr,useEffect:jv,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,hf(4194308,4,oS.bind(null,e,t),n)},useLayoutEffect:function(t,e){return hf(4194308,4,t,e)},useInsertionEffect:function(t,e){return hf(4,2,t,e)},useMemo:function(t,e){var n=bi();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=bi();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=rO.bind(null,Ut,t),[r.memoizedState,t]},useRef:function(t){var e=bi();return t={current:t},e.memoizedState=t},useState:zv,useDebugValue:lw,useDeferredValue:function(t){return bi().memoizedState=t},useTransition:function(){var t=zv(!1),e=t[0];return t=nO.bind(null,t[1]),bi().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Ut,i=bi();if(Lt){if(n===void 0)throw Error(le(407));n=n()}else{if(n=e(),Nn===null)throw Error(le(349));ua&30||Xx(r,e,n)}i.memoizedState=n;var s={value:n,getSnapshot:e};return i.queue=s,jv(eS.bind(null,r,s,t),[t]),r.flags|=2048,wu(9,Jx.bind(null,r,s,n,e),void 0,null),n},useId:function(){var t=bi(),e=Nn.identifierPrefix;if(Lt){var n=fs,r=ds;n=(r&~(1<<32-ci(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=yu++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=tO++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},oO={readContext:Yr,useCallback:cS,useContext:Yr,useEffect:cw,useImperativeHandle:aS,useInsertionEffect:iS,useLayoutEffect:sS,useMemo:lS,useReducer:k0,useRef:rS,useState:function(){return k0(mu)},useDebugValue:lw,useDeferredValue:function(t){var e=qr();return uS(e,yn.memoizedState,t)},useTransition:function(){var t=k0(mu)[0],e=qr().memoizedState;return[t,e]},useMutableSource:qx,useSyncExternalStore:Qx,useId:dS,unstable_isNewReconciler:!1},aO={readContext:Yr,useCallback:cS,useContext:Yr,useEffect:cw,useImperativeHandle:aS,useInsertionEffect:iS,useLayoutEffect:sS,useMemo:lS,useReducer:R0,useRef:rS,useState:function(){return R0(mu)},useDebugValue:lw,useDeferredValue:function(t){var e=qr();return yn===null?e.memoizedState=t:uS(e,yn.memoizedState,t)},useTransition:function(){var t=R0(mu)[0],e=qr().memoizedState;return[t,e]},useMutableSource:qx,useSyncExternalStore:Qx,useId:dS,unstable_isNewReconciler:!1};function ti(t,e){if(t&&t.defaultProps){e=Ft({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function oy(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:Ft({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var Vh={isMounted:function(t){return(t=t._reactInternals)?Sa(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=tr(),i=so(t),s=ws(r,i);s.payload=e,n!=null&&(s.callback=n),e=ro(t,s,i),e!==null&&(li(e,t,i,r),df(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=tr(),i=so(t),s=ws(r,i);s.tag=1,s.payload=e,n!=null&&(s.callback=n),e=ro(t,s,i),e!==null&&(li(e,t,i,r),df(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=tr(),r=so(t),i=ws(n,r);i.tag=2,e!=null&&(i.callback=e),e=ro(t,i,r),e!==null&&(li(e,t,r,n),df(e,t,r))}};function Uv(t,e,n,r,i,s,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,s,o):e.prototype&&e.prototype.isPureReactComponent?!uu(n,r)||!uu(i,s):!0}function gS(t,e,n){var r=!1,i=yo,s=e.contextType;return typeof s=="object"&&s!==null?s=Yr(s):(i=wr(e)?ca:Yn.current,r=e.contextTypes,s=(r=r!=null)?Sc(t,i):yo),e=new e(n,s),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=Vh,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=s),e}function Fv(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&Vh.enqueueReplaceState(e,e.state,null)}function ay(t,e,n,r){var i=t.stateNode;i.props=n,i.state=t.memoizedState,i.refs={},tw(t);var s=e.contextType;typeof s=="object"&&s!==null?i.context=Yr(s):(s=wr(e)?ca:Yn.current,i.context=Sc(t,s)),i.state=t.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&(oy(t,e,s,n),i.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&Vh.enqueueReplaceState(i,i.state,null),Zf(t,n,i,r),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308)}function Rc(t,e){try{var n="",r=e;do n+=D2(r),r=r.return;while(r);var i=n}catch(s){i=` +Error generating stack: `+s.message+` +`+s.stack}return{value:t,source:e,stack:i,digest:null}}function N0(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function cy(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var cO=typeof WeakMap=="function"?WeakMap:Map;function yS(t,e,n){n=ws(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){Qf||(Qf=!0,wy=r),cy(t,e)},n}function mS(t,e,n){n=ws(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;n.payload=function(){return r(i)},n.callback=function(){cy(t,e)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){cy(t,e),typeof r!="function"&&(io===null?io=new Set([this]):io.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),n}function Wv(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new cO;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(n)||(i.add(n),t=EO.bind(null,t,e,n),e.then(t,t))}function Hv(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function $v(t,e,n,r,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=ws(-1,1),e.tag=2,ro(n,e,1))),n.lanes|=1),t)}var lO=Ts.ReactCurrentOwner,gr=!1;function Qn(t,e,n,r){e.child=t===null?Zx(e,null,n,r):Ic(e,t.child,n,r)}function Vv(t,e,n,r,i){n=n.render;var s=e.ref;return fc(e,i),r=ow(t,e,n,r,s,i),n=aw(),t!==null&&!gr?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,xs(t,e,i)):(Lt&&n&&Gm(e),e.flags|=1,Qn(t,e,r,i),e.child)}function Zv(t,e,n,r,i){if(t===null){var s=n.type;return typeof s=="function"&&!mw(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=s,wS(t,e,s,r,i)):(t=mf(n.type,null,r,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!(t.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:uu,n(o,r)&&t.ref===e.ref)return xs(t,e,i)}return e.flags|=1,t=oo(s,r),t.ref=e.ref,t.return=e,e.child=t}function wS(t,e,n,r,i){if(t!==null){var s=t.memoizedProps;if(uu(s,r)&&t.ref===e.ref)if(gr=!1,e.pendingProps=r=s,(t.lanes&i)!==0)t.flags&131072&&(gr=!0);else return e.lanes=t.lanes,xs(t,e,i)}return ly(t,e,n,r,i)}function _S(t,e,n){var r=e.pendingProps,i=r.children,s=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},It(Ja,xr),xr|=n;else{if(!(n&1073741824))return t=s!==null?s.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,It(Ja,xr),xr|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,It(Ja,xr),xr|=r}else s!==null?(r=s.baseLanes|n,e.memoizedState=null):r=n,It(Ja,xr),xr|=r;return Qn(t,e,i,n),e.child}function vS(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function ly(t,e,n,r,i){var s=wr(n)?ca:Yn.current;return s=Sc(e,s),fc(e,i),n=ow(t,e,n,r,s,i),r=aw(),t!==null&&!gr?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,xs(t,e,i)):(Lt&&r&&Gm(e),e.flags|=1,Qn(t,e,n,i),e.child)}function Kv(t,e,n,r,i){if(wr(n)){var s=!0;Ff(e)}else s=!1;if(fc(e,i),e.stateNode===null)pf(t,e),gS(e,n,r),ay(e,n,r,i),r=!0;else if(t===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var c=o.context,l=n.contextType;typeof l=="object"&&l!==null?l=Yr(l):(l=wr(n)?ca:Yn.current,l=Sc(e,l));var u=n.getDerivedStateFromProps,f=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||c!==l)&&Fv(e,o,r,l),Fs=!1;var g=e.memoizedState;o.state=g,Zf(e,r,o,i),c=e.memoizedState,a!==r||g!==c||mr.current||Fs?(typeof u=="function"&&(oy(e,n,u,r),c=e.memoizedState),(a=Fs||Uv(e,n,a,r,g,c,l))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=c),o.props=r,o.state=c,o.context=l,r=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{o=e.stateNode,Gx(t,e),a=e.memoizedProps,l=e.type===e.elementType?a:ti(e.type,a),o.props=l,f=e.pendingProps,g=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=Yr(c):(c=wr(n)?ca:Yn.current,c=Sc(e,c));var p=n.getDerivedStateFromProps;(u=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==f||g!==c)&&Fv(e,o,r,c),Fs=!1,g=e.memoizedState,o.state=g,Zf(e,r,o,i);var _=e.memoizedState;a!==f||g!==_||mr.current||Fs?(typeof p=="function"&&(oy(e,n,p,r),_=e.memoizedState),(l=Fs||Uv(e,n,l,r,g,_,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,_,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,_,c)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&g===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&g===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=_),o.props=r,o.state=_,o.context=c,r=l):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&g===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&g===t.memoizedState||(e.flags|=1024),r=!1)}return uy(t,e,n,r,s,i)}function uy(t,e,n,r,i,s){vS(t,e);var o=(e.flags&128)!==0;if(!r&&!o)return i&&Ov(e,n,!1),xs(t,e,s);r=e.stateNode,lO.current=e;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&o?(e.child=Ic(e,t.child,null,s),e.child=Ic(e,null,a,s)):Qn(t,e,a,s),e.memoizedState=r.state,i&&Ov(e,n,!0),e.child}function bS(t){var e=t.stateNode;e.pendingContext?Mv(t,e.pendingContext,e.pendingContext!==e.context):e.context&&Mv(t,e.context,!1),nw(t,e.containerInfo)}function Gv(t,e,n,r,i){return Ac(),qm(i),e.flags|=256,Qn(t,e,n,r),e.child}var dy={dehydrated:null,treeContext:null,retryLane:0};function fy(t){return{baseLanes:t,cachePool:null,transitions:null}}function ES(t,e,n){var r=e.pendingProps,i=Pt.current,s=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=t!==null&&t.memoizedState===null?!1:(i&2)!==0),a?(s=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),It(Pt,i&1),t===null)return iy(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=r.children,t=r.fallback,s?(r=e.mode,s=e.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=Gh(o,r,0,null),t=sa(t,r,n,null),s.return=e,t.return=e,s.sibling=t,e.child=s,e.child.memoizedState=fy(n),e.memoizedState=dy,t):uw(e,o));if(i=t.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return uO(t,e,o,r,a,i,n);if(s){s=r.fallback,o=e.mode,i=t.child,a=i.sibling;var c={mode:"hidden",children:r.children};return!(o&1)&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=c,e.deletions=null):(r=oo(i,c),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=oo(a,s):(s=sa(s,o,n,null),s.flags|=2),s.return=e,r.return=e,r.sibling=s,e.child=r,r=s,s=e.child,o=t.child.memoizedState,o=o===null?fy(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=t.childLanes&~n,e.memoizedState=dy,r}return s=t.child,t=s.sibling,r=oo(s,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function uw(t,e){return e=Gh({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Bd(t,e,n,r){return r!==null&&qm(r),Ic(e,t.child,null,n),t=uw(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function uO(t,e,n,r,i,s,o){if(n)return e.flags&256?(e.flags&=-257,r=N0(Error(le(422))),Bd(t,e,o,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(s=r.fallback,i=e.mode,r=Gh({mode:"visible",children:r.children},i,0,null),s=sa(s,i,o,null),s.flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,e.mode&1&&Ic(e,t.child,null,o),e.child.memoizedState=fy(o),e.memoizedState=dy,s);if(!(e.mode&1))return Bd(t,e,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(le(419)),r=N0(s,r,void 0),Bd(t,e,o,r)}if(a=(o&t.childLanes)!==0,gr||a){if(r=Nn,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,Es(t,i),li(r,t,i,-1))}return yw(),r=N0(Error(le(421))),Bd(t,e,o,r)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=xO.bind(null,t),i._reactRetry=e,null):(t=s.treeContext,Rr=no(i.nextSibling),Tr=e,Lt=!0,ii=null,t!==null&&(Wr[Hr++]=ds,Wr[Hr++]=fs,Wr[Hr++]=la,ds=t.id,fs=t.overflow,la=e),e=uw(e,r.children),e.flags|=4096,e)}function Yv(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),sy(t.return,e,n)}function T0(t,e,n,r,i){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function xS(t,e,n){var r=e.pendingProps,i=r.revealOrder,s=r.tail;if(Qn(t,e,r.children,n),r=Pt.current,r&2)r=r&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Yv(t,n,e);else if(t.tag===19)Yv(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(It(Pt,r),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(n=e.child,i=null;n!==null;)t=n.alternate,t!==null&&Kf(t)===null&&(i=n),n=n.sibling;n=i,n===null?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),T0(e,!1,i,n,s);break;case"backwards":for(n=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&Kf(t)===null){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}T0(e,!0,n,null,s);break;case"together":T0(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function pf(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function xs(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),da|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(le(153));if(e.child!==null){for(t=e.child,n=oo(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=oo(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function dO(t,e,n){switch(e.tag){case 3:bS(e),Ac();break;case 5:Yx(e);break;case 1:wr(e.type)&&Ff(e);break;case 4:nw(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;It($f,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(It(Pt,Pt.current&1),e.flags|=128,null):n&e.child.childLanes?ES(t,e,n):(It(Pt,Pt.current&1),t=xs(t,e,n),t!==null?t.sibling:null);It(Pt,Pt.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return xS(t,e,n);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),It(Pt,Pt.current),r)break;return null;case 22:case 23:return e.lanes=0,_S(t,e,n)}return xs(t,e,n)}var SS,hy,AS,IS;SS=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};hy=function(){};AS=function(t,e,n,r){var i=t.memoizedProps;if(i!==r){t=e.stateNode,Zo(Mi.current);var s=null;switch(n){case"input":i=Dg(t,i),r=Dg(t,r),s=[];break;case"select":i=Ft({},i,{value:void 0}),r=Ft({},r,{value:void 0}),s=[];break;case"textarea":i=zg(t,i),r=zg(t,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=jf)}Ug(n,r);var o;n=null;for(l in i)if(!r.hasOwnProperty(l)&&i.hasOwnProperty(l)&&i[l]!=null)if(l==="style"){var a=i[l];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else l!=="dangerouslySetInnerHTML"&&l!=="children"&&l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(ru.hasOwnProperty(l)?s||(s=[]):(s=s||[]).push(l,null));for(l in r){var c=r[l];if(a=i!=null?i[l]:void 0,r.hasOwnProperty(l)&&c!==a&&(c!=null||a!=null))if(l==="style")if(a){for(o in a)!a.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&a[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(s||(s=[]),s.push(l,n)),n=c;else l==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,a=a?a.__html:void 0,c!=null&&a!==c&&(s=s||[]).push(l,c)):l==="children"?typeof c!="string"&&typeof c!="number"||(s=s||[]).push(l,""+c):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&(ru.hasOwnProperty(l)?(c!=null&&l==="onScroll"&&Nt("scroll",t),s||a===c||(s=[])):(s=s||[]).push(l,c))}n&&(s=s||[]).push("style",n);var l=s;(e.updateQueue=l)&&(e.flags|=4)}};IS=function(t,e,n,r){n!==r&&(e.flags|=4)};function _l(t,e){if(!Lt)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function Fn(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function fO(t,e,n){var r=e.pendingProps;switch(Ym(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fn(e),null;case 1:return wr(e.type)&&Uf(),Fn(e),null;case 3:return r=e.stateNode,kc(),Mt(mr),Mt(Yn),iw(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(Dd(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,ii!==null&&(by(ii),ii=null))),hy(t,e),Fn(e),null;case 5:rw(e);var i=Zo(gu.current);if(n=e.type,t!==null&&e.stateNode!=null)AS(t,e,n,r,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(le(166));return Fn(e),null}if(t=Zo(Mi.current),Dd(e)){r=e.stateNode,n=e.type;var s=e.memoizedProps;switch(r[xi]=e,r[hu]=s,t=(e.mode&1)!==0,n){case"dialog":Nt("cancel",r),Nt("close",r);break;case"iframe":case"object":case"embed":Nt("load",r);break;case"video":case"audio":for(i=0;i<Ol.length;i++)Nt(Ol[i],r);break;case"source":Nt("error",r);break;case"img":case"image":case"link":Nt("error",r),Nt("load",r);break;case"details":Nt("toggle",r);break;case"input":iv(r,s),Nt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Nt("invalid",r);break;case"textarea":ov(r,s),Nt("invalid",r)}Ug(n,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&Ld(r.textContent,a,t),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&Ld(r.textContent,a,t),i=["children",""+a]):ru.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&Nt("scroll",r)}switch(n){case"input":Id(r),sv(r,s,!0);break;case"textarea":Id(r),av(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=jf)}r=i,e.updateQueue=r,r!==null&&(e.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=ex(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=o.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=o.createElement(n,{is:r.is}):(t=o.createElement(n),n==="select"&&(o=t,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):t=o.createElementNS(t,n),t[xi]=e,t[hu]=r,SS(t,e,!1,!1),e.stateNode=t;e:{switch(o=Fg(n,r),n){case"dialog":Nt("cancel",t),Nt("close",t),i=r;break;case"iframe":case"object":case"embed":Nt("load",t),i=r;break;case"video":case"audio":for(i=0;i<Ol.length;i++)Nt(Ol[i],t);i=r;break;case"source":Nt("error",t),i=r;break;case"img":case"image":case"link":Nt("error",t),Nt("load",t),i=r;break;case"details":Nt("toggle",t),i=r;break;case"input":iv(t,r),i=Dg(t,r),Nt("invalid",t);break;case"option":i=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},i=Ft({},r,{value:void 0}),Nt("invalid",t);break;case"textarea":ov(t,r),i=zg(t,r),Nt("invalid",t);break;default:i=r}Ug(n,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var c=a[s];s==="style"?rx(t,c):s==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&tx(t,c)):s==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&iu(t,c):typeof c=="number"&&iu(t,""+c):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(ru.hasOwnProperty(s)?c!=null&&s==="onScroll"&&Nt("scroll",t):c!=null&&Lm(t,s,c,o))}switch(n){case"input":Id(t),sv(t,r,!1);break;case"textarea":Id(t),av(t);break;case"option":r.value!=null&&t.setAttribute("value",""+go(r.value));break;case"select":t.multiple=!!r.multiple,s=r.value,s!=null?cc(t,!!r.multiple,s,!1):r.defaultValue!=null&&cc(t,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=jf)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return Fn(e),null;case 6:if(t&&e.stateNode!=null)IS(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(le(166));if(n=Zo(gu.current),Zo(Mi.current),Dd(e)){if(r=e.stateNode,n=e.memoizedProps,r[xi]=e,(s=r.nodeValue!==n)&&(t=Tr,t!==null))switch(t.tag){case 3:Ld(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Ld(r.nodeValue,n,(t.mode&1)!==0)}s&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[xi]=e,e.stateNode=r}return Fn(e),null;case 13:if(Mt(Pt),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(Lt&&Rr!==null&&e.mode&1&&!(e.flags&128))$x(),Ac(),e.flags|=98560,s=!1;else if(s=Dd(e),r!==null&&r.dehydrated!==null){if(t===null){if(!s)throw Error(le(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(le(317));s[xi]=e}else Ac(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Fn(e),s=!1}else ii!==null&&(by(ii),ii=null),s=!0;if(!s)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(r=r!==null,r!==(t!==null&&t.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(t===null||Pt.current&1?vn===0&&(vn=3):yw())),e.updateQueue!==null&&(e.flags|=4),Fn(e),null);case 4:return kc(),hy(t,e),t===null&&du(e.stateNode.containerInfo),Fn(e),null;case 10:return Jm(e.type._context),Fn(e),null;case 17:return wr(e.type)&&Uf(),Fn(e),null;case 19:if(Mt(Pt),s=e.memoizedState,s===null)return Fn(e),null;if(r=(e.flags&128)!==0,o=s.rendering,o===null)if(r)_l(s,!1);else{if(vn!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(o=Kf(t),o!==null){for(e.flags|=128,_l(s,!1),r=o.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)s=n,t=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=t,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,t=o.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return It(Pt,Pt.current&1|2),e.child}t=t.sibling}s.tail!==null&&Kt()>Nc&&(e.flags|=128,r=!0,_l(s,!1),e.lanes=4194304)}else{if(!r)if(t=Kf(o),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),_l(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Lt)return Fn(e),null}else 2*Kt()-s.renderingStartTime>Nc&&n!==1073741824&&(e.flags|=128,r=!0,_l(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(n=s.last,n!==null?n.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Kt(),e.sibling=null,n=Pt.current,It(Pt,r?n&1|2:n&1),e):(Fn(e),null);case 22:case 23:return gw(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?xr&1073741824&&(Fn(e),e.subtreeFlags&6&&(e.flags|=8192)):Fn(e),null;case 24:return null;case 25:return null}throw Error(le(156,e.tag))}function hO(t,e){switch(Ym(e),e.tag){case 1:return wr(e.type)&&Uf(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return kc(),Mt(mr),Mt(Yn),iw(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return rw(e),null;case 13:if(Mt(Pt),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(le(340));Ac()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Mt(Pt),null;case 4:return kc(),null;case 10:return Jm(e.type._context),null;case 22:case 23:return gw(),null;case 24:return null;default:return null}}var zd=!1,Kn=!1,pO=typeof WeakSet=="function"?WeakSet:Set,xe=null;function Xa(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Vt(t,e,r)}else n.current=null}function py(t,e,n){try{n()}catch(r){Vt(t,e,r)}}var qv=!1;function gO(t,e){if(Qg=Pf,t=Mx(),Km(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,c=-1,l=0,u=0,f=t,g=null;t:for(;;){for(var p;f!==n||i!==0&&f.nodeType!==3||(a=o+i),f!==s||r!==0&&f.nodeType!==3||(c=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(p=f.firstChild)!==null;)g=f,f=p;for(;;){if(f===t)break t;if(g===n&&++l===i&&(a=o),g===s&&++u===r&&(c=o),(p=f.nextSibling)!==null)break;f=g,g=f.parentNode}f=p}n=a===-1||c===-1?null:{start:a,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Xg={focusedElem:t,selectionRange:n},Pf=!1,xe=e;xe!==null;)if(e=xe,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,xe=t;else for(;xe!==null;){e=xe;try{var _=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(_!==null){var A=_.memoizedProps,S=_.memoizedState,E=e.stateNode,b=E.getSnapshotBeforeUpdate(e.elementType===e.type?A:ti(e.type,A),S);E.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var x=e.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(le(163))}}catch(M){Vt(e,e.return,M)}if(t=e.sibling,t!==null){t.return=e.return,xe=t;break}xe=e.return}return _=qv,qv=!1,_}function Vl(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&py(e,n,s)}i=i.next}while(i!==r)}}function Zh(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function gy(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function kS(t){var e=t.alternate;e!==null&&(t.alternate=null,kS(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[xi],delete e[hu],delete e[ty],delete e[QM],delete e[XM])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function RS(t){return t.tag===5||t.tag===3||t.tag===4}function Qv(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||RS(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function yy(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=jf));else if(r!==4&&(t=t.child,t!==null))for(yy(t,e,n),t=t.sibling;t!==null;)yy(t,e,n),t=t.sibling}function my(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(my(t,e,n),t=t.sibling;t!==null;)my(t,e,n),t=t.sibling}var Cn=null,ri=!1;function Os(t,e,n){for(n=n.child;n!==null;)NS(t,e,n),n=n.sibling}function NS(t,e,n){if(Ti&&typeof Ti.onCommitFiberUnmount=="function")try{Ti.onCommitFiberUnmount(zh,n)}catch{}switch(n.tag){case 5:Kn||Xa(n,e);case 6:var r=Cn,i=ri;Cn=null,Os(t,e,n),Cn=r,ri=i,Cn!==null&&(ri?(t=Cn,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Cn.removeChild(n.stateNode));break;case 18:Cn!==null&&(ri?(t=Cn,n=n.stateNode,t.nodeType===8?x0(t.parentNode,n):t.nodeType===1&&x0(t,n),cu(t)):x0(Cn,n.stateNode));break;case 4:r=Cn,i=ri,Cn=n.stateNode.containerInfo,ri=!0,Os(t,e,n),Cn=r,ri=i;break;case 0:case 11:case 14:case 15:if(!Kn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&py(n,e,o),i=i.next}while(i!==r)}Os(t,e,n);break;case 1:if(!Kn&&(Xa(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Vt(n,e,a)}Os(t,e,n);break;case 21:Os(t,e,n);break;case 22:n.mode&1?(Kn=(r=Kn)||n.memoizedState!==null,Os(t,e,n),Kn=r):Os(t,e,n);break;default:Os(t,e,n)}}function Xv(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new pO),e.forEach(function(r){var i=SO.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Jr(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=t,o=e,a=o;e:for(;a!==null;){switch(a.tag){case 5:Cn=a.stateNode,ri=!1;break e;case 3:Cn=a.stateNode.containerInfo,ri=!0;break e;case 4:Cn=a.stateNode.containerInfo,ri=!0;break e}a=a.return}if(Cn===null)throw Error(le(160));NS(s,o,i),Cn=null,ri=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(l){Vt(i,e,l)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)TS(e,t),e=e.sibling}function TS(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Jr(e,t),wi(t),r&4){try{Vl(3,t,t.return),Zh(3,t)}catch(A){Vt(t,t.return,A)}try{Vl(5,t,t.return)}catch(A){Vt(t,t.return,A)}}break;case 1:Jr(e,t),wi(t),r&512&&n!==null&&Xa(n,n.return);break;case 5:if(Jr(e,t),wi(t),r&512&&n!==null&&Xa(n,n.return),t.flags&32){var i=t.stateNode;try{iu(i,"")}catch(A){Vt(t,t.return,A)}}if(r&4&&(i=t.stateNode,i!=null)){var s=t.memoizedProps,o=n!==null?n.memoizedProps:s,a=t.type,c=t.updateQueue;if(t.updateQueue=null,c!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&XE(i,s),Fg(a,o);var l=Fg(a,s);for(o=0;o<c.length;o+=2){var u=c[o],f=c[o+1];u==="style"?rx(i,f):u==="dangerouslySetInnerHTML"?tx(i,f):u==="children"?iu(i,f):Lm(i,u,f,l)}switch(a){case"input":Pg(i,s);break;case"textarea":JE(i,s);break;case"select":var g=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var p=s.value;p!=null?cc(i,!!s.multiple,p,!1):g!==!!s.multiple&&(s.defaultValue!=null?cc(i,!!s.multiple,s.defaultValue,!0):cc(i,!!s.multiple,s.multiple?[]:"",!1))}i[hu]=s}catch(A){Vt(t,t.return,A)}}break;case 6:if(Jr(e,t),wi(t),r&4){if(t.stateNode===null)throw Error(le(162));i=t.stateNode,s=t.memoizedProps;try{i.nodeValue=s}catch(A){Vt(t,t.return,A)}}break;case 3:if(Jr(e,t),wi(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{cu(e.containerInfo)}catch(A){Vt(t,t.return,A)}break;case 4:Jr(e,t),wi(t);break;case 13:Jr(e,t),wi(t),i=t.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(hw=Kt())),r&4&&Xv(t);break;case 22:if(u=n!==null&&n.memoizedState!==null,t.mode&1?(Kn=(l=Kn)||u,Jr(e,t),Kn=l):Jr(e,t),wi(t),r&8192){if(l=t.memoizedState!==null,(t.stateNode.isHidden=l)&&!u&&t.mode&1)for(xe=t,u=t.child;u!==null;){for(f=xe=u;xe!==null;){switch(g=xe,p=g.child,g.tag){case 0:case 11:case 14:case 15:Vl(4,g,g.return);break;case 1:Xa(g,g.return);var _=g.stateNode;if(typeof _.componentWillUnmount=="function"){r=g,n=g.return;try{e=r,_.props=e.memoizedProps,_.state=e.memoizedState,_.componentWillUnmount()}catch(A){Vt(r,n,A)}}break;case 5:Xa(g,g.return);break;case 22:if(g.memoizedState!==null){e1(f);continue}}p!==null?(p.return=g,xe=p):e1(f)}u=u.sibling}e:for(u=null,f=t;;){if(f.tag===5){if(u===null){u=f;try{i=f.stateNode,l?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=f.stateNode,c=f.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,a.style.display=nx("display",o))}catch(A){Vt(t,t.return,A)}}}else if(f.tag===6){if(u===null)try{f.stateNode.nodeValue=l?"":f.memoizedProps}catch(A){Vt(t,t.return,A)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===t)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;u===f&&(u=null),f=f.return}u===f&&(u=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Jr(e,t),wi(t),r&4&&Xv(t);break;case 21:break;default:Jr(e,t),wi(t)}}function wi(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(RS(n)){var r=n;break e}n=n.return}throw Error(le(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(iu(i,""),r.flags&=-33);var s=Qv(t);my(t,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=Qv(t);yy(t,a,o);break;default:throw Error(le(161))}}catch(c){Vt(t,t.return,c)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function yO(t,e,n){xe=t,MS(t)}function MS(t,e,n){for(var r=(t.mode&1)!==0;xe!==null;){var i=xe,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||zd;if(!o){var a=i.alternate,c=a!==null&&a.memoizedState!==null||Kn;a=zd;var l=Kn;if(zd=o,(Kn=c)&&!l)for(xe=i;xe!==null;)o=xe,c=o.child,o.tag===22&&o.memoizedState!==null?t1(i):c!==null?(c.return=o,xe=c):t1(i);for(;s!==null;)xe=s,MS(s),s=s.sibling;xe=i,zd=a,Kn=l}Jv(t)}else i.subtreeFlags&8772&&s!==null?(s.return=i,xe=s):Jv(t)}}function Jv(t){for(;xe!==null;){var e=xe;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Kn||Zh(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!Kn)if(n===null)r.componentDidMount();else{var i=e.elementType===e.type?n.memoizedProps:ti(e.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;s!==null&&Bv(e,s,r);break;case 3:var o=e.updateQueue;if(o!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}Bv(e,o,n)}break;case 5:var a=e.stateNode;if(n===null&&e.flags&4){n=a;var c=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var l=e.alternate;if(l!==null){var u=l.memoizedState;if(u!==null){var f=u.dehydrated;f!==null&&cu(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(le(163))}Kn||e.flags&512&&gy(e)}catch(g){Vt(e,e.return,g)}}if(e===t){xe=null;break}if(n=e.sibling,n!==null){n.return=e.return,xe=n;break}xe=e.return}}function e1(t){for(;xe!==null;){var e=xe;if(e===t){xe=null;break}var n=e.sibling;if(n!==null){n.return=e.return,xe=n;break}xe=e.return}}function t1(t){for(;xe!==null;){var e=xe;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{Zh(4,e)}catch(c){Vt(e,n,c)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(c){Vt(e,i,c)}}var s=e.return;try{gy(e)}catch(c){Vt(e,s,c)}break;case 5:var o=e.return;try{gy(e)}catch(c){Vt(e,o,c)}}}catch(c){Vt(e,e.return,c)}if(e===t){xe=null;break}var a=e.sibling;if(a!==null){a.return=e.return,xe=a;break}xe=e.return}}var mO=Math.ceil,qf=Ts.ReactCurrentDispatcher,dw=Ts.ReactCurrentOwner,Kr=Ts.ReactCurrentBatchConfig,ot=0,Nn=null,hn=null,zn=0,xr=0,Ja=To(0),vn=0,_u=null,da=0,Kh=0,fw=0,Zl=null,fr=null,hw=0,Nc=1/0,Ji=null,Qf=!1,wy=null,io=null,jd=!1,Ys=null,Xf=0,Kl=0,_y=null,gf=-1,yf=0;function tr(){return ot&6?Kt():gf!==-1?gf:gf=Kt()}function so(t){return t.mode&1?ot&2&&zn!==0?zn&-zn:eO.transition!==null?(yf===0&&(yf=gx()),yf):(t=wt,t!==0||(t=window.event,t=t===void 0?16:Ex(t.type)),t):1}function li(t,e,n,r){if(50<Kl)throw Kl=0,_y=null,Error(le(185));Qu(t,n,r),(!(ot&2)||t!==Nn)&&(t===Nn&&(!(ot&2)&&(Kh|=n),vn===4&&$s(t,zn)),_r(t,r),n===1&&ot===0&&!(e.mode&1)&&(Nc=Kt()+500,Hh&&Mo()))}function _r(t,e){var n=t.callbackNode;eM(t,e);var r=Df(t,t===Nn?zn:0);if(r===0)n!==null&&uv(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&uv(n),e===1)t.tag===0?JM(n1.bind(null,t)):Fx(n1.bind(null,t)),YM(function(){!(ot&6)&&Mo()}),n=null;else{switch(yx(r)){case 1:n=jm;break;case 4:n=hx;break;case 16:n=Lf;break;case 536870912:n=px;break;default:n=Lf}n=jS(n,OS.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function OS(t,e){if(gf=-1,yf=0,ot&6)throw Error(le(327));var n=t.callbackNode;if(hc()&&t.callbackNode!==n)return null;var r=Df(t,t===Nn?zn:0);if(r===0)return null;if(r&30||r&t.expiredLanes||e)e=Jf(t,r);else{e=r;var i=ot;ot|=2;var s=LS();(Nn!==t||zn!==e)&&(Ji=null,Nc=Kt()+500,ia(t,e));do try{vO();break}catch(a){CS(t,a)}while(!0);Xm(),qf.current=s,ot=i,hn!==null?e=0:(Nn=null,zn=0,e=vn)}if(e!==0){if(e===2&&(i=Zg(t),i!==0&&(r=i,e=vy(t,i))),e===1)throw n=_u,ia(t,0),$s(t,r),_r(t,Kt()),n;if(e===6)$s(t,r);else{if(i=t.current.alternate,!(r&30)&&!wO(i)&&(e=Jf(t,r),e===2&&(s=Zg(t),s!==0&&(r=s,e=vy(t,s))),e===1))throw n=_u,ia(t,0),$s(t,r),_r(t,Kt()),n;switch(t.finishedWork=i,t.finishedLanes=r,e){case 0:case 1:throw Error(le(345));case 2:zo(t,fr,Ji);break;case 3:if($s(t,r),(r&130023424)===r&&(e=hw+500-Kt(),10<e)){if(Df(t,0)!==0)break;if(i=t.suspendedLanes,(i&r)!==r){tr(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=ey(zo.bind(null,t,fr,Ji),e);break}zo(t,fr,Ji);break;case 4:if($s(t,r),(r&4194240)===r)break;for(e=t.eventTimes,i=-1;0<r;){var o=31-ci(r);s=1<<o,o=e[o],o>i&&(i=o),r&=~s}if(r=i,r=Kt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*mO(r/1960))-r,10<r){t.timeoutHandle=ey(zo.bind(null,t,fr,Ji),r);break}zo(t,fr,Ji);break;case 5:zo(t,fr,Ji);break;default:throw Error(le(329))}}}return _r(t,Kt()),t.callbackNode===n?OS.bind(null,t):null}function vy(t,e){var n=Zl;return t.current.memoizedState.isDehydrated&&(ia(t,e).flags|=256),t=Jf(t,e),t!==2&&(e=fr,fr=n,e!==null&&by(e)),t}function by(t){fr===null?fr=t:fr.push.apply(fr,t)}function wO(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!fi(s(),i))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function $s(t,e){for(e&=~fw,e&=~Kh,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-ci(e),r=1<<n;t[n]=-1,e&=~r}}function n1(t){if(ot&6)throw Error(le(327));hc();var e=Df(t,0);if(!(e&1))return _r(t,Kt()),null;var n=Jf(t,e);if(t.tag!==0&&n===2){var r=Zg(t);r!==0&&(e=r,n=vy(t,r))}if(n===1)throw n=_u,ia(t,0),$s(t,e),_r(t,Kt()),n;if(n===6)throw Error(le(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,zo(t,fr,Ji),_r(t,Kt()),null}function pw(t,e){var n=ot;ot|=1;try{return t(e)}finally{ot=n,ot===0&&(Nc=Kt()+500,Hh&&Mo())}}function fa(t){Ys!==null&&Ys.tag===0&&!(ot&6)&&hc();var e=ot;ot|=1;var n=Kr.transition,r=wt;try{if(Kr.transition=null,wt=1,t)return t()}finally{wt=r,Kr.transition=n,ot=e,!(ot&6)&&Mo()}}function gw(){xr=Ja.current,Mt(Ja)}function ia(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,GM(n)),hn!==null)for(n=hn.return;n!==null;){var r=n;switch(Ym(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Uf();break;case 3:kc(),Mt(mr),Mt(Yn),iw();break;case 5:rw(r);break;case 4:kc();break;case 13:Mt(Pt);break;case 19:Mt(Pt);break;case 10:Jm(r.type._context);break;case 22:case 23:gw()}n=n.return}if(Nn=t,hn=t=oo(t.current,null),zn=xr=e,vn=0,_u=null,fw=Kh=da=0,fr=Zl=null,Vo!==null){for(e=0;e<Vo.length;e++)if(n=Vo[e],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}n.pending=r}Vo=null}return t}function CS(t,e){do{var n=hn;try{if(Xm(),ff.current=Yf,Gf){for(var r=Ut.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Gf=!1}if(ua=0,kn=yn=Ut=null,$l=!1,yu=0,dw.current=null,n===null||n.return===null){vn=1,_u=e,hn=null;break}e:{var s=t,o=n.return,a=n,c=e;if(e=zn,a.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var l=c,u=a,f=u.tag;if(!(u.mode&1)&&(f===0||f===11||f===15)){var g=u.alternate;g?(u.updateQueue=g.updateQueue,u.memoizedState=g.memoizedState,u.lanes=g.lanes):(u.updateQueue=null,u.memoizedState=null)}var p=Hv(o);if(p!==null){p.flags&=-257,$v(p,o,a,s,e),p.mode&1&&Wv(s,l,e),e=p,c=l;var _=e.updateQueue;if(_===null){var A=new Set;A.add(c),e.updateQueue=A}else _.add(c);break e}else{if(!(e&1)){Wv(s,l,e),yw();break e}c=Error(le(426))}}else if(Lt&&a.mode&1){var S=Hv(o);if(S!==null){!(S.flags&65536)&&(S.flags|=256),$v(S,o,a,s,e),qm(Rc(c,a));break e}}s=c=Rc(c,a),vn!==4&&(vn=2),Zl===null?Zl=[s]:Zl.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e;var E=yS(s,c,e);Pv(s,E);break e;case 1:a=c;var b=s.type,x=s.stateNode;if(!(s.flags&128)&&(typeof b.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(io===null||!io.has(x)))){s.flags|=65536,e&=-e,s.lanes|=e;var M=mS(s,a,e);Pv(s,M);break e}}s=s.return}while(s!==null)}PS(n)}catch(L){e=L,hn===n&&n!==null&&(hn=n=n.return);continue}break}while(!0)}function LS(){var t=qf.current;return qf.current=Yf,t===null?Yf:t}function yw(){(vn===0||vn===3||vn===2)&&(vn=4),Nn===null||!(da&268435455)&&!(Kh&268435455)||$s(Nn,zn)}function Jf(t,e){var n=ot;ot|=2;var r=LS();(Nn!==t||zn!==e)&&(Ji=null,ia(t,e));do try{_O();break}catch(i){CS(t,i)}while(!0);if(Xm(),ot=n,qf.current=r,hn!==null)throw Error(le(261));return Nn=null,zn=0,vn}function _O(){for(;hn!==null;)DS(hn)}function vO(){for(;hn!==null&&!V2();)DS(hn)}function DS(t){var e=zS(t.alternate,t,xr);t.memoizedProps=t.pendingProps,e===null?PS(t):hn=e,dw.current=null}function PS(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=hO(n,e),n!==null){n.flags&=32767,hn=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{vn=6,hn=null;return}}else if(n=fO(n,e,xr),n!==null){hn=n;return}if(e=e.sibling,e!==null){hn=e;return}hn=e=t}while(e!==null);vn===0&&(vn=5)}function zo(t,e,n){var r=wt,i=Kr.transition;try{Kr.transition=null,wt=1,bO(t,e,n,r)}finally{Kr.transition=i,wt=r}return null}function bO(t,e,n,r){do hc();while(Ys!==null);if(ot&6)throw Error(le(327));n=t.finishedWork;var i=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(le(177));t.callbackNode=null,t.callbackPriority=0;var s=n.lanes|n.childLanes;if(tM(t,s),t===Nn&&(hn=Nn=null,zn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||jd||(jd=!0,jS(Lf,function(){return hc(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=Kr.transition,Kr.transition=null;var o=wt;wt=1;var a=ot;ot|=4,dw.current=null,gO(t,n),TS(n,t),FM(Xg),Pf=!!Qg,Xg=Qg=null,t.current=n,yO(n),Z2(),ot=a,wt=o,Kr.transition=s}else t.current=n;if(jd&&(jd=!1,Ys=t,Xf=i),s=t.pendingLanes,s===0&&(io=null),Y2(n.stateNode),_r(t,Kt()),e!==null)for(r=t.onRecoverableError,n=0;n<e.length;n++)i=e[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Qf)throw Qf=!1,t=wy,wy=null,t;return Xf&1&&t.tag!==0&&hc(),s=t.pendingLanes,s&1?t===_y?Kl++:(Kl=0,_y=t):Kl=0,Mo(),null}function hc(){if(Ys!==null){var t=yx(Xf),e=Kr.transition,n=wt;try{if(Kr.transition=null,wt=16>t?16:t,Ys===null)var r=!1;else{if(t=Ys,Ys=null,Xf=0,ot&6)throw Error(le(331));var i=ot;for(ot|=4,xe=t.current;xe!==null;){var s=xe,o=s.child;if(xe.flags&16){var a=s.deletions;if(a!==null){for(var c=0;c<a.length;c++){var l=a[c];for(xe=l;xe!==null;){var u=xe;switch(u.tag){case 0:case 11:case 15:Vl(8,u,s)}var f=u.child;if(f!==null)f.return=u,xe=f;else for(;xe!==null;){u=xe;var g=u.sibling,p=u.return;if(kS(u),u===l){xe=null;break}if(g!==null){g.return=p,xe=g;break}xe=p}}}var _=s.alternate;if(_!==null){var A=_.child;if(A!==null){_.child=null;do{var S=A.sibling;A.sibling=null,A=S}while(A!==null)}}xe=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,xe=o;else e:for(;xe!==null;){if(s=xe,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Vl(9,s,s.return)}var E=s.sibling;if(E!==null){E.return=s.return,xe=E;break e}xe=s.return}}var b=t.current;for(xe=b;xe!==null;){o=xe;var x=o.child;if(o.subtreeFlags&2064&&x!==null)x.return=o,xe=x;else e:for(o=b;xe!==null;){if(a=xe,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Zh(9,a)}}catch(L){Vt(a,a.return,L)}if(a===o){xe=null;break e}var M=a.sibling;if(M!==null){M.return=a.return,xe=M;break e}xe=a.return}}if(ot=i,Mo(),Ti&&typeof Ti.onPostCommitFiberRoot=="function")try{Ti.onPostCommitFiberRoot(zh,t)}catch{}r=!0}return r}finally{wt=n,Kr.transition=e}}return!1}function r1(t,e,n){e=Rc(n,e),e=yS(t,e,1),t=ro(t,e,1),e=tr(),t!==null&&(Qu(t,1,e),_r(t,e))}function Vt(t,e,n){if(t.tag===3)r1(t,t,n);else for(;e!==null;){if(e.tag===3){r1(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(io===null||!io.has(r))){t=Rc(n,t),t=mS(e,t,1),e=ro(e,t,1),t=tr(),e!==null&&(Qu(e,1,t),_r(e,t));break}}e=e.return}}function EO(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=tr(),t.pingedLanes|=t.suspendedLanes&n,Nn===t&&(zn&n)===n&&(vn===4||vn===3&&(zn&130023424)===zn&&500>Kt()-hw?ia(t,0):fw|=n),_r(t,e)}function BS(t,e){e===0&&(t.mode&1?(e=Nd,Nd<<=1,!(Nd&130023424)&&(Nd=4194304)):e=1);var n=tr();t=Es(t,e),t!==null&&(Qu(t,e,n),_r(t,n))}function xO(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),BS(t,n)}function SO(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(le(314))}r!==null&&r.delete(e),BS(t,n)}var zS;zS=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||mr.current)gr=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return gr=!1,dO(t,e,n);gr=!!(t.flags&131072)}else gr=!1,Lt&&e.flags&1048576&&Wx(e,Hf,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;pf(t,e),t=e.pendingProps;var i=Sc(e,Yn.current);fc(e,n),i=ow(null,e,r,t,i,n);var s=aw();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,wr(r)?(s=!0,Ff(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,tw(e),i.updater=Vh,e.stateNode=i,i._reactInternals=e,ay(e,r,t,n),e=uy(null,e,r,!0,s,n)):(e.tag=0,Lt&&s&&Gm(e),Qn(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(pf(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=IO(r),t=ti(r,t),i){case 0:e=ly(null,e,r,t,n);break e;case 1:e=Kv(null,e,r,t,n);break e;case 11:e=Vv(null,e,r,t,n);break e;case 14:e=Zv(null,e,r,ti(r.type,t),n);break e}throw Error(le(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:ti(r,i),ly(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:ti(r,i),Kv(t,e,r,i,n);case 3:e:{if(bS(e),t===null)throw Error(le(387));r=e.pendingProps,s=e.memoizedState,i=s.element,Gx(t,e),Zf(e,r,null,n);var o=e.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=Rc(Error(le(423)),e),e=Gv(t,e,r,n,i);break e}else if(r!==i){i=Rc(Error(le(424)),e),e=Gv(t,e,r,n,i);break e}else for(Rr=no(e.stateNode.containerInfo.firstChild),Tr=e,Lt=!0,ii=null,n=Zx(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ac(),r===i){e=xs(t,e,n);break e}Qn(t,e,r,n)}e=e.child}return e;case 5:return Yx(e),t===null&&iy(e),r=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,Jg(r,i)?o=null:s!==null&&Jg(r,s)&&(e.flags|=32),vS(t,e),Qn(t,e,o,n),e.child;case 6:return t===null&&iy(e),null;case 13:return ES(t,e,n);case 4:return nw(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Ic(e,null,r,n):Qn(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:ti(r,i),Vv(t,e,r,i,n);case 7:return Qn(t,e,e.pendingProps,n),e.child;case 8:return Qn(t,e,e.pendingProps.children,n),e.child;case 12:return Qn(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,It($f,r._currentValue),r._currentValue=o,s!==null)if(fi(s.value,o)){if(s.children===i.children&&!mr.current){e=xs(t,e,n);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var c=a.firstContext;c!==null;){if(c.context===r){if(s.tag===1){c=ws(-1,n&-n),c.tag=2;var l=s.updateQueue;if(l!==null){l=l.shared;var u=l.pending;u===null?c.next=c:(c.next=u.next,u.next=c),l.pending=c}}s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),sy(s.return,n,e),a.lanes|=n;break}c=c.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(le(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),sy(o,n,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Qn(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,fc(e,n),i=Yr(i),r=r(i),e.flags|=1,Qn(t,e,r,n),e.child;case 14:return r=e.type,i=ti(r,e.pendingProps),i=ti(r.type,i),Zv(t,e,r,i,n);case 15:return wS(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:ti(r,i),pf(t,e),e.tag=1,wr(r)?(t=!0,Ff(e)):t=!1,fc(e,n),gS(e,r,i),ay(e,r,i,n),uy(null,e,r,!0,t,n);case 19:return xS(t,e,n);case 22:return _S(t,e,n)}throw Error(le(156,e.tag))};function jS(t,e){return fx(t,e)}function AO(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zr(t,e,n,r){return new AO(t,e,n,r)}function mw(t){return t=t.prototype,!(!t||!t.isReactComponent)}function IO(t){if(typeof t=="function")return mw(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Pm)return 11;if(t===Bm)return 14}return 2}function oo(t,e){var n=t.alternate;return n===null?(n=Zr(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function mf(t,e,n,r,i,s){var o=2;if(r=t,typeof t=="function")mw(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case Ha:return sa(n.children,i,s,e);case Dm:o=8,i|=8;break;case Mg:return t=Zr(12,n,e,i|2),t.elementType=Mg,t.lanes=s,t;case Og:return t=Zr(13,n,e,i),t.elementType=Og,t.lanes=s,t;case Cg:return t=Zr(19,n,e,i),t.elementType=Cg,t.lanes=s,t;case YE:return Gh(n,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case KE:o=10;break e;case GE:o=9;break e;case Pm:o=11;break e;case Bm:o=14;break e;case Us:o=16,r=null;break e}throw Error(le(130,t==null?t:typeof t,""))}return e=Zr(o,n,e,i),e.elementType=t,e.type=r,e.lanes=s,e}function sa(t,e,n,r){return t=Zr(7,t,r,e),t.lanes=n,t}function Gh(t,e,n,r){return t=Zr(22,t,r,e),t.elementType=YE,t.lanes=n,t.stateNode={isHidden:!1},t}function M0(t,e,n){return t=Zr(6,t,null,e),t.lanes=n,t}function O0(t,e,n){return e=Zr(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function kO(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=f0(0),this.expirationTimes=f0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=f0(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function ww(t,e,n,r,i,s,o,a,c){return t=new kO(t,e,n,a,c),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Zr(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},tw(s),t}function RO(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Wa,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function US(t){if(!t)return yo;t=t._reactInternals;e:{if(Sa(t)!==t||t.tag!==1)throw Error(le(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(wr(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(le(171))}if(t.tag===1){var n=t.type;if(wr(n))return Ux(t,n,e)}return e}function FS(t,e,n,r,i,s,o,a,c){return t=ww(n,r,!0,t,i,s,o,a,c),t.context=US(null),n=t.current,r=tr(),i=so(n),s=ws(r,i),s.callback=e??null,ro(n,s,i),t.current.lanes=i,Qu(t,i,r),_r(t,r),t}function Yh(t,e,n,r){var i=e.current,s=tr(),o=so(i);return n=US(n),e.context===null?e.context=n:e.pendingContext=n,e=ws(s,o),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=ro(i,e,o),t!==null&&(li(t,i,o,s),df(t,i,o)),o}function eh(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function i1(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function _w(t,e){i1(t,e),(t=t.alternate)&&i1(t,e)}function NO(){return null}var WS=typeof reportError=="function"?reportError:function(t){console.error(t)};function vw(t){this._internalRoot=t}qh.prototype.render=vw.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(le(409));Yh(t,e,null,null)};qh.prototype.unmount=vw.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;fa(function(){Yh(null,t,null,null)}),e[bs]=null}};function qh(t){this._internalRoot=t}qh.prototype.unstable_scheduleHydration=function(t){if(t){var e=_x();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Hs.length&&e!==0&&e<Hs[n].priority;n++);Hs.splice(n,0,t),n===0&&bx(t)}};function bw(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Qh(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function s1(){}function TO(t,e,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var l=eh(o);s.call(l)}}var o=FS(e,r,t,0,null,!1,!1,"",s1);return t._reactRootContainer=o,t[bs]=o.current,du(t.nodeType===8?t.parentNode:t),fa(),o}for(;i=t.lastChild;)t.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var l=eh(c);a.call(l)}}var c=ww(t,0,!1,null,null,!1,!1,"",s1);return t._reactRootContainer=c,t[bs]=c.current,du(t.nodeType===8?t.parentNode:t),fa(function(){Yh(e,c,n,r)}),c}function Xh(t,e,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var c=eh(o);a.call(c)}}Yh(e,o,t,i)}else o=TO(n,e,t,i,r);return eh(o)}mx=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=Ml(e.pendingLanes);n!==0&&(Um(e,n|1),_r(e,Kt()),!(ot&6)&&(Nc=Kt()+500,Mo()))}break;case 13:fa(function(){var r=Es(t,1);if(r!==null){var i=tr();li(r,t,1,i)}}),_w(t,1)}};Fm=function(t){if(t.tag===13){var e=Es(t,134217728);if(e!==null){var n=tr();li(e,t,134217728,n)}_w(t,134217728)}};wx=function(t){if(t.tag===13){var e=so(t),n=Es(t,e);if(n!==null){var r=tr();li(n,t,e,r)}_w(t,e)}};_x=function(){return wt};vx=function(t,e){var n=wt;try{return wt=t,e()}finally{wt=n}};Hg=function(t,e,n){switch(e){case"input":if(Pg(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var i=Wh(r);if(!i)throw Error(le(90));QE(r),Pg(r,i)}}}break;case"textarea":JE(t,n);break;case"select":e=n.value,e!=null&&cc(t,!!n.multiple,e,!1)}};ox=pw;ax=fa;var MO={usingClientEntryPoint:!1,Events:[Ju,Ka,Wh,ix,sx,pw]},vl={findFiberByHostInstance:$o,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},OO={bundleType:vl.bundleType,version:vl.version,rendererPackageName:vl.rendererPackageName,rendererConfig:vl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ts.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=ux(t),t===null?null:t.stateNode},findFiberByHostInstance:vl.findFiberByHostInstance||NO,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ud=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ud.isDisabled&&Ud.supportsFiber)try{zh=Ud.inject(OO),Ti=Ud}catch{}}Dr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=MO;Dr.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!bw(e))throw Error(le(200));return RO(t,e,null,n)};Dr.createRoot=function(t,e){if(!bw(t))throw Error(le(299));var n=!1,r="",i=WS;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=ww(t,1,!1,null,null,n,!1,r,i),t[bs]=e.current,du(t.nodeType===8?t.parentNode:t),new vw(e)};Dr.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(le(188)):(t=Object.keys(t).join(","),Error(le(268,t)));return t=ux(e),t=t===null?null:t.stateNode,t};Dr.flushSync=function(t){return fa(t)};Dr.hydrate=function(t,e,n){if(!Qh(e))throw Error(le(200));return Xh(null,t,e,!0,n)};Dr.hydrateRoot=function(t,e,n){if(!bw(t))throw Error(le(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=WS;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),e=FS(e,null,t,1,n??null,i,!1,s,o),t[bs]=e.current,du(t),r)for(t=0;t<r.length;t++)n=r[t],i=n._getVersion,i=i(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,i]:e.mutableSourceEagerHydrationData.push(n,i);return new qh(e)};Dr.render=function(t,e,n){if(!Qh(e))throw Error(le(200));return Xh(null,t,e,!1,n)};Dr.unmountComponentAtNode=function(t){if(!Qh(t))throw Error(le(40));return t._reactRootContainer?(fa(function(){Xh(null,null,t,!1,function(){t._reactRootContainer=null,t[bs]=null})}),!0):!1};Dr.unstable_batchedUpdates=pw;Dr.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!Qh(n))throw Error(le(200));if(t==null||t._reactInternals===void 0)throw Error(le(38));return Xh(t,e,n,!1,r)};Dr.version="18.3.1-next-f1338f8080-20240426";function HS(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(HS)}catch(t){console.error(t)}}HS(),HE.exports=Dr;var td=HE.exports,$S,o1=td;$S=o1.createRoot,o1.hydrateRoot;const VS={setVisible(t){console.error(ZS("call","setVisible"))},visible:!1};Object.defineProperty(VS,"visible",{get(){return console.error(ZS("read","visible")),!1}});function ZS(t,e){return`You have tried to ${t} "${e}" on a WalletModalContext without providing one. Make sure to render a WalletModalProvider as an ancestor of the component that uses WalletModalContext`}const KS=j.createContext(VS);function GS(){return j.useContext(KS)}var re={},Jh={};Jh.byteLength=DO;Jh.toByteArray=BO;Jh.fromByteArray=UO;var Si=[],jr=[],CO=typeof Uint8Array<"u"?Uint8Array:Array,C0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Ca=0,LO=C0.length;Ca<LO;++Ca)Si[Ca]=C0[Ca],jr[C0.charCodeAt(Ca)]=Ca;jr[45]=62;jr[95]=63;function YS(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");n===-1&&(n=e);var r=n===e?0:4-n%4;return[n,r]}function DO(t){var e=YS(t),n=e[0],r=e[1];return(n+r)*3/4-r}function PO(t,e,n){return(e+n)*3/4-n}function BO(t){var e,n=YS(t),r=n[0],i=n[1],s=new CO(PO(t,r,i)),o=0,a=i>0?r-4:r,c;for(c=0;c<a;c+=4)e=jr[t.charCodeAt(c)]<<18|jr[t.charCodeAt(c+1)]<<12|jr[t.charCodeAt(c+2)]<<6|jr[t.charCodeAt(c+3)],s[o++]=e>>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=jr[t.charCodeAt(c)]<<2|jr[t.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=jr[t.charCodeAt(c)]<<10|jr[t.charCodeAt(c+1)]<<4|jr[t.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function zO(t){return Si[t>>18&63]+Si[t>>12&63]+Si[t>>6&63]+Si[t&63]}function jO(t,e,n){for(var r,i=[],s=e;s<n;s+=3)r=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),i.push(zO(r));return i.join("")}function UO(t){for(var e,n=t.length,r=n%3,i=[],s=16383,o=0,a=n-r;o<a;o+=s)i.push(jO(t,o,o+s>a?a:o+s));return r===1?(e=t[n-1],i.push(Si[e>>2]+Si[e<<4&63]+"==")):r===2&&(e=(t[n-2]<<8)+t[n-1],i.push(Si[e>>10]+Si[e>>4&63]+Si[e<<2&63]+"=")),i.join("")}var Ew={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Ew.read=function(t,e,n,r,i){var s,o,a=i*8-r-1,c=(1<<a)-1,l=c>>1,u=-7,f=n?i-1:0,g=n?-1:1,p=t[e+f];for(f+=g,s=p&(1<<-u)-1,p>>=-u,u+=a;u>0;s=s*256+t[e+f],f+=g,u-=8);for(o=s&(1<<-u)-1,s>>=-u,u+=r;u>0;o=o*256+t[e+f],f+=g,u-=8);if(s===0)s=1-l;else{if(s===c)return o?NaN:(p?-1:1)*(1/0);o=o+Math.pow(2,r),s=s-l}return(p?-1:1)*o*Math.pow(2,s-r)};Ew.write=function(t,e,n,r,i,s){var o,a,c,l=s*8-i-1,u=(1<<l)-1,f=u>>1,g=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:s-1,_=r?1:-1,A=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+f>=1?e+=g/c:e+=g*Math.pow(2,1-f),e*c>=2&&(o++,c/=2),o+f>=u?(a=0,o=u):o+f>=1?(a=(e*c-1)*Math.pow(2,i),o=o+f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[n+p]=a&255,p+=_,a/=256,i-=8);for(o=o<<i|a,l+=i;l>0;t[n+p]=o&255,p+=_,o/=256,l-=8);t[n+p-_]|=A*128};/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh <https://feross.org> + * @license MIT + */(function(t){const e=Jh,n=Ew,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=a,t.SlowBuffer=b,t.INSPECT_MAX_BYTES=50;const i=2147483647;t.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=s(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function s(){try{const R=new Uint8Array(1),y={foo:function(){return 42}};return Object.setPrototypeOf(y,Uint8Array.prototype),Object.setPrototypeOf(R,y),R.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function o(R){if(R>i)throw new RangeError('The value "'+R+'" is invalid for option "size"');const y=new Uint8Array(R);return Object.setPrototypeOf(y,a.prototype),y}function a(R,y,w){if(typeof R=="number"){if(typeof y=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return f(R)}return c(R,y,w)}a.poolSize=8192;function c(R,y,w){if(typeof R=="string")return g(R,y);if(ArrayBuffer.isView(R))return _(R);if(R==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof R);if(ce(R,ArrayBuffer)||R&&ce(R.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ce(R,SharedArrayBuffer)||R&&ce(R.buffer,SharedArrayBuffer)))return A(R,y,w);if(typeof R=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const C=R.valueOf&&R.valueOf();if(C!=null&&C!==R)return a.from(C,y,w);const H=S(R);if(H)return H;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof R[Symbol.toPrimitive]=="function")return a.from(R[Symbol.toPrimitive]("string"),y,w);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof R)}a.from=function(R,y,w){return c(R,y,w)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function l(R){if(typeof R!="number")throw new TypeError('"size" argument must be of type number');if(R<0)throw new RangeError('The value "'+R+'" is invalid for option "size"')}function u(R,y,w){return l(R),R<=0?o(R):y!==void 0?typeof w=="string"?o(R).fill(y,w):o(R).fill(y):o(R)}a.alloc=function(R,y,w){return u(R,y,w)};function f(R){return l(R),o(R<0?0:E(R)|0)}a.allocUnsafe=function(R){return f(R)},a.allocUnsafeSlow=function(R){return f(R)};function g(R,y){if((typeof y!="string"||y==="")&&(y="utf8"),!a.isEncoding(y))throw new TypeError("Unknown encoding: "+y);const w=x(R,y)|0;let C=o(w);const H=C.write(R,y);return H!==w&&(C=C.slice(0,H)),C}function p(R){const y=R.length<0?0:E(R.length)|0,w=o(y);for(let C=0;C<y;C+=1)w[C]=R[C]&255;return w}function _(R){if(ce(R,Uint8Array)){const y=new Uint8Array(R);return A(y.buffer,y.byteOffset,y.byteLength)}return p(R)}function A(R,y,w){if(y<0||R.byteLength<y)throw new RangeError('"offset" is outside of buffer bounds');if(R.byteLength<y+(w||0))throw new RangeError('"length" is outside of buffer bounds');let C;return y===void 0&&w===void 0?C=new Uint8Array(R):w===void 0?C=new Uint8Array(R,y):C=new Uint8Array(R,y,w),Object.setPrototypeOf(C,a.prototype),C}function S(R){if(a.isBuffer(R)){const y=E(R.length)|0,w=o(y);return w.length===0||R.copy(w,0,0,y),w}if(R.length!==void 0)return typeof R.length!="number"||ne(R.length)?o(0):p(R);if(R.type==="Buffer"&&Array.isArray(R.data))return p(R.data)}function E(R){if(R>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return R|0}function b(R){return+R!=R&&(R=0),a.alloc(+R)}a.isBuffer=function(y){return y!=null&&y._isBuffer===!0&&y!==a.prototype},a.compare=function(y,w){if(ce(y,Uint8Array)&&(y=a.from(y,y.offset,y.byteLength)),ce(w,Uint8Array)&&(w=a.from(w,w.offset,w.byteLength)),!a.isBuffer(y)||!a.isBuffer(w))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(y===w)return 0;let C=y.length,H=w.length;for(let Z=0,J=Math.min(C,H);Z<J;++Z)if(y[Z]!==w[Z]){C=y[Z],H=w[Z];break}return C<H?-1:H<C?1:0},a.isEncoding=function(y){switch(String(y).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(y,w){if(!Array.isArray(y))throw new TypeError('"list" argument must be an Array of Buffers');if(y.length===0)return a.alloc(0);let C;if(w===void 0)for(w=0,C=0;C<y.length;++C)w+=y[C].length;const H=a.allocUnsafe(w);let Z=0;for(C=0;C<y.length;++C){let J=y[C];if(ce(J,Uint8Array))Z+J.length>H.length?(a.isBuffer(J)||(J=a.from(J)),J.copy(H,Z)):Uint8Array.prototype.set.call(H,J,Z);else if(a.isBuffer(J))J.copy(H,Z);else throw new TypeError('"list" argument must be an Array of Buffers');Z+=J.length}return H};function x(R,y){if(a.isBuffer(R))return R.length;if(ArrayBuffer.isView(R)||ce(R,ArrayBuffer))return R.byteLength;if(typeof R!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof R);const w=R.length,C=arguments.length>2&&arguments[2]===!0;if(!C&&w===0)return 0;let H=!1;for(;;)switch(y){case"ascii":case"latin1":case"binary":return w;case"utf8":case"utf-8":return yt(R).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w*2;case"hex":return w>>>1;case"base64":return Q(R).length;default:if(H)return C?-1:yt(R).length;y=(""+y).toLowerCase(),H=!0}}a.byteLength=x;function M(R,y,w){let C=!1;if((y===void 0||y<0)&&(y=0),y>this.length||((w===void 0||w>this.length)&&(w=this.length),w<=0)||(w>>>=0,y>>>=0,w<=y))return"";for(R||(R="utf8");;)switch(R){case"hex":return O(this,y,w);case"utf8":case"utf-8":return d(this,y,w);case"ascii":return I(this,y,w);case"latin1":case"binary":return k(this,y,w);case"base64":return N(this,y,w);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,y,w);default:if(C)throw new TypeError("Unknown encoding: "+R);R=(R+"").toLowerCase(),C=!0}}a.prototype._isBuffer=!0;function L(R,y,w){const C=R[y];R[y]=R[w],R[w]=C}a.prototype.swap16=function(){const y=this.length;if(y%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let w=0;w<y;w+=2)L(this,w,w+1);return this},a.prototype.swap32=function(){const y=this.length;if(y%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let w=0;w<y;w+=4)L(this,w,w+3),L(this,w+1,w+2);return this},a.prototype.swap64=function(){const y=this.length;if(y%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let w=0;w<y;w+=8)L(this,w,w+7),L(this,w+1,w+6),L(this,w+2,w+5),L(this,w+3,w+4);return this},a.prototype.toString=function(){const y=this.length;return y===0?"":arguments.length===0?d(this,0,y):M.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(y){if(!a.isBuffer(y))throw new TypeError("Argument must be a Buffer");return this===y?!0:a.compare(this,y)===0},a.prototype.inspect=function(){let y="";const w=t.INSPECT_MAX_BYTES;return y=this.toString("hex",0,w).replace(/(.{2})/g,"$1 ").trim(),this.length>w&&(y+=" ... "),"<Buffer "+y+">"},r&&(a.prototype[r]=a.prototype.inspect),a.prototype.compare=function(y,w,C,H,Z){if(ce(y,Uint8Array)&&(y=a.from(y,y.offset,y.byteLength)),!a.isBuffer(y))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof y);if(w===void 0&&(w=0),C===void 0&&(C=y?y.length:0),H===void 0&&(H=0),Z===void 0&&(Z=this.length),w<0||C>y.length||H<0||Z>this.length)throw new RangeError("out of range index");if(H>=Z&&w>=C)return 0;if(H>=Z)return-1;if(w>=C)return 1;if(w>>>=0,C>>>=0,H>>>=0,Z>>>=0,this===y)return 0;let J=Z-H,He=C-w;const ze=Math.min(J,He),Ue=this.slice(H,Z),kt=y.slice(w,C);for(let Pe=0;Pe<ze;++Pe)if(Ue[Pe]!==kt[Pe]){J=Ue[Pe],He=kt[Pe];break}return J<He?-1:He<J?1:0};function z(R,y,w,C,H){if(R.length===0)return-1;if(typeof w=="string"?(C=w,w=0):w>2147483647?w=2147483647:w<-2147483648&&(w=-2147483648),w=+w,ne(w)&&(w=H?0:R.length-1),w<0&&(w=R.length+w),w>=R.length){if(H)return-1;w=R.length-1}else if(w<0)if(H)w=0;else return-1;if(typeof y=="string"&&(y=a.from(y,C)),a.isBuffer(y))return y.length===0?-1:D(R,y,w,C,H);if(typeof y=="number")return y=y&255,typeof Uint8Array.prototype.indexOf=="function"?H?Uint8Array.prototype.indexOf.call(R,y,w):Uint8Array.prototype.lastIndexOf.call(R,y,w):D(R,[y],w,C,H);throw new TypeError("val must be string, number or Buffer")}function D(R,y,w,C,H){let Z=1,J=R.length,He=y.length;if(C!==void 0&&(C=String(C).toLowerCase(),C==="ucs2"||C==="ucs-2"||C==="utf16le"||C==="utf-16le")){if(R.length<2||y.length<2)return-1;Z=2,J/=2,He/=2,w/=2}function ze(kt,Pe){return Z===1?kt[Pe]:kt.readUInt16BE(Pe*Z)}let Ue;if(H){let kt=-1;for(Ue=w;Ue<J;Ue++)if(ze(R,Ue)===ze(y,kt===-1?0:Ue-kt)){if(kt===-1&&(kt=Ue),Ue-kt+1===He)return kt*Z}else kt!==-1&&(Ue-=Ue-kt),kt=-1}else for(w+He>J&&(w=J-He),Ue=w;Ue>=0;Ue--){let kt=!0;for(let Pe=0;Pe<He;Pe++)if(ze(R,Ue+Pe)!==ze(y,Pe)){kt=!1;break}if(kt)return Ue}return-1}a.prototype.includes=function(y,w,C){return this.indexOf(y,w,C)!==-1},a.prototype.indexOf=function(y,w,C){return z(this,y,w,C,!0)},a.prototype.lastIndexOf=function(y,w,C){return z(this,y,w,C,!1)};function F(R,y,w,C){w=Number(w)||0;const H=R.length-w;C?(C=Number(C),C>H&&(C=H)):C=H;const Z=y.length;C>Z/2&&(C=Z/2);let J;for(J=0;J<C;++J){const He=parseInt(y.substr(J*2,2),16);if(ne(He))return J;R[w+J]=He}return J}function $(R,y,w,C){return oe(yt(y,R.length-w),R,w,C)}function V(R,y,w,C){return oe(U(y),R,w,C)}function G(R,y,w,C){return oe(Q(y),R,w,C)}function W(R,y,w,C){return oe(Y(y,R.length-w),R,w,C)}a.prototype.write=function(y,w,C,H){if(w===void 0)H="utf8",C=this.length,w=0;else if(C===void 0&&typeof w=="string")H=w,C=this.length,w=0;else if(isFinite(w))w=w>>>0,isFinite(C)?(C=C>>>0,H===void 0&&(H="utf8")):(H=C,C=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Z=this.length-w;if((C===void 0||C>Z)&&(C=Z),y.length>0&&(C<0||w<0)||w>this.length)throw new RangeError("Attempt to write outside buffer bounds");H||(H="utf8");let J=!1;for(;;)switch(H){case"hex":return F(this,y,w,C);case"utf8":case"utf-8":return $(this,y,w,C);case"ascii":case"latin1":case"binary":return V(this,y,w,C);case"base64":return G(this,y,w,C);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return W(this,y,w,C);default:if(J)throw new TypeError("Unknown encoding: "+H);H=(""+H).toLowerCase(),J=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function N(R,y,w){return y===0&&w===R.length?e.fromByteArray(R):e.fromByteArray(R.slice(y,w))}function d(R,y,w){w=Math.min(R.length,w);const C=[];let H=y;for(;H<w;){const Z=R[H];let J=null,He=Z>239?4:Z>223?3:Z>191?2:1;if(H+He<=w){let ze,Ue,kt,Pe;switch(He){case 1:Z<128&&(J=Z);break;case 2:ze=R[H+1],(ze&192)===128&&(Pe=(Z&31)<<6|ze&63,Pe>127&&(J=Pe));break;case 3:ze=R[H+1],Ue=R[H+2],(ze&192)===128&&(Ue&192)===128&&(Pe=(Z&15)<<12|(ze&63)<<6|Ue&63,Pe>2047&&(Pe<55296||Pe>57343)&&(J=Pe));break;case 4:ze=R[H+1],Ue=R[H+2],kt=R[H+3],(ze&192)===128&&(Ue&192)===128&&(kt&192)===128&&(Pe=(Z&15)<<18|(ze&63)<<12|(Ue&63)<<6|kt&63,Pe>65535&&Pe<1114112&&(J=Pe))}}J===null?(J=65533,He=1):J>65535&&(J-=65536,C.push(J>>>10&1023|55296),J=56320|J&1023),C.push(J),H+=He}return v(C)}const h=4096;function v(R){const y=R.length;if(y<=h)return String.fromCharCode.apply(String,R);let w="",C=0;for(;C<y;)w+=String.fromCharCode.apply(String,R.slice(C,C+=h));return w}function I(R,y,w){let C="";w=Math.min(R.length,w);for(let H=y;H<w;++H)C+=String.fromCharCode(R[H]&127);return C}function k(R,y,w){let C="";w=Math.min(R.length,w);for(let H=y;H<w;++H)C+=String.fromCharCode(R[H]);return C}function O(R,y,w){const C=R.length;(!y||y<0)&&(y=0),(!w||w<0||w>C)&&(w=C);let H="";for(let Z=y;Z<w;++Z)H+=pe[R[Z]];return H}function B(R,y,w){const C=R.slice(y,w);let H="";for(let Z=0;Z<C.length-1;Z+=2)H+=String.fromCharCode(C[Z]+C[Z+1]*256);return H}a.prototype.slice=function(y,w){const C=this.length;y=~~y,w=w===void 0?C:~~w,y<0?(y+=C,y<0&&(y=0)):y>C&&(y=C),w<0?(w+=C,w<0&&(w=0)):w>C&&(w=C),w<y&&(w=y);const H=this.subarray(y,w);return Object.setPrototypeOf(H,a.prototype),H};function T(R,y,w){if(R%1!==0||R<0)throw new RangeError("offset is not uint");if(R+y>w)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(y,w,C){y=y>>>0,w=w>>>0,C||T(y,w,this.length);let H=this[y],Z=1,J=0;for(;++J<w&&(Z*=256);)H+=this[y+J]*Z;return H},a.prototype.readUintBE=a.prototype.readUIntBE=function(y,w,C){y=y>>>0,w=w>>>0,C||T(y,w,this.length);let H=this[y+--w],Z=1;for(;w>0&&(Z*=256);)H+=this[y+--w]*Z;return H},a.prototype.readUint8=a.prototype.readUInt8=function(y,w){return y=y>>>0,w||T(y,1,this.length),this[y]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(y,w){return y=y>>>0,w||T(y,2,this.length),this[y]|this[y+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(y,w){return y=y>>>0,w||T(y,2,this.length),this[y]<<8|this[y+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(y,w){return y=y>>>0,w||T(y,4,this.length),(this[y]|this[y+1]<<8|this[y+2]<<16)+this[y+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(y,w){return y=y>>>0,w||T(y,4,this.length),this[y]*16777216+(this[y+1]<<16|this[y+2]<<8|this[y+3])},a.prototype.readBigUInt64LE=je(function(y){y=y>>>0,ht(y,"offset");const w=this[y],C=this[y+7];(w===void 0||C===void 0)&&Qe(y,this.length-8);const H=w+this[++y]*2**8+this[++y]*2**16+this[++y]*2**24,Z=this[++y]+this[++y]*2**8+this[++y]*2**16+C*2**24;return BigInt(H)+(BigInt(Z)<<BigInt(32))}),a.prototype.readBigUInt64BE=je(function(y){y=y>>>0,ht(y,"offset");const w=this[y],C=this[y+7];(w===void 0||C===void 0)&&Qe(y,this.length-8);const H=w*2**24+this[++y]*2**16+this[++y]*2**8+this[++y],Z=this[++y]*2**24+this[++y]*2**16+this[++y]*2**8+C;return(BigInt(H)<<BigInt(32))+BigInt(Z)}),a.prototype.readIntLE=function(y,w,C){y=y>>>0,w=w>>>0,C||T(y,w,this.length);let H=this[y],Z=1,J=0;for(;++J<w&&(Z*=256);)H+=this[y+J]*Z;return Z*=128,H>=Z&&(H-=Math.pow(2,8*w)),H},a.prototype.readIntBE=function(y,w,C){y=y>>>0,w=w>>>0,C||T(y,w,this.length);let H=w,Z=1,J=this[y+--H];for(;H>0&&(Z*=256);)J+=this[y+--H]*Z;return Z*=128,J>=Z&&(J-=Math.pow(2,8*w)),J},a.prototype.readInt8=function(y,w){return y=y>>>0,w||T(y,1,this.length),this[y]&128?(255-this[y]+1)*-1:this[y]},a.prototype.readInt16LE=function(y,w){y=y>>>0,w||T(y,2,this.length);const C=this[y]|this[y+1]<<8;return C&32768?C|4294901760:C},a.prototype.readInt16BE=function(y,w){y=y>>>0,w||T(y,2,this.length);const C=this[y+1]|this[y]<<8;return C&32768?C|4294901760:C},a.prototype.readInt32LE=function(y,w){return y=y>>>0,w||T(y,4,this.length),this[y]|this[y+1]<<8|this[y+2]<<16|this[y+3]<<24},a.prototype.readInt32BE=function(y,w){return y=y>>>0,w||T(y,4,this.length),this[y]<<24|this[y+1]<<16|this[y+2]<<8|this[y+3]},a.prototype.readBigInt64LE=je(function(y){y=y>>>0,ht(y,"offset");const w=this[y],C=this[y+7];(w===void 0||C===void 0)&&Qe(y,this.length-8);const H=this[y+4]+this[y+5]*2**8+this[y+6]*2**16+(C<<24);return(BigInt(H)<<BigInt(32))+BigInt(w+this[++y]*2**8+this[++y]*2**16+this[++y]*2**24)}),a.prototype.readBigInt64BE=je(function(y){y=y>>>0,ht(y,"offset");const w=this[y],C=this[y+7];(w===void 0||C===void 0)&&Qe(y,this.length-8);const H=(w<<24)+this[++y]*2**16+this[++y]*2**8+this[++y];return(BigInt(H)<<BigInt(32))+BigInt(this[++y]*2**24+this[++y]*2**16+this[++y]*2**8+C)}),a.prototype.readFloatLE=function(y,w){return y=y>>>0,w||T(y,4,this.length),n.read(this,y,!0,23,4)},a.prototype.readFloatBE=function(y,w){return y=y>>>0,w||T(y,4,this.length),n.read(this,y,!1,23,4)},a.prototype.readDoubleLE=function(y,w){return y=y>>>0,w||T(y,8,this.length),n.read(this,y,!0,52,8)},a.prototype.readDoubleBE=function(y,w){return y=y>>>0,w||T(y,8,this.length),n.read(this,y,!1,52,8)};function m(R,y,w,C,H,Z){if(!a.isBuffer(R))throw new TypeError('"buffer" argument must be a Buffer instance');if(y>H||y<Z)throw new RangeError('"value" argument is out of bounds');if(w+C>R.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(y,w,C,H){if(y=+y,w=w>>>0,C=C>>>0,!H){const He=Math.pow(2,8*C)-1;m(this,y,w,C,He,0)}let Z=1,J=0;for(this[w]=y&255;++J<C&&(Z*=256);)this[w+J]=y/Z&255;return w+C},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(y,w,C,H){if(y=+y,w=w>>>0,C=C>>>0,!H){const He=Math.pow(2,8*C)-1;m(this,y,w,C,He,0)}let Z=C-1,J=1;for(this[w+Z]=y&255;--Z>=0&&(J*=256);)this[w+Z]=y/J&255;return w+C},a.prototype.writeUint8=a.prototype.writeUInt8=function(y,w,C){return y=+y,w=w>>>0,C||m(this,y,w,1,255,0),this[w]=y&255,w+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(y,w,C){return y=+y,w=w>>>0,C||m(this,y,w,2,65535,0),this[w]=y&255,this[w+1]=y>>>8,w+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(y,w,C){return y=+y,w=w>>>0,C||m(this,y,w,2,65535,0),this[w]=y>>>8,this[w+1]=y&255,w+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(y,w,C){return y=+y,w=w>>>0,C||m(this,y,w,4,4294967295,0),this[w+3]=y>>>24,this[w+2]=y>>>16,this[w+1]=y>>>8,this[w]=y&255,w+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(y,w,C){return y=+y,w=w>>>0,C||m(this,y,w,4,4294967295,0),this[w]=y>>>24,this[w+1]=y>>>16,this[w+2]=y>>>8,this[w+3]=y&255,w+4};function P(R,y,w,C,H){De(y,C,H,R,w,7);let Z=Number(y&BigInt(4294967295));R[w++]=Z,Z=Z>>8,R[w++]=Z,Z=Z>>8,R[w++]=Z,Z=Z>>8,R[w++]=Z;let J=Number(y>>BigInt(32)&BigInt(4294967295));return R[w++]=J,J=J>>8,R[w++]=J,J=J>>8,R[w++]=J,J=J>>8,R[w++]=J,w}function ae(R,y,w,C,H){De(y,C,H,R,w,7);let Z=Number(y&BigInt(4294967295));R[w+7]=Z,Z=Z>>8,R[w+6]=Z,Z=Z>>8,R[w+5]=Z,Z=Z>>8,R[w+4]=Z;let J=Number(y>>BigInt(32)&BigInt(4294967295));return R[w+3]=J,J=J>>8,R[w+2]=J,J=J>>8,R[w+1]=J,J=J>>8,R[w]=J,w+8}a.prototype.writeBigUInt64LE=je(function(y,w=0){return P(this,y,w,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=je(function(y,w=0){return ae(this,y,w,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(y,w,C,H){if(y=+y,w=w>>>0,!H){const ze=Math.pow(2,8*C-1);m(this,y,w,C,ze-1,-ze)}let Z=0,J=1,He=0;for(this[w]=y&255;++Z<C&&(J*=256);)y<0&&He===0&&this[w+Z-1]!==0&&(He=1),this[w+Z]=(y/J>>0)-He&255;return w+C},a.prototype.writeIntBE=function(y,w,C,H){if(y=+y,w=w>>>0,!H){const ze=Math.pow(2,8*C-1);m(this,y,w,C,ze-1,-ze)}let Z=C-1,J=1,He=0;for(this[w+Z]=y&255;--Z>=0&&(J*=256);)y<0&&He===0&&this[w+Z+1]!==0&&(He=1),this[w+Z]=(y/J>>0)-He&255;return w+C},a.prototype.writeInt8=function(y,w,C){return y=+y,w=w>>>0,C||m(this,y,w,1,127,-128),y<0&&(y=255+y+1),this[w]=y&255,w+1},a.prototype.writeInt16LE=function(y,w,C){return y=+y,w=w>>>0,C||m(this,y,w,2,32767,-32768),this[w]=y&255,this[w+1]=y>>>8,w+2},a.prototype.writeInt16BE=function(y,w,C){return y=+y,w=w>>>0,C||m(this,y,w,2,32767,-32768),this[w]=y>>>8,this[w+1]=y&255,w+2},a.prototype.writeInt32LE=function(y,w,C){return y=+y,w=w>>>0,C||m(this,y,w,4,2147483647,-2147483648),this[w]=y&255,this[w+1]=y>>>8,this[w+2]=y>>>16,this[w+3]=y>>>24,w+4},a.prototype.writeInt32BE=function(y,w,C){return y=+y,w=w>>>0,C||m(this,y,w,4,2147483647,-2147483648),y<0&&(y=4294967295+y+1),this[w]=y>>>24,this[w+1]=y>>>16,this[w+2]=y>>>8,this[w+3]=y&255,w+4},a.prototype.writeBigInt64LE=je(function(y,w=0){return P(this,y,w,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=je(function(y,w=0){return ae(this,y,w,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function fe(R,y,w,C,H,Z){if(w+C>R.length)throw new RangeError("Index out of range");if(w<0)throw new RangeError("Index out of range")}function de(R,y,w,C,H){return y=+y,w=w>>>0,H||fe(R,y,w,4),n.write(R,y,w,C,23,4),w+4}a.prototype.writeFloatLE=function(y,w,C){return de(this,y,w,!0,C)},a.prototype.writeFloatBE=function(y,w,C){return de(this,y,w,!1,C)};function Ce(R,y,w,C,H){return y=+y,w=w>>>0,H||fe(R,y,w,8),n.write(R,y,w,C,52,8),w+8}a.prototype.writeDoubleLE=function(y,w,C){return Ce(this,y,w,!0,C)},a.prototype.writeDoubleBE=function(y,w,C){return Ce(this,y,w,!1,C)},a.prototype.copy=function(y,w,C,H){if(!a.isBuffer(y))throw new TypeError("argument should be a Buffer");if(C||(C=0),!H&&H!==0&&(H=this.length),w>=y.length&&(w=y.length),w||(w=0),H>0&&H<C&&(H=C),H===C||y.length===0||this.length===0)return 0;if(w<0)throw new RangeError("targetStart out of bounds");if(C<0||C>=this.length)throw new RangeError("Index out of range");if(H<0)throw new RangeError("sourceEnd out of bounds");H>this.length&&(H=this.length),y.length-w<H-C&&(H=y.length-w+C);const Z=H-C;return this===y&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(w,C,H):Uint8Array.prototype.set.call(y,this.subarray(C,H),w),Z},a.prototype.fill=function(y,w,C,H){if(typeof y=="string"){if(typeof w=="string"?(H=w,w=0,C=this.length):typeof C=="string"&&(H=C,C=this.length),H!==void 0&&typeof H!="string")throw new TypeError("encoding must be a string");if(typeof H=="string"&&!a.isEncoding(H))throw new TypeError("Unknown encoding: "+H);if(y.length===1){const J=y.charCodeAt(0);(H==="utf8"&&J<128||H==="latin1")&&(y=J)}}else typeof y=="number"?y=y&255:typeof y=="boolean"&&(y=Number(y));if(w<0||this.length<w||this.length<C)throw new RangeError("Out of range index");if(C<=w)return this;w=w>>>0,C=C===void 0?this.length:C>>>0,y||(y=0);let Z;if(typeof y=="number")for(Z=w;Z<C;++Z)this[Z]=y;else{const J=a.isBuffer(y)?y:a.from(y,H),He=J.length;if(He===0)throw new TypeError('The value "'+y+'" is invalid for argument "value"');for(Z=0;Z<C-w;++Z)this[Z+w]=J[Z%He]}return this};const Re={};function Me(R,y,w){Re[R]=class extends w{constructor(){super(),Object.defineProperty(this,"message",{value:y.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${R}]`,this.stack,delete this.name}get code(){return R}set code(H){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:H,writable:!0})}toString(){return`${this.name} [${R}]: ${this.message}`}}}Me("ERR_BUFFER_OUT_OF_BOUNDS",function(R){return R?`${R} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Me("ERR_INVALID_ARG_TYPE",function(R,y){return`The "${R}" argument must be of type number. Received type ${typeof y}`},TypeError),Me("ERR_OUT_OF_RANGE",function(R,y,w){let C=`The value of "${R}" is out of range.`,H=w;return Number.isInteger(w)&&Math.abs(w)>2**32?H=xt(String(w)):typeof w=="bigint"&&(H=String(w),(w>BigInt(2)**BigInt(32)||w<-(BigInt(2)**BigInt(32)))&&(H=xt(H)),H+="n"),C+=` It must be ${y}. Received ${H}`,C},RangeError);function xt(R){let y="",w=R.length;const C=R[0]==="-"?1:0;for(;w>=C+4;w-=3)y=`_${R.slice(w-3,w)}${y}`;return`${R.slice(0,w)}${y}`}function Fe(R,y,w){ht(y,"offset"),(R[y]===void 0||R[y+w]===void 0)&&Qe(y,R.length-(w+1))}function De(R,y,w,C,H,Z){if(R>w||R<y){const J=typeof y=="bigint"?"n":"";let He;throw y===0||y===BigInt(0)?He=`>= 0${J} and < 2${J} ** ${(Z+1)*8}${J}`:He=`>= -(2${J} ** ${(Z+1)*8-1}${J}) and < 2 ** ${(Z+1)*8-1}${J}`,new Re.ERR_OUT_OF_RANGE("value",He,R)}Fe(C,H,Z)}function ht(R,y){if(typeof R!="number")throw new Re.ERR_INVALID_ARG_TYPE(y,"number",R)}function Qe(R,y,w){throw Math.floor(R)!==R?(ht(R,w),new Re.ERR_OUT_OF_RANGE("offset","an integer",R)):y<0?new Re.ERR_BUFFER_OUT_OF_BOUNDS:new Re.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${y}`,R)}const dt=/[^+/0-9A-Za-z-_]/g;function Zi(R){if(R=R.split("=")[0],R=R.trim().replace(dt,""),R.length<2)return"";for(;R.length%4!==0;)R=R+"=";return R}function yt(R,y){y=y||1/0;let w;const C=R.length;let H=null;const Z=[];for(let J=0;J<C;++J){if(w=R.charCodeAt(J),w>55295&&w<57344){if(!H){if(w>56319){(y-=3)>-1&&Z.push(239,191,189);continue}else if(J+1===C){(y-=3)>-1&&Z.push(239,191,189);continue}H=w;continue}if(w<56320){(y-=3)>-1&&Z.push(239,191,189),H=w;continue}w=(H-55296<<10|w-56320)+65536}else H&&(y-=3)>-1&&Z.push(239,191,189);if(H=null,w<128){if((y-=1)<0)break;Z.push(w)}else if(w<2048){if((y-=2)<0)break;Z.push(w>>6|192,w&63|128)}else if(w<65536){if((y-=3)<0)break;Z.push(w>>12|224,w>>6&63|128,w&63|128)}else if(w<1114112){if((y-=4)<0)break;Z.push(w>>18|240,w>>12&63|128,w>>6&63|128,w&63|128)}else throw new Error("Invalid code point")}return Z}function U(R){const y=[];for(let w=0;w<R.length;++w)y.push(R.charCodeAt(w)&255);return y}function Y(R,y){let w,C,H;const Z=[];for(let J=0;J<R.length&&!((y-=2)<0);++J)w=R.charCodeAt(J),C=w>>8,H=w%256,Z.push(H),Z.push(C);return Z}function Q(R){return e.toByteArray(Zi(R))}function oe(R,y,w,C){let H;for(H=0;H<C&&!(H+w>=y.length||H>=R.length);++H)y[H+w]=R[H];return H}function ce(R,y){return R instanceof y||R!=null&&R.constructor!=null&&R.constructor.name!=null&&R.constructor.name===y.name}function ne(R){return R!==R}const pe=function(){const R="0123456789abcdef",y=new Array(256);for(let w=0;w<16;++w){const C=w*16;for(let H=0;H<16;++H)y[C+H]=R[w]+R[H]}return y}();function je(R){return typeof BigInt>"u"?We:R}function We(){throw new Error("BigInt not supported")}})(re);function th(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`positive integer expected, not ${t}`)}function FO(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function nd(t,...e){if(!FO(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${t.length}`)}function WO(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");th(t.outputLen),th(t.blockLen)}function Tc(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function qS(t,e){nd(t);const n=e.outputLen;if(t.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const La=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const HO=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),L0=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),_i=(t,e)=>t<<32-e|t>>>e,a1=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,$O=t=>t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255;function c1(t){for(let e=0;e<t.length;e++)t[e]=$O(t[e])}function VO(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function ep(t){return typeof t=="string"&&(t=VO(t)),nd(t),t}function ZO(...t){let e=0;for(let r=0;r<t.length;r++){const i=t[r];nd(i),e+=i.length}const n=new Uint8Array(e);for(let r=0,i=0;r<t.length;r++){const s=t[r];n.set(s,i),i+=s.length}return n}class xw{clone(){return this._cloneInto()}}function Sw(t){const e=r=>t().update(ep(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function QS(t=32){if(La&&typeof La.getRandomValues=="function")return La.getRandomValues(new Uint8Array(t));if(La&&typeof La.randomBytes=="function")return La.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}function KO(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const i=BigInt(32),s=BigInt(4294967295),o=Number(n>>i&s),a=Number(n&s),c=r?4:0,l=r?0:4;t.setUint32(e+c,o,r),t.setUint32(e+l,a,r)}const GO=(t,e,n)=>t&e^~t&n,YO=(t,e,n)=>t&e^t&n^e&n;class XS extends xw{constructor(e,n,r,i){super(),this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=L0(this.buffer)}update(e){Tc(this);const{view:n,buffer:r,blockLen:i}=this;e=ep(e);const s=e.length;for(let o=0;o<s;){const a=Math.min(i-this.pos,s-o);if(a===i){const c=L0(e);for(;i<=s-o;o+=i)this.process(c,o);continue}r.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===i&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Tc(this),qS(e,this),this.finished=!0;const{buffer:n,view:r,blockLen:i,isLE:s}=this;let{pos:o}=this;n[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>i-o&&(this.process(r,0),o=0);for(let f=o;f<i;f++)n[f]=0;KO(r,i-8,BigInt(this.length*8),s),this.process(r,0);const a=L0(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=c/4,u=this.get();if(l>u.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<l;f++)a.setUint32(4*f,u[f],s)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const r=e.slice(0,n);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:n,buffer:r,length:i,finished:s,destroyed:o,pos:a}=this;return e.length=i,e.pos=a,e.finished=s,e.destroyed=o,i%n&&e.buffer.set(r),e}}const Fd=BigInt(2**32-1),Ey=BigInt(32);function JS(t,e=!1){return e?{h:Number(t&Fd),l:Number(t>>Ey&Fd)}:{h:Number(t>>Ey&Fd)|0,l:Number(t&Fd)|0}}function eA(t,e=!1){let n=new Uint32Array(t.length),r=new Uint32Array(t.length);for(let i=0;i<t.length;i++){const{h:s,l:o}=JS(t[i],e);[n[i],r[i]]=[s,o]}return[n,r]}const qO=(t,e)=>BigInt(t>>>0)<<Ey|BigInt(e>>>0),QO=(t,e,n)=>t>>>n,XO=(t,e,n)=>t<<32-n|e>>>n,JO=(t,e,n)=>t>>>n|e<<32-n,eC=(t,e,n)=>t<<32-n|e>>>n,tC=(t,e,n)=>t<<64-n|e>>>n-32,nC=(t,e,n)=>t>>>n-32|e<<64-n,rC=(t,e)=>e,iC=(t,e)=>t,tA=(t,e,n)=>t<<n|e>>>32-n,nA=(t,e,n)=>e<<n|t>>>32-n,rA=(t,e,n)=>e<<n-32|t>>>64-n,iA=(t,e,n)=>t<<n-32|e>>>64-n;function sC(t,e,n,r){const i=(e>>>0)+(r>>>0);return{h:t+n+(i/2**32|0)|0,l:i|0}}const oC=(t,e,n)=>(t>>>0)+(e>>>0)+(n>>>0),aC=(t,e,n,r)=>e+n+r+(t/2**32|0)|0,cC=(t,e,n,r)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0),lC=(t,e,n,r,i)=>e+n+r+i+(t/2**32|0)|0,uC=(t,e,n,r,i)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)+(i>>>0),dC=(t,e,n,r,i,s)=>e+n+r+i+s+(t/2**32|0)|0,Ke={fromBig:JS,split:eA,toBig:qO,shrSH:QO,shrSL:XO,rotrSH:JO,rotrSL:eC,rotrBH:tC,rotrBL:nC,rotr32H:rC,rotr32L:iC,rotlSH:tA,rotlSL:nA,rotlBH:rA,rotlBL:iA,add:sC,add3L:oC,add3H:aC,add4L:cC,add4H:lC,add5H:dC,add5L:uC},[fC,hC]=Ke.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Cs=new Uint32Array(80),Ls=new Uint32Array(80);class pC extends XS{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:n,Bh:r,Bl:i,Ch:s,Cl:o,Dh:a,Dl:c,Eh:l,El:u,Fh:f,Fl:g,Gh:p,Gl:_,Hh:A,Hl:S}=this;return[e,n,r,i,s,o,a,c,l,u,f,g,p,_,A,S]}set(e,n,r,i,s,o,a,c,l,u,f,g,p,_,A,S){this.Ah=e|0,this.Al=n|0,this.Bh=r|0,this.Bl=i|0,this.Ch=s|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=l|0,this.El=u|0,this.Fh=f|0,this.Fl=g|0,this.Gh=p|0,this.Gl=_|0,this.Hh=A|0,this.Hl=S|0}process(e,n){for(let x=0;x<16;x++,n+=4)Cs[x]=e.getUint32(n),Ls[x]=e.getUint32(n+=4);for(let x=16;x<80;x++){const M=Cs[x-15]|0,L=Ls[x-15]|0,z=Ke.rotrSH(M,L,1)^Ke.rotrSH(M,L,8)^Ke.shrSH(M,L,7),D=Ke.rotrSL(M,L,1)^Ke.rotrSL(M,L,8)^Ke.shrSL(M,L,7),F=Cs[x-2]|0,$=Ls[x-2]|0,V=Ke.rotrSH(F,$,19)^Ke.rotrBH(F,$,61)^Ke.shrSH(F,$,6),G=Ke.rotrSL(F,$,19)^Ke.rotrBL(F,$,61)^Ke.shrSL(F,$,6),W=Ke.add4L(D,G,Ls[x-7],Ls[x-16]),N=Ke.add4H(W,z,V,Cs[x-7],Cs[x-16]);Cs[x]=N|0,Ls[x]=W|0}let{Ah:r,Al:i,Bh:s,Bl:o,Ch:a,Cl:c,Dh:l,Dl:u,Eh:f,El:g,Fh:p,Fl:_,Gh:A,Gl:S,Hh:E,Hl:b}=this;for(let x=0;x<80;x++){const M=Ke.rotrSH(f,g,14)^Ke.rotrSH(f,g,18)^Ke.rotrBH(f,g,41),L=Ke.rotrSL(f,g,14)^Ke.rotrSL(f,g,18)^Ke.rotrBL(f,g,41),z=f&p^~f&A,D=g&_^~g&S,F=Ke.add5L(b,L,D,hC[x],Ls[x]),$=Ke.add5H(F,E,M,z,fC[x],Cs[x]),V=F|0,G=Ke.rotrSH(r,i,28)^Ke.rotrBH(r,i,34)^Ke.rotrBH(r,i,39),W=Ke.rotrSL(r,i,28)^Ke.rotrBL(r,i,34)^Ke.rotrBL(r,i,39),N=r&s^r&a^s&a,d=i&o^i&c^o&c;E=A|0,b=S|0,A=p|0,S=_|0,p=f|0,_=g|0,{h:f,l:g}=Ke.add(l|0,u|0,$|0,V|0),l=a|0,u=c|0,a=s|0,c=o|0,s=r|0,o=i|0;const h=Ke.add3L(V,W,d);r=Ke.add3H(h,$,G,N),i=h|0}({h:r,l:i}=Ke.add(this.Ah|0,this.Al|0,r|0,i|0)),{h:s,l:o}=Ke.add(this.Bh|0,this.Bl|0,s|0,o|0),{h:a,l:c}=Ke.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:l,l:u}=Ke.add(this.Dh|0,this.Dl|0,l|0,u|0),{h:f,l:g}=Ke.add(this.Eh|0,this.El|0,f|0,g|0),{h:p,l:_}=Ke.add(this.Fh|0,this.Fl|0,p|0,_|0),{h:A,l:S}=Ke.add(this.Gh|0,this.Gl|0,A|0,S|0),{h:E,l:b}=Ke.add(this.Hh|0,this.Hl|0,E|0,b|0),this.set(r,i,s,o,a,c,l,u,f,g,p,_,A,S,E,b)}roundClean(){Cs.fill(0),Ls.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const gC=Sw(()=>new pC);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Aw=BigInt(0),tp=BigInt(1),yC=BigInt(2);function ha(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function rd(t){if(!ha(t))throw new Error("Uint8Array expected")}function _s(t,e){if(typeof e!="boolean")throw new Error(`${t} must be valid boolean, got "${e}".`)}const mC=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function pa(t){rd(t);let e="";for(let n=0;n<t.length;n++)e+=mC[t[n]];return e}function ec(t){const e=t.toString(16);return e.length&1?`0${e}`:e}function Iw(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return BigInt(t===""?"0":`0x${t}`)}const Ki={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function l1(t){if(t>=Ki._0&&t<=Ki._9)return t-Ki._0;if(t>=Ki._A&&t<=Ki._F)return t-(Ki._A-10);if(t>=Ki._a&&t<=Ki._f)return t-(Ki._a-10)}function Mc(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length,n=e/2;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(n);for(let i=0,s=0;i<n;i++,s+=2){const o=l1(t.charCodeAt(s)),a=l1(t.charCodeAt(s+1));if(o===void 0||a===void 0){const c=t[s]+t[s+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+s)}r[i]=o*16+a}return r}function oa(t){return Iw(pa(t))}function pc(t){return rd(t),Iw(pa(Uint8Array.from(t).reverse()))}function Oc(t,e){return Mc(t.toString(16).padStart(e*2,"0"))}function vu(t,e){return Oc(t,e).reverse()}function wC(t){return Mc(ec(t))}function mn(t,e,n){let r;if(typeof e=="string")try{r=Mc(e)}catch(s){throw new Error(`${t} must be valid hex string, got "${e}". Cause: ${s}`)}else if(ha(e))r=Uint8Array.from(e);else throw new Error(`${t} must be hex string or Uint8Array`);const i=r.length;if(typeof n=="number"&&i!==n)throw new Error(`${t} expected ${n} bytes, got ${i}`);return r}function ga(...t){let e=0;for(let r=0;r<t.length;r++){const i=t[r];rd(i),e+=i.length}const n=new Uint8Array(e);for(let r=0,i=0;r<t.length;r++){const s=t[r];n.set(s,i),i+=s.length}return n}function _C(t,e){if(t.length!==e.length)return!1;let n=0;for(let r=0;r<t.length;r++)n|=t[r]^e[r];return n===0}function vC(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}const D0=t=>typeof t=="bigint"&&Aw<=t;function np(t,e,n){return D0(t)&&D0(e)&&D0(n)&&e<=t&&t<n}function $r(t,e,n,r){if(!np(e,n,r))throw new Error(`expected valid ${t}: ${n} <= n < ${r}, got ${typeof e} ${e}`)}function sA(t){let e;for(e=0;t>Aw;t>>=tp,e+=1);return e}function bC(t,e){return t>>BigInt(e)&tp}function EC(t,e,n){return t|(n?tp:Aw)<<BigInt(e)}const kw=t=>(yC<<BigInt(t-1))-tp,P0=t=>new Uint8Array(t),u1=t=>Uint8Array.from(t);function oA(t,e,n){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=P0(t),i=P0(t),s=0;const o=()=>{r.fill(1),i.fill(0),s=0},a=(...f)=>n(i,r,...f),c=(f=P0())=>{i=a(u1([0]),f),r=a(),f.length!==0&&(i=a(u1([1]),f),r=a())},l=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const g=[];for(;f<e;){r=a();const p=r.slice();g.push(p),f+=r.length}return ga(...g)};return(f,g)=>{o(),c(f);let p;for(;!(p=g(l()));)c();return o(),p}}const xC={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||ha(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function Qc(t,e,n={}){const r=(i,s,o)=>{const a=xC[s];if(typeof a!="function")throw new Error(`Invalid validator "${s}", expected function`);const c=t[i];if(!(o&&c===void 0)&&!a(c,t))throw new Error(`Invalid param ${String(i)}=${c} (${typeof c}), expected ${s}`)};for(const[i,s]of Object.entries(e))r(i,s,!1);for(const[i,s]of Object.entries(n))r(i,s,!0);return t}const SC=()=>{throw new Error("not implemented")};function bu(t){const e=new WeakMap;return(n,...r)=>{const i=e.get(n);if(i!==void 0)return i;const s=t(n,...r);return e.set(n,s),s}}const AC=Object.freeze(Object.defineProperty({__proto__:null,aInRange:$r,abool:_s,abytes:rd,bitGet:bC,bitLen:sA,bitMask:kw,bitSet:EC,bytesToHex:pa,bytesToNumberBE:oa,bytesToNumberLE:pc,concatBytes:ga,createHmacDrbg:oA,ensureBytes:mn,equalBytes:_C,hexToBytes:Mc,hexToNumber:Iw,inRange:np,isBytes:ha,memoized:bu,notImplemented:SC,numberToBytesBE:Oc,numberToBytesLE:vu,numberToHexUnpadded:ec,numberToVarBytesBE:wC,utf8ToBytes:vC,validateObject:Qc},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Rn=BigInt(0),zt=BigInt(1),Uo=BigInt(2),IC=BigInt(3),xy=BigInt(4),d1=BigInt(5),f1=BigInt(8);BigInt(9);BigInt(16);function Ct(t,e){const n=t%e;return n>=Rn?n:e+n}function kC(t,e,n){if(n<=Rn||e<Rn)throw new Error("Expected power/modulo > 0");if(n===zt)return Rn;let r=zt;for(;e>Rn;)e&zt&&(r=r*t%n),t=t*t%n,e>>=zt;return r}function Ht(t,e,n){let r=t;for(;e-- >Rn;)r*=r,r%=n;return r}function Sy(t,e){if(t===Rn||e<=Rn)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let n=Ct(t,e),r=e,i=Rn,s=zt;for(;n!==Rn;){const a=r/n,c=r%n,l=i-s*a;r=n,n=c,i=s,s=l}if(r!==zt)throw new Error("invert: does not exist");return Ct(i,e)}function RC(t){const e=(t-zt)/Uo;let n,r,i;for(n=t-zt,r=0;n%Uo===Rn;n/=Uo,r++);for(i=Uo;i<t&&kC(i,e,t)!==t-zt;i++);if(r===1){const o=(t+zt)/xy;return function(c,l){const u=c.pow(l,o);if(!c.eql(c.sqr(u),l))throw new Error("Cannot find square root");return u}}const s=(n+zt)/Uo;return function(a,c){if(a.pow(c,e)===a.neg(a.ONE))throw new Error("Cannot find square root");let l=r,u=a.pow(a.mul(a.ONE,i),n),f=a.pow(c,s),g=a.pow(c,n);for(;!a.eql(g,a.ONE);){if(a.eql(g,a.ZERO))return a.ZERO;let p=1;for(let A=a.sqr(g);p<l&&!a.eql(A,a.ONE);p++)A=a.sqr(A);const _=a.pow(u,zt<<BigInt(l-p-1));u=a.sqr(_),f=a.mul(f,_),g=a.mul(g,u),l=p}return f}}function NC(t){if(t%xy===IC){const e=(t+zt)/xy;return function(r,i){const s=r.pow(i,e);if(!r.eql(r.sqr(s),i))throw new Error("Cannot find square root");return s}}if(t%f1===d1){const e=(t-d1)/f1;return function(r,i){const s=r.mul(i,Uo),o=r.pow(s,e),a=r.mul(i,o),c=r.mul(r.mul(a,Uo),o),l=r.mul(a,r.sub(c,r.ONE));if(!r.eql(r.sqr(l),i))throw new Error("Cannot find square root");return l}}return RC(t)}const TC=(t,e)=>(Ct(t,e)&zt)===zt,MC=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function OC(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=MC.reduce((r,i)=>(r[i]="function",r),e);return Qc(t,n)}function CC(t,e,n){if(n<Rn)throw new Error("Expected power > 0");if(n===Rn)return t.ONE;if(n===zt)return e;let r=t.ONE,i=e;for(;n>Rn;)n&zt&&(r=t.mul(r,i)),i=t.sqr(i),n>>=zt;return r}function LC(t,e){const n=new Array(e.length),r=e.reduce((s,o,a)=>t.is0(o)?s:(n[a]=s,t.mul(s,o)),t.ONE),i=t.inv(r);return e.reduceRight((s,o,a)=>t.is0(o)?s:(n[a]=t.mul(s,n[a]),t.mul(s,o)),i),n}function aA(t,e){const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function rp(t,e,n=!1,r={}){if(t<=Rn)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:i,nByteLength:s}=aA(t,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=NC(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:s,MASK:kw(i),ZERO:Rn,ONE:zt,create:c=>Ct(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return Rn<=c&&c<t},is0:c=>c===Rn,isOdd:c=>(c&zt)===zt,neg:c=>Ct(-c,t),eql:(c,l)=>c===l,sqr:c=>Ct(c*c,t),add:(c,l)=>Ct(c+l,t),sub:(c,l)=>Ct(c-l,t),mul:(c,l)=>Ct(c*l,t),pow:(c,l)=>CC(a,c,l),div:(c,l)=>Ct(c*Sy(l,t),t),sqrN:c=>c*c,addN:(c,l)=>c+l,subN:(c,l)=>c-l,mulN:(c,l)=>c*l,inv:c=>Sy(c,t),sqrt:r.sqrt||(c=>o(a,c)),invertBatch:c=>LC(a,c),cmov:(c,l,u)=>u?l:c,toBytes:c=>n?vu(c,s):Oc(c,s),fromBytes:c=>{if(c.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${c.length}`);return n?pc(c):oa(c)}});return Object.freeze(a)}function cA(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function lA(t){const e=cA(t);return e+Math.ceil(e/2)}function DC(t,e,n=!1){const r=t.length,i=cA(e),s=lA(e);if(r<16||r<s||r>1024)throw new Error(`expected ${s}-1024 bytes of input, got ${r}`);const o=n?oa(t):pc(t),a=Ct(o,e-zt)+zt;return n?vu(a,i):Oc(a,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const PC=BigInt(0),B0=BigInt(1),z0=new WeakMap,h1=new WeakMap;function uA(t,e){const n=(s,o)=>{const a=o.negate();return s?a:o},r=s=>{if(!Number.isSafeInteger(s)||s<=0||s>e)throw new Error(`Wrong window size=${s}, should be [1..${e}]`)},i=s=>{r(s);const o=Math.ceil(e/s)+1,a=2**(s-1);return{windows:o,windowSize:a}};return{constTimeNegate:n,unsafeLadder(s,o){let a=t.ZERO,c=s;for(;o>PC;)o&B0&&(a=a.add(c)),c=c.double(),o>>=B0;return a},precomputeWindow(s,o){const{windows:a,windowSize:c}=i(o),l=[];let u=s,f=u;for(let g=0;g<a;g++){f=u,l.push(f);for(let p=1;p<c;p++)f=f.add(u),l.push(f);u=f.double()}return l},wNAF(s,o,a){const{windows:c,windowSize:l}=i(s);let u=t.ZERO,f=t.BASE;const g=BigInt(2**s-1),p=2**s,_=BigInt(s);for(let A=0;A<c;A++){const S=A*l;let E=Number(a&g);a>>=_,E>l&&(E-=p,a+=B0);const b=S,x=S+Math.abs(E)-1,M=A%2!==0,L=E<0;E===0?f=f.add(n(M,o[b])):u=u.add(n(L,o[x]))}return{p:u,f}},wNAFCached(s,o,a){const c=h1.get(s)||1;let l=z0.get(s);return l||(l=this.precomputeWindow(s,c),c!==1&&z0.set(s,a(l))),this.wNAF(c,l,o)},setWindowSize(s,o){r(o),h1.set(s,o),z0.delete(s)}}}function dA(t,e,n,r){if(!Array.isArray(n)||!Array.isArray(r)||r.length!==n.length)throw new Error("arrays of points and scalars must have equal length");r.forEach((u,f)=>{if(!e.isValid(u))throw new Error(`wrong scalar at index ${f}`)}),n.forEach((u,f)=>{if(!(u instanceof t))throw new Error(`wrong point at index ${f}`)});const i=sA(BigInt(n.length)),s=i>12?i-3:i>4?i-2:i?2:1,o=(1<<s)-1,a=new Array(o+1).fill(t.ZERO),c=Math.floor((e.BITS-1)/s)*s;let l=t.ZERO;for(let u=c;u>=0;u-=s){a.fill(t.ZERO);for(let g=0;g<r.length;g++){const p=r[g],_=Number(p>>BigInt(u)&BigInt(o));a[_]=a[_].add(n[g])}let f=t.ZERO;for(let g=a.length-1,p=t.ZERO;g>0;g--)p=p.add(a[g]),f=f.add(p);if(l=l.add(f),u!==0)for(let g=0;g<s;g++)l=l.double()}return l}function Rw(t){return OC(t.Fp),Qc(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...aA(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ei=BigInt(0),or=BigInt(1),Wd=BigInt(2),BC=BigInt(8),zC={zip215:!0};function jC(t){const e=Rw(t);return Qc(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function UC(t){const e=jC(t),{Fp:n,n:r,prehash:i,hash:s,randomBytes:o,nByteLength:a,h:c}=e,l=Wd<<BigInt(a*8)-or,u=n.create,f=rp(e.n,e.nBitLength),g=e.uvRatio||((v,I)=>{try{return{isValid:!0,value:n.sqrt(v*n.inv(I))}}catch{return{isValid:!1,value:ei}}}),p=e.adjustScalarBytes||(v=>v),_=e.domain||((v,I,k)=>{if(_s("phflag",k),I.length||k)throw new Error("Contexts/pre-hash are not supported");return v});function A(v,I){$r("coordinate "+v,I,ei,l)}function S(v){if(!(v instanceof x))throw new Error("ExtendedPoint expected")}const E=bu((v,I)=>{const{ex:k,ey:O,ez:B}=v,T=v.is0();I==null&&(I=T?BC:n.inv(B));const m=u(k*I),P=u(O*I),ae=u(B*I);if(T)return{x:ei,y:or};if(ae!==or)throw new Error("invZ was invalid");return{x:m,y:P}}),b=bu(v=>{const{a:I,d:k}=e;if(v.is0())throw new Error("bad point: ZERO");const{ex:O,ey:B,ez:T,et:m}=v,P=u(O*O),ae=u(B*B),fe=u(T*T),de=u(fe*fe),Ce=u(P*I),Re=u(fe*u(Ce+ae)),Me=u(de+u(k*u(P*ae)));if(Re!==Me)throw new Error("bad point: equation left != right (1)");const xt=u(O*B),Fe=u(T*m);if(xt!==Fe)throw new Error("bad point: equation left != right (2)");return!0});class x{constructor(I,k,O,B){this.ex=I,this.ey=k,this.ez=O,this.et=B,A("x",I),A("y",k),A("z",O),A("t",B),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(I){if(I instanceof x)throw new Error("extended point not allowed");const{x:k,y:O}=I||{};return A("x",k),A("y",O),new x(k,O,or,u(k*O))}static normalizeZ(I){const k=n.invertBatch(I.map(O=>O.ez));return I.map((O,B)=>O.toAffine(k[B])).map(x.fromAffine)}static msm(I,k){return dA(x,f,I,k)}_setWindowSize(I){z.setWindowSize(this,I)}assertValidity(){b(this)}equals(I){S(I);const{ex:k,ey:O,ez:B}=this,{ex:T,ey:m,ez:P}=I,ae=u(k*P),fe=u(T*B),de=u(O*P),Ce=u(m*B);return ae===fe&&de===Ce}is0(){return this.equals(x.ZERO)}negate(){return new x(u(-this.ex),this.ey,this.ez,u(-this.et))}double(){const{a:I}=e,{ex:k,ey:O,ez:B}=this,T=u(k*k),m=u(O*O),P=u(Wd*u(B*B)),ae=u(I*T),fe=k+O,de=u(u(fe*fe)-T-m),Ce=ae+m,Re=Ce-P,Me=ae-m,xt=u(de*Re),Fe=u(Ce*Me),De=u(de*Me),ht=u(Re*Ce);return new x(xt,Fe,ht,De)}add(I){S(I);const{a:k,d:O}=e,{ex:B,ey:T,ez:m,et:P}=this,{ex:ae,ey:fe,ez:de,et:Ce}=I;if(k===BigInt(-1)){const Q=u((T-B)*(fe+ae)),oe=u((T+B)*(fe-ae)),ce=u(oe-Q);if(ce===ei)return this.double();const ne=u(m*Wd*Ce),pe=u(P*Wd*de),je=pe+ne,We=oe+Q,R=pe-ne,y=u(je*ce),w=u(We*R),C=u(je*R),H=u(ce*We);return new x(y,w,H,C)}const Re=u(B*ae),Me=u(T*fe),xt=u(P*O*Ce),Fe=u(m*de),De=u((B+T)*(ae+fe)-Re-Me),ht=Fe-xt,Qe=Fe+xt,dt=u(Me-k*Re),Zi=u(De*ht),yt=u(Qe*dt),U=u(De*dt),Y=u(ht*Qe);return new x(Zi,yt,Y,U)}subtract(I){return this.add(I.negate())}wNAF(I){return z.wNAFCached(this,I,x.normalizeZ)}multiply(I){const k=I;$r("scalar",k,or,r);const{p:O,f:B}=this.wNAF(k);return x.normalizeZ([O,B])[0]}multiplyUnsafe(I){const k=I;return $r("scalar",k,ei,r),k===ei?L:this.equals(L)||k===or?this:this.equals(M)?this.wNAF(k).p:z.unsafeLadder(this,k)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return z.unsafeLadder(this,r).is0()}toAffine(I){return E(this,I)}clearCofactor(){const{h:I}=e;return I===or?this:this.multiplyUnsafe(I)}static fromHex(I,k=!1){const{d:O,a:B}=e,T=n.BYTES;I=mn("pointHex",I,T),_s("zip215",k);const m=I.slice(),P=I[T-1];m[T-1]=P&-129;const ae=pc(m),fe=k?l:n.ORDER;$r("pointHex.y",ae,ei,fe);const de=u(ae*ae),Ce=u(de-or),Re=u(O*de-B);let{isValid:Me,value:xt}=g(Ce,Re);if(!Me)throw new Error("Point.fromHex: invalid y coordinate");const Fe=(xt&or)===or,De=(P&128)!==0;if(!k&&xt===ei&&De)throw new Error("Point.fromHex: x=0 and x_0=1");return De!==Fe&&(xt=u(-xt)),x.fromAffine({x:xt,y:ae})}static fromPrivateKey(I){return $(I).point}toRawBytes(){const{x:I,y:k}=this.toAffine(),O=vu(k,n.BYTES);return O[O.length-1]|=I&or?128:0,O}toHex(){return pa(this.toRawBytes())}}x.BASE=new x(e.Gx,e.Gy,or,u(e.Gx*e.Gy)),x.ZERO=new x(ei,or,or,ei);const{BASE:M,ZERO:L}=x,z=uA(x,a*8);function D(v){return Ct(v,r)}function F(v){return D(pc(v))}function $(v){const I=a;v=mn("private key",v,I);const k=mn("hashed private key",s(v),2*I),O=p(k.slice(0,I)),B=k.slice(I,2*I),T=F(O),m=M.multiply(T),P=m.toRawBytes();return{head:O,prefix:B,scalar:T,point:m,pointBytes:P}}function V(v){return $(v).pointBytes}function G(v=new Uint8Array,...I){const k=ga(...I);return F(s(_(k,mn("context",v),!!i)))}function W(v,I,k={}){v=mn("message",v),i&&(v=i(v));const{prefix:O,scalar:B,pointBytes:T}=$(I),m=G(k.context,O,v),P=M.multiply(m).toRawBytes(),ae=G(k.context,P,T,v),fe=D(m+ae*B);$r("signature.s",fe,ei,r);const de=ga(P,vu(fe,n.BYTES));return mn("result",de,a*2)}const N=zC;function d(v,I,k,O=N){const{context:B,zip215:T}=O,m=n.BYTES;v=mn("signature",v,2*m),I=mn("message",I),T!==void 0&&_s("zip215",T),i&&(I=i(I));const P=pc(v.slice(m,2*m));let ae,fe,de;try{ae=x.fromHex(k,T),fe=x.fromHex(v.slice(0,m),T),de=M.multiplyUnsafe(P)}catch{return!1}if(!T&&ae.isSmallOrder())return!1;const Ce=G(B,fe.toRawBytes(),ae.toRawBytes(),I);return fe.add(ae.multiplyUnsafe(Ce)).subtract(de).clearCofactor().equals(x.ZERO)}return M._setWindowSize(8),{CURVE:e,getPublicKey:V,sign:W,verify:d,ExtendedPoint:x,utils:{getExtendedPublicKey:$,randomPrivateKey:()=>o(n.BYTES),precompute(v=8,I=x.BASE){return I._setWindowSize(v),I.multiply(BigInt(3)),I}}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Nw=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),p1=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);const FC=BigInt(1),g1=BigInt(2);BigInt(3);const WC=BigInt(5),HC=BigInt(8);function $C(t){const e=BigInt(10),n=BigInt(20),r=BigInt(40),i=BigInt(80),s=Nw,a=t*t%s*t%s,c=Ht(a,g1,s)*a%s,l=Ht(c,FC,s)*t%s,u=Ht(l,WC,s)*l%s,f=Ht(u,e,s)*u%s,g=Ht(f,n,s)*f%s,p=Ht(g,r,s)*g%s,_=Ht(p,i,s)*p%s,A=Ht(_,i,s)*p%s,S=Ht(A,e,s)*u%s;return{pow_p_5_8:Ht(S,g1,s)*t%s,b2:a}}function VC(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function ZC(t,e){const n=Nw,r=Ct(e*e*e,n),i=Ct(r*r*e,n),s=$C(t*i).pow_p_5_8;let o=Ct(t*r*s,n);const a=Ct(e*o*o,n),c=o,l=Ct(o*p1,n),u=a===t,f=a===Ct(-t,n),g=a===Ct(-t*p1,n);return u&&(o=c),(f||g)&&(o=l),TC(o,n)&&(o=Ct(-o,n)),{isValid:u||f,value:o}}const KC=rp(Nw,void 0,!0),GC={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:KC,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:HC,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:gC,randomBytes:QS,adjustScalarBytes:VC,uvRatio:ZC},Xc=UC(GC);var Tw={exports:{}};const YC={},qC=Object.freeze(Object.defineProperty({__proto__:null,default:YC},Symbol.toStringTag,{value:"Module"})),QC=Ph(qC);Tw.exports;(function(t){(function(e,n){function r(N,d){if(!N)throw new Error(d||"Assertion failed")}function i(N,d){N.super_=d;var h=function(){};h.prototype=d.prototype,N.prototype=new h,N.prototype.constructor=N}function s(N,d,h){if(s.isBN(N))return N;this.negative=0,this.words=null,this.length=0,this.red=null,N!==null&&((d==="le"||d==="be")&&(h=d,d=10),this._init(N||0,d||10,h||"be"))}typeof e=="object"?e.exports=s:n.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=QC.Buffer}catch{}s.isBN=function(d){return d instanceof s?!0:d!==null&&typeof d=="object"&&d.constructor.wordSize===s.wordSize&&Array.isArray(d.words)},s.max=function(d,h){return d.cmp(h)>0?d:h},s.min=function(d,h){return d.cmp(h)<0?d:h},s.prototype._init=function(d,h,v){if(typeof d=="number")return this._initNumber(d,h,v);if(typeof d=="object")return this._initArray(d,h,v);h==="hex"&&(h=16),r(h===(h|0)&&h>=2&&h<=36),d=d.toString().replace(/\s+/g,"");var I=0;d[0]==="-"&&(I++,this.negative=1),I<d.length&&(h===16?this._parseHex(d,I,v):(this._parseBase(d,h,I),v==="le"&&this._initArray(this.toArray(),h,v)))},s.prototype._initNumber=function(d,h,v){d<0&&(this.negative=1,d=-d),d<67108864?(this.words=[d&67108863],this.length=1):d<4503599627370496?(this.words=[d&67108863,d/67108864&67108863],this.length=2):(r(d<9007199254740992),this.words=[d&67108863,d/67108864&67108863,1],this.length=3),v==="le"&&this._initArray(this.toArray(),h,v)},s.prototype._initArray=function(d,h,v){if(r(typeof d.length=="number"),d.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(d.length/3),this.words=new Array(this.length);for(var I=0;I<this.length;I++)this.words[I]=0;var k,O,B=0;if(v==="be")for(I=d.length-1,k=0;I>=0;I-=3)O=d[I]|d[I-1]<<8|d[I-2]<<16,this.words[k]|=O<<B&67108863,this.words[k+1]=O>>>26-B&67108863,B+=24,B>=26&&(B-=26,k++);else if(v==="le")for(I=0,k=0;I<d.length;I+=3)O=d[I]|d[I+1]<<8|d[I+2]<<16,this.words[k]|=O<<B&67108863,this.words[k+1]=O>>>26-B&67108863,B+=24,B>=26&&(B-=26,k++);return this._strip()};function a(N,d){var h=N.charCodeAt(d);if(h>=48&&h<=57)return h-48;if(h>=65&&h<=70)return h-55;if(h>=97&&h<=102)return h-87;r(!1,"Invalid character in "+N)}function c(N,d,h){var v=a(N,h);return h-1>=d&&(v|=a(N,h-1)<<4),v}s.prototype._parseHex=function(d,h,v){this.length=Math.ceil((d.length-h)/6),this.words=new Array(this.length);for(var I=0;I<this.length;I++)this.words[I]=0;var k=0,O=0,B;if(v==="be")for(I=d.length-1;I>=h;I-=2)B=c(d,h,I)<<k,this.words[O]|=B&67108863,k>=18?(k-=18,O+=1,this.words[O]|=B>>>26):k+=8;else{var T=d.length-h;for(I=T%2===0?h+1:h;I<d.length;I+=2)B=c(d,h,I)<<k,this.words[O]|=B&67108863,k>=18?(k-=18,O+=1,this.words[O]|=B>>>26):k+=8}this._strip()};function l(N,d,h,v){for(var I=0,k=0,O=Math.min(N.length,h),B=d;B<O;B++){var T=N.charCodeAt(B)-48;I*=v,T>=49?k=T-49+10:T>=17?k=T-17+10:k=T,r(T>=0&&k<v,"Invalid character"),I+=k}return I}s.prototype._parseBase=function(d,h,v){this.words=[0],this.length=1;for(var I=0,k=1;k<=67108863;k*=h)I++;I--,k=k/h|0;for(var O=d.length-v,B=O%I,T=Math.min(O,O-B)+v,m=0,P=v;P<T;P+=I)m=l(d,P,P+I,h),this.imuln(k),this.words[0]+m<67108864?this.words[0]+=m:this._iaddn(m);if(B!==0){var ae=1;for(m=l(d,P,d.length,h),P=0;P<B;P++)ae*=h;this.imuln(ae),this.words[0]+m<67108864?this.words[0]+=m:this._iaddn(m)}this._strip()},s.prototype.copy=function(d){d.words=new Array(this.length);for(var h=0;h<this.length;h++)d.words[h]=this.words[h];d.length=this.length,d.negative=this.negative,d.red=this.red};function u(N,d){N.words=d.words,N.length=d.length,N.negative=d.negative,N.red=d.red}if(s.prototype._move=function(d){u(d,this)},s.prototype.clone=function(){var d=new s(null);return this.copy(d),d},s.prototype._expand=function(d){for(;this.length<d;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch{s.prototype.inspect=f}else s.prototype.inspect=f;function f(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var g=["","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"],p=[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],_=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(d,h){d=d||10,h=h|0||1;var v;if(d===16||d==="hex"){v="";for(var I=0,k=0,O=0;O<this.length;O++){var B=this.words[O],T=((B<<I|k)&16777215).toString(16);k=B>>>24-I&16777215,I+=2,I>=26&&(I-=26,O--),k!==0||O!==this.length-1?v=g[6-T.length]+T+v:v=T+v}for(k!==0&&(v=k.toString(16)+v);v.length%h!==0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}if(d===(d|0)&&d>=2&&d<=36){var m=p[d],P=_[d];v="";var ae=this.clone();for(ae.negative=0;!ae.isZero();){var fe=ae.modrn(P).toString(d);ae=ae.idivn(P),ae.isZero()?v=fe+v:v=g[m-fe.length]+fe+v}for(this.isZero()&&(v="0"+v);v.length%h!==0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}r(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var d=this.words[0];return this.length===2?d+=this.words[1]*67108864:this.length===3&&this.words[2]===1?d+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-d:d},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(d,h){return this.toArrayLike(o,d,h)}),s.prototype.toArray=function(d,h){return this.toArrayLike(Array,d,h)};var A=function(d,h){return d.allocUnsafe?d.allocUnsafe(h):new d(h)};s.prototype.toArrayLike=function(d,h,v){this._strip();var I=this.byteLength(),k=v||Math.max(1,I);r(I<=k,"byte array longer than desired length"),r(k>0,"Requested array length <= 0");var O=A(d,k),B=h==="le"?"LE":"BE";return this["_toArrayLike"+B](O,I),O},s.prototype._toArrayLikeLE=function(d,h){for(var v=0,I=0,k=0,O=0;k<this.length;k++){var B=this.words[k]<<O|I;d[v++]=B&255,v<d.length&&(d[v++]=B>>8&255),v<d.length&&(d[v++]=B>>16&255),O===6?(v<d.length&&(d[v++]=B>>24&255),I=0,O=0):(I=B>>>24,O+=2)}if(v<d.length)for(d[v++]=I;v<d.length;)d[v++]=0},s.prototype._toArrayLikeBE=function(d,h){for(var v=d.length-1,I=0,k=0,O=0;k<this.length;k++){var B=this.words[k]<<O|I;d[v--]=B&255,v>=0&&(d[v--]=B>>8&255),v>=0&&(d[v--]=B>>16&255),O===6?(v>=0&&(d[v--]=B>>24&255),I=0,O=0):(I=B>>>24,O+=2)}if(v>=0)for(d[v--]=I;v>=0;)d[v--]=0},Math.clz32?s.prototype._countBits=function(d){return 32-Math.clz32(d)}:s.prototype._countBits=function(d){var h=d,v=0;return h>=4096&&(v+=13,h>>>=13),h>=64&&(v+=7,h>>>=7),h>=8&&(v+=4,h>>>=4),h>=2&&(v+=2,h>>>=2),v+h},s.prototype._zeroBits=function(d){if(d===0)return 26;var h=d,v=0;return h&8191||(v+=13,h>>>=13),h&127||(v+=7,h>>>=7),h&15||(v+=4,h>>>=4),h&3||(v+=2,h>>>=2),h&1||v++,v},s.prototype.bitLength=function(){var d=this.words[this.length-1],h=this._countBits(d);return(this.length-1)*26+h};function S(N){for(var d=new Array(N.bitLength()),h=0;h<d.length;h++){var v=h/26|0,I=h%26;d[h]=N.words[v]>>>I&1}return d}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var d=0,h=0;h<this.length;h++){var v=this._zeroBits(this.words[h]);if(d+=v,v!==26)break}return d},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(d){return this.negative!==0?this.abs().inotn(d).iaddn(1):this.clone()},s.prototype.fromTwos=function(d){return this.testn(d-1)?this.notn(d).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(d){for(;this.length<d.length;)this.words[this.length++]=0;for(var h=0;h<d.length;h++)this.words[h]=this.words[h]|d.words[h];return this._strip()},s.prototype.ior=function(d){return r((this.negative|d.negative)===0),this.iuor(d)},s.prototype.or=function(d){return this.length>d.length?this.clone().ior(d):d.clone().ior(this)},s.prototype.uor=function(d){return this.length>d.length?this.clone().iuor(d):d.clone().iuor(this)},s.prototype.iuand=function(d){var h;this.length>d.length?h=d:h=this;for(var v=0;v<h.length;v++)this.words[v]=this.words[v]&d.words[v];return this.length=h.length,this._strip()},s.prototype.iand=function(d){return r((this.negative|d.negative)===0),this.iuand(d)},s.prototype.and=function(d){return this.length>d.length?this.clone().iand(d):d.clone().iand(this)},s.prototype.uand=function(d){return this.length>d.length?this.clone().iuand(d):d.clone().iuand(this)},s.prototype.iuxor=function(d){var h,v;this.length>d.length?(h=this,v=d):(h=d,v=this);for(var I=0;I<v.length;I++)this.words[I]=h.words[I]^v.words[I];if(this!==h)for(;I<h.length;I++)this.words[I]=h.words[I];return this.length=h.length,this._strip()},s.prototype.ixor=function(d){return r((this.negative|d.negative)===0),this.iuxor(d)},s.prototype.xor=function(d){return this.length>d.length?this.clone().ixor(d):d.clone().ixor(this)},s.prototype.uxor=function(d){return this.length>d.length?this.clone().iuxor(d):d.clone().iuxor(this)},s.prototype.inotn=function(d){r(typeof d=="number"&&d>=0);var h=Math.ceil(d/26)|0,v=d%26;this._expand(h),v>0&&h--;for(var I=0;I<h;I++)this.words[I]=~this.words[I]&67108863;return v>0&&(this.words[I]=~this.words[I]&67108863>>26-v),this._strip()},s.prototype.notn=function(d){return this.clone().inotn(d)},s.prototype.setn=function(d,h){r(typeof d=="number"&&d>=0);var v=d/26|0,I=d%26;return this._expand(v+1),h?this.words[v]=this.words[v]|1<<I:this.words[v]=this.words[v]&~(1<<I),this._strip()},s.prototype.iadd=function(d){var h;if(this.negative!==0&&d.negative===0)return this.negative=0,h=this.isub(d),this.negative^=1,this._normSign();if(this.negative===0&&d.negative!==0)return d.negative=0,h=this.isub(d),d.negative=1,h._normSign();var v,I;this.length>d.length?(v=this,I=d):(v=d,I=this);for(var k=0,O=0;O<I.length;O++)h=(v.words[O]|0)+(I.words[O]|0)+k,this.words[O]=h&67108863,k=h>>>26;for(;k!==0&&O<v.length;O++)h=(v.words[O]|0)+k,this.words[O]=h&67108863,k=h>>>26;if(this.length=v.length,k!==0)this.words[this.length]=k,this.length++;else if(v!==this)for(;O<v.length;O++)this.words[O]=v.words[O];return this},s.prototype.add=function(d){var h;return d.negative!==0&&this.negative===0?(d.negative=0,h=this.sub(d),d.negative^=1,h):d.negative===0&&this.negative!==0?(this.negative=0,h=d.sub(this),this.negative=1,h):this.length>d.length?this.clone().iadd(d):d.clone().iadd(this)},s.prototype.isub=function(d){if(d.negative!==0){d.negative=0;var h=this.iadd(d);return d.negative=1,h._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(d),this.negative=1,this._normSign();var v=this.cmp(d);if(v===0)return this.negative=0,this.length=1,this.words[0]=0,this;var I,k;v>0?(I=this,k=d):(I=d,k=this);for(var O=0,B=0;B<k.length;B++)h=(I.words[B]|0)-(k.words[B]|0)+O,O=h>>26,this.words[B]=h&67108863;for(;O!==0&&B<I.length;B++)h=(I.words[B]|0)+O,O=h>>26,this.words[B]=h&67108863;if(O===0&&B<I.length&&I!==this)for(;B<I.length;B++)this.words[B]=I.words[B];return this.length=Math.max(this.length,B),I!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(d){return this.clone().isub(d)};function E(N,d,h){h.negative=d.negative^N.negative;var v=N.length+d.length|0;h.length=v,v=v-1|0;var I=N.words[0]|0,k=d.words[0]|0,O=I*k,B=O&67108863,T=O/67108864|0;h.words[0]=B;for(var m=1;m<v;m++){for(var P=T>>>26,ae=T&67108863,fe=Math.min(m,d.length-1),de=Math.max(0,m-N.length+1);de<=fe;de++){var Ce=m-de|0;I=N.words[Ce]|0,k=d.words[de]|0,O=I*k+ae,P+=O/67108864|0,ae=O&67108863}h.words[m]=ae|0,T=P|0}return T!==0?h.words[m]=T|0:h.length--,h._strip()}var b=function(d,h,v){var I=d.words,k=h.words,O=v.words,B=0,T,m,P,ae=I[0]|0,fe=ae&8191,de=ae>>>13,Ce=I[1]|0,Re=Ce&8191,Me=Ce>>>13,xt=I[2]|0,Fe=xt&8191,De=xt>>>13,ht=I[3]|0,Qe=ht&8191,dt=ht>>>13,Zi=I[4]|0,yt=Zi&8191,U=Zi>>>13,Y=I[5]|0,Q=Y&8191,oe=Y>>>13,ce=I[6]|0,ne=ce&8191,pe=ce>>>13,je=I[7]|0,We=je&8191,R=je>>>13,y=I[8]|0,w=y&8191,C=y>>>13,H=I[9]|0,Z=H&8191,J=H>>>13,He=k[0]|0,ze=He&8191,Ue=He>>>13,kt=k[1]|0,Pe=kt&8191,Gt=kt>>>13,$_=k[2]|0,Yt=$_&8191,qt=$_>>>13,V_=k[3]|0,Qt=V_&8191,Xt=V_>>>13,Z_=k[4]|0,Jt=Z_&8191,en=Z_>>>13,K_=k[5]|0,tn=K_&8191,nn=K_>>>13,G_=k[6]|0,rn=G_&8191,sn=G_>>>13,Y_=k[7]|0,on=Y_&8191,an=Y_>>>13,q_=k[8]|0,cn=q_&8191,ln=q_>>>13,Q_=k[9]|0,un=Q_&8191,dn=Q_>>>13;v.negative=d.negative^h.negative,v.length=19,T=Math.imul(fe,ze),m=Math.imul(fe,Ue),m=m+Math.imul(de,ze)|0,P=Math.imul(de,Ue);var Wp=(B+T|0)+((m&8191)<<13)|0;B=(P+(m>>>13)|0)+(Wp>>>26)|0,Wp&=67108863,T=Math.imul(Re,ze),m=Math.imul(Re,Ue),m=m+Math.imul(Me,ze)|0,P=Math.imul(Me,Ue),T=T+Math.imul(fe,Pe)|0,m=m+Math.imul(fe,Gt)|0,m=m+Math.imul(de,Pe)|0,P=P+Math.imul(de,Gt)|0;var Hp=(B+T|0)+((m&8191)<<13)|0;B=(P+(m>>>13)|0)+(Hp>>>26)|0,Hp&=67108863,T=Math.imul(Fe,ze),m=Math.imul(Fe,Ue),m=m+Math.imul(De,ze)|0,P=Math.imul(De,Ue),T=T+Math.imul(Re,Pe)|0,m=m+Math.imul(Re,Gt)|0,m=m+Math.imul(Me,Pe)|0,P=P+Math.imul(Me,Gt)|0,T=T+Math.imul(fe,Yt)|0,m=m+Math.imul(fe,qt)|0,m=m+Math.imul(de,Yt)|0,P=P+Math.imul(de,qt)|0;var $p=(B+T|0)+((m&8191)<<13)|0;B=(P+(m>>>13)|0)+($p>>>26)|0,$p&=67108863,T=Math.imul(Qe,ze),m=Math.imul(Qe,Ue),m=m+Math.imul(dt,ze)|0,P=Math.imul(dt,Ue),T=T+Math.imul(Fe,Pe)|0,m=m+Math.imul(Fe,Gt)|0,m=m+Math.imul(De,Pe)|0,P=P+Math.imul(De,Gt)|0,T=T+Math.imul(Re,Yt)|0,m=m+Math.imul(Re,qt)|0,m=m+Math.imul(Me,Yt)|0,P=P+Math.imul(Me,qt)|0,T=T+Math.imul(fe,Qt)|0,m=m+Math.imul(fe,Xt)|0,m=m+Math.imul(de,Qt)|0,P=P+Math.imul(de,Xt)|0;var Vp=(B+T|0)+((m&8191)<<13)|0;B=(P+(m>>>13)|0)+(Vp>>>26)|0,Vp&=67108863,T=Math.imul(yt,ze),m=Math.imul(yt,Ue),m=m+Math.imul(U,ze)|0,P=Math.imul(U,Ue),T=T+Math.imul(Qe,Pe)|0,m=m+Math.imul(Qe,Gt)|0,m=m+Math.imul(dt,Pe)|0,P=P+Math.imul(dt,Gt)|0,T=T+Math.imul(Fe,Yt)|0,m=m+Math.imul(Fe,qt)|0,m=m+Math.imul(De,Yt)|0,P=P+Math.imul(De,qt)|0,T=T+Math.imul(Re,Qt)|0,m=m+Math.imul(Re,Xt)|0,m=m+Math.imul(Me,Qt)|0,P=P+Math.imul(Me,Xt)|0,T=T+Math.imul(fe,Jt)|0,m=m+Math.imul(fe,en)|0,m=m+Math.imul(de,Jt)|0,P=P+Math.imul(de,en)|0;var Zp=(B+T|0)+((m&8191)<<13)|0;B=(P+(m>>>13)|0)+(Zp>>>26)|0,Zp&=67108863,T=Math.imul(Q,ze),m=Math.imul(Q,Ue),m=m+Math.imul(oe,ze)|0,P=Math.imul(oe,Ue),T=T+Math.imul(yt,Pe)|0,m=m+Math.imul(yt,Gt)|0,m=m+Math.imul(U,Pe)|0,P=P+Math.imul(U,Gt)|0,T=T+Math.imul(Qe,Yt)|0,m=m+Math.imul(Qe,qt)|0,m=m+Math.imul(dt,Yt)|0,P=P+Math.imul(dt,qt)|0,T=T+Math.imul(Fe,Qt)|0,m=m+Math.imul(Fe,Xt)|0,m=m+Math.imul(De,Qt)|0,P=P+Math.imul(De,Xt)|0,T=T+Math.imul(Re,Jt)|0,m=m+Math.imul(Re,en)|0,m=m+Math.imul(Me,Jt)|0,P=P+Math.imul(Me,en)|0,T=T+Math.imul(fe,tn)|0,m=m+Math.imul(fe,nn)|0,m=m+Math.imul(de,tn)|0,P=P+Math.imul(de,nn)|0;var Kp=(B+T|0)+((m&8191)<<13)|0;B=(P+(m>>>13)|0)+(Kp>>>26)|0,Kp&=67108863,T=Math.imul(ne,ze),m=Math.imul(ne,Ue),m=m+Math.imul(pe,ze)|0,P=Math.imul(pe,Ue),T=T+Math.imul(Q,Pe)|0,m=m+Math.imul(Q,Gt)|0,m=m+Math.imul(oe,Pe)|0,P=P+Math.imul(oe,Gt)|0,T=T+Math.imul(yt,Yt)|0,m=m+Math.imul(yt,qt)|0,m=m+Math.imul(U,Yt)|0,P=P+Math.imul(U,qt)|0,T=T+Math.imul(Qe,Qt)|0,m=m+Math.imul(Qe,Xt)|0,m=m+Math.imul(dt,Qt)|0,P=P+Math.imul(dt,Xt)|0,T=T+Math.imul(Fe,Jt)|0,m=m+Math.imul(Fe,en)|0,m=m+Math.imul(De,Jt)|0,P=P+Math.imul(De,en)|0,T=T+Math.imul(Re,tn)|0,m=m+Math.imul(Re,nn)|0,m=m+Math.imul(Me,tn)|0,P=P+Math.imul(Me,nn)|0,T=T+Math.imul(fe,rn)|0,m=m+Math.imul(fe,sn)|0,m=m+Math.imul(de,rn)|0,P=P+Math.imul(de,sn)|0;var Gp=(B+T|0)+((m&8191)<<13)|0;B=(P+(m>>>13)|0)+(Gp>>>26)|0,Gp&=67108863,T=Math.imul(We,ze),m=Math.imul(We,Ue),m=m+Math.imul(R,ze)|0,P=Math.imul(R,Ue),T=T+Math.imul(ne,Pe)|0,m=m+Math.imul(ne,Gt)|0,m=m+Math.imul(pe,Pe)|0,P=P+Math.imul(pe,Gt)|0,T=T+Math.imul(Q,Yt)|0,m=m+Math.imul(Q,qt)|0,m=m+Math.imul(oe,Yt)|0,P=P+Math.imul(oe,qt)|0,T=T+Math.imul(yt,Qt)|0,m=m+Math.imul(yt,Xt)|0,m=m+Math.imul(U,Qt)|0,P=P+Math.imul(U,Xt)|0,T=T+Math.imul(Qe,Jt)|0,m=m+Math.imul(Qe,en)|0,m=m+Math.imul(dt,Jt)|0,P=P+Math.imul(dt,en)|0,T=T+Math.imul(Fe,tn)|0,m=m+Math.imul(Fe,nn)|0,m=m+Math.imul(De,tn)|0,P=P+Math.imul(De,nn)|0,T=T+Math.imul(Re,rn)|0,m=m+Math.imul(Re,sn)|0,m=m+Math.imul(Me,rn)|0,P=P+Math.imul(Me,sn)|0,T=T+Math.imul(fe,on)|0,m=m+Math.imul(fe,an)|0,m=m+Math.imul(de,on)|0,P=P+Math.imul(de,an)|0;var Yp=(B+T|0)+((m&8191)<<13)|0;B=(P+(m>>>13)|0)+(Yp>>>26)|0,Yp&=67108863,T=Math.imul(w,ze),m=Math.imul(w,Ue),m=m+Math.imul(C,ze)|0,P=Math.imul(C,Ue),T=T+Math.imul(We,Pe)|0,m=m+Math.imul(We,Gt)|0,m=m+Math.imul(R,Pe)|0,P=P+Math.imul(R,Gt)|0,T=T+Math.imul(ne,Yt)|0,m=m+Math.imul(ne,qt)|0,m=m+Math.imul(pe,Yt)|0,P=P+Math.imul(pe,qt)|0,T=T+Math.imul(Q,Qt)|0,m=m+Math.imul(Q,Xt)|0,m=m+Math.imul(oe,Qt)|0,P=P+Math.imul(oe,Xt)|0,T=T+Math.imul(yt,Jt)|0,m=m+Math.imul(yt,en)|0,m=m+Math.imul(U,Jt)|0,P=P+Math.imul(U,en)|0,T=T+Math.imul(Qe,tn)|0,m=m+Math.imul(Qe,nn)|0,m=m+Math.imul(dt,tn)|0,P=P+Math.imul(dt,nn)|0,T=T+Math.imul(Fe,rn)|0,m=m+Math.imul(Fe,sn)|0,m=m+Math.imul(De,rn)|0,P=P+Math.imul(De,sn)|0,T=T+Math.imul(Re,on)|0,m=m+Math.imul(Re,an)|0,m=m+Math.imul(Me,on)|0,P=P+Math.imul(Me,an)|0,T=T+Math.imul(fe,cn)|0,m=m+Math.imul(fe,ln)|0,m=m+Math.imul(de,cn)|0,P=P+Math.imul(de,ln)|0;var qp=(B+T|0)+((m&8191)<<13)|0;B=(P+(m>>>13)|0)+(qp>>>26)|0,qp&=67108863,T=Math.imul(Z,ze),m=Math.imul(Z,Ue),m=m+Math.imul(J,ze)|0,P=Math.imul(J,Ue),T=T+Math.imul(w,Pe)|0,m=m+Math.imul(w,Gt)|0,m=m+Math.imul(C,Pe)|0,P=P+Math.imul(C,Gt)|0,T=T+Math.imul(We,Yt)|0,m=m+Math.imul(We,qt)|0,m=m+Math.imul(R,Yt)|0,P=P+Math.imul(R,qt)|0,T=T+Math.imul(ne,Qt)|0,m=m+Math.imul(ne,Xt)|0,m=m+Math.imul(pe,Qt)|0,P=P+Math.imul(pe,Xt)|0,T=T+Math.imul(Q,Jt)|0,m=m+Math.imul(Q,en)|0,m=m+Math.imul(oe,Jt)|0,P=P+Math.imul(oe,en)|0,T=T+Math.imul(yt,tn)|0,m=m+Math.imul(yt,nn)|0,m=m+Math.imul(U,tn)|0,P=P+Math.imul(U,nn)|0,T=T+Math.imul(Qe,rn)|0,m=m+Math.imul(Qe,sn)|0,m=m+Math.imul(dt,rn)|0,P=P+Math.imul(dt,sn)|0,T=T+Math.imul(Fe,on)|0,m=m+Math.imul(Fe,an)|0,m=m+Math.imul(De,on)|0,P=P+Math.imul(De,an)|0,T=T+Math.imul(Re,cn)|0,m=m+Math.imul(Re,ln)|0,m=m+Math.imul(Me,cn)|0,P=P+Math.imul(Me,ln)|0,T=T+Math.imul(fe,un)|0,m=m+Math.imul(fe,dn)|0,m=m+Math.imul(de,un)|0,P=P+Math.imul(de,dn)|0;var Qp=(B+T|0)+((m&8191)<<13)|0;B=(P+(m>>>13)|0)+(Qp>>>26)|0,Qp&=67108863,T=Math.imul(Z,Pe),m=Math.imul(Z,Gt),m=m+Math.imul(J,Pe)|0,P=Math.imul(J,Gt),T=T+Math.imul(w,Yt)|0,m=m+Math.imul(w,qt)|0,m=m+Math.imul(C,Yt)|0,P=P+Math.imul(C,qt)|0,T=T+Math.imul(We,Qt)|0,m=m+Math.imul(We,Xt)|0,m=m+Math.imul(R,Qt)|0,P=P+Math.imul(R,Xt)|0,T=T+Math.imul(ne,Jt)|0,m=m+Math.imul(ne,en)|0,m=m+Math.imul(pe,Jt)|0,P=P+Math.imul(pe,en)|0,T=T+Math.imul(Q,tn)|0,m=m+Math.imul(Q,nn)|0,m=m+Math.imul(oe,tn)|0,P=P+Math.imul(oe,nn)|0,T=T+Math.imul(yt,rn)|0,m=m+Math.imul(yt,sn)|0,m=m+Math.imul(U,rn)|0,P=P+Math.imul(U,sn)|0,T=T+Math.imul(Qe,on)|0,m=m+Math.imul(Qe,an)|0,m=m+Math.imul(dt,on)|0,P=P+Math.imul(dt,an)|0,T=T+Math.imul(Fe,cn)|0,m=m+Math.imul(Fe,ln)|0,m=m+Math.imul(De,cn)|0,P=P+Math.imul(De,ln)|0,T=T+Math.imul(Re,un)|0,m=m+Math.imul(Re,dn)|0,m=m+Math.imul(Me,un)|0,P=P+Math.imul(Me,dn)|0;var Xp=(B+T|0)+((m&8191)<<13)|0;B=(P+(m>>>13)|0)+(Xp>>>26)|0,Xp&=67108863,T=Math.imul(Z,Yt),m=Math.imul(Z,qt),m=m+Math.imul(J,Yt)|0,P=Math.imul(J,qt),T=T+Math.imul(w,Qt)|0,m=m+Math.imul(w,Xt)|0,m=m+Math.imul(C,Qt)|0,P=P+Math.imul(C,Xt)|0,T=T+Math.imul(We,Jt)|0,m=m+Math.imul(We,en)|0,m=m+Math.imul(R,Jt)|0,P=P+Math.imul(R,en)|0,T=T+Math.imul(ne,tn)|0,m=m+Math.imul(ne,nn)|0,m=m+Math.imul(pe,tn)|0,P=P+Math.imul(pe,nn)|0,T=T+Math.imul(Q,rn)|0,m=m+Math.imul(Q,sn)|0,m=m+Math.imul(oe,rn)|0,P=P+Math.imul(oe,sn)|0,T=T+Math.imul(yt,on)|0,m=m+Math.imul(yt,an)|0,m=m+Math.imul(U,on)|0,P=P+Math.imul(U,an)|0,T=T+Math.imul(Qe,cn)|0,m=m+Math.imul(Qe,ln)|0,m=m+Math.imul(dt,cn)|0,P=P+Math.imul(dt,ln)|0,T=T+Math.imul(Fe,un)|0,m=m+Math.imul(Fe,dn)|0,m=m+Math.imul(De,un)|0,P=P+Math.imul(De,dn)|0;var Jp=(B+T|0)+((m&8191)<<13)|0;B=(P+(m>>>13)|0)+(Jp>>>26)|0,Jp&=67108863,T=Math.imul(Z,Qt),m=Math.imul(Z,Xt),m=m+Math.imul(J,Qt)|0,P=Math.imul(J,Xt),T=T+Math.imul(w,Jt)|0,m=m+Math.imul(w,en)|0,m=m+Math.imul(C,Jt)|0,P=P+Math.imul(C,en)|0,T=T+Math.imul(We,tn)|0,m=m+Math.imul(We,nn)|0,m=m+Math.imul(R,tn)|0,P=P+Math.imul(R,nn)|0,T=T+Math.imul(ne,rn)|0,m=m+Math.imul(ne,sn)|0,m=m+Math.imul(pe,rn)|0,P=P+Math.imul(pe,sn)|0,T=T+Math.imul(Q,on)|0,m=m+Math.imul(Q,an)|0,m=m+Math.imul(oe,on)|0,P=P+Math.imul(oe,an)|0,T=T+Math.imul(yt,cn)|0,m=m+Math.imul(yt,ln)|0,m=m+Math.imul(U,cn)|0,P=P+Math.imul(U,ln)|0,T=T+Math.imul(Qe,un)|0,m=m+Math.imul(Qe,dn)|0,m=m+Math.imul(dt,un)|0,P=P+Math.imul(dt,dn)|0;var e0=(B+T|0)+((m&8191)<<13)|0;B=(P+(m>>>13)|0)+(e0>>>26)|0,e0&=67108863,T=Math.imul(Z,Jt),m=Math.imul(Z,en),m=m+Math.imul(J,Jt)|0,P=Math.imul(J,en),T=T+Math.imul(w,tn)|0,m=m+Math.imul(w,nn)|0,m=m+Math.imul(C,tn)|0,P=P+Math.imul(C,nn)|0,T=T+Math.imul(We,rn)|0,m=m+Math.imul(We,sn)|0,m=m+Math.imul(R,rn)|0,P=P+Math.imul(R,sn)|0,T=T+Math.imul(ne,on)|0,m=m+Math.imul(ne,an)|0,m=m+Math.imul(pe,on)|0,P=P+Math.imul(pe,an)|0,T=T+Math.imul(Q,cn)|0,m=m+Math.imul(Q,ln)|0,m=m+Math.imul(oe,cn)|0,P=P+Math.imul(oe,ln)|0,T=T+Math.imul(yt,un)|0,m=m+Math.imul(yt,dn)|0,m=m+Math.imul(U,un)|0,P=P+Math.imul(U,dn)|0;var t0=(B+T|0)+((m&8191)<<13)|0;B=(P+(m>>>13)|0)+(t0>>>26)|0,t0&=67108863,T=Math.imul(Z,tn),m=Math.imul(Z,nn),m=m+Math.imul(J,tn)|0,P=Math.imul(J,nn),T=T+Math.imul(w,rn)|0,m=m+Math.imul(w,sn)|0,m=m+Math.imul(C,rn)|0,P=P+Math.imul(C,sn)|0,T=T+Math.imul(We,on)|0,m=m+Math.imul(We,an)|0,m=m+Math.imul(R,on)|0,P=P+Math.imul(R,an)|0,T=T+Math.imul(ne,cn)|0,m=m+Math.imul(ne,ln)|0,m=m+Math.imul(pe,cn)|0,P=P+Math.imul(pe,ln)|0,T=T+Math.imul(Q,un)|0,m=m+Math.imul(Q,dn)|0,m=m+Math.imul(oe,un)|0,P=P+Math.imul(oe,dn)|0;var n0=(B+T|0)+((m&8191)<<13)|0;B=(P+(m>>>13)|0)+(n0>>>26)|0,n0&=67108863,T=Math.imul(Z,rn),m=Math.imul(Z,sn),m=m+Math.imul(J,rn)|0,P=Math.imul(J,sn),T=T+Math.imul(w,on)|0,m=m+Math.imul(w,an)|0,m=m+Math.imul(C,on)|0,P=P+Math.imul(C,an)|0,T=T+Math.imul(We,cn)|0,m=m+Math.imul(We,ln)|0,m=m+Math.imul(R,cn)|0,P=P+Math.imul(R,ln)|0,T=T+Math.imul(ne,un)|0,m=m+Math.imul(ne,dn)|0,m=m+Math.imul(pe,un)|0,P=P+Math.imul(pe,dn)|0;var r0=(B+T|0)+((m&8191)<<13)|0;B=(P+(m>>>13)|0)+(r0>>>26)|0,r0&=67108863,T=Math.imul(Z,on),m=Math.imul(Z,an),m=m+Math.imul(J,on)|0,P=Math.imul(J,an),T=T+Math.imul(w,cn)|0,m=m+Math.imul(w,ln)|0,m=m+Math.imul(C,cn)|0,P=P+Math.imul(C,ln)|0,T=T+Math.imul(We,un)|0,m=m+Math.imul(We,dn)|0,m=m+Math.imul(R,un)|0,P=P+Math.imul(R,dn)|0;var i0=(B+T|0)+((m&8191)<<13)|0;B=(P+(m>>>13)|0)+(i0>>>26)|0,i0&=67108863,T=Math.imul(Z,cn),m=Math.imul(Z,ln),m=m+Math.imul(J,cn)|0,P=Math.imul(J,ln),T=T+Math.imul(w,un)|0,m=m+Math.imul(w,dn)|0,m=m+Math.imul(C,un)|0,P=P+Math.imul(C,dn)|0;var s0=(B+T|0)+((m&8191)<<13)|0;B=(P+(m>>>13)|0)+(s0>>>26)|0,s0&=67108863,T=Math.imul(Z,un),m=Math.imul(Z,dn),m=m+Math.imul(J,un)|0,P=Math.imul(J,dn);var o0=(B+T|0)+((m&8191)<<13)|0;return B=(P+(m>>>13)|0)+(o0>>>26)|0,o0&=67108863,O[0]=Wp,O[1]=Hp,O[2]=$p,O[3]=Vp,O[4]=Zp,O[5]=Kp,O[6]=Gp,O[7]=Yp,O[8]=qp,O[9]=Qp,O[10]=Xp,O[11]=Jp,O[12]=e0,O[13]=t0,O[14]=n0,O[15]=r0,O[16]=i0,O[17]=s0,O[18]=o0,B!==0&&(O[19]=B,v.length++),v};Math.imul||(b=E);function x(N,d,h){h.negative=d.negative^N.negative,h.length=N.length+d.length;for(var v=0,I=0,k=0;k<h.length-1;k++){var O=I;I=0;for(var B=v&67108863,T=Math.min(k,d.length-1),m=Math.max(0,k-N.length+1);m<=T;m++){var P=k-m,ae=N.words[P]|0,fe=d.words[m]|0,de=ae*fe,Ce=de&67108863;O=O+(de/67108864|0)|0,Ce=Ce+B|0,B=Ce&67108863,O=O+(Ce>>>26)|0,I+=O>>>26,O&=67108863}h.words[k]=B,v=O,O=I}return v!==0?h.words[k]=v:h.length--,h._strip()}function M(N,d,h){return x(N,d,h)}s.prototype.mulTo=function(d,h){var v,I=this.length+d.length;return this.length===10&&d.length===10?v=b(this,d,h):I<63?v=E(this,d,h):I<1024?v=x(this,d,h):v=M(this,d,h),v},s.prototype.mul=function(d){var h=new s(null);return h.words=new Array(this.length+d.length),this.mulTo(d,h)},s.prototype.mulf=function(d){var h=new s(null);return h.words=new Array(this.length+d.length),M(this,d,h)},s.prototype.imul=function(d){return this.clone().mulTo(d,this)},s.prototype.imuln=function(d){var h=d<0;h&&(d=-d),r(typeof d=="number"),r(d<67108864);for(var v=0,I=0;I<this.length;I++){var k=(this.words[I]|0)*d,O=(k&67108863)+(v&67108863);v>>=26,v+=k/67108864|0,v+=O>>>26,this.words[I]=O&67108863}return v!==0&&(this.words[I]=v,this.length++),h?this.ineg():this},s.prototype.muln=function(d){return this.clone().imuln(d)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(d){var h=S(d);if(h.length===0)return new s(1);for(var v=this,I=0;I<h.length&&h[I]===0;I++,v=v.sqr());if(++I<h.length)for(var k=v.sqr();I<h.length;I++,k=k.sqr())h[I]!==0&&(v=v.mul(k));return v},s.prototype.iushln=function(d){r(typeof d=="number"&&d>=0);var h=d%26,v=(d-h)/26,I=67108863>>>26-h<<26-h,k;if(h!==0){var O=0;for(k=0;k<this.length;k++){var B=this.words[k]&I,T=(this.words[k]|0)-B<<h;this.words[k]=T|O,O=B>>>26-h}O&&(this.words[k]=O,this.length++)}if(v!==0){for(k=this.length-1;k>=0;k--)this.words[k+v]=this.words[k];for(k=0;k<v;k++)this.words[k]=0;this.length+=v}return this._strip()},s.prototype.ishln=function(d){return r(this.negative===0),this.iushln(d)},s.prototype.iushrn=function(d,h,v){r(typeof d=="number"&&d>=0);var I;h?I=(h-h%26)/26:I=0;var k=d%26,O=Math.min((d-k)/26,this.length),B=67108863^67108863>>>k<<k,T=v;if(I-=O,I=Math.max(0,I),T){for(var m=0;m<O;m++)T.words[m]=this.words[m];T.length=O}if(O!==0)if(this.length>O)for(this.length-=O,m=0;m<this.length;m++)this.words[m]=this.words[m+O];else this.words[0]=0,this.length=1;var P=0;for(m=this.length-1;m>=0&&(P!==0||m>=I);m--){var ae=this.words[m]|0;this.words[m]=P<<26-k|ae>>>k,P=ae&B}return T&&P!==0&&(T.words[T.length++]=P),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(d,h,v){return r(this.negative===0),this.iushrn(d,h,v)},s.prototype.shln=function(d){return this.clone().ishln(d)},s.prototype.ushln=function(d){return this.clone().iushln(d)},s.prototype.shrn=function(d){return this.clone().ishrn(d)},s.prototype.ushrn=function(d){return this.clone().iushrn(d)},s.prototype.testn=function(d){r(typeof d=="number"&&d>=0);var h=d%26,v=(d-h)/26,I=1<<h;if(this.length<=v)return!1;var k=this.words[v];return!!(k&I)},s.prototype.imaskn=function(d){r(typeof d=="number"&&d>=0);var h=d%26,v=(d-h)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=v)return this;if(h!==0&&v++,this.length=Math.min(v,this.length),h!==0){var I=67108863^67108863>>>h<<h;this.words[this.length-1]&=I}return this._strip()},s.prototype.maskn=function(d){return this.clone().imaskn(d)},s.prototype.iaddn=function(d){return r(typeof d=="number"),r(d<67108864),d<0?this.isubn(-d):this.negative!==0?this.length===1&&(this.words[0]|0)<=d?(this.words[0]=d-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(d),this.negative=1,this):this._iaddn(d)},s.prototype._iaddn=function(d){this.words[0]+=d;for(var h=0;h<this.length&&this.words[h]>=67108864;h++)this.words[h]-=67108864,h===this.length-1?this.words[h+1]=1:this.words[h+1]++;return this.length=Math.max(this.length,h+1),this},s.prototype.isubn=function(d){if(r(typeof d=="number"),r(d<67108864),d<0)return this.iaddn(-d);if(this.negative!==0)return this.negative=0,this.iaddn(d),this.negative=1,this;if(this.words[0]-=d,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var h=0;h<this.length&&this.words[h]<0;h++)this.words[h]+=67108864,this.words[h+1]-=1;return this._strip()},s.prototype.addn=function(d){return this.clone().iaddn(d)},s.prototype.subn=function(d){return this.clone().isubn(d)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(d,h,v){var I=d.length+v,k;this._expand(I);var O,B=0;for(k=0;k<d.length;k++){O=(this.words[k+v]|0)+B;var T=(d.words[k]|0)*h;O-=T&67108863,B=(O>>26)-(T/67108864|0),this.words[k+v]=O&67108863}for(;k<this.length-v;k++)O=(this.words[k+v]|0)+B,B=O>>26,this.words[k+v]=O&67108863;if(B===0)return this._strip();for(r(B===-1),B=0,k=0;k<this.length;k++)O=-(this.words[k]|0)+B,B=O>>26,this.words[k]=O&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(d,h){var v=this.length-d.length,I=this.clone(),k=d,O=k.words[k.length-1]|0,B=this._countBits(O);v=26-B,v!==0&&(k=k.ushln(v),I.iushln(v),O=k.words[k.length-1]|0);var T=I.length-k.length,m;if(h!=="mod"){m=new s(null),m.length=T+1,m.words=new Array(m.length);for(var P=0;P<m.length;P++)m.words[P]=0}var ae=I.clone()._ishlnsubmul(k,1,T);ae.negative===0&&(I=ae,m&&(m.words[T]=1));for(var fe=T-1;fe>=0;fe--){var de=(I.words[k.length+fe]|0)*67108864+(I.words[k.length+fe-1]|0);for(de=Math.min(de/O|0,67108863),I._ishlnsubmul(k,de,fe);I.negative!==0;)de--,I.negative=0,I._ishlnsubmul(k,1,fe),I.isZero()||(I.negative^=1);m&&(m.words[fe]=de)}return m&&m._strip(),I._strip(),h!=="div"&&v!==0&&I.iushrn(v),{div:m||null,mod:I}},s.prototype.divmod=function(d,h,v){if(r(!d.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var I,k,O;return this.negative!==0&&d.negative===0?(O=this.neg().divmod(d,h),h!=="mod"&&(I=O.div.neg()),h!=="div"&&(k=O.mod.neg(),v&&k.negative!==0&&k.iadd(d)),{div:I,mod:k}):this.negative===0&&d.negative!==0?(O=this.divmod(d.neg(),h),h!=="mod"&&(I=O.div.neg()),{div:I,mod:O.mod}):this.negative&d.negative?(O=this.neg().divmod(d.neg(),h),h!=="div"&&(k=O.mod.neg(),v&&k.negative!==0&&k.isub(d)),{div:O.div,mod:k}):d.length>this.length||this.cmp(d)<0?{div:new s(0),mod:this}:d.length===1?h==="div"?{div:this.divn(d.words[0]),mod:null}:h==="mod"?{div:null,mod:new s(this.modrn(d.words[0]))}:{div:this.divn(d.words[0]),mod:new s(this.modrn(d.words[0]))}:this._wordDiv(d,h)},s.prototype.div=function(d){return this.divmod(d,"div",!1).div},s.prototype.mod=function(d){return this.divmod(d,"mod",!1).mod},s.prototype.umod=function(d){return this.divmod(d,"mod",!0).mod},s.prototype.divRound=function(d){var h=this.divmod(d);if(h.mod.isZero())return h.div;var v=h.div.negative!==0?h.mod.isub(d):h.mod,I=d.ushrn(1),k=d.andln(1),O=v.cmp(I);return O<0||k===1&&O===0?h.div:h.div.negative!==0?h.div.isubn(1):h.div.iaddn(1)},s.prototype.modrn=function(d){var h=d<0;h&&(d=-d),r(d<=67108863);for(var v=(1<<26)%d,I=0,k=this.length-1;k>=0;k--)I=(v*I+(this.words[k]|0))%d;return h?-I:I},s.prototype.modn=function(d){return this.modrn(d)},s.prototype.idivn=function(d){var h=d<0;h&&(d=-d),r(d<=67108863);for(var v=0,I=this.length-1;I>=0;I--){var k=(this.words[I]|0)+v*67108864;this.words[I]=k/d|0,v=k%d}return this._strip(),h?this.ineg():this},s.prototype.divn=function(d){return this.clone().idivn(d)},s.prototype.egcd=function(d){r(d.negative===0),r(!d.isZero());var h=this,v=d.clone();h.negative!==0?h=h.umod(d):h=h.clone();for(var I=new s(1),k=new s(0),O=new s(0),B=new s(1),T=0;h.isEven()&&v.isEven();)h.iushrn(1),v.iushrn(1),++T;for(var m=v.clone(),P=h.clone();!h.isZero();){for(var ae=0,fe=1;!(h.words[0]&fe)&&ae<26;++ae,fe<<=1);if(ae>0)for(h.iushrn(ae);ae-- >0;)(I.isOdd()||k.isOdd())&&(I.iadd(m),k.isub(P)),I.iushrn(1),k.iushrn(1);for(var de=0,Ce=1;!(v.words[0]&Ce)&&de<26;++de,Ce<<=1);if(de>0)for(v.iushrn(de);de-- >0;)(O.isOdd()||B.isOdd())&&(O.iadd(m),B.isub(P)),O.iushrn(1),B.iushrn(1);h.cmp(v)>=0?(h.isub(v),I.isub(O),k.isub(B)):(v.isub(h),O.isub(I),B.isub(k))}return{a:O,b:B,gcd:v.iushln(T)}},s.prototype._invmp=function(d){r(d.negative===0),r(!d.isZero());var h=this,v=d.clone();h.negative!==0?h=h.umod(d):h=h.clone();for(var I=new s(1),k=new s(0),O=v.clone();h.cmpn(1)>0&&v.cmpn(1)>0;){for(var B=0,T=1;!(h.words[0]&T)&&B<26;++B,T<<=1);if(B>0)for(h.iushrn(B);B-- >0;)I.isOdd()&&I.iadd(O),I.iushrn(1);for(var m=0,P=1;!(v.words[0]&P)&&m<26;++m,P<<=1);if(m>0)for(v.iushrn(m);m-- >0;)k.isOdd()&&k.iadd(O),k.iushrn(1);h.cmp(v)>=0?(h.isub(v),I.isub(k)):(v.isub(h),k.isub(I))}var ae;return h.cmpn(1)===0?ae=I:ae=k,ae.cmpn(0)<0&&ae.iadd(d),ae},s.prototype.gcd=function(d){if(this.isZero())return d.abs();if(d.isZero())return this.abs();var h=this.clone(),v=d.clone();h.negative=0,v.negative=0;for(var I=0;h.isEven()&&v.isEven();I++)h.iushrn(1),v.iushrn(1);do{for(;h.isEven();)h.iushrn(1);for(;v.isEven();)v.iushrn(1);var k=h.cmp(v);if(k<0){var O=h;h=v,v=O}else if(k===0||v.cmpn(1)===0)break;h.isub(v)}while(!0);return v.iushln(I)},s.prototype.invm=function(d){return this.egcd(d).a.umod(d)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(d){return this.words[0]&d},s.prototype.bincn=function(d){r(typeof d=="number");var h=d%26,v=(d-h)/26,I=1<<h;if(this.length<=v)return this._expand(v+1),this.words[v]|=I,this;for(var k=I,O=v;k!==0&&O<this.length;O++){var B=this.words[O]|0;B+=k,k=B>>>26,B&=67108863,this.words[O]=B}return k!==0&&(this.words[O]=k,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(d){var h=d<0;if(this.negative!==0&&!h)return-1;if(this.negative===0&&h)return 1;this._strip();var v;if(this.length>1)v=1;else{h&&(d=-d),r(d<=67108863,"Number is too big");var I=this.words[0]|0;v=I===d?0:I<d?-1:1}return this.negative!==0?-v|0:v},s.prototype.cmp=function(d){if(this.negative!==0&&d.negative===0)return-1;if(this.negative===0&&d.negative!==0)return 1;var h=this.ucmp(d);return this.negative!==0?-h|0:h},s.prototype.ucmp=function(d){if(this.length>d.length)return 1;if(this.length<d.length)return-1;for(var h=0,v=this.length-1;v>=0;v--){var I=this.words[v]|0,k=d.words[v]|0;if(I!==k){I<k?h=-1:I>k&&(h=1);break}}return h},s.prototype.gtn=function(d){return this.cmpn(d)===1},s.prototype.gt=function(d){return this.cmp(d)===1},s.prototype.gten=function(d){return this.cmpn(d)>=0},s.prototype.gte=function(d){return this.cmp(d)>=0},s.prototype.ltn=function(d){return this.cmpn(d)===-1},s.prototype.lt=function(d){return this.cmp(d)===-1},s.prototype.lten=function(d){return this.cmpn(d)<=0},s.prototype.lte=function(d){return this.cmp(d)<=0},s.prototype.eqn=function(d){return this.cmpn(d)===0},s.prototype.eq=function(d){return this.cmp(d)===0},s.red=function(d){return new G(d)},s.prototype.toRed=function(d){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),d.convertTo(this)._forceRed(d)},s.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(d){return this.red=d,this},s.prototype.forceRed=function(d){return r(!this.red,"Already a number in reduction context"),this._forceRed(d)},s.prototype.redAdd=function(d){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,d)},s.prototype.redIAdd=function(d){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,d)},s.prototype.redSub=function(d){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,d)},s.prototype.redISub=function(d){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,d)},s.prototype.redShl=function(d){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,d)},s.prototype.redMul=function(d){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,d),this.red.mul(this,d)},s.prototype.redIMul=function(d){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,d),this.red.imul(this,d)},s.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(d){return r(this.red&&!d.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,d)};var L={k256:null,p224:null,p192:null,p25519:null};function z(N,d){this.name=N,this.p=new s(d,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}z.prototype._tmp=function(){var d=new s(null);return d.words=new Array(Math.ceil(this.n/13)),d},z.prototype.ireduce=function(d){var h=d,v;do this.split(h,this.tmp),h=this.imulK(h),h=h.iadd(this.tmp),v=h.bitLength();while(v>this.n);var I=v<this.n?-1:h.ucmp(this.p);return I===0?(h.words[0]=0,h.length=1):I>0?h.isub(this.p):h.strip!==void 0?h.strip():h._strip(),h},z.prototype.split=function(d,h){d.iushrn(this.n,0,h)},z.prototype.imulK=function(d){return d.imul(this.k)};function D(){z.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(D,z),D.prototype.split=function(d,h){for(var v=4194303,I=Math.min(d.length,9),k=0;k<I;k++)h.words[k]=d.words[k];if(h.length=I,d.length<=9){d.words[0]=0,d.length=1;return}var O=d.words[9];for(h.words[h.length++]=O&v,k=10;k<d.length;k++){var B=d.words[k]|0;d.words[k-10]=(B&v)<<4|O>>>22,O=B}O>>>=22,d.words[k-10]=O,O===0&&d.length>10?d.length-=10:d.length-=9},D.prototype.imulK=function(d){d.words[d.length]=0,d.words[d.length+1]=0,d.length+=2;for(var h=0,v=0;v<d.length;v++){var I=d.words[v]|0;h+=I*977,d.words[v]=h&67108863,h=I*64+(h/67108864|0)}return d.words[d.length-1]===0&&(d.length--,d.words[d.length-1]===0&&d.length--),d};function F(){z.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(F,z);function $(){z.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i($,z);function V(){z.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(V,z),V.prototype.imulK=function(d){for(var h=0,v=0;v<d.length;v++){var I=(d.words[v]|0)*19+h,k=I&67108863;I>>>=26,d.words[v]=k,h=I}return h!==0&&(d.words[d.length++]=h),d},s._prime=function(d){if(L[d])return L[d];var h;if(d==="k256")h=new D;else if(d==="p224")h=new F;else if(d==="p192")h=new $;else if(d==="p25519")h=new V;else throw new Error("Unknown prime "+d);return L[d]=h,h};function G(N){if(typeof N=="string"){var d=s._prime(N);this.m=d.p,this.prime=d}else r(N.gtn(1),"modulus must be greater than 1"),this.m=N,this.prime=null}G.prototype._verify1=function(d){r(d.negative===0,"red works only with positives"),r(d.red,"red works only with red numbers")},G.prototype._verify2=function(d,h){r((d.negative|h.negative)===0,"red works only with positives"),r(d.red&&d.red===h.red,"red works only with red numbers")},G.prototype.imod=function(d){return this.prime?this.prime.ireduce(d)._forceRed(this):(u(d,d.umod(this.m)._forceRed(this)),d)},G.prototype.neg=function(d){return d.isZero()?d.clone():this.m.sub(d)._forceRed(this)},G.prototype.add=function(d,h){this._verify2(d,h);var v=d.add(h);return v.cmp(this.m)>=0&&v.isub(this.m),v._forceRed(this)},G.prototype.iadd=function(d,h){this._verify2(d,h);var v=d.iadd(h);return v.cmp(this.m)>=0&&v.isub(this.m),v},G.prototype.sub=function(d,h){this._verify2(d,h);var v=d.sub(h);return v.cmpn(0)<0&&v.iadd(this.m),v._forceRed(this)},G.prototype.isub=function(d,h){this._verify2(d,h);var v=d.isub(h);return v.cmpn(0)<0&&v.iadd(this.m),v},G.prototype.shl=function(d,h){return this._verify1(d),this.imod(d.ushln(h))},G.prototype.imul=function(d,h){return this._verify2(d,h),this.imod(d.imul(h))},G.prototype.mul=function(d,h){return this._verify2(d,h),this.imod(d.mul(h))},G.prototype.isqr=function(d){return this.imul(d,d.clone())},G.prototype.sqr=function(d){return this.mul(d,d)},G.prototype.sqrt=function(d){if(d.isZero())return d.clone();var h=this.m.andln(3);if(r(h%2===1),h===3){var v=this.m.add(new s(1)).iushrn(2);return this.pow(d,v)}for(var I=this.m.subn(1),k=0;!I.isZero()&&I.andln(1)===0;)k++,I.iushrn(1);r(!I.isZero());var O=new s(1).toRed(this),B=O.redNeg(),T=this.m.subn(1).iushrn(1),m=this.m.bitLength();for(m=new s(2*m*m).toRed(this);this.pow(m,T).cmp(B)!==0;)m.redIAdd(B);for(var P=this.pow(m,I),ae=this.pow(d,I.addn(1).iushrn(1)),fe=this.pow(d,I),de=k;fe.cmp(O)!==0;){for(var Ce=fe,Re=0;Ce.cmp(O)!==0;Re++)Ce=Ce.redSqr();r(Re<de);var Me=this.pow(P,new s(1).iushln(de-Re-1));ae=ae.redMul(Me),P=Me.redSqr(),fe=fe.redMul(P),de=Re}return ae},G.prototype.invm=function(d){var h=d._invmp(this.m);return h.negative!==0?(h.negative=0,this.imod(h).redNeg()):this.imod(h)},G.prototype.pow=function(d,h){if(h.isZero())return new s(1).toRed(this);if(h.cmpn(1)===0)return d.clone();var v=4,I=new Array(1<<v);I[0]=new s(1).toRed(this),I[1]=d;for(var k=2;k<I.length;k++)I[k]=this.mul(I[k-1],d);var O=I[0],B=0,T=0,m=h.bitLength()%26;for(m===0&&(m=26),k=h.length-1;k>=0;k--){for(var P=h.words[k],ae=m-1;ae>=0;ae--){var fe=P>>ae&1;if(O!==I[0]&&(O=this.sqr(O)),fe===0&&B===0){T=0;continue}B<<=1,B|=fe,T++,!(T!==v&&(k!==0||ae!==0))&&(O=this.mul(O,I[B]),T=0,B=0)}m=26}return O},G.prototype.convertTo=function(d){var h=d.umod(this.m);return h===d?h.clone():h},G.prototype.convertFrom=function(d){var h=d.clone();return h.red=null,h},s.mont=function(d){return new W(d)};function W(N){G.call(this,N),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(W,G),W.prototype.convertTo=function(d){return this.imod(d.ushln(this.shift))},W.prototype.convertFrom=function(d){var h=this.imod(d.mul(this.rinv));return h.red=null,h},W.prototype.imul=function(d,h){if(d.isZero()||h.isZero())return d.words[0]=0,d.length=1,d;var v=d.imul(h),I=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),k=v.isub(I).iushrn(this.shift),O=k;return k.cmp(this.m)>=0?O=k.isub(this.m):k.cmpn(0)<0&&(O=k.iadd(this.m)),O._forceRed(this)},W.prototype.mul=function(d,h){if(d.isZero()||h.isZero())return new s(0)._forceRed(this);var v=d.mul(h),I=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),k=v.isub(I).iushrn(this.shift),O=k;return k.cmp(this.m)>=0?O=k.isub(this.m):k.cmpn(0)<0&&(O=k.iadd(this.m)),O._forceRed(this)},W.prototype.invm=function(d){var h=this.imod(d._invmp(this.m).mul(this.r2));return h._forceRed(this)}})(t,Cr)})(Tw);var Mw=Tw.exports;const ss=Ro(Mw);var Ay={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(t,e){var n=re,r=n.Buffer;function i(o,a){for(var c in o)a[c]=o[c]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=n:(i(n,e),e.Buffer=s);function s(o,a,c){return r(o,a,c)}s.prototype=Object.create(r.prototype),i(r,s),s.from=function(o,a,c){if(typeof o=="number")throw new TypeError("Argument must not be a number");return r(o,a,c)},s.alloc=function(o,a,c){if(typeof o!="number")throw new TypeError("Argument must be a number");var l=r(o);return a!==void 0?typeof c=="string"?l.fill(a,c):l.fill(a):l.fill(0),l},s.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r(o)},s.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(o)}})(Ay,Ay.exports);var XC=Ay.exports,Hd=XC.Buffer;function JC(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),n=0;n<e.length;n++)e[n]=255;for(var r=0;r<t.length;r++){var i=t.charAt(r),s=i.charCodeAt(0);if(e[s]!==255)throw new TypeError(i+" is ambiguous");e[s]=r}var o=t.length,a=t.charAt(0),c=Math.log(o)/Math.log(256),l=Math.log(256)/Math.log(o);function u(p){if((Array.isArray(p)||p instanceof Uint8Array)&&(p=Hd.from(p)),!Hd.isBuffer(p))throw new TypeError("Expected Buffer");if(p.length===0)return"";for(var _=0,A=0,S=0,E=p.length;S!==E&&p[S]===0;)S++,_++;for(var b=(E-S)*l+1>>>0,x=new Uint8Array(b);S!==E;){for(var M=p[S],L=0,z=b-1;(M!==0||L<A)&&z!==-1;z--,L++)M+=256*x[z]>>>0,x[z]=M%o>>>0,M=M/o>>>0;if(M!==0)throw new Error("Non-zero carry");A=L,S++}for(var D=b-A;D!==b&&x[D]===0;)D++;for(var F=a.repeat(_);D<b;++D)F+=t.charAt(x[D]);return F}function f(p){if(typeof p!="string")throw new TypeError("Expected String");if(p.length===0)return Hd.alloc(0);for(var _=0,A=0,S=0;p[_]===a;)A++,_++;for(var E=(p.length-_)*c+1>>>0,b=new Uint8Array(E);_<p.length;){var x=e[p.charCodeAt(_)];if(x===255)return;for(var M=0,L=E-1;(x!==0||M<S)&&L!==-1;L--,M++)x+=o*b[L]>>>0,b[L]=x%256>>>0,x=x/256>>>0;if(x!==0)throw new Error("Non-zero carry");S=M,_++}for(var z=E-S;z!==E&&b[z]===0;)z++;var D=Hd.allocUnsafe(A+(E-z));D.fill(0,0,A);for(var F=A;z!==E;)D[F++]=b[z++];return D}function g(p){var _=f(p);if(_)return _;throw new Error("Non-base"+o+" character")}return{encode:u,decodeUnsafe:f,decode:g}}var eL=JC,tL=eL,nL="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",fA=tL(nL);const jt=Ro(fA),rL=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Ds=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ps=new Uint32Array(64);class iL extends XS{constructor(){super(64,32,8,!1),this.A=Ds[0]|0,this.B=Ds[1]|0,this.C=Ds[2]|0,this.D=Ds[3]|0,this.E=Ds[4]|0,this.F=Ds[5]|0,this.G=Ds[6]|0,this.H=Ds[7]|0}get(){const{A:e,B:n,C:r,D:i,E:s,F:o,G:a,H:c}=this;return[e,n,r,i,s,o,a,c]}set(e,n,r,i,s,o,a,c){this.A=e|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,n){for(let f=0;f<16;f++,n+=4)Ps[f]=e.getUint32(n,!1);for(let f=16;f<64;f++){const g=Ps[f-15],p=Ps[f-2],_=_i(g,7)^_i(g,18)^g>>>3,A=_i(p,17)^_i(p,19)^p>>>10;Ps[f]=A+Ps[f-7]+_+Ps[f-16]|0}let{A:r,B:i,C:s,D:o,E:a,F:c,G:l,H:u}=this;for(let f=0;f<64;f++){const g=_i(a,6)^_i(a,11)^_i(a,25),p=u+g+GO(a,c,l)+rL[f]+Ps[f]|0,A=(_i(r,2)^_i(r,13)^_i(r,22))+YO(r,i,s)|0;u=l,l=c,c=a,a=o+p|0,o=s,s=i,i=r,r=p+A|0}r=r+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(r,i,s,o,a,c,l,u)}roundClean(){Ps.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Iy=Sw(()=>new iL);var Pn={};function os(t,e,n){return e<=t&&t<=n}function ip(t){if(t===void 0)return{};if(t===Object(t))return t;throw TypeError("Could not convert argument to dictionary")}function sL(t){for(var e=String(t),n=e.length,r=0,i=[];r<n;){var s=e.charCodeAt(r);if(s<55296||s>57343)i.push(s);else if(56320<=s&&s<=57343)i.push(65533);else if(55296<=s&&s<=56319)if(r===n-1)i.push(65533);else{var o=t.charCodeAt(r+1);if(56320<=o&&o<=57343){var a=s&1023,c=o&1023;i.push(65536+(a<<10)+c),r+=1}else i.push(65533)}r+=1}return i}function oL(t){for(var e="",n=0;n<t.length;++n){var r=t[n];r<=65535?e+=String.fromCharCode(r):(r-=65536,e+=String.fromCharCode((r>>10)+55296,(r&1023)+56320))}return e}var nh=-1;function Ow(t){this.tokens=[].slice.call(t)}Ow.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():nh},prepend:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.unshift(e.pop());else this.tokens.unshift(t)},push:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.push(e.shift());else this.tokens.push(t)}};var Cc=-1;function j0(t,e){if(t)throw TypeError("Decoder error");return e||65533}var rh="utf-8";function ih(t,e){if(!(this instanceof ih))return new ih(t,e);if(t=t!==void 0?String(t).toLowerCase():rh,t!==rh)throw new Error("Encoding not supported. Only utf-8 is supported");e=ip(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})}ih.prototype={decode:function(e,n){var r;typeof e=="object"&&e instanceof ArrayBuffer?r=new Uint8Array(e):typeof e=="object"&&"buffer"in e&&e.buffer instanceof ArrayBuffer?r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):r=new Uint8Array(0),n=ip(n),this._streaming||(this._decoder=new aL({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!n.stream;for(var i=new Ow(r),s=[],o;!i.endOfStream()&&(o=this._decoder.handler(i,i.read()),o!==Cc);)o!==null&&(Array.isArray(o)?s.push.apply(s,o):s.push(o));if(!this._streaming){do{if(o=this._decoder.handler(i,i.read()),o===Cc)break;o!==null&&(Array.isArray(o)?s.push.apply(s,o):s.push(o))}while(!i.endOfStream());this._decoder=null}return s.length&&["utf-8"].indexOf(this.encoding)!==-1&&!this._ignoreBOM&&!this._BOMseen&&(s[0]===65279?(this._BOMseen=!0,s.shift()):this._BOMseen=!0),oL(s)}};function sh(t,e){if(!(this instanceof sh))return new sh(t,e);if(t=t!==void 0?String(t).toLowerCase():rh,t!==rh)throw new Error("Encoding not supported. Only utf-8 is supported");e=ip(e),this._streaming=!1,this._encoder=null,this._options={fatal:!!e.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}sh.prototype={encode:function(e,n){e=e?String(e):"",n=ip(n),this._streaming||(this._encoder=new cL(this._options)),this._streaming=!!n.stream;for(var r=[],i=new Ow(sL(e)),s;!i.endOfStream()&&(s=this._encoder.handler(i,i.read()),s!==Cc);)Array.isArray(s)?r.push.apply(r,s):r.push(s);if(!this._streaming){for(;s=this._encoder.handler(i,i.read()),s!==Cc;)Array.isArray(s)?r.push.apply(r,s):r.push(s);this._encoder=null}return new Uint8Array(r)}};function aL(t){var e=t.fatal,n=0,r=0,i=0,s=128,o=191;this.handler=function(a,c){if(c===nh&&i!==0)return i=0,j0(e);if(c===nh)return Cc;if(i===0){if(os(c,0,127))return c;if(os(c,194,223))i=1,n=c-192;else if(os(c,224,239))c===224&&(s=160),c===237&&(o=159),i=2,n=c-224;else if(os(c,240,244))c===240&&(s=144),c===244&&(o=143),i=3,n=c-240;else return j0(e);return n=n<<6*i,null}if(!os(c,s,o))return n=i=r=0,s=128,o=191,a.prepend(c),j0(e);if(s=128,o=191,r+=1,n+=c-128<<6*(i-r),r!==i)return null;var l=n;return n=i=r=0,l}}function cL(t){t.fatal,this.handler=function(e,n){if(n===nh)return Cc;if(os(n,0,127))return n;var r,i;os(n,128,2047)?(r=1,i=192):os(n,2048,65535)?(r=2,i=224):os(n,65536,1114111)&&(r=3,i=240);for(var s=[(n>>6*r)+i];r>0;){var o=n>>6*(r-1);s.push(128|o&63),r-=1}return s}}const lL=Object.freeze(Object.defineProperty({__proto__:null,TextDecoder:ih,TextEncoder:sh},Symbol.toStringTag,{value:"Module"})),uL=Ph(lL);var dL=Cr&&Cr.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),fL=Cr&&Cr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Fi=Cr&&Cr.__decorate||function(t,e,n,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,n,s):o(e,n))||s);return i>3&&s&&Object.defineProperty(e,n,s),s},hL=Cr&&Cr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.hasOwnProperty.call(t,n)&&dL(e,t,n);return fL(e,t),e},hA=Cr&&Cr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Pn,"__esModule",{value:!0});var pA=Pn.deserializeUnchecked=vA=Pn.deserialize=_A=Pn.serialize=Pn.BinaryReader=Pn.BinaryWriter=Pn.BorshError=Pn.baseDecode=Pn.baseEncode=void 0;const qs=hA(Mw),gA=hA(fA),pL=hL(uL),gL=typeof TextDecoder!="function"?pL.TextDecoder:TextDecoder,yL=new gL("utf-8",{fatal:!0});function mL(t){return typeof t=="string"&&(t=re.Buffer.from(t,"utf8")),gA.default.encode(re.Buffer.from(t))}Pn.baseEncode=mL;function wL(t){return re.Buffer.from(gA.default.decode(t))}Pn.baseDecode=wL;const U0=1024;class Jn extends Error{constructor(e){super(e),this.fieldPath=[],this.originalMessage=e}addToFieldPath(e){this.fieldPath.splice(0,0,e),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}Pn.BorshError=Jn;class yA{constructor(){this.buf=re.Buffer.alloc(U0),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=re.Buffer.concat([this.buf,re.Buffer.alloc(U0)]))}writeU8(e){this.maybeResize(),this.buf.writeUInt8(e,this.length),this.length+=1}writeU16(e){this.maybeResize(),this.buf.writeUInt16LE(e,this.length),this.length+=2}writeU32(e){this.maybeResize(),this.buf.writeUInt32LE(e,this.length),this.length+=4}writeU64(e){this.maybeResize(),this.writeBuffer(re.Buffer.from(new qs.default(e).toArray("le",8)))}writeU128(e){this.maybeResize(),this.writeBuffer(re.Buffer.from(new qs.default(e).toArray("le",16)))}writeU256(e){this.maybeResize(),this.writeBuffer(re.Buffer.from(new qs.default(e).toArray("le",32)))}writeU512(e){this.maybeResize(),this.writeBuffer(re.Buffer.from(new qs.default(e).toArray("le",64)))}writeBuffer(e){this.buf=re.Buffer.concat([re.Buffer.from(this.buf.subarray(0,this.length)),e,re.Buffer.alloc(U0)]),this.length+=e.length}writeString(e){this.maybeResize();const n=re.Buffer.from(e,"utf8");this.writeU32(n.length),this.writeBuffer(n)}writeFixedArray(e){this.writeBuffer(re.Buffer.from(e))}writeArray(e,n){this.maybeResize(),this.writeU32(e.length);for(const r of e)this.maybeResize(),n(r)}toArray(){return this.buf.subarray(0,this.length)}}Pn.BinaryWriter=yA;function Wi(t,e,n){const r=n.value;n.value=function(...i){try{return r.apply(this,i)}catch(s){if(s instanceof RangeError){const o=s.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(o)>=0)throw new Jn("Reached the end of buffer when deserializing")}throw s}}}class Br{constructor(e){this.buf=e,this.offset=0}readU8(){const e=this.buf.readUInt8(this.offset);return this.offset+=1,e}readU16(){const e=this.buf.readUInt16LE(this.offset);return this.offset+=2,e}readU32(){const e=this.buf.readUInt32LE(this.offset);return this.offset+=4,e}readU64(){const e=this.readBuffer(8);return new qs.default(e,"le")}readU128(){const e=this.readBuffer(16);return new qs.default(e,"le")}readU256(){const e=this.readBuffer(32);return new qs.default(e,"le")}readU512(){const e=this.readBuffer(64);return new qs.default(e,"le")}readBuffer(e){if(this.offset+e>this.buf.length)throw new Jn(`Expected buffer length ${e} isn't within bounds`);const n=this.buf.slice(this.offset,this.offset+e);return this.offset+=e,n}readString(){const e=this.readU32(),n=this.readBuffer(e);try{return yL.decode(n)}catch(r){throw new Jn(`Error decoding UTF-8 string: ${r}`)}}readFixedArray(e){return new Uint8Array(this.readBuffer(e))}readArray(e){const n=this.readU32(),r=Array();for(let i=0;i<n;++i)r.push(e());return r}}Fi([Wi],Br.prototype,"readU8",null);Fi([Wi],Br.prototype,"readU16",null);Fi([Wi],Br.prototype,"readU32",null);Fi([Wi],Br.prototype,"readU64",null);Fi([Wi],Br.prototype,"readU128",null);Fi([Wi],Br.prototype,"readU256",null);Fi([Wi],Br.prototype,"readU512",null);Fi([Wi],Br.prototype,"readString",null);Fi([Wi],Br.prototype,"readFixedArray",null);Fi([Wi],Br.prototype,"readArray",null);Pn.BinaryReader=Br;function mA(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Fo(t,e,n,r,i){try{if(typeof r=="string")i[`write${mA(r)}`](n);else if(r instanceof Array)if(typeof r[0]=="number"){if(n.length!==r[0])throw new Jn(`Expecting byte array of length ${r[0]}, but got ${n.length} bytes`);i.writeFixedArray(n)}else if(r.length===2&&typeof r[1]=="number"){if(n.length!==r[1])throw new Jn(`Expecting byte array of length ${r[1]}, but got ${n.length} bytes`);for(let s=0;s<r[1];s++)Fo(t,null,n[s],r[0],i)}else i.writeArray(n,s=>{Fo(t,e,s,r[0],i)});else if(r.kind!==void 0)switch(r.kind){case"option":{n==null?i.writeU8(0):(i.writeU8(1),Fo(t,e,n,r.type,i));break}case"map":{i.writeU32(n.size),n.forEach((s,o)=>{Fo(t,e,o,r.key,i),Fo(t,e,s,r.value,i)});break}default:throw new Jn(`FieldType ${r} unrecognized`)}else wA(t,n,i)}catch(s){throw s instanceof Jn&&s.addToFieldPath(e),s}}function wA(t,e,n){if(typeof e.borshSerialize=="function"){e.borshSerialize(n);return}const r=t.get(e.constructor);if(!r)throw new Jn(`Class ${e.constructor.name} is missing in schema`);if(r.kind==="struct")r.fields.map(([i,s])=>{Fo(t,i,e[i],s,n)});else if(r.kind==="enum"){const i=e[r.field];for(let s=0;s<r.values.length;++s){const[o,a]=r.values[s];if(o===i){n.writeU8(s),Fo(t,o,e[o],a,n);break}}}else throw new Jn(`Unexpected schema kind: ${r.kind} for ${e.constructor.name}`)}function _L(t,e,n=yA){const r=new n;return wA(t,e,r),r.toArray()}var _A=Pn.serialize=_L;function Wo(t,e,n,r){try{if(typeof n=="string")return r[`read${mA(n)}`]();if(n instanceof Array){if(typeof n[0]=="number")return r.readFixedArray(n[0]);if(typeof n[1]=="number"){const i=[];for(let s=0;s<n[1];s++)i.push(Wo(t,null,n[0],r));return i}else return r.readArray(()=>Wo(t,e,n[0],r))}if(n.kind==="option")return r.readU8()?Wo(t,e,n.type,r):void 0;if(n.kind==="map"){let i=new Map;const s=r.readU32();for(let o=0;o<s;o++){const a=Wo(t,e,n.key,r),c=Wo(t,e,n.value,r);i.set(a,c)}return i}return Cw(t,n,r)}catch(i){throw i instanceof Jn&&i.addToFieldPath(e),i}}function Cw(t,e,n){if(typeof e.borshDeserialize=="function")return e.borshDeserialize(n);const r=t.get(e);if(!r)throw new Jn(`Class ${e.name} is missing in schema`);if(r.kind==="struct"){const i={};for(const[s,o]of t.get(e).fields)i[s]=Wo(t,s,o,n);return new e(i)}if(r.kind==="enum"){const i=n.readU8();if(i>=r.values.length)throw new Jn(`Enum index: ${i} is out of range`);const[s,o]=r.values[i],a=Wo(t,s,o,n);return new e({[s]:a})}throw new Jn(`Unexpected schema kind: ${r.kind} for ${e.constructor.name}`)}function vL(t,e,n,r=Br){const i=new r(n),s=Cw(t,e,i);if(i.offset<n.length)throw new Jn(`Unexpected ${n.length-i.offset} bytes after deserialized data`);return s}var vA=Pn.deserialize=vL;function bL(t,e,n,r=Br){const i=new r(n);return Cw(t,e,i)}pA=Pn.deserializeUnchecked=bL;var X={};Object.defineProperty(X,"__esModule",{value:!0});X.s16=X.s8=X.nu64be=X.u48be=X.u40be=X.u32be=X.u24be=X.u16be=On=X.nu64=X.u48=X.u40=Se=X.u32=X.u24=Ur=X.u16=st=X.u8=ao=X.offset=X.greedy=X.Constant=X.UTF8=X.CString=X.Blob=X.Boolean=X.BitField=X.BitStructure=X.VariantLayout=X.Union=X.UnionLayoutDiscriminator=X.UnionDiscriminator=X.Structure=X.Sequence=X.DoubleBE=X.Double=X.FloatBE=X.Float=X.NearInt64BE=X.NearInt64=X.NearUInt64BE=X.NearUInt64=X.IntBE=X.Int=X.UIntBE=X.UInt=X.OffsetLayout=X.GreedyCount=X.ExternalLayout=X.bindConstructorLayout=X.nameWithProperty=X.Layout=X.uint8ArrayToBuffer=X.checkUint8Array=void 0;X.constant=X.utf8=X.cstr=Tt=X.blob=X.unionLayoutDiscriminator=X.union=Bn=X.seq=X.bits=Ae=X.struct=X.f64be=X.f64=X.f32be=X.f32=X.ns64be=X.s48be=X.s40be=X.s32be=X.s24be=X.s16be=Ar=X.ns64=X.s48=X.s40=X.s32=X.s24=void 0;const Lw=re;function Jc(t){if(!(t instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}X.checkUint8Array=Jc;function ut(t){return Jc(t),Lw.Buffer.from(t.buffer,t.byteOffset,t.length)}X.uint8ArrayToBuffer=ut;let _t=class{constructor(e,n){if(!Number.isInteger(e))throw new TypeError("span must be an integer");this.span=e,this.property=n}makeDestinationObject(){return{}}getSpan(e,n){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(e){const n=Object.create(this.constructor.prototype);return Object.assign(n,this),n.property=e,n}fromArray(e){}};X.Layout=_t;function Dw(t,e){return e.property?t+"["+e.property+"]":t}X.nameWithProperty=Dw;function EL(t,e){if(typeof t!="function")throw new TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(t,"layout_"))throw new Error("Class is already bound to a layout");if(!(e&&e instanceof _t))throw new TypeError("layout must be a Layout");if(Object.prototype.hasOwnProperty.call(e,"boundConstructor_"))throw new Error("layout is already bound to a constructor");t.layout_=e,e.boundConstructor_=t,e.makeDestinationObject=()=>new t,Object.defineProperty(t.prototype,"encode",{value(n,r){return e.encode(this,n,r)},writable:!0}),Object.defineProperty(t,"decode",{value(n,r){return e.decode(n,r)},writable:!0})}X.bindConstructorLayout=EL;let hr=class extends _t{isCount(){throw new Error("ExternalLayout is abstract")}};X.ExternalLayout=hr;let bA=class extends hr{constructor(e=1,n){if(!Number.isInteger(e)||0>=e)throw new TypeError("elementSpan must be a (positive) integer");super(-1,n),this.elementSpan=e}isCount(){return!0}decode(e,n=0){Jc(e);const r=e.length-n;return Math.floor(r/this.elementSpan)}encode(e,n,r){return 0}};X.GreedyCount=bA;let Pw=class extends hr{constructor(e,n=0,r){if(!(e instanceof _t))throw new TypeError("layout must be a Layout");if(!Number.isInteger(n))throw new TypeError("offset must be integer or undefined");super(e.span,r||e.property),this.layout=e,this.offset=n}isCount(){return this.layout instanceof Gr||this.layout instanceof ui}decode(e,n=0){return this.layout.decode(e,n+this.offset)}encode(e,n,r=0){return this.layout.encode(e,n,r+this.offset)}};X.OffsetLayout=Pw;let Gr=class extends _t{constructor(e,n){if(super(e,n),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,n=0){return ut(e).readUIntLE(n,this.span)}encode(e,n,r=0){return ut(n).writeUIntLE(e,r,this.span),this.span}};X.UInt=Gr;let ui=class extends _t{constructor(e,n){if(super(e,n),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,n=0){return ut(e).readUIntBE(n,this.span)}encode(e,n,r=0){return ut(n).writeUIntBE(e,r,this.span),this.span}};X.UIntBE=ui;let Aa=class extends _t{constructor(e,n){if(super(e,n),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,n=0){return ut(e).readIntLE(n,this.span)}encode(e,n,r=0){return ut(n).writeIntLE(e,r,this.span),this.span}};X.Int=Aa;let el=class extends _t{constructor(e,n){if(super(e,n),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,n=0){return ut(e).readIntBE(n,this.span)}encode(e,n,r=0){return ut(n).writeIntBE(e,r,this.span),this.span}};X.IntBE=el;const ky=Math.pow(2,32);function sp(t){const e=Math.floor(t/ky),n=t-e*ky;return{hi32:e,lo32:n}}function op(t,e){return t*ky+e}let EA=class extends _t{constructor(e){super(8,e)}decode(e,n=0){const r=ut(e),i=r.readUInt32LE(n),s=r.readUInt32LE(n+4);return op(s,i)}encode(e,n,r=0){const i=sp(e),s=ut(n);return s.writeUInt32LE(i.lo32,r),s.writeUInt32LE(i.hi32,r+4),8}};X.NearUInt64=EA;let xA=class extends _t{constructor(e){super(8,e)}decode(e,n=0){const r=ut(e),i=r.readUInt32BE(n),s=r.readUInt32BE(n+4);return op(i,s)}encode(e,n,r=0){const i=sp(e),s=ut(n);return s.writeUInt32BE(i.hi32,r),s.writeUInt32BE(i.lo32,r+4),8}};X.NearUInt64BE=xA;let SA=class extends _t{constructor(e){super(8,e)}decode(e,n=0){const r=ut(e),i=r.readUInt32LE(n),s=r.readInt32LE(n+4);return op(s,i)}encode(e,n,r=0){const i=sp(e),s=ut(n);return s.writeUInt32LE(i.lo32,r),s.writeInt32LE(i.hi32,r+4),8}};X.NearInt64=SA;let AA=class extends _t{constructor(e){super(8,e)}decode(e,n=0){const r=ut(e),i=r.readInt32BE(n),s=r.readUInt32BE(n+4);return op(i,s)}encode(e,n,r=0){const i=sp(e),s=ut(n);return s.writeInt32BE(i.hi32,r),s.writeUInt32BE(i.lo32,r+4),8}};X.NearInt64BE=AA;let IA=class extends _t{constructor(e){super(4,e)}decode(e,n=0){return ut(e).readFloatLE(n)}encode(e,n,r=0){return ut(n).writeFloatLE(e,r),4}};X.Float=IA;let kA=class extends _t{constructor(e){super(4,e)}decode(e,n=0){return ut(e).readFloatBE(n)}encode(e,n,r=0){return ut(n).writeFloatBE(e,r),4}};X.FloatBE=kA;let RA=class extends _t{constructor(e){super(8,e)}decode(e,n=0){return ut(e).readDoubleLE(n)}encode(e,n,r=0){return ut(n).writeDoubleLE(e,r),8}};X.Double=RA;let NA=class extends _t{constructor(e){super(8,e)}decode(e,n=0){return ut(e).readDoubleBE(n)}encode(e,n,r=0){return ut(n).writeDoubleBE(e,r),8}};X.DoubleBE=NA;let TA=class extends _t{constructor(e,n,r){if(!(e instanceof _t))throw new TypeError("elementLayout must be a Layout");if(!(n instanceof hr&&n.isCount()||Number.isInteger(n)&&0<=n))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let i=-1;!(n instanceof hr)&&0<e.span&&(i=n*e.span),super(i,r),this.elementLayout=e,this.count=n}getSpan(e,n=0){if(0<=this.span)return this.span;let r=0,i=this.count;if(i instanceof hr&&(i=i.decode(e,n)),0<this.elementLayout.span)r=i*this.elementLayout.span;else{let s=0;for(;s<i;)r+=this.elementLayout.getSpan(e,n+r),++s}return r}decode(e,n=0){const r=[];let i=0,s=this.count;for(s instanceof hr&&(s=s.decode(e,n));i<s;)r.push(this.elementLayout.decode(e,n)),n+=this.elementLayout.getSpan(e,n),i+=1;return r}encode(e,n,r=0){const i=this.elementLayout,s=e.reduce((o,a)=>o+i.encode(a,n,r+o),0);return this.count instanceof hr&&this.count.encode(e.length,n,r),s}};X.Sequence=TA;let MA=class extends _t{constructor(e,n,r){if(!(Array.isArray(e)&&e.reduce((s,o)=>s&&o instanceof _t,!0)))throw new TypeError("fields must be array of Layout instances");typeof n=="boolean"&&r===void 0&&(r=n,n=void 0);for(const s of e)if(0>s.span&&s.property===void 0)throw new Error("fields cannot contain unnamed variable-length layout");let i=-1;try{i=e.reduce((s,o)=>s+o.getSpan(),0)}catch{}super(i,n),this.fields=e,this.decodePrefixes=!!r}getSpan(e,n=0){if(0<=this.span)return this.span;let r=0;try{r=this.fields.reduce((i,s)=>{const o=s.getSpan(e,n);return n+=o,i+o},0)}catch{throw new RangeError("indeterminate span")}return r}decode(e,n=0){Jc(e);const r=this.makeDestinationObject();for(const i of this.fields)if(i.property!==void 0&&(r[i.property]=i.decode(e,n)),n+=i.getSpan(e,n),this.decodePrefixes&&e.length===n)break;return r}encode(e,n,r=0){const i=r;let s=0,o=0;for(const a of this.fields){let c=a.span;if(o=0<c?c:0,a.property!==void 0){const l=e[a.property];l!==void 0&&(o=a.encode(l,n,r),0>c&&(c=a.getSpan(n,r)))}s=r,r+=c}return s+o-i}fromArray(e){const n=this.makeDestinationObject();for(const r of this.fields)r.property!==void 0&&0<e.length&&(n[r.property]=e.shift());return n}layoutFor(e){if(typeof e!="string")throw new TypeError("property must be string");for(const n of this.fields)if(n.property===e)return n}offsetOf(e){if(typeof e!="string")throw new TypeError("property must be string");let n=0;for(const r of this.fields){if(r.property===e)return n;0>r.span?n=-1:0<=n&&(n+=r.span)}}};X.Structure=MA;let Bw=class{constructor(e){this.property=e}decode(e,n){throw new Error("UnionDiscriminator is abstract")}encode(e,n,r){throw new Error("UnionDiscriminator is abstract")}};X.UnionDiscriminator=Bw;let oh=class extends Bw{constructor(e,n){if(!(e instanceof hr&&e.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");super(n||e.property||"variant"),this.layout=e}decode(e,n){return this.layout.decode(e,n)}encode(e,n,r){return this.layout.encode(e,n,r)}};X.UnionLayoutDiscriminator=oh;let zw=class extends _t{constructor(e,n,r){let i;if(e instanceof Gr||e instanceof ui)i=new oh(new Pw(e));else if(e instanceof hr&&e.isCount())i=new oh(e);else if(e instanceof Bw)i=e;else throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(n===void 0&&(n=null),!(n===null||n instanceof _t))throw new TypeError("defaultLayout must be null or a Layout");if(n!==null){if(0>n.span)throw new Error("defaultLayout must have constant span");n.property===void 0&&(n=n.replicate("content"))}let s=-1;n&&(s=n.span,0<=s&&(e instanceof Gr||e instanceof ui)&&(s+=i.layout.span)),super(s,r),this.discriminator=i,this.usesPrefixDiscriminator=e instanceof Gr||e instanceof ui,this.defaultLayout=n,this.registry={};let o=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(a){return o(a)},this.configGetSourceVariant=function(a){o=a.bind(this)}}getSpan(e,n=0){if(0<=this.span)return this.span;const r=this.getVariant(e,n);if(!r)throw new Error("unable to determine span for unrecognized variant");return r.getSpan(e,n)}defaultGetSourceVariant(e){if(Object.prototype.hasOwnProperty.call(e,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(e,this.defaultLayout.property))return;const n=this.registry[e[this.discriminator.property]];if(n&&(!n.layout||n.property&&Object.prototype.hasOwnProperty.call(e,n.property)))return n}else for(const n in this.registry){const r=this.registry[n];if(r.property&&Object.prototype.hasOwnProperty.call(e,r.property))return r}throw new Error("unable to infer src variant")}decode(e,n=0){let r;const i=this.discriminator,s=i.decode(e,n),o=this.registry[s];if(o===void 0){const a=this.defaultLayout;let c=0;this.usesPrefixDiscriminator&&(c=i.layout.span),r=this.makeDestinationObject(),r[i.property]=s,r[a.property]=a.decode(e,n+c)}else r=o.decode(e,n);return r}encode(e,n,r=0){const i=this.getSourceVariant(e);if(i===void 0){const s=this.discriminator,o=this.defaultLayout;let a=0;return this.usesPrefixDiscriminator&&(a=s.layout.span),s.encode(e[s.property],n,r),a+o.encode(e[o.property],n,r+a)}return i.encode(e,n,r)}addVariant(e,n,r){const i=new OA(this,e,n,r);return this.registry[e]=i,i}getVariant(e,n=0){let r;return e instanceof Uint8Array?r=this.discriminator.decode(e,n):r=e,this.registry[r]}};X.Union=zw;let OA=class extends _t{constructor(e,n,r,i){if(!(e instanceof zw))throw new TypeError("union must be a Union");if(!Number.isInteger(n)||0>n)throw new TypeError("variant must be a (non-negative) integer");if(typeof r=="string"&&i===void 0&&(i=r,r=null),r){if(!(r instanceof _t))throw new TypeError("layout must be a Layout");if(e.defaultLayout!==null&&0<=r.span&&r.span>e.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if(typeof i!="string")throw new TypeError("variant must have a String property")}let s=e.span;0>e.span&&(s=r?r.span:0,0<=s&&e.usesPrefixDiscriminator&&(s+=e.discriminator.layout.span)),super(s,i),this.union=e,this.variant=n,this.layout=r||null}getSpan(e,n=0){if(0<=this.span)return this.span;let r=0;this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span);let i=0;return this.layout&&(i=this.layout.getSpan(e,n+r)),r+i}decode(e,n=0){const r=this.makeDestinationObject();if(this!==this.union.getVariant(e,n))throw new Error("variant mismatch");let i=0;return this.union.usesPrefixDiscriminator&&(i=this.union.discriminator.layout.span),this.layout?r[this.property]=this.layout.decode(e,n+i):this.property?r[this.property]=!0:this.union.usesPrefixDiscriminator&&(r[this.union.discriminator.property]=this.variant),r}encode(e,n,r=0){let i=0;if(this.union.usesPrefixDiscriminator&&(i=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(e,this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,n,r);let s=i;if(this.layout&&(this.layout.encode(e[this.property],n,r+i),s+=this.layout.getSpan(n,r+i),0<=this.union.span&&s>this.union.span))throw new Error("encoded variant overruns containing union");return s}fromArray(e){if(this.layout)return this.layout.fromArray(e)}};X.VariantLayout=OA;function za(t){return 0>t&&(t+=4294967296),t}let jw=class extends _t{constructor(e,n,r){if(!(e instanceof Gr||e instanceof ui))throw new TypeError("word must be a UInt or UIntBE layout");if(typeof n=="string"&&r===void 0&&(r=n,n=!1),4<e.span)throw new RangeError("word cannot exceed 32 bits");super(e.span,r),this.word=e,this.msb=!!n,this.fields=[];let i=0;this._packedSetValue=function(s){return i=za(s),this},this._packedGetValue=function(){return i}}decode(e,n=0){const r=this.makeDestinationObject(),i=this.word.decode(e,n);this._packedSetValue(i);for(const s of this.fields)s.property!==void 0&&(r[s.property]=s.decode(e));return r}encode(e,n,r=0){const i=this.word.decode(n,r);this._packedSetValue(i);for(const s of this.fields)if(s.property!==void 0){const o=e[s.property];o!==void 0&&s.encode(o)}return this.word.encode(this._packedGetValue(),n,r)}addField(e,n){const r=new Uw(this,e,n);return this.fields.push(r),r}addBoolean(e){const n=new CA(this,e);return this.fields.push(n),n}fieldFor(e){if(typeof e!="string")throw new TypeError("property must be string");for(const n of this.fields)if(n.property===e)return n}};X.BitStructure=jw;let Uw=class{constructor(e,n,r){if(!(e instanceof jw))throw new TypeError("container must be a BitStructure");if(!Number.isInteger(n)||0>=n)throw new TypeError("bits must be positive integer");const i=8*e.span,s=e.fields.reduce((o,a)=>o+a.bits,0);if(n+s>i)throw new Error("bits too long for span remainder ("+(i-s)+" of "+i+" remain)");this.container=e,this.bits=n,this.valueMask=(1<<n)-1,n===32&&(this.valueMask=4294967295),this.start=s,this.container.msb&&(this.start=i-s-n),this.wordMask=za(this.valueMask<<this.start),this.property=r}decode(e,n){const r=this.container._packedGetValue();return za(r&this.wordMask)>>>this.start}encode(e){if(typeof e!="number"||!Number.isInteger(e)||e!==za(e&this.valueMask))throw new TypeError(Dw("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);const n=this.container._packedGetValue(),r=za(e<<this.start);this.container._packedSetValue(za(n&~this.wordMask)|r)}};X.BitField=Uw;let CA=class extends Uw{constructor(e,n){super(e,1,n)}decode(e,n){return!!super.decode(e,n)}encode(e){typeof e=="boolean"&&(e=+e),super.encode(e)}};X.Boolean=CA;let LA=class extends _t{constructor(e,n){if(!(e instanceof hr&&e.isCount()||Number.isInteger(e)&&0<=e))throw new TypeError("length must be positive integer or an unsigned integer ExternalLayout");let r=-1;e instanceof hr||(r=e),super(r,n),this.length=e}getSpan(e,n){let r=this.span;return 0>r&&(r=this.length.decode(e,n)),r}decode(e,n=0){let r=this.span;return 0>r&&(r=this.length.decode(e,n)),ut(e).slice(n,n+r)}encode(e,n,r){let i=this.length;if(this.length instanceof hr&&(i=e.length),!(e instanceof Uint8Array&&i===e.length))throw new TypeError(Dw("Blob.encode",this)+" requires (length "+i+") Uint8Array as src");if(r+i>n.length)throw new RangeError("encoding overruns Uint8Array");const s=ut(e);return ut(n).write(s.toString("hex"),r,i,"hex"),this.length instanceof hr&&this.length.encode(i,n,r),i}};X.Blob=LA;let DA=class extends _t{constructor(e){super(-1,e)}getSpan(e,n=0){Jc(e);let r=n;for(;r<e.length&&e[r]!==0;)r+=1;return 1+r-n}decode(e,n=0){const r=this.getSpan(e,n);return ut(e).slice(n,n+r-1).toString("utf-8")}encode(e,n,r=0){typeof e!="string"&&(e=String(e));const i=Lw.Buffer.from(e,"utf8"),s=i.length;if(r+s>n.length)throw new RangeError("encoding overruns Buffer");const o=ut(n);return i.copy(o,r),o[r+s]=0,s+1}};X.CString=DA;let PA=class extends _t{constructor(e,n){if(typeof e=="string"&&n===void 0&&(n=e,e=void 0),e===void 0)e=-1;else if(!Number.isInteger(e))throw new TypeError("maxSpan must be an integer");super(-1,n),this.maxSpan=e}getSpan(e,n=0){return Jc(e),e.length-n}decode(e,n=0){const r=this.getSpan(e,n);if(0<=this.maxSpan&&this.maxSpan<r)throw new RangeError("text length exceeds maxSpan");return ut(e).slice(n,n+r).toString("utf-8")}encode(e,n,r=0){typeof e!="string"&&(e=String(e));const i=Lw.Buffer.from(e,"utf8"),s=i.length;if(0<=this.maxSpan&&this.maxSpan<s)throw new RangeError("text length exceeds maxSpan");if(r+s>n.length)throw new RangeError("encoding overruns Buffer");return i.copy(ut(n),r),s}};X.UTF8=PA;let BA=class extends _t{constructor(e,n){super(0,n),this.value=e}decode(e,n){return this.value}encode(e,n,r){return 0}};X.Constant=BA;X.greedy=(t,e)=>new bA(t,e);var ao=X.offset=(t,e,n)=>new Pw(t,e,n),st=X.u8=t=>new Gr(1,t),Ur=X.u16=t=>new Gr(2,t);X.u24=t=>new Gr(3,t);var Se=X.u32=t=>new Gr(4,t);X.u40=t=>new Gr(5,t);X.u48=t=>new Gr(6,t);var On=X.nu64=t=>new EA(t);X.u16be=t=>new ui(2,t);X.u24be=t=>new ui(3,t);X.u32be=t=>new ui(4,t);X.u40be=t=>new ui(5,t);X.u48be=t=>new ui(6,t);X.nu64be=t=>new xA(t);X.s8=t=>new Aa(1,t);X.s16=t=>new Aa(2,t);X.s24=t=>new Aa(3,t);X.s32=t=>new Aa(4,t);X.s40=t=>new Aa(5,t);X.s48=t=>new Aa(6,t);var Ar=X.ns64=t=>new SA(t);X.s16be=t=>new el(2,t);X.s24be=t=>new el(3,t);X.s32be=t=>new el(4,t);X.s40be=t=>new el(5,t);X.s48be=t=>new el(6,t);X.ns64be=t=>new AA(t);X.f32=t=>new IA(t);X.f32be=t=>new kA(t);X.f64=t=>new RA(t);X.f64be=t=>new NA(t);var Ae=X.struct=(t,e,n)=>new MA(t,e,n);X.bits=(t,e,n)=>new jw(t,e,n);var Bn=X.seq=(t,e,n)=>new TA(t,e,n);X.union=(t,e,n)=>new zw(t,e,n);X.unionLayoutDiscriminator=(t,e)=>new oh(t,e);var Tt=X.blob=(t,e)=>new LA(t,e);X.cstr=t=>new DA(t);X.utf8=(t,e)=>new PA(t,e);X.constant=(t,e)=>new BA(t,e);var id={};Object.defineProperty(id,"__esModule",{value:!0});function xL(t){{const e=re.Buffer.from(t);e.reverse();const n=e.toString("hex");return n.length===0?BigInt(0):BigInt(`0x${n}`)}}var SL=id.toBigIntLE=xL;function AL(t){{const e=t.toString("hex");return e.length===0?BigInt(0):BigInt(`0x${e}`)}}id.toBigIntBE=AL;function IL(t,e){{const n=t.toString(16),r=re.Buffer.from(n.padStart(e*2,"0").slice(0,e*2),"hex");return r.reverse(),r}}var zA=id.toBufferLE=IL;function kL(t,e){{const n=t.toString(16);return re.Buffer.from(n.padStart(e*2,"0").slice(0,e*2),"hex")}}id.toBufferBE=kL;let RL=class extends TypeError{constructor(e,n){let r;const{message:i,explanation:s,...o}=e,{path:a}=e,c=a.length===0?i:`At path: ${a.join(".")} -- ${i}`;super(s??c),s!=null&&(this.cause=c),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>r??(r=[e,...n()])}};function NL(t){return sd(t)&&typeof t[Symbol.iterator]=="function"}function sd(t){return typeof t=="object"&&t!=null}function ah(t){return sd(t)&&!Array.isArray(t)}function hi(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function TL(t){const{done:e,value:n}=t.next();return e?void 0:n}function ML(t,e,n,r){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:i,branch:s}=e,{type:o}=n,{refinement:a,message:c=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${hi(r)}\``}=t;return{value:r,type:o,refinement:a,key:i[i.length-1],path:i,branch:s,...t,message:c}}function*y1(t,e,n,r){NL(t)||(t=[t]);for(const i of t){const s=ML(i,e,n,r);s&&(yield s)}}function*Fw(t,e,n={}){const{path:r=[],branch:i=[t],coerce:s=!1,mask:o=!1}=n,a={path:r,branch:i,mask:o};s&&(t=e.coercer(t,a));let c="valid";for(const l of e.validator(t,a))l.explanation=n.message,c="not_valid",yield[l,void 0];for(let[l,u,f]of e.entries(t,a)){const g=Fw(u,f,{path:l===void 0?r:[...r,l],branch:l===void 0?i:[...i,u],coerce:s,mask:o,message:n.message});for(const p of g)p[0]?(c=p[0].refinement!=null?"not_refined":"not_valid",yield[p[0],void 0]):s&&(u=p[1],l===void 0?t=u:t instanceof Map?t.set(l,u):t instanceof Set?t.add(u):sd(t)&&(u!==void 0||l in t)&&(t[l]=u))}if(c!=="not_valid")for(const l of e.refiner(t,a))l.explanation=n.message,c="not_refined",yield[l,void 0];c==="valid"&&(yield[void 0,t])}let Hi=class{constructor(e){const{type:n,schema:r,validator:i,refiner:s,coercer:o=c=>c,entries:a=function*(){}}=e;this.type=n,this.schema=r,this.entries=a,this.coercer=o,i?this.validator=(c,l)=>{const u=i(c,l);return y1(u,l,this,c)}:this.validator=()=>[],s?this.refiner=(c,l)=>{const u=s(c,l);return y1(u,l,this,c)}:this.refiner=()=>[]}assert(e,n){return jA(e,this,n)}create(e,n){return ye(e,this,n)}is(e){return UA(e,this)}mask(e,n){return OL(e,this,n)}validate(e,n={}){return od(e,this,n)}};function jA(t,e,n){const r=od(t,e,{message:n});if(r[0])throw r[0]}function ye(t,e,n){const r=od(t,e,{coerce:!0,message:n});if(r[0])throw r[0];return r[1]}function OL(t,e,n){const r=od(t,e,{coerce:!0,mask:!0,message:n});if(r[0])throw r[0];return r[1]}function UA(t,e){return!od(t,e)[0]}function od(t,e,n={}){const r=Fw(t,e,n),i=TL(r);return i[0]?[new RL(i[0],function*(){for(const o of r)o[0]&&(yield o[0])}),void 0]:[void 0,i[1]]}function Ia(t,e){return new Hi({type:t,schema:null,validator:e})}function CL(){return Ia("any",()=>!0)}function we(t){return new Hi({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[n,r]of e.entries())yield[n,r,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${hi(e)}`}})}function Bi(){return Ia("boolean",t=>typeof t=="boolean")}function Ww(t){return Ia("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${hi(e)}`)}function Bt(t){const e=hi(t),n=typeof t;return new Hi({type:"literal",schema:n==="string"||n==="number"||n==="boolean"?t:null,validator(r){return r===t||`Expected the literal \`${e}\`, but received: ${hi(r)}`}})}function LL(){return Ia("never",()=>!1)}function _e(t){return new Hi({...t,validator:(e,n)=>e===null||t.validator(e,n),refiner:(e,n)=>e===null||t.refiner(e,n)})}function K(){return Ia("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${hi(t)}`)}function Oe(t){return new Hi({...t,validator:(e,n)=>e===void 0||t.validator(e,n),refiner:(e,n)=>e===void 0||t.refiner(e,n)})}function FA(t,e){return new Hi({type:"record",schema:null,*entries(n){if(sd(n))for(const r in n){const i=n[r];yield[r,r,t],yield[r,i,e]}},validator(n){return ah(n)||`Expected an object, but received: ${hi(n)}`},coercer(n){return ah(n)?{...n}:n}})}function he(){return Ia("string",t=>typeof t=="string"||`Expected a string, but received: ${hi(t)}`)}function Hw(t){const e=LL();return new Hi({type:"tuple",schema:null,*entries(n){if(Array.isArray(n)){const r=Math.max(t.length,n.length);for(let i=0;i<r;i++)yield[i,n[i],t[i]||e]}},validator(n){return Array.isArray(n)||`Expected an array, but received: ${hi(n)}`},coercer(n){return Array.isArray(n)?n.slice():n}})}function se(t){const e=Object.keys(t);return new Hi({type:"type",schema:t,*entries(n){if(sd(n))for(const r of e)yield[r,n[r],t[r]]},validator(n){return ah(n)||`Expected an object, but received: ${hi(n)}`},coercer(n){return ah(n)?{...n}:n}})}function nr(t){const e=t.map(n=>n.type).join(" | ");return new Hi({type:"union",schema:null,coercer(n,r){for(const i of t){const[s,o]=i.validate(n,{coerce:!0,mask:r.mask});if(!s)return o}return n},validator(n,r){const i=[];for(const s of t){const[...o]=Fw(n,s,r),[a]=o;if(a[0])for(const[c]of o)c&&i.push(c);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${hi(n)}`,...i]}})}function tl(){return Ia("unknown",()=>!0)}function ad(t,e,n){return new Hi({...t,coercer:(r,i)=>UA(r,e)?t.coercer(n(r,i),i):t.coercer(r,i)})}var $d,DL=new Uint8Array(16);function WA(){if(!$d&&($d=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!$d))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return $d(DL)}const PL=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function ap(t){return typeof t=="string"&&PL.test(t)}var Mn=[];for(var F0=0;F0<256;++F0)Mn.push((F0+256).toString(16).substr(1));function cp(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(Mn[t[e+0]]+Mn[t[e+1]]+Mn[t[e+2]]+Mn[t[e+3]]+"-"+Mn[t[e+4]]+Mn[t[e+5]]+"-"+Mn[t[e+6]]+Mn[t[e+7]]+"-"+Mn[t[e+8]]+Mn[t[e+9]]+"-"+Mn[t[e+10]]+Mn[t[e+11]]+Mn[t[e+12]]+Mn[t[e+13]]+Mn[t[e+14]]+Mn[t[e+15]]).toLowerCase();if(!ap(n))throw TypeError("Stringified UUID is invalid");return n}var m1,W0,H0=0,$0=0;function BL(t,e,n){var r=e&&n||0,i=e||new Array(16);t=t||{};var s=t.node||m1,o=t.clockseq!==void 0?t.clockseq:W0;if(s==null||o==null){var a=t.random||(t.rng||WA)();s==null&&(s=m1=[a[0]|1,a[1],a[2],a[3],a[4],a[5]]),o==null&&(o=W0=(a[6]<<8|a[7])&16383)}var c=t.msecs!==void 0?t.msecs:Date.now(),l=t.nsecs!==void 0?t.nsecs:$0+1,u=c-H0+(l-$0)/1e4;if(u<0&&t.clockseq===void 0&&(o=o+1&16383),(u<0||c>H0)&&t.nsecs===void 0&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");H0=c,$0=l,W0=o,c+=122192928e5;var f=((c&268435455)*1e4+l)%4294967296;i[r++]=f>>>24&255,i[r++]=f>>>16&255,i[r++]=f>>>8&255,i[r++]=f&255;var g=c/4294967296*1e4&268435455;i[r++]=g>>>8&255,i[r++]=g&255,i[r++]=g>>>24&15|16,i[r++]=g>>>16&255,i[r++]=o>>>8|128,i[r++]=o&255;for(var p=0;p<6;++p)i[r+p]=s[p];return e||cp(i)}function HA(t){if(!ap(t))throw TypeError("Invalid UUID");var e,n=new Uint8Array(16);return n[0]=(e=parseInt(t.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=e&255,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=e&255,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=e&255,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=e&255,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=e&255,n}function zL(t){t=unescape(encodeURIComponent(t));for(var e=[],n=0;n<t.length;++n)e.push(t.charCodeAt(n));return e}var jL="6ba7b810-9dad-11d1-80b4-00c04fd430c8",UL="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function $A(t,e,n){function r(i,s,o,a){if(typeof i=="string"&&(i=zL(i)),typeof s=="string"&&(s=HA(s)),s.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var c=new Uint8Array(16+i.length);if(c.set(s),c.set(i,s.length),c=n(c),c[6]=c[6]&15|e,c[8]=c[8]&63|128,o){a=a||0;for(var l=0;l<16;++l)o[a+l]=c[l];return o}return cp(c)}try{r.name=t}catch{}return r.DNS=jL,r.URL=UL,r}function FL(t){if(typeof t=="string"){var e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(var n=0;n<e.length;++n)t[n]=e.charCodeAt(n)}return WL(HL($L(t),t.length*8))}function WL(t){for(var e=[],n=t.length*32,r="0123456789abcdef",i=0;i<n;i+=8){var s=t[i>>5]>>>i%32&255,o=parseInt(r.charAt(s>>>4&15)+r.charAt(s&15),16);e.push(o)}return e}function VA(t){return(t+64>>>9<<4)+14+1}function HL(t,e){t[e>>5]|=128<<e%32,t[VA(e)-1]=e;for(var n=1732584193,r=-271733879,i=-1732584194,s=271733878,o=0;o<t.length;o+=16){var a=n,c=r,l=i,u=s;n=Wn(n,r,i,s,t[o],7,-680876936),s=Wn(s,n,r,i,t[o+1],12,-389564586),i=Wn(i,s,n,r,t[o+2],17,606105819),r=Wn(r,i,s,n,t[o+3],22,-1044525330),n=Wn(n,r,i,s,t[o+4],7,-176418897),s=Wn(s,n,r,i,t[o+5],12,1200080426),i=Wn(i,s,n,r,t[o+6],17,-1473231341),r=Wn(r,i,s,n,t[o+7],22,-45705983),n=Wn(n,r,i,s,t[o+8],7,1770035416),s=Wn(s,n,r,i,t[o+9],12,-1958414417),i=Wn(i,s,n,r,t[o+10],17,-42063),r=Wn(r,i,s,n,t[o+11],22,-1990404162),n=Wn(n,r,i,s,t[o+12],7,1804603682),s=Wn(s,n,r,i,t[o+13],12,-40341101),i=Wn(i,s,n,r,t[o+14],17,-1502002290),r=Wn(r,i,s,n,t[o+15],22,1236535329),n=Hn(n,r,i,s,t[o+1],5,-165796510),s=Hn(s,n,r,i,t[o+6],9,-1069501632),i=Hn(i,s,n,r,t[o+11],14,643717713),r=Hn(r,i,s,n,t[o],20,-373897302),n=Hn(n,r,i,s,t[o+5],5,-701558691),s=Hn(s,n,r,i,t[o+10],9,38016083),i=Hn(i,s,n,r,t[o+15],14,-660478335),r=Hn(r,i,s,n,t[o+4],20,-405537848),n=Hn(n,r,i,s,t[o+9],5,568446438),s=Hn(s,n,r,i,t[o+14],9,-1019803690),i=Hn(i,s,n,r,t[o+3],14,-187363961),r=Hn(r,i,s,n,t[o+8],20,1163531501),n=Hn(n,r,i,s,t[o+13],5,-1444681467),s=Hn(s,n,r,i,t[o+2],9,-51403784),i=Hn(i,s,n,r,t[o+7],14,1735328473),r=Hn(r,i,s,n,t[o+12],20,-1926607734),n=$n(n,r,i,s,t[o+5],4,-378558),s=$n(s,n,r,i,t[o+8],11,-2022574463),i=$n(i,s,n,r,t[o+11],16,1839030562),r=$n(r,i,s,n,t[o+14],23,-35309556),n=$n(n,r,i,s,t[o+1],4,-1530992060),s=$n(s,n,r,i,t[o+4],11,1272893353),i=$n(i,s,n,r,t[o+7],16,-155497632),r=$n(r,i,s,n,t[o+10],23,-1094730640),n=$n(n,r,i,s,t[o+13],4,681279174),s=$n(s,n,r,i,t[o],11,-358537222),i=$n(i,s,n,r,t[o+3],16,-722521979),r=$n(r,i,s,n,t[o+6],23,76029189),n=$n(n,r,i,s,t[o+9],4,-640364487),s=$n(s,n,r,i,t[o+12],11,-421815835),i=$n(i,s,n,r,t[o+15],16,530742520),r=$n(r,i,s,n,t[o+2],23,-995338651),n=Vn(n,r,i,s,t[o],6,-198630844),s=Vn(s,n,r,i,t[o+7],10,1126891415),i=Vn(i,s,n,r,t[o+14],15,-1416354905),r=Vn(r,i,s,n,t[o+5],21,-57434055),n=Vn(n,r,i,s,t[o+12],6,1700485571),s=Vn(s,n,r,i,t[o+3],10,-1894986606),i=Vn(i,s,n,r,t[o+10],15,-1051523),r=Vn(r,i,s,n,t[o+1],21,-2054922799),n=Vn(n,r,i,s,t[o+8],6,1873313359),s=Vn(s,n,r,i,t[o+15],10,-30611744),i=Vn(i,s,n,r,t[o+6],15,-1560198380),r=Vn(r,i,s,n,t[o+13],21,1309151649),n=Vn(n,r,i,s,t[o+4],6,-145523070),s=Vn(s,n,r,i,t[o+11],10,-1120210379),i=Vn(i,s,n,r,t[o+2],15,718787259),r=Vn(r,i,s,n,t[o+9],21,-343485551),n=Qs(n,a),r=Qs(r,c),i=Qs(i,l),s=Qs(s,u)}return[n,r,i,s]}function $L(t){if(t.length===0)return[];for(var e=t.length*8,n=new Uint32Array(VA(e)),r=0;r<e;r+=8)n[r>>5]|=(t[r/8]&255)<<r%32;return n}function Qs(t,e){var n=(t&65535)+(e&65535),r=(t>>16)+(e>>16)+(n>>16);return r<<16|n&65535}function VL(t,e){return t<<e|t>>>32-e}function lp(t,e,n,r,i,s){return Qs(VL(Qs(Qs(e,t),Qs(r,s)),i),n)}function Wn(t,e,n,r,i,s,o){return lp(e&n|~e&r,t,e,i,s,o)}function Hn(t,e,n,r,i,s,o){return lp(e&r|n&~r,t,e,i,s,o)}function $n(t,e,n,r,i,s,o){return lp(e^n^r,t,e,i,s,o)}function Vn(t,e,n,r,i,s,o){return lp(n^(e|~r),t,e,i,s,o)}var ZL=$A("v3",48,FL);function KL(t,e,n){t=t||{};var r=t.random||(t.rng||WA)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){n=n||0;for(var i=0;i<16;++i)e[n+i]=r[i];return e}return cp(r)}function GL(t,e,n,r){switch(t){case 0:return e&n^~e&r;case 1:return e^n^r;case 2:return e&n^e&r^n&r;case 3:return e^n^r}}function V0(t,e){return t<<e|t>>>32-e}function YL(t){var e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof t=="string"){var r=unescape(encodeURIComponent(t));t=[];for(var i=0;i<r.length;++i)t.push(r.charCodeAt(i))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);for(var s=t.length/4+2,o=Math.ceil(s/16),a=new Array(o),c=0;c<o;++c){for(var l=new Uint32Array(16),u=0;u<16;++u)l[u]=t[c*64+u*4]<<24|t[c*64+u*4+1]<<16|t[c*64+u*4+2]<<8|t[c*64+u*4+3];a[c]=l}a[o-1][14]=(t.length-1)*8/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][14]),a[o-1][15]=(t.length-1)*8&4294967295;for(var f=0;f<o;++f){for(var g=new Uint32Array(80),p=0;p<16;++p)g[p]=a[f][p];for(var _=16;_<80;++_)g[_]=V0(g[_-3]^g[_-8]^g[_-14]^g[_-16],1);for(var A=n[0],S=n[1],E=n[2],b=n[3],x=n[4],M=0;M<80;++M){var L=Math.floor(M/20),z=V0(A,5)+GL(L,S,E,b)+x+e[L]+g[M]>>>0;x=b,b=E,E=V0(S,30)>>>0,S=A,A=z}n[0]=n[0]+A>>>0,n[1]=n[1]+S>>>0,n[2]=n[2]+E>>>0,n[3]=n[3]+b>>>0,n[4]=n[4]+x>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,n[0]&255,n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,n[1]&255,n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,n[2]&255,n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,n[3]&255,n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,n[4]&255]}var qL=$A("v5",80,YL);const QL="00000000-0000-0000-0000-000000000000";function XL(t){if(!ap(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}const JL=Object.freeze(Object.defineProperty({__proto__:null,NIL:QL,parse:HA,stringify:cp,v1:BL,v3:ZL,v4:KL,v5:qL,validate:ap,version:XL},Symbol.toStringTag,{value:"Module"})),ZA=Ph(JL),e4=ZA.v4,t4=function(t,e,n,r){if(typeof t!="string")throw new TypeError(t+" must be a string");r=r||{};const i=typeof r.version=="number"?r.version:2;if(i!==1&&i!==2)throw new TypeError(i+" must be 1 or 2");const s={method:t};if(i===2&&(s.jsonrpc="2.0"),e){if(typeof e!="object"&&!Array.isArray(e))throw new TypeError(e+" must be an object, array or omitted");s.params=e}if(typeof n>"u"){const o=typeof r.generator=="function"?r.generator:function(){return e4()};s.id=o(s,r)}else i===2&&n===null?r.notificationIdNull&&(s.id=null):s.id=n;return s};var n4=t4;const r4=ZA.v4,i4=n4,Eu=function(t,e){if(!(this instanceof Eu))return new Eu(t,e);e||(e={}),this.options={reviver:typeof e.reviver<"u"?e.reviver:null,replacer:typeof e.replacer<"u"?e.replacer:null,generator:typeof e.generator<"u"?e.generator:function(){return r4()},version:typeof e.version<"u"?e.version:2,notificationIdNull:typeof e.notificationIdNull=="boolean"?e.notificationIdNull:!1},this.callServer=t};var s4=Eu;Eu.prototype.request=function(t,e,n,r){const i=this;let s=null;const o=Array.isArray(t)&&typeof e=="function";if(this.options.version===1&&o)throw new TypeError("JSON-RPC 1.0 does not support batching");if(o||!o&&t&&typeof t=="object"&&typeof e=="function")r=e,s=t;else{typeof n=="function"&&(r=n,n=void 0);const l=typeof r=="function";try{s=i4(t,e,n,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(u){if(l)return r(u);throw u}if(!l)return s}let c;try{c=JSON.stringify(s,this.options.replacer)}catch(l){return r(l)}return this.callServer(c,function(l,u){i._parseResponse(l,u,r)}),s};Eu.prototype._parseResponse=function(t,e,n){if(t){n(t);return}if(!e)return n();let r;try{r=JSON.parse(e,this.options.reviver)}catch(i){return n(i)}if(n.length===3)if(Array.isArray(r)){const i=function(o){return typeof o.error<"u"},s=function(o){return!i(o)};return n(null,r.filter(i),r.filter(s))}else return n(null,r.error,r.result);n(null,r)};const o4=Ro(s4);var KA={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(c,l,u){this.fn=c,this.context=l,this.once=u||!1}function s(c,l,u,f,g){if(typeof u!="function")throw new TypeError("The listener must be a function");var p=new i(u,f||c,g),_=n?n+l:l;return c._events[_]?c._events[_].fn?c._events[_]=[c._events[_],p]:c._events[_].push(p):(c._events[_]=p,c._eventsCount++),c}function o(c,l){--c._eventsCount===0?c._events=new r:delete c._events[l]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],u,f;if(this._eventsCount===0)return l;for(f in u=this._events)e.call(u,f)&&l.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(u)):l},a.prototype.listeners=function(l){var u=n?n+l:l,f=this._events[u];if(!f)return[];if(f.fn)return[f.fn];for(var g=0,p=f.length,_=new Array(p);g<p;g++)_[g]=f[g].fn;return _},a.prototype.listenerCount=function(l){var u=n?n+l:l,f=this._events[u];return f?f.fn?1:f.length:0},a.prototype.emit=function(l,u,f,g,p,_){var A=n?n+l:l;if(!this._events[A])return!1;var S=this._events[A],E=arguments.length,b,x;if(S.fn){switch(S.once&&this.removeListener(l,S.fn,void 0,!0),E){case 1:return S.fn.call(S.context),!0;case 2:return S.fn.call(S.context,u),!0;case 3:return S.fn.call(S.context,u,f),!0;case 4:return S.fn.call(S.context,u,f,g),!0;case 5:return S.fn.call(S.context,u,f,g,p),!0;case 6:return S.fn.call(S.context,u,f,g,p,_),!0}for(x=1,b=new Array(E-1);x<E;x++)b[x-1]=arguments[x];S.fn.apply(S.context,b)}else{var M=S.length,L;for(x=0;x<M;x++)switch(S[x].once&&this.removeListener(l,S[x].fn,void 0,!0),E){case 1:S[x].fn.call(S[x].context);break;case 2:S[x].fn.call(S[x].context,u);break;case 3:S[x].fn.call(S[x].context,u,f);break;case 4:S[x].fn.call(S[x].context,u,f,g);break;default:if(!b)for(L=1,b=new Array(E-1);L<E;L++)b[L-1]=arguments[L];S[x].fn.apply(S[x].context,b)}}return!0},a.prototype.on=function(l,u,f){return s(this,l,u,f,!1)},a.prototype.once=function(l,u,f){return s(this,l,u,f,!0)},a.prototype.removeListener=function(l,u,f,g){var p=n?n+l:l;if(!this._events[p])return this;if(!u)return o(this,p),this;var _=this._events[p];if(_.fn)_.fn===u&&(!g||_.once)&&(!f||_.context===f)&&o(this,p);else{for(var A=0,S=[],E=_.length;A<E;A++)(_[A].fn!==u||g&&!_[A].once||f&&_[A].context!==f)&&S.push(_[A]);S.length?this._events[p]=S.length===1?S[0]:S:o(this,p)}return this},a.prototype.removeAllListeners=function(l){var u;return l?(u=n?n+l:l,this._events[u]&&o(this,u)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,t.exports=a})(KA);var a4=KA.exports;const GA=Ro(a4);var c4=class extends GA{constructor(e,n,r){super();En(this,"socket");this.socket=new window.WebSocket(e,r),this.socket.onopen=()=>this.emit("open"),this.socket.onmessage=i=>this.emit("message",i.data),this.socket.onerror=i=>this.emit("error",i),this.socket.onclose=i=>{this.emit("close",i.code,i.reason)}}send(e,n,r){const i=r||n;try{this.socket.send(e),i()}catch(s){i(s)}}close(e,n){this.socket.close(e,n)}addEventListener(e,n,r){this.socket.addEventListener(e,n,r)}};function l4(t,e){return new c4(t,e)}var u4=class{encode(t){return JSON.stringify(t)}decode(t){return JSON.parse(t)}},d4=class extends GA{constructor(e,n="ws://localhost:8080",{autoconnect:r=!0,reconnect:i=!0,reconnect_interval:s=1e3,max_reconnects:o=5,...a}={},c,l){super();En(this,"address");En(this,"rpc_id");En(this,"queue");En(this,"options");En(this,"autoconnect");En(this,"ready");En(this,"reconnect");En(this,"reconnect_timer_id");En(this,"reconnect_interval");En(this,"max_reconnects");En(this,"rest_options");En(this,"current_reconnects");En(this,"generate_request_id");En(this,"socket");En(this,"webSocketFactory");En(this,"dataPack");this.webSocketFactory=e,this.queue={},this.rpc_id=0,this.address=n,this.autoconnect=r,this.ready=!1,this.reconnect=i,this.reconnect_timer_id=void 0,this.reconnect_interval=s,this.max_reconnects=o,this.rest_options=a,this.current_reconnects=0,this.generate_request_id=c||(()=>++this.rpc_id),l?this.dataPack=l:this.dataPack=new u4,this.autoconnect&&this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}connect(){this.socket||this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}call(e,n,r,i){return!i&&typeof r=="object"&&(i=r,r=null),new Promise((s,o)=>{if(!this.ready)return o(new Error("socket not ready"));const a=this.generate_request_id(e,n),c={jsonrpc:"2.0",method:e,params:n||void 0,id:a};this.socket.send(this.dataPack.encode(c),i,l=>{if(l)return o(l);this.queue[a]={promise:[s,o]},r&&(this.queue[a].timeout=setTimeout(()=>{delete this.queue[a],o(new Error("reply timeout"))},r))})})}async login(e){const n=await this.call("rpc.login",e);if(!n)throw new Error("authentication failed");return n}async listMethods(){return await this.call("__listMethods")}notify(e,n){return new Promise((r,i)=>{if(!this.ready)return i(new Error("socket not ready"));const s={jsonrpc:"2.0",method:e,params:n};this.socket.send(this.dataPack.encode(s),o=>{if(o)return i(o);r()})})}async subscribe(e){typeof e=="string"&&(e=[e]);const n=await this.call("rpc.on",e);if(typeof e=="string"&&n[e]!=="ok")throw new Error("Failed subscribing to an event '"+e+"' with: "+n[e]);return n}async unsubscribe(e){typeof e=="string"&&(e=[e]);const n=await this.call("rpc.off",e);if(typeof e=="string"&&n[e]!=="ok")throw new Error("Failed unsubscribing from an event with: "+n);return n}close(e,n){this.socket.close(e||1e3,n)}setAutoReconnect(e){this.reconnect=e}setReconnectInterval(e){this.reconnect_interval=e}setMaxReconnects(e){this.max_reconnects=e}_connect(e,n){clearTimeout(this.reconnect_timer_id),this.socket=this.webSocketFactory(e,n),this.socket.addEventListener("open",()=>{this.ready=!0,this.emit("open"),this.current_reconnects=0}),this.socket.addEventListener("message",({data:r})=>{r instanceof ArrayBuffer&&(r=re.Buffer.from(r).toString());try{r=this.dataPack.decode(r)}catch{return}if(r.notification&&this.listeners(r.notification).length){if(!Object.keys(r.params).length)return this.emit(r.notification);const i=[r.notification];if(r.params.constructor===Object)i.push(r.params);else for(let s=0;s<r.params.length;s++)i.push(r.params[s]);return Promise.resolve().then(()=>{this.emit.apply(this,i)})}if(!this.queue[r.id])return r.method?Promise.resolve().then(()=>{this.emit(r.method,r==null?void 0:r.params)}):void 0;"error"in r=="result"in r&&this.queue[r.id].promise[1](new Error('Server response malformed. Response must include either "result" or "error", but not both.')),this.queue[r.id].timeout&&clearTimeout(this.queue[r.id].timeout),r.error?this.queue[r.id].promise[1](r.error):this.queue[r.id].promise[0](r.result),delete this.queue[r.id]}),this.socket.addEventListener("error",r=>this.emit("error",r)),this.socket.addEventListener("close",({code:r,reason:i})=>{this.ready&&setTimeout(()=>this.emit("close",r,i),0),this.ready=!1,this.socket=void 0,r!==1e3&&(this.current_reconnects++,this.reconnect&&(this.max_reconnects>this.current_reconnects||this.max_reconnects===0)&&(this.reconnect_timer_id=setTimeout(()=>this._connect(e,n),this.reconnect_interval)))})}};const YA=[],qA=[],QA=[],f4=BigInt(0),bl=BigInt(1),h4=BigInt(2),p4=BigInt(7),g4=BigInt(256),y4=BigInt(113);for(let t=0,e=bl,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],YA.push(2*(5*r+n)),qA.push((t+1)*(t+2)/2%64);let i=f4;for(let s=0;s<7;s++)e=(e<<bl^(e>>p4)*y4)%g4,e&h4&&(i^=bl<<(bl<<BigInt(s))-bl);QA.push(i)}const[m4,w4]=eA(QA,!0),w1=(t,e,n)=>n>32?rA(t,e,n):tA(t,e,n),_1=(t,e,n)=>n>32?iA(t,e,n):nA(t,e,n);function _4(t,e=24){const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let o=0;o<10;o++)n[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,l=n[c],u=n[c+1],f=w1(l,u,1)^n[a],g=_1(l,u,1)^n[a+1];for(let p=0;p<50;p+=10)t[o+p]^=f,t[o+p+1]^=g}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=qA[o],c=w1(i,s,a),l=_1(i,s,a),u=YA[o];i=t[u],s=t[u+1],t[u]=c,t[u+1]=l}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)n[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~n[(a+2)%10]&n[(a+4)%10]}t[0]^=m4[r],t[1]^=w4[r]}n.fill(0)}class $w extends xw{constructor(e,n,r,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=n,this.outputLen=r,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,th(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=HO(this.state)}keccak(){a1||c1(this.state32),_4(this.state32,this.rounds),a1||c1(this.state32),this.posOut=0,this.pos=0}update(e){Tc(this);const{blockLen:n,state:r}=this;e=ep(e);const i=e.length;for(let s=0;s<i;){const o=Math.min(n-this.pos,i-s);for(let a=0;a<o;a++)r[this.pos++]^=e[s++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:n,pos:r,blockLen:i}=this;e[r]^=n,n&128&&r===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){Tc(this,!1),nd(e),this.finish();const n=this.state,{blockLen:r}=this;for(let i=0,s=e.length;i<s;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,s-i);e.set(n.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return th(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(qS(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:n,suffix:r,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new $w(n,r,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=r,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const v4=(t,e,n)=>Sw(()=>new $w(e,t,n)),v1=v4(1,136,256/8);class XA extends xw{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,WO(e);const r=ep(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,s=new Uint8Array(i);s.set(r.length>i?e.create().update(r).digest():r);for(let o=0;o<s.length;o++)s[o]^=54;this.iHash.update(s),this.oHash=e.create();for(let o=0;o<s.length;o++)s[o]^=106;this.oHash.update(s),s.fill(0)}update(e){return Tc(this),this.iHash.update(e),this}digestInto(e){Tc(this),nd(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:i,destroyed:s,blockLen:o,outputLen:a}=this;return e=e,e.finished=i,e.destroyed=s,e.blockLen=o,e.outputLen=a,e.oHash=n._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const JA=(t,e,n)=>new XA(t,e).update(n).digest();JA.create=(t,e)=>new XA(t,e);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function b1(t){t.lowS!==void 0&&_s("lowS",t.lowS),t.prehash!==void 0&&_s("prehash",t.prehash)}function b4(t){const e=Rw(t);Qc(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:i}=e;if(n){if(!r.eql(i,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:E4,hexToBytes:x4}=AC,ts={Err:class extends Error{constructor(e=""){super(e)}},_tlv:{encode:(t,e)=>{const{Err:n}=ts;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(e.length&1)throw new n("tlv.encode: unpadded data");const r=e.length/2,i=ec(r);if(i.length/2&128)throw new n("tlv.encode: long form length too big");const s=r>127?ec(i.length/2|128):"";return`${ec(t)}${s}${i}${e}`},decode(t,e){const{Err:n}=ts;let r=0;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(e.length<2||e[r++]!==t)throw new n("tlv.decode: wrong tlv");const i=e[r++],s=!!(i&128);let o=0;if(!s)o=i;else{const c=i&127;if(!c)throw new n("tlv.decode(long): indefinite length not supported");if(c>4)throw new n("tlv.decode(long): byte length is too big");const l=e.subarray(r,r+c);if(l.length!==c)throw new n("tlv.decode: length bytes not complete");if(l[0]===0)throw new n("tlv.decode(long): zero leftmost byte");for(const u of l)o=o<<8|u;if(r+=c,o<128)throw new n("tlv.decode(long): not minimal encoding")}const a=e.subarray(r,r+o);if(a.length!==o)throw new n("tlv.decode: wrong value length");return{v:a,l:e.subarray(r+o)}}},_int:{encode(t){const{Err:e}=ts;if(t<as)throw new e("integer: negative integers are not allowed");let n=ec(t);if(Number.parseInt(n[0],16)&8&&(n="00"+n),n.length&1)throw new e("unexpected assertion");return n},decode(t){const{Err:e}=ts;if(t[0]&128)throw new e("Invalid signature integer: negative");if(t[0]===0&&!(t[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return E4(t)}},toSig(t){const{Err:e,_int:n,_tlv:r}=ts,i=typeof t=="string"?x4(t):t;rd(i);const{v:s,l:o}=r.decode(48,i);if(o.length)throw new e("Invalid signature: left bytes after parsing");const{v:a,l:c}=r.decode(2,s),{v:l,l:u}=r.decode(2,c);if(u.length)throw new e("Invalid signature: left bytes after parsing");return{r:n.decode(a),s:n.decode(l)}},hexFromSig(t){const{_tlv:e,_int:n}=ts,r=`${e.encode(2,n.encode(t.r))}${e.encode(2,n.encode(t.s))}`;return e.encode(48,r)}},as=BigInt(0),xn=BigInt(1);BigInt(2);const E1=BigInt(3);BigInt(4);function S4(t){const e=b4(t),{Fp:n}=e,r=rp(e.n,e.nBitLength),i=e.toBytes||((A,S,E)=>{const b=S.toAffine();return ga(Uint8Array.from([4]),n.toBytes(b.x),n.toBytes(b.y))}),s=e.fromBytes||(A=>{const S=A.subarray(1),E=n.fromBytes(S.subarray(0,n.BYTES)),b=n.fromBytes(S.subarray(n.BYTES,2*n.BYTES));return{x:E,y:b}});function o(A){const{a:S,b:E}=e,b=n.sqr(A),x=n.mul(b,A);return n.add(n.add(x,n.mul(A,S)),E)}if(!n.eql(n.sqr(e.Gy),o(e.Gx)))throw new Error("bad generator point: equation left != right");function a(A){return np(A,xn,e.n)}function c(A){const{allowedPrivateKeyLengths:S,nByteLength:E,wrapPrivateKey:b,n:x}=e;if(S&&typeof A!="bigint"){if(ha(A)&&(A=pa(A)),typeof A!="string"||!S.includes(A.length))throw new Error("Invalid key");A=A.padStart(E*2,"0")}let M;try{M=typeof A=="bigint"?A:oa(mn("private key",A,E))}catch{throw new Error(`private key must be ${E} bytes, hex or bigint, not ${typeof A}`)}return b&&(M=Ct(M,x)),$r("private key",M,xn,x),M}function l(A){if(!(A instanceof g))throw new Error("ProjectivePoint expected")}const u=bu((A,S)=>{const{px:E,py:b,pz:x}=A;if(n.eql(x,n.ONE))return{x:E,y:b};const M=A.is0();S==null&&(S=M?n.ONE:n.inv(x));const L=n.mul(E,S),z=n.mul(b,S),D=n.mul(x,S);if(M)return{x:n.ZERO,y:n.ZERO};if(!n.eql(D,n.ONE))throw new Error("invZ was invalid");return{x:L,y:z}}),f=bu(A=>{if(A.is0()){if(e.allowInfinityPoint&&!n.is0(A.py))return;throw new Error("bad point: ZERO")}const{x:S,y:E}=A.toAffine();if(!n.isValid(S)||!n.isValid(E))throw new Error("bad point: x or y not FE");const b=n.sqr(E),x=o(S);if(!n.eql(b,x))throw new Error("bad point: equation left != right");if(!A.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class g{constructor(S,E,b){if(this.px=S,this.py=E,this.pz=b,S==null||!n.isValid(S))throw new Error("x required");if(E==null||!n.isValid(E))throw new Error("y required");if(b==null||!n.isValid(b))throw new Error("z required");Object.freeze(this)}static fromAffine(S){const{x:E,y:b}=S||{};if(!S||!n.isValid(E)||!n.isValid(b))throw new Error("invalid affine point");if(S instanceof g)throw new Error("projective point not allowed");const x=M=>n.eql(M,n.ZERO);return x(E)&&x(b)?g.ZERO:new g(E,b,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(S){const E=n.invertBatch(S.map(b=>b.pz));return S.map((b,x)=>b.toAffine(E[x])).map(g.fromAffine)}static fromHex(S){const E=g.fromAffine(s(mn("pointHex",S)));return E.assertValidity(),E}static fromPrivateKey(S){return g.BASE.multiply(c(S))}static msm(S,E){return dA(g,r,S,E)}_setWindowSize(S){_.setWindowSize(this,S)}assertValidity(){f(this)}hasEvenY(){const{y:S}=this.toAffine();if(n.isOdd)return!n.isOdd(S);throw new Error("Field doesn't support isOdd")}equals(S){l(S);const{px:E,py:b,pz:x}=this,{px:M,py:L,pz:z}=S,D=n.eql(n.mul(E,z),n.mul(M,x)),F=n.eql(n.mul(b,z),n.mul(L,x));return D&&F}negate(){return new g(this.px,n.neg(this.py),this.pz)}double(){const{a:S,b:E}=e,b=n.mul(E,E1),{px:x,py:M,pz:L}=this;let z=n.ZERO,D=n.ZERO,F=n.ZERO,$=n.mul(x,x),V=n.mul(M,M),G=n.mul(L,L),W=n.mul(x,M);return W=n.add(W,W),F=n.mul(x,L),F=n.add(F,F),z=n.mul(S,F),D=n.mul(b,G),D=n.add(z,D),z=n.sub(V,D),D=n.add(V,D),D=n.mul(z,D),z=n.mul(W,z),F=n.mul(b,F),G=n.mul(S,G),W=n.sub($,G),W=n.mul(S,W),W=n.add(W,F),F=n.add($,$),$=n.add(F,$),$=n.add($,G),$=n.mul($,W),D=n.add(D,$),G=n.mul(M,L),G=n.add(G,G),$=n.mul(G,W),z=n.sub(z,$),F=n.mul(G,V),F=n.add(F,F),F=n.add(F,F),new g(z,D,F)}add(S){l(S);const{px:E,py:b,pz:x}=this,{px:M,py:L,pz:z}=S;let D=n.ZERO,F=n.ZERO,$=n.ZERO;const V=e.a,G=n.mul(e.b,E1);let W=n.mul(E,M),N=n.mul(b,L),d=n.mul(x,z),h=n.add(E,b),v=n.add(M,L);h=n.mul(h,v),v=n.add(W,N),h=n.sub(h,v),v=n.add(E,x);let I=n.add(M,z);return v=n.mul(v,I),I=n.add(W,d),v=n.sub(v,I),I=n.add(b,x),D=n.add(L,z),I=n.mul(I,D),D=n.add(N,d),I=n.sub(I,D),$=n.mul(V,v),D=n.mul(G,d),$=n.add(D,$),D=n.sub(N,$),$=n.add(N,$),F=n.mul(D,$),N=n.add(W,W),N=n.add(N,W),d=n.mul(V,d),v=n.mul(G,v),N=n.add(N,d),d=n.sub(W,d),d=n.mul(V,d),v=n.add(v,d),W=n.mul(N,v),F=n.add(F,W),W=n.mul(I,v),D=n.mul(h,D),D=n.sub(D,W),W=n.mul(h,N),$=n.mul(I,$),$=n.add($,W),new g(D,F,$)}subtract(S){return this.add(S.negate())}is0(){return this.equals(g.ZERO)}wNAF(S){return _.wNAFCached(this,S,g.normalizeZ)}multiplyUnsafe(S){$r("scalar",S,as,e.n);const E=g.ZERO;if(S===as)return E;if(S===xn)return this;const{endo:b}=e;if(!b)return _.unsafeLadder(this,S);let{k1neg:x,k1:M,k2neg:L,k2:z}=b.splitScalar(S),D=E,F=E,$=this;for(;M>as||z>as;)M&xn&&(D=D.add($)),z&xn&&(F=F.add($)),$=$.double(),M>>=xn,z>>=xn;return x&&(D=D.negate()),L&&(F=F.negate()),F=new g(n.mul(F.px,b.beta),F.py,F.pz),D.add(F)}multiply(S){const{endo:E,n:b}=e;$r("scalar",S,xn,b);let x,M;if(E){const{k1neg:L,k1:z,k2neg:D,k2:F}=E.splitScalar(S);let{p:$,f:V}=this.wNAF(z),{p:G,f:W}=this.wNAF(F);$=_.constTimeNegate(L,$),G=_.constTimeNegate(D,G),G=new g(n.mul(G.px,E.beta),G.py,G.pz),x=$.add(G),M=V.add(W)}else{const{p:L,f:z}=this.wNAF(S);x=L,M=z}return g.normalizeZ([x,M])[0]}multiplyAndAddUnsafe(S,E,b){const x=g.BASE,M=(z,D)=>D===as||D===xn||!z.equals(x)?z.multiplyUnsafe(D):z.multiply(D),L=M(this,E).add(M(S,b));return L.is0()?void 0:L}toAffine(S){return u(this,S)}isTorsionFree(){const{h:S,isTorsionFree:E}=e;if(S===xn)return!0;if(E)return E(g,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:S,clearCofactor:E}=e;return S===xn?this:E?E(g,this):this.multiplyUnsafe(e.h)}toRawBytes(S=!0){return _s("isCompressed",S),this.assertValidity(),i(g,this,S)}toHex(S=!0){return _s("isCompressed",S),pa(this.toRawBytes(S))}}g.BASE=new g(e.Gx,e.Gy,n.ONE),g.ZERO=new g(n.ZERO,n.ONE,n.ZERO);const p=e.nBitLength,_=uA(g,e.endo?Math.ceil(p/2):p);return{CURVE:e,ProjectivePoint:g,normPrivateKeyToScalar:c,weierstrassEquation:o,isWithinCurveOrder:a}}function A4(t){const e=Rw(t);return Qc(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function I4(t){const e=A4(t),{Fp:n,n:r}=e,i=n.BYTES+1,s=2*n.BYTES+1;function o(d){return Ct(d,r)}function a(d){return Sy(d,r)}const{ProjectivePoint:c,normPrivateKeyToScalar:l,weierstrassEquation:u,isWithinCurveOrder:f}=S4({...e,toBytes(d,h,v){const I=h.toAffine(),k=n.toBytes(I.x),O=ga;return _s("isCompressed",v),v?O(Uint8Array.from([h.hasEvenY()?2:3]),k):O(Uint8Array.from([4]),k,n.toBytes(I.y))},fromBytes(d){const h=d.length,v=d[0],I=d.subarray(1);if(h===i&&(v===2||v===3)){const k=oa(I);if(!np(k,xn,n.ORDER))throw new Error("Point is not on curve");const O=u(k);let B;try{B=n.sqrt(O)}catch(P){const ae=P instanceof Error?": "+P.message:"";throw new Error("Point is not on curve"+ae)}const T=(B&xn)===xn;return(v&1)===1!==T&&(B=n.neg(B)),{x:k,y:B}}else if(h===s&&v===4){const k=n.fromBytes(I.subarray(0,n.BYTES)),O=n.fromBytes(I.subarray(n.BYTES,2*n.BYTES));return{x:k,y:O}}else throw new Error(`Point of length ${h} was invalid. Expected ${i} compressed bytes or ${s} uncompressed bytes`)}}),g=d=>pa(Oc(d,e.nByteLength));function p(d){const h=r>>xn;return d>h}function _(d){return p(d)?o(-d):d}const A=(d,h,v)=>oa(d.slice(h,v));class S{constructor(h,v,I){this.r=h,this.s=v,this.recovery=I,this.assertValidity()}static fromCompact(h){const v=e.nByteLength;return h=mn("compactSignature",h,v*2),new S(A(h,0,v),A(h,v,2*v))}static fromDER(h){const{r:v,s:I}=ts.toSig(mn("DER",h));return new S(v,I)}assertValidity(){$r("r",this.r,xn,r),$r("s",this.s,xn,r)}addRecoveryBit(h){return new S(this.r,this.s,h)}recoverPublicKey(h){const{r:v,s:I,recovery:k}=this,O=z(mn("msgHash",h));if(k==null||![0,1,2,3].includes(k))throw new Error("recovery id invalid");const B=k===2||k===3?v+e.n:v;if(B>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const T=k&1?"03":"02",m=c.fromHex(T+g(B)),P=a(B),ae=o(-O*P),fe=o(I*P),de=c.BASE.multiplyAndAddUnsafe(m,ae,fe);if(!de)throw new Error("point at infinify");return de.assertValidity(),de}hasHighS(){return p(this.s)}normalizeS(){return this.hasHighS()?new S(this.r,o(-this.s),this.recovery):this}toDERRawBytes(){return Mc(this.toDERHex())}toDERHex(){return ts.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Mc(this.toCompactHex())}toCompactHex(){return g(this.r)+g(this.s)}}const E={isValidPrivateKey(d){try{return l(d),!0}catch{return!1}},normPrivateKeyToScalar:l,randomPrivateKey:()=>{const d=lA(e.n);return DC(e.randomBytes(d),e.n)},precompute(d=8,h=c.BASE){return h._setWindowSize(d),h.multiply(BigInt(3)),h}};function b(d,h=!0){return c.fromPrivateKey(d).toRawBytes(h)}function x(d){const h=ha(d),v=typeof d=="string",I=(h||v)&&d.length;return h?I===i||I===s:v?I===2*i||I===2*s:d instanceof c}function M(d,h,v=!0){if(x(d))throw new Error("first arg must be private key");if(!x(h))throw new Error("second arg must be public key");return c.fromHex(h).multiply(l(d)).toRawBytes(v)}const L=e.bits2int||function(d){const h=oa(d),v=d.length*8-e.nBitLength;return v>0?h>>BigInt(v):h},z=e.bits2int_modN||function(d){return o(L(d))},D=kw(e.nBitLength);function F(d){return $r(`num < 2^${e.nBitLength}`,d,as,D),Oc(d,e.nByteLength)}function $(d,h,v=V){if(["recovered","canonical"].some(Re=>Re in v))throw new Error("sign() legacy options not supported");const{hash:I,randomBytes:k}=e;let{lowS:O,prehash:B,extraEntropy:T}=v;O==null&&(O=!0),d=mn("msgHash",d),b1(v),B&&(d=mn("prehashed msgHash",I(d)));const m=z(d),P=l(h),ae=[F(P),F(m)];if(T!=null&&T!==!1){const Re=T===!0?k(n.BYTES):T;ae.push(mn("extraEntropy",Re))}const fe=ga(...ae),de=m;function Ce(Re){const Me=L(Re);if(!f(Me))return;const xt=a(Me),Fe=c.BASE.multiply(Me).toAffine(),De=o(Fe.x);if(De===as)return;const ht=o(xt*o(de+De*P));if(ht===as)return;let Qe=(Fe.x===De?0:2)|Number(Fe.y&xn),dt=ht;return O&&p(ht)&&(dt=_(ht),Qe^=1),new S(De,dt,Qe)}return{seed:fe,k2sig:Ce}}const V={lowS:e.lowS,prehash:!1},G={lowS:e.lowS,prehash:!1};function W(d,h,v=V){const{seed:I,k2sig:k}=$(d,h,v),O=e;return oA(O.hash.outputLen,O.nByteLength,O.hmac)(I,k)}c.BASE._setWindowSize(8);function N(d,h,v,I=G){var Fe;const k=d;if(h=mn("msgHash",h),v=mn("publicKey",v),"strict"in I)throw new Error("options.strict was renamed to lowS");b1(I);const{lowS:O,prehash:B}=I;let T,m;try{if(typeof k=="string"||ha(k))try{T=S.fromDER(k)}catch(De){if(!(De instanceof ts.Err))throw De;T=S.fromCompact(k)}else if(typeof k=="object"&&typeof k.r=="bigint"&&typeof k.s=="bigint"){const{r:De,s:ht}=k;T=new S(De,ht)}else throw new Error("PARSE");m=c.fromHex(v)}catch(De){if(De.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(O&&T.hasHighS())return!1;B&&(h=e.hash(h));const{r:P,s:ae}=T,fe=z(h),de=a(ae),Ce=o(fe*de),Re=o(P*de),Me=(Fe=c.BASE.multiplyAndAddUnsafe(m,Ce,Re))==null?void 0:Fe.toAffine();return Me?o(Me.x)===P:!1}return{CURVE:e,getPublicKey:b,getSharedSecret:M,sign:W,verify:N,ProjectivePoint:c,Signature:S,utils:E}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function k4(t){return{hash:t,hmac:(e,...n)=>JA(t,e,ZO(...n)),randomBytes:QS}}function R4(t,e){const n=r=>I4({...t,...k4(r)});return Object.freeze({...n(e),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const eI=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),x1=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),N4=BigInt(1),Ry=BigInt(2),S1=(t,e)=>(t+e/Ry)/e;function T4(t){const e=eI,n=BigInt(3),r=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),l=t*t*t%e,u=l*l*t%e,f=Ht(u,n,e)*u%e,g=Ht(f,n,e)*u%e,p=Ht(g,Ry,e)*l%e,_=Ht(p,i,e)*p%e,A=Ht(_,s,e)*_%e,S=Ht(A,a,e)*A%e,E=Ht(S,c,e)*S%e,b=Ht(E,a,e)*A%e,x=Ht(b,n,e)*u%e,M=Ht(x,o,e)*_%e,L=Ht(M,r,e)*l%e,z=Ht(L,Ry,e);if(!Ny.eql(Ny.sqr(z),t))throw new Error("Cannot find square root");return z}const Ny=rp(eI,void 0,void 0,{sqrt:T4}),up=R4({a:BigInt(0),b:BigInt(7),Fp:Ny,n:x1,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=x1,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-N4*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=n,o=BigInt("0x100000000000000000000000000000000"),a=S1(s*t,e),c=S1(-r*t,e);let l=Ct(t-a*n-c*i,e),u=Ct(-a*r-c*s,e);const f=l>o,g=u>o;if(f&&(l=e-l),g&&(u=e-u),l>o||u>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:f,k1:l,k2neg:g,k2:u}}}},Iy);BigInt(0);up.ProjectivePoint;const M4=Xc.utils.randomPrivateKey,A1=()=>{const t=Xc.utils.randomPrivateKey(),e=ch(t),n=new Uint8Array(64);return n.set(t),n.set(e,32),{publicKey:e,secretKey:n}},ch=Xc.getPublicKey;function I1(t){try{return Xc.ExtendedPoint.fromHex(t),!0}catch{return!1}}const Vw=(t,e)=>Xc.sign(t,e.slice(0,32)),O4=Xc.verify,Ye=t=>re.Buffer.isBuffer(t)?t:t instanceof Uint8Array?re.Buffer.from(t.buffer,t.byteOffset,t.byteLength):re.Buffer.from(t);let Zw=class{constructor(e){Object.assign(this,e)}encode(){return re.Buffer.from(_A(Gl,this))}static decode(e){return vA(Gl,this,e)}static decodeUnchecked(e){return pA(Gl,this,e)}};class C4 extends Zw{constructor(e){if(super(e),this.enum="",Object.keys(e).length!==1)throw new Error("Enum can only take single value");Object.keys(e).map(n=>{this.enum=n})}}const Gl=new Map;var tI;const nI=32,Oi=32;function L4(t){return t._bn!==void 0}let k1=1;class ie extends Zw{constructor(e){if(super({}),this._bn=void 0,L4(e))this._bn=e._bn;else{if(typeof e=="string"){const n=jt.decode(e);if(n.length!=Oi)throw new Error("Invalid public key input");this._bn=new ss(n)}else this._bn=new ss(e);if(this._bn.byteLength()>Oi)throw new Error("Invalid public key input")}}static unique(){const e=new ie(k1);return k1+=1,new ie(e.toBuffer())}equals(e){return this._bn.eq(e._bn)}toBase58(){return jt.encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){const e=this.toBuffer();return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}toBuffer(){const e=this._bn.toArrayLike(re.Buffer);if(e.length===Oi)return e;const n=re.Buffer.alloc(32);return e.copy(n,32-e.length),n}get[Symbol.toStringTag](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(e,n,r){const i=re.Buffer.concat([e.toBuffer(),re.Buffer.from(n),r.toBuffer()]),s=Iy(i);return new ie(s)}static createProgramAddressSync(e,n){let r=re.Buffer.alloc(0);e.forEach(function(s){if(s.length>nI)throw new TypeError("Max seed length exceeded");r=re.Buffer.concat([r,Ye(s)])}),r=re.Buffer.concat([r,n.toBuffer(),re.Buffer.from("ProgramDerivedAddress")]);const i=Iy(r);if(I1(i))throw new Error("Invalid seeds, address must fall off the curve");return new ie(i)}static async createProgramAddress(e,n){return this.createProgramAddressSync(e,n)}static findProgramAddressSync(e,n){let r=255,i;for(;r!=0;){try{const s=e.concat(re.Buffer.from([r]));i=this.createProgramAddressSync(s,n)}catch(s){if(s instanceof TypeError)throw s;r--;continue}return[i,r]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(e,n){return this.findProgramAddressSync(e,n)}static isOnCurve(e){const n=new ie(e);return I1(n.toBytes())}}tI=ie;ie.default=new tI("11111111111111111111111111111111");Gl.set(ie,{kind:"struct",fields:[["_bn","u256"]]});class D4{constructor(e){if(this._publicKey=void 0,this._secretKey=void 0,e){const n=Ye(e);if(e.length!==64)throw new Error("bad secret key size");this._publicKey=n.slice(32,64),this._secretKey=n.slice(0,32)}else this._secretKey=Ye(M4()),this._publicKey=Ye(ch(this._secretKey))}get publicKey(){return new ie(this._publicKey)}get secretKey(){return re.Buffer.concat([this._secretKey,this._publicKey],64)}}const P4=new ie("BPFLoader1111111111111111111111111111111111"),co=1232,dp=127,Lc=64;class Kw extends Error{constructor(e){super(`Signature ${e} has expired: block height exceeded.`),this.signature=void 0,this.signature=e}}Object.defineProperty(Kw.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});class Gw extends Error{constructor(e,n){super(`Transaction was not confirmed in ${n.toFixed(2)} seconds. It is unknown if it succeeded or failed. Check signature ${e} using the Solana Explorer or CLI tools.`),this.signature=void 0,this.signature=e}}Object.defineProperty(Gw.prototype,"name",{value:"TransactionExpiredTimeoutError"});class tc extends Error{constructor(e){super(`Signature ${e} has expired: the nonce is no longer valid.`),this.signature=void 0,this.signature=e}}Object.defineProperty(tc.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});class xu{constructor(e,n){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=e,this.accountKeysFromLookups=n}keySegments(){const e=[this.staticAccountKeys];return this.accountKeysFromLookups&&(e.push(this.accountKeysFromLookups.writable),e.push(this.accountKeysFromLookups.readonly)),e}get(e){for(const n of this.keySegments()){if(e<n.length)return n[e];e-=n.length}}get length(){return this.keySegments().flat().length}compileInstructions(e){if(this.length>256)throw new Error("Account index overflow encountered during compilation");const r=new Map;this.keySegments().flat().forEach((s,o)=>{r.set(s.toBase58(),o)});const i=s=>{const o=r.get(s.toBase58());if(o===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return o};return e.map(s=>({programIdIndex:i(s.programId),accountKeyIndexes:s.keys.map(o=>i(o.pubkey)),data:s.data}))}}const Xe=(t="publicKey")=>Tt(32,t),B4=(t="signature")=>Tt(64,t),Ko=(t="string")=>{const e=Ae([Se("length"),Se("lengthPadding"),Tt(ao(Se(),-8),"chars")],t),n=e.decode.bind(e),r=e.encode.bind(e),i=e;return i.decode=(s,o)=>n(s,o).chars.toString(),i.encode=(s,o,a)=>{const c={chars:re.Buffer.from(s,"utf8")};return r(c,o,a)},i.alloc=s=>Se().span+Se().span+re.Buffer.from(s,"utf8").length,i},z4=(t="authorized")=>Ae([Xe("staker"),Xe("withdrawer")],t),j4=(t="lockup")=>Ae([Ar("unixTimestamp"),Ar("epoch"),Xe("custodian")],t),U4=(t="voteInit")=>Ae([Xe("nodePubkey"),Xe("authorizedVoter"),Xe("authorizedWithdrawer"),st("commission")],t),F4=(t="voteAuthorizeWithSeedArgs")=>Ae([Se("voteAuthorizationType"),Xe("currentAuthorityDerivedKeyOwnerPubkey"),Ko("currentAuthorityDerivedKeySeed"),Xe("newAuthorized")],t);function rI(t,e){const n=i=>{if(i.span>=0)return i.span;if(typeof i.alloc=="function")return i.alloc(e[i.property]);if("count"in i&&"elementLayout"in i){const s=e[i.property];if(Array.isArray(s))return s.length*n(i.elementLayout)}else if("fields"in i)return rI({layout:i},e[i.property]);return 0};let r=0;return t.layout.fields.forEach(i=>{r+=n(i)}),r}function ur(t){let e=0,n=0;for(;;){let r=t.shift();if(e|=(r&127)<<n*7,n+=1,!(r&128))break}return e}function Ir(t,e){let n=e;for(;;){let r=n&127;if(n>>=7,n==0){t.push(r);break}else r|=128,t.push(r)}}function lt(t,e){if(!t)throw new Error(e||"Assertion failed")}class fp{constructor(e,n){this.payer=void 0,this.keyMetaMap=void 0,this.payer=e,this.keyMetaMap=n}static compile(e,n){const r=new Map,i=o=>{const a=o.toBase58();let c=r.get(a);return c===void 0&&(c={isSigner:!1,isWritable:!1,isInvoked:!1},r.set(a,c)),c},s=i(n);s.isSigner=!0,s.isWritable=!0;for(const o of e){i(o.programId).isInvoked=!0;for(const a of o.keys){const c=i(a.pubkey);c.isSigner||(c.isSigner=a.isSigner),c.isWritable||(c.isWritable=a.isWritable)}}return new fp(n,r)}getMessageComponents(){const e=[...this.keyMetaMap.entries()];lt(e.length<=256,"Max static account keys length exceeded");const n=e.filter(([,c])=>c.isSigner&&c.isWritable),r=e.filter(([,c])=>c.isSigner&&!c.isWritable),i=e.filter(([,c])=>!c.isSigner&&c.isWritable),s=e.filter(([,c])=>!c.isSigner&&!c.isWritable),o={numRequiredSignatures:n.length+r.length,numReadonlySignedAccounts:r.length,numReadonlyUnsignedAccounts:s.length};{lt(n.length>0,"Expected at least one writable signer key");const[c]=n[0];lt(c===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}const a=[...n.map(([c])=>new ie(c)),...r.map(([c])=>new ie(c)),...i.map(([c])=>new ie(c)),...s.map(([c])=>new ie(c))];return[o,a]}extractTableLookup(e){const[n,r]=this.drainKeysFoundInLookupTable(e.state.addresses,o=>!o.isSigner&&!o.isInvoked&&o.isWritable),[i,s]=this.drainKeysFoundInLookupTable(e.state.addresses,o=>!o.isSigner&&!o.isInvoked&&!o.isWritable);if(!(n.length===0&&i.length===0))return[{accountKey:e.key,writableIndexes:n,readonlyIndexes:i},{writable:r,readonly:s}]}drainKeysFoundInLookupTable(e,n){const r=new Array,i=new Array;for(const[s,o]of this.keyMetaMap.entries())if(n(o)){const a=new ie(s),c=e.findIndex(l=>l.equals(a));c>=0&&(lt(c<256,"Max lookup table index exceeded"),r.push(c),i.push(a),this.keyMetaMap.delete(s))}return[r,i]}}const iI="Reached end of buffer unexpectedly";function Ai(t){if(t.length===0)throw new Error(iI);return t.shift()}function dr(t,...e){const[n]=e;if(e.length===2?n+(e[1]??0)>t.length:n>=t.length)throw new Error(iI);return t.splice(...e)}class pi{constructor(e){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=e.header,this.accountKeys=e.accountKeys.map(n=>new ie(n)),this.recentBlockhash=e.recentBlockhash,this.instructions=e.instructions,this.instructions.forEach(n=>this.indexToProgramIds.set(n.programIdIndex,this.accountKeys[n.programIdIndex]))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map(e=>({programIdIndex:e.programIdIndex,accountKeyIndexes:e.accounts,data:jt.decode(e.data)}))}get addressTableLookups(){return[]}getAccountKeys(){return new xu(this.staticAccountKeys)}static compile(e){const n=fp.compile(e.instructions,e.payerKey),[r,i]=n.getMessageComponents(),o=new xu(i).compileInstructions(e.instructions).map(a=>({programIdIndex:a.programIdIndex,accounts:a.accountKeyIndexes,data:jt.encode(a.data)}));return new pi({header:r,accountKeys:i,recentBlockhash:e.recentBlockhash,instructions:o})}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){const n=this.header.numRequiredSignatures;if(e>=this.header.numRequiredSignatures){const r=e-n,s=this.accountKeys.length-n-this.header.numReadonlyUnsignedAccounts;return r<s}else{const r=n-this.header.numReadonlySignedAccounts;return e<r}}isProgramId(e){return this.indexToProgramIds.has(e)}programIds(){return[...this.indexToProgramIds.values()]}nonProgramIds(){return this.accountKeys.filter((e,n)=>!this.isProgramId(n))}serialize(){const e=this.accountKeys.length;let n=[];Ir(n,e);const r=this.instructions.map(f=>{const{accounts:g,programIdIndex:p}=f,_=Array.from(jt.decode(f.data));let A=[];Ir(A,g.length);let S=[];return Ir(S,_.length),{programIdIndex:p,keyIndicesCount:re.Buffer.from(A),keyIndices:g,dataLength:re.Buffer.from(S),data:_}});let i=[];Ir(i,r.length);let s=re.Buffer.alloc(co);re.Buffer.from(i).copy(s);let o=i.length;r.forEach(f=>{const p=Ae([st("programIdIndex"),Tt(f.keyIndicesCount.length,"keyIndicesCount"),Bn(st("keyIndex"),f.keyIndices.length,"keyIndices"),Tt(f.dataLength.length,"dataLength"),Bn(st("userdatum"),f.data.length,"data")]).encode(f,s,o);o+=p}),s=s.slice(0,o);const a=Ae([Tt(1,"numRequiredSignatures"),Tt(1,"numReadonlySignedAccounts"),Tt(1,"numReadonlyUnsignedAccounts"),Tt(n.length,"keyCount"),Bn(Xe("key"),e,"keys"),Xe("recentBlockhash")]),c={numRequiredSignatures:re.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:re.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:re.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:re.Buffer.from(n),keys:this.accountKeys.map(f=>Ye(f.toBytes())),recentBlockhash:jt.decode(this.recentBlockhash)};let l=re.Buffer.alloc(2048);const u=a.encode(c,l);return s.copy(l,u),l.slice(0,u+s.length)}static from(e){let n=[...e];const r=Ai(n);if(r!==(r&dp))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");const i=Ai(n),s=Ai(n),o=ur(n);let a=[];for(let g=0;g<o;g++){const p=dr(n,0,Oi);a.push(new ie(re.Buffer.from(p)))}const c=dr(n,0,Oi),l=ur(n);let u=[];for(let g=0;g<l;g++){const p=Ai(n),_=ur(n),A=dr(n,0,_),S=ur(n),E=dr(n,0,S),b=jt.encode(re.Buffer.from(E));u.push({programIdIndex:p,accounts:A,data:b})}const f={header:{numRequiredSignatures:r,numReadonlySignedAccounts:i,numReadonlyUnsignedAccounts:s},recentBlockhash:jt.encode(re.Buffer.from(c)),accountKeys:a,instructions:u};return new pi(f)}}class ya{constructor(e){this.header=void 0,this.staticAccountKeys=void 0,this.recentBlockhash=void 0,this.compiledInstructions=void 0,this.addressTableLookups=void 0,this.header=e.header,this.staticAccountKeys=e.staticAccountKeys,this.recentBlockhash=e.recentBlockhash,this.compiledInstructions=e.compiledInstructions,this.addressTableLookups=e.addressTableLookups}get version(){return 0}get numAccountKeysFromLookups(){let e=0;for(const n of this.addressTableLookups)e+=n.readonlyIndexes.length+n.writableIndexes.length;return e}getAccountKeys(e){let n;if(e&&"accountKeysFromLookups"in e&&e.accountKeysFromLookups){if(this.numAccountKeysFromLookups!=e.accountKeysFromLookups.writable.length+e.accountKeysFromLookups.readonly.length)throw new Error("Failed to get account keys because of a mismatch in the number of account keys from lookups");n=e.accountKeysFromLookups}else if(e&&"addressLookupTableAccounts"in e&&e.addressLookupTableAccounts)n=this.resolveAddressTableLookups(e.addressLookupTableAccounts);else if(this.addressTableLookups.length>0)throw new Error("Failed to get account keys because address table lookups were not resolved");return new xu(this.staticAccountKeys,n)}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){const n=this.header.numRequiredSignatures,r=this.staticAccountKeys.length;if(e>=r){const i=e-r,s=this.addressTableLookups.reduce((o,a)=>o+a.writableIndexes.length,0);return i<s}else if(e>=this.header.numRequiredSignatures){const i=e-n,o=r-n-this.header.numReadonlyUnsignedAccounts;return i<o}else{const i=n-this.header.numReadonlySignedAccounts;return e<i}}resolveAddressTableLookups(e){const n={writable:[],readonly:[]};for(const r of this.addressTableLookups){const i=e.find(s=>s.key.equals(r.accountKey));if(!i)throw new Error(`Failed to find address lookup table account for table key ${r.accountKey.toBase58()}`);for(const s of r.writableIndexes)if(s<i.state.addresses.length)n.writable.push(i.state.addresses[s]);else throw new Error(`Failed to find address for index ${s} in address lookup table ${r.accountKey.toBase58()}`);for(const s of r.readonlyIndexes)if(s<i.state.addresses.length)n.readonly.push(i.state.addresses[s]);else throw new Error(`Failed to find address for index ${s} in address lookup table ${r.accountKey.toBase58()}`)}return n}static compile(e){const n=fp.compile(e.instructions,e.payerKey),r=new Array,i={writable:new Array,readonly:new Array},s=e.addressLookupTableAccounts||[];for(const u of s){const f=n.extractTableLookup(u);if(f!==void 0){const[g,{writable:p,readonly:_}]=f;r.push(g),i.writable.push(...p),i.readonly.push(..._)}}const[o,a]=n.getMessageComponents(),l=new xu(a,i).compileInstructions(e.instructions);return new ya({header:o,staticAccountKeys:a,recentBlockhash:e.recentBlockhash,compiledInstructions:l,addressTableLookups:r})}serialize(){const e=Array();Ir(e,this.staticAccountKeys.length);const n=this.serializeInstructions(),r=Array();Ir(r,this.compiledInstructions.length);const i=this.serializeAddressTableLookups(),s=Array();Ir(s,this.addressTableLookups.length);const o=Ae([st("prefix"),Ae([st("numRequiredSignatures"),st("numReadonlySignedAccounts"),st("numReadonlyUnsignedAccounts")],"header"),Tt(e.length,"staticAccountKeysLength"),Bn(Xe(),this.staticAccountKeys.length,"staticAccountKeys"),Xe("recentBlockhash"),Tt(r.length,"instructionsLength"),Tt(n.length,"serializedInstructions"),Tt(s.length,"addressTableLookupsLength"),Tt(i.length,"serializedAddressTableLookups")]),a=new Uint8Array(co),l=o.encode({prefix:128,header:this.header,staticAccountKeysLength:new Uint8Array(e),staticAccountKeys:this.staticAccountKeys.map(u=>u.toBytes()),recentBlockhash:jt.decode(this.recentBlockhash),instructionsLength:new Uint8Array(r),serializedInstructions:n,addressTableLookupsLength:new Uint8Array(s),serializedAddressTableLookups:i},a);return a.slice(0,l)}serializeInstructions(){let e=0;const n=new Uint8Array(co);for(const r of this.compiledInstructions){const i=Array();Ir(i,r.accountKeyIndexes.length);const s=Array();Ir(s,r.data.length);const o=Ae([st("programIdIndex"),Tt(i.length,"encodedAccountKeyIndexesLength"),Bn(st(),r.accountKeyIndexes.length,"accountKeyIndexes"),Tt(s.length,"encodedDataLength"),Tt(r.data.length,"data")]);e+=o.encode({programIdIndex:r.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(i),accountKeyIndexes:r.accountKeyIndexes,encodedDataLength:new Uint8Array(s),data:r.data},n,e)}return n.slice(0,e)}serializeAddressTableLookups(){let e=0;const n=new Uint8Array(co);for(const r of this.addressTableLookups){const i=Array();Ir(i,r.writableIndexes.length);const s=Array();Ir(s,r.readonlyIndexes.length);const o=Ae([Xe("accountKey"),Tt(i.length,"encodedWritableIndexesLength"),Bn(st(),r.writableIndexes.length,"writableIndexes"),Tt(s.length,"encodedReadonlyIndexesLength"),Bn(st(),r.readonlyIndexes.length,"readonlyIndexes")]);e+=o.encode({accountKey:r.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(i),writableIndexes:r.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(s),readonlyIndexes:r.readonlyIndexes},n,e)}return n.slice(0,e)}static deserialize(e){let n=[...e];const r=Ai(n),i=r&dp;lt(r!==i,"Expected versioned message but received legacy message");const s=i;lt(s===0,`Expected versioned message with version 0 but found version ${s}`);const o={numRequiredSignatures:Ai(n),numReadonlySignedAccounts:Ai(n),numReadonlyUnsignedAccounts:Ai(n)},a=[],c=ur(n);for(let _=0;_<c;_++)a.push(new ie(dr(n,0,Oi)));const l=jt.encode(dr(n,0,Oi)),u=ur(n),f=[];for(let _=0;_<u;_++){const A=Ai(n),S=ur(n),E=dr(n,0,S),b=ur(n),x=new Uint8Array(dr(n,0,b));f.push({programIdIndex:A,accountKeyIndexes:E,data:x})}const g=ur(n),p=[];for(let _=0;_<g;_++){const A=new ie(dr(n,0,Oi)),S=ur(n),E=dr(n,0,S),b=ur(n),x=dr(n,0,b);p.push({accountKey:A,writableIndexes:E,readonlyIndexes:x})}return new ya({header:o,staticAccountKeys:a,recentBlockhash:l,compiledInstructions:f,addressTableLookups:p})}}const hp={deserializeMessageVersion(t){const e=t[0],n=e&dp;return n===e?"legacy":n},deserialize:t=>{const e=hp.deserializeMessageVersion(t);if(e==="legacy")return pi.from(t);if(e===0)return ya.deserialize(t);throw new Error(`Transaction message version ${e} deserialization is not supported`)}};let Qi=function(t){return t[t.BLOCKHEIGHT_EXCEEDED=0]="BLOCKHEIGHT_EXCEEDED",t[t.PROCESSED=1]="PROCESSED",t[t.TIMED_OUT=2]="TIMED_OUT",t[t.NONCE_INVALID=3]="NONCE_INVALID",t}({});const W4=re.Buffer.alloc(Lc).fill(0);class bt{constructor(e){this.keys=void 0,this.programId=void 0,this.data=re.Buffer.alloc(0),this.programId=e.programId,this.keys=e.keys,e.data&&(this.data=e.data)}toJSON(){return{keys:this.keys.map(({pubkey:e,isSigner:n,isWritable:r})=>({pubkey:e.toJSON(),isSigner:n,isWritable:r})),programId:this.programId.toJSON(),data:[...this.data]}}}class Je{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(e){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,!!e)if(e.feePayer&&(this.feePayer=e.feePayer),e.signatures&&(this.signatures=e.signatures),Object.prototype.hasOwnProperty.call(e,"nonceInfo")){const{minContextSlot:n,nonceInfo:r}=e;this.minNonceContextSlot=n,this.nonceInfo=r}else if(Object.prototype.hasOwnProperty.call(e,"lastValidBlockHeight")){const{blockhash:n,lastValidBlockHeight:r}=e;this.recentBlockhash=n,this.lastValidBlockHeight=r}else{const{recentBlockhash:n,nonceInfo:r}=e;r&&(this.nonceInfo=r),this.recentBlockhash=n}}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(e=>e.toJSON()),signers:this.signatures.map(({publicKey:e})=>e.toJSON())}}add(...e){if(e.length===0)throw new Error("No instructions");return e.forEach(n=>{"instructions"in n?this.instructions=this.instructions.concat(n.instructions):"data"in n&&"programId"in n&&"keys"in n?this.instructions.push(n):this.instructions.push(new bt(n))}),this}compileMessage(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;let e,n;if(this.nonceInfo?(e=this.nonceInfo.nonce,this.instructions[0]!=this.nonceInfo.nonceInstruction?n=[this.nonceInfo.nonceInstruction,...this.instructions]:n=this.instructions):(e=this.recentBlockhash,n=this.instructions),!e)throw new Error("Transaction recentBlockhash required");n.length<1&&console.warn("No instructions provided");let r;if(this.feePayer)r=this.feePayer;else if(this.signatures.length>0&&this.signatures[0].publicKey)r=this.signatures[0].publicKey;else throw new Error("Transaction fee payer required");for(let A=0;A<n.length;A++)if(n[A].programId===void 0)throw new Error(`Transaction instruction index ${A} has undefined program id`);const i=[],s=[];n.forEach(A=>{A.keys.forEach(E=>{s.push({...E})});const S=A.programId.toString();i.includes(S)||i.push(S)}),i.forEach(A=>{s.push({pubkey:new ie(A),isSigner:!1,isWritable:!1})});const o=[];s.forEach(A=>{const S=A.pubkey.toString(),E=o.findIndex(b=>b.pubkey.toString()===S);E>-1?(o[E].isWritable=o[E].isWritable||A.isWritable,o[E].isSigner=o[E].isSigner||A.isSigner):o.push(A)}),o.sort(function(A,S){if(A.isSigner!==S.isSigner)return A.isSigner?-1:1;if(A.isWritable!==S.isWritable)return A.isWritable?-1:1;const E={localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"};return A.pubkey.toBase58().localeCompare(S.pubkey.toBase58(),"en",E)});const a=o.findIndex(A=>A.pubkey.equals(r));if(a>-1){const[A]=o.splice(a,1);A.isSigner=!0,A.isWritable=!0,o.unshift(A)}else o.unshift({pubkey:r,isSigner:!0,isWritable:!0});for(const A of this.signatures){const S=o.findIndex(E=>E.pubkey.equals(A.publicKey));if(S>-1)o[S].isSigner||(o[S].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."));else throw new Error(`unknown signer: ${A.publicKey.toString()}`)}let c=0,l=0,u=0;const f=[],g=[];o.forEach(({pubkey:A,isSigner:S,isWritable:E})=>{S?(f.push(A.toString()),c+=1,E||(l+=1)):(g.push(A.toString()),E||(u+=1))});const p=f.concat(g),_=n.map(A=>{const{data:S,programId:E}=A;return{programIdIndex:p.indexOf(E.toString()),accounts:A.keys.map(b=>p.indexOf(b.pubkey.toString())),data:jt.encode(S)}});return _.forEach(A=>{lt(A.programIdIndex>=0),A.accounts.forEach(S=>lt(S>=0))}),new pi({header:{numRequiredSignatures:c,numReadonlySignedAccounts:l,numReadonlyUnsignedAccounts:u},accountKeys:p,recentBlockhash:e,instructions:_})}_compile(){const e=this.compileMessage(),n=e.accountKeys.slice(0,e.header.numRequiredSignatures);return this.signatures.length===n.length&&this.signatures.every((i,s)=>n[s].equals(i.publicKey))||(this.signatures=n.map(r=>({signature:null,publicKey:r}))),e}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(e){return(await e.getFeeForMessage(this.compileMessage())).value}setSigners(...e){if(e.length===0)throw new Error("No signers");const n=new Set;this.signatures=e.filter(r=>{const i=r.toString();return n.has(i)?!1:(n.add(i),!0)}).map(r=>({signature:null,publicKey:r}))}sign(...e){if(e.length===0)throw new Error("No signers");const n=new Set,r=[];for(const s of e){const o=s.publicKey.toString();n.has(o)||(n.add(o),r.push(s))}this.signatures=r.map(s=>({signature:null,publicKey:s.publicKey}));const i=this._compile();this._partialSign(i,...r)}partialSign(...e){if(e.length===0)throw new Error("No signers");const n=new Set,r=[];for(const s of e){const o=s.publicKey.toString();n.has(o)||(n.add(o),r.push(s))}const i=this._compile();this._partialSign(i,...r)}_partialSign(e,...n){const r=e.serialize();n.forEach(i=>{const s=Vw(r,i.secretKey);this._addSignature(i.publicKey,Ye(s))})}addSignature(e,n){this._compile(),this._addSignature(e,n)}_addSignature(e,n){lt(n.length===64);const r=this.signatures.findIndex(i=>e.equals(i.publicKey));if(r<0)throw new Error(`unknown signer: ${e.toString()}`);this.signatures[r].signature=re.Buffer.from(n)}verifySignatures(e=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),e)}_getMessageSignednessErrors(e,n){const r={};for(const{signature:i,publicKey:s}of this.signatures)i===null?n&&(r.missing||(r.missing=[])).push(s):O4(i,e,s.toBytes())||(r.invalid||(r.invalid=[])).push(s);return r.invalid||r.missing?r:void 0}serialize(e){const{requireAllSignatures:n,verifySignatures:r}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},e),i=this.serializeMessage();if(r){const s=this._getMessageSignednessErrors(i,n);if(s){let o="Signature verification failed.";throw s.invalid&&(o+=` +Invalid signature for public key${s.invalid.length===1?"":"(s)"} [\`${s.invalid.map(a=>a.toBase58()).join("`, `")}\`].`),s.missing&&(o+=` +Missing signature for public key${s.missing.length===1?"":"(s)"} [\`${s.missing.map(a=>a.toBase58()).join("`, `")}\`].`),new Error(o)}}return this._serialize(i)}_serialize(e){const{signatures:n}=this,r=[];Ir(r,n.length);const i=r.length+n.length*64+e.length,s=re.Buffer.alloc(i);return lt(n.length<256),re.Buffer.from(r).copy(s,0),n.forEach(({signature:o},a)=>{o!==null&&(lt(o.length===64,"signature has invalid length"),re.Buffer.from(o).copy(s,r.length+a*64))}),e.copy(s,r.length+n.length*64),lt(s.length<=co,`Transaction too large: ${s.length} > ${co}`),s}get keys(){return lt(this.instructions.length===1),this.instructions[0].keys.map(e=>e.pubkey)}get programId(){return lt(this.instructions.length===1),this.instructions[0].programId}get data(){return lt(this.instructions.length===1),this.instructions[0].data}static from(e){let n=[...e];const r=ur(n);let i=[];for(let s=0;s<r;s++){const o=dr(n,0,Lc);i.push(jt.encode(re.Buffer.from(o)))}return Je.populate(pi.from(n),i)}static populate(e,n=[]){const r=new Je;return r.recentBlockhash=e.recentBlockhash,e.header.numRequiredSignatures>0&&(r.feePayer=e.accountKeys[0]),n.forEach((i,s)=>{const o={signature:i==jt.encode(W4)?null:jt.decode(i),publicKey:e.accountKeys[s]};r.signatures.push(o)}),e.instructions.forEach(i=>{const s=i.accounts.map(o=>{const a=e.accountKeys[o];return{pubkey:a,isSigner:r.signatures.some(c=>c.publicKey.toString()===a.toString())||e.isAccountSigner(o),isWritable:e.isAccountWritable(o)}});r.instructions.push(new bt({keys:s,programId:e.accountKeys[i.programIdIndex],data:jt.decode(i.data)}))}),r._message=e,r._json=r.toJSON(),r}}class Yw{constructor(e){this.payerKey=void 0,this.instructions=void 0,this.recentBlockhash=void 0,this.payerKey=e.payerKey,this.instructions=e.instructions,this.recentBlockhash=e.recentBlockhash}static decompile(e,n){const{header:r,compiledInstructions:i,recentBlockhash:s}=e,{numRequiredSignatures:o,numReadonlySignedAccounts:a,numReadonlyUnsignedAccounts:c}=r,l=o-a;lt(l>0,"Message header is invalid");const u=e.staticAccountKeys.length-o-c;lt(u>=0,"Message header is invalid");const f=e.getAccountKeys(n),g=f.get(0);if(g===void 0)throw new Error("Failed to decompile message because no account keys were found");const p=[];for(const _ of i){const A=[];for(const E of _.accountKeyIndexes){const b=f.get(E);if(b===void 0)throw new Error(`Failed to find key for account key index ${E}`);const x=E<o;let M;x?M=E<l:E<f.staticAccountKeys.length?M=E-o<u:M=E-f.staticAccountKeys.length<f.accountKeysFromLookups.writable.length,A.push({pubkey:b,isSigner:E<r.numRequiredSignatures,isWritable:M})}const S=f.get(_.programIdIndex);if(S===void 0)throw new Error(`Failed to find program id for program id index ${_.programIdIndex}`);p.push(new bt({programId:S,data:Ye(_.data),keys:A}))}return new Yw({payerKey:g,instructions:p,recentBlockhash:s})}compileToLegacyMessage(){return pi.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions})}compileToV0Message(e){return ya.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions,addressLookupTableAccounts:e})}}class Dc{get version(){return this.message.version}constructor(e,n){if(this.signatures=void 0,this.message=void 0,n!==void 0)lt(n.length===e.header.numRequiredSignatures,"Expected signatures length to be equal to the number of required signatures"),this.signatures=n;else{const r=[];for(let i=0;i<e.header.numRequiredSignatures;i++)r.push(new Uint8Array(Lc));this.signatures=r}this.message=e}serialize(){const e=this.message.serialize(),n=Array();Ir(n,this.signatures.length);const r=Ae([Tt(n.length,"encodedSignaturesLength"),Bn(B4(),this.signatures.length,"signatures"),Tt(e.length,"serializedMessage")]),i=new Uint8Array(2048),s=r.encode({encodedSignaturesLength:new Uint8Array(n),signatures:this.signatures,serializedMessage:e},i);return i.slice(0,s)}static deserialize(e){let n=[...e];const r=[],i=ur(n);for(let o=0;o<i;o++)r.push(new Uint8Array(dr(n,0,Lc)));const s=hp.deserialize(new Uint8Array(n));return new Dc(s,r)}sign(e){const n=this.message.serialize(),r=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures);for(const i of e){const s=r.findIndex(o=>o.equals(i.publicKey));lt(s>=0,`Cannot sign with non signer key ${i.publicKey.toBase58()}`),this.signatures[s]=Vw(n,i.secretKey)}}addSignature(e,n){lt(n.byteLength===64,"Signature must be 64 bytes long");const i=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex(s=>s.equals(e));lt(i>=0,`Can not add signature; \`${e.toBase58()}\` is not required to sign this transaction`),this.signatures[i]=n}}const H4=160,$4=64,V4=H4/$4,sI=1e3/V4,Ei=new ie("SysvarC1ock11111111111111111111111111111111"),Z4=new ie("SysvarEpochSchedu1e111111111111111111111111"),K4=new ie("Sysvar1nstructions1111111111111111111111111"),wf=new ie("SysvarRecentB1ockHashes11111111111111111111"),Pc=new ie("SysvarRent111111111111111111111111111111111"),G4=new ie("SysvarRewards111111111111111111111111111111"),Y4=new ie("SysvarS1otHashes111111111111111111111111111"),q4=new ie("SysvarS1otHistory11111111111111111111111111"),_f=new ie("SysvarStakeHistory1111111111111111111111111");class mo extends Error{constructor({action:e,signature:n,transactionMessage:r,logs:i}){const s=i?`Logs: +${JSON.stringify(i.slice(-10),null,2)}. `:"",o="\nCatch the `SendTransactionError` and call `getLogs()` on it for full details.";let a;switch(e){case"send":a=`Transaction ${n} resulted in an error. +${r}. `+s+o;break;case"simulate":a=`Simulation failed. +Message: ${r}. +`+s+o;break;default:a=`Unknown action '${(c=>c)(e)}'`}super(a),this.signature=void 0,this.transactionMessage=void 0,this.transactionLogs=void 0,this.signature=n,this.transactionMessage=r,this.transactionLogs=i||void 0}get transactionError(){return{message:this.transactionMessage,logs:Array.isArray(this.transactionLogs)?this.transactionLogs:void 0}}get logs(){const e=this.transactionLogs;if(!(e!=null&&typeof e=="object"&&"then"in e))return e}async getLogs(e){return Array.isArray(this.transactionLogs)||(this.transactionLogs=new Promise((n,r)=>{e.getTransaction(this.signature).then(i=>{if(i&&i.meta&&i.meta.logMessages){const s=i.meta.logMessages;this.transactionLogs=s,n(s)}else r(new Error("Log messages not found"))}).catch(r)})),await this.transactionLogs}}const Q4={JSON_RPC_SERVER_ERROR_BLOCK_CLEANED_UP:-32001,JSON_RPC_SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE:-32002,JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE:-32003,JSON_RPC_SERVER_ERROR_BLOCK_NOT_AVAILABLE:-32004,JSON_RPC_SERVER_ERROR_NODE_UNHEALTHY:-32005,JSON_RPC_SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE:-32006,JSON_RPC_SERVER_ERROR_SLOT_SKIPPED:-32007,JSON_RPC_SERVER_ERROR_NO_SNAPSHOT:-32008,JSON_RPC_SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED:-32009,JSON_RPC_SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX:-32010,JSON_RPC_SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE:-32011,JSON_RPC_SCAN_ERROR:-32012,JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH:-32013,JSON_RPC_SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET:-32014,JSON_RPC_SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION:-32015,JSON_RPC_SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED:-32016};class Ie extends Error{constructor({code:e,message:n,data:r},i){super(i!=null?`${i}: ${n}`:n),this.code=void 0,this.data=void 0,this.code=e,this.data=r,this.name="SolanaJSONRPCError"}}async function Ty(t,e,n,r){const i=r&&{skipPreflight:r.skipPreflight,preflightCommitment:r.preflightCommitment||r.commitment,maxRetries:r.maxRetries,minContextSlot:r.minContextSlot},s=await t.sendTransaction(e,n,i);let o;if(e.recentBlockhash!=null&&e.lastValidBlockHeight!=null)o=(await t.confirmTransaction({abortSignal:r==null?void 0:r.abortSignal,signature:s,blockhash:e.recentBlockhash,lastValidBlockHeight:e.lastValidBlockHeight},r&&r.commitment)).value;else if(e.minNonceContextSlot!=null&&e.nonceInfo!=null){const{nonceInstruction:a}=e.nonceInfo,c=a.keys[0].pubkey;o=(await t.confirmTransaction({abortSignal:r==null?void 0:r.abortSignal,minContextSlot:e.minNonceContextSlot,nonceAccountPubkey:c,nonceValue:e.nonceInfo.nonce,signature:s},r&&r.commitment)).value}else(r==null?void 0:r.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."),o=(await t.confirmTransaction(s,r&&r.commitment)).value;if(o.err)throw s!=null?new mo({action:"send",signature:s,transactionMessage:`Status: (${JSON.stringify(o)})`}):new Error(`Transaction ${s} failed (${JSON.stringify(o)})`);return s}function Ho(t){return new Promise(e=>setTimeout(e,t))}function rt(t,e){const n=t.layout.span>=0?t.layout.span:rI(t,e),r=re.Buffer.alloc(n),i=Object.assign({instruction:t.index},e);return t.layout.encode(i,r),r}function gt(t,e){let n;try{n=t.layout.decode(e)}catch(r){throw new Error("invalid instruction; "+r)}if(n.instruction!==t.index)throw new Error(`invalid instruction; instruction index mismatch ${n.instruction} != ${t.index}`);return n}const oI=On("lamportsPerSignature"),aI=Ae([Se("version"),Se("state"),Xe("authorizedPubkey"),Xe("nonce"),Ae([oI],"feeCalculator")]),My=aI.span;class pp{constructor(e){this.authorizedPubkey=void 0,this.nonce=void 0,this.feeCalculator=void 0,this.authorizedPubkey=e.authorizedPubkey,this.nonce=e.nonce,this.feeCalculator=e.feeCalculator}static fromAccountData(e){const n=aI.decode(Ye(e),0);return new pp({authorizedPubkey:new ie(n.authorizedPubkey),nonce:new ie(n.nonce).toString(),feeCalculator:n.feeCalculator})}}const X4=t=>{const e=t.decode.bind(t),n=t.encode.bind(t);return{decode:e,encode:n}},J4=t=>e=>{const n=Tt(t,e),{encode:r,decode:i}=X4(n),s=n;return s.decode=(o,a)=>{const c=i(o,a);return SL(re.Buffer.from(c))},s.encode=(o,a,c)=>{const l=zA(o,t);return r(l,a,c)},s},Bc=J4(8);class e3{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const r=Se("instruction").decode(e.data);let i;for(const[s,o]of Object.entries(At))if(o.index==r){i=s;break}if(!i)throw new Error("Instruction type incorrect; not a SystemInstruction");return i}static decodeCreateAccount(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{lamports:n,space:r,programId:i}=gt(At.Create,e.data);return{fromPubkey:e.keys[0].pubkey,newAccountPubkey:e.keys[1].pubkey,lamports:n,space:r,programId:new ie(i)}}static decodeTransfer(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{lamports:n}=gt(At.Transfer,e.data);return{fromPubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,lamports:n}}static decodeTransferWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{lamports:n,seed:r,programId:i}=gt(At.TransferWithSeed,e.data);return{fromPubkey:e.keys[0].pubkey,basePubkey:e.keys[1].pubkey,toPubkey:e.keys[2].pubkey,lamports:n,seed:r,programId:new ie(i)}}static decodeAllocate(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{space:n}=gt(At.Allocate,e.data);return{accountPubkey:e.keys[0].pubkey,space:n}}static decodeAllocateWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{base:n,seed:r,space:i,programId:s}=gt(At.AllocateWithSeed,e.data);return{accountPubkey:e.keys[0].pubkey,basePubkey:new ie(n),seed:r,space:i,programId:new ie(s)}}static decodeAssign(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{programId:n}=gt(At.Assign,e.data);return{accountPubkey:e.keys[0].pubkey,programId:new ie(n)}}static decodeAssignWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{base:n,seed:r,programId:i}=gt(At.AssignWithSeed,e.data);return{accountPubkey:e.keys[0].pubkey,basePubkey:new ie(n),seed:r,programId:new ie(i)}}static decodeCreateWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{base:n,seed:r,lamports:i,space:s,programId:o}=gt(At.CreateWithSeed,e.data);return{fromPubkey:e.keys[0].pubkey,newAccountPubkey:e.keys[1].pubkey,basePubkey:new ie(n),seed:r,lamports:i,space:s,programId:new ie(o)}}static decodeNonceInitialize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{authorized:n}=gt(At.InitializeNonceAccount,e.data);return{noncePubkey:e.keys[0].pubkey,authorizedPubkey:new ie(n)}}static decodeNonceAdvance(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),gt(At.AdvanceNonceAccount,e.data),{noncePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey}}static decodeNonceWithdraw(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,5);const{lamports:n}=gt(At.WithdrawNonceAccount,e.data);return{noncePubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey,lamports:n}}static decodeNonceAuthorize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{authorized:n}=gt(At.AuthorizeNonceAccount,e.data);return{noncePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[1].pubkey,newAuthorizedPubkey:new ie(n)}}static checkProgramId(e){if(!e.equals(_n.programId))throw new Error("invalid instruction; programId is not SystemProgram")}static checkKeyLength(e,n){if(e.length<n)throw new Error(`invalid instruction; found ${e.length} keys, expected at least ${n}`)}}const At=Object.freeze({Create:{index:0,layout:Ae([Se("instruction"),Ar("lamports"),Ar("space"),Xe("programId")])},Assign:{index:1,layout:Ae([Se("instruction"),Xe("programId")])},Transfer:{index:2,layout:Ae([Se("instruction"),Bc("lamports")])},CreateWithSeed:{index:3,layout:Ae([Se("instruction"),Xe("base"),Ko("seed"),Ar("lamports"),Ar("space"),Xe("programId")])},AdvanceNonceAccount:{index:4,layout:Ae([Se("instruction")])},WithdrawNonceAccount:{index:5,layout:Ae([Se("instruction"),Ar("lamports")])},InitializeNonceAccount:{index:6,layout:Ae([Se("instruction"),Xe("authorized")])},AuthorizeNonceAccount:{index:7,layout:Ae([Se("instruction"),Xe("authorized")])},Allocate:{index:8,layout:Ae([Se("instruction"),Ar("space")])},AllocateWithSeed:{index:9,layout:Ae([Se("instruction"),Xe("base"),Ko("seed"),Ar("space"),Xe("programId")])},AssignWithSeed:{index:10,layout:Ae([Se("instruction"),Xe("base"),Ko("seed"),Xe("programId")])},TransferWithSeed:{index:11,layout:Ae([Se("instruction"),Bc("lamports"),Ko("seed"),Xe("programId")])},UpgradeNonceAccount:{index:12,layout:Ae([Se("instruction")])}});class _n{constructor(){}static createAccount(e){const n=At.Create,r=rt(n,{lamports:e.lamports,space:e.space,programId:Ye(e.programId.toBuffer())});return new bt({keys:[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:r})}static transfer(e){let n,r;if("basePubkey"in e){const i=At.TransferWithSeed;n=rt(i,{lamports:BigInt(e.lamports),seed:e.seed,programId:Ye(e.programId.toBuffer())}),r=[{pubkey:e.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]}else{const i=At.Transfer;n=rt(i,{lamports:BigInt(e.lamports)}),r=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]}return new bt({keys:r,programId:this.programId,data:n})}static assign(e){let n,r;if("basePubkey"in e){const i=At.AssignWithSeed;n=rt(i,{base:Ye(e.basePubkey.toBuffer()),seed:e.seed,programId:Ye(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]}else{const i=At.Assign;n=rt(i,{programId:Ye(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]}return new bt({keys:r,programId:this.programId,data:n})}static createAccountWithSeed(e){const n=At.CreateWithSeed,r=rt(n,{base:Ye(e.basePubkey.toBuffer()),seed:e.seed,lamports:e.lamports,space:e.space,programId:Ye(e.programId.toBuffer())});let i=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!1,isWritable:!0}];return e.basePubkey.equals(e.fromPubkey)||i.push({pubkey:e.basePubkey,isSigner:!0,isWritable:!1}),new bt({keys:i,programId:this.programId,data:r})}static createNonceAccount(e){const n=new Je;"basePubkey"in e&&"seed"in e?n.add(_n.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:My,programId:this.programId})):n.add(_n.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,lamports:e.lamports,space:My,programId:this.programId}));const r={noncePubkey:e.noncePubkey,authorizedPubkey:e.authorizedPubkey};return n.add(this.nonceInitialize(r)),n}static nonceInitialize(e){const n=At.InitializeNonceAccount,r=rt(n,{authorized:Ye(e.authorizedPubkey.toBuffer())}),i={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:wf,isSigner:!1,isWritable:!1},{pubkey:Pc,isSigner:!1,isWritable:!1}],programId:this.programId,data:r};return new bt(i)}static nonceAdvance(e){const n=At.AdvanceNonceAccount,r=rt(n),i={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:wf,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:r};return new bt(i)}static nonceWithdraw(e){const n=At.WithdrawNonceAccount,r=rt(n,{lamports:e.lamports});return new bt({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0},{pubkey:wf,isSigner:!1,isWritable:!1},{pubkey:Pc,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:r})}static nonceAuthorize(e){const n=At.AuthorizeNonceAccount,r=rt(n,{authorized:Ye(e.newAuthorizedPubkey.toBuffer())});return new bt({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:r})}static allocate(e){let n,r;if("basePubkey"in e){const i=At.AllocateWithSeed;n=rt(i,{base:Ye(e.basePubkey.toBuffer()),seed:e.seed,space:e.space,programId:Ye(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]}else{const i=At.Allocate;n=rt(i,{space:e.space}),r=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]}return new bt({keys:r,programId:this.programId,data:n})}}_n.programId=new ie("11111111111111111111111111111111");const t3=co-300;class ma{constructor(){}static getMinNumSignatures(e){return 2*(Math.ceil(e/ma.chunkSize)+1+1)}static async load(e,n,r,i,s){{const f=await e.getMinimumBalanceForRentExemption(s.length),g=await e.getAccountInfo(r.publicKey,"confirmed");let p=null;if(g!==null){if(g.executable)return console.error("Program load failed, account is already executable"),!1;g.data.length!==s.length&&(p=p||new Je,p.add(_n.allocate({accountPubkey:r.publicKey,space:s.length}))),g.owner.equals(i)||(p=p||new Je,p.add(_n.assign({accountPubkey:r.publicKey,programId:i}))),g.lamports<f&&(p=p||new Je,p.add(_n.transfer({fromPubkey:n.publicKey,toPubkey:r.publicKey,lamports:f-g.lamports})))}else p=new Je().add(_n.createAccount({fromPubkey:n.publicKey,newAccountPubkey:r.publicKey,lamports:f>0?f:1,space:s.length,programId:i}));p!==null&&await Ty(e,p,[n,r],{commitment:"confirmed"})}const o=Ae([Se("instruction"),Se("offset"),Se("bytesLength"),Se("bytesLengthPadding"),Bn(st("byte"),ao(Se(),-8),"bytes")]),a=ma.chunkSize;let c=0,l=s,u=[];for(;l.length>0;){const f=l.slice(0,a),g=re.Buffer.alloc(a+16);o.encode({instruction:0,offset:c,bytes:f,bytesLength:0,bytesLengthPadding:0},g);const p=new Je().add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0}],programId:i,data:g});u.push(Ty(e,p,[n,r],{commitment:"confirmed"})),e._rpcEndpoint.includes("solana.com")&&await Ho(1e3/4),c+=a,l=l.slice(a)}await Promise.all(u);{const f=Ae([Se("instruction")]),g=re.Buffer.alloc(f.span);f.encode({instruction:1},g);const p=new Je().add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0},{pubkey:Pc,isSigner:!1,isWritable:!1}],programId:i,data:g}),_="processed",A=await e.sendTransaction(p,[n,r],{preflightCommitment:_}),{context:S,value:E}=await e.confirmTransaction({signature:A,lastValidBlockHeight:p.lastValidBlockHeight,blockhash:p.recentBlockhash},_);if(E.err)throw new Error(`Transaction ${A} failed (${JSON.stringify(E)})`);for(;;){try{if(await e.getSlot({commitment:_})>S.slot)break}catch{}await new Promise(b=>setTimeout(b,Math.round(sI/2)))}}return!0}}ma.chunkSize=t3;const n3=new ie("BPFLoader2111111111111111111111111111111111");class r3{static getMinNumSignatures(e){return ma.getMinNumSignatures(e)}static load(e,n,r,i,s){return ma.load(e,n,r,s,i)}}function i3(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var s3=Object.prototype.toString,o3=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};function Cl(t,e){var n,r,i,s,o,a,c;if(t===!0)return"true";if(t===!1)return"false";switch(typeof t){case"object":if(t===null)return null;if(t.toJSON&&typeof t.toJSON=="function")return Cl(t.toJSON(),e);if(c=s3.call(t),c==="[object Array]"){for(i="[",r=t.length-1,n=0;n<r;n++)i+=Cl(t[n],!0)+",";return r>-1&&(i+=Cl(t[n],!0)),i+"]"}else if(c==="[object Object]"){for(s=o3(t).sort(),r=s.length,i="",n=0;n<r;)o=s[n],a=Cl(t[o],!1),a!==void 0&&(i&&(i+=","),i+=JSON.stringify(o)+":"+a),n++;return"{"+i+"}"}else return JSON.stringify(t);case"function":case"undefined":return e?null:void 0;case"string":return JSON.stringify(t);default:return isFinite(t)?t:null}}var a3=function(t){var e=Cl(t,!1);if(e!==void 0)return""+e},R1=i3(a3);const El=32;function Z0(t){let e=0;for(;t>1;)t/=2,e++;return e}function c3(t){return t===0?1:(t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,t|=t>>32,t+1)}class cI{constructor(e,n,r,i,s){this.slotsPerEpoch=void 0,this.leaderScheduleSlotOffset=void 0,this.warmup=void 0,this.firstNormalEpoch=void 0,this.firstNormalSlot=void 0,this.slotsPerEpoch=e,this.leaderScheduleSlotOffset=n,this.warmup=r,this.firstNormalEpoch=i,this.firstNormalSlot=s}getEpoch(e){return this.getEpochAndSlotIndex(e)[0]}getEpochAndSlotIndex(e){if(e<this.firstNormalSlot){const n=Z0(c3(e+El+1))-Z0(El)-1,r=this.getSlotsInEpoch(n),i=e-(r-El);return[n,i]}else{const n=e-this.firstNormalSlot,r=Math.floor(n/this.slotsPerEpoch),i=this.firstNormalEpoch+r,s=n%this.slotsPerEpoch;return[i,s]}}getFirstSlotInEpoch(e){return e<=this.firstNormalEpoch?(Math.pow(2,e)-1)*El:(e-this.firstNormalEpoch)*this.slotsPerEpoch+this.firstNormalSlot}getLastSlotInEpoch(e){return this.getFirstSlotInEpoch(e)+this.getSlotsInEpoch(e)-1}getSlotsInEpoch(e){return e<this.firstNormalEpoch?Math.pow(2,e+Z0(El)):this.slotsPerEpoch}}var l3=globalThis.fetch;class u3 extends d4{constructor(e,n,r){const i=s=>{const o=l4(s,{autoconnect:!0,max_reconnects:5,reconnect:!0,reconnect_interval:1e3,...n});return"socket"in o?this.underlyingSocket=o.socket:this.underlyingSocket=o,o};super(i,e,n,r),this.underlyingSocket=void 0}call(...e){var r;const n=(r=this.underlyingSocket)==null?void 0:r.readyState;return n===1?super.call(...e):Promise.reject(new Error("Tried to call a JSON-RPC method `"+e[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+n+")"))}notify(...e){var r;const n=(r=this.underlyingSocket)==null?void 0:r.readyState;return n===1?super.notify(...e):Promise.reject(new Error("Tried to send a JSON-RPC notification `"+e[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+n+")"))}}function d3(t,e){let n;try{n=t.layout.decode(e)}catch(r){throw new Error("invalid instruction; "+r)}if(n.typeIndex!==t.index)throw new Error(`invalid account data; account type mismatch ${n.typeIndex} != ${t.index}`);return n}const N1=56;class Oy{constructor(e){this.key=void 0,this.state=void 0,this.key=e.key,this.state=e.state}isActive(){const e=BigInt("0xffffffffffffffff");return this.state.deactivationSlot===e}static deserialize(e){const n=d3(f3,e),r=e.length-N1;lt(r>=0,"lookup table is invalid"),lt(r%32===0,"lookup table is invalid");const i=r/32,{addresses:s}=Ae([Bn(Xe(),i,"addresses")]).decode(e.slice(N1));return{deactivationSlot:n.deactivationSlot,lastExtendedSlot:n.lastExtendedSlot,lastExtendedSlotStartIndex:n.lastExtendedStartIndex,authority:n.authority.length!==0?new ie(n.authority[0]):void 0,addresses:s.map(o=>new ie(o))}}}const f3={index:1,layout:Ae([Se("typeIndex"),Bc("deactivationSlot"),On("lastExtendedSlot"),st("lastExtendedStartIndex"),st(),Bn(Xe(),ao(st(),-1),"authority")])},h3=/^[^:]+:\/\/([^:[]+|\[[^\]]+\])(:\d+)?(.*)/i;function p3(t){const e=t.match(h3);if(e==null)throw TypeError(`Failed to validate endpoint URL \`${t}\``);const[n,r,i,s]=e,o=t.startsWith("https:")?"wss:":"ws:",a=i==null?null:parseInt(i.slice(1),10),c=a==null?"":`:${a+1}`;return`${o}//${r}${c}${s}`}const Wt=ad(Ww(ie),he(),t=>new ie(t)),lI=Hw([he(),Bt("base64")]),qw=ad(Ww(re.Buffer),lI,t=>re.Buffer.from(t[0],"base64")),uI=30*1e3;function g3(t){if(/^https?:/.test(t)===!1)throw new TypeError("Endpoint URL must start with `http:` or `https:`.");return t}function St(t){let e,n;if(typeof t=="string")e=t;else if(t){const{commitment:r,...i}=t;e=r,n=i}return{commitment:e,config:n}}function T1(t){return t.map(e=>"memcmp"in e?{...e,memcmp:{...e.memcmp,encoding:e.memcmp.encoding??"base58"}}:e)}function dI(t){return nr([se({jsonrpc:Bt("2.0"),id:he(),result:t}),se({jsonrpc:Bt("2.0"),id:he(),error:se({code:tl(),message:he(),data:Oe(CL())})})])}const y3=dI(tl());function Ge(t){return ad(dI(t),y3,e=>"error"in e?e:{...e,result:ye(e.result,t)})}function $t(t){return Ge(se({context:se({slot:K()}),value:t}))}function gp(t){return se({context:se({slot:K()}),value:t})}function K0(t,e){return t===0?new ya({header:e.header,staticAccountKeys:e.accountKeys.map(n=>new ie(n)),recentBlockhash:e.recentBlockhash,compiledInstructions:e.instructions.map(n=>({programIdIndex:n.programIdIndex,accountKeyIndexes:n.accounts,data:jt.decode(n.data)})),addressTableLookups:e.addressTableLookups}):new pi(e)}const m3=se({foundation:K(),foundationTerm:K(),initial:K(),taper:K(),terminal:K()}),w3=Ge(we(_e(se({epoch:K(),effectiveSlot:K(),amount:K(),postBalance:K(),commission:Oe(_e(K()))})))),_3=we(se({slot:K(),prioritizationFee:K()})),v3=se({total:K(),validator:K(),foundation:K(),epoch:K()}),b3=se({epoch:K(),slotIndex:K(),slotsInEpoch:K(),absoluteSlot:K(),blockHeight:Oe(K()),transactionCount:Oe(K())}),E3=se({slotsPerEpoch:K(),leaderScheduleSlotOffset:K(),warmup:Bi(),firstNormalEpoch:K(),firstNormalSlot:K()}),x3=FA(he(),we(K())),ka=_e(nr([se({}),he()])),S3=se({err:ka}),A3=Bt("receivedSignature"),I3=se({"solana-core":he(),"feature-set":Oe(K())}),k3=se({program:he(),programId:Wt,parsed:tl()}),R3=se({programId:Wt,accounts:we(Wt),data:he()}),M1=$t(se({err:_e(nr([se({}),he()])),logs:_e(we(he())),accounts:Oe(_e(we(_e(se({executable:Bi(),owner:he(),lamports:K(),data:we(he()),rentEpoch:Oe(K())}))))),unitsConsumed:Oe(K()),returnData:Oe(_e(se({programId:he(),data:Hw([he(),Bt("base64")])}))),innerInstructions:Oe(_e(we(se({index:K(),instructions:we(nr([k3,R3]))}))))})),N3=$t(se({byIdentity:FA(he(),we(K())),range:se({firstSlot:K(),lastSlot:K()})}));function T3(t,e,n,r,i,s){const o=n||l3;let a;s!=null&&console.warn("You have supplied an `httpAgent` when creating a `Connection` in a browser environment.It has been ignored; `httpAgent` is only used in Node environments.");let c;return r&&(c=async(u,f)=>{const g=await new Promise((p,_)=>{try{r(u,f,(A,S)=>p([A,S]))}catch(A){_(A)}});return await o(...g)}),new o4(async(u,f)=>{const g={method:"POST",body:u,agent:a,headers:Object.assign({"Content-Type":"application/json"},e||{},MD)};try{let p=5,_,A=500;for(;c?_=await c(t,g):_=await o(t,g),!(_.status!==429||i===!0||(p-=1,p===0));)console.error(`Server responded with ${_.status} ${_.statusText}. Retrying after ${A}ms delay...`),await Ho(A),A*=2;const S=await _.text();_.ok?f(null,S):f(new Error(`${_.status} ${_.statusText}: ${S}`))}catch(p){p instanceof Error&&f(p)}},{})}function M3(t){return(e,n)=>new Promise((r,i)=>{t.request(e,n,(s,o)=>{if(s){i(s);return}r(o)})})}function O3(t){return e=>new Promise((n,r)=>{e.length===0&&n([]);const i=e.map(s=>t.request(s.methodName,s.args));t.request(i,(s,o)=>{if(s){r(s);return}n(o)})})}const C3=Ge(m3),L3=Ge(v3),D3=Ge(_3),P3=Ge(b3),B3=Ge(E3),z3=Ge(x3),j3=Ge(K()),U3=$t(se({total:K(),circulating:K(),nonCirculating:K(),nonCirculatingAccounts:we(Wt)})),Cy=se({amount:he(),uiAmount:_e(K()),decimals:K(),uiAmountString:Oe(he())}),F3=$t(we(se({address:Wt,amount:he(),uiAmount:_e(K()),decimals:K(),uiAmountString:Oe(he())}))),W3=$t(we(se({pubkey:Wt,account:se({executable:Bi(),owner:Wt,lamports:K(),data:qw,rentEpoch:K()})}))),Ly=se({program:he(),parsed:tl(),space:K()}),H3=$t(we(se({pubkey:Wt,account:se({executable:Bi(),owner:Wt,lamports:K(),data:Ly,rentEpoch:K()})}))),$3=$t(we(se({lamports:K(),address:Wt}))),Su=se({executable:Bi(),owner:Wt,lamports:K(),data:qw,rentEpoch:K()}),V3=se({pubkey:Wt,account:Su}),Z3=ad(nr([Ww(re.Buffer),Ly]),nr([lI,Ly]),t=>Array.isArray(t)?ye(t,qw):t),Dy=se({executable:Bi(),owner:Wt,lamports:K(),data:Z3,rentEpoch:K()}),K3=se({pubkey:Wt,account:Dy}),G3=se({state:nr([Bt("active"),Bt("inactive"),Bt("activating"),Bt("deactivating")]),active:K(),inactive:K()}),Y3=Ge(we(se({signature:he(),slot:K(),err:ka,memo:_e(he()),blockTime:Oe(_e(K()))}))),q3=Ge(we(se({signature:he(),slot:K(),err:ka,memo:_e(he()),blockTime:Oe(_e(K()))}))),Q3=se({subscription:K(),result:gp(Su)}),X3=se({pubkey:Wt,account:Su}),J3=se({subscription:K(),result:gp(X3)}),eD=se({parent:K(),slot:K(),root:K()}),tD=se({subscription:K(),result:eD}),nD=nr([se({type:nr([Bt("firstShredReceived"),Bt("completed"),Bt("optimisticConfirmation"),Bt("root")]),slot:K(),timestamp:K()}),se({type:Bt("createdBank"),parent:K(),slot:K(),timestamp:K()}),se({type:Bt("frozen"),slot:K(),timestamp:K(),stats:se({numTransactionEntries:K(),numSuccessfulTransactions:K(),numFailedTransactions:K(),maxTransactionsPerEntry:K()})}),se({type:Bt("dead"),slot:K(),timestamp:K(),err:he()})]),rD=se({subscription:K(),result:nD}),iD=se({subscription:K(),result:gp(nr([S3,A3]))}),sD=se({subscription:K(),result:K()}),oD=se({pubkey:he(),gossip:_e(he()),tpu:_e(he()),rpc:_e(he()),version:_e(he())}),O1=se({votePubkey:he(),nodePubkey:he(),activatedStake:K(),epochVoteAccount:Bi(),epochCredits:we(Hw([K(),K(),K()])),commission:K(),lastVote:K(),rootSlot:_e(K())}),aD=Ge(se({current:we(O1),delinquent:we(O1)})),cD=nr([Bt("processed"),Bt("confirmed"),Bt("finalized")]),lD=se({slot:K(),confirmations:_e(K()),err:ka,confirmationStatus:Oe(cD)}),uD=$t(we(_e(lD))),dD=Ge(K()),fI=se({accountKey:Wt,writableIndexes:we(K()),readonlyIndexes:we(K())}),Qw=se({signatures:we(he()),message:se({accountKeys:we(he()),header:se({numRequiredSignatures:K(),numReadonlySignedAccounts:K(),numReadonlyUnsignedAccounts:K()}),instructions:we(se({accounts:we(K()),data:he(),programIdIndex:K()})),recentBlockhash:he(),addressTableLookups:Oe(we(fI))})}),hI=se({pubkey:Wt,signer:Bi(),writable:Bi(),source:Oe(nr([Bt("transaction"),Bt("lookupTable")]))}),pI=se({accountKeys:we(hI),signatures:we(he())}),gI=se({parsed:tl(),program:he(),programId:Wt}),yI=se({accounts:we(Wt),data:he(),programId:Wt}),fD=nr([yI,gI]),hD=nr([se({parsed:tl(),program:he(),programId:he()}),se({accounts:we(he()),data:he(),programId:he()})]),mI=ad(fD,hD,t=>"accounts"in t?ye(t,yI):ye(t,gI)),wI=se({signatures:we(he()),message:se({accountKeys:we(hI),instructions:we(mI),recentBlockhash:he(),addressTableLookups:Oe(_e(we(fI)))})}),lh=se({accountIndex:K(),mint:he(),owner:Oe(he()),uiTokenAmount:Cy}),_I=se({writable:we(Wt),readonly:we(Wt)}),yp=se({err:ka,fee:K(),innerInstructions:Oe(_e(we(se({index:K(),instructions:we(se({accounts:we(K()),data:he(),programIdIndex:K()}))})))),preBalances:we(K()),postBalances:we(K()),logMessages:Oe(_e(we(he()))),preTokenBalances:Oe(_e(we(lh))),postTokenBalances:Oe(_e(we(lh))),loadedAddresses:Oe(_I),computeUnitsConsumed:Oe(K())}),Xw=se({err:ka,fee:K(),innerInstructions:Oe(_e(we(se({index:K(),instructions:we(mI)})))),preBalances:we(K()),postBalances:we(K()),logMessages:Oe(_e(we(he()))),preTokenBalances:Oe(_e(we(lh))),postTokenBalances:Oe(_e(we(lh))),loadedAddresses:Oe(_I),computeUnitsConsumed:Oe(K())}),nl=nr([Bt(0),Bt("legacy")]),Ra=se({pubkey:he(),lamports:K(),postBalance:_e(K()),rewardType:_e(he()),commission:Oe(_e(K()))}),pD=Ge(_e(se({blockhash:he(),previousBlockhash:he(),parentSlot:K(),transactions:we(se({transaction:Qw,meta:_e(yp),version:Oe(nl)})),rewards:Oe(we(Ra)),blockTime:_e(K()),blockHeight:_e(K())}))),gD=Ge(_e(se({blockhash:he(),previousBlockhash:he(),parentSlot:K(),rewards:Oe(we(Ra)),blockTime:_e(K()),blockHeight:_e(K())}))),yD=Ge(_e(se({blockhash:he(),previousBlockhash:he(),parentSlot:K(),transactions:we(se({transaction:pI,meta:_e(yp),version:Oe(nl)})),rewards:Oe(we(Ra)),blockTime:_e(K()),blockHeight:_e(K())}))),mD=Ge(_e(se({blockhash:he(),previousBlockhash:he(),parentSlot:K(),transactions:we(se({transaction:wI,meta:_e(Xw),version:Oe(nl)})),rewards:Oe(we(Ra)),blockTime:_e(K()),blockHeight:_e(K())}))),wD=Ge(_e(se({blockhash:he(),previousBlockhash:he(),parentSlot:K(),transactions:we(se({transaction:pI,meta:_e(Xw),version:Oe(nl)})),rewards:Oe(we(Ra)),blockTime:_e(K()),blockHeight:_e(K())}))),_D=Ge(_e(se({blockhash:he(),previousBlockhash:he(),parentSlot:K(),rewards:Oe(we(Ra)),blockTime:_e(K()),blockHeight:_e(K())}))),vD=Ge(_e(se({blockhash:he(),previousBlockhash:he(),parentSlot:K(),transactions:we(se({transaction:Qw,meta:_e(yp)})),rewards:Oe(we(Ra)),blockTime:_e(K())}))),C1=Ge(_e(se({blockhash:he(),previousBlockhash:he(),parentSlot:K(),signatures:we(he()),blockTime:_e(K())}))),G0=Ge(_e(se({slot:K(),meta:_e(yp),blockTime:Oe(_e(K())),transaction:Qw,version:Oe(nl)}))),Vd=Ge(_e(se({slot:K(),transaction:wI,meta:_e(Xw),blockTime:Oe(_e(K())),version:Oe(nl)}))),bD=$t(se({blockhash:he(),feeCalculator:se({lamportsPerSignature:K()})})),ED=$t(se({blockhash:he(),lastValidBlockHeight:K()})),xD=$t(Bi()),SD=se({slot:K(),numTransactions:K(),numSlots:K(),samplePeriodSecs:K()}),AD=Ge(we(SD)),ID=$t(_e(se({feeCalculator:se({lamportsPerSignature:K()})}))),kD=Ge(he()),RD=Ge(he()),ND=se({err:ka,logs:we(he()),signature:he()}),TD=se({result:gp(ND),subscription:K()}),MD={"solana-client":"js/1.0.0-maintenance"};class Jw{constructor(e,n){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=(()=>{const l={};return async u=>{const{commitment:f,config:g}=St(u),p=this._buildArgs([],f,void 0,g),_=R1(p);return l[_]=l[_]??(async()=>{try{const A=await this._rpcRequest("getBlockHeight",p),S=ye(A,Ge(K()));if("error"in S)throw new Ie(S.error,"failed to get block height information");return S.result}finally{delete l[_]}})(),await l[_]}})();let r,i,s,o,a,c;n&&typeof n=="string"?this._commitment=n:n&&(this._commitment=n.commitment,this._confirmTransactionInitialTimeout=n.confirmTransactionInitialTimeout,r=n.wsEndpoint,i=n.httpHeaders,s=n.fetch,o=n.fetchMiddleware,a=n.disableRetryOnRateLimit,c=n.httpAgent),this._rpcEndpoint=g3(e),this._rpcWsEndpoint=r||p3(e),this._rpcClient=T3(e,i,s,o,a,c),this._rpcRequest=M3(this._rpcClient),this._rpcBatchRequest=O3(this._rpcClient),this._rpcWebSocket=new u3(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(e,n){const{commitment:r,config:i}=St(n),s=this._buildArgs([e.toBase58()],r,void 0,i),o=await this._rpcRequest("getBalance",s),a=ye(o,$t(K()));if("error"in a)throw new Ie(a.error,`failed to get balance for ${e.toBase58()}`);return a.result}async getBalance(e,n){return await this.getBalanceAndContext(e,n).then(r=>r.value).catch(r=>{throw new Error("failed to get balance of account "+e.toBase58()+": "+r)})}async getBlockTime(e){const n=await this._rpcRequest("getBlockTime",[e]),r=ye(n,Ge(_e(K())));if("error"in r)throw new Ie(r.error,`failed to get block time for slot ${e}`);return r.result}async getMinimumLedgerSlot(){const e=await this._rpcRequest("minimumLedgerSlot",[]),n=ye(e,Ge(K()));if("error"in n)throw new Ie(n.error,"failed to get minimum ledger slot");return n.result}async getFirstAvailableBlock(){const e=await this._rpcRequest("getFirstAvailableBlock",[]),n=ye(e,j3);if("error"in n)throw new Ie(n.error,"failed to get first available block");return n.result}async getSupply(e){let n={};typeof e=="string"?n={commitment:e}:e?n={...e,commitment:e&&e.commitment||this.commitment}:n={commitment:this.commitment};const r=await this._rpcRequest("getSupply",[n]),i=ye(r,U3);if("error"in i)throw new Ie(i.error,"failed to get supply");return i.result}async getTokenSupply(e,n){const r=this._buildArgs([e.toBase58()],n),i=await this._rpcRequest("getTokenSupply",r),s=ye(i,$t(Cy));if("error"in s)throw new Ie(s.error,"failed to get token supply");return s.result}async getTokenAccountBalance(e,n){const r=this._buildArgs([e.toBase58()],n),i=await this._rpcRequest("getTokenAccountBalance",r),s=ye(i,$t(Cy));if("error"in s)throw new Ie(s.error,"failed to get token account balance");return s.result}async getTokenAccountsByOwner(e,n,r){const{commitment:i,config:s}=St(r);let o=[e.toBase58()];"mint"in n?o.push({mint:n.mint.toBase58()}):o.push({programId:n.programId.toBase58()});const a=this._buildArgs(o,i,"base64",s),c=await this._rpcRequest("getTokenAccountsByOwner",a),l=ye(c,W3);if("error"in l)throw new Ie(l.error,`failed to get token accounts owned by account ${e.toBase58()}`);return l.result}async getParsedTokenAccountsByOwner(e,n,r){let i=[e.toBase58()];"mint"in n?i.push({mint:n.mint.toBase58()}):i.push({programId:n.programId.toBase58()});const s=this._buildArgs(i,r,"jsonParsed"),o=await this._rpcRequest("getTokenAccountsByOwner",s),a=ye(o,H3);if("error"in a)throw new Ie(a.error,`failed to get token accounts owned by account ${e.toBase58()}`);return a.result}async getLargestAccounts(e){const n={...e,commitment:e&&e.commitment||this.commitment},r=n.filter||n.commitment?[n]:[],i=await this._rpcRequest("getLargestAccounts",r),s=ye(i,$3);if("error"in s)throw new Ie(s.error,"failed to get largest accounts");return s.result}async getTokenLargestAccounts(e,n){const r=this._buildArgs([e.toBase58()],n),i=await this._rpcRequest("getTokenLargestAccounts",r),s=ye(i,F3);if("error"in s)throw new Ie(s.error,"failed to get token largest accounts");return s.result}async getAccountInfoAndContext(e,n){const{commitment:r,config:i}=St(n),s=this._buildArgs([e.toBase58()],r,"base64",i),o=await this._rpcRequest("getAccountInfo",s),a=ye(o,$t(_e(Su)));if("error"in a)throw new Ie(a.error,`failed to get info about account ${e.toBase58()}`);return a.result}async getParsedAccountInfo(e,n){const{commitment:r,config:i}=St(n),s=this._buildArgs([e.toBase58()],r,"jsonParsed",i),o=await this._rpcRequest("getAccountInfo",s),a=ye(o,$t(_e(Dy)));if("error"in a)throw new Ie(a.error,`failed to get info about account ${e.toBase58()}`);return a.result}async getAccountInfo(e,n){try{return(await this.getAccountInfoAndContext(e,n)).value}catch(r){throw new Error("failed to get info about account "+e.toBase58()+": "+r)}}async getMultipleParsedAccounts(e,n){const{commitment:r,config:i}=St(n),s=e.map(l=>l.toBase58()),o=this._buildArgs([s],r,"jsonParsed",i),a=await this._rpcRequest("getMultipleAccounts",o),c=ye(a,$t(we(_e(Dy))));if("error"in c)throw new Ie(c.error,`failed to get info for accounts ${s}`);return c.result}async getMultipleAccountsInfoAndContext(e,n){const{commitment:r,config:i}=St(n),s=e.map(l=>l.toBase58()),o=this._buildArgs([s],r,"base64",i),a=await this._rpcRequest("getMultipleAccounts",o),c=ye(a,$t(we(_e(Su))));if("error"in c)throw new Ie(c.error,`failed to get info for accounts ${s}`);return c.result}async getMultipleAccountsInfo(e,n){return(await this.getMultipleAccountsInfoAndContext(e,n)).value}async getStakeActivation(e,n,r){const{commitment:i,config:s}=St(n),o=this._buildArgs([e.toBase58()],i,void 0,{...s,epoch:r??(s==null?void 0:s.epoch)}),a=await this._rpcRequest("getStakeActivation",o),c=ye(a,Ge(G3));if("error"in c)throw new Ie(c.error,`failed to get Stake Activation ${e.toBase58()}`);return c.result}async getProgramAccounts(e,n){const{commitment:r,config:i}=St(n),{encoding:s,...o}=i||{},a=this._buildArgs([e.toBase58()],r,s||"base64",{...o,...o.filters?{filters:T1(o.filters)}:null}),c=await this._rpcRequest("getProgramAccounts",a),l=we(V3),u=o.withContext===!0?ye(c,$t(l)):ye(c,Ge(l));if("error"in u)throw new Ie(u.error,`failed to get accounts owned by program ${e.toBase58()}`);return u.result}async getParsedProgramAccounts(e,n){const{commitment:r,config:i}=St(n),s=this._buildArgs([e.toBase58()],r,"jsonParsed",i),o=await this._rpcRequest("getProgramAccounts",s),a=ye(o,Ge(we(K3)));if("error"in a)throw new Ie(a.error,`failed to get accounts owned by program ${e.toBase58()}`);return a.result}async confirmTransaction(e,n){var s;let r;if(typeof e=="string")r=e;else{const o=e;if((s=o.abortSignal)!=null&&s.aborted)return Promise.reject(o.abortSignal.reason);r=o.signature}let i;try{i=jt.decode(r)}catch{throw new Error("signature must be base58 encoded: "+r)}return lt(i.length===64,"signature has invalid length"),typeof e=="string"?await this.confirmTransactionUsingLegacyTimeoutStrategy({commitment:n||this.commitment,signature:r}):"lastValidBlockHeight"in e?await this.confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:n||this.commitment,strategy:e}):await this.confirmTransactionUsingDurableNonceStrategy({commitment:n||this.commitment,strategy:e})}getCancellationPromise(e){return new Promise((n,r)=>{e!=null&&(e.aborted?r(e.reason):e.addEventListener("abort",()=>{r(e.reason)}))})}getTransactionConfirmationPromise({commitment:e,signature:n}){let r,i,s=!1;const o=new Promise((c,l)=>{try{r=this.onSignature(n,(f,g)=>{r=void 0;const p={context:g,value:f};c({__type:Qi.PROCESSED,response:p})},e);const u=new Promise(f=>{r==null?f():i=this._onSubscriptionStateChange(r,g=>{g==="subscribed"&&f()})});(async()=>{if(await u,s)return;const f=await this.getSignatureStatus(n);if(s||f==null)return;const{context:g,value:p}=f;if(p!=null)if(p!=null&&p.err)l(p.err);else{switch(e){case"confirmed":case"single":case"singleGossip":{if(p.confirmationStatus==="processed")return;break}case"finalized":case"max":case"root":{if(p.confirmationStatus==="processed"||p.confirmationStatus==="confirmed")return;break}case"processed":case"recent":}s=!0,c({__type:Qi.PROCESSED,response:{context:g,value:p}})}})()}catch(u){l(u)}});return{abortConfirmation:()=>{i&&(i(),i=void 0),r!=null&&(this.removeSignatureListener(r),r=void 0)},confirmationPromise:o}}async confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:e,strategy:{abortSignal:n,lastValidBlockHeight:r,signature:i}}){let s=!1;const o=new Promise(f=>{const g=async()=>{try{return await this.getBlockHeight(e)}catch{return-1}};(async()=>{let p=await g();if(!s){for(;p<=r;)if(await Ho(1e3),s||(p=await g(),s))return;f({__type:Qi.BLOCKHEIGHT_EXCEEDED})}})()}),{abortConfirmation:a,confirmationPromise:c}=this.getTransactionConfirmationPromise({commitment:e,signature:i}),l=this.getCancellationPromise(n);let u;try{const f=await Promise.race([l,c,o]);if(f.__type===Qi.PROCESSED)u=f.response;else throw new Kw(i)}finally{s=!0,a()}return u}async confirmTransactionUsingDurableNonceStrategy({commitment:e,strategy:{abortSignal:n,minContextSlot:r,nonceAccountPubkey:i,nonceValue:s,signature:o}}){let a=!1;const c=new Promise(p=>{let _=s,A=null;const S=async()=>{try{const{context:E,value:b}=await this.getNonceAndContext(i,{commitment:e,minContextSlot:r});return A=E.slot,b==null?void 0:b.nonce}catch{return _}};(async()=>{if(_=await S(),!a)for(;;){if(s!==_){p({__type:Qi.NONCE_INVALID,slotInWhichNonceDidAdvance:A});return}if(await Ho(2e3),a||(_=await S(),a))return}})()}),{abortConfirmation:l,confirmationPromise:u}=this.getTransactionConfirmationPromise({commitment:e,signature:o}),f=this.getCancellationPromise(n);let g;try{const p=await Promise.race([f,u,c]);if(p.__type===Qi.PROCESSED)g=p.response;else{let _;for(;;){const A=await this.getSignatureStatus(o);if(A==null)break;if(A.context.slot<(p.slotInWhichNonceDidAdvance??r)){await Ho(400);continue}_=A;break}if(_!=null&&_.value){const A=e||"finalized",{confirmationStatus:S}=_.value;switch(A){case"processed":case"recent":if(S!=="processed"&&S!=="confirmed"&&S!=="finalized")throw new tc(o);break;case"confirmed":case"single":case"singleGossip":if(S!=="confirmed"&&S!=="finalized")throw new tc(o);break;case"finalized":case"max":case"root":if(S!=="finalized")throw new tc(o);break;default:}g={context:_.context,value:{err:_.value.err}}}else throw new tc(o)}}finally{a=!0,l()}return g}async confirmTransactionUsingLegacyTimeoutStrategy({commitment:e,signature:n}){let r;const i=new Promise(c=>{let l=this._confirmTransactionInitialTimeout||6e4;switch(e){case"processed":case"recent":case"single":case"confirmed":case"singleGossip":{l=this._confirmTransactionInitialTimeout||3e4;break}}r=setTimeout(()=>c({__type:Qi.TIMED_OUT,timeoutMs:l}),l)}),{abortConfirmation:s,confirmationPromise:o}=this.getTransactionConfirmationPromise({commitment:e,signature:n});let a;try{const c=await Promise.race([o,i]);if(c.__type===Qi.PROCESSED)a=c.response;else throw new Gw(n,c.timeoutMs/1e3)}finally{clearTimeout(r),s()}return a}async getClusterNodes(){const e=await this._rpcRequest("getClusterNodes",[]),n=ye(e,Ge(we(oD)));if("error"in n)throw new Ie(n.error,"failed to get cluster nodes");return n.result}async getVoteAccounts(e){const n=this._buildArgs([],e),r=await this._rpcRequest("getVoteAccounts",n),i=ye(r,aD);if("error"in i)throw new Ie(i.error,"failed to get vote accounts");return i.result}async getSlot(e){const{commitment:n,config:r}=St(e),i=this._buildArgs([],n,void 0,r),s=await this._rpcRequest("getSlot",i),o=ye(s,Ge(K()));if("error"in o)throw new Ie(o.error,"failed to get slot");return o.result}async getSlotLeader(e){const{commitment:n,config:r}=St(e),i=this._buildArgs([],n,void 0,r),s=await this._rpcRequest("getSlotLeader",i),o=ye(s,Ge(he()));if("error"in o)throw new Ie(o.error,"failed to get slot leader");return o.result}async getSlotLeaders(e,n){const r=[e,n],i=await this._rpcRequest("getSlotLeaders",r),s=ye(i,Ge(we(Wt)));if("error"in s)throw new Ie(s.error,"failed to get slot leaders");return s.result}async getSignatureStatus(e,n){const{context:r,value:i}=await this.getSignatureStatuses([e],n);lt(i.length===1);const s=i[0];return{context:r,value:s}}async getSignatureStatuses(e,n){const r=[e];n&&r.push(n);const i=await this._rpcRequest("getSignatureStatuses",r),s=ye(i,uD);if("error"in s)throw new Ie(s.error,"failed to get signature status");return s.result}async getTransactionCount(e){const{commitment:n,config:r}=St(e),i=this._buildArgs([],n,void 0,r),s=await this._rpcRequest("getTransactionCount",i),o=ye(s,Ge(K()));if("error"in o)throw new Ie(o.error,"failed to get transaction count");return o.result}async getTotalSupply(e){return(await this.getSupply({commitment:e,excludeNonCirculatingAccountsList:!0})).value.total}async getInflationGovernor(e){const n=this._buildArgs([],e),r=await this._rpcRequest("getInflationGovernor",n),i=ye(r,C3);if("error"in i)throw new Ie(i.error,"failed to get inflation");return i.result}async getInflationReward(e,n,r){const{commitment:i,config:s}=St(r),o=this._buildArgs([e.map(l=>l.toBase58())],i,void 0,{...s,epoch:n??(s==null?void 0:s.epoch)}),a=await this._rpcRequest("getInflationReward",o),c=ye(a,w3);if("error"in c)throw new Ie(c.error,"failed to get inflation reward");return c.result}async getInflationRate(){const e=await this._rpcRequest("getInflationRate",[]),n=ye(e,L3);if("error"in n)throw new Ie(n.error,"failed to get inflation rate");return n.result}async getEpochInfo(e){const{commitment:n,config:r}=St(e),i=this._buildArgs([],n,void 0,r),s=await this._rpcRequest("getEpochInfo",i),o=ye(s,P3);if("error"in o)throw new Ie(o.error,"failed to get epoch info");return o.result}async getEpochSchedule(){const e=await this._rpcRequest("getEpochSchedule",[]),n=ye(e,B3);if("error"in n)throw new Ie(n.error,"failed to get epoch schedule");const r=n.result;return new cI(r.slotsPerEpoch,r.leaderScheduleSlotOffset,r.warmup,r.firstNormalEpoch,r.firstNormalSlot)}async getLeaderSchedule(){const e=await this._rpcRequest("getLeaderSchedule",[]),n=ye(e,z3);if("error"in n)throw new Ie(n.error,"failed to get leader schedule");return n.result}async getMinimumBalanceForRentExemption(e,n){const r=this._buildArgs([e],n),i=await this._rpcRequest("getMinimumBalanceForRentExemption",r),s=ye(i,dD);return"error"in s?(console.warn("Unable to fetch minimum balance for rent exemption"),0):s.result}async getRecentBlockhashAndContext(e){const n=this._buildArgs([],e),r=await this._rpcRequest("getRecentBlockhash",n),i=ye(r,bD);if("error"in i)throw new Ie(i.error,"failed to get recent blockhash");return i.result}async getRecentPerformanceSamples(e){const n=await this._rpcRequest("getRecentPerformanceSamples",e?[e]:[]),r=ye(n,AD);if("error"in r)throw new Ie(r.error,"failed to get recent performance samples");return r.result}async getFeeCalculatorForBlockhash(e,n){const r=this._buildArgs([e],n),i=await this._rpcRequest("getFeeCalculatorForBlockhash",r),s=ye(i,ID);if("error"in s)throw new Ie(s.error,"failed to get fee calculator");const{context:o,value:a}=s.result;return{context:o,value:a!==null?a.feeCalculator:null}}async getFeeForMessage(e,n){const r=Ye(e.serialize()).toString("base64"),i=this._buildArgs([r],n),s=await this._rpcRequest("getFeeForMessage",i),o=ye(s,$t(_e(K())));if("error"in o)throw new Ie(o.error,"failed to get fee for message");if(o.result===null)throw new Error("invalid blockhash");return o.result}async getRecentPrioritizationFees(e){var o;const n=(o=e==null?void 0:e.lockedWritableAccounts)==null?void 0:o.map(a=>a.toBase58()),r=n!=null&&n.length?[n]:[],i=await this._rpcRequest("getRecentPrioritizationFees",r),s=ye(i,D3);if("error"in s)throw new Ie(s.error,"failed to get recent prioritization fees");return s.result}async getRecentBlockhash(e){try{return(await this.getRecentBlockhashAndContext(e)).value}catch(n){throw new Error("failed to get recent blockhash: "+n)}}async getLatestBlockhash(e){try{return(await this.getLatestBlockhashAndContext(e)).value}catch(n){throw new Error("failed to get recent blockhash: "+n)}}async getLatestBlockhashAndContext(e){const{commitment:n,config:r}=St(e),i=this._buildArgs([],n,void 0,r),s=await this._rpcRequest("getLatestBlockhash",i),o=ye(s,ED);if("error"in o)throw new Ie(o.error,"failed to get latest blockhash");return o.result}async isBlockhashValid(e,n){const{commitment:r,config:i}=St(n),s=this._buildArgs([e],r,void 0,i),o=await this._rpcRequest("isBlockhashValid",s),a=ye(o,xD);if("error"in a)throw new Ie(a.error,"failed to determine if the blockhash `"+e+"`is valid");return a.result}async getVersion(){const e=await this._rpcRequest("getVersion",[]),n=ye(e,Ge(I3));if("error"in n)throw new Ie(n.error,"failed to get version");return n.result}async getGenesisHash(){const e=await this._rpcRequest("getGenesisHash",[]),n=ye(e,Ge(he()));if("error"in n)throw new Ie(n.error,"failed to get genesis hash");return n.result}async getBlock(e,n){const{commitment:r,config:i}=St(n),s=this._buildArgsAtLeastConfirmed([e],r,void 0,i),o=await this._rpcRequest("getBlock",s);try{switch(i==null?void 0:i.transactionDetails){case"accounts":{const a=ye(o,yD);if("error"in a)throw a.error;return a.result}case"none":{const a=ye(o,gD);if("error"in a)throw a.error;return a.result}default:{const a=ye(o,pD);if("error"in a)throw a.error;const{result:c}=a;return c?{...c,transactions:c.transactions.map(({transaction:l,meta:u,version:f})=>({meta:u,transaction:{...l,message:K0(f,l.message)},version:f}))}:null}}}catch(a){throw new Ie(a,"failed to get confirmed block")}}async getParsedBlock(e,n){const{commitment:r,config:i}=St(n),s=this._buildArgsAtLeastConfirmed([e],r,"jsonParsed",i),o=await this._rpcRequest("getBlock",s);try{switch(i==null?void 0:i.transactionDetails){case"accounts":{const a=ye(o,wD);if("error"in a)throw a.error;return a.result}case"none":{const a=ye(o,_D);if("error"in a)throw a.error;return a.result}default:{const a=ye(o,mD);if("error"in a)throw a.error;return a.result}}}catch(a){throw new Ie(a,"failed to get block")}}async getBlockProduction(e){let n,r;if(typeof e=="string")r=e;else if(e){const{commitment:a,...c}=e;r=a,n=c}const i=this._buildArgs([],r,"base64",n),s=await this._rpcRequest("getBlockProduction",i),o=ye(s,N3);if("error"in o)throw new Ie(o.error,"failed to get block production information");return o.result}async getTransaction(e,n){const{commitment:r,config:i}=St(n),s=this._buildArgsAtLeastConfirmed([e],r,void 0,i),o=await this._rpcRequest("getTransaction",s),a=ye(o,G0);if("error"in a)throw new Ie(a.error,"failed to get transaction");const c=a.result;return c&&{...c,transaction:{...c.transaction,message:K0(c.version,c.transaction.message)}}}async getParsedTransaction(e,n){const{commitment:r,config:i}=St(n),s=this._buildArgsAtLeastConfirmed([e],r,"jsonParsed",i),o=await this._rpcRequest("getTransaction",s),a=ye(o,Vd);if("error"in a)throw new Ie(a.error,"failed to get transaction");return a.result}async getParsedTransactions(e,n){const{commitment:r,config:i}=St(n),s=e.map(c=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([c],r,"jsonParsed",i)}));return(await this._rpcBatchRequest(s)).map(c=>{const l=ye(c,Vd);if("error"in l)throw new Ie(l.error,"failed to get transactions");return l.result})}async getTransactions(e,n){const{commitment:r,config:i}=St(n),s=e.map(c=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([c],r,void 0,i)}));return(await this._rpcBatchRequest(s)).map(c=>{const l=ye(c,G0);if("error"in l)throw new Ie(l.error,"failed to get transactions");const u=l.result;return u&&{...u,transaction:{...u.transaction,message:K0(u.version,u.transaction.message)}}})}async getConfirmedBlock(e,n){const r=this._buildArgsAtLeastConfirmed([e],n),i=await this._rpcRequest("getConfirmedBlock",r),s=ye(i,vD);if("error"in s)throw new Ie(s.error,"failed to get confirmed block");const o=s.result;if(!o)throw new Error("Confirmed block "+e+" not found");const a={...o,transactions:o.transactions.map(({transaction:c,meta:l})=>{const u=new pi(c.message);return{meta:l,transaction:{...c,message:u}}})};return{...a,transactions:a.transactions.map(({transaction:c,meta:l})=>({meta:l,transaction:Je.populate(c.message,c.signatures)}))}}async getBlocks(e,n,r){const i=this._buildArgsAtLeastConfirmed(n!==void 0?[e,n]:[e],r),s=await this._rpcRequest("getBlocks",i),o=ye(s,Ge(we(K())));if("error"in o)throw new Ie(o.error,"failed to get blocks");return o.result}async getBlockSignatures(e,n){const r=this._buildArgsAtLeastConfirmed([e],n,void 0,{transactionDetails:"signatures",rewards:!1}),i=await this._rpcRequest("getBlock",r),s=ye(i,C1);if("error"in s)throw new Ie(s.error,"failed to get block");const o=s.result;if(!o)throw new Error("Block "+e+" not found");return o}async getConfirmedBlockSignatures(e,n){const r=this._buildArgsAtLeastConfirmed([e],n,void 0,{transactionDetails:"signatures",rewards:!1}),i=await this._rpcRequest("getConfirmedBlock",r),s=ye(i,C1);if("error"in s)throw new Ie(s.error,"failed to get confirmed block");const o=s.result;if(!o)throw new Error("Confirmed block "+e+" not found");return o}async getConfirmedTransaction(e,n){const r=this._buildArgsAtLeastConfirmed([e],n),i=await this._rpcRequest("getConfirmedTransaction",r),s=ye(i,G0);if("error"in s)throw new Ie(s.error,"failed to get transaction");const o=s.result;if(!o)return o;const a=new pi(o.transaction.message),c=o.transaction.signatures;return{...o,transaction:Je.populate(a,c)}}async getParsedConfirmedTransaction(e,n){const r=this._buildArgsAtLeastConfirmed([e],n,"jsonParsed"),i=await this._rpcRequest("getConfirmedTransaction",r),s=ye(i,Vd);if("error"in s)throw new Ie(s.error,"failed to get confirmed transaction");return s.result}async getParsedConfirmedTransactions(e,n){const r=e.map(o=>({methodName:"getConfirmedTransaction",args:this._buildArgsAtLeastConfirmed([o],n,"jsonParsed")}));return(await this._rpcBatchRequest(r)).map(o=>{const a=ye(o,Vd);if("error"in a)throw new Ie(a.error,"failed to get confirmed transactions");return a.result})}async getConfirmedSignaturesForAddress(e,n,r){let i={},s=await this.getFirstAvailableBlock();for(;!("until"in i)&&(n--,!(n<=0||n<s));)try{const c=await this.getConfirmedBlockSignatures(n,"finalized");c.signatures.length>0&&(i.until=c.signatures[c.signatures.length-1].toString())}catch(c){if(c instanceof Error&&c.message.includes("skipped"))continue;throw c}let o=await this.getSlot("finalized");for(;!("before"in i)&&(r++,!(r>o));)try{const c=await this.getConfirmedBlockSignatures(r);c.signatures.length>0&&(i.before=c.signatures[c.signatures.length-1].toString())}catch(c){if(c instanceof Error&&c.message.includes("skipped"))continue;throw c}return(await this.getConfirmedSignaturesForAddress2(e,i)).map(c=>c.signature)}async getConfirmedSignaturesForAddress2(e,n,r){const i=this._buildArgsAtLeastConfirmed([e.toBase58()],r,void 0,n),s=await this._rpcRequest("getConfirmedSignaturesForAddress2",i),o=ye(s,Y3);if("error"in o)throw new Ie(o.error,"failed to get confirmed signatures for address");return o.result}async getSignaturesForAddress(e,n,r){const i=this._buildArgsAtLeastConfirmed([e.toBase58()],r,void 0,n),s=await this._rpcRequest("getSignaturesForAddress",i),o=ye(s,q3);if("error"in o)throw new Ie(o.error,"failed to get signatures for address");return o.result}async getAddressLookupTable(e,n){const{context:r,value:i}=await this.getAccountInfoAndContext(e,n);let s=null;return i!==null&&(s=new Oy({key:e,state:Oy.deserialize(i.data)})),{context:r,value:s}}async getNonceAndContext(e,n){const{context:r,value:i}=await this.getAccountInfoAndContext(e,n);let s=null;return i!==null&&(s=pp.fromAccountData(i.data)),{context:r,value:s}}async getNonce(e,n){return await this.getNonceAndContext(e,n).then(r=>r.value).catch(r=>{throw new Error("failed to get nonce for account "+e.toBase58()+": "+r)})}async requestAirdrop(e,n){const r=await this._rpcRequest("requestAirdrop",[e.toBase58(),n]),i=ye(r,kD);if("error"in i)throw new Ie(i.error,`airdrop to ${e.toBase58()} failed`);return i.result}async _blockhashWithExpiryBlockHeight(e){if(!e){for(;this._pollingBlockhash;)await Ho(100);const r=Date.now()-this._blockhashInfo.lastFetch>=uI;if(this._blockhashInfo.latestBlockhash!==null&&!r)return this._blockhashInfo.latestBlockhash}return await this._pollNewBlockhash()}async _pollNewBlockhash(){this._pollingBlockhash=!0;try{const e=Date.now(),n=this._blockhashInfo.latestBlockhash,r=n?n.blockhash:null;for(let i=0;i<50;i++){const s=await this.getLatestBlockhash("finalized");if(r!==s.blockhash)return this._blockhashInfo={latestBlockhash:s,lastFetch:Date.now(),transactionSignatures:[],simulatedSignatures:[]},s;await Ho(sI/2)}throw new Error(`Unable to obtain a new blockhash after ${Date.now()-e}ms`)}finally{this._pollingBlockhash=!1}}async getStakeMinimumDelegation(e){const{commitment:n,config:r}=St(e),i=this._buildArgs([],n,"base64",r),s=await this._rpcRequest("getStakeMinimumDelegation",i),o=ye(s,$t(K()));if("error"in o)throw new Ie(o.error,"failed to get stake minimum delegation");return o.result}async simulateTransaction(e,n,r){if("message"in e){const A=e.serialize(),S=re.Buffer.from(A).toString("base64");if(Array.isArray(n)||r!==void 0)throw new Error("Invalid arguments");const E=n||{};E.encoding="base64","commitment"in E||(E.commitment=this.commitment),n&&typeof n=="object"&&"innerInstructions"in n&&(E.innerInstructions=n.innerInstructions);const b=[S,E],x=await this._rpcRequest("simulateTransaction",b),M=ye(x,M1);if("error"in M)throw new Error("failed to simulate transaction: "+M.error.message);return M.result}let i;if(e instanceof Je){let _=e;i=new Je,i.feePayer=_.feePayer,i.instructions=e.instructions,i.nonceInfo=_.nonceInfo,i.signatures=_.signatures}else i=Je.populate(e),i._message=i._json=void 0;if(n!==void 0&&!Array.isArray(n))throw new Error("Invalid arguments");const s=n;if(i.nonceInfo&&s)i.sign(...s);else{let _=this._disableBlockhashCaching;for(;;){const A=await this._blockhashWithExpiryBlockHeight(_);if(i.lastValidBlockHeight=A.lastValidBlockHeight,i.recentBlockhash=A.blockhash,!s)break;if(i.sign(...s),!i.signature)throw new Error("!signature");const S=i.signature.toString("base64");if(!this._blockhashInfo.simulatedSignatures.includes(S)&&!this._blockhashInfo.transactionSignatures.includes(S)){this._blockhashInfo.simulatedSignatures.push(S);break}else _=!0}}const o=i._compile(),a=o.serialize(),l=i._serialize(a).toString("base64"),u={encoding:"base64",commitment:this.commitment};if(r){const _=(Array.isArray(r)?r:o.nonProgramIds()).map(A=>A.toBase58());u.accounts={encoding:"base64",addresses:_}}s&&(u.sigVerify=!0),n&&typeof n=="object"&&"innerInstructions"in n&&(u.innerInstructions=n.innerInstructions);const f=[l,u],g=await this._rpcRequest("simulateTransaction",f),p=ye(g,M1);if("error"in p){let _;if("data"in p.error&&(_=p.error.data.logs,_&&Array.isArray(_))){const A=` + `,S=A+_.join(A);console.error(p.error.message,S)}throw new mo({action:"simulate",signature:"",transactionMessage:p.error.message,logs:_})}return p.result}async sendTransaction(e,n,r){if("version"in e){if(n&&Array.isArray(n))throw new Error("Invalid arguments");const o=e.serialize();return await this.sendRawTransaction(o,n)}if(n===void 0||!Array.isArray(n))throw new Error("Invalid arguments");const i=n;if(e.nonceInfo)e.sign(...i);else{let o=this._disableBlockhashCaching;for(;;){const a=await this._blockhashWithExpiryBlockHeight(o);if(e.lastValidBlockHeight=a.lastValidBlockHeight,e.recentBlockhash=a.blockhash,e.sign(...i),!e.signature)throw new Error("!signature");const c=e.signature.toString("base64");if(this._blockhashInfo.transactionSignatures.includes(c))o=!0;else{this._blockhashInfo.transactionSignatures.push(c);break}}}const s=e.serialize();return await this.sendRawTransaction(s,r)}async sendRawTransaction(e,n){const r=Ye(e).toString("base64");return await this.sendEncodedTransaction(r,n)}async sendEncodedTransaction(e,n){const r={encoding:"base64"},i=n&&n.skipPreflight,s=i===!0?"processed":n&&n.preflightCommitment||this.commitment;n&&n.maxRetries!=null&&(r.maxRetries=n.maxRetries),n&&n.minContextSlot!=null&&(r.minContextSlot=n.minContextSlot),i&&(r.skipPreflight=i),s&&(r.preflightCommitment=s);const o=[e,r],a=await this._rpcRequest("sendTransaction",o),c=ye(a,RD);if("error"in c){let l;throw"data"in c.error&&(l=c.error.data.logs),new mo({action:i?"send":"simulate",signature:"",transactionMessage:c.error.message,logs:l})}return c.result}_wsOnOpen(){this._rpcWebSocketConnected=!0,this._rpcWebSocketHeartbeat=setInterval(()=>{(async()=>{try{await this._rpcWebSocket.notify("ping")}catch{}})()},5e3),this._updateSubscriptions()}_wsOnError(e){this._rpcWebSocketConnected=!1,console.error("ws error:",e.message)}_wsOnClose(e){if(this._rpcWebSocketConnected=!1,this._rpcWebSocketGeneration=(this._rpcWebSocketGeneration+1)%Number.MAX_SAFE_INTEGER,this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null),this._rpcWebSocketHeartbeat&&(clearInterval(this._rpcWebSocketHeartbeat),this._rpcWebSocketHeartbeat=null),e===1e3){this._updateSubscriptions();return}this._subscriptionCallbacksByServerSubscriptionId={},Object.entries(this._subscriptionsByHash).forEach(([n,r])=>{this._setSubscription(n,{...r,state:"pending"})})}_setSubscription(e,n){var i;const r=(i=this._subscriptionsByHash[e])==null?void 0:i.state;if(this._subscriptionsByHash[e]=n,r!==n.state){const s=this._subscriptionStateChangeCallbacksByHash[e];s&&s.forEach(o=>{try{o(n.state)}catch{}})}}_onSubscriptionStateChange(e,n){var s;const r=this._subscriptionHashByClientSubscriptionId[e];if(r==null)return()=>{};const i=(s=this._subscriptionStateChangeCallbacksByHash)[r]||(s[r]=new Set);return i.add(n),()=>{i.delete(n),i.size===0&&delete this._subscriptionStateChangeCallbacksByHash[r]}}async _updateSubscriptions(){if(Object.keys(this._subscriptionsByHash).length===0){this._rpcWebSocketConnected&&(this._rpcWebSocketConnected=!1,this._rpcWebSocketIdleTimeout=setTimeout(()=>{this._rpcWebSocketIdleTimeout=null;try{this._rpcWebSocket.close()}catch(r){r instanceof Error&&console.log(`Error when closing socket connection: ${r.message}`)}},500));return}if(this._rpcWebSocketIdleTimeout!==null&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketConnected=!0),!this._rpcWebSocketConnected){this._rpcWebSocket.connect();return}const e=this._rpcWebSocketGeneration,n=()=>e===this._rpcWebSocketGeneration;await Promise.all(Object.keys(this._subscriptionsByHash).map(async r=>{const i=this._subscriptionsByHash[r];if(i!==void 0)switch(i.state){case"pending":case"unsubscribed":if(i.callbacks.size===0){delete this._subscriptionsByHash[r],i.state==="unsubscribed"&&delete this._subscriptionCallbacksByServerSubscriptionId[i.serverSubscriptionId],await this._updateSubscriptions();return}await(async()=>{const{args:s,method:o}=i;try{this._setSubscription(r,{...i,state:"subscribing"});const a=await this._rpcWebSocket.call(o,s);this._setSubscription(r,{...i,serverSubscriptionId:a,state:"subscribed"}),this._subscriptionCallbacksByServerSubscriptionId[a]=i.callbacks,await this._updateSubscriptions()}catch(a){if(a instanceof Error&&console.error(`${o} error for argument`,s,a.message),!n())return;this._setSubscription(r,{...i,state:"pending"}),await this._updateSubscriptions()}})();break;case"subscribed":i.callbacks.size===0&&await(async()=>{const{serverSubscriptionId:s,unsubscribeMethod:o}=i;if(this._subscriptionsAutoDisposedByRpc.has(s))this._subscriptionsAutoDisposedByRpc.delete(s);else{this._setSubscription(r,{...i,state:"unsubscribing"}),this._setSubscription(r,{...i,state:"unsubscribing"});try{await this._rpcWebSocket.call(o,[s])}catch(a){if(a instanceof Error&&console.error(`${o} error:`,a.message),!n())return;this._setSubscription(r,{...i,state:"subscribed"}),await this._updateSubscriptions();return}}this._setSubscription(r,{...i,state:"unsubscribed"}),await this._updateSubscriptions()})();break}}))}_handleServerNotification(e,n){const r=this._subscriptionCallbacksByServerSubscriptionId[e];r!==void 0&&r.forEach(i=>{try{i(...n)}catch(s){console.error(s)}})}_wsOnAccountNotification(e){const{result:n,subscription:r}=ye(e,Q3);this._handleServerNotification(r,[n.value,n.context])}_makeSubscription(e,n){const r=this._nextClientSubscriptionId++,i=R1([e.method,n]),s=this._subscriptionsByHash[i];return s===void 0?this._subscriptionsByHash[i]={...e,args:n,callbacks:new Set([e.callback]),state:"pending"}:s.callbacks.add(e.callback),this._subscriptionHashByClientSubscriptionId[r]=i,this._subscriptionDisposeFunctionsByClientSubscriptionId[r]=async()=>{delete this._subscriptionDisposeFunctionsByClientSubscriptionId[r],delete this._subscriptionHashByClientSubscriptionId[r];const o=this._subscriptionsByHash[i];lt(o!==void 0,`Could not find a \`Subscription\` when tearing down client subscription #${r}`),o.callbacks.delete(e.callback),await this._updateSubscriptions()},this._updateSubscriptions(),r}onAccountChange(e,n,r){const{commitment:i,config:s}=St(r),o=this._buildArgs([e.toBase58()],i||this._commitment||"finalized","base64",s);return this._makeSubscription({callback:n,method:"accountSubscribe",unsubscribeMethod:"accountUnsubscribe"},o)}async removeAccountChangeListener(e){await this._unsubscribeClientSubscription(e,"account change")}_wsOnProgramAccountNotification(e){const{result:n,subscription:r}=ye(e,J3);this._handleServerNotification(r,[{accountId:n.value.pubkey,accountInfo:n.value.account},n.context])}onProgramAccountChange(e,n,r,i){const{commitment:s,config:o}=St(r),a=this._buildArgs([e.toBase58()],s||this._commitment||"finalized","base64",o||(i?{filters:T1(i)}:void 0));return this._makeSubscription({callback:n,method:"programSubscribe",unsubscribeMethod:"programUnsubscribe"},a)}async removeProgramAccountChangeListener(e){await this._unsubscribeClientSubscription(e,"program account change")}onLogs(e,n,r){const i=this._buildArgs([typeof e=="object"?{mentions:[e.toString()]}:e],r||this._commitment||"finalized");return this._makeSubscription({callback:n,method:"logsSubscribe",unsubscribeMethod:"logsUnsubscribe"},i)}async removeOnLogsListener(e){await this._unsubscribeClientSubscription(e,"logs")}_wsOnLogsNotification(e){const{result:n,subscription:r}=ye(e,TD);this._handleServerNotification(r,[n.value,n.context])}_wsOnSlotNotification(e){const{result:n,subscription:r}=ye(e,tD);this._handleServerNotification(r,[n])}onSlotChange(e){return this._makeSubscription({callback:e,method:"slotSubscribe",unsubscribeMethod:"slotUnsubscribe"},[])}async removeSlotChangeListener(e){await this._unsubscribeClientSubscription(e,"slot change")}_wsOnSlotUpdatesNotification(e){const{result:n,subscription:r}=ye(e,rD);this._handleServerNotification(r,[n])}onSlotUpdate(e){return this._makeSubscription({callback:e,method:"slotsUpdatesSubscribe",unsubscribeMethod:"slotsUpdatesUnsubscribe"},[])}async removeSlotUpdateListener(e){await this._unsubscribeClientSubscription(e,"slot update")}async _unsubscribeClientSubscription(e,n){const r=this._subscriptionDisposeFunctionsByClientSubscriptionId[e];r?await r():console.warn(`Ignored unsubscribe request because an active subscription with id \`${e}\` for '${n}' events could not be found.`)}_buildArgs(e,n,r,i){const s=n||this._commitment;if(s||r||i){let o={};r&&(o.encoding=r),s&&(o.commitment=s),i&&(o=Object.assign(o,i)),e.push(o)}return e}_buildArgsAtLeastConfirmed(e,n,r,i){const s=n||this._commitment;if(s&&!["confirmed","finalized"].includes(s))throw new Error("Using Connection with default commitment: `"+this._commitment+"`, but method requires at least `confirmed`");return this._buildArgs(e,n,r,i)}_wsOnSignatureNotification(e){const{result:n,subscription:r}=ye(e,iD);n.value!=="receivedSignature"&&this._subscriptionsAutoDisposedByRpc.add(r),this._handleServerNotification(r,n.value==="receivedSignature"?[{type:"received"},n.context]:[{type:"status",result:n.value},n.context])}onSignature(e,n,r){const i=this._buildArgs([e],r||this._commitment||"finalized"),s=this._makeSubscription({callback:(o,a)=>{if(o.type==="status"){n(o.result,a);try{this.removeSignatureListener(s)}catch{}}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},i);return s}onSignatureWithOptions(e,n,r){const{commitment:i,...s}={...r,commitment:r&&r.commitment||this._commitment||"finalized"},o=this._buildArgs([e],i,void 0,s),a=this._makeSubscription({callback:(c,l)=>{n(c,l);try{this.removeSignatureListener(a)}catch{}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},o);return a}async removeSignatureListener(e){await this._unsubscribeClientSubscription(e,"signature result")}_wsOnRootNotification(e){const{result:n,subscription:r}=ye(e,sD);this._handleServerNotification(r,[n])}onRootChange(e){return this._makeSubscription({callback:e,method:"rootSubscribe",unsubscribeMethod:"rootUnsubscribe"},[])}async removeRootChangeListener(e){await this._unsubscribeClientSubscription(e,"root change")}}class gc{constructor(e){this._keypair=void 0,this._keypair=e??A1()}static generate(){return new gc(A1())}static fromSecretKey(e,n){if(e.byteLength!==64)throw new Error("bad secret key size");const r=e.slice(32,64);if(!n||!n.skipValidation){const i=e.slice(0,32),s=ch(i);for(let o=0;o<32;o++)if(r[o]!==s[o])throw new Error("provided secretKey is invalid")}return new gc({publicKey:r,secretKey:e})}static fromSeed(e){const n=ch(e),r=new Uint8Array(64);return r.set(e),r.set(n,32),new gc({publicKey:n,secretKey:r})}get publicKey(){return new ie(this._keypair.publicKey)}get secretKey(){return new Uint8Array(this._keypair.secretKey)}}const cs=Object.freeze({CreateLookupTable:{index:0,layout:Ae([Se("instruction"),Bc("recentSlot"),st("bumpSeed")])},FreezeLookupTable:{index:1,layout:Ae([Se("instruction")])},ExtendLookupTable:{index:2,layout:Ae([Se("instruction"),Bc(),Bn(Xe(),ao(Se(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:Ae([Se("instruction")])},CloseLookupTable:{index:4,layout:Ae([Se("instruction")])}});class OD{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const r=Se("instruction").decode(e.data);let i;for(const[s,o]of Object.entries(cs))if(o.index==r){i=s;break}if(!i)throw new Error("Invalid Instruction. Should be a LookupTable Instruction");return i}static decodeCreateLookupTable(e){this.checkProgramId(e.programId),this.checkKeysLength(e.keys,4);const{recentSlot:n}=gt(cs.CreateLookupTable,e.data);return{authority:e.keys[1].pubkey,payer:e.keys[2].pubkey,recentSlot:Number(n)}}static decodeExtendLookupTable(e){if(this.checkProgramId(e.programId),e.keys.length<2)throw new Error(`invalid instruction; found ${e.keys.length} keys, expected at least 2`);const{addresses:n}=gt(cs.ExtendLookupTable,e.data);return{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey,payer:e.keys.length>2?e.keys[2].pubkey:void 0,addresses:n.map(r=>new ie(r))}}static decodeCloseLookupTable(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,3),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey,recipient:e.keys[2].pubkey}}static decodeFreezeLookupTable(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,2),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey}}static decodeDeactivateLookupTable(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,2),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey}}static checkProgramId(e){if(!e.equals(e_.programId))throw new Error("invalid instruction; programId is not AddressLookupTable Program")}static checkKeysLength(e,n){if(e.length<n)throw new Error(`invalid instruction; found ${e.length} keys, expected at least ${n}`)}}class e_{constructor(){}static createLookupTable(e){const[n,r]=ie.findProgramAddressSync([e.authority.toBuffer(),zA(BigInt(e.recentSlot),8)],this.programId),i=cs.CreateLookupTable,s=rt(i,{recentSlot:BigInt(e.recentSlot),bumpSeed:r}),o=[{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1},{pubkey:e.payer,isSigner:!0,isWritable:!0},{pubkey:_n.programId,isSigner:!1,isWritable:!1}];return[new bt({programId:this.programId,keys:o,data:s}),n]}static freezeLookupTable(e){const n=cs.FreezeLookupTable,r=rt(n),i=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return new bt({programId:this.programId,keys:i,data:r})}static extendLookupTable(e){const n=cs.ExtendLookupTable,r=rt(n,{addresses:e.addresses.map(s=>s.toBytes())}),i=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return e.payer&&i.push({pubkey:e.payer,isSigner:!0,isWritable:!0},{pubkey:_n.programId,isSigner:!1,isWritable:!1}),new bt({programId:this.programId,keys:i,data:r})}static deactivateLookupTable(e){const n=cs.DeactivateLookupTable,r=rt(n),i=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return new bt({programId:this.programId,keys:i,data:r})}static closeLookupTable(e){const n=cs.CloseLookupTable,r=rt(n),i=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1},{pubkey:e.recipient,isSigner:!1,isWritable:!0}];return new bt({programId:this.programId,keys:i,data:r})}}e_.programId=new ie("AddressLookupTab1e1111111111111111111111111");class CD{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const r=st("instruction").decode(e.data);let i;for(const[s,o]of Object.entries(Ii))if(o.index==r){i=s;break}if(!i)throw new Error("Instruction type incorrect; not a ComputeBudgetInstruction");return i}static decodeRequestUnits(e){this.checkProgramId(e.programId);const{units:n,additionalFee:r}=gt(Ii.RequestUnits,e.data);return{units:n,additionalFee:r}}static decodeRequestHeapFrame(e){this.checkProgramId(e.programId);const{bytes:n}=gt(Ii.RequestHeapFrame,e.data);return{bytes:n}}static decodeSetComputeUnitLimit(e){this.checkProgramId(e.programId);const{units:n}=gt(Ii.SetComputeUnitLimit,e.data);return{units:n}}static decodeSetComputeUnitPrice(e){this.checkProgramId(e.programId);const{microLamports:n}=gt(Ii.SetComputeUnitPrice,e.data);return{microLamports:n}}static checkProgramId(e){if(!e.equals(t_.programId))throw new Error("invalid instruction; programId is not ComputeBudgetProgram")}}const Ii=Object.freeze({RequestUnits:{index:0,layout:Ae([st("instruction"),Se("units"),Se("additionalFee")])},RequestHeapFrame:{index:1,layout:Ae([st("instruction"),Se("bytes")])},SetComputeUnitLimit:{index:2,layout:Ae([st("instruction"),Se("units")])},SetComputeUnitPrice:{index:3,layout:Ae([st("instruction"),Bc("microLamports")])}});class t_{constructor(){}static requestUnits(e){const n=Ii.RequestUnits,r=rt(n,e);return new bt({keys:[],programId:this.programId,data:r})}static requestHeapFrame(e){const n=Ii.RequestHeapFrame,r=rt(n,e);return new bt({keys:[],programId:this.programId,data:r})}static setComputeUnitLimit(e){const n=Ii.SetComputeUnitLimit,r=rt(n,e);return new bt({keys:[],programId:this.programId,data:r})}static setComputeUnitPrice(e){const n=Ii.SetComputeUnitPrice,r=rt(n,{microLamports:BigInt(e.microLamports)});return new bt({keys:[],programId:this.programId,data:r})}}t_.programId=new ie("ComputeBudget111111111111111111111111111111");const L1=64,D1=32,P1=64,B1=Ae([st("numSignatures"),st("padding"),Ur("signatureOffset"),Ur("signatureInstructionIndex"),Ur("publicKeyOffset"),Ur("publicKeyInstructionIndex"),Ur("messageDataOffset"),Ur("messageDataSize"),Ur("messageInstructionIndex")]);class mp{constructor(){}static createInstructionWithPublicKey(e){const{publicKey:n,message:r,signature:i,instructionIndex:s}=e;lt(n.length===D1,`Public Key must be ${D1} bytes but received ${n.length} bytes`),lt(i.length===P1,`Signature must be ${P1} bytes but received ${i.length} bytes`);const o=B1.span,a=o+n.length,c=a+i.length,l=1,u=re.Buffer.alloc(c+r.length),f=s??65535;return B1.encode({numSignatures:l,padding:0,signatureOffset:a,signatureInstructionIndex:f,publicKeyOffset:o,publicKeyInstructionIndex:f,messageDataOffset:c,messageDataSize:r.length,messageInstructionIndex:f},u),u.fill(n,o),u.fill(i,a),u.fill(r,c),new bt({keys:[],programId:mp.programId,data:u})}static createInstructionWithPrivateKey(e){const{privateKey:n,message:r,instructionIndex:i}=e;lt(n.length===L1,`Private key must be ${L1} bytes but received ${n.length} bytes`);try{const s=gc.fromSecretKey(n),o=s.publicKey.toBytes(),a=Vw(r,s.secretKey);return this.createInstructionWithPublicKey({publicKey:o,message:r,signature:a,instructionIndex:i})}catch(s){throw new Error(`Error creating instruction; ${s}`)}}}mp.programId=new ie("Ed25519SigVerify111111111111111111111111111");const LD=(t,e)=>{const n=up.sign(t,e);return[n.toCompactRawBytes(),n.recovery]};up.utils.isValidPrivateKey;const DD=up.getPublicKey,z1=32,Y0=20,j1=64,PD=11,q0=Ae([st("numSignatures"),Ur("signatureOffset"),st("signatureInstructionIndex"),Ur("ethAddressOffset"),st("ethAddressInstructionIndex"),Ur("messageDataOffset"),Ur("messageDataSize"),st("messageInstructionIndex"),Tt(20,"ethAddress"),Tt(64,"signature"),st("recoveryId")]);class yc{constructor(){}static publicKeyToEthAddress(e){lt(e.length===j1,`Public key must be ${j1} bytes but received ${e.length} bytes`);try{return re.Buffer.from(v1(Ye(e))).slice(-Y0)}catch(n){throw new Error(`Error constructing Ethereum address: ${n}`)}}static createInstructionWithPublicKey(e){const{publicKey:n,message:r,signature:i,recoveryId:s,instructionIndex:o}=e;return yc.createInstructionWithEthAddress({ethAddress:yc.publicKeyToEthAddress(n),message:r,signature:i,recoveryId:s,instructionIndex:o})}static createInstructionWithEthAddress(e){const{ethAddress:n,message:r,signature:i,recoveryId:s,instructionIndex:o=0}=e;let a;typeof n=="string"?n.startsWith("0x")?a=re.Buffer.from(n.substr(2),"hex"):a=re.Buffer.from(n,"hex"):a=n,lt(a.length===Y0,`Address must be ${Y0} bytes but received ${a.length} bytes`);const c=1+PD,l=c,u=c+a.length,f=u+i.length+1,g=1,p=re.Buffer.alloc(q0.span+r.length);return q0.encode({numSignatures:g,signatureOffset:u,signatureInstructionIndex:o,ethAddressOffset:l,ethAddressInstructionIndex:o,messageDataOffset:f,messageDataSize:r.length,messageInstructionIndex:o,signature:Ye(i),ethAddress:Ye(a),recoveryId:s},p),p.fill(Ye(r),q0.span),new bt({keys:[],programId:yc.programId,data:p})}static createInstructionWithPrivateKey(e){const{privateKey:n,message:r,instructionIndex:i}=e;lt(n.length===z1,`Private key must be ${z1} bytes but received ${n.length} bytes`);try{const s=Ye(n),o=DD(s,!1).slice(1),a=re.Buffer.from(v1(Ye(r))),[c,l]=LD(a,s);return this.createInstructionWithPublicKey({publicKey:o,message:r,signature:c,recoveryId:l,instructionIndex:i})}catch(s){throw new Error(`Error creating instruction; ${s}`)}}}yc.programId=new ie("KeccakSecp256k11111111111111111111111111111");var vI;const bI=new ie("StakeConfig11111111111111111111111111111111");class EI{constructor(e,n){this.staker=void 0,this.withdrawer=void 0,this.staker=e,this.withdrawer=n}}class cd{constructor(e,n,r){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=e,this.epoch=n,this.custodian=r}}vI=cd;cd.default=new vI(0,0,ie.default);class BD{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const r=Se("instruction").decode(e.data);let i;for(const[s,o]of Object.entries(An))if(o.index==r){i=s;break}if(!i)throw new Error("Instruction type incorrect; not a StakeInstruction");return i}static decodeInitialize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{authorized:n,lockup:r}=gt(An.Initialize,e.data);return{stakePubkey:e.keys[0].pubkey,authorized:new EI(new ie(n.staker),new ie(n.withdrawer)),lockup:new cd(r.unixTimestamp,r.epoch,new ie(r.custodian))}}static decodeDelegate(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,6),gt(An.Delegate,e.data),{stakePubkey:e.keys[0].pubkey,votePubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[5].pubkey}}static decodeAuthorize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{newAuthorized:n,stakeAuthorizationType:r}=gt(An.Authorize,e.data),i={stakePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey,newAuthorizedPubkey:new ie(n),stakeAuthorizationType:{index:r}};return e.keys.length>3&&(i.custodianPubkey=e.keys[3].pubkey),i}static decodeAuthorizeWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{newAuthorized:n,stakeAuthorizationType:r,authoritySeed:i,authorityOwner:s}=gt(An.AuthorizeWithSeed,e.data),o={stakePubkey:e.keys[0].pubkey,authorityBase:e.keys[1].pubkey,authoritySeed:i,authorityOwner:new ie(s),newAuthorizedPubkey:new ie(n),stakeAuthorizationType:{index:r}};return e.keys.length>3&&(o.custodianPubkey=e.keys[3].pubkey),o}static decodeSplit(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{lamports:n}=gt(An.Split,e.data);return{stakePubkey:e.keys[0].pubkey,splitStakePubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[2].pubkey,lamports:n}}static decodeMerge(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),gt(An.Merge,e.data),{stakePubkey:e.keys[0].pubkey,sourceStakePubKey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey}}static decodeWithdraw(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,5);const{lamports:n}=gt(An.Withdraw,e.data),r={stakePubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey,lamports:n};return e.keys.length>5&&(r.custodianPubkey=e.keys[5].pubkey),r}static decodeDeactivate(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),gt(An.Deactivate,e.data),{stakePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey}}static checkProgramId(e){if(!e.equals(wp.programId))throw new Error("invalid instruction; programId is not StakeProgram")}static checkKeyLength(e,n){if(e.length<n)throw new Error(`invalid instruction; found ${e.length} keys, expected at least ${n}`)}}const An=Object.freeze({Initialize:{index:0,layout:Ae([Se("instruction"),z4(),j4()])},Authorize:{index:1,layout:Ae([Se("instruction"),Xe("newAuthorized"),Se("stakeAuthorizationType")])},Delegate:{index:2,layout:Ae([Se("instruction")])},Split:{index:3,layout:Ae([Se("instruction"),Ar("lamports")])},Withdraw:{index:4,layout:Ae([Se("instruction"),Ar("lamports")])},Deactivate:{index:5,layout:Ae([Se("instruction")])},Merge:{index:7,layout:Ae([Se("instruction")])},AuthorizeWithSeed:{index:8,layout:Ae([Se("instruction"),Xe("newAuthorized"),Se("stakeAuthorizationType"),Ko("authoritySeed"),Xe("authorityOwner")])}}),zD=Object.freeze({Staker:{index:0},Withdrawer:{index:1}});class wp{constructor(){}static initialize(e){const{stakePubkey:n,authorized:r,lockup:i}=e,s=i||cd.default,o=An.Initialize,a=rt(o,{authorized:{staker:Ye(r.staker.toBuffer()),withdrawer:Ye(r.withdrawer.toBuffer())},lockup:{unixTimestamp:s.unixTimestamp,epoch:s.epoch,custodian:Ye(s.custodian.toBuffer())}}),c={keys:[{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:Pc,isSigner:!1,isWritable:!1}],programId:this.programId,data:a};return new bt(c)}static createAccountWithSeed(e){const n=new Je;n.add(_n.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:this.space,programId:this.programId}));const{stakePubkey:r,authorized:i,lockup:s}=e;return n.add(this.initialize({stakePubkey:r,authorized:i,lockup:s}))}static createAccount(e){const n=new Je;n.add(_n.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,lamports:e.lamports,space:this.space,programId:this.programId}));const{stakePubkey:r,authorized:i,lockup:s}=e;return n.add(this.initialize({stakePubkey:r,authorized:i,lockup:s}))}static delegate(e){const{stakePubkey:n,authorizedPubkey:r,votePubkey:i}=e,s=An.Delegate,o=rt(s);return new Je().add({keys:[{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!1},{pubkey:Ei,isSigner:!1,isWritable:!1},{pubkey:_f,isSigner:!1,isWritable:!1},{pubkey:bI,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static authorize(e){const{stakePubkey:n,authorizedPubkey:r,newAuthorizedPubkey:i,stakeAuthorizationType:s,custodianPubkey:o}=e,a=An.Authorize,c=rt(a,{newAuthorized:Ye(i.toBuffer()),stakeAuthorizationType:s.index}),l=[{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:Ei,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}];return o&&l.push({pubkey:o,isSigner:!0,isWritable:!1}),new Je().add({keys:l,programId:this.programId,data:c})}static authorizeWithSeed(e){const{stakePubkey:n,authorityBase:r,authoritySeed:i,authorityOwner:s,newAuthorizedPubkey:o,stakeAuthorizationType:a,custodianPubkey:c}=e,l=An.AuthorizeWithSeed,u=rt(l,{newAuthorized:Ye(o.toBuffer()),stakeAuthorizationType:a.index,authoritySeed:i,authorityOwner:Ye(s.toBuffer())}),f=[{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1},{pubkey:Ei,isSigner:!1,isWritable:!1}];return c&&f.push({pubkey:c,isSigner:!0,isWritable:!1}),new Je().add({keys:f,programId:this.programId,data:u})}static splitInstruction(e){const{stakePubkey:n,authorizedPubkey:r,splitStakePubkey:i,lamports:s}=e,o=An.Split,a=rt(o,{lamports:s});return new bt({keys:[{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:a})}static split(e,n){const r=new Je;return r.add(_n.createAccount({fromPubkey:e.authorizedPubkey,newAccountPubkey:e.splitStakePubkey,lamports:n,space:this.space,programId:this.programId})),r.add(this.splitInstruction(e))}static splitWithSeed(e,n){const{stakePubkey:r,authorizedPubkey:i,splitStakePubkey:s,basePubkey:o,seed:a,lamports:c}=e,l=new Je;return l.add(_n.allocate({accountPubkey:s,basePubkey:o,seed:a,space:this.space,programId:this.programId})),n&&n>0&&l.add(_n.transfer({fromPubkey:e.authorizedPubkey,toPubkey:s,lamports:n})),l.add(this.splitInstruction({stakePubkey:r,authorizedPubkey:i,splitStakePubkey:s,lamports:c}))}static merge(e){const{stakePubkey:n,sourceStakePubKey:r,authorizedPubkey:i}=e,s=An.Merge,o=rt(s);return new Je().add({keys:[{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:Ei,isSigner:!1,isWritable:!1},{pubkey:_f,isSigner:!1,isWritable:!1},{pubkey:i,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static withdraw(e){const{stakePubkey:n,authorizedPubkey:r,toPubkey:i,lamports:s,custodianPubkey:o}=e,a=An.Withdraw,c=rt(a,{lamports:s}),l=[{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:Ei,isSigner:!1,isWritable:!1},{pubkey:_f,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return o&&l.push({pubkey:o,isSigner:!0,isWritable:!1}),new Je().add({keys:l,programId:this.programId,data:c})}static deactivate(e){const{stakePubkey:n,authorizedPubkey:r}=e,i=An.Deactivate,s=rt(i);return new Je().add({keys:[{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:Ei,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:s})}}wp.programId=new ie("Stake11111111111111111111111111111111111111");wp.space=200;class xI{constructor(e,n,r,i){this.nodePubkey=void 0,this.authorizedVoter=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.nodePubkey=e,this.authorizedVoter=n,this.authorizedWithdrawer=r,this.commission=i}}class jD{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const r=Se("instruction").decode(e.data);let i;for(const[s,o]of Object.entries(ki))if(o.index==r){i=s;break}if(!i)throw new Error("Instruction type incorrect; not a VoteInstruction");return i}static decodeInitializeAccount(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,4);const{voteInit:n}=gt(ki.InitializeAccount,e.data);return{votePubkey:e.keys[0].pubkey,nodePubkey:e.keys[3].pubkey,voteInit:new xI(new ie(n.nodePubkey),new ie(n.authorizedVoter),new ie(n.authorizedWithdrawer),n.commission)}}static decodeAuthorize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{newAuthorized:n,voteAuthorizationType:r}=gt(ki.Authorize,e.data);return{votePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey,newAuthorizedPubkey:new ie(n),voteAuthorizationType:{index:r}}}static decodeAuthorizeWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:n,currentAuthorityDerivedKeySeed:r,newAuthorized:i,voteAuthorizationType:s}}=gt(ki.AuthorizeWithSeed,e.data);return{currentAuthorityDerivedKeyBasePubkey:e.keys[2].pubkey,currentAuthorityDerivedKeyOwnerPubkey:new ie(n),currentAuthorityDerivedKeySeed:r,newAuthorizedPubkey:new ie(i),voteAuthorizationType:{index:s},votePubkey:e.keys[0].pubkey}}static decodeWithdraw(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{lamports:n}=gt(ki.Withdraw,e.data);return{votePubkey:e.keys[0].pubkey,authorizedWithdrawerPubkey:e.keys[2].pubkey,lamports:n,toPubkey:e.keys[1].pubkey}}static checkProgramId(e){if(!e.equals(rl.programId))throw new Error("invalid instruction; programId is not VoteProgram")}static checkKeyLength(e,n){if(e.length<n)throw new Error(`invalid instruction; found ${e.length} keys, expected at least ${n}`)}}const ki=Object.freeze({InitializeAccount:{index:0,layout:Ae([Se("instruction"),U4()])},Authorize:{index:1,layout:Ae([Se("instruction"),Xe("newAuthorized"),Se("voteAuthorizationType")])},Withdraw:{index:3,layout:Ae([Se("instruction"),Ar("lamports")])},UpdateValidatorIdentity:{index:4,layout:Ae([Se("instruction")])},AuthorizeWithSeed:{index:10,layout:Ae([Se("instruction"),F4()])}}),UD=Object.freeze({Voter:{index:0},Withdrawer:{index:1}});class rl{constructor(){}static initializeAccount(e){const{votePubkey:n,nodePubkey:r,voteInit:i}=e,s=ki.InitializeAccount,o=rt(s,{voteInit:{nodePubkey:Ye(i.nodePubkey.toBuffer()),authorizedVoter:Ye(i.authorizedVoter.toBuffer()),authorizedWithdrawer:Ye(i.authorizedWithdrawer.toBuffer()),commission:i.commission}}),a={keys:[{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:Pc,isSigner:!1,isWritable:!1},{pubkey:Ei,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:o};return new bt(a)}static createAccount(e){const n=new Je;return n.add(_n.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.votePubkey,lamports:e.lamports,space:this.space,programId:this.programId})),n.add(this.initializeAccount({votePubkey:e.votePubkey,nodePubkey:e.voteInit.nodePubkey,voteInit:e.voteInit}))}static authorize(e){const{votePubkey:n,authorizedPubkey:r,newAuthorizedPubkey:i,voteAuthorizationType:s}=e,o=ki.Authorize,a=rt(o,{newAuthorized:Ye(i.toBuffer()),voteAuthorizationType:s.index}),c=[{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:Ei,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return new Je().add({keys:c,programId:this.programId,data:a})}static authorizeWithSeed(e){const{currentAuthorityDerivedKeyBasePubkey:n,currentAuthorityDerivedKeyOwnerPubkey:r,currentAuthorityDerivedKeySeed:i,newAuthorizedPubkey:s,voteAuthorizationType:o,votePubkey:a}=e,c=ki.AuthorizeWithSeed,l=rt(c,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:Ye(r.toBuffer()),currentAuthorityDerivedKeySeed:i,newAuthorized:Ye(s.toBuffer()),voteAuthorizationType:o.index}}),u=[{pubkey:a,isSigner:!1,isWritable:!0},{pubkey:Ei,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return new Je().add({keys:u,programId:this.programId,data:l})}static withdraw(e){const{votePubkey:n,authorizedWithdrawerPubkey:r,lamports:i,toPubkey:s}=e,o=ki.Withdraw,a=rt(o,{lamports:i}),c=[{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}];return new Je().add({keys:c,programId:this.programId,data:a})}static safeWithdraw(e,n,r){if(e.lamports>n-r)throw new Error("Withdraw will leave vote account with insufficient funds.");return rl.withdraw(e)}static updateValidatorIdentity(e){const{votePubkey:n,authorizedWithdrawerPubkey:r,nodePubkey:i}=e,s=ki.UpdateValidatorIdentity,o=rt(s),a=[{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!0,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return new Je().add({keys:a,programId:this.programId,data:o})}}rl.programId=new ie("Vote111111111111111111111111111111111111111");rl.space=3762;const SI=new ie("Va1idator1nfo111111111111111111111111111111"),FD=se({name:he(),website:Oe(he()),details:Oe(he()),iconUrl:Oe(he()),keybaseUsername:Oe(he())});class n_{constructor(e,n){this.key=void 0,this.info=void 0,this.key=e,this.info=n}static fromConfigData(e){let n=[...e];if(ur(n)!==2)return null;const i=[];for(let s=0;s<2;s++){const o=new ie(dr(n,0,Oi)),a=Ai(n)===1;i.push({publicKey:o,isSigner:a})}if(i[0].publicKey.equals(SI)&&i[1].isSigner){const s=Ko().decode(re.Buffer.from(n)),o=JSON.parse(s);return jA(o,FD),new n_(i[1].publicKey,o)}return null}}const WD=new ie("Vote111111111111111111111111111111111111111"),HD=Ae([Xe("nodePubkey"),Xe("authorizedWithdrawer"),st("commission"),On(),Bn(Ae([On("slot"),Se("confirmationCount")]),ao(Se(),-8),"votes"),st("rootSlotValid"),On("rootSlot"),On(),Bn(Ae([On("epoch"),Xe("authorizedVoter")]),ao(Se(),-8),"authorizedVoters"),Ae([Bn(Ae([Xe("authorizedPubkey"),On("epochOfLastAuthorizedSwitch"),On("targetEpoch")]),32,"buf"),On("idx"),st("isEmpty")],"priorVoters"),On(),Bn(Ae([On("epoch"),On("credits"),On("prevCredits")]),ao(Se(),-8),"epochCredits"),Ae([On("slot"),On("timestamp")],"lastTimestamp")]);class r_{constructor(e){this.nodePubkey=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.rootSlot=void 0,this.votes=void 0,this.authorizedVoters=void 0,this.priorVoters=void 0,this.epochCredits=void 0,this.lastTimestamp=void 0,this.nodePubkey=e.nodePubkey,this.authorizedWithdrawer=e.authorizedWithdrawer,this.commission=e.commission,this.rootSlot=e.rootSlot,this.votes=e.votes,this.authorizedVoters=e.authorizedVoters,this.priorVoters=e.priorVoters,this.epochCredits=e.epochCredits,this.lastTimestamp=e.lastTimestamp}static fromAccountData(e){const r=HD.decode(Ye(e),4);let i=r.rootSlot;return r.rootSlotValid||(i=null),new r_({nodePubkey:new ie(r.nodePubkey),authorizedWithdrawer:new ie(r.authorizedWithdrawer),commission:r.commission,votes:r.votes,rootSlot:i,authorizedVoters:r.authorizedVoters.map($D),priorVoters:VD(r.priorVoters),epochCredits:r.epochCredits,lastTimestamp:r.lastTimestamp})}}function $D({authorizedVoter:t,epoch:e}){return{epoch:e,authorizedVoter:new ie(t)}}function U1({authorizedPubkey:t,epochOfLastAuthorizedSwitch:e,targetEpoch:n}){return{authorizedPubkey:new ie(t),epochOfLastAuthorizedSwitch:e,targetEpoch:n}}function VD({buf:t,idx:e,isEmpty:n}){return n?[]:[...t.slice(e+1).map(U1),...t.slice(0,e).map(U1)]}const F1={http:{devnet:"http://api.devnet.solana.com",testnet:"http://api.testnet.solana.com","mainnet-beta":"http://api.mainnet-beta.solana.com/"},https:{devnet:"https://api.devnet.solana.com",testnet:"https://api.testnet.solana.com","mainnet-beta":"https://api.mainnet-beta.solana.com/"}};function ZD(t,e){const n=e===!1?"http":"https";if(!t)return F1[n].devnet;const r=F1[n][t];if(!r)throw new Error(`Unknown ${n} cluster: ${t}`);return r}async function KD(t,e,n,r){let i,s;n&&Object.prototype.hasOwnProperty.call(n,"lastValidBlockHeight")||n&&Object.prototype.hasOwnProperty.call(n,"nonceValue")?(i=n,s=r):s=n;const o=s&&{skipPreflight:s.skipPreflight,preflightCommitment:s.preflightCommitment||s.commitment,minContextSlot:s.minContextSlot},a=await t.sendRawTransaction(e,o),c=s&&s.commitment,u=(await(i?t.confirmTransaction(i,c):t.confirmTransaction(a,c))).value;if(u.err)throw a!=null?new mo({action:o!=null&&o.skipPreflight?"send":"simulate",signature:a,transactionMessage:`Status: (${JSON.stringify(u)})`}):new Error(`Raw transaction ${a} failed (${JSON.stringify(u)})`);return a}const GD=1e9,YD=Object.freeze(Object.defineProperty({__proto__:null,Account:D4,AddressLookupTableAccount:Oy,AddressLookupTableInstruction:OD,AddressLookupTableProgram:e_,Authorized:EI,BLOCKHASH_CACHE_TIMEOUT_MS:uI,BPF_LOADER_DEPRECATED_PROGRAM_ID:P4,BPF_LOADER_PROGRAM_ID:n3,BpfLoader:r3,COMPUTE_BUDGET_INSTRUCTION_LAYOUTS:Ii,ComputeBudgetInstruction:CD,ComputeBudgetProgram:t_,Connection:Jw,Ed25519Program:mp,Enum:C4,EpochSchedule:cI,FeeCalculatorLayout:oI,Keypair:gc,LAMPORTS_PER_SOL:GD,LOOKUP_TABLE_INSTRUCTION_LAYOUTS:cs,Loader:ma,Lockup:cd,MAX_SEED_LENGTH:nI,Message:pi,MessageAccountKeys:xu,MessageV0:ya,NONCE_ACCOUNT_LENGTH:My,NonceAccount:pp,PACKET_DATA_SIZE:co,PUBLIC_KEY_LENGTH:Oi,PublicKey:ie,SIGNATURE_LENGTH_IN_BYTES:Lc,SOLANA_SCHEMA:Gl,STAKE_CONFIG_ID:bI,STAKE_INSTRUCTION_LAYOUTS:An,SYSTEM_INSTRUCTION_LAYOUTS:At,SYSVAR_CLOCK_PUBKEY:Ei,SYSVAR_EPOCH_SCHEDULE_PUBKEY:Z4,SYSVAR_INSTRUCTIONS_PUBKEY:K4,SYSVAR_RECENT_BLOCKHASHES_PUBKEY:wf,SYSVAR_RENT_PUBKEY:Pc,SYSVAR_REWARDS_PUBKEY:G4,SYSVAR_SLOT_HASHES_PUBKEY:Y4,SYSVAR_SLOT_HISTORY_PUBKEY:q4,SYSVAR_STAKE_HISTORY_PUBKEY:_f,Secp256k1Program:yc,SendTransactionError:mo,SolanaJSONRPCError:Ie,SolanaJSONRPCErrorCode:Q4,StakeAuthorizationLayout:zD,StakeInstruction:BD,StakeProgram:wp,Struct:Zw,SystemInstruction:e3,SystemProgram:_n,Transaction:Je,TransactionExpiredBlockheightExceededError:Kw,TransactionExpiredNonceInvalidError:tc,TransactionExpiredTimeoutError:Gw,TransactionInstruction:bt,TransactionMessage:Yw,TransactionStatus:Qi,VALIDATOR_INFO_KEY:SI,VERSION_PREFIX_MASK:dp,VOTE_PROGRAM_ID:WD,ValidatorInfo:n_,VersionedMessage:hp,VersionedTransaction:Dc,VoteAccount:r_,VoteAuthorizationLayout:UD,VoteInit:xI,VoteInstruction:jD,VoteProgram:rl,clusterApiUrl:ZD,sendAndConfirmRawTransaction:KD,sendAndConfirmTransaction:Ty},Symbol.toStringTag,{value:"Module"})),AI=j.createContext({});function i_(){return j.useContext(AI)}const qD=({children:t,endpoint:e,config:n={commitment:"confirmed"}})=>{const r=j.useMemo(()=>new Jw(e,n),[e,n]);return ee.createElement(AI.Provider,{value:{connection:r}},t)};var II={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(c,l,u){this.fn=c,this.context=l,this.once=u||!1}function s(c,l,u,f,g){if(typeof u!="function")throw new TypeError("The listener must be a function");var p=new i(u,f||c,g),_=n?n+l:l;return c._events[_]?c._events[_].fn?c._events[_]=[c._events[_],p]:c._events[_].push(p):(c._events[_]=p,c._eventsCount++),c}function o(c,l){--c._eventsCount===0?c._events=new r:delete c._events[l]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],u,f;if(this._eventsCount===0)return l;for(f in u=this._events)e.call(u,f)&&l.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(u)):l},a.prototype.listeners=function(l){var u=n?n+l:l,f=this._events[u];if(!f)return[];if(f.fn)return[f.fn];for(var g=0,p=f.length,_=new Array(p);g<p;g++)_[g]=f[g].fn;return _},a.prototype.listenerCount=function(l){var u=n?n+l:l,f=this._events[u];return f?f.fn?1:f.length:0},a.prototype.emit=function(l,u,f,g,p,_){var A=n?n+l:l;if(!this._events[A])return!1;var S=this._events[A],E=arguments.length,b,x;if(S.fn){switch(S.once&&this.removeListener(l,S.fn,void 0,!0),E){case 1:return S.fn.call(S.context),!0;case 2:return S.fn.call(S.context,u),!0;case 3:return S.fn.call(S.context,u,f),!0;case 4:return S.fn.call(S.context,u,f,g),!0;case 5:return S.fn.call(S.context,u,f,g,p),!0;case 6:return S.fn.call(S.context,u,f,g,p,_),!0}for(x=1,b=new Array(E-1);x<E;x++)b[x-1]=arguments[x];S.fn.apply(S.context,b)}else{var M=S.length,L;for(x=0;x<M;x++)switch(S[x].once&&this.removeListener(l,S[x].fn,void 0,!0),E){case 1:S[x].fn.call(S[x].context);break;case 2:S[x].fn.call(S[x].context,u);break;case 3:S[x].fn.call(S[x].context,u,f);break;case 4:S[x].fn.call(S[x].context,u,f,g);break;default:if(!b)for(L=1,b=new Array(E-1);L<E;L++)b[L-1]=arguments[L];S[x].fn.apply(S[x].context,b)}}return!0},a.prototype.on=function(l,u,f){return s(this,l,u,f,!1)},a.prototype.once=function(l,u,f){return s(this,l,u,f,!0)},a.prototype.removeListener=function(l,u,f,g){var p=n?n+l:l;if(!this._events[p])return this;if(!u)return o(this,p),this;var _=this._events[p];if(_.fn)_.fn===u&&(!g||_.once)&&(!f||_.context===f)&&o(this,p);else{for(var A=0,S=[],E=_.length;A<E;A++)(_[A].fn!==u||g&&!_[A].once||f&&_[A].context!==f)&&S.push(_[A]);S.length?this._events[p]=S.length===1?S[0]:S:o(this,p)}return this},a.prototype.removeAllListeners=function(l){var u;return l?(u=n?n+l:l,this._events[u]&&o(this,u)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,t.exports=a})(II);var QD=II.exports;const kI=Ro(QD);class Tn extends Error{constructor(e,n){super(e),this.error=n}}class Ci extends Tn{constructor(){super(...arguments),this.name="WalletNotReadyError"}}class RI extends Tn{constructor(){super(...arguments),this.name="WalletLoadError"}}class Go extends Tn{constructor(){super(...arguments),this.name="WalletConfigError"}}class hs extends Tn{constructor(){super(...arguments),this.name="WalletConnectionError"}}class ld extends Tn{constructor(){super(...arguments),this.name="WalletDisconnectedError"}}class ud extends Tn{constructor(){super(...arguments),this.name="WalletDisconnectionError"}}class ps extends Tn{constructor(){super(...arguments),this.name="WalletAccountError"}}class wo extends Tn{constructor(){super(...arguments),this.name="WalletPublicKeyError"}}class Et extends Tn{constructor(){super(...arguments),this.name="WalletNotConnectedError"}}class gs extends Tn{constructor(){super(...arguments),this.name="WalletSendTransactionError"}}class Gn extends Tn{constructor(){super(...arguments),this.name="WalletSignTransactionError"}}class dd extends Tn{constructor(){super(...arguments),this.name="WalletSignMessageError"}}class W1 extends Tn{constructor(){super(...arguments),this.name="WalletSignInError"}}var Te;(function(t){t.Installed="Installed",t.NotDetected="NotDetected",t.Loadable="Loadable",t.Unsupported="Unsupported"})(Te||(Te={}));class NI extends kI{get connected(){return!!this.publicKey}async autoConnect(){await this.connect()}async prepareTransaction(e,n,r={}){const i=this.publicKey;if(!i)throw new Et;return e.feePayer=e.feePayer||i,e.recentBlockhash=e.recentBlockhash||(await n.getLatestBlockhash({commitment:r.preflightCommitment,minContextSlot:r.minContextSlot})).blockhash,e}}function _p(t){if(typeof window>"u"||typeof document>"u")return;const e=[];function n(){if(t())for(const s of e)s()}const r=setInterval(n,1e3);e.push(()=>clearInterval(r)),document.readyState==="loading"&&(document.addEventListener("DOMContentLoaded",n,{once:!0}),e.push(()=>document.removeEventListener("DOMContentLoaded",n))),document.readyState!=="complete"&&(window.addEventListener("load",n,{once:!0}),e.push(()=>window.removeEventListener("load",n))),n()}function Py(){if(!navigator)return!1;const t=navigator.userAgent.toLowerCase(),e=t.includes("iphone")||t.includes("ipad"),n=t.includes("safari");return e&&n}function ys(t){return"version"in t}class XD extends NI{async sendTransaction(e,n,r={}){let i=!0;try{if(ys(e)){if(!this.supportedTransactionVersions)throw new gs("Sending versioned transactions isn't supported by this wallet");if(!this.supportedTransactionVersions.has(e.version))throw new gs(`Sending transaction version ${e.version} isn't supported by this wallet`);try{e=await this.signTransaction(e);const s=e.serialize();return await n.sendRawTransaction(s,r)}catch(s){throw s instanceof Gn?(i=!1,s):new gs(s==null?void 0:s.message,s)}}else try{const{signers:s,...o}=r;e=await this.prepareTransaction(e,n,o),s!=null&&s.length&&e.partialSign(...s),e=await this.signTransaction(e);const a=e.serialize();return await n.sendRawTransaction(a,o)}catch(s){throw s instanceof Gn?(i=!1,s):new gs(s==null?void 0:s.message,s)}}catch(s){throw i&&this.emit("error",s),s}}async signAllTransactions(e){for(const r of e)if(ys(r)){if(!this.supportedTransactionVersions)throw new Gn("Signing versioned transactions isn't supported by this wallet");if(!this.supportedTransactionVersions.has(r.version))throw new Gn(`Signing transaction version ${r.version} isn't supported by this wallet`)}const n=[];for(const r of e)n.push(await this.signTransaction(r));return n}}class fd extends XD{}class JD extends fd{}const ls="solana:signAndSendTransaction",Q0="solana:signIn",ja="solana:signMessage",In="solana:signTransaction",s_="standard:connect",By="standard:disconnect",o_="standard:events";function eP(t){return s_ in t.features&&o_ in t.features&&(ls in t.features||In in t.features)}var zy;(function(t){t.Mainnet="mainnet-beta",t.Testnet="testnet",t.Devnet="devnet"})(zy||(zy={}));class H1 extends Tn{constructor(){super(...arguments),this.name="WalletNotSelectedError"}}const tP=[],vp={autoConnect:!1,connecting:!1,connected:!1,disconnecting:!1,select(){ni("call","select")},connect(){return Promise.reject(ni("call","connect"))},disconnect(){return Promise.reject(ni("call","disconnect"))},sendTransaction(){return Promise.reject(ni("call","sendTransaction"))},signTransaction(){return Promise.reject(ni("call","signTransaction"))},signAllTransactions(){return Promise.reject(ni("call","signAllTransactions"))},signMessage(){return Promise.reject(ni("call","signMessage"))},signIn(){return Promise.reject(ni("call","signIn"))}};Object.defineProperty(vp,"wallets",{get(){return ni("read","wallets"),tP}});Object.defineProperty(vp,"wallet",{get(){return ni("read","wallet"),null}});Object.defineProperty(vp,"publicKey",{get(){return ni("read","publicKey"),null}});function ni(t,e){const n=new Error(`You have tried to ${t} "${e}" on a WalletContext without providing one. Make sure to render a WalletProvider as an ancestor of the component that uses WalletContext.`);return console.error(n),n}const TI=j.createContext(vp);function il(){return j.useContext(TI)}function nP(){const{publicKey:t,signTransaction:e,signAllTransactions:n}=il();return j.useMemo(()=>t&&e&&n?{publicKey:t,signTransaction:e,signAllTransactions:n}:void 0,[t,e,n])}function rP(t,e){const n=j.useState(()=>{try{const s=localStorage.getItem(t);if(s)return JSON.parse(s)}catch(s){typeof window<"u"&&console.error(s)}return e}),r=n[0],i=j.useRef(!0);return j.useEffect(()=>{if(i.current){i.current=!1;return}try{r===null?localStorage.removeItem(t):localStorage.setItem(t,JSON.stringify(r))}catch(s){typeof window<"u"&&console.error(s)}},[r,t]),n}function X0(t){switch(t){case"processed":case"confirmed":case"finalized":case void 0:return t;case"recent":return"processed";case"single":case"singleGossip":return"confirmed";case"max":case"root":return"finalized";default:return}}const jy="solana:mainnet",MI="solana:devnet",OI="solana:testnet",iP="solana:localnet",sP="https://api.mainnet-beta.solana.com";function oP(t){return t.includes(sP)?jy:/\bdevnet\b/i.test(t)?MI:/\btestnet\b/i.test(t)?OI:/\blocalhost\b/i.test(t)||/\b127\.0\.0\.1\b/.test(t)?iP:jy}function aP(t){let e=`${t.domain} wants you to sign in with your Solana account: +`;e+=`${t.address}`,t.statement&&(e+=` + +${t.statement}`);const n=[];if(t.uri&&n.push(`URI: ${t.uri}`),t.version&&n.push(`Version: ${t.version}`),t.chainId&&n.push(`Chain ID: ${t.chainId}`),t.nonce&&n.push(`Nonce: ${t.nonce}`),t.issuedAt&&n.push(`Issued At: ${t.issuedAt}`),t.expirationTime&&n.push(`Expiration Time: ${t.expirationTime}`),t.notBefore&&n.push(`Not Before: ${t.notBefore}`),t.requestId&&n.push(`Request ID: ${t.requestId}`),t.resources){n.push("Resources:");for(const r of t.resources)n.push(`- ${r}`)}return n.length&&(e+=` + +${n.join(` +`)}`),e}const Ss={ERROR_ASSOCIATION_PORT_OUT_OF_RANGE:"ERROR_ASSOCIATION_PORT_OUT_OF_RANGE",ERROR_FORBIDDEN_WALLET_BASE_URL:"ERROR_FORBIDDEN_WALLET_BASE_URL",ERROR_SECURE_CONTEXT_REQUIRED:"ERROR_SECURE_CONTEXT_REQUIRED",ERROR_SESSION_CLOSED:"ERROR_SESSION_CLOSED",ERROR_SESSION_TIMEOUT:"ERROR_SESSION_TIMEOUT",ERROR_WALLET_NOT_FOUND:"ERROR_WALLET_NOT_FOUND",ERROR_INVALID_PROTOCOL_VERSION:"ERROR_INVALID_PROTOCOL_VERSION"};class As extends Error{constructor(...e){const[n,r,i]=e;super(r),this.code=n,this.data=i,this.name="SolanaMobileWalletAdapterError"}}class CI extends Error{constructor(...e){const[n,r,i,s]=e;super(i),this.code=r,this.data=s,this.jsonRpcMessageId=n,this.name="SolanaMobileWalletAdapterProtocolError"}}function wn(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(u){try{l(r.next(u))}catch(f){o(f)}}function c(u){try{l(r.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((r=r.apply(t,[])).next())})}function cP(t,e){return wn(this,void 0,void 0,function*(){const n=yield crypto.subtle.exportKey("raw",t),r=yield crypto.subtle.sign({hash:"SHA-256",name:"ECDSA"},e,n),i=new Uint8Array(n.byteLength+r.byteLength);return i.set(new Uint8Array(n),0),i.set(new Uint8Array(r),n.byteLength),i})}function lP(t){return window.btoa(t)}function uP(t){return aP(t)}function dP(t){return lP(uP(t))}const fP="solana:signTransactions",$1="solana:cloneAuthorization";function hP(t,e){return new Proxy({},{get(n,r){return n[r]==null&&(n[r]=function(i){return wn(this,void 0,void 0,function*(){const{method:s,params:o}=pP(r,i,t),a=yield e(s,o);return s==="authorize"&&o.sign_in_payload&&!a.sign_in_result&&(a.sign_in_result=yield yP(o.sign_in_payload,a,e)),gP(r,a,t)})}),n[r]},defineProperty(){return!1},deleteProperty(){return!1}})}function pP(t,e,n){let r=e,i=t.toString().replace(/[A-Z]/g,s=>`_${s.toLowerCase()}`).toLowerCase();switch(t){case"authorize":{let{chain:s}=r;if(n==="legacy"){switch(s){case"solana:testnet":{s="testnet";break}case"solana:devnet":{s="devnet";break}case"solana:mainnet":{s="mainnet-beta";break}default:s=r.cluster}r.cluster=s}else{switch(s){case"testnet":case"devnet":{s=`solana:${s}`;break}case"mainnet-beta":{s="solana:mainnet";break}}r.chain=s}}case"reauthorize":{const{auth_token:s,identity:o}=r;if(s)switch(n){case"legacy":{i="reauthorize",r={auth_token:s,identity:o};break}default:{i="authorize";break}}break}}return{method:i,params:r}}function gP(t,e,n){switch(t){case"getCapabilities":{const r=e;switch(n){case"legacy":{const i=[fP];return r.supports_clone_authorization===!0&&i.push($1),Object.assign(Object.assign({},r),{features:i})}case"v1":return Object.assign(Object.assign({},r),{supports_sign_and_send_transactions:!0,supports_clone_authorization:r.features.includes($1)})}}}return e}function yP(t,e,n){var r;return wn(this,void 0,void 0,function*(){const i=(r=t.domain)!==null&&r!==void 0?r:window.location.host,s=e.accounts[0].address,o=dP(Object.assign(Object.assign({},t),{domain:i,address:s})),a=yield n("sign_messages",{addresses:[s],payloads:[o]});return{address:s,signed_message:o,signature:a.signed_payloads[0].slice(o.length)}})}const Yo=4;function mP(t){if(t>=4294967296)throw new Error("Outbound sequence number overflow. The maximum sequence number is 32-bytes.");const e=new ArrayBuffer(Yo);return new DataView(e).setUint32(0,t,!1),new Uint8Array(e)}const Uy=12,LI=65;function wP(t,e,n){return wn(this,void 0,void 0,function*(){const r=mP(e),i=new Uint8Array(Uy);crypto.getRandomValues(i);const s=yield crypto.subtle.encrypt(PI(r,i),n,new TextEncoder().encode(t)),o=new Uint8Array(r.byteLength+i.byteLength+s.byteLength);return o.set(new Uint8Array(r),0),o.set(new Uint8Array(i),r.byteLength),o.set(new Uint8Array(s),r.byteLength+i.byteLength),o})}function DI(t,e){return wn(this,void 0,void 0,function*(){const n=t.slice(0,Yo),r=t.slice(Yo,Yo+Uy),i=t.slice(Yo+Uy),s=yield crypto.subtle.decrypt(PI(n,r),e,i);return _P().decode(s)})}function PI(t,e){return{additionalData:t,iv:e,name:"AES-GCM",tagLength:128}}let J0;function _P(){return J0===void 0&&(J0=new TextDecoder("utf-8")),J0}function vP(){return wn(this,void 0,void 0,function*(){return yield crypto.subtle.generateKey({name:"ECDSA",namedCurve:"P-256"},!1,["sign"])})}function bP(){return wn(this,void 0,void 0,function*(){return yield crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!1,["deriveKey","deriveBits"])})}function EP(t,e){return wn(this,void 0,void 0,function*(){const n=JSON.stringify(t),r=t.id;return wP(n,r,e)})}function xP(t,e){return wn(this,void 0,void 0,function*(){const n=yield DI(t,e),r=JSON.parse(n);if(Object.hasOwnProperty.call(r,"error"))throw new CI(r.id,r.error.code,r.error.message);return r})}function SP(t,e,n){return wn(this,void 0,void 0,function*(){const[r,i]=yield Promise.all([crypto.subtle.exportKey("raw",e),crypto.subtle.importKey("raw",t.slice(0,LI),{name:"ECDH",namedCurve:"P-256"},!1,[])]),s=yield crypto.subtle.deriveBits({name:"ECDH",public:i},n,256),o=yield crypto.subtle.importKey("raw",s,"HKDF",!1,["deriveKey"]);return yield crypto.subtle.deriveKey({name:"HKDF",hash:"SHA-256",salt:new Uint8Array(r),info:new Uint8Array},o,{name:"AES-GCM",length:128},!1,["encrypt","decrypt"])})}function AP(t,e){return wn(this,void 0,void 0,function*(){const n=yield DI(t,e),r=JSON.parse(n);let i="legacy";if(Object.hasOwnProperty.call(r,"v"))switch(r.v){case 1:case"1":case"v1":i="v1";break;case"legacy":i="legacy";break;default:throw new As(Ss.ERROR_INVALID_PROTOCOL_VERSION,`Unknown/unsupported protocol version: ${r.v}`)}return{protocol_version:i}})}function IP(){return BI(49152+Math.floor(Math.random()*16384))}function BI(t){if(t<49152||t>65535)throw new As(Ss.ERROR_ASSOCIATION_PORT_OUT_OF_RANGE,`Association port number must be between 49152 and 65535. ${t} given.`,{port:t});return t}function kP(t){let e="";const n=new Uint8Array(t),r=n.byteLength;for(let i=0;i<r;i++)e+=String.fromCharCode(n[i]);return window.btoa(e)}function RP(t){return t.replace(/[/+=]/g,e=>({"/":"_","+":"-","=":"."})[e])}const NP="solana-wallet";function V1(t){return t.replace(/(^\/+|\/+$)/g,"").split("/")}function TP(t,e){let n=null;if(e){try{n=new URL(e)}catch{}if((n==null?void 0:n.protocol)!=="https:")throw new As(Ss.ERROR_FORBIDDEN_WALLET_BASE_URL,"Base URLs supplied by wallets must be valid `https` URLs")}n||(n=new URL(`${NP}:/`));const r=t.startsWith("/")?t:[...V1(n.pathname),...V1(t)].join("/");return new URL(r,n)}function MP(t,e,n,r=["v1"]){return wn(this,void 0,void 0,function*(){const i=BI(e),s=yield crypto.subtle.exportKey("raw",t),o=kP(s),a=TP("v1/associate/local",n);return a.searchParams.set("association",RP(o)),a.searchParams.set("port",`${i}`),r.forEach(c=>{a.searchParams.set("v",c)}),a})}const uh={Firefox:0,Other:1};function OP(){return navigator.userAgent.indexOf("Firefox/")!==-1?uh.Firefox:uh.Other}function CP(){return new Promise((t,e)=>{function n(){clearTimeout(i),window.removeEventListener("blur",r)}function r(){n(),t()}window.addEventListener("blur",r);const i=setTimeout(()=>{n(),e()},2e3)})}let xl=null;function LP(t){xl==null&&(xl=document.createElement("iframe"),xl.style.display="none",document.body.appendChild(xl)),xl.contentWindow.location.href=t.toString()}function DP(t,e){return wn(this,void 0,void 0,function*(){const n=IP(),r=yield MP(t,n,e);if(r.protocol==="https:")window.location.assign(r);else try{const i=OP();switch(i){case uh.Firefox:LP(r);break;case uh.Other:{const s=CP();window.location.assign(r),yield s;break}default:}}catch{throw new As(Ss.ERROR_WALLET_NOT_FOUND,"Found no installed wallet that supports the mobile wallet protocol.")}return n})}const Z1={retryDelayScheduleMs:[150,150,200,500,500,750,750,1e3],timeoutMs:3e4},PP="com.solana.mobilewalletadapter.v1";function BP(){if(typeof window>"u"||window.isSecureContext!==!0)throw new As(Ss.ERROR_SECURE_CONTEXT_REQUIRED,"The mobile wallet adapter protocol must be used in a secure context (`https`).")}function zP(t){let e;try{e=new URL(t)}catch{throw new As(Ss.ERROR_FORBIDDEN_WALLET_BASE_URL,"Invalid base URL supplied by wallet")}if(e.protocol!=="https:")throw new As(Ss.ERROR_FORBIDDEN_WALLET_BASE_URL,"Base URLs supplied by wallets must be valid `https` URLs")}function K1(t){return new DataView(t).getUint32(0,!1)}function jP(t,e){return wn(this,void 0,void 0,function*(){BP();const n=yield vP(),r=yield DP(n.publicKey,e==null?void 0:e.baseUri),i=`ws://localhost:${r}/solana-wallet`;let s;const o=(()=>{const u=[...Z1.retryDelayScheduleMs];return()=>u.length>1?u.shift():u[0]})();let a=1,c=0,l={__type:"disconnected"};return new Promise((u,f)=>{let g;const p={},_=()=>wn(this,void 0,void 0,function*(){if(l.__type!=="connecting"){console.warn(`Expected adapter state to be \`connecting\` at the moment the websocket opens. Got \`${l.__type}\`.`);return}const{associationKeypair:L}=l;g.removeEventListener("open",_);const z=yield bP();g.send(yield cP(z.publicKey,L.privateKey)),l={__type:"hello_req_sent",associationPublicKey:L.publicKey,ecdhPrivateKey:z.privateKey}}),A=L=>{L.wasClean?l={__type:"disconnected"}:f(new As(Ss.ERROR_SESSION_CLOSED,`The wallet session dropped unexpectedly (${L.code}: ${L.reason}).`,{closeEvent:L})),b()},S=L=>wn(this,void 0,void 0,function*(){b(),Date.now()-s>=Z1.timeoutMs?f(new As(Ss.ERROR_SESSION_TIMEOUT,`Failed to connect to the wallet websocket on port ${r}.`)):(yield new Promise(z=>{const D=o();x=window.setTimeout(z,D)}),M())}),E=L=>wn(this,void 0,void 0,function*(){const z=yield L.data.arrayBuffer();switch(l.__type){case"connected":try{const D=z.slice(0,Yo),F=K1(D);if(F!==c+1)throw new Error("Encrypted message has invalid sequence number");c=F;const $=yield xP(z,l.sharedSecret),V=p[$.id];delete p[$.id],V.resolve($.result)}catch(D){if(D instanceof CI){const F=p[D.jsonRpcMessageId];delete p[D.jsonRpcMessageId],F.reject(D)}else throw D}break;case"hello_req_sent":{const D=yield SP(z,l.associationPublicKey,l.ecdhPrivateKey),F=z.slice(LI),$=F.byteLength!==0?yield wn(this,void 0,void 0,function*(){const G=F.slice(0,Yo),W=K1(G);if(W!==c+1)throw new Error("Encrypted message has invalid sequence number");return c=W,AP(F,D)}):{protocol_version:"legacy"};l={__type:"connected",sharedSecret:D,sessionProperties:$};const V=hP($.protocol_version,(G,W)=>wn(this,void 0,void 0,function*(){const N=a++;return g.send(yield EP({id:N,jsonrpc:"2.0",method:G,params:W??{}},D)),new Promise((d,h)=>{p[N]={resolve(v){switch(G){case"authorize":case"reauthorize":{const{wallet_uri_base:I}=v;if(I!=null)try{zP(I)}catch(k){h(k);return}break}}d(v)},reject:h}})}));try{u(yield t(V))}catch(G){f(G)}finally{b(),g.close()}break}}});let b,x;const M=()=>{b&&b(),l={__type:"connecting",associationKeypair:n},s===void 0&&(s=Date.now()),g=new WebSocket(i,[PP]),g.addEventListener("open",_),g.addEventListener("close",A),g.addEventListener("error",S),g.addEventListener("message",E),b=()=>{window.clearTimeout(x),g.removeEventListener("open",_),g.removeEventListener("close",A),g.removeEventListener("error",S),g.removeEventListener("message",E)}};M()})})}function UP(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),n=0;n<e.length;n++)e[n]=255;for(var r=0;r<t.length;r++){var i=t.charAt(r),s=i.charCodeAt(0);if(e[s]!==255)throw new TypeError(i+" is ambiguous");e[s]=r}var o=t.length,a=t.charAt(0),c=Math.log(o)/Math.log(256),l=Math.log(256)/Math.log(o);function u(p){if(p instanceof Uint8Array||(ArrayBuffer.isView(p)?p=new Uint8Array(p.buffer,p.byteOffset,p.byteLength):Array.isArray(p)&&(p=Uint8Array.from(p))),!(p instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(p.length===0)return"";for(var _=0,A=0,S=0,E=p.length;S!==E&&p[S]===0;)S++,_++;for(var b=(E-S)*l+1>>>0,x=new Uint8Array(b);S!==E;){for(var M=p[S],L=0,z=b-1;(M!==0||L<A)&&z!==-1;z--,L++)M+=256*x[z]>>>0,x[z]=M%o>>>0,M=M/o>>>0;if(M!==0)throw new Error("Non-zero carry");A=L,S++}for(var D=b-A;D!==b&&x[D]===0;)D++;for(var F=a.repeat(_);D<b;++D)F+=t.charAt(x[D]);return F}function f(p){if(typeof p!="string")throw new TypeError("Expected String");if(p.length===0)return new Uint8Array;for(var _=0,A=0,S=0;p[_]===a;)A++,_++;for(var E=(p.length-_)*c+1>>>0,b=new Uint8Array(E);p[_];){var x=e[p.charCodeAt(_)];if(x===255)return;for(var M=0,L=E-1;(x!==0||M<S)&&L!==-1;L--,M++)x+=o*b[L]>>>0,b[L]=x%256>>>0,x=x/256>>>0;if(x!==0)throw new Error("Non-zero carry");S=M,_++}for(var z=E-S;z!==E&&b[z]===0;)z++;for(var D=new Uint8Array(A+(E-z)),F=A;z!==E;)D[F++]=b[z++];return D}function g(p){var _=f(p);if(_)return _;throw new Error("Non-base"+o+" character")}return{encode:u,decodeUnsafe:f,decode:g}}var FP=UP;const WP=FP,HP="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";var $P=WP(HP);const VP=Ro($P);function eg(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function Zd(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(u){try{l(r.next(u))}catch(f){o(f)}}function c(u){try{l(r.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((r=r.apply(t,[])).next())})}function zI(t){return window.btoa(String.fromCharCode.call(null,...t))}function tg(t){return new Uint8Array(window.atob(t).split("").map(e=>e.charCodeAt(0)))}function G1(t){const e="version"in t?t.serialize():t.serialize({requireAllSignatures:!1,verifySignatures:!1});return zI(e)}function ZP(t){const n=t[0]*Lc+1;return hp.deserializeMessageVersion(t.slice(n,t.length))==="legacy"?Je.from(t):Dc.deserialize(t)}function KP(t,e){return Zd(this,void 0,void 0,function*(){return yield jP(r=>{const i=new Proxy({},{get(s,o){if(s[o]==null)switch(o){case"signAndSendTransactions":s[o]=function(a){var{minContextSlot:c,commitment:l,skipPreflight:u,maxRetries:f,waitForCommitmentToSendNextTransaction:g,transactions:p}=a,_=eg(a,["minContextSlot","commitment","skipPreflight","maxRetries","waitForCommitmentToSendNextTransaction","transactions"]);return Zd(this,void 0,void 0,function*(){const A=p.map(G1),S={min_context_slot:c,commitment:l,skip_preflight:u,max_retries:f,wait_for_commitment_to_send_next_transaction:g},{signatures:E}=yield r.signAndSendTransactions(Object.assign(Object.assign(Object.assign({},_),Object.values(S).some(x=>x!=null)?{options:S}:null),{payloads:A}));return E.map(tg).map(VP.encode)})};break;case"signMessages":s[o]=function(a){var{payloads:c}=a,l=eg(a,["payloads"]);return Zd(this,void 0,void 0,function*(){const u=c.map(zI),{signed_payloads:f}=yield r.signMessages(Object.assign(Object.assign({},l),{payloads:u}));return f.map(tg)})};break;case"signTransactions":s[o]=function(a){var{transactions:c}=a,l=eg(a,["transactions"]);return Zd(this,void 0,void 0,function*(){const u=c.map(G1),{signed_payloads:f}=yield r.signTransactions(Object.assign(Object.assign({},l),{payloads:u}));return f.map(tg).map(ZP)})};break;default:{s[o]=r[o];break}}return s[o]},defineProperty(){return!1},deleteProperty(){return!1}});return t(i)},e)})}function at(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(u){try{l(r.next(u))}catch(f){o(f)}}function c(u){try{l(r.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((r=r.apply(t,[])).next())})}function vf(t){return new Uint8Array(window.atob(t).split("").map(e=>e.charCodeAt(0)))}function GP(){return typeof window<"u"&&window.isSecureContext&&typeof document<"u"&&/android/i.test(navigator.userAgent)}const Ws="Mobile Wallet Adapter",YP=64;function qP(t){const e=vf(t);return new ie(e)}function Y1(t){return"version"in t}class QP extends JD{constructor(e){var n;super(),this.supportedTransactionVersions=new Set(["legacy",0]),this.name=Ws,this.url="https://solanamobile.com/wallets",this.icon="data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjI4IiB3aWR0aD0iMjgiIHZpZXdCb3g9Ii0zIDAgMjggMjgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI0RDQjhGRiI+PHBhdGggZD0iTTE3LjQgMTcuNEgxNXYyLjRoMi40di0yLjRabTEuMi05LjZoLTIuNHYyLjRoMi40VjcuOFoiLz48cGF0aCBkPSJNMjEuNiAzVjBoLTIuNHYzaC0zLjZWMGgtMi40djNoLTIuNHY2LjZINC41YTIuMSAyLjEgMCAxIDEgMC00LjJoMi43VjNINC41QTQuNSA0LjUgMCAwIDAgMCA3LjVWMjRoMjEuNnYtNi42aC0yLjR2NC4ySDIuNFYxMS41Yy41LjMgMS4yLjQgMS44LjVoNy41QTYuNiA2LjYgMCAwIDAgMjQgOVYzaC0yLjRabTAgNS43YTQuMiA0LjIgMCAxIDEtOC40IDBWNS40aDguNHYzLjNaIi8+PC9nPjwvc3ZnPg==",this._connecting=!1,this._connectionGeneration=0,this._readyState=GP()?Te.Loadable:Te.Unsupported,this._authorizationResultCache=e.authorizationResultCache,this._addressSelector=e.addressSelector,this._appIdentity=e.appIdentity,this._chain=(n=e.chain)!==null&&n!==void 0?n:e.cluster,this._onWalletNotFound=e.onWalletNotFound,this._readyState!==Te.Unsupported&&this._authorizationResultCache.get().then(r=>{r&&this.declareWalletAsInstalled()})}get publicKey(){if(this._publicKey==null&&this._selectedAddress!=null)try{this._publicKey=qP(this._selectedAddress)}catch(e){throw new wo(e instanceof Error&&(e==null?void 0:e.message)||"Unknown error",e)}return this._publicKey?this._publicKey:null}get connected(){return!!this._authorizationResult}get connecting(){return this._connecting}get readyState(){return this._readyState}declareWalletAsInstalled(){this._readyState!==Te.Installed&&this.emit("readyStateChange",this._readyState=Te.Installed)}runWithGuard(e){return at(this,void 0,void 0,function*(){try{return yield e()}catch(n){throw this.emit("error",n),n}})}autoConnect_DO_NOT_USE_OR_YOU_WILL_BE_FIRED(){return at(this,void 0,void 0,function*(){return yield this.autoConnect()})}autoConnect(){return at(this,void 0,void 0,function*(){if(!(this.connecting||this.connected))return yield this.runWithGuard(()=>at(this,void 0,void 0,function*(){if(this._readyState!==Te.Installed&&this._readyState!==Te.Loadable)throw new Ci;this._connecting=!0;try{const e=yield this._authorizationResultCache.get();e&&this.handleAuthorizationResult(e)}catch(e){throw new hs(e instanceof Error&&e.message||"Unknown error",e)}finally{this._connecting=!1}}))})}connect(){return at(this,void 0,void 0,function*(){if(!(this.connecting||this.connected))return yield this.runWithGuard(()=>at(this,void 0,void 0,function*(){if(this._readyState!==Te.Installed&&this._readyState!==Te.Loadable)throw new Ci;this._connecting=!0;try{yield this.performAuthorization()}catch(e){throw new hs(e instanceof Error&&e.message||"Unknown error",e)}finally{this._connecting=!1}}))})}performAuthorization(e){return at(this,void 0,void 0,function*(){try{const n=yield this._authorizationResultCache.get();return n?(this.handleAuthorizationResult(n),n):yield this.transact(r=>at(this,void 0,void 0,function*(){const i=yield r.authorize({chain:this._chain,identity:this._appIdentity,sign_in_payload:e});return Promise.all([this._authorizationResultCache.set(i),this.handleAuthorizationResult(i)]),i}))}catch(n){throw new hs(n instanceof Error&&n.message||"Unknown error",n)}})}handleAuthorizationResult(e){var n;return at(this,void 0,void 0,function*(){const r=this._authorizationResult==null||((n=this._authorizationResult)===null||n===void 0?void 0:n.accounts.length)!==e.accounts.length||this._authorizationResult.accounts.some((i,s)=>i.address!==e.accounts[s].address);if(this._authorizationResult=e,this.declareWalletAsInstalled(),r){const i=yield this._addressSelector.select(e.accounts.map(({address:s})=>s));i!==this._selectedAddress&&(this._selectedAddress=i,delete this._publicKey,this.emit("connect",this.publicKey))}})}performReauthorization(e,n){return at(this,void 0,void 0,function*(){try{const r=yield e.authorize({auth_token:n,identity:this._appIdentity});Promise.all([this._authorizationResultCache.set(r),this.handleAuthorizationResult(r)])}catch(r){throw this.disconnect(),new ld(r instanceof Error&&(r==null?void 0:r.message)||"Unknown error",r)}})}disconnect(){return at(this,void 0,void 0,function*(){this._authorizationResultCache.clear(),this._connecting=!1,this._connectionGeneration++,delete this._authorizationResult,delete this._publicKey,delete this._selectedAddress,this.emit("disconnect")})}transact(e){var n;return at(this,void 0,void 0,function*(){const r=(n=this._authorizationResult)===null||n===void 0?void 0:n.wallet_uri_base,i=r?{baseUri:r}:void 0,s=this._connectionGeneration;try{return yield KP(e,i)}catch(o){throw this._connectionGeneration!==s&&(yield new Promise(()=>{})),o instanceof Error&&o.name==="SolanaMobileWalletAdapterError"&&o.code==="ERROR_WALLET_NOT_FOUND"&&(yield this._onWalletNotFound(this)),o}})}assertIsAuthorized(){if(!this._authorizationResult||!this._selectedAddress)throw new Et;return{authToken:this._authorizationResult.auth_token,selectedAddress:this._selectedAddress}}performSignTransactions(e){return at(this,void 0,void 0,function*(){const{authToken:n}=this.assertIsAuthorized();try{return yield this.transact(r=>at(this,void 0,void 0,function*(){return yield this.performReauthorization(r,n),yield r.signTransactions({transactions:e})}))}catch(r){throw new Gn(r==null?void 0:r.message,r)}})}sendTransaction(e,n,r){return at(this,void 0,void 0,function*(){return yield this.runWithGuard(()=>at(this,void 0,void 0,function*(){const{authToken:i}=this.assertIsAuthorized(),s=r==null?void 0:r.minContextSlot;try{return yield this.transact(o=>at(this,void 0,void 0,function*(){function a(){let f;switch(n.commitment){case"confirmed":case"finalized":case"processed":f=n.commitment;break;default:f="finalized"}let g;switch(r==null?void 0:r.preflightCommitment){case"confirmed":case"finalized":case"processed":g=r.preflightCommitment;break;case void 0:g=f;break;default:g="finalized"}return(g==="finalized"?2:g==="confirmed"?1:0)<(f==="finalized"?2:f==="confirmed"?1:0)?g:f}const[c,l,u]=yield Promise.all([o.getCapabilities(),this.performReauthorization(o,i),Y1(e)?null:at(this,void 0,void 0,function*(){var f;if(e.feePayer||(e.feePayer=(f=this.publicKey)!==null&&f!==void 0?f:void 0),e.recentBlockhash==null){const{blockhash:g}=yield n.getLatestBlockhash({commitment:a()});e.recentBlockhash=g}})]);if(c.supports_sign_and_send_transactions)return(yield o.signAndSendTransactions({minContextSlot:s,transactions:[e]}))[0];{const[f]=yield o.signTransactions({transactions:[e]});if(Y1(f))return yield n.sendTransaction(f);{const g=f.serialize();return yield n.sendRawTransaction(g,Object.assign(Object.assign({},r),{preflightCommitment:a()}))}}}))}catch(o){throw new gs(o==null?void 0:o.message,o)}}))})}signTransaction(e){return at(this,void 0,void 0,function*(){return yield this.runWithGuard(()=>at(this,void 0,void 0,function*(){const[n]=yield this.performSignTransactions([e]);return n}))})}signAllTransactions(e){return at(this,void 0,void 0,function*(){return yield this.runWithGuard(()=>at(this,void 0,void 0,function*(){return yield this.performSignTransactions(e)}))})}signMessage(e){return at(this,void 0,void 0,function*(){return yield this.runWithGuard(()=>at(this,void 0,void 0,function*(){const{authToken:n,selectedAddress:r}=this.assertIsAuthorized();try{return yield this.transact(i=>at(this,void 0,void 0,function*(){yield this.performReauthorization(i,n);const[s]=yield i.signMessages({addresses:[r],payloads:[e]});return s.slice(-YP)}))}catch(i){throw new dd(i==null?void 0:i.message,i)}}))})}signIn(e){return at(this,void 0,void 0,function*(){return yield this.runWithGuard(()=>at(this,void 0,void 0,function*(){var n,r;if(this._readyState!==Te.Installed&&this._readyState!==Te.Loadable)throw new Ci;this._connecting=!0;try{const i=yield this.performAuthorization(Object.assign(Object.assign({},e),{domain:(n=e==null?void 0:e.domain)!==null&&n!==void 0?n:window.location.host}));if(!i.sign_in_result)throw new Error("Sign in failed, no sign in result returned by wallet");const s=i.sign_in_result.address;return{account:Object.assign(Object.assign({},(r=i.accounts.find(a=>a.address==s))!==null&&r!==void 0?r:{address:s}),{publicKey:vf(s)}),signedMessage:vf(i.sign_in_result.signed_message),signature:vf(i.sign_in_result.signature)}}catch(i){throw new hs(i instanceof Error&&i.message||"Unknown error",i)}finally{this._connecting=!1}}))})}}function XP(){return{select(t){return at(this,void 0,void 0,function*(){return t[0]})}}}const ng="SolanaMobileWalletAdapterDefaultAuthorizationCache";function JP(){let t;try{t=window.localStorage}catch{}return{clear(){return at(this,void 0,void 0,function*(){if(t)try{t.removeItem(ng)}catch{}})},get(){return at(this,void 0,void 0,function*(){if(t)try{return JSON.parse(t.getItem(ng))||void 0}catch{}})},set(e){return at(this,void 0,void 0,function*(){if(t)try{t.setItem(ng,JSON.stringify(e))}catch{}})}}}function eB(t){return at(this,void 0,void 0,function*(){typeof window<"u"&&window.location.assign(t.url)})}function tB(){return eB}var nB=function(t,e,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(t,n):i?i.value=n:e.set(t,n),n},rB=function(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)},bf;function iB(t){const e=({register:n})=>n(t);try{window.dispatchEvent(new sB(e))}catch(n){console.error(`wallet-standard:register-wallet event could not be dispatched +`,n)}try{window.addEventListener("wallet-standard:app-ready",({detail:n})=>e(n))}catch(n){console.error(`wallet-standard:app-ready event listener could not be added +`,n)}}class sB extends Event{constructor(e){super("wallet-standard:register-wallet",{bubbles:!1,cancelable:!1,composed:!1}),bf.set(this,void 0),nB(this,bf,e,"f")}get detail(){return rB(this,bf,"f")}get type(){return"wallet-standard:register-wallet"}preventDefault(){throw new Error("preventDefault cannot be called")}stopImmediatePropagation(){throw new Error("stopImmediatePropagation cannot be called")}stopPropagation(){throw new Error("stopPropagation cannot be called")}}bf=new WeakMap;function oB(t,e){if(t===e)return!0;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var fn=function(t,e,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(t,n):i?i.value=n:e.set(t,n),n},ke=function(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)},Dn,lr,qo,Qo,jo,Ll,dh,ct,fh,Fy,Ef,Wy,Yl,Hy,q1,Q1,X1,J1;class aB extends NI{constructor({wallet:e}){super(),Dn.add(this),lr.set(this,void 0),qo.set(this,void 0),Qo.set(this,void 0),jo.set(this,void 0),Ll.set(this,void 0),dh.set(this,void 0),ct.set(this,void 0),fh.set(this,typeof window>"u"||typeof document>"u"?Te.Unsupported:Te.Installed),Hy.set(this,n=>{if("accounts"in n){const r=ke(this,ct,"f").accounts[0];ke(this,lr,"f")&&!ke(this,jo,"f")&&r!==ke(this,lr,"f")&&(r?ke(this,Dn,"m",Ef).call(this,r):(this.emit("error",new ld),ke(this,Dn,"m",Wy).call(this)))}"features"in n&&ke(this,Dn,"m",Yl).call(this)}),fn(this,ct,e,"f"),fn(this,lr,null,"f"),fn(this,qo,null,"f"),fn(this,Qo,!1,"f"),fn(this,jo,!1,"f"),fn(this,Ll,ke(this,ct,"f").features[o_].on("change",ke(this,Hy,"f")),"f"),ke(this,Dn,"m",Yl).call(this)}get name(){return ke(this,ct,"f").name}get url(){return"https://github.com/solana-labs/wallet-standard"}get icon(){return ke(this,ct,"f").icon}get readyState(){return ke(this,fh,"f")}get publicKey(){return ke(this,qo,"f")}get connecting(){return ke(this,Qo,"f")}get supportedTransactionVersions(){return ke(this,dh,"f")}get wallet(){return ke(this,ct,"f")}get standard(){return!0}destroy(){fn(this,lr,null,"f"),fn(this,qo,null,"f"),fn(this,Qo,!1,"f"),fn(this,jo,!1,"f");const e=ke(this,Ll,"f");e&&(fn(this,Ll,null,"f"),e())}async autoConnect(){return ke(this,Dn,"m",Fy).call(this,{silent:!0})}async connect(){return ke(this,Dn,"m",Fy).call(this)}async disconnect(){if(By in ke(this,ct,"f").features)try{fn(this,jo,!0,"f"),await ke(this,ct,"f").features[By].disconnect()}catch(e){this.emit("error",new ud(e==null?void 0:e.message,e))}finally{fn(this,jo,!1,"f")}ke(this,Dn,"m",Wy).call(this)}async sendTransaction(e,n,r={}){try{const i=ke(this,lr,"f");if(!i)throw new Et;let s;if(ls in ke(this,ct,"f").features)if(i.features.includes(ls))s=ls;else if(In in ke(this,ct,"f").features&&i.features.includes(In))s=In;else throw new ps;else if(In in ke(this,ct,"f").features){if(!i.features.includes(In))throw new ps;s=In}else throw new Go;const o=oP(n.rpcEndpoint);if(!i.chains.includes(o))throw new gs;try{const{signers:a,...c}=r;let l;if(ys(e)?(a!=null&&a.length&&e.sign(a),l=e.serialize()):(e=await this.prepareTransaction(e,n,c),a!=null&&a.length&&e.partialSign(...a),l=new Uint8Array(e.serialize({requireAllSignatures:!1,verifySignatures:!1}))),s===ls){const[u]=await ke(this,ct,"f").features[ls].signAndSendTransaction({account:i,chain:o,transaction:l,options:{preflightCommitment:X0(c.preflightCommitment||n.commitment),skipPreflight:c.skipPreflight,maxRetries:c.maxRetries,minContextSlot:c.minContextSlot}});return jt.encode(u.signature)}else{const[u]=await ke(this,ct,"f").features[In].signTransaction({account:i,chain:o,transaction:l,options:{preflightCommitment:X0(c.preflightCommitment||n.commitment),minContextSlot:c.minContextSlot}});return await n.sendRawTransaction(u.signedTransaction,{...c,preflightCommitment:X0(c.preflightCommitment||n.commitment)})}}catch(a){throw a instanceof Tn?a:new gs(a==null?void 0:a.message,a)}}catch(i){throw this.emit("error",i),i}}}lr=new WeakMap,qo=new WeakMap,Qo=new WeakMap,jo=new WeakMap,Ll=new WeakMap,dh=new WeakMap,ct=new WeakMap,fh=new WeakMap,Hy=new WeakMap,Dn=new WeakSet,Fy=async function(e){try{if(this.connected||this.connecting)return;if(ke(this,fh,"f")!==Te.Installed)throw new Ci;if(fn(this,Qo,!0,"f"),!ke(this,ct,"f").accounts.length)try{await ke(this,ct,"f").features[s_].connect(e)}catch(r){throw new hs(r==null?void 0:r.message,r)}const n=ke(this,ct,"f").accounts[0];if(!n)throw new ps;ke(this,Dn,"m",Ef).call(this,n)}catch(n){throw this.emit("error",n),n}finally{fn(this,Qo,!1,"f")}},Ef=function(e){let n;try{n=new ie(e.address)}catch(r){throw new wo(r==null?void 0:r.message,r)}fn(this,lr,e,"f"),fn(this,qo,n,"f"),ke(this,Dn,"m",Yl).call(this),this.emit("connect",n)},Wy=function(){fn(this,lr,null,"f"),fn(this,qo,null,"f"),ke(this,Dn,"m",Yl).call(this),this.emit("disconnect")},Yl=function(){var n,r;const e=ls in ke(this,ct,"f").features?ke(this,ct,"f").features[ls].supportedTransactionVersions:ke(this,ct,"f").features[In].supportedTransactionVersions;fn(this,dh,oB(e,["legacy"])?null:new Set(e),"f"),In in ke(this,ct,"f").features&&((n=ke(this,lr,"f"))!=null&&n.features.includes(In))?(this.signTransaction=ke(this,Dn,"m",q1),this.signAllTransactions=ke(this,Dn,"m",Q1)):(delete this.signTransaction,delete this.signAllTransactions),ja in ke(this,ct,"f").features&&((r=ke(this,lr,"f"))!=null&&r.features.includes(ja))?this.signMessage=ke(this,Dn,"m",X1):delete this.signMessage,Q0 in ke(this,ct,"f").features?this.signIn=ke(this,Dn,"m",J1):delete this.signIn},q1=async function(e){try{const n=ke(this,lr,"f");if(!n)throw new Et;if(!(In in ke(this,ct,"f").features))throw new Go;if(!n.features.includes(In))throw new ps;try{const i=(await ke(this,ct,"f").features[In].signTransaction({account:n,transaction:ys(e)?e.serialize():new Uint8Array(e.serialize({requireAllSignatures:!1,verifySignatures:!1}))}))[0].signedTransaction;return ys(e)?Dc.deserialize(i):Je.from(i)}catch(r){throw r instanceof Tn?r:new Gn(r==null?void 0:r.message,r)}}catch(n){throw this.emit("error",n),n}},Q1=async function(e){try{const n=ke(this,lr,"f");if(!n)throw new Et;if(!(In in ke(this,ct,"f").features))throw new Go;if(!n.features.includes(In))throw new ps;try{const r=await ke(this,ct,"f").features[In].signTransaction(...e.map(i=>({account:n,transaction:ys(i)?i.serialize():new Uint8Array(i.serialize({requireAllSignatures:!1,verifySignatures:!1}))})));return e.map((i,s)=>{const o=r[s].signedTransaction;return ys(i)?Dc.deserialize(o):Je.from(o)})}catch(r){throw new Gn(r==null?void 0:r.message,r)}}catch(n){throw this.emit("error",n),n}},X1=async function(e){try{const n=ke(this,lr,"f");if(!n)throw new Et;if(!(ja in ke(this,ct,"f").features))throw new Go;if(!n.features.includes(ja))throw new ps;try{return(await ke(this,ct,"f").features[ja].signMessage({account:n,message:e}))[0].signature}catch(r){throw new dd(r==null?void 0:r.message,r)}}catch(n){throw this.emit("error",n),n}},J1=async function(e={}){try{if(!(Q0 in ke(this,ct,"f").features))throw new Go;let n;try{[n]=await ke(this,ct,"f").features[Q0].signIn(e)}catch(r){throw new W1(r==null?void 0:r.message,r)}if(!n)throw new W1;return ke(this,Dn,"m",Ef).call(this,n.account),n}catch(n){throw this.emit("error",n),n}};const cB=eP;var lB=function(t,e,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(t,n):i?i.value=n:e.set(t,n),n},uB=function(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)},xf;let Sr;const Sf=new Set,nc={};function dB(){if(Sr||(Sr=Object.freeze({register:eb,get:fB,on:hB}),typeof window>"u"))return Sr;const t=Object.freeze({register:eb});try{window.addEventListener("wallet-standard:register-wallet",({detail:e})=>e(t))}catch(e){console.error(`wallet-standard:register-wallet event listener could not be added +`,e)}try{window.dispatchEvent(new pB(t))}catch(e){console.error(`wallet-standard:app-ready event could not be dispatched +`,e)}return Sr}function eb(...t){var e;return t=t.filter(n=>!Sf.has(n)),t.length?(t.forEach(n=>Sf.add(n)),(e=nc.register)==null||e.forEach(n=>$y(()=>n(...t))),function(){var r;t.forEach(i=>Sf.delete(i)),(r=nc.unregister)==null||r.forEach(i=>$y(()=>i(...t)))}):()=>{}}function fB(){return[...Sf]}function hB(t,e){var n;return(n=nc[t])!=null&&n.push(e)||(nc[t]=[e]),function(){var i;nc[t]=(i=nc[t])==null?void 0:i.filter(s=>e!==s)}}function $y(t){try{t()}catch(e){console.error(e)}}class pB extends Event{constructor(e){super("wallet-standard:app-ready",{bubbles:!1,cancelable:!1,composed:!1}),xf.set(this,void 0),lB(this,xf,e,"f")}get detail(){return uB(this,xf,"f")}get type(){return"wallet-standard:app-ready"}preventDefault(){throw new Error("preventDefault cannot be called")}stopImmediatePropagation(){throw new Error("stopImmediatePropagation cannot be called")}stopPropagation(){throw new Error("stopPropagation cannot be called")}}xf=new WeakMap;function gB(){if(Sr||(Sr=dB(),typeof window>"u"))return Sr;const t=window.navigator.wallets||[];if(!Array.isArray(t))return console.error("window.navigator.wallets is not an array"),Sr;const{register:e}=Sr,n=(...r)=>r.forEach(i=>$y(()=>i({register:e})));try{Object.defineProperty(window.navigator,"wallets",{value:Object.freeze({push:n})})}catch{return console.error("window.navigator.wallets could not be set"),Sr}return n(...t),Sr}function yB(t){const e=tb(()=>new Set),{get:n,on:r}=tb(()=>gB()),[i,s]=j.useState(()=>nb(n()));j.useEffect(()=>{const a=[r("register",(...c)=>s(l=>[...l,...nb(c)])),r("unregister",(...c)=>s(l=>l.filter(u=>c.some(f=>f===u.wallet))))];return()=>a.forEach(c=>c())},[r]);const o=mB(i);return j.useEffect(()=>{if(!o)return;const a=new Set(i);new Set(o.filter(l=>!a.has(l))).forEach(l=>l.destroy())},[o,i]),j.useEffect(()=>()=>i.forEach(a=>a.destroy()),[]),j.useMemo(()=>[...i,...t.filter(({name:a})=>i.some(c=>c.name===a)?(e.has(a)||(e.add(a),console.warn(`${a} was registered as a Standard Wallet. The Wallet Adapter for ${a} can be removed from your app.`)),!1):!0)],[i,t,e])}function tb(t){const e=j.useRef();return e.current||(e.current={value:t()}),e.current.value}function mB(t){const e=j.useRef();return j.useEffect(()=>{e.current=t}),e.current}function nb(t){return t.filter(cB).map(e=>new aB({wallet:e}))}var mc;(function(t){t[t.DESKTOP_WEB=0]="DESKTOP_WEB",t[t.MOBILE_WEB=1]="MOBILE_WEB"})(mc||(mc={}));function wB(t){return/(WebView|Version\/.+(Chrome)\/(\d+)\.(\d+)\.(\d+)\.(\d+)|; wv\).+(Chrome)\/(\d+)\.(\d+)\.(\d+)\.(\d+))/i.test(t)}function _B({adapters:t,userAgentString:e}){return t.some(n=>n.name!==Ws&&n.readyState===Te.Installed)?mc.DESKTOP_WEB:e&&/android/i.test(e)&&!wB(e)?mc.MOBILE_WEB:mc.DESKTOP_WEB}function vB(t){return t?/devnet/i.test(t)?"devnet":/testnet/i.test(t)?"testnet":"mainnet-beta":"mainnet-beta"}function bB({children:t,wallets:e,adapter:n,isUnloadingRef:r,onAutoConnectRequest:i,onConnectError:s,onError:o,onSelectWallet:a}){const c=j.useRef(!1),[l,u]=j.useState(!1),f=j.useRef(!1),[g,p]=j.useState(!1),[_,A]=j.useState(()=>(n==null?void 0:n.publicKey)??null),[S,E]=j.useState(()=>(n==null?void 0:n.connected)??!1),b=j.useRef(o);j.useEffect(()=>(b.current=o,()=>{b.current=void 0}),[o]);const x=j.useRef((h,v)=>(r.current||(b.current?b.current(h,v):(console.error(h,v),h instanceof Ci&&typeof window<"u"&&v&&window.open(v.url,"_blank"))),h)),[M,L]=j.useState(()=>e.map(h=>({adapter:h,readyState:h.readyState})).filter(({readyState:h})=>h!==Te.Unsupported));j.useEffect(()=>{L(v=>e.map((I,k)=>{const O=v[k];return O&&O.adapter===I&&O.readyState===I.readyState?O:{adapter:I,readyState:I.readyState}}).filter(({readyState:I})=>I!==Te.Unsupported));function h(v){L(I=>{const k=I.findIndex(({adapter:B})=>B===this);if(k===-1)return I;const{adapter:O}=I[k];return[...I.slice(0,k),{adapter:O,readyState:v},...I.slice(k+1)].filter(({readyState:B})=>B!==Te.Unsupported)})}return e.forEach(v=>v.on("readyStateChange",h,v)),()=>{e.forEach(v=>v.off("readyStateChange",h,v))}},[n,e]);const z=j.useMemo(()=>M.find(h=>h.adapter===n)??null,[n,M]);j.useEffect(()=>{if(!n)return;const h=k=>{A(k),c.current=!1,u(!1),E(!0),f.current=!1,p(!1)},v=()=>{r.current||(A(null),c.current=!1,u(!1),E(!1),f.current=!1,p(!1))},I=k=>{x.current(k,n)};return n.on("connect",h),n.on("disconnect",v),n.on("error",I),()=>{n.off("connect",h),n.off("disconnect",v),n.off("error",I),v()}},[n,r]);const D=j.useRef(!1);j.useEffect(()=>()=>{D.current=!1},[n]),j.useEffect(()=>{D.current||c.current||S||!i||!((z==null?void 0:z.readyState)===Te.Installed||(z==null?void 0:z.readyState)===Te.Loadable)||(c.current=!0,u(!0),D.current=!0,async function(){try{await i()}catch{s()}finally{u(!1),c.current=!1}}())},[S,i,s,z]);const F=j.useCallback(async(h,v,I)=>{if(!n)throw x.current(new H1);if(!S)throw x.current(new Et,n);return await n.sendTransaction(h,v,I)},[n,S]),$=j.useMemo(()=>n&&"signTransaction"in n?async h=>{if(!S)throw x.current(new Et,n);return await n.signTransaction(h)}:void 0,[n,S]),V=j.useMemo(()=>n&&"signAllTransactions"in n?async h=>{if(!S)throw x.current(new Et,n);return await n.signAllTransactions(h)}:void 0,[n,S]),G=j.useMemo(()=>n&&"signMessage"in n?async h=>{if(!S)throw x.current(new Et,n);return await n.signMessage(h)}:void 0,[n,S]),W=j.useMemo(()=>n&&"signIn"in n?async h=>await n.signIn(h):void 0,[n]),N=j.useCallback(async()=>{if(c.current||f.current||z!=null&&z.adapter.connected)return;if(!z)throw x.current(new H1);const{adapter:h,readyState:v}=z;if(!(v===Te.Installed||v===Te.Loadable))throw x.current(new Ci,h);c.current=!0,u(!0);try{await h.connect()}catch(I){throw s(),I}finally{u(!1),c.current=!1}},[s,z]),d=j.useCallback(async()=>{if(!f.current&&n){f.current=!0,p(!0);try{await n.disconnect()}finally{p(!1),f.current=!1}}},[n]);return ee.createElement(TI.Provider,{value:{autoConnect:!!i,wallets:M,wallet:z,publicKey:_,connected:S,connecting:l,disconnecting:g,select:a,connect:N,disconnect:d,sendTransaction:F,signTransaction:$,signAllTransactions:V,signMessage:G,signIn:W}},t)}let rg;function EB(){var t;return rg===void 0&&(rg=((t=globalThis.navigator)==null?void 0:t.userAgent)??null),rg}function Kd(t){const e=EB();return _B({adapters:t,userAgentString:e})===mc.MOBILE_WEB}function xB(){const t=globalThis.location;if(t)return`${t.protocol}//${t.host}`}function SB({children:t,wallets:e,autoConnect:n,localStorageKey:r="walletName",onError:i}){const{connection:s}=i_(),o=yB(e),a=j.useMemo(()=>{if(!Kd(o))return null;const b=o.find(x=>x.name===Ws);return b||new QP({addressSelector:XP(),appIdentity:{uri:xB()},authorizationResultCache:JP(),cluster:vB(s==null?void 0:s.rpcEndpoint),onWalletNotFound:tB()})},[o,s==null?void 0:s.rpcEndpoint]),c=j.useMemo(()=>a==null||o.indexOf(a)!==-1?o:[a,...o],[o,a]),[l,u]=rP(r,Kd(o)?Ws:null),f=j.useMemo(()=>c.find(b=>b.name===l)??null,[c,l]),g=j.useCallback(b=>{l!==b&&(f&&f.name!==Ws&&f.disconnect(),u(b))},[f,u,l]);j.useEffect(()=>{if(!f)return;function b(){A.current||l===Ws&&Kd(o)||u(null)}return f.on("disconnect",b),()=>{f.off("disconnect",b)}},[f,o,u,l]);const p=j.useRef(!1),_=j.useMemo(()=>{if(!(!n||!f))return async()=>{(n===!0||await n(f))&&(p.current?await f.connect():await f.autoConnect())}},[n,f]),A=j.useRef(!1);j.useEffect(()=>{if(l===Ws&&Kd(o)){A.current=!1;return}function b(){A.current=!0}return window.addEventListener("beforeunload",b),()=>{window.removeEventListener("beforeunload",b)}},[o,l]);const S=j.useCallback(()=>{f&&f.name!==Ws&&g(null)},[f,g]),E=j.useCallback(b=>{p.current=!0,g(b)},[g]);return ee.createElement(bB,{wallets:c,adapter:f,isUnloadingRef:A,onAutoConnectRequest:_,onConnectError:S,onError:i,onSelectWallet:E},t)}function AB({onSelectWallet:t}){const{connect:e,connected:n,connecting:r,disconnect:i,disconnecting:s,publicKey:o,select:a,wallet:c,wallets:l}=il();let u;r?u="connecting":n?u="connected":s?u="disconnecting":c?u="has-wallet":u="no-wallet";const f=j.useCallback(()=>{e().catch(()=>{})},[e]),g=j.useCallback(()=>{i().catch(()=>{})},[i]),p=j.useCallback(()=>{t({onSelectWallet:a,wallets:l})},[t,a,l]);return{buttonState:u,onConnect:u==="has-wallet"?f:void 0,onDisconnect:u!=="disconnecting"&&u!=="no-wallet"?g:void 0,onSelectWallet:p,publicKey:o??void 0,walletIcon:c==null?void 0:c.adapter.icon,walletName:c==null?void 0:c.adapter.name}}const jI=t=>ee.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&&ee.createElement("i",{className:"wallet-adapter-button-start-icon"},t.startIcon),t.children,t.endIcon&&ee.createElement("i",{className:"wallet-adapter-button-end-icon"},t.endIcon)),UI=({wallet:t,...e})=>t&&ee.createElement("img",{src:t.adapter.icon,alt:`${t.adapter.name} icon`,...e});function IB({walletIcon:t,walletName:e,...n}){return ee.createElement(jI,{...n,className:"wallet-adapter-button-trigger",startIcon:t&&e?ee.createElement(UI,{wallet:{adapter:{icon:t,name:e}}}):void 0})}function kB({children:t,labels:e,...n}){const{setVisible:r}=GS(),{buttonState:i,onConnect:s,onDisconnect:o,publicKey:a,walletIcon:c,walletName:l}=AB({onSelectWallet(){r(!0)}}),[u,f]=j.useState(!1),[g,p]=j.useState(!1),_=j.useRef(null);j.useEffect(()=>{const S=E=>{const b=_.current;!b||b.contains(E.target)||p(!1)};return document.addEventListener("mousedown",S),document.addEventListener("touchstart",S),()=>{document.removeEventListener("mousedown",S),document.removeEventListener("touchstart",S)}},[]);const A=j.useMemo(()=>{if(t)return t;if(a){const S=a.toBase58();return S.slice(0,4)+".."+S.slice(-4)}else return i==="connecting"||i==="has-wallet"?e[i]:e["no-wallet"]},[i,t,e,a]);return ee.createElement("div",{className:"wallet-adapter-dropdown"},ee.createElement(IB,{...n,"aria-expanded":g,style:{pointerEvents:g?"none":"auto",...n.style},onClick:()=>{switch(i){case"no-wallet":r(!0);break;case"has-wallet":s&&s();break;case"connected":p(!0);break}},walletIcon:c,walletName:l},A),ee.createElement("ul",{"aria-label":"dropdown-list",className:`wallet-adapter-dropdown-list ${g&&"wallet-adapter-dropdown-list-active"}`,ref:_,role:"menu"},a?ee.createElement("li",{className:"wallet-adapter-dropdown-list-item",onClick:async()=>{await navigator.clipboard.writeText(a.toBase58()),f(!0),setTimeout(()=>f(!1),400)},role:"menuitem"},u?e.copied:e["copy-address"]):null,ee.createElement("li",{className:"wallet-adapter-dropdown-list-item",onClick:()=>{r(!0),p(!1)},role:"menuitem"},e["change-wallet"]),o?ee.createElement("li",{className:"wallet-adapter-dropdown-list-item",onClick:()=>{o(),p(!1)},role:"menuitem"},e.disconnect):null))}const rb=({id:t,children:e,expanded:n=!1})=>{const r=j.useRef(null),i=j.useRef(!0),s="height 250ms ease-out",o=()=>{const c=r.current;c&&requestAnimationFrame(()=>{c.style.height=c.scrollHeight+"px"})},a=()=>{const c=r.current;c&&requestAnimationFrame(()=>{c.style.height=c.offsetHeight+"px",c.style.overflow="hidden",requestAnimationFrame(()=>{c.style.height="0"})})};return j.useLayoutEffect(()=>{n?o():a()},[n]),j.useLayoutEffect(()=>{const c=r.current;if(!c)return;function l(){c&&(c.style.overflow=n?"initial":"hidden",n&&(c.style.height="auto"))}function u(f){c&&f.target===c&&f.propertyName==="height"&&l()}return i.current&&(l(),i.current=!1),c.addEventListener("transitionend",u),()=>c.removeEventListener("transitionend",u)},[n]),ee.createElement("div",{className:"wallet-adapter-collapse",id:t,ref:r,role:"region",style:{height:0,transition:i.current?void 0:s}},e)},ig=({handleClick:t,tabIndex:e,wallet:n})=>ee.createElement("li",null,ee.createElement(jI,{onClick:t,startIcon:ee.createElement(UI,{wallet:n}),tabIndex:e},n.adapter.name,n.readyState===Te.Installed&&ee.createElement("span",null,"Detected"))),RB=()=>ee.createElement("svg",{width:"97",height:"96",viewBox:"0 0 97 96",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ee.createElement("circle",{cx:"48.5",cy:"48",r:"48",fill:"url(#paint0_linear_880_5115)",fillOpacity:"0.1"}),ee.createElement("circle",{cx:"48.5",cy:"48",r:"47",stroke:"url(#paint1_linear_880_5115)",strokeOpacity:"0.4",strokeWidth:"2"}),ee.createElement("g",{clipPath:"url(#clip0_880_5115)"},ee.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)"}),ee.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)"})),ee.createElement("defs",null,ee.createElement("linearGradient",{id:"paint0_linear_880_5115",x1:"3.41664",y1:"98.0933",x2:"103.05",y2:"8.42498",gradientUnits:"userSpaceOnUse"},ee.createElement("stop",{stopColor:"#9945FF"}),ee.createElement("stop",{offset:"0.14",stopColor:"#8A53F4"}),ee.createElement("stop",{offset:"0.42",stopColor:"#6377D6"}),ee.createElement("stop",{offset:"0.79",stopColor:"#24B0A7"}),ee.createElement("stop",{offset:"0.99",stopColor:"#00D18C"}),ee.createElement("stop",{offset:"1",stopColor:"#00D18C"})),ee.createElement("linearGradient",{id:"paint1_linear_880_5115",x1:"3.41664",y1:"98.0933",x2:"103.05",y2:"8.42498",gradientUnits:"userSpaceOnUse"},ee.createElement("stop",{stopColor:"#9945FF"}),ee.createElement("stop",{offset:"0.14",stopColor:"#8A53F4"}),ee.createElement("stop",{offset:"0.42",stopColor:"#6377D6"}),ee.createElement("stop",{offset:"0.79",stopColor:"#24B0A7"}),ee.createElement("stop",{offset:"0.99",stopColor:"#00D18C"}),ee.createElement("stop",{offset:"1",stopColor:"#00D18C"})),ee.createElement("linearGradient",{id:"paint2_linear_880_5115",x1:"25.9583",y1:"68.7101",x2:"67.2337",y2:"23.7879",gradientUnits:"userSpaceOnUse"},ee.createElement("stop",{stopColor:"#9945FF"}),ee.createElement("stop",{offset:"0.14",stopColor:"#8A53F4"}),ee.createElement("stop",{offset:"0.42",stopColor:"#6377D6"}),ee.createElement("stop",{offset:"0.79",stopColor:"#24B0A7"}),ee.createElement("stop",{offset:"0.99",stopColor:"#00D18C"}),ee.createElement("stop",{offset:"1",stopColor:"#00D18C"})),ee.createElement("linearGradient",{id:"paint3_linear_880_5115",x1:"58.3326",y1:"49.4467",x2:"61.0002",y2:"45.4453",gradientUnits:"userSpaceOnUse"},ee.createElement("stop",{stopColor:"#9945FF"}),ee.createElement("stop",{offset:"0.14",stopColor:"#8A53F4"}),ee.createElement("stop",{offset:"0.42",stopColor:"#6377D6"}),ee.createElement("stop",{offset:"0.79",stopColor:"#24B0A7"}),ee.createElement("stop",{offset:"0.99",stopColor:"#00D18C"}),ee.createElement("stop",{offset:"1",stopColor:"#00D18C"})),ee.createElement("clipPath",{id:"clip0_880_5115"},ee.createElement("rect",{width:"48",height:"48",fill:"white",transform:"translate(24.5 24)"})))),NB=({className:t="",container:e="body"})=>{const n=j.useRef(null),{wallets:r,select:i}=il(),{setVisible:s}=GS(),[o,a]=j.useState(!1),[c,l]=j.useState(!1),[u,f]=j.useState(null),[g,p]=j.useMemo(()=>{const x=[],M=[];for(const L of r)L.readyState===Te.Installed?x.push(L):M.push(L);return x.length?[x,M]:[M,[]]},[r]),_=j.useCallback(()=>{l(!1),setTimeout(()=>s(!1),150)},[s]),A=j.useCallback(x=>{x.preventDefault(),_()},[_]),S=j.useCallback((x,M)=>{i(M),A(x)},[i,A]),E=j.useCallback(()=>a(!o),[o]),b=j.useCallback(x=>{const M=n.current;if(!M)return;const L=M.querySelectorAll("button"),z=L[0],D=L[L.length-1];x.shiftKey?document.activeElement===z&&(D.focus(),x.preventDefault()):document.activeElement===D&&(z.focus(),x.preventDefault())},[n]);return j.useLayoutEffect(()=>{const x=L=>{L.key==="Escape"?_():L.key==="Tab"&&b(L)},{overflow:M}=window.getComputedStyle(document.body);return setTimeout(()=>l(!0),0),document.body.style.overflow="hidden",window.addEventListener("keydown",x,!1),()=>{document.body.style.overflow=M,window.removeEventListener("keydown",x,!1)}},[_,b]),j.useLayoutEffect(()=>f(document.querySelector(e)),[e]),u&&td.createPortal(ee.createElement("div",{"aria-labelledby":"wallet-adapter-modal-title","aria-modal":"true",className:`wallet-adapter-modal ${c&&"wallet-adapter-modal-fade-in"} ${t}`,ref:n,role:"dialog"},ee.createElement("div",{className:"wallet-adapter-modal-container"},ee.createElement("div",{className:"wallet-adapter-modal-wrapper"},ee.createElement("button",{onClick:A,className:"wallet-adapter-modal-button-close"},ee.createElement("svg",{width:"14",height:"14"},ee.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"}))),g.length?ee.createElement(ee.Fragment,null,ee.createElement("h1",{className:"wallet-adapter-modal-title"},"Connect a wallet on Solana to continue"),ee.createElement("ul",{className:"wallet-adapter-modal-list"},g.map(x=>ee.createElement(ig,{key:x.adapter.name,handleClick:M=>S(M,x.adapter.name),wallet:x})),p.length?ee.createElement(rb,{expanded:o,id:"wallet-adapter-modal-collapse"},p.map(x=>ee.createElement(ig,{key:x.adapter.name,handleClick:M=>S(M,x.adapter.name),tabIndex:o?0:-1,wallet:x}))):null),p.length?ee.createElement("button",{className:"wallet-adapter-modal-list-more",onClick:E,tabIndex:0},ee.createElement("span",null,o?"Less ":"More ","options"),ee.createElement("svg",{width:"13",height:"7",viewBox:"0 0 13 7",xmlns:"http://www.w3.org/2000/svg",className:`${o?"wallet-adapter-modal-list-more-icon-rotate":""}`},ee.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):ee.createElement(ee.Fragment,null,ee.createElement("h1",{className:"wallet-adapter-modal-title"},"You'll need a wallet on Solana to continue"),ee.createElement("div",{className:"wallet-adapter-modal-middle"},ee.createElement(RB,null)),p.length?ee.createElement(ee.Fragment,null,ee.createElement("button",{className:"wallet-adapter-modal-list-more",onClick:E,tabIndex:0},ee.createElement("span",null,o?"Hide ":"Already have a wallet? View ","options"),ee.createElement("svg",{width:"13",height:"7",viewBox:"0 0 13 7",xmlns:"http://www.w3.org/2000/svg",className:`${o?"wallet-adapter-modal-list-more-icon-rotate":""}`},ee.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"}))),ee.createElement(rb,{expanded:o,id:"wallet-adapter-modal-collapse"},ee.createElement("ul",{className:"wallet-adapter-modal-list"},p.map(x=>ee.createElement(ig,{key:x.adapter.name,handleClick:M=>S(M,x.adapter.name),tabIndex:o?0:-1,wallet:x}))))):null))),ee.createElement("div",{className:"wallet-adapter-modal-overlay",onMouseDown:A})),u)},TB=({children:t,...e})=>{const[n,r]=j.useState(!1);return ee.createElement(KS.Provider,{value:{visible:n,setVisible:r}},t,n&&ee.createElement(NB,{...e}))},MB={"change-wallet":"Change wallet",connecting:"Connecting ...","copy-address":"Copy address",copied:"Copied",disconnect:"Disconnect","has-wallet":"Connect","no-wallet":"Select Wallet"};function OB(t){return ee.createElement(kB,{...t,labels:MB})}function FI(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=FI(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function CB(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=FI(t))&&(r&&(r+=" "),r+=e);return r}const a_="-",LB=t=>{const e=PB(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{const a=o.split(a_);return a[0]===""&&a.length!==1&&a.shift(),WI(a,e)||DB(o)},getConflictingClassGroupIds:(o,a)=>{const c=n[o]||[];return a&&r[o]?[...c,...r[o]]:c}}},WI=(t,e)=>{var o;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),i=r?WI(t.slice(1),r):void 0;if(i)return i;if(e.validators.length===0)return;const s=t.join(a_);return(o=e.validators.find(({validator:a})=>a(s)))==null?void 0:o.classGroupId},ib=/^\[(.+)\]$/,DB=t=>{if(ib.test(t)){const e=ib.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},PB=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return zB(Object.entries(t.classGroups),n).forEach(([s,o])=>{Vy(o,r,s,e)}),r},Vy=(t,e,n,r)=>{t.forEach(i=>{if(typeof i=="string"){const s=i===""?e:sb(e,i);s.classGroupId=n;return}if(typeof i=="function"){if(BB(i)){Vy(i(r),e,n,r);return}e.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,o])=>{Vy(o,sb(e,s),n,r)})})},sb=(t,e)=>{let n=t;return e.split(a_).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},BB=t=>t.isThemeGetter,zB=(t,e)=>e?t.map(([n,r])=>{const i=r.map(s=>typeof s=="string"?e+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([o,a])=>[e+o,a])):s);return[n,i]}):t,jB=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const i=(s,o)=>{n.set(s,o),e++,e>t&&(e=0,r=n,n=new Map)};return{get(s){let o=n.get(s);if(o!==void 0)return o;if((o=r.get(s))!==void 0)return i(s,o),o},set(s,o){n.has(s)?n.set(s,o):i(s,o)}}},HI="!",UB=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,i=e[0],s=e.length,o=a=>{const c=[];let l=0,u=0,f;for(let S=0;S<a.length;S++){let E=a[S];if(l===0){if(E===i&&(r||a.slice(S,S+s)===e)){c.push(a.slice(u,S)),u=S+s;continue}if(E==="/"){f=S;continue}}E==="["?l++:E==="]"&&l--}const g=c.length===0?a:a.substring(u),p=g.startsWith(HI),_=p?g.substring(1):g,A=f&&f>u?f-u:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:_,maybePostfixModifierPosition:A}};return n?a=>n({className:a,parseClassName:o}):o},FB=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},WB=t=>({cache:jB(t.cacheSize),parseClassName:UB(t),...LB(t)}),HB=/\s+/,$B=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=e,s=[],o=t.trim().split(HB);let a="";for(let c=o.length-1;c>=0;c-=1){const l=o[c],{modifiers:u,hasImportantModifier:f,baseClassName:g,maybePostfixModifierPosition:p}=n(l);let _=!!p,A=r(_?g.substring(0,p):g);if(!A){if(!_){a=l+(a.length>0?" "+a:a);continue}if(A=r(g),!A){a=l+(a.length>0?" "+a:a);continue}_=!1}const S=FB(u).join(":"),E=f?S+HI:S,b=E+A;if(s.includes(b))continue;s.push(b);const x=i(A,_);for(let M=0;M<x.length;++M){const L=x[M];s.push(E+L)}a=l+(a.length>0?" "+a:a)}return a};function VB(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=$I(e))&&(r&&(r+=" "),r+=n);return r}const $I=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=$I(t[r]))&&(n&&(n+=" "),n+=e);return n};function ZB(t,...e){let n,r,i,s=o;function o(c){const l=e.reduce((u,f)=>f(u),t());return n=WB(l),r=n.cache.get,i=n.cache.set,s=a,a(c)}function a(c){const l=r(c);if(l)return l;const u=$B(c,n);return i(c,u),u}return function(){return s(VB.apply(null,arguments))}}const Rt=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},VI=/^\[(?:([a-z-]+):)?(.+)\]$/i,KB=/^\d+\/\d+$/,GB=new Set(["px","full","screen"]),YB=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,qB=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,QB=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,XB=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,JB=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Gi=t=>wc(t)||GB.has(t)||KB.test(t),Bs=t=>sl(t,"length",az),wc=t=>!!t&&!Number.isNaN(Number(t)),sg=t=>sl(t,"number",wc),Sl=t=>!!t&&Number.isInteger(Number(t)),ez=t=>t.endsWith("%")&&wc(t.slice(0,-1)),Ze=t=>VI.test(t),zs=t=>YB.test(t),tz=new Set(["length","size","percentage"]),nz=t=>sl(t,tz,ZI),rz=t=>sl(t,"position",ZI),iz=new Set(["image","url"]),sz=t=>sl(t,iz,lz),oz=t=>sl(t,"",cz),Al=()=>!0,sl=(t,e,n)=>{const r=VI.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},az=t=>qB.test(t)&&!QB.test(t),ZI=()=>!1,cz=t=>XB.test(t),lz=t=>JB.test(t),uz=()=>{const t=Rt("colors"),e=Rt("spacing"),n=Rt("blur"),r=Rt("brightness"),i=Rt("borderColor"),s=Rt("borderRadius"),o=Rt("borderSpacing"),a=Rt("borderWidth"),c=Rt("contrast"),l=Rt("grayscale"),u=Rt("hueRotate"),f=Rt("invert"),g=Rt("gap"),p=Rt("gradientColorStops"),_=Rt("gradientColorStopPositions"),A=Rt("inset"),S=Rt("margin"),E=Rt("opacity"),b=Rt("padding"),x=Rt("saturate"),M=Rt("scale"),L=Rt("sepia"),z=Rt("skew"),D=Rt("space"),F=Rt("translate"),$=()=>["auto","contain","none"],V=()=>["auto","hidden","clip","visible","scroll"],G=()=>["auto",Ze,e],W=()=>[Ze,e],N=()=>["",Gi,Bs],d=()=>["auto",wc,Ze],h=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],v=()=>["solid","dashed","dotted","double","none"],I=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],k=()=>["start","end","center","between","around","evenly","stretch"],O=()=>["","0",Ze],B=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>[wc,Ze];return{cacheSize:500,separator:":",theme:{colors:[Al],spacing:[Gi,Bs],blur:["none","",zs,Ze],brightness:T(),borderColor:[t],borderRadius:["none","","full",zs,Ze],borderSpacing:W(),borderWidth:N(),contrast:T(),grayscale:O(),hueRotate:T(),invert:O(),gap:W(),gradientColorStops:[t],gradientColorStopPositions:[ez,Bs],inset:G(),margin:G(),opacity:T(),padding:W(),saturate:T(),scale:T(),sepia:O(),skew:T(),space:W(),translate:W()},classGroups:{aspect:[{aspect:["auto","square","video",Ze]}],container:["container"],columns:[{columns:[zs]}],"break-after":[{"break-after":B()}],"break-before":[{"break-before":B()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...h(),Ze]}],overflow:[{overflow:V()}],"overflow-x":[{"overflow-x":V()}],"overflow-y":[{"overflow-y":V()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[A]}],"inset-x":[{"inset-x":[A]}],"inset-y":[{"inset-y":[A]}],start:[{start:[A]}],end:[{end:[A]}],top:[{top:[A]}],right:[{right:[A]}],bottom:[{bottom:[A]}],left:[{left:[A]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Sl,Ze]}],basis:[{basis:G()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ze]}],grow:[{grow:O()}],shrink:[{shrink:O()}],order:[{order:["first","last","none",Sl,Ze]}],"grid-cols":[{"grid-cols":[Al]}],"col-start-end":[{col:["auto",{span:["full",Sl,Ze]},Ze]}],"col-start":[{"col-start":d()}],"col-end":[{"col-end":d()}],"grid-rows":[{"grid-rows":[Al]}],"row-start-end":[{row:["auto",{span:[Sl,Ze]},Ze]}],"row-start":[{"row-start":d()}],"row-end":[{"row-end":d()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ze]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ze]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"justify-content":[{justify:["normal",...k()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...k(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...k(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[S]}],mx:[{mx:[S]}],my:[{my:[S]}],ms:[{ms:[S]}],me:[{me:[S]}],mt:[{mt:[S]}],mr:[{mr:[S]}],mb:[{mb:[S]}],ml:[{ml:[S]}],"space-x":[{"space-x":[D]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[D]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ze,e]}],"min-w":[{"min-w":[Ze,e,"min","max","fit"]}],"max-w":[{"max-w":[Ze,e,"none","full","min","max","fit","prose",{screen:[zs]},zs]}],h:[{h:[Ze,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ze,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ze,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ze,e,"auto","min","max","fit"]}],"font-size":[{text:["base",zs,Bs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",sg]}],"font-family":[{font:[Al]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ze]}],"line-clamp":[{"line-clamp":["none",wc,sg]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Gi,Ze]}],"list-image":[{"list-image":["none",Ze]}],"list-style-type":[{list:["none","disc","decimal",Ze]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[E]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[E]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...v(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Gi,Bs]}],"underline-offset":[{"underline-offset":["auto",Gi,Ze]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:W()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ze]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ze]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[E]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...h(),rz]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",nz]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},sz]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[_]}],"gradient-via-pos":[{via:[_]}],"gradient-to-pos":[{to:[_]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[E]}],"border-style":[{border:[...v(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[E]}],"divide-style":[{divide:v()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...v()]}],"outline-offset":[{"outline-offset":[Gi,Ze]}],"outline-w":[{outline:[Gi,Bs]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:N()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[E]}],"ring-offset-w":[{"ring-offset":[Gi,Bs]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",zs,oz]}],"shadow-color":[{shadow:[Al]}],opacity:[{opacity:[E]}],"mix-blend":[{"mix-blend":[...I(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":I()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",zs,Ze]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[x]}],sepia:[{sepia:[L]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[E]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[L]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ze]}],duration:[{duration:T()}],ease:[{ease:["linear","in","out","in-out",Ze]}],delay:[{delay:T()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ze]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[M]}],"scale-x":[{"scale-x":[M]}],"scale-y":[{"scale-y":[M]}],rotate:[{rotate:[Sl,Ze]}],"translate-x":[{"translate-x":[F]}],"translate-y":[{"translate-y":[F]}],"skew-x":[{"skew-x":[z]}],"skew-y":[{"skew-y":[z]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ze]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ze]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":W()}],"scroll-mx":[{"scroll-mx":W()}],"scroll-my":[{"scroll-my":W()}],"scroll-ms":[{"scroll-ms":W()}],"scroll-me":[{"scroll-me":W()}],"scroll-mt":[{"scroll-mt":W()}],"scroll-mr":[{"scroll-mr":W()}],"scroll-mb":[{"scroll-mb":W()}],"scroll-ml":[{"scroll-ml":W()}],"scroll-p":[{"scroll-p":W()}],"scroll-px":[{"scroll-px":W()}],"scroll-py":[{"scroll-py":W()}],"scroll-ps":[{"scroll-ps":W()}],"scroll-pe":[{"scroll-pe":W()}],"scroll-pt":[{"scroll-pt":W()}],"scroll-pr":[{"scroll-pr":W()}],"scroll-pb":[{"scroll-pb":W()}],"scroll-pl":[{"scroll-pl":W()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ze]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Gi,Bs,sg]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},dz=ZB(uz);function Oo(...t){return dz(CB(t))}const c_=j.forwardRef(({className:t,type:e,...n},r)=>te.jsx("input",{type:e,className:Oo("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),ref:r,...n}));c_.displayName="Input";function fz(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function KI(...t){return e=>t.forEach(n=>fz(n,e))}function Na(...t){return j.useCallback(KI(...t),t)}var bp=j.forwardRef((t,e)=>{const{children:n,...r}=t,i=j.Children.toArray(n),s=i.find(hz);if(s){const o=s.props.children,a=i.map(c=>c===s?j.Children.count(o)>1?j.Children.only(null):j.isValidElement(o)?o.props.children:null:c);return te.jsx(Zy,{...r,ref:e,children:j.isValidElement(o)?j.cloneElement(o,void 0,a):null})}return te.jsx(Zy,{...r,ref:e,children:n})});bp.displayName="Slot";var Zy=j.forwardRef((t,e)=>{const{children:n,...r}=t;if(j.isValidElement(n)){const i=gz(n);return j.cloneElement(n,{...pz(r,n.props),ref:e?KI(e,i):i})}return j.Children.count(n)>1?j.Children.only(null):null});Zy.displayName="SlotClone";var GI=({children:t})=>te.jsx(te.Fragment,{children:t});function hz(t){return j.isValidElement(t)&&t.type===GI}function pz(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{s(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function gz(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function YI(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=YI(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function yz(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=YI(t))&&(r&&(r+=" "),r+=e);return r}const ob=t=>typeof t=="boolean"?"".concat(t):t===0?"0":t,ab=yz,qI=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return ab(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:s}=e,o=Object.keys(i).map(l=>{const u=n==null?void 0:n[l],f=s==null?void 0:s[l];if(u===null)return null;const g=ob(u)||ob(f);return i[l][g]}),a=n&&Object.entries(n).reduce((l,u)=>{let[f,g]=u;return g===void 0||(l[f]=g),l},{}),c=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((l,u)=>{let{class:f,className:g,...p}=u;return Object.entries(p).every(_=>{let[A,S]=_;return Array.isArray(S)?S.includes({...s,...a}[A]):{...s,...a}[A]===S})?[...l,f,g]:l},[]);return ab(t,o,c,n==null?void 0:n.class,n==null?void 0:n.className)},mz=qI("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),lo=j.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...i},s)=>{const o=r?bp:"button";return te.jsx(o,{className:Oo(mz({variant:e,size:n,className:t})),ref:s,...i})});lo.displayName="Button";var hd=t=>t.type==="checkbox",rc=t=>t instanceof Date,Xn=t=>t==null;const QI=t=>typeof t=="object";var pn=t=>!Xn(t)&&!Array.isArray(t)&&QI(t)&&!rc(t),XI=t=>pn(t)&&t.target?hd(t.target)?t.target.checked:t.target.value:t,wz=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,JI=(t,e)=>t.has(wz(e)),_z=t=>{const e=t.constructor&&t.constructor.prototype;return pn(e)&&e.hasOwnProperty("isPrototypeOf")},l_=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ar(t){let e;const n=Array.isArray(t);if(t instanceof Date)e=new Date(t);else if(t instanceof Set)e=new Set(t);else if(!(l_&&(t instanceof Blob||t instanceof FileList))&&(n||pn(t)))if(e=n?[]:{},!n&&!_z(t))e=t;else for(const r in t)t.hasOwnProperty(r)&&(e[r]=ar(t[r]));else return t;return e}var Ep=t=>Array.isArray(t)?t.filter(Boolean):[],Zt=t=>t===void 0,ge=(t,e,n)=>{if(!e||!pn(t))return n;const r=Ep(e.split(/[,[\].]+?/)).reduce((i,s)=>Xn(i)?i:i[s],t);return Zt(r)||r===t?Zt(t[e])?n:t[e]:r},Fr=t=>typeof t=="boolean",u_=t=>/^\w*$/.test(t),ek=t=>Ep(t.replace(/["|']|\]/g,"").split(/\.|\[/)),pt=(t,e,n)=>{let r=-1;const i=u_(e)?[e]:ek(e),s=i.length,o=s-1;for(;++r<s;){const a=i[r];let c=n;if(r!==o){const l=t[a];c=pn(l)||Array.isArray(l)?l:isNaN(+i[r+1])?{}:[]}if(a==="__proto__")return;t[a]=c,t=t[a]}return t};const hh={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},si={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Yi={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},tk=ee.createContext(null),xp=()=>ee.useContext(tk),vz=t=>{const{children:e,...n}=t;return ee.createElement(tk.Provider,{value:n},e)};var nk=(t,e,n,r=!0)=>{const i={defaultValues:e._defaultValues};for(const s in t)Object.defineProperty(i,s,{get:()=>{const o=s;return e._proxyFormState[o]!==si.all&&(e._proxyFormState[o]=!r||si.all),n&&(n[o]=!0),t[o]}});return i},cr=t=>pn(t)&&!Object.keys(t).length,rk=(t,e,n,r)=>{n(t);const{name:i,...s}=t;return cr(s)||Object.keys(s).length>=Object.keys(e).length||Object.keys(s).find(o=>e[o]===(!r||si.all))},ql=t=>Array.isArray(t)?t:[t],ik=(t,e,n)=>!t||!e||t===e||ql(t).some(r=>r&&(n?r===e:r.startsWith(e)||e.startsWith(r)));function d_(t){const e=ee.useRef(t);e.current=t,ee.useEffect(()=>{const n=!t.disabled&&e.current.subject&&e.current.subject.subscribe({next:e.current.next});return()=>{n&&n.unsubscribe()}},[t.disabled])}function bz(t){const e=xp(),{control:n=e.control,disabled:r,name:i,exact:s}=t||{},[o,a]=ee.useState(n._formState),c=ee.useRef(!0),l=ee.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),u=ee.useRef(i);return u.current=i,d_({disabled:r,next:f=>c.current&&ik(u.current,f.name,s)&&rk(f,l.current,n._updateFormState)&&a({...n._formState,...f}),subject:n._subjects.state}),ee.useEffect(()=>(c.current=!0,l.current.isValid&&n._updateValid(!0),()=>{c.current=!1}),[n]),nk(o,n,l.current,!1)}var Ni=t=>typeof t=="string",sk=(t,e,n,r,i)=>Ni(t)?(r&&e.watch.add(t),ge(n,t,i)):Array.isArray(t)?t.map(s=>(r&&e.watch.add(s),ge(n,s))):(r&&(e.watchAll=!0),n);function Ez(t){const e=xp(),{control:n=e.control,name:r,defaultValue:i,disabled:s,exact:o}=t||{},a=ee.useRef(r);a.current=r,d_({disabled:s,subject:n._subjects.values,next:u=>{ik(a.current,u.name,o)&&l(ar(sk(a.current,n._names,u.values||n._formValues,!1,i)))}});const[c,l]=ee.useState(n._getWatch(r,i));return ee.useEffect(()=>n._removeUnmounted()),c}function xz(t){const e=xp(),{name:n,disabled:r,control:i=e.control,shouldUnregister:s}=t,o=JI(i._names.array,n),a=Ez({control:i,name:n,defaultValue:ge(i._formValues,n,ge(i._defaultValues,n,t.defaultValue)),exact:!0}),c=bz({control:i,name:n,exact:!0}),l=ee.useRef(i.register(n,{...t.rules,value:a,...Fr(t.disabled)?{disabled:t.disabled}:{}}));return ee.useEffect(()=>{const u=i._options.shouldUnregister||s,f=(g,p)=>{const _=ge(i._fields,g);_&&_._f&&(_._f.mount=p)};if(f(n,!0),u){const g=ar(ge(i._options.defaultValues,n));pt(i._defaultValues,n,g),Zt(ge(i._formValues,n))&&pt(i._formValues,n,g)}return()=>{(o?u&&!i._state.action:u)?i.unregister(n):f(n,!1)}},[n,i,o,s]),ee.useEffect(()=>{ge(i._fields,n)&&i._updateDisabledField({disabled:r,fields:i._fields,name:n,value:ge(i._fields,n)._f.value})},[r,n,i]),{field:{name:n,value:a,...Fr(r)||c.disabled?{disabled:c.disabled||r}:{},onChange:ee.useCallback(u=>l.current.onChange({target:{value:XI(u),name:n},type:hh.CHANGE}),[n]),onBlur:ee.useCallback(()=>l.current.onBlur({target:{value:ge(i._formValues,n),name:n},type:hh.BLUR}),[n,i]),ref:ee.useCallback(u=>{const f=ge(i._fields,n);f&&u&&(f._f.ref={focus:()=>u.focus(),select:()=>u.select(),setCustomValidity:g=>u.setCustomValidity(g),reportValidity:()=>u.reportValidity()})},[i._fields,n])},formState:c,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!ge(c.errors,n)},isDirty:{enumerable:!0,get:()=>!!ge(c.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!ge(c.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!ge(c.validatingFields,n)},error:{enumerable:!0,get:()=>ge(c.errors,n)}})}}const Sz=t=>t.render(xz(t));var ok=(t,e,n,r,i)=>e?{...n[t],types:{...n[t]&&n[t].types?n[t].types:{},[r]:i||!0}}:{},cb=t=>({isOnSubmit:!t||t===si.onSubmit,isOnBlur:t===si.onBlur,isOnChange:t===si.onChange,isOnAll:t===si.all,isOnTouch:t===si.onTouched}),lb=(t,e,n)=>!n&&(e.watchAll||e.watch.has(t)||[...e.watch].some(r=>t.startsWith(r)&&/^\.\w+/.test(t.slice(r.length))));const Ql=(t,e,n,r)=>{for(const i of n||Object.keys(t)){const s=ge(t,i);if(s){const{_f:o,...a}=s;if(o){if(o.refs&&o.refs[0]&&e(o.refs[0],i)&&!r)return!0;if(o.ref&&e(o.ref,o.name)&&!r)return!0;if(Ql(a,e))break}else if(pn(a)&&Ql(a,e))break}}};var Az=(t,e,n)=>{const r=ql(ge(t,n));return pt(r,"root",e[n]),pt(t,n,r),t},f_=t=>t.type==="file",ms=t=>typeof t=="function",ph=t=>{if(!l_)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},Af=t=>Ni(t),h_=t=>t.type==="radio",gh=t=>t instanceof RegExp;const ub={value:!1,isValid:!1},db={value:!0,isValid:!0};var ak=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!Zt(t[0].attributes.value)?Zt(t[0].value)||t[0].value===""?db:{value:t[0].value,isValid:!0}:db:ub}return ub};const fb={isValid:!1,value:null};var ck=t=>Array.isArray(t)?t.reduce((e,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:e,fb):fb;function hb(t,e,n="validate"){if(Af(t)||Array.isArray(t)&&t.every(Af)||Fr(t)&&!t)return{type:n,message:Af(t)?t:"",ref:e}}var Da=t=>pn(t)&&!gh(t)?t:{value:t,message:""},pb=async(t,e,n,r,i)=>{const{ref:s,refs:o,required:a,maxLength:c,minLength:l,min:u,max:f,pattern:g,validate:p,name:_,valueAsNumber:A,mount:S,disabled:E}=t._f,b=ge(e,_);if(!S||E)return{};const x=o?o[0]:s,M=W=>{r&&x.reportValidity&&(x.setCustomValidity(Fr(W)?"":W||""),x.reportValidity())},L={},z=h_(s),D=hd(s),F=z||D,$=(A||f_(s))&&Zt(s.value)&&Zt(b)||ph(s)&&s.value===""||b===""||Array.isArray(b)&&!b.length,V=ok.bind(null,_,n,L),G=(W,N,d,h=Yi.maxLength,v=Yi.minLength)=>{const I=W?N:d;L[_]={type:W?h:v,message:I,ref:s,...V(W?h:v,I)}};if(i?!Array.isArray(b)||!b.length:a&&(!F&&($||Xn(b))||Fr(b)&&!b||D&&!ak(o).isValid||z&&!ck(o).isValid)){const{value:W,message:N}=Af(a)?{value:!!a,message:a}:Da(a);if(W&&(L[_]={type:Yi.required,message:N,ref:x,...V(Yi.required,N)},!n))return M(N),L}if(!$&&(!Xn(u)||!Xn(f))){let W,N;const d=Da(f),h=Da(u);if(!Xn(b)&&!isNaN(b)){const v=s.valueAsNumber||b&&+b;Xn(d.value)||(W=v>d.value),Xn(h.value)||(N=v<h.value)}else{const v=s.valueAsDate||new Date(b),I=B=>new Date(new Date().toDateString()+" "+B),k=s.type=="time",O=s.type=="week";Ni(d.value)&&b&&(W=k?I(b)>I(d.value):O?b>d.value:v>new Date(d.value)),Ni(h.value)&&b&&(N=k?I(b)<I(h.value):O?b<h.value:v<new Date(h.value))}if((W||N)&&(G(!!W,d.message,h.message,Yi.max,Yi.min),!n))return M(L[_].message),L}if((c||l)&&!$&&(Ni(b)||i&&Array.isArray(b))){const W=Da(c),N=Da(l),d=!Xn(W.value)&&b.length>+W.value,h=!Xn(N.value)&&b.length<+N.value;if((d||h)&&(G(d,W.message,N.message),!n))return M(L[_].message),L}if(g&&!$&&Ni(b)){const{value:W,message:N}=Da(g);if(gh(W)&&!b.match(W)&&(L[_]={type:Yi.pattern,message:N,ref:s,...V(Yi.pattern,N)},!n))return M(N),L}if(p){if(ms(p)){const W=await p(b,e),N=hb(W,x);if(N&&(L[_]={...N,...V(Yi.validate,N.message)},!n))return M(N.message),L}else if(pn(p)){let W={};for(const N in p){if(!cr(W)&&!n)break;const d=hb(await p[N](b,e),x,N);d&&(W={...d,...V(N,d.message)},M(d.message),n&&(L[_]=W))}if(!cr(W)&&(L[_]={ref:x,...W},!n))return L}}return M(!0),L};function Iz(t,e){const n=e.slice(0,-1).length;let r=0;for(;r<n;)t=Zt(t)?r++:t[e[r++]];return t}function kz(t){for(const e in t)if(t.hasOwnProperty(e)&&!Zt(t[e]))return!1;return!0}function gn(t,e){const n=Array.isArray(e)?e:u_(e)?[e]:ek(e),r=n.length===1?t:Iz(t,n),i=n.length-1,s=n[i];return r&&delete r[s],i!==0&&(pn(r)&&cr(r)||Array.isArray(r)&&kz(r))&&gn(t,n.slice(0,-1)),t}var og=()=>{let t=[];return{get observers(){return t},next:i=>{for(const s of t)s.next&&s.next(i)},subscribe:i=>(t.push(i),{unsubscribe:()=>{t=t.filter(s=>s!==i)}}),unsubscribe:()=>{t=[]}}},yh=t=>Xn(t)||!QI(t);function Vs(t,e){if(yh(t)||yh(e))return t===e;if(rc(t)&&rc(e))return t.getTime()===e.getTime();const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const i of n){const s=t[i];if(!r.includes(i))return!1;if(i!=="ref"){const o=e[i];if(rc(s)&&rc(o)||pn(s)&&pn(o)||Array.isArray(s)&&Array.isArray(o)?!Vs(s,o):s!==o)return!1}}return!0}var lk=t=>t.type==="select-multiple",Rz=t=>h_(t)||hd(t),ag=t=>ph(t)&&t.isConnected,uk=t=>{for(const e in t)if(ms(t[e]))return!0;return!1};function mh(t,e={}){const n=Array.isArray(t);if(pn(t)||n)for(const r in t)Array.isArray(t[r])||pn(t[r])&&!uk(t[r])?(e[r]=Array.isArray(t[r])?[]:{},mh(t[r],e[r])):Xn(t[r])||(e[r]=!0);return e}function dk(t,e,n){const r=Array.isArray(t);if(pn(t)||r)for(const i in t)Array.isArray(t[i])||pn(t[i])&&!uk(t[i])?Zt(e)||yh(n[i])?n[i]=Array.isArray(t[i])?mh(t[i],[]):{...mh(t[i])}:dk(t[i],Xn(e)?{}:e[i],n[i]):n[i]=!Vs(t[i],e[i]);return n}var Gd=(t,e)=>dk(t,e,mh(e)),fk=(t,{valueAsNumber:e,valueAsDate:n,setValueAs:r})=>Zt(t)?t:e?t===""?NaN:t&&+t:n&&Ni(t)?new Date(t):r?r(t):t;function cg(t){const e=t.ref;if(!(t.refs?t.refs.every(n=>n.disabled):e.disabled))return f_(e)?e.files:h_(e)?ck(t.refs).value:lk(e)?[...e.selectedOptions].map(({value:n})=>n):hd(e)?ak(t.refs).value:fk(Zt(e.value)?t.ref.value:e.value,t)}var Nz=(t,e,n,r)=>{const i={};for(const s of t){const o=ge(e,s);o&&pt(i,s,o._f)}return{criteriaMode:n,names:[...t],fields:i,shouldUseNativeValidation:r}},Il=t=>Zt(t)?t:gh(t)?t.source:pn(t)?gh(t.value)?t.value.source:t.value:t;const gb="AsyncFunction";var Tz=t=>(!t||!t.validate)&&!!(ms(t.validate)&&t.validate.constructor.name===gb||pn(t.validate)&&Object.values(t.validate).find(e=>e.constructor.name===gb)),Mz=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate);function yb(t,e,n){const r=ge(t,n);if(r||u_(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const s=i.join("."),o=ge(e,s),a=ge(t,s);if(o&&!Array.isArray(o)&&n!==s)return{name:n};if(a&&a.type)return{name:s,error:a};i.pop()}return{name:n}}var Oz=(t,e,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(e||t):(n?r.isOnBlur:i.isOnBlur)?!t:(n?r.isOnChange:i.isOnChange)?t:!0,Cz=(t,e)=>!Ep(ge(t,e)).length&&gn(t,e);const Lz={mode:si.onSubmit,reValidateMode:si.onChange,shouldFocusError:!0};function Dz(t={}){let e={...Lz,...t},n={submitCount:0,isDirty:!1,isLoading:ms(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1},r={},i=pn(e.defaultValues)||pn(e.values)?ar(e.defaultValues||e.values)||{}:{},s=e.shouldUnregister?{}:ar(i),o={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c,l=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={values:og(),array:og(),state:og()},g=cb(e.mode),p=cb(e.reValidateMode),_=e.criteriaMode===si.all,A=U=>Y=>{clearTimeout(l),l=setTimeout(U,Y)},S=async U=>{if(u.isValid||U){const Y=e.resolver?cr((await F()).errors):await V(r,!0);Y!==n.isValid&&f.state.next({isValid:Y})}},E=(U,Y)=>{(u.isValidating||u.validatingFields)&&((U||Array.from(a.mount)).forEach(Q=>{Q&&(Y?pt(n.validatingFields,Q,Y):gn(n.validatingFields,Q))}),f.state.next({validatingFields:n.validatingFields,isValidating:!cr(n.validatingFields)}))},b=(U,Y=[],Q,oe,ce=!0,ne=!0)=>{if(oe&&Q){if(o.action=!0,ne&&Array.isArray(ge(r,U))){const pe=Q(ge(r,U),oe.argA,oe.argB);ce&&pt(r,U,pe)}if(ne&&Array.isArray(ge(n.errors,U))){const pe=Q(ge(n.errors,U),oe.argA,oe.argB);ce&&pt(n.errors,U,pe),Cz(n.errors,U)}if(u.touchedFields&&ne&&Array.isArray(ge(n.touchedFields,U))){const pe=Q(ge(n.touchedFields,U),oe.argA,oe.argB);ce&&pt(n.touchedFields,U,pe)}u.dirtyFields&&(n.dirtyFields=Gd(i,s)),f.state.next({name:U,isDirty:W(U,Y),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else pt(s,U,Y)},x=(U,Y)=>{pt(n.errors,U,Y),f.state.next({errors:n.errors})},M=U=>{n.errors=U,f.state.next({errors:n.errors,isValid:!1})},L=(U,Y,Q,oe)=>{const ce=ge(r,U);if(ce){const ne=ge(s,U,Zt(Q)?ge(i,U):Q);Zt(ne)||oe&&oe.defaultChecked||Y?pt(s,U,Y?ne:cg(ce._f)):h(U,ne),o.mount&&S()}},z=(U,Y,Q,oe,ce)=>{let ne=!1,pe=!1;const je={name:U},We=!!(ge(r,U)&&ge(r,U)._f&&ge(r,U)._f.disabled);if(!Q||oe){u.isDirty&&(pe=n.isDirty,n.isDirty=je.isDirty=W(),ne=pe!==je.isDirty);const R=We||Vs(ge(i,U),Y);pe=!!(!We&&ge(n.dirtyFields,U)),R||We?gn(n.dirtyFields,U):pt(n.dirtyFields,U,!0),je.dirtyFields=n.dirtyFields,ne=ne||u.dirtyFields&&pe!==!R}if(Q){const R=ge(n.touchedFields,U);R||(pt(n.touchedFields,U,Q),je.touchedFields=n.touchedFields,ne=ne||u.touchedFields&&R!==Q)}return ne&&ce&&f.state.next(je),ne?je:{}},D=(U,Y,Q,oe)=>{const ce=ge(n.errors,U),ne=u.isValid&&Fr(Y)&&n.isValid!==Y;if(t.delayError&&Q?(c=A(()=>x(U,Q)),c(t.delayError)):(clearTimeout(l),c=null,Q?pt(n.errors,U,Q):gn(n.errors,U)),(Q?!Vs(ce,Q):ce)||!cr(oe)||ne){const pe={...oe,...ne&&Fr(Y)?{isValid:Y}:{},errors:n.errors,name:U};n={...n,...pe},f.state.next(pe)}},F=async U=>{E(U,!0);const Y=await e.resolver(s,e.context,Nz(U||a.mount,r,e.criteriaMode,e.shouldUseNativeValidation));return E(U),Y},$=async U=>{const{errors:Y}=await F(U);if(U)for(const Q of U){const oe=ge(Y,Q);oe?pt(n.errors,Q,oe):gn(n.errors,Q)}else n.errors=Y;return Y},V=async(U,Y,Q={valid:!0})=>{for(const oe in U){const ce=U[oe];if(ce){const{_f:ne,...pe}=ce;if(ne){const je=a.array.has(ne.name),We=ce._f&&Tz(ce._f);We&&u.validatingFields&&E([oe],!0);const R=await pb(ce,s,_,e.shouldUseNativeValidation&&!Y,je);if(We&&u.validatingFields&&E([oe]),R[ne.name]&&(Q.valid=!1,Y))break;!Y&&(ge(R,ne.name)?je?Az(n.errors,R,ne.name):pt(n.errors,ne.name,R[ne.name]):gn(n.errors,ne.name))}!cr(pe)&&await V(pe,Y,Q)}}return Q.valid},G=()=>{for(const U of a.unMount){const Y=ge(r,U);Y&&(Y._f.refs?Y._f.refs.every(Q=>!ag(Q)):!ag(Y._f.ref))&&de(U)}a.unMount=new Set},W=(U,Y)=>(U&&Y&&pt(s,U,Y),!Vs(T(),i)),N=(U,Y,Q)=>sk(U,a,{...o.mount?s:Zt(Y)?i:Ni(U)?{[U]:Y}:Y},Q,Y),d=U=>Ep(ge(o.mount?s:i,U,t.shouldUnregister?ge(i,U,[]):[])),h=(U,Y,Q={})=>{const oe=ge(r,U);let ce=Y;if(oe){const ne=oe._f;ne&&(!ne.disabled&&pt(s,U,fk(Y,ne)),ce=ph(ne.ref)&&Xn(Y)?"":Y,lk(ne.ref)?[...ne.ref.options].forEach(pe=>pe.selected=ce.includes(pe.value)):ne.refs?hd(ne.ref)?ne.refs.length>1?ne.refs.forEach(pe=>(!pe.defaultChecked||!pe.disabled)&&(pe.checked=Array.isArray(ce)?!!ce.find(je=>je===pe.value):ce===pe.value)):ne.refs[0]&&(ne.refs[0].checked=!!ce):ne.refs.forEach(pe=>pe.checked=pe.value===ce):f_(ne.ref)?ne.ref.value="":(ne.ref.value=ce,ne.ref.type||f.values.next({name:U,values:{...s}})))}(Q.shouldDirty||Q.shouldTouch)&&z(U,ce,Q.shouldTouch,Q.shouldDirty,!0),Q.shouldValidate&&B(U)},v=(U,Y,Q)=>{for(const oe in Y){const ce=Y[oe],ne=`${U}.${oe}`,pe=ge(r,ne);(a.array.has(U)||!yh(ce)||pe&&!pe._f)&&!rc(ce)?v(ne,ce,Q):h(ne,ce,Q)}},I=(U,Y,Q={})=>{const oe=ge(r,U),ce=a.array.has(U),ne=ar(Y);pt(s,U,ne),ce?(f.array.next({name:U,values:{...s}}),(u.isDirty||u.dirtyFields)&&Q.shouldDirty&&f.state.next({name:U,dirtyFields:Gd(i,s),isDirty:W(U,ne)})):oe&&!oe._f&&!Xn(ne)?v(U,ne,Q):h(U,ne,Q),lb(U,a)&&f.state.next({...n}),f.values.next({name:o.mount?U:void 0,values:{...s}})},k=async U=>{o.mount=!0;const Y=U.target;let Q=Y.name,oe=!0;const ce=ge(r,Q),ne=()=>Y.type?cg(ce._f):XI(U),pe=je=>{oe=Number.isNaN(je)||Vs(je,ge(s,Q,je))};if(ce){let je,We;const R=ne(),y=U.type===hh.BLUR||U.type===hh.FOCUS_OUT,w=!Mz(ce._f)&&!e.resolver&&!ge(n.errors,Q)&&!ce._f.deps||Oz(y,ge(n.touchedFields,Q),n.isSubmitted,p,g),C=lb(Q,a,y);pt(s,Q,R),y?(ce._f.onBlur&&ce._f.onBlur(U),c&&c(0)):ce._f.onChange&&ce._f.onChange(U);const H=z(Q,R,y,!1),Z=!cr(H)||C;if(!y&&f.values.next({name:Q,type:U.type,values:{...s}}),w)return u.isValid&&(t.mode==="onBlur"?y&&S():S()),Z&&f.state.next({name:Q,...C?{}:H});if(!y&&C&&f.state.next({...n}),e.resolver){const{errors:J}=await F([Q]);if(pe(R),oe){const He=yb(n.errors,r,Q),ze=yb(J,r,He.name||Q);je=ze.error,Q=ze.name,We=cr(J)}}else E([Q],!0),je=(await pb(ce,s,_,e.shouldUseNativeValidation))[Q],E([Q]),pe(R),oe&&(je?We=!1:u.isValid&&(We=await V(r,!0)));oe&&(ce._f.deps&&B(ce._f.deps),D(Q,We,je,H))}},O=(U,Y)=>{if(ge(n.errors,Y)&&U.focus)return U.focus(),1},B=async(U,Y={})=>{let Q,oe;const ce=ql(U);if(e.resolver){const ne=await $(Zt(U)?U:ce);Q=cr(ne),oe=U?!ce.some(pe=>ge(ne,pe)):Q}else U?(oe=(await Promise.all(ce.map(async ne=>{const pe=ge(r,ne);return await V(pe&&pe._f?{[ne]:pe}:pe)}))).every(Boolean),!(!oe&&!n.isValid)&&S()):oe=Q=await V(r);return f.state.next({...!Ni(U)||u.isValid&&Q!==n.isValid?{}:{name:U},...e.resolver||!U?{isValid:Q}:{},errors:n.errors}),Y.shouldFocus&&!oe&&Ql(r,O,U?ce:a.mount),oe},T=U=>{const Y={...o.mount?s:i};return Zt(U)?Y:Ni(U)?ge(Y,U):U.map(Q=>ge(Y,Q))},m=(U,Y)=>({invalid:!!ge((Y||n).errors,U),isDirty:!!ge((Y||n).dirtyFields,U),error:ge((Y||n).errors,U),isValidating:!!ge(n.validatingFields,U),isTouched:!!ge((Y||n).touchedFields,U)}),P=U=>{U&&ql(U).forEach(Y=>gn(n.errors,Y)),f.state.next({errors:U?n.errors:{}})},ae=(U,Y,Q)=>{const oe=(ge(r,U,{_f:{}})._f||{}).ref,ce=ge(n.errors,U)||{},{ref:ne,message:pe,type:je,...We}=ce;pt(n.errors,U,{...We,...Y,ref:oe}),f.state.next({name:U,errors:n.errors,isValid:!1}),Q&&Q.shouldFocus&&oe&&oe.focus&&oe.focus()},fe=(U,Y)=>ms(U)?f.values.subscribe({next:Q=>U(N(void 0,Y),Q)}):N(U,Y,!0),de=(U,Y={})=>{for(const Q of U?ql(U):a.mount)a.mount.delete(Q),a.array.delete(Q),Y.keepValue||(gn(r,Q),gn(s,Q)),!Y.keepError&&gn(n.errors,Q),!Y.keepDirty&&gn(n.dirtyFields,Q),!Y.keepTouched&&gn(n.touchedFields,Q),!Y.keepIsValidating&&gn(n.validatingFields,Q),!e.shouldUnregister&&!Y.keepDefaultValue&&gn(i,Q);f.values.next({values:{...s}}),f.state.next({...n,...Y.keepDirty?{isDirty:W()}:{}}),!Y.keepIsValid&&S()},Ce=({disabled:U,name:Y,field:Q,fields:oe,value:ce})=>{if(Fr(U)&&o.mount||U){const ne=U?void 0:Zt(ce)?cg(Q?Q._f:ge(oe,Y)._f):ce;pt(s,Y,ne),z(Y,ne,!1,!1,!0)}},Re=(U,Y={})=>{let Q=ge(r,U);const oe=Fr(Y.disabled)||Fr(t.disabled);return pt(r,U,{...Q||{},_f:{...Q&&Q._f?Q._f:{ref:{name:U}},name:U,mount:!0,...Y}}),a.mount.add(U),Q?Ce({field:Q,disabled:Fr(Y.disabled)?Y.disabled:t.disabled,name:U,value:Y.value}):L(U,!0,Y.value),{...oe?{disabled:Y.disabled||t.disabled}:{},...e.progressive?{required:!!Y.required,min:Il(Y.min),max:Il(Y.max),minLength:Il(Y.minLength),maxLength:Il(Y.maxLength),pattern:Il(Y.pattern)}:{},name:U,onChange:k,onBlur:k,ref:ce=>{if(ce){Re(U,Y),Q=ge(r,U);const ne=Zt(ce.value)&&ce.querySelectorAll&&ce.querySelectorAll("input,select,textarea")[0]||ce,pe=Rz(ne),je=Q._f.refs||[];if(pe?je.find(We=>We===ne):ne===Q._f.ref)return;pt(r,U,{_f:{...Q._f,...pe?{refs:[...je.filter(ag),ne,...Array.isArray(ge(i,U))?[{}]:[]],ref:{type:ne.type,name:U}}:{ref:ne}}}),L(U,!1,void 0,ne)}else Q=ge(r,U,{}),Q._f&&(Q._f.mount=!1),(e.shouldUnregister||Y.shouldUnregister)&&!(JI(a.array,U)&&o.action)&&a.unMount.add(U)}}},Me=()=>e.shouldFocusError&&Ql(r,O,a.mount),xt=U=>{Fr(U)&&(f.state.next({disabled:U}),Ql(r,(Y,Q)=>{const oe=ge(r,Q);oe&&(Y.disabled=oe._f.disabled||U,Array.isArray(oe._f.refs)&&oe._f.refs.forEach(ce=>{ce.disabled=oe._f.disabled||U}))},0,!1))},Fe=(U,Y)=>async Q=>{let oe;Q&&(Q.preventDefault&&Q.preventDefault(),Q.persist&&Q.persist());let ce=ar(s);if(f.state.next({isSubmitting:!0}),e.resolver){const{errors:ne,values:pe}=await F();n.errors=ne,ce=pe}else await V(r);if(gn(n.errors,"root"),cr(n.errors)){f.state.next({errors:{}});try{await U(ce,Q)}catch(ne){oe=ne}}else Y&&await Y({...n.errors},Q),Me(),setTimeout(Me);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:cr(n.errors)&&!oe,submitCount:n.submitCount+1,errors:n.errors}),oe)throw oe},De=(U,Y={})=>{ge(r,U)&&(Zt(Y.defaultValue)?I(U,ar(ge(i,U))):(I(U,Y.defaultValue),pt(i,U,ar(Y.defaultValue))),Y.keepTouched||gn(n.touchedFields,U),Y.keepDirty||(gn(n.dirtyFields,U),n.isDirty=Y.defaultValue?W(U,ar(ge(i,U))):W()),Y.keepError||(gn(n.errors,U),u.isValid&&S()),f.state.next({...n}))},ht=(U,Y={})=>{const Q=U?ar(U):i,oe=ar(Q),ce=cr(U),ne=ce?i:oe;if(Y.keepDefaultValues||(i=Q),!Y.keepValues){if(Y.keepDirtyValues)for(const pe of a.mount)ge(n.dirtyFields,pe)?pt(ne,pe,ge(s,pe)):I(pe,ge(ne,pe));else{if(l_&&Zt(U))for(const pe of a.mount){const je=ge(r,pe);if(je&&je._f){const We=Array.isArray(je._f.refs)?je._f.refs[0]:je._f.ref;if(ph(We)){const R=We.closest("form");if(R){R.reset();break}}}}r={}}s=t.shouldUnregister?Y.keepDefaultValues?ar(i):{}:ar(ne),f.array.next({values:{...ne}}),f.values.next({values:{...ne}})}a={mount:Y.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!u.isValid||!!Y.keepIsValid||!!Y.keepDirtyValues,o.watch=!!t.shouldUnregister,f.state.next({submitCount:Y.keepSubmitCount?n.submitCount:0,isDirty:ce?!1:Y.keepDirty?n.isDirty:!!(Y.keepDefaultValues&&!Vs(U,i)),isSubmitted:Y.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:ce?{}:Y.keepDirtyValues?Y.keepDefaultValues&&s?Gd(i,s):n.dirtyFields:Y.keepDefaultValues&&U?Gd(i,U):Y.keepDirty?n.dirtyFields:{},touchedFields:Y.keepTouched?n.touchedFields:{},errors:Y.keepErrors?n.errors:{},isSubmitSuccessful:Y.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Qe=(U,Y)=>ht(ms(U)?U(s):U,Y);return{control:{register:Re,unregister:de,getFieldState:m,handleSubmit:Fe,setError:ae,_executeSchema:F,_getWatch:N,_getDirty:W,_updateValid:S,_removeUnmounted:G,_updateFieldArray:b,_updateDisabledField:Ce,_getFieldArray:d,_reset:ht,_resetDefaultValues:()=>ms(e.defaultValues)&&e.defaultValues().then(U=>{Qe(U,e.resetOptions),f.state.next({isLoading:!1})}),_updateFormState:U=>{n={...n,...U}},_disableForm:xt,_subjects:f,_proxyFormState:u,_setErrors:M,get _fields(){return r},get _formValues(){return s},get _state(){return o},set _state(U){o=U},get _defaultValues(){return i},get _names(){return a},set _names(U){a=U},get _formState(){return n},set _formState(U){n=U},get _options(){return e},set _options(U){e={...e,...U}}},trigger:B,register:Re,handleSubmit:Fe,watch:fe,setValue:I,getValues:T,reset:Qe,resetField:De,clearErrors:P,unregister:de,setError:ae,setFocus:(U,Y={})=>{const Q=ge(r,U),oe=Q&&Q._f;if(oe){const ce=oe.refs?oe.refs[0]:oe.ref;ce.focus&&(ce.focus(),Y.shouldSelect&&ce.select())}},getFieldState:m}}function hk(t={}){const e=ee.useRef(),n=ee.useRef(),[r,i]=ee.useState({isDirty:!1,isValidating:!1,isLoading:ms(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,defaultValues:ms(t.defaultValues)?void 0:t.defaultValues});e.current||(e.current={...Dz(t),formState:r});const s=e.current.control;return s._options=t,d_({subject:s._subjects.state,next:o=>{rk(o,s._proxyFormState,s._updateFormState,!0)&&i({...s._formState})}}),ee.useEffect(()=>s._disableForm(t.disabled),[s,t.disabled]),ee.useEffect(()=>{if(s._proxyFormState.isDirty){const o=s._getDirty();o!==r.isDirty&&s._subjects.state.next({isDirty:o})}},[s,r.isDirty]),ee.useEffect(()=>{t.values&&!Vs(t.values,n.current)?(s._reset(t.values,s._options.resetOptions),n.current=t.values,i(o=>({...o}))):s._resetDefaultValues()},[t.values,s]),ee.useEffect(()=>{t.errors&&s._setErrors(t.errors)},[t.errors,s]),ee.useEffect(()=>{s._state.mount||(s._updateValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),ee.useEffect(()=>{t.shouldUnregister&&s._subjects.values.next({values:s._getWatch()})},[t.shouldUnregister,s]),e.current.formState=nk(r,s),e.current}var Pz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Co=Pz.reduce((t,e)=>{const n=j.forwardRef((r,i)=>{const{asChild:s,...o}=r,a=s?bp:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),te.jsx(a,{...o,ref:i})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function Bz(t,e){t&&td.flushSync(()=>t.dispatchEvent(e))}var zz="Label",pk=j.forwardRef((t,e)=>te.jsx(Co.label,{...t,ref:e,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=t.onMouseDown)==null||i.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));pk.displayName=zz;var gk=pk;const jz=qI("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),yk=j.forwardRef(({className:t,...e},n)=>te.jsx(gk,{ref:n,className:Oo(jz(),t),...e}));yk.displayName=gk.displayName;const mk=vz,wk=j.createContext({}),_k=({...t})=>te.jsx(wk.Provider,{value:{name:t.name},children:te.jsx(Sz,{...t})}),Sp=()=>{const t=j.useContext(wk),e=j.useContext(vk),{getFieldState:n,formState:r}=xp(),i=n(t.name,r);if(!t)throw new Error("useFormField should be used within <FormField>");const{id:s}=e;return{id:s,name:t.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...i}},vk=j.createContext({}),p_=j.forwardRef(({className:t,...e},n)=>{const r=j.useId();return te.jsx(vk.Provider,{value:{id:r},children:te.jsx("div",{ref:n,className:Oo("space-y-2",t),...e})})});p_.displayName="FormItem";const Uz=j.forwardRef(({className:t,...e},n)=>{const{error:r,formItemId:i}=Sp();return te.jsx(yk,{ref:n,className:Oo(r&&"text-destructive",t),htmlFor:i,...e})});Uz.displayName="FormLabel";const g_=j.forwardRef(({...t},e)=>{const{error:n,formItemId:r,formDescriptionId:i,formMessageId:s}=Sp();return te.jsx(bp,{ref:e,id:r,"aria-describedby":n?`${i} ${s}`:`${i}`,"aria-invalid":!!n,...t})});g_.displayName="FormControl";const Fz=j.forwardRef(({className:t,...e},n)=>{const{formDescriptionId:r}=Sp();return te.jsx("p",{ref:n,id:r,className:Oo("text-sm text-muted-foreground",t),...e})});Fz.displayName="FormDescription";const Wz=j.forwardRef(({className:t,children:e,...n},r)=>{const{error:i,formMessageId:s}=Sp(),o=i?String(i==null?void 0:i.message):e;return o?te.jsx("p",{ref:r,id:s,className:Oo("text-sm font-medium text-destructive",t),...n,children:o}):null});Wz.displayName="FormMessage";function ns(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function bk(t,e=[]){let n=[];function r(s,o){const a=j.createContext(o),c=n.length;n=[...n,o];function l(f){const{scope:g,children:p,..._}=f,A=(g==null?void 0:g[t][c])||a,S=j.useMemo(()=>_,Object.values(_));return te.jsx(A.Provider,{value:S,children:p})}function u(f,g){const p=(g==null?void 0:g[t][c])||a,_=j.useContext(p);if(_)return _;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return l.displayName=s+"Provider",[l,u]}const i=()=>{const s=n.map(o=>j.createContext(o));return function(a){const c=(a==null?void 0:a[t])||s;return j.useMemo(()=>({[`__scope${t}`]:{...a,[t]:c}}),[a,c])}};return i.scopeName=t,[r,Hz(i,...e)]}function Hz(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:c,scopeName:l})=>{const f=c(s)[`__scope${l}`];return{...a,...f}},{});return j.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function ol(t){const e=j.useRef(t);return j.useEffect(()=>{e.current=t}),j.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function $z(t,e=globalThis==null?void 0:globalThis.document){const n=ol(t);j.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var Vz="DismissableLayer",Ky="dismissableLayer.update",Zz="dismissableLayer.pointerDownOutside",Kz="dismissableLayer.focusOutside",mb,Ek=j.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),xk=j.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:a,...c}=t,l=j.useContext(Ek),[u,f]=j.useState(null),g=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=j.useState({}),_=Na(e,D=>f(D)),A=Array.from(l.layers),[S]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),E=A.indexOf(S),b=u?A.indexOf(u):-1,x=l.layersWithOutsidePointerEventsDisabled.size>0,M=b>=E,L=qz(D=>{const F=D.target,$=[...l.branches].some(V=>V.contains(F));!M||$||(i==null||i(D),o==null||o(D),D.defaultPrevented||a==null||a())},g),z=Qz(D=>{const F=D.target;[...l.branches].some(V=>V.contains(F))||(s==null||s(D),o==null||o(D),D.defaultPrevented||a==null||a())},g);return $z(D=>{b===l.layers.size-1&&(r==null||r(D),!D.defaultPrevented&&a&&(D.preventDefault(),a()))},g),j.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(mb=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),wb(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=mb)}},[u,g,n,l]),j.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),wb())},[u,l]),j.useEffect(()=>{const D=()=>p({});return document.addEventListener(Ky,D),()=>document.removeEventListener(Ky,D)},[]),te.jsx(Co.div,{...c,ref:_,style:{pointerEvents:x?M?"auto":"none":void 0,...t.style},onFocusCapture:ns(t.onFocusCapture,z.onFocusCapture),onBlurCapture:ns(t.onBlurCapture,z.onBlurCapture),onPointerDownCapture:ns(t.onPointerDownCapture,L.onPointerDownCapture)})});xk.displayName=Vz;var Gz="DismissableLayerBranch",Yz=j.forwardRef((t,e)=>{const n=j.useContext(Ek),r=j.useRef(null),i=Na(e,r);return j.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),te.jsx(Co.div,{...t,ref:i})});Yz.displayName=Gz;function qz(t,e=globalThis==null?void 0:globalThis.document){const n=ol(t),r=j.useRef(!1),i=j.useRef(()=>{});return j.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){Sk(Zz,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=c,e.addEventListener("click",i.current,{once:!0})):c()}else e.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function Qz(t,e=globalThis==null?void 0:globalThis.document){const n=ol(t),r=j.useRef(!1);return j.useEffect(()=>{const i=s=>{s.target&&!r.current&&Sk(Kz,n,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function wb(){const t=new CustomEvent(Ky);document.dispatchEvent(t)}function Sk(t,e,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?Bz(i,s):i.dispatchEvent(s)}var zc=globalThis!=null&&globalThis.document?j.useLayoutEffect:()=>{},Xz=E2.useId||(()=>{}),Jz=0;function e8(t){const[e,n]=j.useState(Xz());return zc(()=>{n(r=>r??String(Jz++))},[t]),e?`radix-${e}`:""}const t8=["top","right","bottom","left"],_o=Math.min,kr=Math.max,wh=Math.round,Yd=Math.floor,vo=t=>({x:t,y:t}),n8={left:"right",right:"left",bottom:"top",top:"bottom"},r8={start:"end",end:"start"};function Gy(t,e,n){return kr(t,_o(e,n))}function Is(t,e){return typeof t=="function"?t(e):t}function ks(t){return t.split("-")[0]}function al(t){return t.split("-")[1]}function y_(t){return t==="x"?"y":"x"}function m_(t){return t==="y"?"height":"width"}function bo(t){return["top","bottom"].includes(ks(t))?"y":"x"}function w_(t){return y_(bo(t))}function i8(t,e,n){n===void 0&&(n=!1);const r=al(t),i=w_(t),s=m_(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=_h(o)),[o,_h(o)]}function s8(t){const e=_h(t);return[Yy(t),e,Yy(e)]}function Yy(t){return t.replace(/start|end/g,e=>r8[e])}function o8(t,e,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?s:o;default:return[]}}function a8(t,e,n,r){const i=al(t);let s=o8(ks(t),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(Yy)))),s}function _h(t){return t.replace(/left|right|bottom|top/g,e=>n8[e])}function c8(t){return{top:0,right:0,bottom:0,left:0,...t}}function Ak(t){return typeof t!="number"?c8(t):{top:t,right:t,bottom:t,left:t}}function vh(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function _b(t,e,n){let{reference:r,floating:i}=t;const s=bo(e),o=w_(e),a=m_(o),c=ks(e),l=s==="y",u=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,g=r[a]/2-i[a]/2;let p;switch(c){case"top":p={x:u,y:r.y-i.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-i.width,y:f};break;default:p={x:r.x,y:r.y}}switch(al(e)){case"start":p[o]-=g*(n&&l?-1:1);break;case"end":p[o]+=g*(n&&l?-1:1);break}return p}const l8=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(e));let l=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=_b(l,r,c),g=r,p={},_=0;for(let A=0;A<a.length;A++){const{name:S,fn:E}=a[A],{x:b,y:x,data:M,reset:L}=await E({x:u,y:f,initialPlacement:r,placement:g,strategy:i,middlewareData:p,rects:l,platform:o,elements:{reference:t,floating:e}});u=b??u,f=x??f,p={...p,[S]:{...p[S],...M}},L&&_<=50&&(_++,typeof L=="object"&&(L.placement&&(g=L.placement),L.rects&&(l=L.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):L.rects),{x:u,y:f}=_b(l,g,c)),A=-1)}return{x:u,y:f,placement:g,strategy:i,middlewareData:p}};async function Au(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:c}=t,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:g=!1,padding:p=0}=Is(e,t),_=Ak(p),S=a[g?f==="floating"?"reference":"floating":f],E=vh(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(S)))==null||n?S:S.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),b=f==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),M=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},L=vh(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:x,strategy:c}):b);return{top:(E.top-L.top+_.top)/M.y,bottom:(L.bottom-E.bottom+_.bottom)/M.y,left:(E.left-L.left+_.left)/M.x,right:(L.right-E.right+_.right)/M.x}}const u8=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:c}=e,{element:l,padding:u=0}=Is(t,e)||{};if(l==null)return{};const f=Ak(u),g={x:n,y:r},p=w_(i),_=m_(p),A=await o.getDimensions(l),S=p==="y",E=S?"top":"left",b=S?"bottom":"right",x=S?"clientHeight":"clientWidth",M=s.reference[_]+s.reference[p]-g[p]-s.floating[_],L=g[p]-s.reference[p],z=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l));let D=z?z[x]:0;(!D||!await(o.isElement==null?void 0:o.isElement(z)))&&(D=a.floating[x]||s.floating[_]);const F=M/2-L/2,$=D/2-A[_]/2-1,V=_o(f[E],$),G=_o(f[b],$),W=V,N=D-A[_]-G,d=D/2-A[_]/2+F,h=Gy(W,d,N),v=!c.arrow&&al(i)!=null&&d!==h&&s.reference[_]/2-(d<W?V:G)-A[_]/2<0,I=v?d<W?d-W:d-N:0;return{[p]:g[p]+I,data:{[p]:h,centerOffset:d-h-I,...v&&{alignmentOffset:I}},reset:v}}}),d8=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:c,elements:l}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:g,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:A=!0,...S}=Is(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const E=ks(i),b=bo(a),x=ks(a)===a,M=await(c.isRTL==null?void 0:c.isRTL(l.floating)),L=g||(x||!A?[_h(a)]:s8(a)),z=_!=="none";!g&&z&&L.push(...a8(a,A,_,M));const D=[a,...L],F=await Au(e,S),$=[];let V=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&$.push(F[E]),f){const d=i8(i,o,M);$.push(F[d[0]],F[d[1]])}if(V=[...V,{placement:i,overflows:$}],!$.every(d=>d<=0)){var G,W;const d=(((G=s.flip)==null?void 0:G.index)||0)+1,h=D[d];if(h)return{data:{index:d,overflows:V},reset:{placement:h}};let v=(W=V.filter(I=>I.overflows[0]<=0).sort((I,k)=>I.overflows[1]-k.overflows[1])[0])==null?void 0:W.placement;if(!v)switch(p){case"bestFit":{var N;const I=(N=V.filter(k=>{if(z){const O=bo(k.placement);return O===b||O==="y"}return!0}).map(k=>[k.placement,k.overflows.filter(O=>O>0).reduce((O,B)=>O+B,0)]).sort((k,O)=>k[1]-O[1])[0])==null?void 0:N[0];I&&(v=I);break}case"initialPlacement":v=a;break}if(i!==v)return{reset:{placement:v}}}return{}}}};function vb(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function bb(t){return t8.some(e=>t[e]>=0)}const f8=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=Is(t,e);switch(r){case"referenceHidden":{const s=await Au(e,{...i,elementContext:"reference"}),o=vb(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:bb(o)}}}case"escaped":{const s=await Au(e,{...i,altBoundary:!0}),o=vb(s,n.floating);return{data:{escapedOffsets:o,escaped:bb(o)}}}default:return{}}}}};async function h8(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ks(n),a=al(n),c=bo(n)==="y",l=["left","top"].includes(o)?-1:1,u=s&&c?-1:1,f=Is(e,t);let{mainAxis:g,crossAxis:p,alignmentAxis:_}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof _=="number"&&(p=a==="end"?_*-1:_),c?{x:p*u,y:g*l}:{x:g*l,y:p*u}}const p8=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=e,c=await h8(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:o}}}}},g8=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:S=>{let{x:E,y:b}=S;return{x:E,y:b}}},...c}=Is(t,e),l={x:n,y:r},u=await Au(e,c),f=bo(ks(i)),g=y_(f);let p=l[g],_=l[f];if(s){const S=g==="y"?"top":"left",E=g==="y"?"bottom":"right",b=p+u[S],x=p-u[E];p=Gy(b,p,x)}if(o){const S=f==="y"?"top":"left",E=f==="y"?"bottom":"right",b=_+u[S],x=_-u[E];_=Gy(b,_,x)}const A=a.fn({...e,[g]:p,[f]:_});return{...A,data:{x:A.x-n,y:A.y-r,enabled:{[g]:s,[f]:o}}}}}},y8=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=Is(t,e),u={x:n,y:r},f=bo(i),g=y_(f);let p=u[g],_=u[f];const A=Is(a,e),S=typeof A=="number"?{mainAxis:A,crossAxis:0}:{mainAxis:0,crossAxis:0,...A};if(c){const x=g==="y"?"height":"width",M=s.reference[g]-s.floating[x]+S.mainAxis,L=s.reference[g]+s.reference[x]-S.mainAxis;p<M?p=M:p>L&&(p=L)}if(l){var E,b;const x=g==="y"?"width":"height",M=["top","left"].includes(ks(i)),L=s.reference[f]-s.floating[x]+(M&&((E=o.offset)==null?void 0:E[f])||0)+(M?0:S.crossAxis),z=s.reference[f]+s.reference[x]+(M?0:((b=o.offset)==null?void 0:b[f])||0)-(M?S.crossAxis:0);_<L?_=L:_>z&&(_=z)}return{[g]:p,[f]:_}}}},m8=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:s,platform:o,elements:a}=e,{apply:c=()=>{},...l}=Is(t,e),u=await Au(e,l),f=ks(i),g=al(i),p=bo(i)==="y",{width:_,height:A}=s.floating;let S,E;f==="top"||f==="bottom"?(S=f,E=g===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(E=f,S=g==="end"?"top":"bottom");const b=A-u.top-u.bottom,x=_-u.left-u.right,M=_o(A-u[S],b),L=_o(_-u[E],x),z=!e.middlewareData.shift;let D=M,F=L;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(F=x),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(D=b),z&&!g){const V=kr(u.left,0),G=kr(u.right,0),W=kr(u.top,0),N=kr(u.bottom,0);p?F=_-2*(V!==0||G!==0?V+G:kr(u.left,u.right)):D=A-2*(W!==0||N!==0?W+N:kr(u.top,u.bottom))}await c({...e,availableWidth:F,availableHeight:D});const $=await o.getDimensions(a.floating);return _!==$.width||A!==$.height?{reset:{rects:!0}}:{}}}};function Ap(){return typeof window<"u"}function cl(t){return Ik(t)?(t.nodeName||"").toLowerCase():"#document"}function Mr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function $i(t){var e;return(e=(Ik(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Ik(t){return Ap()?t instanceof Node||t instanceof Mr(t).Node:!1}function gi(t){return Ap()?t instanceof Element||t instanceof Mr(t).Element:!1}function zi(t){return Ap()?t instanceof HTMLElement||t instanceof Mr(t).HTMLElement:!1}function Eb(t){return!Ap()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Mr(t).ShadowRoot}function pd(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=yi(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function w8(t){return["table","td","th"].includes(cl(t))}function Ip(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function __(t){const e=v_(),n=gi(t)?yi(t):t;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function _8(t){let e=Eo(t);for(;zi(e)&&!jc(e);){if(__(e))return e;if(Ip(e))return null;e=Eo(e)}return null}function v_(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function jc(t){return["html","body","#document"].includes(cl(t))}function yi(t){return Mr(t).getComputedStyle(t)}function kp(t){return gi(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Eo(t){if(cl(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Eb(t)&&t.host||$i(t);return Eb(e)?e.host:e}function kk(t){const e=Eo(t);return jc(e)?t.ownerDocument?t.ownerDocument.body:t.body:zi(e)&&pd(e)?e:kk(e)}function Iu(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=kk(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),o=Mr(i);if(s){const a=qy(o);return e.concat(o,o.visualViewport||[],pd(i)?i:[],a&&n?Iu(a):[])}return e.concat(i,Iu(i,[],n))}function qy(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Rk(t){const e=yi(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=zi(t),s=i?t.offsetWidth:n,o=i?t.offsetHeight:r,a=wh(n)!==s||wh(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function b_(t){return gi(t)?t:t.contextElement}function _c(t){const e=b_(t);if(!zi(e))return vo(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=Rk(e);let o=(s?wh(n.width):n.width)/r,a=(s?wh(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const v8=vo(0);function Nk(t){const e=Mr(t);return!v_()||!e.visualViewport?v8:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function b8(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Mr(t)?!1:e}function wa(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=b_(t);let o=vo(1);e&&(r?gi(r)&&(o=_c(r)):o=_c(t));const a=b8(s,n,r)?Nk(s):vo(0);let c=(i.left+a.x)/o.x,l=(i.top+a.y)/o.y,u=i.width/o.x,f=i.height/o.y;if(s){const g=Mr(s),p=r&&gi(r)?Mr(r):r;let _=g,A=qy(_);for(;A&&r&&p!==_;){const S=_c(A),E=A.getBoundingClientRect(),b=yi(A),x=E.left+(A.clientLeft+parseFloat(b.paddingLeft))*S.x,M=E.top+(A.clientTop+parseFloat(b.paddingTop))*S.y;c*=S.x,l*=S.y,u*=S.x,f*=S.y,c+=x,l+=M,_=Mr(A),A=qy(_)}}return vh({width:u,height:f,x:c,y:l})}function E8(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",o=$i(r),a=e?Ip(e.floating):!1;if(r===o||a&&s)return n;let c={scrollLeft:0,scrollTop:0},l=vo(1);const u=vo(0),f=zi(r);if((f||!f&&!s)&&((cl(r)!=="body"||pd(o))&&(c=kp(r)),zi(r))){const g=wa(r);l=_c(r),u.x=g.x+r.clientLeft,u.y=g.y+r.clientTop}return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x,y:n.y*l.y-c.scrollTop*l.y+u.y}}function x8(t){return Array.from(t.getClientRects())}function Qy(t,e){const n=kp(t).scrollLeft;return e?e.left+n:wa($i(t)).left+n}function S8(t){const e=$i(t),n=kp(t),r=t.ownerDocument.body,i=kr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=kr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Qy(t);const a=-n.scrollTop;return yi(r).direction==="rtl"&&(o+=kr(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function A8(t,e){const n=Mr(t),r=$i(t),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,c=0;if(i){s=i.width,o=i.height;const l=v_();(!l||l&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:s,height:o,x:a,y:c}}function I8(t,e){const n=wa(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=zi(t)?_c(t):vo(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,c=i*s.x,l=r*s.y;return{width:o,height:a,x:c,y:l}}function xb(t,e,n){let r;if(e==="viewport")r=A8(t,n);else if(e==="document")r=S8($i(t));else if(gi(e))r=I8(e,n);else{const i=Nk(t);r={...e,x:e.x-i.x,y:e.y-i.y}}return vh(r)}function Tk(t,e){const n=Eo(t);return n===e||!gi(n)||jc(n)?!1:yi(n).position==="fixed"||Tk(n,e)}function k8(t,e){const n=e.get(t);if(n)return n;let r=Iu(t,[],!1).filter(a=>gi(a)&&cl(a)!=="body"),i=null;const s=yi(t).position==="fixed";let o=s?Eo(t):t;for(;gi(o)&&!jc(o);){const a=yi(o),c=__(o);!c&&a.position==="fixed"&&(i=null),(s?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||pd(o)&&!c&&Tk(t,o))?r=r.filter(u=>u!==o):i=a,o=Eo(o)}return e.set(t,r),r}function R8(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const o=[...n==="clippingAncestors"?Ip(e)?[]:k8(e,this._c):[].concat(n),r],a=o[0],c=o.reduce((l,u)=>{const f=xb(e,u,i);return l.top=kr(f.top,l.top),l.right=_o(f.right,l.right),l.bottom=_o(f.bottom,l.bottom),l.left=kr(f.left,l.left),l},xb(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function N8(t){const{width:e,height:n}=Rk(t);return{width:e,height:n}}function T8(t,e,n){const r=zi(e),i=$i(e),s=n==="fixed",o=wa(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=vo(0);if(r||!r&&!s)if((cl(e)!=="body"||pd(i))&&(a=kp(e)),r){const p=wa(e,!0,s,e);c.x=p.x+e.clientLeft,c.y=p.y+e.clientTop}else i&&(c.x=Qy(i));let l=0,u=0;if(i&&!r&&!s){const p=i.getBoundingClientRect();u=p.top+a.scrollTop,l=p.left+a.scrollLeft-Qy(i,p)}const f=o.left+a.scrollLeft-c.x-l,g=o.top+a.scrollTop-c.y-u;return{x:f,y:g,width:o.width,height:o.height}}function lg(t){return yi(t).position==="static"}function Sb(t,e){if(!zi(t)||yi(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return $i(t)===n&&(n=n.ownerDocument.body),n}function Mk(t,e){const n=Mr(t);if(Ip(t))return n;if(!zi(t)){let i=Eo(t);for(;i&&!jc(i);){if(gi(i)&&!lg(i))return i;i=Eo(i)}return n}let r=Sb(t,e);for(;r&&w8(r)&&lg(r);)r=Sb(r,e);return r&&jc(r)&&lg(r)&&!__(r)?n:r||_8(t)||n}const M8=async function(t){const e=this.getOffsetParent||Mk,n=this.getDimensions,r=await n(t.floating);return{reference:T8(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function O8(t){return yi(t).direction==="rtl"}const C8={convertOffsetParentRelativeRectToViewportRelativeRect:E8,getDocumentElement:$i,getClippingRect:R8,getOffsetParent:Mk,getElementRects:M8,getClientRects:x8,getDimensions:N8,getScale:_c,isElement:gi,isRTL:O8};function L8(t,e){let n=null,r;const i=$i(t);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const{left:l,top:u,width:f,height:g}=t.getBoundingClientRect();if(a||e(),!f||!g)return;const p=Yd(u),_=Yd(i.clientWidth-(l+f)),A=Yd(i.clientHeight-(u+g)),S=Yd(l),b={rootMargin:-p+"px "+-_+"px "+-A+"px "+-S+"px",threshold:kr(0,_o(1,c))||1};let x=!0;function M(L){const z=L[0].intersectionRatio;if(z!==c){if(!x)return o();z?o(!1,z):r=setTimeout(()=>{o(!1,1e-7)},1e3)}x=!1}try{n=new IntersectionObserver(M,{...b,root:i.ownerDocument})}catch{n=new IntersectionObserver(M,b)}n.observe(t)}return o(!0),s}function D8(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=b_(t),u=i||s?[...l?Iu(l):[],...Iu(e)]:[];u.forEach(E=>{i&&E.addEventListener("scroll",n,{passive:!0}),s&&E.addEventListener("resize",n)});const f=l&&a?L8(l,n):null;let g=-1,p=null;o&&(p=new ResizeObserver(E=>{let[b]=E;b&&b.target===l&&p&&(p.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var x;(x=p)==null||x.observe(e)})),n()}),l&&!c&&p.observe(l),p.observe(e));let _,A=c?wa(t):null;c&&S();function S(){const E=wa(t);A&&(E.x!==A.x||E.y!==A.y||E.width!==A.width||E.height!==A.height)&&n(),A=E,_=requestAnimationFrame(S)}return n(),()=>{var E;u.forEach(b=>{i&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),f==null||f(),(E=p)==null||E.disconnect(),p=null,c&&cancelAnimationFrame(_)}}const P8=p8,B8=g8,z8=d8,j8=m8,U8=f8,Ab=u8,F8=y8,W8=(t,e,n)=>{const r=new Map,i={platform:C8,...n},s={...i.platform,_c:r};return l8(t,e,{...i,platform:s})};var If=typeof document<"u"?j.useLayoutEffect:j.useEffect;function bh(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!bh(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&t.$$typeof)&&!bh(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function Ok(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Ib(t,e){const n=Ok(t);return Math.round(e*n)/n}function ug(t){const e=j.useRef(t);return If(()=>{e.current=t}),e}function H8(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:c,open:l}=t,[u,f]=j.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[g,p]=j.useState(r);bh(g,r)||p(r);const[_,A]=j.useState(null),[S,E]=j.useState(null),b=j.useCallback(k=>{k!==z.current&&(z.current=k,A(k))},[]),x=j.useCallback(k=>{k!==D.current&&(D.current=k,E(k))},[]),M=s||_,L=o||S,z=j.useRef(null),D=j.useRef(null),F=j.useRef(u),$=c!=null,V=ug(c),G=ug(i),W=ug(l),N=j.useCallback(()=>{if(!z.current||!D.current)return;const k={placement:e,strategy:n,middleware:g};G.current&&(k.platform=G.current),W8(z.current,D.current,k).then(O=>{const B={...O,isPositioned:W.current!==!1};d.current&&!bh(F.current,B)&&(F.current=B,td.flushSync(()=>{f(B)}))})},[g,e,n,G,W]);If(()=>{l===!1&&F.current.isPositioned&&(F.current.isPositioned=!1,f(k=>({...k,isPositioned:!1})))},[l]);const d=j.useRef(!1);If(()=>(d.current=!0,()=>{d.current=!1}),[]),If(()=>{if(M&&(z.current=M),L&&(D.current=L),M&&L){if(V.current)return V.current(M,L,N);N()}},[M,L,N,V,$]);const h=j.useMemo(()=>({reference:z,floating:D,setReference:b,setFloating:x}),[b,x]),v=j.useMemo(()=>({reference:M,floating:L}),[M,L]),I=j.useMemo(()=>{const k={position:n,left:0,top:0};if(!v.floating)return k;const O=Ib(v.floating,u.x),B=Ib(v.floating,u.y);return a?{...k,transform:"translate("+O+"px, "+B+"px)",...Ok(v.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:O,top:B}},[n,a,v.floating,u.x,u.y]);return j.useMemo(()=>({...u,update:N,refs:h,elements:v,floatingStyles:I}),[u,N,h,v,I])}const $8=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?Ab({element:r.current,padding:i}).fn(n):{}:r?Ab({element:r,padding:i}).fn(n):{}}}},V8=(t,e)=>({...P8(t),options:[t,e]}),Z8=(t,e)=>({...B8(t),options:[t,e]}),K8=(t,e)=>({...F8(t),options:[t,e]}),G8=(t,e)=>({...z8(t),options:[t,e]}),Y8=(t,e)=>({...j8(t),options:[t,e]}),q8=(t,e)=>({...U8(t),options:[t,e]}),Q8=(t,e)=>({...$8(t),options:[t,e]});var X8="Arrow",Ck=j.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...s}=t;return te.jsx(Co.svg,{...s,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:te.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ck.displayName=X8;var J8=Ck;function e6(t){const[e,n]=j.useState(void 0);return zc(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const c=s.borderBoxSize,l=Array.isArray(c)?c[0]:c;o=l.inlineSize,a=l.blockSize}else o=t.offsetWidth,a=t.offsetHeight;n({width:o,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var E_="Popper",[Lk,Dk]=bk(E_),[t6,Pk]=Lk(E_),Bk=t=>{const{__scopePopper:e,children:n}=t,[r,i]=j.useState(null);return te.jsx(t6,{scope:e,anchor:r,onAnchorChange:i,children:n})};Bk.displayName=E_;var zk="PopperAnchor",jk=j.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,s=Pk(zk,n),o=j.useRef(null),a=Na(e,o);return j.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:te.jsx(Co.div,{...i,ref:a})});jk.displayName=zk;var x_="PopperContent",[n6,r6]=Lk(x_),Uk=j.forwardRef((t,e)=>{var Ce,Re,Me,xt,Fe,De;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:g=!1,updatePositionStrategy:p="optimized",onPlaced:_,...A}=t,S=Pk(x_,n),[E,b]=j.useState(null),x=Na(e,ht=>b(ht)),[M,L]=j.useState(null),z=e6(M),D=(z==null?void 0:z.width)??0,F=(z==null?void 0:z.height)??0,$=r+(s!=="center"?"-"+s:""),V=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},G=Array.isArray(l)?l:[l],W=G.length>0,N={padding:V,boundary:G.filter(s6),altBoundary:W},{refs:d,floatingStyles:h,placement:v,isPositioned:I,middlewareData:k}=H8({strategy:"fixed",placement:$,whileElementsMounted:(...ht)=>D8(...ht,{animationFrame:p==="always"}),elements:{reference:S.anchor},middleware:[V8({mainAxis:i+F,alignmentAxis:o}),c&&Z8({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?K8():void 0,...N}),c&&G8({...N}),Y8({...N,apply:({elements:ht,rects:Qe,availableWidth:dt,availableHeight:Zi})=>{const{width:yt,height:U}=Qe.reference,Y=ht.floating.style;Y.setProperty("--radix-popper-available-width",`${dt}px`),Y.setProperty("--radix-popper-available-height",`${Zi}px`),Y.setProperty("--radix-popper-anchor-width",`${yt}px`),Y.setProperty("--radix-popper-anchor-height",`${U}px`)}}),M&&Q8({element:M,padding:a}),o6({arrowWidth:D,arrowHeight:F}),g&&q8({strategy:"referenceHidden",...N})]}),[O,B]=Hk(v),T=ol(_);zc(()=>{I&&(T==null||T())},[I,T]);const m=(Ce=k.arrow)==null?void 0:Ce.x,P=(Re=k.arrow)==null?void 0:Re.y,ae=((Me=k.arrow)==null?void 0:Me.centerOffset)!==0,[fe,de]=j.useState();return zc(()=>{E&&de(window.getComputedStyle(E).zIndex)},[E]),te.jsx("div",{ref:d.setFloating,"data-radix-popper-content-wrapper":"",style:{...h,transform:I?h.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[(xt=k.transformOrigin)==null?void 0:xt.x,(Fe=k.transformOrigin)==null?void 0:Fe.y].join(" "),...((De=k.hide)==null?void 0:De.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:te.jsx(n6,{scope:n,placedSide:O,onArrowChange:L,arrowX:m,arrowY:P,shouldHideArrow:ae,children:te.jsx(Co.div,{"data-side":O,"data-align":B,...A,ref:x,style:{...A.style,animation:I?void 0:"none"}})})})});Uk.displayName=x_;var Fk="PopperArrow",i6={top:"bottom",right:"left",bottom:"top",left:"right"},Wk=j.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,s=r6(Fk,r),o=i6[s.placedSide];return te.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:te.jsx(J8,{...i,ref:n,style:{...i.style,display:"block"}})})});Wk.displayName=Fk;function s6(t){return t!==null}var o6=t=>({name:"transformOrigin",options:t,fn(e){var S,E,b;const{placement:n,rects:r,middlewareData:i}=e,o=((S=i.arrow)==null?void 0:S.centerOffset)!==0,a=o?0:t.arrowWidth,c=o?0:t.arrowHeight,[l,u]=Hk(n),f={start:"0%",center:"50%",end:"100%"}[u],g=(((E=i.arrow)==null?void 0:E.x)??0)+a/2,p=(((b=i.arrow)==null?void 0:b.y)??0)+c/2;let _="",A="";return l==="bottom"?(_=o?f:`${g}px`,A=`${-c}px`):l==="top"?(_=o?f:`${g}px`,A=`${r.floating.height+c}px`):l==="right"?(_=`${-c}px`,A=o?f:`${p}px`):l==="left"&&(_=`${r.floating.width+c}px`,A=o?f:`${p}px`),{data:{x:_,y:A}}}});function Hk(t){const[e,n="center"]=t.split("-");return[e,n]}var a6=Bk,c6=jk,l6=Uk,u6=Wk;function d6(t,e){return j.useReducer((n,r)=>e[n][r]??n,t)}var $k=t=>{const{present:e,children:n}=t,r=f6(e),i=typeof n=="function"?n({present:r.isPresent}):j.Children.only(n),s=Na(r.ref,h6(i));return typeof n=="function"||r.isPresent?j.cloneElement(i,{ref:s}):null};$k.displayName="Presence";function f6(t){const[e,n]=j.useState(),r=j.useRef({}),i=j.useRef(t),s=j.useRef("none"),o=t?"mounted":"unmounted",[a,c]=d6(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return j.useEffect(()=>{const l=qd(r.current);s.current=a==="mounted"?l:"none"},[a]),zc(()=>{const l=r.current,u=i.current;if(u!==t){const g=s.current,p=qd(l);t?c("MOUNT"):p==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&g!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,c]),zc(()=>{if(e){const l=f=>{const p=qd(r.current).includes(f.animationName);f.target===e&&p&&td.flushSync(()=>c("ANIMATION_END"))},u=f=>{f.target===e&&(s.current=qd(r.current))};return e.addEventListener("animationstart",u),e.addEventListener("animationcancel",l),e.addEventListener("animationend",l),()=>{e.removeEventListener("animationstart",u),e.removeEventListener("animationcancel",l),e.removeEventListener("animationend",l)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:j.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function qd(t){return(t==null?void 0:t.animationName)||"none"}function h6(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function p6({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,i]=g6({defaultProp:e,onChange:n}),s=t!==void 0,o=s?t:r,a=ol(n),c=j.useCallback(l=>{if(s){const f=typeof l=="function"?l(t):l;f!==t&&a(f)}else i(l)},[s,t,i,a]);return[o,c]}function g6({defaultProp:t,onChange:e}){const n=j.useState(t),[r]=n,i=j.useRef(r),s=ol(e);return j.useEffect(()=>{i.current!==r&&(s(r),i.current=r)},[r,i,s]),n}var y6="VisuallyHidden",Vk=j.forwardRef((t,e)=>te.jsx(Co.span,{...t,ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}));Vk.displayName=y6;var m6=Vk,[Rp,sH]=bk("Tooltip",[Dk]),Np=Dk(),Zk="TooltipProvider",w6=700,Xy="tooltip.open",[_6,S_]=Rp(Zk),Kk=t=>{const{__scopeTooltip:e,delayDuration:n=w6,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=t,[o,a]=j.useState(!0),c=j.useRef(!1),l=j.useRef(0);return j.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),te.jsx(_6,{scope:e,isOpenDelayed:o,delayDuration:n,onOpen:j.useCallback(()=>{window.clearTimeout(l.current),a(!1)},[]),onClose:j.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:j.useCallback(u=>{c.current=u},[]),disableHoverableContent:i,children:s})};Kk.displayName=Zk;var Tp="Tooltip",[v6,Mp]=Rp(Tp),Gk=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:i=!1,onOpenChange:s,disableHoverableContent:o,delayDuration:a}=t,c=S_(Tp,t.__scopeTooltip),l=Np(e),[u,f]=j.useState(null),g=e8(),p=j.useRef(0),_=o??c.disableHoverableContent,A=a??c.delayDuration,S=j.useRef(!1),[E=!1,b]=p6({prop:r,defaultProp:i,onChange:D=>{D?(c.onOpen(),document.dispatchEvent(new CustomEvent(Xy))):c.onClose(),s==null||s(D)}}),x=j.useMemo(()=>E?S.current?"delayed-open":"instant-open":"closed",[E]),M=j.useCallback(()=>{window.clearTimeout(p.current),S.current=!1,b(!0)},[b]),L=j.useCallback(()=>{window.clearTimeout(p.current),b(!1)},[b]),z=j.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{S.current=!0,b(!0)},A)},[A,b]);return j.useEffect(()=>()=>window.clearTimeout(p.current),[]),te.jsx(a6,{...l,children:te.jsx(v6,{scope:e,contentId:g,open:E,stateAttribute:x,trigger:u,onTriggerChange:f,onTriggerEnter:j.useCallback(()=>{c.isOpenDelayed?z():M()},[c.isOpenDelayed,z,M]),onTriggerLeave:j.useCallback(()=>{_?L():window.clearTimeout(p.current)},[L,_]),onOpen:M,onClose:L,disableHoverableContent:_,children:n})})};Gk.displayName=Tp;var Jy="TooltipTrigger",Yk=j.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=Mp(Jy,n),s=S_(Jy,n),o=Np(n),a=j.useRef(null),c=Na(e,a,i.onTriggerChange),l=j.useRef(!1),u=j.useRef(!1),f=j.useCallback(()=>l.current=!1,[]);return j.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),te.jsx(c6,{asChild:!0,...o,children:te.jsx(Co.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:c,onPointerMove:ns(t.onPointerMove,g=>{g.pointerType!=="touch"&&!u.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:ns(t.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:ns(t.onPointerDown,()=>{l.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:ns(t.onFocus,()=>{l.current||i.onOpen()}),onBlur:ns(t.onBlur,i.onClose),onClick:ns(t.onClick,i.onClose)})})});Yk.displayName=Jy;var b6="TooltipPortal",[oH,E6]=Rp(b6,{forceMount:void 0}),Uc="TooltipContent",qk=j.forwardRef((t,e)=>{const n=E6(Uc,t.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...s}=t,o=Mp(Uc,t.__scopeTooltip);return te.jsx($k,{present:r||o.open,children:o.disableHoverableContent?te.jsx(Qk,{side:i,...s,ref:e}):te.jsx(x6,{side:i,...s,ref:e})})}),x6=j.forwardRef((t,e)=>{const n=Mp(Uc,t.__scopeTooltip),r=S_(Uc,t.__scopeTooltip),i=j.useRef(null),s=Na(e,i),[o,a]=j.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:f}=r,g=j.useCallback(()=>{a(null),f(!1)},[f]),p=j.useCallback((_,A)=>{const S=_.currentTarget,E={x:_.clientX,y:_.clientY},b=k6(E,S.getBoundingClientRect()),x=R6(E,b),M=N6(A.getBoundingClientRect()),L=M6([...x,...M]);a(L),f(!0)},[f]);return j.useEffect(()=>()=>g(),[g]),j.useEffect(()=>{if(c&&u){const _=S=>p(S,u),A=S=>p(S,c);return c.addEventListener("pointerleave",_),u.addEventListener("pointerleave",A),()=>{c.removeEventListener("pointerleave",_),u.removeEventListener("pointerleave",A)}}},[c,u,p,g]),j.useEffect(()=>{if(o){const _=A=>{const S=A.target,E={x:A.clientX,y:A.clientY},b=(c==null?void 0:c.contains(S))||(u==null?void 0:u.contains(S)),x=!T6(E,o);b?g():x&&(g(),l())};return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[c,u,o,l,g]),te.jsx(Qk,{...t,ref:s})}),[S6,A6]=Rp(Tp,{isInside:!1}),Qk=j.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:o,...a}=t,c=Mp(Uc,n),l=Np(n),{onClose:u}=c;return j.useEffect(()=>(document.addEventListener(Xy,u),()=>document.removeEventListener(Xy,u)),[u]),j.useEffect(()=>{if(c.trigger){const f=g=>{const p=g.target;p!=null&&p.contains(c.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,u]),te.jsx(xk,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:f=>f.preventDefault(),onDismiss:u,children:te.jsxs(l6,{"data-state":c.stateAttribute,...l,...a,ref:e,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[te.jsx(GI,{children:r}),te.jsx(S6,{scope:n,isInside:!0,children:te.jsx(m6,{id:c.contentId,role:"tooltip",children:i||r})})]})})});qk.displayName=Uc;var Xk="TooltipArrow",I6=j.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=Np(n);return A6(Xk,n).isInside?null:te.jsx(u6,{...i,...r,ref:e})});I6.displayName=Xk;function k6(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(n,r,i,s)){case s:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function R6(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function N6(t){const{top:e,right:n,bottom:r,left:i}=t;return[{x:i,y:e},{x:n,y:e},{x:n,y:r},{x:i,y:r}]}function T6(t,e){const{x:n,y:r}=t;let i=!1;for(let s=0,o=e.length-1;s<e.length;o=s++){const a=e[s].x,c=e[s].y,l=e[o].x,u=e[o].y;c>r!=u>r&&n<(l-a)*(r-c)/(u-c)+a&&(i=!i)}return i}function M6(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),O6(e)}function O6(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const i=t[r];for(;e.length>=2;){const s=e[e.length-1],o=e[e.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))e.pop();else break}e.push(i)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const i=t[r];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))n.pop();else break}n.push(i)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var C6=Kk,L6=Gk,Jk=qk;const D6=C6,P6=L6,eR=j.forwardRef(({className:t,sideOffset:e=4,...n},r)=>te.jsx(Jk,{ref:r,sideOffset:e,className:Oo("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n}));eR.displayName=Jk.displayName;/** + * @license lucide-react v0.446.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const B6=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),tR=(...t)=>t.filter((e,n,r)=>!!e&&r.indexOf(e)===n).join(" ");/** + * @license lucide-react v0.446.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var z6={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v0.446.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const j6=j.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:o,...a},c)=>j.createElement("svg",{ref:c,...z6,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:tR("lucide",i),...a},[...o.map(([l,u])=>j.createElement(l,u)),...Array.isArray(s)?s:[s]]));/** + * @license lucide-react v0.446.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Lo=(t,e)=>{const n=j.forwardRef(({className:r,...i},s)=>j.createElement(j6,{ref:s,iconNode:e,className:tR(`lucide-${B6(t)}`,r),...i}));return n.displayName=`${t}`,n};/** + * @license lucide-react v0.446.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const U6=Lo("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** + * @license lucide-react v0.446.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const F6=Lo("CopyCheck",[["path",{d:"m12 15 2 2 4-4",key:"2c609p"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** + * @license lucide-react v0.446.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const W6=Lo("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** + * @license lucide-react v0.446.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const em=Lo("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** + * @license lucide-react v0.446.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const H6=Lo("MessageSquareMore",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M16 10h.01",key:"1m94wz"}]]);/** + * @license lucide-react v0.446.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $6=Lo("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + * @license lucide-react v0.446.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nR=Lo("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + * @license lucide-react v0.446.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const V6=Lo("SendHorizontal",[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]]);function rR(t){return ie.findProgramAddressSync([re.Buffer.from("global"),t.toBuffer()],new ie("3o3K93TeUMRxrcsWf2Eu6E7oX41Ffx9AWcxEZqC6KEqg"))[0].toBase58()}function dg(t){return`${t.slice(0,4)}....${t.slice(-4)}`}var it;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const s={};for(const o of i)s[o]=o;return s},t.getValidEnumValues=i=>{const s=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(const a of s)o[a]=i[a];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},t.find=(i,s)=>{for(const o of i)if(s(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}t.joinValues=r,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(it||(it={}));var tm;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(tm||(tm={}));const Ee=it.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Zs=t=>{switch(typeof t){case"undefined":return Ee.undefined;case"string":return Ee.string;case"number":return isNaN(t)?Ee.nan:Ee.number;case"boolean":return Ee.boolean;case"function":return Ee.function;case"bigint":return Ee.bigint;case"symbol":return Ee.symbol;case"object":return Array.isArray(t)?Ee.array:t===null?Ee.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Ee.promise:typeof Map<"u"&&t instanceof Map?Ee.map:typeof Set<"u"&&t instanceof Set?Ee.set:typeof Date<"u"&&t instanceof Date?Ee.date:Ee.object;default:return Ee.unknown}},ue=it.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Z6=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Or extends Error{constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(s){return s.message},r={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let a=r,c=0;for(;c<o.path.length;){const l=o.path[c];c===o.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(n(o))):a[l]=a[l]||{_errors:[]},a=a[l],c++}}};return i(this),r}static assert(e){if(!(e instanceof Or))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,it.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Or.create=t=>new Or(t);const Fc=(t,e)=>{let n;switch(t.code){case ue.invalid_type:t.received===Ee.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case ue.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,it.jsonStringifyReplacer)}`;break;case ue.unrecognized_keys:n=`Unrecognized key(s) in object: ${it.joinValues(t.keys,", ")}`;break;case ue.invalid_union:n="Invalid input";break;case ue.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${it.joinValues(t.options)}`;break;case ue.invalid_enum_value:n=`Invalid enum value. Expected ${it.joinValues(t.options)}, received '${t.received}'`;break;case ue.invalid_arguments:n="Invalid function arguments";break;case ue.invalid_return_type:n="Invalid function return type";break;case ue.invalid_date:n="Invalid date";break;case ue.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:it.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case ue.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case ue.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case ue.custom:n="Invalid input";break;case ue.invalid_intersection_types:n="Intersection results could not be merged";break;case ue.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case ue.not_finite:n="Number must be finite";break;default:n=e.defaultError,it.assertNever(t)}return{message:n}};let iR=Fc;function K6(t){iR=t}function Eh(){return iR}const xh=t=>{const{data:e,path:n,errorMaps:r,issueData:i}=t,s=[...n,...i.path||[]],o={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let a="";const c=r.filter(l=>!!l).slice().reverse();for(const l of c)a=l(o,{data:e,defaultError:a}).message;return{...i,path:s,message:a}},G6=[];function ve(t,e){const n=Eh(),r=xh({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Fc?void 0:Fc].filter(i=>!!i)});t.common.issues.push(r)}class qn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const i of n){if(i.status==="aborted")return Be;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const i of n){const s=await i.key,o=await i.value;r.push({key:s,value:o})}return qn.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return Be;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[s.value]=o.value)}return{status:e.value,value:r}}}const Be=Object.freeze({status:"aborted"}),ic=t=>({status:"dirty",value:t}),rr=t=>({status:"valid",value:t}),nm=t=>t.status==="aborted",rm=t=>t.status==="dirty",ku=t=>t.status==="valid",Ru=t=>typeof Promise<"u"&&t instanceof Promise;function Sh(t,e,n,r){if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function sR(t,e,n,r,i){if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}var Ne;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Ne||(Ne={}));var Dl,Pl;class ji{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const kb=(t,e)=>{if(ku(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Or(t.common.issues);return this._error=n,this._error}}};function Ve(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,a)=>{var c,l;const{message:u}=t;return o.code==="invalid_enum_value"?{message:u??a.defaultError}:typeof a.data>"u"?{message:(c=u??r)!==null&&c!==void 0?c:a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:(l=u??n)!==null&&l!==void 0?l:a.defaultError}},description:i}}class qe{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Zs(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Zs(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new qn,ctx:{common:e.parent.common,data:e.data,parsedType:Zs(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Ru(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Zs(e)},s=this._parseSync({data:e,path:i.path,parent:i});return kb(i,s)}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Zs(e)},i=this._parse({data:e,path:r.path,parent:r}),s=await(Ru(i)?i:Promise.resolve(i));return kb(r,s)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,s)=>{const o=e(i),a=()=>s.addIssue({code:ue.custom,...r(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new mi({schema:this,typeName:Le.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Li.create(this,this._def)}nullable(){return Io.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return di.create(this,this._def)}promise(){return Hc.create(this,this._def)}or(e){return Ou.create([this,e],this._def)}and(e){return Cu.create(this,e,this._def)}transform(e){return new mi({...Ve(this._def),schema:this,typeName:Le.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new zu({...Ve(this._def),innerType:this,defaultValue:n,typeName:Le.ZodDefault})}brand(){return new A_({typeName:Le.ZodBranded,type:this,...Ve(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new ju({...Ve(this._def),innerType:this,catchValue:n,typeName:Le.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return gd.create(this,e)}readonly(){return Uu.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Y6=/^c[^\s-]{8,}$/i,q6=/^[0-9a-z]+$/,Q6=/^[0-9A-HJKMNP-TV-Z]{26}$/,X6=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,J6=/^[a-z0-9_-]{21}$/i,ej=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,tj=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,nj="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let fg;const rj=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ij=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,sj=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,oR="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",oj=new RegExp(`^${oR}$`);function aR(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function aj(t){return new RegExp(`^${aR(t)}$`)}function cR(t){let e=`${oR}T${aR(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function cj(t,e){return!!((e==="v4"||!e)&&rj.test(t)||(e==="v6"||!e)&&ij.test(t))}class oi extends qe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Ee.string){const s=this._getOrReturnCtx(e);return ve(s,{code:ue.invalid_type,expected:Ee.string,received:s.parsedType}),Be}const r=new qn;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),ve(i,{code:ue.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),ve(i,{code:ue.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const o=e.data.length>s.value,a=e.data.length<s.value;(o||a)&&(i=this._getOrReturnCtx(e,i),o?ve(i,{code:ue.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&ve(i,{code:ue.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")tj.test(e.data)||(i=this._getOrReturnCtx(e,i),ve(i,{validation:"email",code:ue.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")fg||(fg=new RegExp(nj,"u")),fg.test(e.data)||(i=this._getOrReturnCtx(e,i),ve(i,{validation:"emoji",code:ue.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")X6.test(e.data)||(i=this._getOrReturnCtx(e,i),ve(i,{validation:"uuid",code:ue.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")J6.test(e.data)||(i=this._getOrReturnCtx(e,i),ve(i,{validation:"nanoid",code:ue.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")Y6.test(e.data)||(i=this._getOrReturnCtx(e,i),ve(i,{validation:"cuid",code:ue.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")q6.test(e.data)||(i=this._getOrReturnCtx(e,i),ve(i,{validation:"cuid2",code:ue.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")Q6.test(e.data)||(i=this._getOrReturnCtx(e,i),ve(i,{validation:"ulid",code:ue.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),ve(i,{validation:"url",code:ue.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),ve(i,{validation:"regex",code:ue.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),ve(i,{code:ue.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),ve(i,{code:ue.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),ve(i,{code:ue.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?cR(s).test(e.data)||(i=this._getOrReturnCtx(e,i),ve(i,{code:ue.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?oj.test(e.data)||(i=this._getOrReturnCtx(e,i),ve(i,{code:ue.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?aj(s).test(e.data)||(i=this._getOrReturnCtx(e,i),ve(i,{code:ue.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?ej.test(e.data)||(i=this._getOrReturnCtx(e,i),ve(i,{validation:"duration",code:ue.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?cj(e.data,s.version)||(i=this._getOrReturnCtx(e,i),ve(i,{validation:"ip",code:ue.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?sj.test(e.data)||(i=this._getOrReturnCtx(e,i),ve(i,{validation:"base64",code:ue.invalid_string,message:s.message}),r.dirty()):it.assertNever(s);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:ue.invalid_string,...Ne.errToObj(r)})}_addCheck(e){return new oi({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ne.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ne.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Ne.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ne.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Ne.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ne.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Ne.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Ne.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Ne.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Ne.errToObj(e)})}datetime(e){var n,r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(r=e==null?void 0:e.local)!==null&&r!==void 0?r:!1,...Ne.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...Ne.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...Ne.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Ne.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...Ne.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Ne.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Ne.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Ne.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Ne.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Ne.errToObj(n)})}nonempty(e){return this.min(1,Ne.errToObj(e))}trim(){return new oi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new oi({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new oi({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}oi.create=t=>{var e;return new oi({checks:[],typeName:Le.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ve(t)})};function lj(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,s=parseInt(t.toFixed(i).replace(".","")),o=parseInt(e.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}class xo extends qe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Ee.number){const s=this._getOrReturnCtx(e);return ve(s,{code:ue.invalid_type,expected:Ee.number,received:s.parsedType}),Be}let r;const i=new qn;for(const s of this._def.checks)s.kind==="int"?it.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),ve(r,{code:ue.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),ve(r,{code:ue.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),ve(r,{code:ue.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?lj(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),ve(r,{code:ue.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),ve(r,{code:ue.not_finite,message:s.message}),i.dirty()):it.assertNever(s);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Ne.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Ne.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Ne.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Ne.toString(n))}setLimit(e,n,r,i){return new xo({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Ne.toString(i)}]})}_addCheck(e){return new xo({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ne.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ne.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ne.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ne.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ne.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Ne.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Ne.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ne.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ne.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&it.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}xo.create=t=>new xo({checks:[],typeName:Le.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ve(t)});class So extends qe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==Ee.bigint){const s=this._getOrReturnCtx(e);return ve(s,{code:ue.invalid_type,expected:Ee.bigint,received:s.parsedType}),Be}let r;const i=new qn;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),ve(r,{code:ue.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),ve(r,{code:ue.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),ve(r,{code:ue.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):it.assertNever(s);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Ne.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Ne.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Ne.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Ne.toString(n))}setLimit(e,n,r,i){return new So({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Ne.toString(i)}]})}_addCheck(e){return new So({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ne.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ne.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ne.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ne.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Ne.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}So.create=t=>{var e;return new So({checks:[],typeName:Le.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ve(t)})};class Nu extends qe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Ee.boolean){const r=this._getOrReturnCtx(e);return ve(r,{code:ue.invalid_type,expected:Ee.boolean,received:r.parsedType}),Be}return rr(e.data)}}Nu.create=t=>new Nu({typeName:Le.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ve(t)});class _a extends qe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Ee.date){const s=this._getOrReturnCtx(e);return ve(s,{code:ue.invalid_type,expected:Ee.date,received:s.parsedType}),Be}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return ve(s,{code:ue.invalid_date}),Be}const r=new qn;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),ve(i,{code:ue.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),ve(i,{code:ue.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):it.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new _a({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Ne.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Ne.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}_a.create=t=>new _a({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:Le.ZodDate,...Ve(t)});class Ah extends qe{_parse(e){if(this._getType(e)!==Ee.symbol){const r=this._getOrReturnCtx(e);return ve(r,{code:ue.invalid_type,expected:Ee.symbol,received:r.parsedType}),Be}return rr(e.data)}}Ah.create=t=>new Ah({typeName:Le.ZodSymbol,...Ve(t)});class Tu extends qe{_parse(e){if(this._getType(e)!==Ee.undefined){const r=this._getOrReturnCtx(e);return ve(r,{code:ue.invalid_type,expected:Ee.undefined,received:r.parsedType}),Be}return rr(e.data)}}Tu.create=t=>new Tu({typeName:Le.ZodUndefined,...Ve(t)});class Mu extends qe{_parse(e){if(this._getType(e)!==Ee.null){const r=this._getOrReturnCtx(e);return ve(r,{code:ue.invalid_type,expected:Ee.null,received:r.parsedType}),Be}return rr(e.data)}}Mu.create=t=>new Mu({typeName:Le.ZodNull,...Ve(t)});class Wc extends qe{constructor(){super(...arguments),this._any=!0}_parse(e){return rr(e.data)}}Wc.create=t=>new Wc({typeName:Le.ZodAny,...Ve(t)});class aa extends qe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return rr(e.data)}}aa.create=t=>new aa({typeName:Le.ZodUnknown,...Ve(t)});class Rs extends qe{_parse(e){const n=this._getOrReturnCtx(e);return ve(n,{code:ue.invalid_type,expected:Ee.never,received:n.parsedType}),Be}}Rs.create=t=>new Rs({typeName:Le.ZodNever,...Ve(t)});class Ih extends qe{_parse(e){if(this._getType(e)!==Ee.undefined){const r=this._getOrReturnCtx(e);return ve(r,{code:ue.invalid_type,expected:Ee.void,received:r.parsedType}),Be}return rr(e.data)}}Ih.create=t=>new Ih({typeName:Le.ZodVoid,...Ve(t)});class di extends qe{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==Ee.array)return ve(n,{code:ue.invalid_type,expected:Ee.array,received:n.parsedType}),Be;if(i.exactLength!==null){const o=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(o||a)&&(ve(n,{code:o?ue.too_big:ue.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(ve(n,{code:ue.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(ve(n,{code:ue.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,a)=>i.type._parseAsync(new ji(n,o,n.path,a)))).then(o=>qn.mergeArray(r,o));const s=[...n.data].map((o,a)=>i.type._parseSync(new ji(n,o,n.path,a)));return qn.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new di({...this._def,minLength:{value:e,message:Ne.toString(n)}})}max(e,n){return new di({...this._def,maxLength:{value:e,message:Ne.toString(n)}})}length(e,n){return new di({...this._def,exactLength:{value:e,message:Ne.toString(n)}})}nonempty(e){return this.min(1,e)}}di.create=(t,e)=>new di({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Le.ZodArray,...Ve(e)});function Ua(t){if(t instanceof Dt){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=Li.create(Ua(r))}return new Dt({...t._def,shape:()=>e})}else return t instanceof di?new di({...t._def,type:Ua(t.element)}):t instanceof Li?Li.create(Ua(t.unwrap())):t instanceof Io?Io.create(Ua(t.unwrap())):t instanceof Ui?Ui.create(t.items.map(e=>Ua(e))):t}class Dt extends qe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=it.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==Ee.object){const l=this._getOrReturnCtx(e);return ve(l,{code:ue.invalid_type,expected:Ee.object,received:l.parsedType}),Be}const{status:r,ctx:i}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof Rs&&this._def.unknownKeys==="strip"))for(const l in i.data)o.includes(l)||a.push(l);const c=[];for(const l of o){const u=s[l],f=i.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new ji(i,f,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof Rs){const l=this._def.unknownKeys;if(l==="passthrough")for(const u of a)c.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(l==="strict")a.length>0&&(ve(i,{code:ue.unrecognized_keys,keys:a}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const u of a){const f=i.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new ji(i,f,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const l=[];for(const u of c){const f=await u.key,g=await u.value;l.push({key:f,value:g,alwaysSet:u.alwaysSet})}return l}).then(l=>qn.mergeObjectSync(r,l)):qn.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return Ne.errToObj,new Dt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,s,o,a;const c=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,n,r).message)!==null&&o!==void 0?o:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=Ne.errToObj(e).message)!==null&&a!==void 0?a:c}:{message:c}}}:{}})}strip(){return new Dt({...this._def,unknownKeys:"strip"})}passthrough(){return new Dt({...this._def,unknownKeys:"passthrough"})}extend(e){return new Dt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Dt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Le.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Dt({...this._def,catchall:e})}pick(e){const n={};return it.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Dt({...this._def,shape:()=>n})}omit(e){const n={};return it.objectKeys(this.shape).forEach(r=>{e[r]||(n[r]=this.shape[r])}),new Dt({...this._def,shape:()=>n})}deepPartial(){return Ua(this)}partial(e){const n={};return it.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}),new Dt({...this._def,shape:()=>n})}required(e){const n={};return it.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Li;)s=s._def.innerType;n[r]=s}}),new Dt({...this._def,shape:()=>n})}keyof(){return lR(it.objectKeys(this.shape))}}Dt.create=(t,e)=>new Dt({shape:()=>t,unknownKeys:"strip",catchall:Rs.create(),typeName:Le.ZodObject,...Ve(e)});Dt.strictCreate=(t,e)=>new Dt({shape:()=>t,unknownKeys:"strict",catchall:Rs.create(),typeName:Le.ZodObject,...Ve(e)});Dt.lazycreate=(t,e)=>new Dt({shape:t,unknownKeys:"strip",catchall:Rs.create(),typeName:Le.ZodObject,...Ve(e)});class Ou extends qe{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function i(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(a=>new Or(a.ctx.common.issues));return ve(n,{code:ue.invalid_union,unionErrors:o}),Be}if(n.common.async)return Promise.all(r.map(async s=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(i);{let s;const o=[];for(const c of r){const l={...n,common:{...n.common,issues:[]},parent:null},u=c._parseSync({data:n.data,path:n.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!s&&(s={result:u,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(c=>new Or(c));return ve(n,{code:ue.invalid_union,unionErrors:a}),Be}}get options(){return this._def.options}}Ou.create=(t,e)=>new Ou({options:t,typeName:Le.ZodUnion,...Ve(e)});const Xi=t=>t instanceof Du?Xi(t.schema):t instanceof mi?Xi(t.innerType()):t instanceof Pu?[t.value]:t instanceof Ao?t.options:t instanceof Bu?it.objectValues(t.enum):t instanceof zu?Xi(t._def.innerType):t instanceof Tu?[void 0]:t instanceof Mu?[null]:t instanceof Li?[void 0,...Xi(t.unwrap())]:t instanceof Io?[null,...Xi(t.unwrap())]:t instanceof A_||t instanceof Uu?Xi(t.unwrap()):t instanceof ju?Xi(t._def.innerType):[];class Op extends qe{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Ee.object)return ve(n,{code:ue.invalid_type,expected:Ee.object,received:n.parsedType}),Be;const r=this.discriminator,i=n.data[r],s=this.optionsMap.get(i);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(ve(n,{code:ue.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Be)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const i=new Map;for(const s of n){const o=Xi(s.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of o){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,s)}}return new Op({typeName:Le.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Ve(r)})}}function im(t,e){const n=Zs(t),r=Zs(e);if(t===e)return{valid:!0,data:t};if(n===Ee.object&&r===Ee.object){const i=it.objectKeys(e),s=it.objectKeys(t).filter(a=>i.indexOf(a)!==-1),o={...t,...e};for(const a of s){const c=im(t[a],e[a]);if(!c.valid)return{valid:!1};o[a]=c.data}return{valid:!0,data:o}}else if(n===Ee.array&&r===Ee.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let s=0;s<t.length;s++){const o=t[s],a=e[s],c=im(o,a);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return n===Ee.date&&r===Ee.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Cu extends qe{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=(s,o)=>{if(nm(s)||nm(o))return Be;const a=im(s.value,o.value);return a.valid?((rm(s)||rm(o))&&n.dirty(),{status:n.value,value:a.data}):(ve(r,{code:ue.invalid_intersection_types}),Be)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Cu.create=(t,e,n)=>new Cu({left:t,right:e,typeName:Le.ZodIntersection,...Ve(n)});class Ui extends qe{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ee.array)return ve(r,{code:ue.invalid_type,expected:Ee.array,received:r.parsedType}),Be;if(r.data.length<this._def.items.length)return ve(r,{code:ue.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Be;!this._def.rest&&r.data.length>this._def.items.length&&(ve(r,{code:ue.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((o,a)=>{const c=this._def.items[a]||this._def.rest;return c?c._parse(new ji(r,o,r.path,a)):null}).filter(o=>!!o);return r.common.async?Promise.all(s).then(o=>qn.mergeArray(n,o)):qn.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new Ui({...this._def,rest:e})}}Ui.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ui({items:t,typeName:Le.ZodTuple,rest:null,...Ve(e)})};class Lu extends qe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ee.object)return ve(r,{code:ue.invalid_type,expected:Ee.object,received:r.parsedType}),Be;const i=[],s=this._def.keyType,o=this._def.valueType;for(const a in r.data)i.push({key:s._parse(new ji(r,a,r.path,a)),value:o._parse(new ji(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?qn.mergeObjectAsync(n,i):qn.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof qe?new Lu({keyType:e,valueType:n,typeName:Le.ZodRecord,...Ve(r)}):new Lu({keyType:oi.create(),valueType:e,typeName:Le.ZodRecord,...Ve(n)})}}class kh extends qe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ee.map)return ve(r,{code:ue.invalid_type,expected:Ee.map,received:r.parsedType}),Be;const i=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([a,c],l)=>({key:i._parse(new ji(r,a,r.path,[l,"key"])),value:s._parse(new ji(r,c,r.path,[l,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const c of o){const l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return Be;(l.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(l.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const c of o){const l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return Be;(l.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(l.value,u.value)}return{status:n.value,value:a}}}}kh.create=(t,e,n)=>new kh({valueType:e,keyType:t,typeName:Le.ZodMap,...Ve(n)});class va extends qe{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ee.set)return ve(r,{code:ue.invalid_type,expected:Ee.set,received:r.parsedType}),Be;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(ve(r,{code:ue.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(ve(r,{code:ue.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const s=this._def.valueType;function o(c){const l=new Set;for(const u of c){if(u.status==="aborted")return Be;u.status==="dirty"&&n.dirty(),l.add(u.value)}return{status:n.value,value:l}}const a=[...r.data.values()].map((c,l)=>s._parse(new ji(r,c,r.path,l)));return r.common.async?Promise.all(a).then(c=>o(c)):o(a)}min(e,n){return new va({...this._def,minSize:{value:e,message:Ne.toString(n)}})}max(e,n){return new va({...this._def,maxSize:{value:e,message:Ne.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}va.create=(t,e)=>new va({valueType:t,minSize:null,maxSize:null,typeName:Le.ZodSet,...Ve(e)});class vc extends qe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Ee.function)return ve(n,{code:ue.invalid_type,expected:Ee.function,received:n.parsedType}),Be;function r(a,c){return xh({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Eh(),Fc].filter(l=>!!l),issueData:{code:ue.invalid_arguments,argumentsError:c}})}function i(a,c){return xh({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Eh(),Fc].filter(l=>!!l),issueData:{code:ue.invalid_return_type,returnTypeError:c}})}const s={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof Hc){const a=this;return rr(async function(...c){const l=new Or([]),u=await a._def.args.parseAsync(c,s).catch(p=>{throw l.addIssue(r(c,p)),l}),f=await Reflect.apply(o,this,u);return await a._def.returns._def.type.parseAsync(f,s).catch(p=>{throw l.addIssue(i(f,p)),l})})}else{const a=this;return rr(function(...c){const l=a._def.args.safeParse(c,s);if(!l.success)throw new Or([r(c,l.error)]);const u=Reflect.apply(o,this,l.data),f=a._def.returns.safeParse(u,s);if(!f.success)throw new Or([i(u,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new vc({...this._def,args:Ui.create(e).rest(aa.create())})}returns(e){return new vc({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new vc({args:e||Ui.create([]).rest(aa.create()),returns:n||aa.create(),typeName:Le.ZodFunction,...Ve(r)})}}class Du extends qe{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Du.create=(t,e)=>new Du({getter:t,typeName:Le.ZodLazy,...Ve(e)});class Pu extends qe{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ve(n,{received:n.data,code:ue.invalid_literal,expected:this._def.value}),Be}return{status:"valid",value:e.data}}get value(){return this._def.value}}Pu.create=(t,e)=>new Pu({value:t,typeName:Le.ZodLiteral,...Ve(e)});function lR(t,e){return new Ao({values:t,typeName:Le.ZodEnum,...Ve(e)})}class Ao extends qe{constructor(){super(...arguments),Dl.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return ve(n,{expected:it.joinValues(r),received:n.parsedType,code:ue.invalid_type}),Be}if(Sh(this,Dl)||sR(this,Dl,new Set(this._def.values)),!Sh(this,Dl).has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return ve(n,{received:n.data,code:ue.invalid_enum_value,options:r}),Be}return rr(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return Ao.create(e,{...this._def,...n})}exclude(e,n=this._def){return Ao.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}Dl=new WeakMap;Ao.create=lR;class Bu extends qe{constructor(){super(...arguments),Pl.set(this,void 0)}_parse(e){const n=it.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Ee.string&&r.parsedType!==Ee.number){const i=it.objectValues(n);return ve(r,{expected:it.joinValues(i),received:r.parsedType,code:ue.invalid_type}),Be}if(Sh(this,Pl)||sR(this,Pl,new Set(it.getValidEnumValues(this._def.values))),!Sh(this,Pl).has(e.data)){const i=it.objectValues(n);return ve(r,{received:r.data,code:ue.invalid_enum_value,options:i}),Be}return rr(e.data)}get enum(){return this._def.values}}Pl=new WeakMap;Bu.create=(t,e)=>new Bu({values:t,typeName:Le.ZodNativeEnum,...Ve(e)});class Hc extends qe{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Ee.promise&&n.common.async===!1)return ve(n,{code:ue.invalid_type,expected:Ee.promise,received:n.parsedType}),Be;const r=n.parsedType===Ee.promise?n.data:Promise.resolve(n.data);return rr(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Hc.create=(t,e)=>new Hc({type:t,typeName:Le.ZodPromise,...Ve(e)});class mi extends qe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Le.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:o=>{ve(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const o=i.transform(r.data,s);if(r.common.async)return Promise.resolve(o).then(async a=>{if(n.value==="aborted")return Be;const c=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return c.status==="aborted"?Be:c.status==="dirty"||n.value==="dirty"?ic(c.value):c});{if(n.value==="aborted")return Be;const a=this._def.schema._parseSync({data:o,path:r.path,parent:r});return a.status==="aborted"?Be:a.status==="dirty"||n.value==="dirty"?ic(a.value):a}}if(i.type==="refinement"){const o=a=>{const c=i.refinement(a,s);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Be:(a.status==="dirty"&&n.dirty(),o(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?Be:(a.status==="dirty"&&n.dirty(),o(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ku(o))return o;const a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>ku(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:n.value,value:a})):o);it.assertNever(i)}}mi.create=(t,e,n)=>new mi({schema:t,typeName:Le.ZodEffects,effect:e,...Ve(n)});mi.createWithPreprocess=(t,e,n)=>new mi({schema:e,effect:{type:"preprocess",transform:t},typeName:Le.ZodEffects,...Ve(n)});class Li extends qe{_parse(e){return this._getType(e)===Ee.undefined?rr(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Li.create=(t,e)=>new Li({innerType:t,typeName:Le.ZodOptional,...Ve(e)});class Io extends qe{_parse(e){return this._getType(e)===Ee.null?rr(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Io.create=(t,e)=>new Io({innerType:t,typeName:Le.ZodNullable,...Ve(e)});class zu extends qe{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===Ee.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}zu.create=(t,e)=>new zu({innerType:t,typeName:Le.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ve(e)});class ju extends qe{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Ru(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Or(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Or(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ju.create=(t,e)=>new ju({innerType:t,typeName:Le.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ve(e)});class Rh extends qe{_parse(e){if(this._getType(e)!==Ee.nan){const r=this._getOrReturnCtx(e);return ve(r,{code:ue.invalid_type,expected:Ee.nan,received:r.parsedType}),Be}return{status:"valid",value:e.data}}}Rh.create=t=>new Rh({typeName:Le.ZodNaN,...Ve(t)});const uj=Symbol("zod_brand");class A_ extends qe{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class gd extends qe{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Be:s.status==="dirty"?(n.dirty(),ic(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Be:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new gd({in:e,out:n,typeName:Le.ZodPipeline})}}class Uu extends qe{_parse(e){const n=this._def.innerType._parse(e),r=i=>(ku(i)&&(i.value=Object.freeze(i.value)),i);return Ru(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}Uu.create=(t,e)=>new Uu({innerType:t,typeName:Le.ZodReadonly,...Ve(e)});function uR(t,e={},n){return t?Wc.create().superRefine((r,i)=>{var s,o;if(!t(r)){const a=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,c=(o=(s=a.fatal)!==null&&s!==void 0?s:n)!==null&&o!==void 0?o:!0,l=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...l,fatal:c})}}):Wc.create()}const dj={object:Dt.lazycreate};var Le;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Le||(Le={}));const fj=(t,e={message:`Input not instance of ${t.name}`})=>uR(n=>n instanceof t,e),dR=oi.create,fR=xo.create,hj=Rh.create,pj=So.create,hR=Nu.create,gj=_a.create,yj=Ah.create,mj=Tu.create,wj=Mu.create,_j=Wc.create,vj=aa.create,bj=Rs.create,Ej=Ih.create,xj=di.create,Sj=Dt.create,Aj=Dt.strictCreate,Ij=Ou.create,kj=Op.create,Rj=Cu.create,Nj=Ui.create,Tj=Lu.create,Mj=kh.create,Oj=va.create,Cj=vc.create,Lj=Du.create,Dj=Pu.create,Pj=Ao.create,Bj=Bu.create,zj=Hc.create,Rb=mi.create,jj=Li.create,Uj=Io.create,Fj=mi.createWithPreprocess,Wj=gd.create,Hj=()=>dR().optional(),$j=()=>fR().optional(),Vj=()=>hR().optional(),Zj={string:t=>oi.create({...t,coerce:!0}),number:t=>xo.create({...t,coerce:!0}),boolean:t=>Nu.create({...t,coerce:!0}),bigint:t=>So.create({...t,coerce:!0}),date:t=>_a.create({...t,coerce:!0})},Kj=Be;var Nh=Object.freeze({__proto__:null,defaultErrorMap:Fc,setErrorMap:K6,getErrorMap:Eh,makeIssue:xh,EMPTY_PATH:G6,addIssueToContext:ve,ParseStatus:qn,INVALID:Be,DIRTY:ic,OK:rr,isAborted:nm,isDirty:rm,isValid:ku,isAsync:Ru,get util(){return it},get objectUtil(){return tm},ZodParsedType:Ee,getParsedType:Zs,ZodType:qe,datetimeRegex:cR,ZodString:oi,ZodNumber:xo,ZodBigInt:So,ZodBoolean:Nu,ZodDate:_a,ZodSymbol:Ah,ZodUndefined:Tu,ZodNull:Mu,ZodAny:Wc,ZodUnknown:aa,ZodNever:Rs,ZodVoid:Ih,ZodArray:di,ZodObject:Dt,ZodUnion:Ou,ZodDiscriminatedUnion:Op,ZodIntersection:Cu,ZodTuple:Ui,ZodRecord:Lu,ZodMap:kh,ZodSet:va,ZodFunction:vc,ZodLazy:Du,ZodLiteral:Pu,ZodEnum:Ao,ZodNativeEnum:Bu,ZodPromise:Hc,ZodEffects:mi,ZodTransformer:mi,ZodOptional:Li,ZodNullable:Io,ZodDefault:zu,ZodCatch:ju,ZodNaN:Rh,BRAND:uj,ZodBranded:A_,ZodPipeline:gd,ZodReadonly:Uu,custom:uR,Schema:qe,ZodSchema:qe,late:dj,get ZodFirstPartyTypeKind(){return Le},coerce:Zj,any:_j,array:xj,bigint:pj,boolean:hR,date:gj,discriminatedUnion:kj,effect:Rb,enum:Pj,function:Cj,instanceof:fj,intersection:Rj,lazy:Lj,literal:Dj,map:Mj,nan:hj,nativeEnum:Bj,never:bj,null:wj,nullable:Uj,number:fR,object:Sj,oboolean:Vj,onumber:$j,optional:jj,ostring:Hj,pipeline:Wj,preprocess:Fj,promise:zj,record:Tj,set:Oj,strictObject:Aj,string:dR,symbol:yj,transformer:Rb,tuple:Nj,undefined:mj,union:Ij,unknown:vj,void:Ej,NEVER:Kj,ZodIssueCode:ue,quotelessJson:Z6,ZodError:Or});const Gj=new Jw("https://devnet.helius-rpc.com/?api-key=6244a448-5327-4ff4-aa0c-a613411ead97"),Yj=Nh.object({chatroom:Nh.string().min(1,{message:"Chatroom address cannot be empty."}).refine(async t=>{try{return!!await Gj.getBalance(new ie(t))}catch(e){return console.error(e),!1}},{message:"Invalid PDA."})}),qj=Nh.object({message:Nh.string().min(1,{message:"Message cannot be empty."}).max(256,{message:"Message cannot exceed 256 characters."})}),Nb=(t,e,n)=>{if(t&&"reportValidity"in t){const r=ge(n,e);t.setCustomValidity(r&&r.message||""),t.reportValidity()}},pR=(t,e)=>{for(const n in e.fields){const r=e.fields[n];r&&r.ref&&"reportValidity"in r.ref?Nb(r.ref,n,t):r.refs&&r.refs.forEach(i=>Nb(i,n,t))}},Qj=(t,e)=>{e.shouldUseNativeValidation&&pR(t,e);const n={};for(const r in t){const i=ge(e.fields,r),s=Object.assign(t[r]||{},{ref:i&&i.ref});if(Xj(e.names||Object.keys(t),r)){const o=Object.assign({},ge(n,r));pt(o,"root",s),pt(n,r,o)}else pt(n,r,s)}return n},Xj=(t,e)=>t.some(n=>n.startsWith(e+"."));var Jj=function(t,e){for(var n={};t.length;){var r=t[0],i=r.code,s=r.message,o=r.path.join(".");if(!n[o])if("unionErrors"in r){var a=r.unionErrors[0].errors[0];n[o]={message:a.message,type:a.code}}else n[o]={message:s,type:i};if("unionErrors"in r&&r.unionErrors.forEach(function(u){return u.errors.forEach(function(f){return t.push(f)})}),e){var c=n[o].types,l=c&&c[r.code];n[o]=ok(o,e,n,i,l?[].concat(l,r.message):r.message)}t.shift()}return n},gR=function(t,e,n){return n===void 0&&(n={}),function(r,i,s){try{return Promise.resolve(function(o,a){try{var c=Promise.resolve(t[n.mode==="sync"?"parse":"parseAsync"](r,e)).then(function(l){return s.shouldUseNativeValidation&&pR({},s),{errors:{},values:n.raw?r:l}})}catch(l){return a(l)}return c&&c.then?c.then(void 0,a):c}(0,function(o){if(function(a){return Array.isArray(a==null?void 0:a.errors)}(o))return{values:{},errors:Qj(Jj(o.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw o}))}catch(o){return Promise.reject(o)}}};function e5({setChatPDA:t}){const{publicKey:e}=il(),[n,r]=j.useState(window.innerWidth<640),[i,s]=j.useState(!1),o=hk({resolver:gR(Yj),defaultValues:{chatroom:""}});function a(){t(rR(e))}function c(l){t(l.chatroom),o.reset()}return j.useEffect(()=>{function l(){const u=window.innerWidth<640;r(u),u||s(!1)}return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[n]),j.useEffect(()=>{i&&o.setFocus("chatroom")},[i,o]),te.jsxs("header",{className:"flex sm:justify-between items-center gap-x-2 sm:gap-x-4 pt-4 text-primary h-[80px]",children:[!i&&te.jsxs(lo,{variant:"ghost",className:"hover:bg-transparent hover:text-primary text-primary flex gap-x-3 items-center pl-0 mr-auto",onClick:a,children:[te.jsx(H6,{size:32}),te.jsx("p",{className:"text-3xl font-semibold hidden sm:block",children:"Mess"})]}),e&&(n?i?te.jsxs(te.Fragment,{children:[te.jsx(lo,{variant:"ghost",size:"icon",className:"hover:bg-transparent hover:text-primary text-primary flex gap-x-3",onClick:()=>s(!1),children:te.jsx(U6,{size:20})}),te.jsx(Tb,{joinChatroom:c,searchForm:o})]}):te.jsxs(lo,{variant:"ghost",size:"icon",className:"hover:bg-transparent hover:text-primary text-primary flex gap-x-3",onClick:()=>s(!0),children:[te.jsx(nR,{size:20}),te.jsx("p",{className:"text-3xl font-semibold hidden md:block",children:"Mess"})]}):te.jsx(Tb,{joinChatroom:c,searchForm:o})),!i&&te.jsx(OB,{})]})}function t5({program:t,chatPDA:e,isLoadingChat:n,setIsLoadingChat:r}){const{publicKey:i,connecting:s,sendTransaction:o}=il(),{connection:a}=i_(),[c,l]=j.useState(!1),[u,f]=j.useState([]),[g,p]=j.useState([]),[_,A]=j.useState(!1),[S,E]=j.useState(!1),b=j.useRef(null),x=hk({resolver:gR(qj),defaultValues:{message:""}});function M(){!_&&e&&(navigator.clipboard.writeText(e.toString()),A(!0),setTimeout(()=>A(!1),3e3))}async function L(){if(t&&e&&i){E(!0);try{const D=await t.methods.init().accountsPartial({chat:e,payer:i}).instruction(),F=await o(new Je().add(D),a),{blockhash:$,lastValidBlockHeight:V}=await a.getLatestBlockhash();await a.confirmTransaction({signature:F,blockhash:$,lastValidBlockHeight:V}),l(!0)}catch(D){console.error(D)}E(!1)}}async function z(D){var F;if(t&&e&&i)try{const $=await t.methods.send(D.message).accounts({chat:e,sender:i}).instruction(),V=await o(new Je().add($),a),{blockhash:G,lastValidBlockHeight:W}=await a.getLatestBlockhash();await a.confirmTransaction({signature:V,blockhash:G,lastValidBlockHeight:W}),f([...u,{sender:i,text:D.message}]),x.reset(),x.setFocus("message"),(F=b.current)==null||F.scrollTo({top:b.current.scrollHeight,behavior:"smooth"})}catch($){console.error($)}}return j.useEffect(()=>{async function D(){if(t&&e){r(!0);try{const{messages:F}=await t.account.chat.fetch(e);f(F),l(!0)}catch(F){console.error(F),f([]),l(!1)}r(!1)}}D()},[t,e,r]),j.useEffect(()=>{async function D(){if(t&&e)try{const F=[];let $="",V=[];u.forEach(({sender:G,text:W},N)=>{$===G.toBase58()?V.push(W):(V.length&&F.push({sender:$,texts:V}),$=G.toBase58(),V=[W]),N===u.length-1&&F.push({sender:$,texts:V})}),p(F)}catch(F){console.error(F),p([])}}D()},[t,e,u]),j.useEffect(()=>{var D;g.length&&((D=b.current)==null||D.scrollTo({top:b.current.scrollHeight,behavior:"smooth"}))},[g]),j.useEffect(()=>{let D=null;async function F(){t&&e&&(D=a.onAccountChange(new ie(e),async()=>{try{const{messages:$}=await t.account.chat.fetch(e);f($),$.length>=20&&a.removeAccountChangeListener(D)}catch($){console.error($),f([])}}))}return F(),()=>{D&&a.removeAccountChangeListener(D)}},[t,e,a]),j.useEffect(()=>{e&&c?document.title=`Mess | ${dg(e)}`:document.title="Mess"},[e,c]),te.jsxs(te.Fragment,{children:[te.jsx("main",{className:"flex flex-col gap-y-2 justify-center items-center grow h-full",children:s?te.jsx(Qd,{content:"Connecting..."}):i?n?te.jsx(n5,{}):e&&c?te.jsxs(te.Fragment,{children:[te.jsxs("div",{className:"w-full flex gap-x-2 items-center",children:[te.jsxs("h2",{className:"text-2xl sm:text-3xl text-primary font-semibold",children:["Chatroom : ",dg(e)]}),te.jsx(lo,{variant:"ghost",size:"icon",onClick:M,className:"aspect-square bg-transparent hover:bg-transparent",children:_?te.jsx(F6,{className:"text-green-500 hover:text-green-500",size:20}):te.jsx(W6,{className:"text-primary hover:text-primary",size:20})})]}),te.jsx("section",{className:`flex flex-col gap-y-2 items-center w-full overflow-y-auto grow h-0 ${u.length?"justify-start":"justify-center"}`,ref:b,children:u.length?g.map(({sender:D,texts:F},$)=>{const V=D===i.toBase58();return te.jsxs("div",{className:`w-fit max-w-[200px] sm:max-w-[400px] p-2 bg-primary-foreground flex flex-col gap-y-2 rounded-lg break-words + ${V?"self-end items-end bg-accent text-primary rounded-br-none mr-4":"self-start items-start bg-primary-foreground text-tertiary rounded-bl-none"}`,children:[F.map((G,W)=>te.jsx("p",{className:"max-w-full",children:G},W)),!V&&te.jsx(D6,{children:te.jsxs(P6,{children:[te.jsx(Yk,{asChild:!0,children:te.jsx("p",{className:"text-[0.6rem]",children:dg(D)})}),te.jsx(eR,{children:D})]})})]},$)}):te.jsx(Qd,{content:"No messages sent."})})]}):te.jsxs("div",{className:"flex flex-col items-center gap-y-3",children:[te.jsx(Qd,{content:"You don't own a chatroom."}),te.jsxs(lo,{className:"w-fit hover:bg-tertiary font-semibold flex gap-x-2 items-center",onClick:L,disabled:S,children:[S?te.jsx(em,{size:16,className:"animate-spin"}):te.jsx($6,{size:16}),"Create Chatroom"]})]}):te.jsx(Qd,{content:"Connect Your Wallet"})}),i&&c&&!n&&te.jsx(mk,{...x,children:te.jsxs("form",{className:"flex w-full gap-x-2 pb-4",onSubmit:x.handleSubmit(z),children:[te.jsx(_k,{control:x.control,name:"message",render:({field:D})=>te.jsx(p_,{className:"w-full",children:te.jsx(g_,{children:te.jsx(c_,{placeholder:u.length>=20?"Maximum chat length reached":"Type a message",...D,disabled:x.formState.isSubmitting||u.length>=20})})})}),te.jsx(lo,{className:"hover:bg-tertiary p-2 aspect-square",size:"icon",type:"submit",disabled:x.formState.isSubmitting||u.length>=20,children:x.formState.isSubmitting?te.jsx(em,{size:20,className:"animate-spin"}):te.jsx(V6,{size:20})})]})})]})}function n5(){return te.jsx(em,{className:"aspect-square h-[25%] w-[25%] animate-spin text-primary opacity-25"})}function Qd({content:t}){return te.jsx("p",{className:"text-2xl text-center font-semibold text-primary",children:t})}function Tb({joinChatroom:t,searchForm:e}){return te.jsx(mk,{...e,children:te.jsxs("form",{className:"flex gap-x-2 sm:ml-auto w-full sm:w-auto",onSubmit:e.handleSubmit(t),children:[te.jsx(_k,{control:e.control,name:"chatroom",render:({field:n})=>te.jsx(p_,{className:"w-full sm:w-[200px]",children:te.jsx(g_,{children:te.jsx(c_,{placeholder:"Enter chatroom address",...n,disabled:e.formState.isSubmitting,className:"text-black"})})})}),te.jsx(lo,{className:"hover:bg-tertiary p-2 aspect-square",size:"icon",type:"submit",disabled:e.formState.isSubmitting,children:te.jsx(nR,{size:20})})]})})}var I_={exports:{}};const r5=/[\p{Lu}]/u,i5=/[\p{Ll}]/u,Mb=/^[\p{Lu}](?![\p{Lu}])/gu,yR=/([\p{Alpha}\p{N}_]|$)/u,mR=/[_.\- ]+/,s5=new RegExp("^"+mR.source),Ob=new RegExp(mR.source+yR.source,"gu"),Cb=new RegExp("\\d+"+yR.source,"gu"),o5=(t,e,n)=>{let r=!1,i=!1,s=!1;for(let o=0;o<t.length;o++){const a=t[o];r&&r5.test(a)?(t=t.slice(0,o)+"-"+t.slice(o),r=!1,s=i,i=!0,o++):i&&s&&i5.test(a)?(t=t.slice(0,o-1)+"-"+t.slice(o-1),s=i,i=!1,r=!0):(r=e(a)===a&&n(a)!==a,s=i,i=n(a)===a&&e(a)!==a)}return t},a5=(t,e)=>(Mb.lastIndex=0,t.replace(Mb,n=>e(n))),c5=(t,e)=>(Ob.lastIndex=0,Cb.lastIndex=0,t.replace(Ob,(n,r)=>e(r)).replace(Cb,n=>e(n))),wR=(t,e)=>{if(!(typeof t=="string"||Array.isArray(t)))throw new TypeError("Expected the input to be `string | string[]`");if(e={pascalCase:!1,preserveConsecutiveUppercase:!1,...e},Array.isArray(t)?t=t.map(s=>s.trim()).filter(s=>s.length).join("-"):t=t.trim(),t.length===0)return"";const n=e.locale===!1?s=>s.toLowerCase():s=>s.toLocaleLowerCase(e.locale),r=e.locale===!1?s=>s.toUpperCase():s=>s.toLocaleUpperCase(e.locale);return t.length===1?e.pascalCase?r(t):n(t):(t!==n(t)&&(t=o5(t,n,r)),t=t.replace(s5,""),e.preserveConsecutiveUppercase?t=a5(t,n):t=n(t),e.pascalCase&&(t=r(t.charAt(0))+t.slice(1)),c5(t,r))};I_.exports=wR;I_.exports.default=wR;var l5=I_.exports;const u5=Ro(l5);var $e={},be={};let vt=class{constructor(e,n){if(!Number.isInteger(e))throw new TypeError("span must be an integer");this.span=e,this.property=n}makeDestinationObject(){return{}}decode(e,n){throw new Error("Layout is abstract")}encode(e,n,r){throw new Error("Layout is abstract")}getSpan(e,n){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(e){const n=Object.create(this.constructor.prototype);return Object.assign(n,this),n.property=e,n}fromArray(e){}};be.Layout=vt;function k_(t,e){return e.property?t+"["+e.property+"]":t}be.nameWithProperty=k_;function d5(t,e){if(typeof t!="function")throw new TypeError("Class must be constructor");if(t.hasOwnProperty("layout_"))throw new Error("Class is already bound to a layout");if(!(e&&e instanceof vt))throw new TypeError("layout must be a Layout");if(e.hasOwnProperty("boundConstructor_"))throw new Error("layout is already bound to a constructor");t.layout_=e,e.boundConstructor_=t,e.makeDestinationObject=()=>new t,Object.defineProperty(t.prototype,"encode",{value:function(n,r){return e.encode(this,n,r)},writable:!0}),Object.defineProperty(t,"decode",{value:function(n,r){return e.decode(n,r)},writable:!0})}be.bindConstructorLayout=d5;let pr=class extends vt{isCount(){throw new Error("ExternalLayout is abstract")}};class _R extends pr{constructor(e,n){if(e===void 0&&(e=1),!Number.isInteger(e)||0>=e)throw new TypeError("elementSpan must be a (positive) integer");super(-1,n),this.elementSpan=e}isCount(){return!0}decode(e,n){n===void 0&&(n=0);const r=e.length-n;return Math.floor(r/this.elementSpan)}encode(e,n,r){return 0}}let R_=class extends pr{constructor(e,n,r){if(!(e instanceof vt))throw new TypeError("layout must be a Layout");if(n===void 0)n=0;else if(!Number.isInteger(n))throw new TypeError("offset must be integer or undefined");super(e.span,r||e.property),this.layout=e,this.offset=n}isCount(){return this.layout instanceof Vi||this.layout instanceof Ms}decode(e,n){return n===void 0&&(n=0),this.layout.decode(e,n+this.offset)}encode(e,n,r){return r===void 0&&(r=0),this.layout.encode(e,n,r+this.offset)}},Vi=class extends vt{constructor(e,n){if(super(e,n),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,n){return n===void 0&&(n=0),e.readUIntLE(n,this.span)}encode(e,n,r){return r===void 0&&(r=0),n.writeUIntLE(e,r,this.span),this.span}},Ms=class extends vt{constructor(e,n){if(super(e,n),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,n){return n===void 0&&(n=0),e.readUIntBE(n,this.span)}encode(e,n,r){return r===void 0&&(r=0),n.writeUIntBE(e,r,this.span),this.span}};class Ta extends vt{constructor(e,n){if(super(e,n),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,n){return n===void 0&&(n=0),e.readIntLE(n,this.span)}encode(e,n,r){return r===void 0&&(r=0),n.writeIntLE(e,r,this.span),this.span}}class ll extends vt{constructor(e,n){if(super(e,n),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,n){return n===void 0&&(n=0),e.readIntBE(n,this.span)}encode(e,n,r){return r===void 0&&(r=0),n.writeIntBE(e,r,this.span),this.span}}const sm=Math.pow(2,32);function Cp(t){const e=Math.floor(t/sm),n=t-e*sm;return{hi32:e,lo32:n}}function Lp(t,e){return t*sm+e}let f5=class extends vt{constructor(e){super(8,e)}decode(e,n){n===void 0&&(n=0);const r=e.readUInt32LE(n),i=e.readUInt32LE(n+4);return Lp(i,r)}encode(e,n,r){r===void 0&&(r=0);const i=Cp(e);return n.writeUInt32LE(i.lo32,r),n.writeUInt32LE(i.hi32,r+4),8}};class h5 extends vt{constructor(e){super(8,e)}decode(e,n){n===void 0&&(n=0);const r=e.readUInt32BE(n),i=e.readUInt32BE(n+4);return Lp(r,i)}encode(e,n,r){r===void 0&&(r=0);const i=Cp(e);return n.writeUInt32BE(i.hi32,r),n.writeUInt32BE(i.lo32,r+4),8}}let p5=class extends vt{constructor(e){super(8,e)}decode(e,n){n===void 0&&(n=0);const r=e.readUInt32LE(n),i=e.readInt32LE(n+4);return Lp(i,r)}encode(e,n,r){r===void 0&&(r=0);const i=Cp(e);return n.writeUInt32LE(i.lo32,r),n.writeInt32LE(i.hi32,r+4),8}};class g5 extends vt{constructor(e){super(8,e)}decode(e,n){n===void 0&&(n=0);const r=e.readInt32BE(n),i=e.readUInt32BE(n+4);return Lp(r,i)}encode(e,n,r){r===void 0&&(r=0);const i=Cp(e);return n.writeInt32BE(i.hi32,r),n.writeUInt32BE(i.lo32,r+4),8}}class vR extends vt{constructor(e){super(4,e)}decode(e,n){return n===void 0&&(n=0),e.readFloatLE(n)}encode(e,n,r){return r===void 0&&(r=0),n.writeFloatLE(e,r),4}}class bR extends vt{constructor(e){super(4,e)}decode(e,n){return n===void 0&&(n=0),e.readFloatBE(n)}encode(e,n,r){return r===void 0&&(r=0),n.writeFloatBE(e,r),4}}class ER extends vt{constructor(e){super(8,e)}decode(e,n){return n===void 0&&(n=0),e.readDoubleLE(n)}encode(e,n,r){return r===void 0&&(r=0),n.writeDoubleLE(e,r),8}}class xR extends vt{constructor(e){super(8,e)}decode(e,n){return n===void 0&&(n=0),e.readDoubleBE(n)}encode(e,n,r){return r===void 0&&(r=0),n.writeDoubleBE(e,r),8}}class SR extends vt{constructor(e,n,r){if(!(e instanceof vt))throw new TypeError("elementLayout must be a Layout");if(!(n instanceof pr&&n.isCount()||Number.isInteger(n)&&0<=n))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let i=-1;!(n instanceof pr)&&0<e.span&&(i=n*e.span),super(i,r),this.elementLayout=e,this.count=n}getSpan(e,n){if(0<=this.span)return this.span;n===void 0&&(n=0);let r=0,i=this.count;if(i instanceof pr&&(i=i.decode(e,n)),0<this.elementLayout.span)r=i*this.elementLayout.span;else{let s=0;for(;s<i;)r+=this.elementLayout.getSpan(e,n+r),++s}return r}decode(e,n){n===void 0&&(n=0);const r=[];let i=0,s=this.count;for(s instanceof pr&&(s=s.decode(e,n));i<s;)r.push(this.elementLayout.decode(e,n)),n+=this.elementLayout.getSpan(e,n),i+=1;return r}encode(e,n,r){r===void 0&&(r=0);const i=this.elementLayout,s=e.reduce((o,a)=>o+i.encode(a,n,r+o),0);return this.count instanceof pr&&this.count.encode(e.length,n,r),s}}let AR=class extends vt{constructor(e,n,r){if(!(Array.isArray(e)&&e.reduce((s,o)=>s&&o instanceof vt,!0)))throw new TypeError("fields must be array of Layout instances");typeof n=="boolean"&&r===void 0&&(r=n,n=void 0);for(const s of e)if(0>s.span&&s.property===void 0)throw new Error("fields cannot contain unnamed variable-length layout");let i=-1;try{i=e.reduce((s,o)=>s+o.getSpan(),0)}catch{}super(i,n),this.fields=e,this.decodePrefixes=!!r}getSpan(e,n){if(0<=this.span)return this.span;n===void 0&&(n=0);let r=0;try{r=this.fields.reduce((i,s)=>{const o=s.getSpan(e,n);return n+=o,i+o},0)}catch{throw new RangeError("indeterminate span")}return r}decode(e,n){n===void 0&&(n=0);const r=this.makeDestinationObject();for(const i of this.fields)if(i.property!==void 0&&(r[i.property]=i.decode(e,n)),n+=i.getSpan(e,n),this.decodePrefixes&&e.length===n)break;return r}encode(e,n,r){r===void 0&&(r=0);const i=r;let s=0,o=0;for(const a of this.fields){let c=a.span;if(o=0<c?c:0,a.property!==void 0){const l=e[a.property];l!==void 0&&(o=a.encode(l,n,r),0>c&&(c=a.getSpan(n,r)))}s=r,r+=c}return s+o-i}fromArray(e){const n=this.makeDestinationObject();for(const r of this.fields)r.property!==void 0&&0<e.length&&(n[r.property]=e.shift());return n}layoutFor(e){if(typeof e!="string")throw new TypeError("property must be string");for(const n of this.fields)if(n.property===e)return n}offsetOf(e){if(typeof e!="string")throw new TypeError("property must be string");let n=0;for(const r of this.fields){if(r.property===e)return n;0>r.span?n=-1:0<=n&&(n+=r.span)}}},N_=class{constructor(e){this.property=e}decode(){throw new Error("UnionDiscriminator is abstract")}encode(){throw new Error("UnionDiscriminator is abstract")}},Th=class extends N_{constructor(e,n){if(!(e instanceof pr&&e.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");super(n||e.property||"variant"),this.layout=e}decode(e,n){return this.layout.decode(e,n)}encode(e,n,r){return this.layout.encode(e,n,r)}},T_=class extends vt{constructor(e,n,r){const i=e instanceof Vi||e instanceof Ms;if(i)e=new Th(new R_(e));else if(e instanceof pr&&e.isCount())e=new Th(e);else if(!(e instanceof N_))throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(n===void 0&&(n=null),!(n===null||n instanceof vt))throw new TypeError("defaultLayout must be null or a Layout");if(n!==null){if(0>n.span)throw new Error("defaultLayout must have constant span");n.property===void 0&&(n=n.replicate("content"))}let s=-1;n&&(s=n.span,0<=s&&i&&(s+=e.layout.span)),super(s,r),this.discriminator=e,this.usesPrefixDiscriminator=i,this.defaultLayout=n,this.registry={};let o=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(a){return o(a)},this.configGetSourceVariant=function(a){o=a.bind(this)}}getSpan(e,n){if(0<=this.span)return this.span;n===void 0&&(n=0);const r=this.getVariant(e,n);if(!r)throw new Error("unable to determine span for unrecognized variant");return r.getSpan(e,n)}defaultGetSourceVariant(e){if(e.hasOwnProperty(this.discriminator.property)){if(this.defaultLayout&&e.hasOwnProperty(this.defaultLayout.property))return;const n=this.registry[e[this.discriminator.property]];if(n&&(!n.layout||e.hasOwnProperty(n.property)))return n}else for(const n in this.registry){const r=this.registry[n];if(e.hasOwnProperty(r.property))return r}throw new Error("unable to infer src variant")}decode(e,n){n===void 0&&(n=0);let r;const i=this.discriminator,s=i.decode(e,n);let o=this.registry[s];if(o===void 0){let a=0;o=this.defaultLayout,this.usesPrefixDiscriminator&&(a=i.layout.span),r=this.makeDestinationObject(),r[i.property]=s,r[o.property]=this.defaultLayout.decode(e,n+a)}else r=o.decode(e,n);return r}encode(e,n,r){r===void 0&&(r=0);const i=this.getSourceVariant(e);if(i===void 0){const s=this.discriminator,o=this.defaultLayout;let a=0;return this.usesPrefixDiscriminator&&(a=s.layout.span),s.encode(e[s.property],n,r),a+o.encode(e[o.property],n,r+a)}return i.encode(e,n,r)}addVariant(e,n,r){const i=new IR(this,e,n,r);return this.registry[e]=i,i}getVariant(e,n){let r=e;return re.Buffer.isBuffer(e)&&(n===void 0&&(n=0),r=this.discriminator.decode(e,n)),this.registry[r]}},IR=class extends vt{constructor(e,n,r,i){if(!(e instanceof T_))throw new TypeError("union must be a Union");if(!Number.isInteger(n)||0>n)throw new TypeError("variant must be a (non-negative) integer");if(typeof r=="string"&&i===void 0&&(i=r,r=null),r){if(!(r instanceof vt))throw new TypeError("layout must be a Layout");if(e.defaultLayout!==null&&0<=r.span&&r.span>e.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if(typeof i!="string")throw new TypeError("variant must have a String property")}let s=e.span;0>e.span&&(s=r?r.span:0,0<=s&&e.usesPrefixDiscriminator&&(s+=e.discriminator.layout.span)),super(s,i),this.union=e,this.variant=n,this.layout=r||null}getSpan(e,n){if(0<=this.span)return this.span;n===void 0&&(n=0);let r=0;return this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),r+this.layout.getSpan(e,n+r)}decode(e,n){const r=this.makeDestinationObject();if(n===void 0&&(n=0),this!==this.union.getVariant(e,n))throw new Error("variant mismatch");let i=0;return this.union.usesPrefixDiscriminator&&(i=this.union.discriminator.layout.span),this.layout?r[this.property]=this.layout.decode(e,n+i):this.property?r[this.property]=!0:this.union.usesPrefixDiscriminator&&(r[this.union.discriminator.property]=this.variant),r}encode(e,n,r){r===void 0&&(r=0);let i=0;if(this.union.usesPrefixDiscriminator&&(i=this.union.discriminator.layout.span),this.layout&&!e.hasOwnProperty(this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,n,r);let s=i;if(this.layout&&(this.layout.encode(e[this.property],n,r+i),s+=this.layout.getSpan(n,r+i),0<=this.union.span&&s>this.union.span))throw new Error("encoded variant overruns containing union");return s}fromArray(e){if(this.layout)return this.layout.fromArray(e)}};function Fa(t){return 0>t&&(t+=4294967296),t}class M_ extends vt{constructor(e,n,r){if(!(e instanceof Vi||e instanceof Ms))throw new TypeError("word must be a UInt or UIntBE layout");if(typeof n=="string"&&r===void 0&&(r=n,n=void 0),4<e.span)throw new RangeError("word cannot exceed 32 bits");super(e.span,r),this.word=e,this.msb=!!n,this.fields=[];let i=0;this._packedSetValue=function(s){return i=Fa(s),this},this._packedGetValue=function(){return i}}decode(e,n){const r=this.makeDestinationObject();n===void 0&&(n=0);const i=this.word.decode(e,n);this._packedSetValue(i);for(const s of this.fields)s.property!==void 0&&(r[s.property]=s.decode(i));return r}encode(e,n,r){r===void 0&&(r=0);const i=this.word.decode(n,r);this._packedSetValue(i);for(const s of this.fields)if(s.property!==void 0){const o=e[s.property];o!==void 0&&s.encode(o)}return this.word.encode(this._packedGetValue(),n,r)}addField(e,n){const r=new Xl(this,e,n);return this.fields.push(r),r}addBoolean(e){const n=new kR(this,e);return this.fields.push(n),n}fieldFor(e){if(typeof e!="string")throw new TypeError("property must be string");for(const n of this.fields)if(n.property===e)return n}}class Xl{constructor(e,n,r){if(!(e instanceof M_))throw new TypeError("container must be a BitStructure");if(!Number.isInteger(n)||0>=n)throw new TypeError("bits must be positive integer");const i=8*e.span,s=e.fields.reduce((o,a)=>o+a.bits,0);if(n+s>i)throw new Error("bits too long for span remainder ("+(i-s)+" of "+i+" remain)");this.container=e,this.bits=n,this.valueMask=(1<<n)-1,n===32&&(this.valueMask=4294967295),this.start=s,this.container.msb&&(this.start=i-s-n),this.wordMask=Fa(this.valueMask<<this.start),this.property=r}decode(){const e=this.container._packedGetValue();return Fa(e&this.wordMask)>>>this.start}encode(e){if(!Number.isInteger(e)||e!==Fa(e&this.valueMask))throw new TypeError(k_("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);const n=this.container._packedGetValue(),r=Fa(e<<this.start);this.container._packedSetValue(Fa(n&~this.wordMask)|r)}}let kR=class extends Xl{constructor(e,n){super(e,1,n)}decode(e,n){return!!Xl.prototype.decode.call(this,e,n)}encode(e){return typeof e=="boolean"&&(e=+e),Xl.prototype.encode.call(this,e)}},RR=class extends vt{constructor(e,n){if(!(e instanceof pr&&e.isCount()||Number.isInteger(e)&&0<=e))throw new TypeError("length must be positive integer or an unsigned integer ExternalLayout");let r=-1;e instanceof pr||(r=e),super(r,n),this.length=e}getSpan(e,n){let r=this.span;return 0>r&&(r=this.length.decode(e,n)),r}decode(e,n){n===void 0&&(n=0);let r=this.span;return 0>r&&(r=this.length.decode(e,n)),e.slice(n,n+r)}encode(e,n,r){let i=this.length;if(this.length instanceof pr&&(i=e.length),!(re.Buffer.isBuffer(e)&&i===e.length))throw new TypeError(k_("Blob.encode",this)+" requires (length "+i+") Buffer as src");if(r+i>n.length)throw new RangeError("encoding overruns Buffer");return n.write(e.toString("hex"),r,i,"hex"),this.length instanceof pr&&this.length.encode(i,n,r),i}};class NR extends vt{constructor(e){super(-1,e)}getSpan(e,n){if(!re.Buffer.isBuffer(e))throw new TypeError("b must be a Buffer");n===void 0&&(n=0);let r=n;for(;r<e.length&&e[r]!==0;)r+=1;return 1+r-n}decode(e,n,r){n===void 0&&(n=0);let i=this.getSpan(e,n);return e.slice(n,n+i-1).toString("utf-8")}encode(e,n,r){r===void 0&&(r=0),typeof e!="string"&&(e=e.toString());const i=new re.Buffer(e,"utf8"),s=i.length;if(r+s>n.length)throw new RangeError("encoding overruns Buffer");return i.copy(n,r),n[r+s]=0,s+1}}class TR extends vt{constructor(e,n){if(typeof e=="string"&&n===void 0&&(n=e,e=void 0),e===void 0)e=-1;else if(!Number.isInteger(e))throw new TypeError("maxSpan must be an integer");super(-1,n),this.maxSpan=e}getSpan(e,n){if(!re.Buffer.isBuffer(e))throw new TypeError("b must be a Buffer");return n===void 0&&(n=0),e.length-n}decode(e,n,r){n===void 0&&(n=0);let i=this.getSpan(e,n);if(0<=this.maxSpan&&this.maxSpan<i)throw new RangeError("text length exceeds maxSpan");return e.slice(n,n+i).toString("utf-8")}encode(e,n,r){r===void 0&&(r=0),typeof e!="string"&&(e=e.toString());const i=new re.Buffer(e,"utf8"),s=i.length;if(0<=this.maxSpan&&this.maxSpan<s)throw new RangeError("text length exceeds maxSpan");if(r+s>n.length)throw new RangeError("encoding overruns Buffer");return i.copy(n,r),s}}class MR extends vt{constructor(e,n){super(0,n),this.value=e}decode(e,n,r){return this.value}encode(e,n,r){return 0}}be.ExternalLayout=pr;be.GreedyCount=_R;be.OffsetLayout=R_;be.UInt=Vi;be.UIntBE=Ms;be.Int=Ta;be.IntBE=ll;be.Float=vR;be.FloatBE=bR;be.Double=ER;be.DoubleBE=xR;be.Sequence=SR;be.Structure=AR;be.UnionDiscriminator=N_;be.UnionLayoutDiscriminator=Th;be.Union=T_;be.VariantLayout=IR;be.BitStructure=M_;be.BitField=Xl;be.Boolean=kR;be.Blob=RR;be.CString=NR;be.UTF8=TR;be.Constant=MR;be.greedy=(t,e)=>new _R(t,e);be.offset=(t,e,n)=>new R_(t,e,n);be.u8=t=>new Vi(1,t);be.u16=t=>new Vi(2,t);be.u24=t=>new Vi(3,t);be.u32=t=>new Vi(4,t);be.u40=t=>new Vi(5,t);be.u48=t=>new Vi(6,t);be.nu64=t=>new f5(t);be.u16be=t=>new Ms(2,t);be.u24be=t=>new Ms(3,t);be.u32be=t=>new Ms(4,t);be.u40be=t=>new Ms(5,t);be.u48be=t=>new Ms(6,t);be.nu64be=t=>new h5(t);be.s8=t=>new Ta(1,t);be.s16=t=>new Ta(2,t);be.s24=t=>new Ta(3,t);be.s32=t=>new Ta(4,t);be.s40=t=>new Ta(5,t);be.s48=t=>new Ta(6,t);be.ns64=t=>new p5(t);be.s16be=t=>new ll(2,t);be.s24be=t=>new ll(3,t);be.s32be=t=>new ll(4,t);be.s40be=t=>new ll(5,t);be.s48be=t=>new ll(6,t);be.ns64be=t=>new g5(t);be.f32=t=>new vR(t);be.f32be=t=>new bR(t);be.f64=t=>new ER(t);be.f64be=t=>new xR(t);be.struct=(t,e,n)=>new AR(t,e,n);be.bits=(t,e,n)=>new M_(t,e,n);be.seq=(t,e,n)=>new SR(t,e,n);be.union=(t,e,n)=>new T_(t,e,n);be.unionLayoutDiscriminator=(t,e)=>new Th(t,e);be.blob=(t,e)=>new RR(t,e);be.cstr=t=>new NR(t);be.utf8=(t,e)=>new TR(t,e);be.const=(t,e)=>new MR(t,e);const y5=Ph(YD);(function(t){var e=Cr&&Cr.__importDefault||function(W){return W&&W.__esModule?W:{default:W}};Object.defineProperty(t,"__esModule",{value:!0}),t.map=t.array=t.rustEnum=t.str=t.vecU8=t.tagged=t.vec=t.bool=t.option=t.publicKey=t.i256=t.u256=t.i128=t.u128=t.i64=t.u64=t.struct=t.f64=t.f32=t.i32=t.u32=t.i16=t.u16=t.i8=t.u8=void 0;const n=be,r=y5,i=e(Mw);var s=be;Object.defineProperty(t,"u8",{enumerable:!0,get:function(){return s.u8}}),Object.defineProperty(t,"i8",{enumerable:!0,get:function(){return s.s8}}),Object.defineProperty(t,"u16",{enumerable:!0,get:function(){return s.u16}}),Object.defineProperty(t,"i16",{enumerable:!0,get:function(){return s.s16}}),Object.defineProperty(t,"u32",{enumerable:!0,get:function(){return s.u32}}),Object.defineProperty(t,"i32",{enumerable:!0,get:function(){return s.s32}}),Object.defineProperty(t,"f32",{enumerable:!0,get:function(){return s.f32}}),Object.defineProperty(t,"f64",{enumerable:!0,get:function(){return s.f64}}),Object.defineProperty(t,"struct",{enumerable:!0,get:function(){return s.struct}});class o extends n.Layout{constructor(N,d,h){super(N,h),this.blob=(0,n.blob)(N),this.signed=d}decode(N,d=0){const h=new i.default(this.blob.decode(N,d),10,"le");return this.signed?h.fromTwos(this.span*8).clone():h}encode(N,d,h=0){return this.signed&&(N=N.toTwos(this.span*8)),this.blob.encode(N.toArrayLike(re.Buffer,"le",this.span),d,h)}}function a(W){return new o(8,!1,W)}t.u64=a;function c(W){return new o(8,!0,W)}t.i64=c;function l(W){return new o(16,!1,W)}t.u128=l;function u(W){return new o(16,!0,W)}t.i128=u;function f(W){return new o(32,!1,W)}t.u256=f;function g(W){return new o(32,!0,W)}t.i256=g;class p extends n.Layout{constructor(N,d,h,v){super(N.span,v),this.layout=N,this.decoder=d,this.encoder=h}decode(N,d){return this.decoder(this.layout.decode(N,d))}encode(N,d,h){return this.layout.encode(this.encoder(N),d,h)}getSpan(N,d){return this.layout.getSpan(N,d)}}function _(W){return new p((0,n.blob)(32),N=>new r.PublicKey(N),N=>N.toBuffer(),W)}t.publicKey=_;class A extends n.Layout{constructor(N,d){super(-1,d),this.layout=N,this.discriminator=(0,n.u8)()}encode(N,d,h=0){return N==null?this.discriminator.encode(0,d,h):(this.discriminator.encode(1,d,h),this.layout.encode(N,d,h+1)+1)}decode(N,d=0){const h=this.discriminator.decode(N,d);if(h===0)return null;if(h===1)return this.layout.decode(N,d+1);throw new Error("Invalid option "+this.property)}getSpan(N,d=0){const h=this.discriminator.decode(N,d);if(h===0)return 1;if(h===1)return this.layout.getSpan(N,d+1)+1;throw new Error("Invalid option "+this.property)}}function S(W,N){return new A(W,N)}t.option=S;function E(W){return new p((0,n.u8)(),b,x,W)}t.bool=E;function b(W){if(W===0)return!1;if(W===1)return!0;throw new Error("Invalid bool: "+W)}function x(W){return W?1:0}function M(W,N){const d=(0,n.u32)("length"),h=(0,n.struct)([d,(0,n.seq)(W,(0,n.offset)(d,-d.span),"values")]);return new p(h,({values:v})=>v,v=>({values:v}),N)}t.vec=M;function L(W,N,d){const h=(0,n.struct)([a("tag"),N.replicate("data")]);function v({tag:I,data:k}){if(!I.eq(W))throw new Error("Invalid tag, expected: "+W.toString("hex")+", got: "+I.toString("hex"));return k}return new p(h,v,I=>({tag:W,data:I}),d)}t.tagged=L;function z(W){const N=(0,n.u32)("length"),d=(0,n.struct)([N,(0,n.blob)((0,n.offset)(N,-N.span),"data")]);return new p(d,({data:h})=>h,h=>({data:h}),W)}t.vecU8=z;function D(W){return new p(z(),N=>N.toString("utf-8"),N=>re.Buffer.from(N,"utf-8"),W)}t.str=D;function F(W,N,d){const h=(0,n.union)(d??(0,n.u8)(),N);return W.forEach((v,I)=>h.addVariant(I,v,v.property)),h}t.rustEnum=F;function $(W,N,d){const h=(0,n.struct)([(0,n.seq)(W,N,"values")]);return new p(h,({values:v})=>v,v=>({values:v}),d)}t.array=$;class V extends n.Layout{constructor(N,d,h){super(N.span+d.span,h),this.keyLayout=N,this.valueLayout=d}decode(N,d){d=d||0;const h=this.keyLayout.decode(N,d),v=this.valueLayout.decode(N,d+this.keyLayout.getSpan(N,d));return[h,v]}encode(N,d,h){h=h||0;const v=this.keyLayout.encode(N[0],d,h),I=this.valueLayout.encode(N[1],d,h+v);return v+I}getSpan(N,d){return this.keyLayout.getSpan(N,d)+this.valueLayout.getSpan(N,d)}}function G(W,N,d){const h=(0,n.u32)("length"),v=(0,n.struct)([h,(0,n.seq)(new V(W,N),(0,n.offset)(h,-h.span),"values")]);return new p(v,({values:I})=>new Map(I),I=>({values:Array.from(I.entries())}),d)}t.map=G})($e);/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const m5=4,Lb=0,Db=1,w5=2;function ul(t){let e=t.length;for(;--e>=0;)t[e]=0}const _5=0,OR=1,v5=2,b5=3,E5=258,O_=29,yd=256,Fu=yd+1+O_,bc=30,C_=19,CR=2*Fu+1,Xo=15,hg=16,x5=7,L_=256,LR=16,DR=17,PR=18,om=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),kf=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),S5=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),BR=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),A5=512,rs=new Array((Fu+2)*2);ul(rs);const Jl=new Array(bc*2);ul(Jl);const Wu=new Array(A5);ul(Wu);const Hu=new Array(E5-b5+1);ul(Hu);const D_=new Array(O_);ul(D_);const Mh=new Array(bc);ul(Mh);function pg(t,e,n,r,i){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=t&&t.length}let zR,jR,UR;function gg(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}const FR=t=>t<256?Wu[t]:Wu[256+(t>>>7)],$u=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},yr=(t,e,n)=>{t.bi_valid>hg-n?(t.bi_buf|=e<<t.bi_valid&65535,$u(t,t.bi_buf),t.bi_buf=e>>hg-t.bi_valid,t.bi_valid+=n-hg):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=n)},Ri=(t,e,n)=>{yr(t,n[e*2],n[e*2+1])},WR=(t,e)=>{let n=0;do n|=t&1,t>>>=1,n<<=1;while(--e>0);return n>>>1},I5=t=>{t.bi_valid===16?($u(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)},k5=(t,e)=>{const n=e.dyn_tree,r=e.max_code,i=e.stat_desc.static_tree,s=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,a=e.stat_desc.extra_base,c=e.stat_desc.max_length;let l,u,f,g,p,_,A=0;for(g=0;g<=Xo;g++)t.bl_count[g]=0;for(n[t.heap[t.heap_max]*2+1]=0,l=t.heap_max+1;l<CR;l++)u=t.heap[l],g=n[n[u*2+1]*2+1]+1,g>c&&(g=c,A++),n[u*2+1]=g,!(u>r)&&(t.bl_count[g]++,p=0,u>=a&&(p=o[u-a]),_=n[u*2],t.opt_len+=_*(g+p),s&&(t.static_len+=_*(i[u*2+1]+p)));if(A!==0){do{for(g=c-1;t.bl_count[g]===0;)g--;t.bl_count[g]--,t.bl_count[g+1]+=2,t.bl_count[c]--,A-=2}while(A>0);for(g=c;g!==0;g--)for(u=t.bl_count[g];u!==0;)f=t.heap[--l],!(f>r)&&(n[f*2+1]!==g&&(t.opt_len+=(g-n[f*2+1])*n[f*2],n[f*2+1]=g),u--)}},HR=(t,e,n)=>{const r=new Array(Xo+1);let i=0,s,o;for(s=1;s<=Xo;s++)i=i+n[s-1]<<1,r[s]=i;for(o=0;o<=e;o++){let a=t[o*2+1];a!==0&&(t[o*2]=WR(r[a]++,a))}},R5=()=>{let t,e,n,r,i;const s=new Array(Xo+1);for(n=0,r=0;r<O_-1;r++)for(D_[r]=n,t=0;t<1<<om[r];t++)Hu[n++]=r;for(Hu[n-1]=r,i=0,r=0;r<16;r++)for(Mh[r]=i,t=0;t<1<<kf[r];t++)Wu[i++]=r;for(i>>=7;r<bc;r++)for(Mh[r]=i<<7,t=0;t<1<<kf[r]-7;t++)Wu[256+i++]=r;for(e=0;e<=Xo;e++)s[e]=0;for(t=0;t<=143;)rs[t*2+1]=8,t++,s[8]++;for(;t<=255;)rs[t*2+1]=9,t++,s[9]++;for(;t<=279;)rs[t*2+1]=7,t++,s[7]++;for(;t<=287;)rs[t*2+1]=8,t++,s[8]++;for(HR(rs,Fu+1,s),t=0;t<bc;t++)Jl[t*2+1]=5,Jl[t*2]=WR(t,5);zR=new pg(rs,om,yd+1,Fu,Xo),jR=new pg(Jl,kf,0,bc,Xo),UR=new pg(new Array(0),S5,0,C_,x5)},$R=t=>{let e;for(e=0;e<Fu;e++)t.dyn_ltree[e*2]=0;for(e=0;e<bc;e++)t.dyn_dtree[e*2]=0;for(e=0;e<C_;e++)t.bl_tree[e*2]=0;t.dyn_ltree[L_*2]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},VR=t=>{t.bi_valid>8?$u(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},Pb=(t,e,n,r)=>{const i=e*2,s=n*2;return t[i]<t[s]||t[i]===t[s]&&r[e]<=r[n]},yg=(t,e,n)=>{const r=t.heap[n];let i=n<<1;for(;i<=t.heap_len&&(i<t.heap_len&&Pb(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!Pb(e,r,t.heap[i],t.depth));)t.heap[n]=t.heap[i],n=i,i<<=1;t.heap[n]=r},Bb=(t,e,n)=>{let r,i,s=0,o,a;if(t.sym_next!==0)do r=t.pending_buf[t.sym_buf+s++]&255,r+=(t.pending_buf[t.sym_buf+s++]&255)<<8,i=t.pending_buf[t.sym_buf+s++],r===0?Ri(t,i,e):(o=Hu[i],Ri(t,o+yd+1,e),a=om[o],a!==0&&(i-=D_[o],yr(t,i,a)),r--,o=FR(r),Ri(t,o,n),a=kf[o],a!==0&&(r-=Mh[o],yr(t,r,a)));while(s<t.sym_next);Ri(t,L_,e)},am=(t,e)=>{const n=e.dyn_tree,r=e.stat_desc.static_tree,i=e.stat_desc.has_stree,s=e.stat_desc.elems;let o,a,c=-1,l;for(t.heap_len=0,t.heap_max=CR,o=0;o<s;o++)n[o*2]!==0?(t.heap[++t.heap_len]=c=o,t.depth[o]=0):n[o*2+1]=0;for(;t.heap_len<2;)l=t.heap[++t.heap_len]=c<2?++c:0,n[l*2]=1,t.depth[l]=0,t.opt_len--,i&&(t.static_len-=r[l*2+1]);for(e.max_code=c,o=t.heap_len>>1;o>=1;o--)yg(t,n,o);l=s;do o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],yg(t,n,1),a=t.heap[1],t.heap[--t.heap_max]=o,t.heap[--t.heap_max]=a,n[l*2]=n[o*2]+n[a*2],t.depth[l]=(t.depth[o]>=t.depth[a]?t.depth[o]:t.depth[a])+1,n[o*2+1]=n[a*2+1]=l,t.heap[1]=l++,yg(t,n,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],k5(t,e),HR(n,c,t.bl_count)},zb=(t,e,n)=>{let r,i=-1,s,o=e[0*2+1],a=0,c=7,l=4;for(o===0&&(c=138,l=3),e[(n+1)*2+1]=65535,r=0;r<=n;r++)s=o,o=e[(r+1)*2+1],!(++a<c&&s===o)&&(a<l?t.bl_tree[s*2]+=a:s!==0?(s!==i&&t.bl_tree[s*2]++,t.bl_tree[LR*2]++):a<=10?t.bl_tree[DR*2]++:t.bl_tree[PR*2]++,a=0,i=s,o===0?(c=138,l=3):s===o?(c=6,l=3):(c=7,l=4))},jb=(t,e,n)=>{let r,i=-1,s,o=e[0*2+1],a=0,c=7,l=4;for(o===0&&(c=138,l=3),r=0;r<=n;r++)if(s=o,o=e[(r+1)*2+1],!(++a<c&&s===o)){if(a<l)do Ri(t,s,t.bl_tree);while(--a!==0);else s!==0?(s!==i&&(Ri(t,s,t.bl_tree),a--),Ri(t,LR,t.bl_tree),yr(t,a-3,2)):a<=10?(Ri(t,DR,t.bl_tree),yr(t,a-3,3)):(Ri(t,PR,t.bl_tree),yr(t,a-11,7));a=0,i=s,o===0?(c=138,l=3):s===o?(c=6,l=3):(c=7,l=4)}},N5=t=>{let e;for(zb(t,t.dyn_ltree,t.l_desc.max_code),zb(t,t.dyn_dtree,t.d_desc.max_code),am(t,t.bl_desc),e=C_-1;e>=3&&t.bl_tree[BR[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},T5=(t,e,n,r)=>{let i;for(yr(t,e-257,5),yr(t,n-1,5),yr(t,r-4,4),i=0;i<r;i++)yr(t,t.bl_tree[BR[i]*2+1],3);jb(t,t.dyn_ltree,e-1),jb(t,t.dyn_dtree,n-1)},M5=t=>{let e=4093624447,n;for(n=0;n<=31;n++,e>>>=1)if(e&1&&t.dyn_ltree[n*2]!==0)return Lb;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return Db;for(n=32;n<yd;n++)if(t.dyn_ltree[n*2]!==0)return Db;return Lb};let Ub=!1;const O5=t=>{Ub||(R5(),Ub=!0),t.l_desc=new gg(t.dyn_ltree,zR),t.d_desc=new gg(t.dyn_dtree,jR),t.bl_desc=new gg(t.bl_tree,UR),t.bi_buf=0,t.bi_valid=0,$R(t)},ZR=(t,e,n,r)=>{yr(t,(_5<<1)+(r?1:0),3),VR(t),$u(t,n),$u(t,~n),n&&t.pending_buf.set(t.window.subarray(e,e+n),t.pending),t.pending+=n},C5=t=>{yr(t,OR<<1,3),Ri(t,L_,rs),I5(t)},L5=(t,e,n,r)=>{let i,s,o=0;t.level>0?(t.strm.data_type===w5&&(t.strm.data_type=M5(t)),am(t,t.l_desc),am(t,t.d_desc),o=N5(t),i=t.opt_len+3+7>>>3,s=t.static_len+3+7>>>3,s<=i&&(i=s)):i=s=n+5,n+4<=i&&e!==-1?ZR(t,e,n,r):t.strategy===m5||s===i?(yr(t,(OR<<1)+(r?1:0),3),Bb(t,rs,Jl)):(yr(t,(v5<<1)+(r?1:0),3),T5(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),Bb(t,t.dyn_ltree,t.dyn_dtree)),$R(t),r&&VR(t)},D5=(t,e,n)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=n,e===0?t.dyn_ltree[n*2]++:(t.matches++,e--,t.dyn_ltree[(Hu[n]+yd+1)*2]++,t.dyn_dtree[FR(e)*2]++),t.sym_next===t.sym_end);var P5=O5,B5=ZR,z5=L5,j5=D5,U5=C5,F5={_tr_init:P5,_tr_stored_block:B5,_tr_flush_block:z5,_tr_tally:j5,_tr_align:U5};const W5=(t,e,n,r)=>{let i=t&65535|0,s=t>>>16&65535|0,o=0;for(;n!==0;){o=n>2e3?2e3:n,n-=o;do i=i+e[r++]|0,s=s+i|0;while(--o);i%=65521,s%=65521}return i|s<<16|0};var Vu=W5;const H5=()=>{let t,e=[];for(var n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=t&1?3988292384^t>>>1:t>>>1;e[n]=t}return e},$5=new Uint32Array(H5()),V5=(t,e,n,r)=>{const i=$5,s=r+n;t^=-1;for(let o=r;o<s;o++)t=t>>>8^i[(t^e[o])&255];return t^-1};var Sn=V5,$c={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},md={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:Z5,_tr_stored_block:cm,_tr_flush_block:K5,_tr_tally:uo,_tr_align:G5}=F5,{Z_NO_FLUSH:fo,Z_PARTIAL_FLUSH:Y5,Z_FULL_FLUSH:q5,Z_FINISH:Vr,Z_BLOCK:Fb,Z_OK:Ln,Z_STREAM_END:Wb,Z_STREAM_ERROR:Di,Z_DATA_ERROR:Q5,Z_BUF_ERROR:mg,Z_DEFAULT_COMPRESSION:X5,Z_FILTERED:J5,Z_HUFFMAN_ONLY:Xd,Z_RLE:eU,Z_FIXED:tU,Z_DEFAULT_STRATEGY:nU,Z_UNKNOWN:rU,Z_DEFLATED:Dp}=md,iU=9,sU=15,oU=8,aU=29,cU=256,lm=cU+1+aU,lU=30,uU=19,dU=2*lm+1,fU=15,tt=3,Xs=258,Pi=Xs+tt+1,hU=32,Vc=42,P_=57,um=69,dm=73,fm=91,hm=103,Jo=113,Bl=666,er=1,dl=2,ba=3,fl=4,pU=3,ea=(t,e)=>(t.msg=$c[e],e),Hb=t=>t*2-(t>4?9:0),Ks=t=>{let e=t.length;for(;--e>=0;)t[e]=0},gU=t=>{let e,n,r,i=t.w_size;e=t.hash_size,r=e;do n=t.head[--r],t.head[r]=n>=i?n-i:0;while(--e);e=i,r=e;do n=t.prev[--r],t.prev[r]=n>=i?n-i:0;while(--e)};let yU=(t,e,n)=>(e<<t.hash_shift^n)&t.hash_mask,ho=yU;const Er=t=>{const e=t.state;let n=e.pending;n>t.avail_out&&(n=t.avail_out),n!==0&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+n),t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,e.pending===0&&(e.pending_out=0))},Nr=(t,e)=>{K5(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,Er(t.strm)},ft=(t,e)=>{t.pending_buf[t.pending++]=e},kl=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255},pm=(t,e,n,r)=>{let i=t.avail_in;return i>r&&(i=r),i===0?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),n),t.state.wrap===1?t.adler=Vu(t.adler,e,i,n):t.state.wrap===2&&(t.adler=Sn(t.adler,e,i,n)),t.next_in+=i,t.total_in+=i,i)},KR=(t,e)=>{let n=t.max_chain_length,r=t.strstart,i,s,o=t.prev_length,a=t.nice_match;const c=t.strstart>t.w_size-Pi?t.strstart-(t.w_size-Pi):0,l=t.window,u=t.w_mask,f=t.prev,g=t.strstart+Xs;let p=l[r+o-1],_=l[r+o];t.prev_length>=t.good_match&&(n>>=2),a>t.lookahead&&(a=t.lookahead);do if(i=e,!(l[i+o]!==_||l[i+o-1]!==p||l[i]!==l[r]||l[++i]!==l[r+1])){r+=2,i++;do;while(l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&r<g);if(s=Xs-(g-r),r=g-Xs,s>o){if(t.match_start=e,o=s,s>=a)break;p=l[r+o-1],_=l[r+o]}}while((e=f[e&u])>c&&--n!==0);return o<=t.lookahead?o:t.lookahead},Zc=t=>{const e=t.w_size;let n,r,i;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Pi)&&(t.window.set(t.window.subarray(e,e+e-r),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),gU(t),r+=e),t.strm.avail_in===0)break;if(n=pm(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=n,t.lookahead+t.insert>=tt)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=ho(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=ho(t,t.ins_h,t.window[i+tt-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<tt)););}while(t.lookahead<Pi&&t.strm.avail_in!==0)},GR=(t,e)=>{let n=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,r,i,s,o=0,a=t.strm.avail_in;do{if(r=65535,s=t.bi_valid+42>>3,t.strm.avail_out<s||(s=t.strm.avail_out-s,i=t.strstart-t.block_start,r>i+t.strm.avail_in&&(r=i+t.strm.avail_in),r>s&&(r=s),r<n&&(r===0&&e!==Vr||e===fo||r!==i+t.strm.avail_in)))break;o=e===Vr&&r===i+t.strm.avail_in?1:0,cm(t,0,0,o),t.pending_buf[t.pending-4]=r,t.pending_buf[t.pending-3]=r>>8,t.pending_buf[t.pending-2]=~r,t.pending_buf[t.pending-1]=~r>>8,Er(t.strm),i&&(i>r&&(i=r),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,r-=i),r&&(pm(t.strm,t.strm.output,t.strm.next_out,r),t.strm.next_out+=r,t.strm.avail_out-=r,t.strm.total_out+=r)}while(o===0);return a-=t.strm.avail_in,a&&(a>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=a&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-a,t.strm.next_in),t.strstart),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),o?fl:e!==fo&&e!==Vr&&t.strm.avail_in===0&&t.strstart===t.block_start?dl:(s=t.window_size-t.strstart,t.strm.avail_in>s&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,s+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),s>t.strm.avail_in&&(s=t.strm.avail_in),s&&(pm(t.strm,t.window,t.strstart,s),t.strstart+=s,t.insert+=s>t.w_size-t.insert?t.w_size-t.insert:s),t.high_water<t.strstart&&(t.high_water=t.strstart),s=t.bi_valid+42>>3,s=t.pending_buf_size-s>65535?65535:t.pending_buf_size-s,n=s>t.w_size?t.w_size:s,i=t.strstart-t.block_start,(i>=n||(i||e===Vr)&&e!==fo&&t.strm.avail_in===0&&i<=s)&&(r=i>s?s:i,o=e===Vr&&t.strm.avail_in===0&&r===i?1:0,cm(t,t.block_start,r,o),t.block_start+=r,Er(t.strm)),o?ba:er)},wg=(t,e)=>{let n,r;for(;;){if(t.lookahead<Pi){if(Zc(t),t.lookahead<Pi&&e===fo)return er;if(t.lookahead===0)break}if(n=0,t.lookahead>=tt&&(t.ins_h=ho(t,t.ins_h,t.window[t.strstart+tt-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),n!==0&&t.strstart-n<=t.w_size-Pi&&(t.match_length=KR(t,n)),t.match_length>=tt)if(r=uo(t,t.strstart-t.match_start,t.match_length-tt),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=tt){t.match_length--;do t.strstart++,t.ins_h=ho(t,t.ins_h,t.window[t.strstart+tt-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=ho(t,t.ins_h,t.window[t.strstart+1]);else r=uo(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(r&&(Nr(t,!1),t.strm.avail_out===0))return er}return t.insert=t.strstart<tt-1?t.strstart:tt-1,e===Vr?(Nr(t,!0),t.strm.avail_out===0?ba:fl):t.sym_next&&(Nr(t,!1),t.strm.avail_out===0)?er:dl},Pa=(t,e)=>{let n,r,i;for(;;){if(t.lookahead<Pi){if(Zc(t),t.lookahead<Pi&&e===fo)return er;if(t.lookahead===0)break}if(n=0,t.lookahead>=tt&&(t.ins_h=ho(t,t.ins_h,t.window[t.strstart+tt-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=tt-1,n!==0&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-Pi&&(t.match_length=KR(t,n),t.match_length<=5&&(t.strategy===J5||t.match_length===tt&&t.strstart-t.match_start>4096)&&(t.match_length=tt-1)),t.prev_length>=tt&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-tt,r=uo(t,t.strstart-1-t.prev_match,t.prev_length-tt),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=ho(t,t.ins_h,t.window[t.strstart+tt-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=tt-1,t.strstart++,r&&(Nr(t,!1),t.strm.avail_out===0))return er}else if(t.match_available){if(r=uo(t,0,t.window[t.strstart-1]),r&&Nr(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return er}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(r=uo(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<tt-1?t.strstart:tt-1,e===Vr?(Nr(t,!0),t.strm.avail_out===0?ba:fl):t.sym_next&&(Nr(t,!1),t.strm.avail_out===0)?er:dl},mU=(t,e)=>{let n,r,i,s;const o=t.window;for(;;){if(t.lookahead<=Xs){if(Zc(t),t.lookahead<=Xs&&e===fo)return er;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=tt&&t.strstart>0&&(i=t.strstart-1,r=o[i],r===o[++i]&&r===o[++i]&&r===o[++i])){s=t.strstart+Xs;do;while(r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&i<s);t.match_length=Xs-(s-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=tt?(n=uo(t,1,t.match_length-tt),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=uo(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(Nr(t,!1),t.strm.avail_out===0))return er}return t.insert=0,e===Vr?(Nr(t,!0),t.strm.avail_out===0?ba:fl):t.sym_next&&(Nr(t,!1),t.strm.avail_out===0)?er:dl},wU=(t,e)=>{let n;for(;;){if(t.lookahead===0&&(Zc(t),t.lookahead===0)){if(e===fo)return er;break}if(t.match_length=0,n=uo(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(Nr(t,!1),t.strm.avail_out===0))return er}return t.insert=0,e===Vr?(Nr(t,!0),t.strm.avail_out===0?ba:fl):t.sym_next&&(Nr(t,!1),t.strm.avail_out===0)?er:dl};function vi(t,e,n,r,i){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=r,this.func=i}const zl=[new vi(0,0,0,0,GR),new vi(4,4,8,4,wg),new vi(4,5,16,8,wg),new vi(4,6,32,32,wg),new vi(4,4,16,16,Pa),new vi(8,16,32,32,Pa),new vi(8,16,128,128,Pa),new vi(8,32,128,256,Pa),new vi(32,128,258,1024,Pa),new vi(32,258,258,4096,Pa)],_U=t=>{t.window_size=2*t.w_size,Ks(t.head),t.max_lazy_match=zl[t.level].max_lazy,t.good_match=zl[t.level].good_length,t.nice_match=zl[t.level].nice_length,t.max_chain_length=zl[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=tt-1,t.match_available=0,t.ins_h=0};function vU(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Dp,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(dU*2),this.dyn_dtree=new Uint16Array((2*lU+1)*2),this.bl_tree=new Uint16Array((2*uU+1)*2),Ks(this.dyn_ltree),Ks(this.dyn_dtree),Ks(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(fU+1),this.heap=new Uint16Array(2*lm+1),Ks(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*lm+1),Ks(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const wd=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.status!==Vc&&e.status!==P_&&e.status!==um&&e.status!==dm&&e.status!==fm&&e.status!==hm&&e.status!==Jo&&e.status!==Bl?1:0},YR=t=>{if(wd(t))return ea(t,Di);t.total_in=t.total_out=0,t.data_type=rU;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?P_:e.wrap?Vc:Jo,t.adler=e.wrap===2?0:1,e.last_flush=-2,Z5(e),Ln},qR=t=>{const e=YR(t);return e===Ln&&_U(t.state),e},bU=(t,e)=>wd(t)||t.state.wrap!==2?Di:(t.state.gzhead=e,Ln),QR=(t,e,n,r,i,s)=>{if(!t)return Di;let o=1;if(e===X5&&(e=6),r<0?(o=0,r=-r):r>15&&(o=2,r-=16),i<1||i>iU||n!==Dp||r<8||r>15||e<0||e>9||s<0||s>tU||r===8&&o!==1)return ea(t,Di);r===8&&(r=9);const a=new vU;return t.state=a,a.strm=t,a.status=Vc,a.wrap=o,a.gzhead=null,a.w_bits=r,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=i+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+tt-1)/tt),a.window=new Uint8Array(a.w_size*2),a.head=new Uint16Array(a.hash_size),a.prev=new Uint16Array(a.w_size),a.lit_bufsize=1<<i+6,a.pending_buf_size=a.lit_bufsize*4,a.pending_buf=new Uint8Array(a.pending_buf_size),a.sym_buf=a.lit_bufsize,a.sym_end=(a.lit_bufsize-1)*3,a.level=e,a.strategy=s,a.method=n,qR(t)},EU=(t,e)=>QR(t,e,Dp,sU,oU,nU),xU=(t,e)=>{if(wd(t)||e>Fb||e<0)return t?ea(t,Di):Di;const n=t.state;if(!t.output||t.avail_in!==0&&!t.input||n.status===Bl&&e!==Vr)return ea(t,t.avail_out===0?mg:Di);const r=n.last_flush;if(n.last_flush=e,n.pending!==0){if(Er(t),t.avail_out===0)return n.last_flush=-1,Ln}else if(t.avail_in===0&&Hb(e)<=Hb(r)&&e!==Vr)return ea(t,mg);if(n.status===Bl&&t.avail_in!==0)return ea(t,mg);if(n.status===Vc&&n.wrap===0&&(n.status=Jo),n.status===Vc){let i=Dp+(n.w_bits-8<<4)<<8,s=-1;if(n.strategy>=Xd||n.level<2?s=0:n.level<6?s=1:n.level===6?s=2:s=3,i|=s<<6,n.strstart!==0&&(i|=hU),i+=31-i%31,kl(n,i),n.strstart!==0&&(kl(n,t.adler>>>16),kl(n,t.adler&65535)),t.adler=1,n.status=Jo,Er(t),n.pending!==0)return n.last_flush=-1,Ln}if(n.status===P_){if(t.adler=0,ft(n,31),ft(n,139),ft(n,8),n.gzhead)ft(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),ft(n,n.gzhead.time&255),ft(n,n.gzhead.time>>8&255),ft(n,n.gzhead.time>>16&255),ft(n,n.gzhead.time>>24&255),ft(n,n.level===9?2:n.strategy>=Xd||n.level<2?4:0),ft(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(ft(n,n.gzhead.extra.length&255),ft(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=Sn(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=um;else if(ft(n,0),ft(n,0),ft(n,0),ft(n,0),ft(n,0),ft(n,n.level===9?2:n.strategy>=Xd||n.level<2?4:0),ft(n,pU),n.status=Jo,Er(t),n.pending!==0)return n.last_flush=-1,Ln}if(n.status===um){if(n.gzhead.extra){let i=n.pending,s=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+s>n.pending_buf_size;){let a=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+a),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>i&&(t.adler=Sn(t.adler,n.pending_buf,n.pending-i,i)),n.gzindex+=a,Er(t),n.pending!==0)return n.last_flush=-1,Ln;i=0,s-=a}let o=new Uint8Array(n.gzhead.extra);n.pending_buf.set(o.subarray(n.gzindex,n.gzindex+s),n.pending),n.pending+=s,n.gzhead.hcrc&&n.pending>i&&(t.adler=Sn(t.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=dm}if(n.status===dm){if(n.gzhead.name){let i=n.pending,s;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(t.adler=Sn(t.adler,n.pending_buf,n.pending-i,i)),Er(t),n.pending!==0)return n.last_flush=-1,Ln;i=0}n.gzindex<n.gzhead.name.length?s=n.gzhead.name.charCodeAt(n.gzindex++)&255:s=0,ft(n,s)}while(s!==0);n.gzhead.hcrc&&n.pending>i&&(t.adler=Sn(t.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=fm}if(n.status===fm){if(n.gzhead.comment){let i=n.pending,s;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(t.adler=Sn(t.adler,n.pending_buf,n.pending-i,i)),Er(t),n.pending!==0)return n.last_flush=-1,Ln;i=0}n.gzindex<n.gzhead.comment.length?s=n.gzhead.comment.charCodeAt(n.gzindex++)&255:s=0,ft(n,s)}while(s!==0);n.gzhead.hcrc&&n.pending>i&&(t.adler=Sn(t.adler,n.pending_buf,n.pending-i,i))}n.status=hm}if(n.status===hm){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(Er(t),n.pending!==0))return n.last_flush=-1,Ln;ft(n,t.adler&255),ft(n,t.adler>>8&255),t.adler=0}if(n.status=Jo,Er(t),n.pending!==0)return n.last_flush=-1,Ln}if(t.avail_in!==0||n.lookahead!==0||e!==fo&&n.status!==Bl){let i=n.level===0?GR(n,e):n.strategy===Xd?wU(n,e):n.strategy===eU?mU(n,e):zl[n.level].func(n,e);if((i===ba||i===fl)&&(n.status=Bl),i===er||i===ba)return t.avail_out===0&&(n.last_flush=-1),Ln;if(i===dl&&(e===Y5?G5(n):e!==Fb&&(cm(n,0,0,!1),e===q5&&(Ks(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Er(t),t.avail_out===0))return n.last_flush=-1,Ln}return e!==Vr?Ln:n.wrap<=0?Wb:(n.wrap===2?(ft(n,t.adler&255),ft(n,t.adler>>8&255),ft(n,t.adler>>16&255),ft(n,t.adler>>24&255),ft(n,t.total_in&255),ft(n,t.total_in>>8&255),ft(n,t.total_in>>16&255),ft(n,t.total_in>>24&255)):(kl(n,t.adler>>>16),kl(n,t.adler&65535)),Er(t),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?Ln:Wb)},SU=t=>{if(wd(t))return Di;const e=t.state.status;return t.state=null,e===Jo?ea(t,Q5):Ln},AU=(t,e)=>{let n=e.length;if(wd(t))return Di;const r=t.state,i=r.wrap;if(i===2||i===1&&r.status!==Vc||r.lookahead)return Di;if(i===1&&(t.adler=Vu(t.adler,e,n,0)),r.wrap=0,n>=r.w_size){i===0&&(Ks(r.head),r.strstart=0,r.block_start=0,r.insert=0);let c=new Uint8Array(r.w_size);c.set(e.subarray(n-r.w_size,n),0),e=c,n=r.w_size}const s=t.avail_in,o=t.next_in,a=t.input;for(t.avail_in=n,t.next_in=0,t.input=e,Zc(r);r.lookahead>=tt;){let c=r.strstart,l=r.lookahead-(tt-1);do r.ins_h=ho(r,r.ins_h,r.window[c+tt-1]),r.prev[c&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=c,c++;while(--l);r.strstart=c,r.lookahead=tt-1,Zc(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=tt-1,r.match_available=0,t.next_in=o,t.input=a,t.avail_in=s,r.wrap=i,Ln};var IU=EU,kU=QR,RU=qR,NU=YR,TU=bU,MU=xU,OU=SU,CU=AU,LU="pako deflate (from Nodeca project)",eu={deflateInit:IU,deflateInit2:kU,deflateReset:RU,deflateResetKeep:NU,deflateSetHeader:TU,deflate:MU,deflateEnd:OU,deflateSetDictionary:CU,deflateInfo:LU};const DU=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var PU=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const n=e.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const r in n)DU(n,r)&&(t[r]=n[r])}}return t},BU=t=>{let e=0;for(let r=0,i=t.length;r<i;r++)e+=t[r].length;const n=new Uint8Array(e);for(let r=0,i=0,s=t.length;r<s;r++){let o=t[r];n.set(o,i),i+=o.length}return n},Pp={assign:PU,flattenChunks:BU};let XR=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{XR=!1}const Zu=new Uint8Array(256);for(let t=0;t<256;t++)Zu[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Zu[254]=Zu[254]=1;var zU=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,n,r,i,s,o=t.length,a=0;for(i=0;i<o;i++)n=t.charCodeAt(i),(n&64512)===55296&&i+1<o&&(r=t.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),a+=n<128?1:n<2048?2:n<65536?3:4;for(e=new Uint8Array(a),s=0,i=0;s<a;i++)n=t.charCodeAt(i),(n&64512)===55296&&i+1<o&&(r=t.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?e[s++]=n:n<2048?(e[s++]=192|n>>>6,e[s++]=128|n&63):n<65536?(e[s++]=224|n>>>12,e[s++]=128|n>>>6&63,e[s++]=128|n&63):(e[s++]=240|n>>>18,e[s++]=128|n>>>12&63,e[s++]=128|n>>>6&63,e[s++]=128|n&63);return e};const jU=(t,e)=>{if(e<65534&&t.subarray&&XR)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let n="";for(let r=0;r<e;r++)n+=String.fromCharCode(t[r]);return n};var UU=(t,e)=>{const n=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let r,i;const s=new Array(n*2);for(i=0,r=0;r<n;){let o=t[r++];if(o<128){s[i++]=o;continue}let a=Zu[o];if(a>4){s[i++]=65533,r+=a-1;continue}for(o&=a===2?31:a===3?15:7;a>1&&r<n;)o=o<<6|t[r++]&63,a--;if(a>1){s[i++]=65533;continue}o<65536?s[i++]=o:(o-=65536,s[i++]=55296|o>>10&1023,s[i++]=56320|o&1023)}return jU(s,i)},FU=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let n=e-1;for(;n>=0&&(t[n]&192)===128;)n--;return n<0||n===0?e:n+Zu[t[n]]>e?n:e},Ku={string2buf:zU,buf2string:UU,utf8border:FU};function WU(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var JR=WU;const eN=Object.prototype.toString,{Z_NO_FLUSH:HU,Z_SYNC_FLUSH:$U,Z_FULL_FLUSH:VU,Z_FINISH:ZU,Z_OK:Oh,Z_STREAM_END:KU,Z_DEFAULT_COMPRESSION:GU,Z_DEFAULT_STRATEGY:YU,Z_DEFLATED:qU}=md;function B_(t){this.options=Pp.assign({level:GU,method:qU,chunkSize:16384,windowBits:15,memLevel:8,strategy:YU},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new JR,this.strm.avail_out=0;let n=eu.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(n!==Oh)throw new Error($c[n]);if(e.header&&eu.deflateSetHeader(this.strm,e.header),e.dictionary){let r;if(typeof e.dictionary=="string"?r=Ku.string2buf(e.dictionary):eN.call(e.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(e.dictionary):r=e.dictionary,n=eu.deflateSetDictionary(this.strm,r),n!==Oh)throw new Error($c[n]);this._dict_set=!0}}B_.prototype.push=function(t,e){const n=this.strm,r=this.options.chunkSize;let i,s;if(this.ended)return!1;for(e===~~e?s=e:s=e===!0?ZU:HU,typeof t=="string"?n.input=Ku.string2buf(t):eN.call(t)==="[object ArrayBuffer]"?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(s===$U||s===VU)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(i=eu.deflate(n,s),i===KU)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=eu.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Oh;if(n.avail_out===0){this.onData(n.output);continue}if(s>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0};B_.prototype.onData=function(t){this.chunks.push(t)};B_.prototype.onEnd=function(t){t===Oh&&(this.result=Pp.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};const Jd=16209,QU=16191;var XU=function(e,n){let r,i,s,o,a,c,l,u,f,g,p,_,A,S,E,b,x,M,L,z,D,F,$,V;const G=e.state;r=e.next_in,$=e.input,i=r+(e.avail_in-5),s=e.next_out,V=e.output,o=s-(n-e.avail_out),a=s+(e.avail_out-257),c=G.dmax,l=G.wsize,u=G.whave,f=G.wnext,g=G.window,p=G.hold,_=G.bits,A=G.lencode,S=G.distcode,E=(1<<G.lenbits)-1,b=(1<<G.distbits)-1;e:do{_<15&&(p+=$[r++]<<_,_+=8,p+=$[r++]<<_,_+=8),x=A[p&E];t:for(;;){if(M=x>>>24,p>>>=M,_-=M,M=x>>>16&255,M===0)V[s++]=x&65535;else if(M&16){L=x&65535,M&=15,M&&(_<M&&(p+=$[r++]<<_,_+=8),L+=p&(1<<M)-1,p>>>=M,_-=M),_<15&&(p+=$[r++]<<_,_+=8,p+=$[r++]<<_,_+=8),x=S[p&b];n:for(;;){if(M=x>>>24,p>>>=M,_-=M,M=x>>>16&255,M&16){if(z=x&65535,M&=15,_<M&&(p+=$[r++]<<_,_+=8,_<M&&(p+=$[r++]<<_,_+=8)),z+=p&(1<<M)-1,z>c){e.msg="invalid distance too far back",G.mode=Jd;break e}if(p>>>=M,_-=M,M=s-o,z>M){if(M=z-M,M>u&&G.sane){e.msg="invalid distance too far back",G.mode=Jd;break e}if(D=0,F=g,f===0){if(D+=l-M,M<L){L-=M;do V[s++]=g[D++];while(--M);D=s-z,F=V}}else if(f<M){if(D+=l+f-M,M-=f,M<L){L-=M;do V[s++]=g[D++];while(--M);if(D=0,f<L){M=f,L-=M;do V[s++]=g[D++];while(--M);D=s-z,F=V}}}else if(D+=f-M,M<L){L-=M;do V[s++]=g[D++];while(--M);D=s-z,F=V}for(;L>2;)V[s++]=F[D++],V[s++]=F[D++],V[s++]=F[D++],L-=3;L&&(V[s++]=F[D++],L>1&&(V[s++]=F[D++]))}else{D=s-z;do V[s++]=V[D++],V[s++]=V[D++],V[s++]=V[D++],L-=3;while(L>2);L&&(V[s++]=V[D++],L>1&&(V[s++]=V[D++]))}}else if(M&64){e.msg="invalid distance code",G.mode=Jd;break e}else{x=S[(x&65535)+(p&(1<<M)-1)];continue n}break}}else if(M&64)if(M&32){G.mode=QU;break e}else{e.msg="invalid literal/length code",G.mode=Jd;break e}else{x=A[(x&65535)+(p&(1<<M)-1)];continue t}break}}while(r<i&&s<a);L=_>>3,r-=L,_-=L<<3,p&=(1<<_)-1,e.next_in=r,e.next_out=s,e.avail_in=r<i?5+(i-r):5-(r-i),e.avail_out=s<a?257+(a-s):257-(s-a),G.hold=p,G.bits=_};const Ba=15,$b=852,Vb=592,Zb=0,_g=1,Kb=2,JU=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),eF=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),tF=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),nF=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),rF=(t,e,n,r,i,s,o,a)=>{const c=a.bits;let l=0,u=0,f=0,g=0,p=0,_=0,A=0,S=0,E=0,b=0,x,M,L,z,D,F=null,$;const V=new Uint16Array(Ba+1),G=new Uint16Array(Ba+1);let W=null,N,d,h;for(l=0;l<=Ba;l++)V[l]=0;for(u=0;u<r;u++)V[e[n+u]]++;for(p=c,g=Ba;g>=1&&V[g]===0;g--);if(p>g&&(p=g),g===0)return i[s++]=1<<24|64<<16|0,i[s++]=1<<24|64<<16|0,a.bits=1,0;for(f=1;f<g&&V[f]===0;f++);for(p<f&&(p=f),S=1,l=1;l<=Ba;l++)if(S<<=1,S-=V[l],S<0)return-1;if(S>0&&(t===Zb||g!==1))return-1;for(G[1]=0,l=1;l<Ba;l++)G[l+1]=G[l]+V[l];for(u=0;u<r;u++)e[n+u]!==0&&(o[G[e[n+u]]++]=u);if(t===Zb?(F=W=o,$=20):t===_g?(F=JU,W=eF,$=257):(F=tF,W=nF,$=0),b=0,u=0,l=f,D=s,_=p,A=0,L=-1,E=1<<p,z=E-1,t===_g&&E>$b||t===Kb&&E>Vb)return 1;for(;;){N=l-A,o[u]+1<$?(d=0,h=o[u]):o[u]>=$?(d=W[o[u]-$],h=F[o[u]-$]):(d=96,h=0),x=1<<l-A,M=1<<_,f=M;do M-=x,i[D+(b>>A)+M]=N<<24|d<<16|h|0;while(M!==0);for(x=1<<l-1;b&x;)x>>=1;if(x!==0?(b&=x-1,b+=x):b=0,u++,--V[l]===0){if(l===g)break;l=e[n+o[u]]}if(l>p&&(b&z)!==L){for(A===0&&(A=p),D+=f,_=l-A,S=1<<_;_+A<g&&(S-=V[_+A],!(S<=0));)_++,S<<=1;if(E+=1<<_,t===_g&&E>$b||t===Kb&&E>Vb)return 1;L=b&z,i[L]=p<<24|_<<16|D-s|0}}return b!==0&&(i[D+b]=l-A<<24|64<<16|0),a.bits=p,0};var tu=rF;const iF=0,tN=1,nN=2,{Z_FINISH:Gb,Z_BLOCK:sF,Z_TREES:ef,Z_OK:Ea,Z_STREAM_END:oF,Z_NEED_DICT:aF,Z_STREAM_ERROR:Qr,Z_DATA_ERROR:rN,Z_MEM_ERROR:iN,Z_BUF_ERROR:cF,Z_DEFLATED:Yb}=md,Bp=16180,qb=16181,Qb=16182,Xb=16183,Jb=16184,eE=16185,tE=16186,nE=16187,rE=16188,iE=16189,Ch=16190,qi=16191,vg=16192,sE=16193,bg=16194,oE=16195,aE=16196,cE=16197,lE=16198,tf=16199,nf=16200,uE=16201,dE=16202,fE=16203,hE=16204,pE=16205,Eg=16206,gE=16207,yE=16208,Ot=16209,sN=16210,oN=16211,lF=852,uF=592,dF=15,fF=dF,mE=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function hF(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Ma=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<Bp||e.mode>oN?1:0},aN=t=>{if(Ma(t))return Qr;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=Bp,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(lF),e.distcode=e.distdyn=new Int32Array(uF),e.sane=1,e.back=-1,Ea},cN=t=>{if(Ma(t))return Qr;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,aN(t)},lN=(t,e)=>{let n;if(Ma(t))return Qr;const r=t.state;return e<0?(n=0,e=-e):(n=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?Qr:(r.window!==null&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,cN(t))},uN=(t,e)=>{if(!t)return Qr;const n=new hF;t.state=n,n.strm=t,n.window=null,n.mode=Bp;const r=lN(t,e);return r!==Ea&&(t.state=null),r},pF=t=>uN(t,fF);let wE=!0,xg,Sg;const gF=t=>{if(wE){xg=new Int32Array(512),Sg=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(tu(tN,t.lens,0,288,xg,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;tu(nN,t.lens,0,32,Sg,0,t.work,{bits:5}),wE=!1}t.lencode=xg,t.lenbits=9,t.distcode=Sg,t.distbits=5},dN=(t,e,n,r)=>{let i;const s=t.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),r>=s.wsize?(s.window.set(e.subarray(n-s.wsize,n),0),s.wnext=0,s.whave=s.wsize):(i=s.wsize-s.wnext,i>r&&(i=r),s.window.set(e.subarray(n-r,n-r+i),s.wnext),r-=i,r?(s.window.set(e.subarray(n-r,n),0),s.wnext=r,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=i))),0},yF=(t,e)=>{let n,r,i,s,o,a,c,l,u,f,g,p,_,A,S=0,E,b,x,M,L,z,D,F;const $=new Uint8Array(4);let V,G;const W=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Ma(t)||!t.output||!t.input&&t.avail_in!==0)return Qr;n=t.state,n.mode===qi&&(n.mode=vg),o=t.next_out,i=t.output,c=t.avail_out,s=t.next_in,r=t.input,a=t.avail_in,l=n.hold,u=n.bits,f=a,g=c,F=Ea;e:for(;;)switch(n.mode){case Bp:if(n.wrap===0){n.mode=vg;break}for(;u<16;){if(a===0)break e;a--,l+=r[s++]<<u,u+=8}if(n.wrap&2&&l===35615){n.wbits===0&&(n.wbits=15),n.check=0,$[0]=l&255,$[1]=l>>>8&255,n.check=Sn(n.check,$,2,0),l=0,u=0,n.mode=qb;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((l&255)<<8)+(l>>8))%31){t.msg="incorrect header check",n.mode=Ot;break}if((l&15)!==Yb){t.msg="unknown compression method",n.mode=Ot;break}if(l>>>=4,u-=4,D=(l&15)+8,n.wbits===0&&(n.wbits=D),D>15||D>n.wbits){t.msg="invalid window size",n.mode=Ot;break}n.dmax=1<<n.wbits,n.flags=0,t.adler=n.check=1,n.mode=l&512?iE:qi,l=0,u=0;break;case qb:for(;u<16;){if(a===0)break e;a--,l+=r[s++]<<u,u+=8}if(n.flags=l,(n.flags&255)!==Yb){t.msg="unknown compression method",n.mode=Ot;break}if(n.flags&57344){t.msg="unknown header flags set",n.mode=Ot;break}n.head&&(n.head.text=l>>8&1),n.flags&512&&n.wrap&4&&($[0]=l&255,$[1]=l>>>8&255,n.check=Sn(n.check,$,2,0)),l=0,u=0,n.mode=Qb;case Qb:for(;u<32;){if(a===0)break e;a--,l+=r[s++]<<u,u+=8}n.head&&(n.head.time=l),n.flags&512&&n.wrap&4&&($[0]=l&255,$[1]=l>>>8&255,$[2]=l>>>16&255,$[3]=l>>>24&255,n.check=Sn(n.check,$,4,0)),l=0,u=0,n.mode=Xb;case Xb:for(;u<16;){if(a===0)break e;a--,l+=r[s++]<<u,u+=8}n.head&&(n.head.xflags=l&255,n.head.os=l>>8),n.flags&512&&n.wrap&4&&($[0]=l&255,$[1]=l>>>8&255,n.check=Sn(n.check,$,2,0)),l=0,u=0,n.mode=Jb;case Jb:if(n.flags&1024){for(;u<16;){if(a===0)break e;a--,l+=r[s++]<<u,u+=8}n.length=l,n.head&&(n.head.extra_len=l),n.flags&512&&n.wrap&4&&($[0]=l&255,$[1]=l>>>8&255,n.check=Sn(n.check,$,2,0)),l=0,u=0}else n.head&&(n.head.extra=null);n.mode=eE;case eE:if(n.flags&1024&&(p=n.length,p>a&&(p=a),p&&(n.head&&(D=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(s,s+p),D)),n.flags&512&&n.wrap&4&&(n.check=Sn(n.check,r,p,s)),a-=p,s+=p,n.length-=p),n.length))break e;n.length=0,n.mode=tE;case tE:if(n.flags&2048){if(a===0)break e;p=0;do D=r[s+p++],n.head&&D&&n.length<65536&&(n.head.name+=String.fromCharCode(D));while(D&&p<a);if(n.flags&512&&n.wrap&4&&(n.check=Sn(n.check,r,p,s)),a-=p,s+=p,D)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=nE;case nE:if(n.flags&4096){if(a===0)break e;p=0;do D=r[s+p++],n.head&&D&&n.length<65536&&(n.head.comment+=String.fromCharCode(D));while(D&&p<a);if(n.flags&512&&n.wrap&4&&(n.check=Sn(n.check,r,p,s)),a-=p,s+=p,D)break e}else n.head&&(n.head.comment=null);n.mode=rE;case rE:if(n.flags&512){for(;u<16;){if(a===0)break e;a--,l+=r[s++]<<u,u+=8}if(n.wrap&4&&l!==(n.check&65535)){t.msg="header crc mismatch",n.mode=Ot;break}l=0,u=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=qi;break;case iE:for(;u<32;){if(a===0)break e;a--,l+=r[s++]<<u,u+=8}t.adler=n.check=mE(l),l=0,u=0,n.mode=Ch;case Ch:if(n.havedict===0)return t.next_out=o,t.avail_out=c,t.next_in=s,t.avail_in=a,n.hold=l,n.bits=u,aF;t.adler=n.check=1,n.mode=qi;case qi:if(e===sF||e===ef)break e;case vg:if(n.last){l>>>=u&7,u-=u&7,n.mode=Eg;break}for(;u<3;){if(a===0)break e;a--,l+=r[s++]<<u,u+=8}switch(n.last=l&1,l>>>=1,u-=1,l&3){case 0:n.mode=sE;break;case 1:if(gF(n),n.mode=tf,e===ef){l>>>=2,u-=2;break e}break;case 2:n.mode=aE;break;case 3:t.msg="invalid block type",n.mode=Ot}l>>>=2,u-=2;break;case sE:for(l>>>=u&7,u-=u&7;u<32;){if(a===0)break e;a--,l+=r[s++]<<u,u+=8}if((l&65535)!==(l>>>16^65535)){t.msg="invalid stored block lengths",n.mode=Ot;break}if(n.length=l&65535,l=0,u=0,n.mode=bg,e===ef)break e;case bg:n.mode=oE;case oE:if(p=n.length,p){if(p>a&&(p=a),p>c&&(p=c),p===0)break e;i.set(r.subarray(s,s+p),o),a-=p,s+=p,c-=p,o+=p,n.length-=p;break}n.mode=qi;break;case aE:for(;u<14;){if(a===0)break e;a--,l+=r[s++]<<u,u+=8}if(n.nlen=(l&31)+257,l>>>=5,u-=5,n.ndist=(l&31)+1,l>>>=5,u-=5,n.ncode=(l&15)+4,l>>>=4,u-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=Ot;break}n.have=0,n.mode=cE;case cE:for(;n.have<n.ncode;){for(;u<3;){if(a===0)break e;a--,l+=r[s++]<<u,u+=8}n.lens[W[n.have++]]=l&7,l>>>=3,u-=3}for(;n.have<19;)n.lens[W[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,V={bits:n.lenbits},F=tu(iF,n.lens,0,19,n.lencode,0,n.work,V),n.lenbits=V.bits,F){t.msg="invalid code lengths set",n.mode=Ot;break}n.have=0,n.mode=lE;case lE:for(;n.have<n.nlen+n.ndist;){for(;S=n.lencode[l&(1<<n.lenbits)-1],E=S>>>24,b=S>>>16&255,x=S&65535,!(E<=u);){if(a===0)break e;a--,l+=r[s++]<<u,u+=8}if(x<16)l>>>=E,u-=E,n.lens[n.have++]=x;else{if(x===16){for(G=E+2;u<G;){if(a===0)break e;a--,l+=r[s++]<<u,u+=8}if(l>>>=E,u-=E,n.have===0){t.msg="invalid bit length repeat",n.mode=Ot;break}D=n.lens[n.have-1],p=3+(l&3),l>>>=2,u-=2}else if(x===17){for(G=E+3;u<G;){if(a===0)break e;a--,l+=r[s++]<<u,u+=8}l>>>=E,u-=E,D=0,p=3+(l&7),l>>>=3,u-=3}else{for(G=E+7;u<G;){if(a===0)break e;a--,l+=r[s++]<<u,u+=8}l>>>=E,u-=E,D=0,p=11+(l&127),l>>>=7,u-=7}if(n.have+p>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=Ot;break}for(;p--;)n.lens[n.have++]=D}}if(n.mode===Ot)break;if(n.lens[256]===0){t.msg="invalid code -- missing end-of-block",n.mode=Ot;break}if(n.lenbits=9,V={bits:n.lenbits},F=tu(tN,n.lens,0,n.nlen,n.lencode,0,n.work,V),n.lenbits=V.bits,F){t.msg="invalid literal/lengths set",n.mode=Ot;break}if(n.distbits=6,n.distcode=n.distdyn,V={bits:n.distbits},F=tu(nN,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,V),n.distbits=V.bits,F){t.msg="invalid distances set",n.mode=Ot;break}if(n.mode=tf,e===ef)break e;case tf:n.mode=nf;case nf:if(a>=6&&c>=258){t.next_out=o,t.avail_out=c,t.next_in=s,t.avail_in=a,n.hold=l,n.bits=u,XU(t,g),o=t.next_out,i=t.output,c=t.avail_out,s=t.next_in,r=t.input,a=t.avail_in,l=n.hold,u=n.bits,n.mode===qi&&(n.back=-1);break}for(n.back=0;S=n.lencode[l&(1<<n.lenbits)-1],E=S>>>24,b=S>>>16&255,x=S&65535,!(E<=u);){if(a===0)break e;a--,l+=r[s++]<<u,u+=8}if(b&&!(b&240)){for(M=E,L=b,z=x;S=n.lencode[z+((l&(1<<M+L)-1)>>M)],E=S>>>24,b=S>>>16&255,x=S&65535,!(M+E<=u);){if(a===0)break e;a--,l+=r[s++]<<u,u+=8}l>>>=M,u-=M,n.back+=M}if(l>>>=E,u-=E,n.back+=E,n.length=x,b===0){n.mode=pE;break}if(b&32){n.back=-1,n.mode=qi;break}if(b&64){t.msg="invalid literal/length code",n.mode=Ot;break}n.extra=b&15,n.mode=uE;case uE:if(n.extra){for(G=n.extra;u<G;){if(a===0)break e;a--,l+=r[s++]<<u,u+=8}n.length+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=dE;case dE:for(;S=n.distcode[l&(1<<n.distbits)-1],E=S>>>24,b=S>>>16&255,x=S&65535,!(E<=u);){if(a===0)break e;a--,l+=r[s++]<<u,u+=8}if(!(b&240)){for(M=E,L=b,z=x;S=n.distcode[z+((l&(1<<M+L)-1)>>M)],E=S>>>24,b=S>>>16&255,x=S&65535,!(M+E<=u);){if(a===0)break e;a--,l+=r[s++]<<u,u+=8}l>>>=M,u-=M,n.back+=M}if(l>>>=E,u-=E,n.back+=E,b&64){t.msg="invalid distance code",n.mode=Ot;break}n.offset=x,n.extra=b&15,n.mode=fE;case fE:if(n.extra){for(G=n.extra;u<G;){if(a===0)break e;a--,l+=r[s++]<<u,u+=8}n.offset+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=Ot;break}n.mode=hE;case hE:if(c===0)break e;if(p=g-c,n.offset>p){if(p=n.offset-p,p>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=Ot;break}p>n.wnext?(p-=n.wnext,_=n.wsize-p):_=n.wnext-p,p>n.length&&(p=n.length),A=n.window}else A=i,_=o-n.offset,p=n.length;p>c&&(p=c),c-=p,n.length-=p;do i[o++]=A[_++];while(--p);n.length===0&&(n.mode=nf);break;case pE:if(c===0)break e;i[o++]=n.length,c--,n.mode=nf;break;case Eg:if(n.wrap){for(;u<32;){if(a===0)break e;a--,l|=r[s++]<<u,u+=8}if(g-=c,t.total_out+=g,n.total+=g,n.wrap&4&&g&&(t.adler=n.check=n.flags?Sn(n.check,i,g,o-g):Vu(n.check,i,g,o-g)),g=c,n.wrap&4&&(n.flags?l:mE(l))!==n.check){t.msg="incorrect data check",n.mode=Ot;break}l=0,u=0}n.mode=gE;case gE:if(n.wrap&&n.flags){for(;u<32;){if(a===0)break e;a--,l+=r[s++]<<u,u+=8}if(n.wrap&4&&l!==(n.total&4294967295)){t.msg="incorrect length check",n.mode=Ot;break}l=0,u=0}n.mode=yE;case yE:F=oF;break e;case Ot:F=rN;break e;case sN:return iN;case oN:default:return Qr}return t.next_out=o,t.avail_out=c,t.next_in=s,t.avail_in=a,n.hold=l,n.bits=u,(n.wsize||g!==t.avail_out&&n.mode<Ot&&(n.mode<Eg||e!==Gb))&&dN(t,t.output,t.next_out,g-t.avail_out),f-=t.avail_in,g-=t.avail_out,t.total_in+=f,t.total_out+=g,n.total+=g,n.wrap&4&&g&&(t.adler=n.check=n.flags?Sn(n.check,i,g,t.next_out-g):Vu(n.check,i,g,t.next_out-g)),t.data_type=n.bits+(n.last?64:0)+(n.mode===qi?128:0)+(n.mode===tf||n.mode===bg?256:0),(f===0&&g===0||e===Gb)&&F===Ea&&(F=cF),F},mF=t=>{if(Ma(t))return Qr;let e=t.state;return e.window&&(e.window=null),t.state=null,Ea},wF=(t,e)=>{if(Ma(t))return Qr;const n=t.state;return n.wrap&2?(n.head=e,e.done=!1,Ea):Qr},_F=(t,e)=>{const n=e.length;let r,i,s;return Ma(t)||(r=t.state,r.wrap!==0&&r.mode!==Ch)?Qr:r.mode===Ch&&(i=1,i=Vu(i,e,n,0),i!==r.check)?rN:(s=dN(t,e,n,n),s?(r.mode=sN,iN):(r.havedict=1,Ea))};var vF=cN,bF=lN,EF=aN,xF=pF,SF=uN,AF=yF,IF=mF,kF=wF,RF=_F,NF="pako inflate (from Nodeca project)",is={inflateReset:vF,inflateReset2:bF,inflateResetKeep:EF,inflateInit:xF,inflateInit2:SF,inflate:AF,inflateEnd:IF,inflateGetHeader:kF,inflateSetDictionary:RF,inflateInfo:NF};function TF(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var MF=TF;const fN=Object.prototype.toString,{Z_NO_FLUSH:OF,Z_FINISH:CF,Z_OK:Gu,Z_STREAM_END:Ag,Z_NEED_DICT:Ig,Z_STREAM_ERROR:LF,Z_DATA_ERROR:_E,Z_MEM_ERROR:DF}=md;function _d(t){this.options=Pp.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new JR,this.strm.avail_out=0;let n=is.inflateInit2(this.strm,e.windowBits);if(n!==Gu)throw new Error($c[n]);if(this.header=new MF,is.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Ku.string2buf(e.dictionary):fN.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=is.inflateSetDictionary(this.strm,e.dictionary),n!==Gu)))throw new Error($c[n])}_d.prototype.push=function(t,e){const n=this.strm,r=this.options.chunkSize,i=this.options.dictionary;let s,o,a;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?CF:OF,fN.call(t)==="[object ArrayBuffer]"?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),s=is.inflate(n,o),s===Ig&&i&&(s=is.inflateSetDictionary(n,i),s===Gu?s=is.inflate(n,o):s===_E&&(s=Ig));n.avail_in>0&&s===Ag&&n.state.wrap>0&&t[n.next_in]!==0;)is.inflateReset(n),s=is.inflate(n,o);switch(s){case LF:case _E:case Ig:case DF:return this.onEnd(s),this.ended=!0,!1}if(a=n.avail_out,n.next_out&&(n.avail_out===0||s===Ag))if(this.options.to==="string"){let c=Ku.utf8border(n.output,n.next_out),l=n.next_out-c,u=Ku.buf2string(n.output,c);n.next_out=l,n.avail_out=r-l,l&&n.output.set(n.output.subarray(c,c+l),0),this.onData(u)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(s===Gu&&a===0)){if(s===Ag)return s=is.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(n.avail_in===0)break}}return!0};_d.prototype.onData=function(t){this.chunks.push(t)};_d.prototype.onEnd=function(t){t===Gu&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Pp.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function z_(t,e){const n=new _d(e);if(n.push(t),n.err)throw n.msg||$c[n.err];return n.result}function PF(t,e){return e=e||{},e.raw=!0,z_(t,e)}var BF=_d,zF=z_,jF=PF,UF=z_,FF=md,WF={Inflate:BF,inflate:zF,inflateRaw:jF,ungzip:UF,constants:FF};const{Inflate:bH,inflate:HF,inflateRaw:EH,ungzip:xH}=WF;var $F=HF;function VF(t,e){return Array.apply(0,new Array(Math.ceil(t.length/e))).map((n,r)=>t.slice(r*e,(r+1)*e))}const Po=t=>"version"in t;function ZF(t){return new TextDecoder("utf-8").decode(t)}function vE(t){return jt.encode(t)}function bE(t){return t.toString("base64")}function hN(t){return re.Buffer.from(t,"base64")}function sc(t){return"accounts"in t}async function KF(t){const e=(await ie.findProgramAddress([],t))[0];return await ie.createWithSeed(e,GF(),t)}function GF(){return"anchor:idl"}const YF=$e.struct([$e.publicKey("authority"),$e.vecU8("data")]);function qF(t){return YF.decode(t)}function QF(t){const e=["name","path","account","relations","generic"],n=s=>s.split(".").map(u5).join("."),r=s=>{for(const o in s){const a=s[o];e.includes(o)?s[o]=Array.isArray(a)?a.map(n):n(a):typeof a=="object"&&r(a)}},i=structuredClone(t);return r(i),i}function oc(t,e,n,r){return t!=null&&t.length?t[0].name?n(t):r(t):e()}function XF(t){const e=new Map;return t.errors&&t.errors.forEach(n=>{var r;let i=(r=n.msg)!==null&&r!==void 0?r:n.name;e.set(n.code,i)}),e}function JF(t,...e){if(t.args.length!=e.length)throw new Error("Invalid argument length");const n={};let r=0;return t.args.forEach(i=>{n[i.name]=e[r],r+=1}),n}function pN(t,e={}){t.forEach(n=>{if(sc(n))pN(n.accounts,e[n.name]);else if(!e[n.name])throw new Error(`Account \`${n.name}\` not provided.`)})}function ai(t){return t instanceof ie?t:new ie(t)}class eW extends TypeError{constructor(e,n){let r;const{message:i,...s}=e,{path:o}=e,a=o.length===0?i:"At path: "+o.join(".")+" -- "+i;super(a),this.value=void 0,this.key=void 0,this.type=void 0,this.refinement=void 0,this.path=void 0,this.branch=void 0,this.failures=void 0,Object.assign(this,s),this.name=this.constructor.name,this.failures=()=>{var c;return(c=r)!=null?c:r=[e,...n()]}}}function tW(t){return Ec(t)&&typeof t[Symbol.iterator]=="function"}function Ec(t){return typeof t=="object"&&t!=null}function ko(t){return typeof t=="string"?JSON.stringify(t):""+t}function nW(t){const{done:e,value:n}=t.next();return e?void 0:n}function rW(t,e,n,r){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:i,branch:s}=e,{type:o}=n,{refinement:a,message:c="Expected a value of type `"+o+"`"+(a?" with refinement `"+a+"`":"")+", but received: `"+ko(r)+"`"}=t;return{value:r,type:o,refinement:a,key:i[i.length-1],path:i,branch:s,...t,message:c}}function*EE(t,e,n,r){tW(t)||(t=[t]);for(const i of t){const s=rW(i,e,n,r);s&&(yield s)}}function*j_(t,e,n){n===void 0&&(n={});const{path:r=[],branch:i=[t],coerce:s=!1,mask:o=!1}=n,a={path:r,branch:i};if(s&&(t=e.coercer(t,a),o&&e.type!=="type"&&Ec(e.schema)&&Ec(t)&&!Array.isArray(t)))for(const l in t)e.schema[l]===void 0&&delete t[l];let c=!0;for(const l of e.validator(t,a))c=!1,yield[l,void 0];for(let[l,u,f]of e.entries(t,a)){const g=j_(u,f,{path:l===void 0?r:[...r,l],branch:l===void 0?i:[...i,u],coerce:s,mask:o});for(const p of g)p[0]?(c=!1,yield[p[0],void 0]):s&&(u=p[1],l===void 0?t=u:t instanceof Map?t.set(l,u):t instanceof Set?t.add(u):Ec(t)&&(t[l]=u))}if(c)for(const l of e.refiner(t,a))c=!1,yield[l,void 0];c&&(yield[void 0,t])}class Do{constructor(e){this.TYPE=void 0,this.type=void 0,this.schema=void 0,this.coercer=void 0,this.validator=void 0,this.refiner=void 0,this.entries=void 0;const{type:n,schema:r,validator:i,refiner:s,coercer:o=c=>c,entries:a=function*(){}}=e;this.type=n,this.schema=r,this.entries=a,this.coercer=o,i?this.validator=(c,l)=>{const u=i(c,l);return EE(u,l,this,c)}:this.validator=()=>[],s?this.refiner=(c,l)=>{const u=s(c,l);return EE(u,l,this,c)}:this.refiner=()=>[]}assert(e){return iW(e,this)}create(e){return U_(e,this)}is(e){return gN(e,this)}mask(e){return sW(e,this)}validate(e,n){return n===void 0&&(n={}),vd(e,this,n)}}function iW(t,e){const n=vd(t,e);if(n[0])throw n[0]}function U_(t,e){const n=vd(t,e,{coerce:!0});if(n[0])throw n[0];return n[1]}function sW(t,e){const n=vd(t,e,{coerce:!0,mask:!0});if(n[0])throw n[0];return n[1]}function gN(t,e){return!vd(t,e)[0]}function vd(t,e,n){n===void 0&&(n={});const r=j_(t,e,n),i=nW(r);return i[0]?[new eW(i[0],function*(){for(const o of r)o[0]&&(yield o[0])}),void 0]:[void 0,i[1]]}function bd(t,e){return new Do({type:t,schema:null,validator:e})}function oW(){return bd("any",()=>!0)}function kg(t){return new Do({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[n,r]of e.entries())yield[n,r,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||"Expected an array value, but received: "+ko(e)}})}function aW(){return bd("boolean",t=>typeof t=="boolean")}function xE(t){const e=ko(t);return new Do({type:"literal",schema:t,validator(n){return n===t||"Expected the literal `"+e+"`, but received: "+ko(n)}})}function rf(t){return new Do({...t,validator:(e,n)=>e===null||t.validator(e,n),refiner:(e,n)=>e===null||t.refiner(e,n)})}function Rf(){return bd("number",t=>typeof t=="number"&&!isNaN(t)||"Expected a number, but received: "+ko(t))}function Nf(t){return new Do({...t,validator:(e,n)=>e===void 0||t.validator(e,n),refiner:(e,n)=>e===void 0||t.refiner(e,n)})}function ta(){return bd("string",t=>typeof t=="string"||"Expected a string, but received: "+ko(t))}function po(t){const e=Object.keys(t);return new Do({type:"type",schema:t,*entries(n){if(Ec(n))for(const r of e)yield[r,n[r],t[r]]},validator(n){return Ec(n)||"Expected an object, but received: "+ko(n)}})}function yN(t){const e=t.map(n=>n.type).join(" | ");return new Do({type:"union",schema:null,coercer(n,r){return(t.find(s=>{const[o]=s.validate(n,{coerce:!0});return!o})||F_()).coercer(n,r)},validator(n,r){const i=[];for(const s of t){const[...o]=j_(n,s,r),[a]=o;if(a[0])for(const[c]of o)c&&i.push(c);else return[]}return["Expected the value to satisfy a union of `"+e+"`, but received: "+ko(n),...i]}})}function F_(){return bd("unknown",()=>!0)}function cW(t,e,n){return new Do({...t,coercer:(r,i)=>gN(r,e)?t.coercer(n(r,i),i):t.coercer(r,i)})}const SE=99;async function lW(t,e,n){if(e.length<=SE)return await AE(t,e,n);{const r=VF(e,SE);return(await Promise.all(r.map(s=>AE(t,s,n)))).flat()}}async function AE(t,e,n){const r=n??t.commitment,{value:i,context:s}=await t.getMultipleAccountsInfoAndContext(e,r);return i.map((a,c)=>a===null?null:{publicKey:e[c],account:a,context:s})}async function uW(t,e,n,r,i){var s;n&&n.length>0&&e.sign(...n);const o=e._compile(),a=o.serialize(),l=e._serialize(a).toString("base64"),u={encoding:"base64",commitment:r??t.commitment};if(i){const _=(Array.isArray(i)?i:o.nonProgramIds()).map(A=>A.toBase58());u.accounts={encoding:"base64",addresses:_}}n&&n.length>0&&(u.sigVerify=!0);const f=[l,u],g=await t._rpcRequest("simulateTransaction",f),p=U_(g,pW);if("error"in p){let _;if("data"in p.error&&(_=(s=p.error.data)===null||s===void 0?void 0:s.logs,_&&Array.isArray(_))){const A=` + `,S=A+_.join(A);console.error(p.error.message,S)}throw new mo("failed to simulate transaction: "+p.error.message,_)}return p.result}function dW(t){return cW(mN(t),fW,e=>"error"in e?e:{...e,result:U_(e.result,t)})}const fW=mN(F_());function mN(t){return yN([po({jsonrpc:xE("2.0"),id:ta(),result:t}),po({jsonrpc:xE("2.0"),id:ta(),error:po({code:F_(),message:ta(),data:Nf(oW())})})])}function hW(t){return dW(po({context:po({slot:Rf()}),value:t}))}const pW=hW(po({err:rf(yN([po({}),ta()])),logs:rf(kg(ta())),accounts:Nf(rf(kg(rf(po({executable:aW(),owner:ta(),lamports:Rf(),data:kg(ta()),rentEpoch:Nf(Rf())}))))),unitsConsumed:Nf(Rf())}));class Yu{constructor(e,n,r=Yu.defaultOptions()){this.connection=e,this.wallet=n,this.opts=r,this.publicKey=n==null?void 0:n.publicKey}static defaultOptions(){return{preflightCommitment:"processed",commitment:"processed"}}static local(e,n=Yu.defaultOptions()){throw new Error("Provider local is not available on browser.")}static env(){throw new Error("Provider env is not available on browser.")}async sendAndConfirm(e,n,r){var i,s,o,a;if(r===void 0&&(r=this.opts),Po(e))n&&e.sign(n);else if(e.feePayer=(i=e.feePayer)!==null&&i!==void 0?i:this.wallet.publicKey,e.recentBlockhash=(await this.connection.getLatestBlockhash(r.preflightCommitment)).blockhash,n)for(const l of n)e.partialSign(l);e=await this.wallet.signTransaction(e);const c=e.serialize();try{return await IE(this.connection,c,r)}catch(l){if(l instanceof gm){const u=vE(Po(e)?((s=e.signatures)===null||s===void 0?void 0:s[0])||new Uint8Array:(o=e.signature)!==null&&o!==void 0?o:new Uint8Array),f=Po(e)?0:void 0,g=await this.connection.getTransaction(u,{commitment:"confirmed",maxSupportedTransactionVersion:f});if(g){const p=(a=g.meta)===null||a===void 0?void 0:a.logMessages;throw p?new mo(l.message,p):l}else throw l}else throw l}}async sendAll(e,n){var r,i,s;n===void 0&&(n=this.opts);const o=(await this.connection.getLatestBlockhash(n.preflightCommitment)).blockhash;let a=e.map(u=>{var f,g;if(Po(u.tx)){let p=u.tx;return u.signers&&p.sign(u.signers),p}else{let p=u.tx,_=(f=u.signers)!==null&&f!==void 0?f:[];return p.feePayer=(g=p.feePayer)!==null&&g!==void 0?g:this.wallet.publicKey,p.recentBlockhash=o,_.forEach(A=>{p.partialSign(A)}),p}});const c=await this.wallet.signAllTransactions(a),l=[];for(let u=0;u<a.length;u+=1){const f=c[u],g=f.serialize();try{l.push(await IE(this.connection,g,n))}catch(p){if(p instanceof gm){const _=vE(Po(f)?((r=f.signatures)===null||r===void 0?void 0:r[0])||new Uint8Array:(i=f.signature)!==null&&i!==void 0?i:new Uint8Array),A=Po(f)?0:void 0,S=await this.connection.getTransaction(_,{commitment:"confirmed",maxSupportedTransactionVersion:A});if(S){const E=(s=S.meta)===null||s===void 0?void 0:s.logMessages;throw E?new mo(p.message,E):p}else throw p}else throw p}}return l}async simulate(e,n,r,i){let s=(await this.connection.getLatestBlockhash(r??this.connection.commitment)).blockhash,o;if(Po(e)?(n&&n.length>0&&(e.sign(n),e=await this.wallet.signTransaction(e)),o=await this.connection.simulateTransaction(e,{commitment:r})):(e.feePayer=e.feePayer||this.wallet.publicKey,e.recentBlockhash=s,n&&n.length>0&&(e=await this.wallet.signTransaction(e)),o=await uW(this.connection,e,n,r,i)),o.value.err)throw new gW(o.value);return o.value}}class gW extends Error{constructor(e,n){super(n),this.simulationResponse=e}}async function IE(t,e,n){const r=n&&{skipPreflight:n.skipPreflight,preflightCommitment:n.preflightCommitment||n.commitment},i=await t.sendRawTransaction(e,r),s=(await t.confirmTransaction(i,n&&n.commitment)).value;if(s.err)throw new gm(`Raw transaction ${i} failed (${JSON.stringify(s)})`);return i}class gm extends Error{constructor(e){super(e)}}function ym(){return Yu.local()}var yW=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},q={};Object.defineProperty(q,"__esModule",{value:!0});var wN=q.ANCHOR_ERROR__REQUIRE_EQ_VIOLATED=pT=q.ANCHOR_ERROR__REQUIRE_VIOLATED=hT=q.ANCHOR_ERROR__CONSTRAINT_MINT_TRANSFER_HOOK_EXTENSION_PROGRAM_ID=fT=q.ANCHOR_ERROR__CONSTRAINT_MINT_TRANSFER_HOOK_EXTENSION_AUTHORITY=dT=q.ANCHOR_ERROR__CONSTRAINT_MINT_TRANSFER_HOOK_EXTENSION=uT=q.ANCHOR_ERROR__CONSTRAINT_MINT_PERMANENT_DELEGATE_EXTENSION_DELEGATE=lT=q.ANCHOR_ERROR__CONSTRAINT_MINT_PERMANENT_DELEGATE_EXTENSION=cT=q.ANCHOR_ERROR__CONSTRAINT_MINT_CLOSE_AUTHORITY_EXTENSION_AUTHORITY=aT=q.ANCHOR_ERROR__CONSTRAINT_MINT_CLOSE_AUTHORITY_EXTENSION=oT=q.ANCHOR_ERROR__CONSTRAINT_MINT_METADATA_POINTER_EXTENSION_METADATA_ADDRESS=sT=q.ANCHOR_ERROR__CONSTRAINT_MINT_METADATA_POINTER_EXTENSION_AUTHORITY=iT=q.ANCHOR_ERROR__CONSTRAINT_MINT_METADATA_POINTER_EXTENSION=rT=q.ANCHOR_ERROR__CONSTRAINT_MINT_GROUP_MEMBER_POINTER_EXTENSION_MEMBER_ADDRESS=nT=q.ANCHOR_ERROR__CONSTRAINT_MINT_GROUP_MEMBER_POINTER_EXTENSION_AUTHORITY=tT=q.ANCHOR_ERROR__CONSTRAINT_MINT_GROUP_MEMBER_POINTER_EXTENSION=eT=q.ANCHOR_ERROR__CONSTRAINT_MINT_GROUP_POINTER_EXTENSION_GROUP_ADDRESS=JN=q.ANCHOR_ERROR__CONSTRAINT_MINT_GROUP_POINTER_EXTENSION_AUTHORITY=XN=q.ANCHOR_ERROR__CONSTRAINT_MINT_GROUP_POINTER_EXTENSION=QN=q.ANCHOR_ERROR__CONSTRAINT_ASSOCIATED_TOKEN_TOKEN_PROGRAM=qN=q.ANCHOR_ERROR__CONSTRAINT_MINT_TOKEN_PROGRAM=YN=q.ANCHOR_ERROR__CONSTRAINT_TOKEN_TOKEN_PROGRAM=GN=q.ANCHOR_ERROR__CONSTRAINT_ACCOUNT_IS_NONE=KN=q.ANCHOR_ERROR__CONSTRAINT_SPACE=ZN=q.ANCHOR_ERROR__CONSTRAINT_MINT_DECIMALS=VN=q.ANCHOR_ERROR__CONSTRAINT_MINT_FREEZE_AUTHORITY=$N=q.ANCHOR_ERROR__CONSTRAINT_MINT_MINT_AUTHORITY=HN=q.ANCHOR_ERROR__CONSTRAINT_TOKEN_OWNER=WN=q.ANCHOR_ERROR__CONSTRAINT_TOKEN_MINT=FN=q.ANCHOR_ERROR__CONSTRAINT_ZERO=UN=q.ANCHOR_ERROR__CONSTRAINT_ADDRESS=jN=q.ANCHOR_ERROR__CONSTRAINT_CLOSE=zN=q.ANCHOR_ERROR__CONSTRAINT_ASSOCIATED_INIT=BN=q.ANCHOR_ERROR__CONSTRAINT_ASSOCIATED=PN=q.ANCHOR_ERROR__CONSTRAINT_STATE=DN=q.ANCHOR_ERROR__CONSTRAINT_EXECUTABLE=LN=q.ANCHOR_ERROR__CONSTRAINT_SEEDS=CN=q.ANCHOR_ERROR__CONSTRAINT_RENT_EXEMPT=ON=q.ANCHOR_ERROR__CONSTRAINT_OWNER=MN=q.ANCHOR_ERROR__CONSTRAINT_RAW=TN=q.ANCHOR_ERROR__CONSTRAINT_SIGNER=NN=q.ANCHOR_ERROR__CONSTRAINT_HAS_ONE=RN=q.ANCHOR_ERROR__CONSTRAINT_MUT=kN=q.ANCHOR_ERROR__EVENT_INSTRUCTION_STUB=IN=q.ANCHOR_ERROR__IDL_ACCOUNT_NOT_EMPTY=AN=q.ANCHOR_ERROR__IDL_INSTRUCTION_INVALID_PROGRAM=SN=q.ANCHOR_ERROR__IDL_INSTRUCTION_STUB=xN=q.ANCHOR_ERROR__INSTRUCTION_DID_NOT_SERIALIZE=EN=q.ANCHOR_ERROR__INSTRUCTION_DID_NOT_DESERIALIZE=bN=q.ANCHOR_ERROR__INSTRUCTION_FALLBACK_NOT_FOUND=vN=q.ANCHOR_ERROR__INSTRUCTION_MISSING=void 0,_N=q.ANCHOR_ERROR__DEPRECATED=UT=q.ANCHOR_ERROR__INVALID_NUMERIC_CONVERSION=jT=q.ANCHOR_ERROR__TRYING_TO_INIT_PAYER_AS_PROGRAM_ACCOUNT=zT=q.ANCHOR_ERROR__DECLARED_PROGRAM_ID_MISMATCH=BT=q.ANCHOR_ERROR__ACCOUNT_DUPLICATE_REALLOCS=PT=q.ANCHOR_ERROR__ACCOUNT_REALLOC_EXCEEDS_LIMIT=DT=q.ANCHOR_ERROR__ACCOUNT_SYSVAR_MISMATCH=LT=q.ANCHOR_ERROR__ACCOUNT_NOT_ASSOCIATED_TOKEN_ACCOUNT=CT=q.ANCHOR_ERROR__ACCOUNT_NOT_PROGRAM_DATA=OT=q.ANCHOR_ERROR__ACCOUNT_NOT_INITIALIZED=MT=q.ANCHOR_ERROR__ACCOUNT_NOT_SYSTEM_OWNED=TT=q.ANCHOR_ERROR__ACCOUNT_NOT_SIGNER=NT=q.ANCHOR_ERROR__INVALID_PROGRAM_EXECUTABLE=RT=q.ANCHOR_ERROR__INVALID_PROGRAM_ID=kT=q.ANCHOR_ERROR__ACCOUNT_OWNED_BY_WRONG_PROGRAM=IT=q.ANCHOR_ERROR__ACCOUNT_NOT_MUTABLE=AT=q.ANCHOR_ERROR__ACCOUNT_NOT_ENOUGH_KEYS=ST=q.ANCHOR_ERROR__ACCOUNT_DID_NOT_SERIALIZE=xT=q.ANCHOR_ERROR__ACCOUNT_DID_NOT_DESERIALIZE=ET=q.ANCHOR_ERROR__ACCOUNT_DISCRIMINATOR_MISMATCH=bT=q.ANCHOR_ERROR__ACCOUNT_DISCRIMINATOR_NOT_FOUND=vT=q.ANCHOR_ERROR__ACCOUNT_DISCRIMINATOR_ALREADY_SET=_T=q.ANCHOR_ERROR__REQUIRE_GTE_VIOLATED=wT=q.ANCHOR_ERROR__REQUIRE_GT_VIOLATED=mT=q.ANCHOR_ERROR__REQUIRE_KEYS_NEQ_VIOLATED=yT=q.ANCHOR_ERROR__REQUIRE_NEQ_VIOLATED=gT=q.ANCHOR_ERROR__REQUIRE_KEYS_EQ_VIOLATED=void 0,vN=q.ANCHOR_ERROR__INSTRUCTION_MISSING=100,bN=q.ANCHOR_ERROR__INSTRUCTION_FALLBACK_NOT_FOUND=101,EN=q.ANCHOR_ERROR__INSTRUCTION_DID_NOT_DESERIALIZE=102,xN=q.ANCHOR_ERROR__INSTRUCTION_DID_NOT_SERIALIZE=103,SN=q.ANCHOR_ERROR__IDL_INSTRUCTION_STUB=1e3,AN=q.ANCHOR_ERROR__IDL_INSTRUCTION_INVALID_PROGRAM=1001,IN=q.ANCHOR_ERROR__IDL_ACCOUNT_NOT_EMPTY=1002,kN=q.ANCHOR_ERROR__EVENT_INSTRUCTION_STUB=1500,RN=q.ANCHOR_ERROR__CONSTRAINT_MUT=2e3,NN=q.ANCHOR_ERROR__CONSTRAINT_HAS_ONE=2001,TN=q.ANCHOR_ERROR__CONSTRAINT_SIGNER=2002,MN=q.ANCHOR_ERROR__CONSTRAINT_RAW=2003,ON=q.ANCHOR_ERROR__CONSTRAINT_OWNER=2004,CN=q.ANCHOR_ERROR__CONSTRAINT_RENT_EXEMPT=2005,LN=q.ANCHOR_ERROR__CONSTRAINT_SEEDS=2006,DN=q.ANCHOR_ERROR__CONSTRAINT_EXECUTABLE=2007,PN=q.ANCHOR_ERROR__CONSTRAINT_STATE=2008,BN=q.ANCHOR_ERROR__CONSTRAINT_ASSOCIATED=2009,zN=q.ANCHOR_ERROR__CONSTRAINT_ASSOCIATED_INIT=2010,jN=q.ANCHOR_ERROR__CONSTRAINT_CLOSE=2011,UN=q.ANCHOR_ERROR__CONSTRAINT_ADDRESS=2012,FN=q.ANCHOR_ERROR__CONSTRAINT_ZERO=2013,WN=q.ANCHOR_ERROR__CONSTRAINT_TOKEN_MINT=2014,HN=q.ANCHOR_ERROR__CONSTRAINT_TOKEN_OWNER=2015,$N=q.ANCHOR_ERROR__CONSTRAINT_MINT_MINT_AUTHORITY=2016,VN=q.ANCHOR_ERROR__CONSTRAINT_MINT_FREEZE_AUTHORITY=2017,ZN=q.ANCHOR_ERROR__CONSTRAINT_MINT_DECIMALS=2018,KN=q.ANCHOR_ERROR__CONSTRAINT_SPACE=2019,GN=q.ANCHOR_ERROR__CONSTRAINT_ACCOUNT_IS_NONE=2020,YN=q.ANCHOR_ERROR__CONSTRAINT_TOKEN_TOKEN_PROGRAM=2021,qN=q.ANCHOR_ERROR__CONSTRAINT_MINT_TOKEN_PROGRAM=2022,QN=q.ANCHOR_ERROR__CONSTRAINT_ASSOCIATED_TOKEN_TOKEN_PROGRAM=2023,XN=q.ANCHOR_ERROR__CONSTRAINT_MINT_GROUP_POINTER_EXTENSION=2024,JN=q.ANCHOR_ERROR__CONSTRAINT_MINT_GROUP_POINTER_EXTENSION_AUTHORITY=2025,eT=q.ANCHOR_ERROR__CONSTRAINT_MINT_GROUP_POINTER_EXTENSION_GROUP_ADDRESS=2026,tT=q.ANCHOR_ERROR__CONSTRAINT_MINT_GROUP_MEMBER_POINTER_EXTENSION=2027,nT=q.ANCHOR_ERROR__CONSTRAINT_MINT_GROUP_MEMBER_POINTER_EXTENSION_AUTHORITY=2028,rT=q.ANCHOR_ERROR__CONSTRAINT_MINT_GROUP_MEMBER_POINTER_EXTENSION_MEMBER_ADDRESS=2029,iT=q.ANCHOR_ERROR__CONSTRAINT_MINT_METADATA_POINTER_EXTENSION=2030,sT=q.ANCHOR_ERROR__CONSTRAINT_MINT_METADATA_POINTER_EXTENSION_AUTHORITY=2031,oT=q.ANCHOR_ERROR__CONSTRAINT_MINT_METADATA_POINTER_EXTENSION_METADATA_ADDRESS=2032,aT=q.ANCHOR_ERROR__CONSTRAINT_MINT_CLOSE_AUTHORITY_EXTENSION=2033,cT=q.ANCHOR_ERROR__CONSTRAINT_MINT_CLOSE_AUTHORITY_EXTENSION_AUTHORITY=2034,lT=q.ANCHOR_ERROR__CONSTRAINT_MINT_PERMANENT_DELEGATE_EXTENSION=2035,uT=q.ANCHOR_ERROR__CONSTRAINT_MINT_PERMANENT_DELEGATE_EXTENSION_DELEGATE=2036,dT=q.ANCHOR_ERROR__CONSTRAINT_MINT_TRANSFER_HOOK_EXTENSION=2037,fT=q.ANCHOR_ERROR__CONSTRAINT_MINT_TRANSFER_HOOK_EXTENSION_AUTHORITY=2038,hT=q.ANCHOR_ERROR__CONSTRAINT_MINT_TRANSFER_HOOK_EXTENSION_PROGRAM_ID=2039,pT=q.ANCHOR_ERROR__REQUIRE_VIOLATED=2500;wN=q.ANCHOR_ERROR__REQUIRE_EQ_VIOLATED=2501;var gT=q.ANCHOR_ERROR__REQUIRE_KEYS_EQ_VIOLATED=2502,yT=q.ANCHOR_ERROR__REQUIRE_NEQ_VIOLATED=2503,mT=q.ANCHOR_ERROR__REQUIRE_KEYS_NEQ_VIOLATED=2504,wT=q.ANCHOR_ERROR__REQUIRE_GT_VIOLATED=2505,_T=q.ANCHOR_ERROR__REQUIRE_GTE_VIOLATED=2506,vT=q.ANCHOR_ERROR__ACCOUNT_DISCRIMINATOR_ALREADY_SET=3e3,bT=q.ANCHOR_ERROR__ACCOUNT_DISCRIMINATOR_NOT_FOUND=3001,ET=q.ANCHOR_ERROR__ACCOUNT_DISCRIMINATOR_MISMATCH=3002,xT=q.ANCHOR_ERROR__ACCOUNT_DID_NOT_DESERIALIZE=3003,ST=q.ANCHOR_ERROR__ACCOUNT_DID_NOT_SERIALIZE=3004,AT=q.ANCHOR_ERROR__ACCOUNT_NOT_ENOUGH_KEYS=3005,IT=q.ANCHOR_ERROR__ACCOUNT_NOT_MUTABLE=3006,kT=q.ANCHOR_ERROR__ACCOUNT_OWNED_BY_WRONG_PROGRAM=3007,RT=q.ANCHOR_ERROR__INVALID_PROGRAM_ID=3008,NT=q.ANCHOR_ERROR__INVALID_PROGRAM_EXECUTABLE=3009,TT=q.ANCHOR_ERROR__ACCOUNT_NOT_SIGNER=3010,MT=q.ANCHOR_ERROR__ACCOUNT_NOT_SYSTEM_OWNED=3011,OT=q.ANCHOR_ERROR__ACCOUNT_NOT_INITIALIZED=3012,CT=q.ANCHOR_ERROR__ACCOUNT_NOT_PROGRAM_DATA=3013,LT=q.ANCHOR_ERROR__ACCOUNT_NOT_ASSOCIATED_TOKEN_ACCOUNT=3014,DT=q.ANCHOR_ERROR__ACCOUNT_SYSVAR_MISMATCH=3015,PT=q.ANCHOR_ERROR__ACCOUNT_REALLOC_EXCEEDS_LIMIT=3016,BT=q.ANCHOR_ERROR__ACCOUNT_DUPLICATE_REALLOCS=3017,zT=q.ANCHOR_ERROR__DECLARED_PROGRAM_ID_MISMATCH=4100,jT=q.ANCHOR_ERROR__TRYING_TO_INIT_PAYER_AS_PROGRAM_ACCOUNT=4101,UT=q.ANCHOR_ERROR__INVALID_NUMERIC_CONVERSION=4102;_N=q.ANCHOR_ERROR__DEPRECATED=5e3;const mW=new Map;function FT(t){return mW.get(t)!==void 0}class js extends Error{constructor(e){super(e),this.name="IdlError"}}class Ed{constructor(e){this.stack=e}static parse(e){var n;const r=/^Program (\w*) invoke/,i=/^Program \w* success/,s=[];for(let o=0;o<e.length;o++){if(i.exec(e[o])){s.pop();continue}const a=(n=r.exec(e[o]))===null||n===void 0?void 0:n[1];a&&s.push(new ie(a))}return new Ed(s)}}class nu extends Error{constructor(e,n,r,i,s,o){super(r.join(` +`).replace("Program log: ","")),this.errorLogs=r,this.logs=i,this.error={errorCode:e,errorMessage:n,comparedValues:o,origin:s},this._programErrorStack=Ed.parse(i)}static parse(e){if(!e)return null;const n=e.findIndex(g=>g.startsWith("Program log: AnchorError"));if(n===-1)return null;const r=e[n],i=[r];let s;if(n+1<e.length){if(e[n+1]==="Program log: Left:"){const g=/^Program log: (.*)$/,p=g.exec(e[n+2])[1],_=g.exec(e[n+4])[1];s=[new ie(p),new ie(_)],i.push(...e.slice(n+1,n+5))}else if(e[n+1].startsWith("Program log: Left:")){const g=/^Program log: (Left|Right): (.*)$/,p=g.exec(e[n+1])[2],_=g.exec(e[n+2])[2];i.push(...e.slice(n+1,n+3)),s=[p,_]}}const a=/^Program log: AnchorError occurred\. Error Code: (.*)\. Error Number: (\d*)\. Error Message: (.*)\./.exec(r),l=/^Program log: AnchorError thrown in (.*):(\d*)\. Error Code: (.*)\. Error Number: (\d*)\. Error Message: (.*)\./.exec(r),f=/^Program log: AnchorError caused by account: (.*)\. Error Code: (.*)\. Error Number: (\d*)\. Error Message: (.*)\./.exec(r);if(a){const[g,p,_]=a.slice(1,4),A={code:g,number:parseInt(p)};return new nu(A,_,i,e,void 0,s)}else if(l){const[g,p,_,A,S]=l.slice(1,6),E={code:_,number:parseInt(A)},b={file:g,line:parseInt(p)};return new nu(E,S,i,e,b,s)}else if(f){const[g,p,_,A]=f.slice(1,5),S=g,E={code:p,number:parseInt(_)};return new nu(E,A,i,e,S,s)}else return null}get program(){return this._programErrorStack.stack[this._programErrorStack.stack.length-1]}get programErrorStack(){return this._programErrorStack.stack}toString(){return this.message}}class Lh extends Error{constructor(e,n,r){super(),this.code=e,this.msg=n,this.logs=r,r&&(this._programErrorStack=Ed.parse(r))}static parse(e,n){const r=e.toString();let i;if(r.includes("custom program error:")){let a=r.split("custom program error: ");if(a.length!==2)return null;i=a[1]}else{const a=r.match(/"Custom":([0-9]+)}/g);if(!a||a.length>1)return null;i=a[0].match(/([0-9]+)/g)[0]}let s;try{s=parseInt(i)}catch{return null}let o=n.get(s);return o!==void 0?new Lh(s,o,e.logs):(o=wW.get(s),o!==void 0?new Lh(s,o,e.logs):null)}get program(){var e;return(e=this._programErrorStack)===null||e===void 0?void 0:e.stack[this._programErrorStack.stack.length-1]}get programErrorStack(){var e;return(e=this._programErrorStack)===null||e===void 0?void 0:e.stack}toString(){return this.msg}}function WT(t,e){FT("debug-logs")&&console.log("Translating error:",t);const n=nu.parse(t.logs);if(n)return n;const r=Lh.parse(t,e);if(r)return r;if(t.logs){const i={get:function(s,o){return o==="programErrorStack"?s.programErrorStack.stack:o==="program"?s.programErrorStack.stack[t.programErrorStack.stack.length-1]:Reflect.get(...arguments)}};return t.programErrorStack=Ed.parse(t.logs),new Proxy(t,i)}return t}const me={InstructionMissing:vN,InstructionFallbackNotFound:bN,InstructionDidNotDeserialize:EN,InstructionDidNotSerialize:xN,IdlInstructionStub:SN,IdlInstructionInvalidProgram:AN,IdlAccountNotEmpty:IN,EventInstructionStub:kN,ConstraintMut:RN,ConstraintHasOne:NN,ConstraintSigner:TN,ConstraintRaw:MN,ConstraintOwner:ON,ConstraintRentExempt:CN,ConstraintSeeds:LN,ConstraintExecutable:DN,ConstraintState:PN,ConstraintAssociated:BN,ConstraintAssociatedInit:zN,ConstraintClose:jN,ConstraintAddress:UN,ConstraintZero:FN,ConstraintTokenMint:WN,ConstraintTokenOwner:HN,ConstraintMintMintAuthority:$N,ConstraintMintFreezeAuthority:VN,ConstraintMintDecimals:ZN,ConstraintSpace:KN,ConstraintAccountIsNone:GN,ConstraintTokenTokenProgram:YN,ConstraintMintTokenProgram:qN,ConstraintAssociatedTokenTokenProgram:QN,ConstraintMintGroupPointerExtension:XN,ConstraintMintGroupPointerExtensionAuthority:JN,ConstraintMintGroupPointerExtensionGroupAddress:eT,ConstraintMintGroupMemberPointerExtension:tT,ConstraintMintGroupMemberPointerExtensionAuthority:nT,ConstraintMintGroupMemberPointerExtensionMemberAddress:rT,ConstraintMintMetadataPointerExtension:iT,ConstraintMintMetadataPointerExtensionAuthority:sT,ConstraintMintMetadataPointerExtensionMetadataAddress:oT,ConstraintMintCloseAuthorityExtension:aT,ConstraintMintCloseAuthorityExtensionAuthority:cT,ConstraintMintPermanentDelegateExtension:lT,ConstraintMintPermanentDelegateExtensionDelegate:uT,ConstraintMintTransferHookExtension:dT,ConstraintMintTransferHookExtensionAuthority:fT,ConstraintMintTransferHookExtensionProgramId:hT,RequireViolated:pT,RequireEqViolated:wN,RequireKeysEqViolated:gT,RequireNeqViolated:yT,RequireKeysNeqViolated:mT,RequireGtViolated:wT,RequireGteViolated:_T,AccountDiscriminatorAlreadySet:vT,AccountDiscriminatorNotFound:bT,AccountDiscriminatorMismatch:ET,AccountDidNotDeserialize:xT,AccountDidNotSerialize:ST,AccountNotEnoughKeys:AT,AccountNotMutable:IT,AccountOwnedByWrongProgram:kT,InvalidProgramId:RT,InvalidProgramExecutable:NT,AccountNotSigner:TT,AccountNotSystemOwned:MT,AccountNotInitialized:OT,AccountNotProgramData:CT,AccountNotAssociatedTokenAccount:LT,AccountSysvarMismatch:DT,AccountReallocExceedsLimit:PT,AccountDuplicateReallocs:BT,DeclaredProgramIdMismatch:zT,TryingToInitPayerAsProgramAccount:jT,InvalidNumericConversion:UT,Deprecated:_N},wW=new Map([[me.InstructionMissing,"8 byte instruction identifier not provided"],[me.InstructionFallbackNotFound,"Fallback functions are not supported"],[me.InstructionDidNotDeserialize,"The program could not deserialize the given instruction"],[me.InstructionDidNotSerialize,"The program could not serialize the given instruction"],[me.IdlInstructionStub,"The program was compiled without idl instructions"],[me.IdlInstructionInvalidProgram,"The transaction was given an invalid program for the IDL instruction"],[me.IdlAccountNotEmpty,"IDL account must be empty in order to resize, try closing first"],[me.EventInstructionStub,"The program was compiled without `event-cpi` feature"],[me.ConstraintMut,"A mut constraint was violated"],[me.ConstraintHasOne,"A has one constraint was violated"],[me.ConstraintSigner,"A signer constraint was violated"],[me.ConstraintRaw,"A raw constraint was violated"],[me.ConstraintOwner,"An owner constraint was violated"],[me.ConstraintRentExempt,"A rent exemption constraint was violated"],[me.ConstraintSeeds,"A seeds constraint was violated"],[me.ConstraintExecutable,"An executable constraint was violated"],[me.ConstraintState,"Deprecated Error, feel free to replace with something else"],[me.ConstraintAssociated,"An associated constraint was violated"],[me.ConstraintAssociatedInit,"An associated init constraint was violated"],[me.ConstraintClose,"A close constraint was violated"],[me.ConstraintAddress,"An address constraint was violated"],[me.ConstraintZero,"Expected zero account discriminant"],[me.ConstraintTokenMint,"A token mint constraint was violated"],[me.ConstraintTokenOwner,"A token owner constraint was violated"],[me.ConstraintMintMintAuthority,"A mint mint authority constraint was violated"],[me.ConstraintMintFreezeAuthority,"A mint freeze authority constraint was violated"],[me.ConstraintMintDecimals,"A mint decimals constraint was violated"],[me.ConstraintSpace,"A space constraint was violated"],[me.ConstraintAccountIsNone,"A required account for the constraint is None"],[me.ConstraintTokenTokenProgram,"A token account token program constraint was violated"],[me.ConstraintMintTokenProgram,"A mint token program constraint was violated"],[me.ConstraintAssociatedTokenTokenProgram,"An associated token account token program constraint was violated"],[me.ConstraintMintGroupPointerExtension,"A group pointer extension constraint was violated"],[me.ConstraintMintGroupPointerExtensionAuthority,"A group pointer extension authority constraint was violated"],[me.ConstraintMintGroupPointerExtensionGroupAddress,"A group pointer extension group address constraint was violated"],[me.ConstraintMintGroupMemberPointerExtension,"A group member pointer extension constraint was violated"],[me.ConstraintMintGroupMemberPointerExtensionAuthority,"A group member pointer extension authority constraint was violated"],[me.ConstraintMintGroupMemberPointerExtensionMemberAddress,"A group member pointer extension group address constraint was violated"],[me.ConstraintMintMetadataPointerExtension,"A metadata pointer extension constraint was violated"],[me.ConstraintMintMetadataPointerExtensionAuthority,"A metadata pointer extension authority constraint was violated"],[me.ConstraintMintMetadataPointerExtensionMetadataAddress,"A metadata pointer extension metadata address constraint was violated"],[me.ConstraintMintCloseAuthorityExtension,"A close authority constraint was violated"],[me.ConstraintMintCloseAuthorityExtensionAuthority,"A close authority extension authority constraint was violated"],[me.ConstraintMintPermanentDelegateExtension,"A permanent delegate extension constraint was violated"],[me.ConstraintMintPermanentDelegateExtensionDelegate,"A permanent delegate extension delegate constraint was violated"],[me.ConstraintMintTransferHookExtension,"A transfer hook extension constraint was violated"],[me.ConstraintMintTransferHookExtensionAuthority,"A transfer hook extension authority constraint was violated"],[me.ConstraintMintTransferHookExtensionProgramId,"A transfer hook extension transfer hook program id constraint was violated"],[me.RequireViolated,"A require expression was violated"],[me.RequireEqViolated,"A require_eq expression was violated"],[me.RequireKeysEqViolated,"A require_keys_eq expression was violated"],[me.RequireNeqViolated,"A require_neq expression was violated"],[me.RequireKeysNeqViolated,"A require_keys_neq expression was violated"],[me.RequireGtViolated,"A require_gt expression was violated"],[me.RequireGteViolated,"A require_gte expression was violated"],[me.AccountDiscriminatorAlreadySet,"The account discriminator was already set on this account"],[me.AccountDiscriminatorNotFound,"No 8 byte discriminator was found on the account"],[me.AccountDiscriminatorMismatch,"8 byte discriminator did not match what was expected"],[me.AccountDidNotDeserialize,"Failed to deserialize the account"],[me.AccountDidNotSerialize,"Failed to serialize the account"],[me.AccountNotEnoughKeys,"Not enough account keys given to the instruction"],[me.AccountNotMutable,"The given account is not mutable"],[me.AccountOwnedByWrongProgram,"The given account is owned by a different program than expected"],[me.InvalidProgramId,"Program ID was not as expected"],[me.InvalidProgramExecutable,"Program account is not executable"],[me.AccountNotSigner,"The given account did not sign"],[me.AccountNotSystemOwned,"The given account is not owned by the system program"],[me.AccountNotInitialized,"The program expected this account to be already initialized"],[me.AccountNotProgramData,"The given account is not a program data account"],[me.AccountNotAssociatedTokenAccount,"The given account is not the associated token account"],[me.AccountSysvarMismatch,"The given public key does not match the required sysvar"],[me.AccountReallocExceedsLimit,"The account reallocation exceeds the MAX_PERMITTED_DATA_INCREASE limit"],[me.AccountDuplicateReallocs,"The account was duplicated for more than one reallocation"],[me.DeclaredProgramIdMismatch,"The declared program id does not match the actual program id"],[me.TryingToInitPayerAsProgramAccount,"You cannot/should not initialize the payer account as a program account"],[me.InvalidNumericConversion,"The program could not perform the numeric conversion, out of range integral type conversion attempted"],[me.Deprecated,"The API being used is deprecated and should no longer be used"]]);class nt{static fieldLayout(e,n=[],r){const i=e.name;switch(e.type){case"bool":return $e.bool(i);case"u8":return $e.u8(i);case"i8":return $e.i8(i);case"u16":return $e.u16(i);case"i16":return $e.i16(i);case"u32":return $e.u32(i);case"i32":return $e.i32(i);case"f32":return $e.f32(i);case"u64":return $e.u64(i);case"i64":return $e.i64(i);case"f64":return $e.f64(i);case"u128":return $e.u128(i);case"i128":return $e.i128(i);case"u256":return $e.u256(i);case"i256":return $e.i256(i);case"bytes":return $e.vecU8(i);case"string":return $e.str(i);case"pubkey":return $e.publicKey(i);default:{if("option"in e.type)return $e.option(nt.fieldLayout({type:e.type.option},n,r),i);if("vec"in e.type)return $e.vec(nt.fieldLayout({type:e.type.vec},n,r),i);if("array"in e.type){let[s,o]=e.type.array;return o=nt.resolveArrayLen(o,r),$e.array(nt.fieldLayout({type:s},n,r),o,i)}if("defined"in e.type){if(!n)throw new js("User defined types not provided");const s=e.type.defined.name,o=n.find(a=>a.name===s);if(!o)throw new js(`Type not found: ${e.name}`);return nt.typeDefLayout({typeDef:o,types:n,genericArgs:r??e.type.defined.generics,name:i})}if("generic"in e.type){const s=r==null?void 0:r.at(0);if((s==null?void 0:s.kind)!=="type")throw new js(`Invalid generic field: ${e.name}`);return nt.fieldLayout({...e,type:s.type},n)}throw new js(`Not yet implemented: ${JSON.stringify(e.type)}`)}}}static typeDefLayout({typeDef:e,types:n,name:r,genericArgs:i}){switch(e.type.kind){case"struct":{const s=oc(e.type.fields,()=>[],o=>o.map(a=>{const c=i&&nt.resolveGenericArgs({type:a.type,typeDef:e,genericArgs:i});return nt.fieldLayout(a,n,c)}),o=>o.map((a,c)=>{const l=i&&nt.resolveGenericArgs({type:a,typeDef:e,genericArgs:i});return nt.fieldLayout({name:c.toString(),type:a},n,l)}));return $e.struct(s,r)}case"enum":{const s=e.type.variants.map(o=>{const a=oc(o.fields,()=>[],c=>c.map(l=>{const u=i&&nt.resolveGenericArgs({type:l.type,typeDef:e,genericArgs:i});return nt.fieldLayout(l,n,u)}),c=>c.map((l,u)=>{const f=i&&nt.resolveGenericArgs({type:l,typeDef:e,genericArgs:i});return nt.fieldLayout({name:u.toString(),type:l},n,f)}));return $e.struct(a,o.name)});return r!==void 0?$e.rustEnum(s).replicate(r):$e.rustEnum(s,r)}case"type":return nt.fieldLayout({type:e.type.alias,name:r},n)}}static typeSize(e,n,r){var i;switch(e){case"bool":return 1;case"u8":return 1;case"i8":return 1;case"i16":return 2;case"u16":return 2;case"u32":return 4;case"i32":return 4;case"f32":return 4;case"u64":return 8;case"i64":return 8;case"f64":return 8;case"u128":return 16;case"i128":return 16;case"u256":return 32;case"i256":return 32;case"bytes":return 1;case"string":return 1;case"pubkey":return 32;default:if("option"in e)return 1+nt.typeSize(e.option,n,r);if("coption"in e)return 4+nt.typeSize(e.coption,n,r);if("vec"in e)return 1;if("array"in e){let[s,o]=e.array;return o=nt.resolveArrayLen(o,r),nt.typeSize(s,n,r)*o}if("defined"in e){const s=(i=n.types)===null||i===void 0?void 0:i.find(a=>a.name===e.defined.name);if(!s)throw new js(`Type not found: ${JSON.stringify(e)}`);const o=a=>{const c=r??e.defined.generics,l=c&&nt.resolveGenericArgs({type:a,typeDef:s,genericArgs:c});return nt.typeSize(a,n,l)};switch(s.type.kind){case"struct":return oc(s.type.fields,()=>[0],a=>a.map(c=>o(c.type)),a=>a.map(c=>o(c))).reduce((a,c)=>a+c,0);case"enum":{const a=s.type.variants.map(c=>oc(c.fields,()=>[0],l=>l.map(u=>o(u.type)),l=>l.map(u=>o(u))).reduce((l,u)=>l+u,0));return Math.max(...a)+1}case"type":return nt.typeSize(s.type.alias,n,r)}}if("generic"in e){const s=r==null?void 0:r.at(0);if((s==null?void 0:s.kind)!=="type")throw new js(`Invalid generic: ${e.generic}`);return nt.typeSize(s.type,n,r)}throw new Error(`Invalid type ${JSON.stringify(e)}`)}}static resolveArrayLen(e,n){if(typeof e=="number")return e;if(n){const r=n.find(i=>i.kind==="const");(r==null?void 0:r.kind)==="const"&&(e=+r.value)}if(typeof e!="number")throw new js("Generic array length did not resolve");return e}static resolveGenericArgs({type:e,typeDef:n,genericArgs:r,isDefined:i}){if(typeof e!="object")return null;for(const s in n.generics){const o=n.generics[s];if("generic"in e&&o.name===e.generic)return[r[s]];if("option"in e){const a=nt.resolveGenericArgs({type:e.option,typeDef:n,genericArgs:r,isDefined:i});if(!a||!i)return a;if(a[0].kind==="type")return[{kind:"type",type:{option:a[0].type}}]}if("vec"in e){const a=nt.resolveGenericArgs({type:e.vec,typeDef:n,genericArgs:r,isDefined:i});if(!a||!i)return a;if(a[0].kind==="type")return[{kind:"type",type:{vec:a[0].type}}]}if("array"in e){const[a,c]=e.array,l=typeof c=="object",u=nt.resolveGenericArgs({type:a,typeDef:n,genericArgs:r,isDefined:i});if(u){for(const f in n.generics.slice(+s)){const g=+s+ +f;l&&n.generics[g].name===c.generic&&u.push(r[g])}if(!i)return u;if(u[0].kind==="type"&&u[1].kind==="const")return[{kind:"type",type:{array:[u[0].type,+u[1].value]}}]}if(l&&o.name===c.generic){const f=r[s];return i?[{kind:"type",type:{array:[a,+f.value]}}]:[f]}return null}if("defined"in e)return e.defined.generics?e.defined.generics.flatMap(a=>{switch(a.kind){case"type":return nt.resolveGenericArgs({type:a.type,typeDef:n,genericArgs:r,isDefined:!0});case"const":return[a]}}).filter(a=>a!==null):null}return null}}class _W{constructor(e){this.idl=e;const n=e.instructions.map(i=>{const s=i.name,o=i.args.map(c=>nt.fieldLayout(c,e.types)),a=$e.struct(o,s);return[s,{discriminator:i.discriminator,layout:a}]});this.ixLayouts=new Map(n);const r=n.map(([i,{discriminator:s,layout:o}])=>[jt.encode(s),{name:i,layout:o}]);this.sighashLayouts=new Map(r)}encode(e,n){const r=re.Buffer.alloc(1e3),i=this.ixLayouts.get(e);if(!i)throw new Error(`Unknown method: ${e}`);const s=i.layout.encode(n,r),o=r.slice(0,s);return re.Buffer.concat([re.Buffer.from(i.discriminator),o])}decode(e,n="hex"){typeof e=="string"&&(e=n==="hex"?re.Buffer.from(e,"hex"):jt.decode(e));const r=e.slice(0,ac),i=e.slice(ac),s=this.sighashLayouts.get(jt.encode(r));return s?{name:s.name,data:s.layout.decode(i)}:null}format(e,n){return br.format(e,n,this.idl)}}class br{static format(e,n,r){const i=r.instructions.find(c=>e.name===c.name);if(!i)return console.error("Invalid instruction given"),null;const s=i.args.map(c=>({name:c.name,type:br.formatIdlType(c.type),data:br.formatIdlData(c,e.data[c.name],r.types)})),o=br.flattenIdlAccounts(i.accounts),a=n.map((c,l)=>l<o.length?{name:o[l].name,...c}:{name:void 0,...c});return{args:s,accounts:a}}static formatIdlType(e){if(typeof e=="string")return e;if("option"in e)return`Option<${this.formatIdlType(e.option)}>`;if("coption"in e)return`COption<${this.formatIdlType(e.coption)}>`;if("vec"in e)return`Vec<${this.formatIdlType(e.vec)}>`;if("array"in e)return`Array<${e.array[0]}; ${e.array[1]}>`;if("defined"in e){const n=e.defined.name;if(e.defined.generics){const r=e.defined.generics.map(i=>{switch(i.kind){case"type":return br.formatIdlType(i.type);case"const":return i.value}}).join(", ");return`${n}<${r}>`}return n}throw new Error(`Unknown IDL type: ${e}`)}static formatIdlData(e,n,r){if(typeof e.type=="string")return n.toString();if("vec"in e.type)return"["+n.map(i=>this.formatIdlData({name:"",type:e.type.vec},i,r)).join(", ")+"]";if("option"in e.type)return n===null?"null":this.formatIdlData({name:"",type:e.type.option},n,r);if("defined"in e.type){if(!r)throw new Error("User defined types not provided");const i=e.type.defined.name,s=r.find(o=>o.name===i);if(!s)throw new Error(`Type not found: ${i}`);return br.formatIdlDataDefined(s,n,r)}return"unknown"}static formatIdlDataDefined(e,n,r){switch(e.type.kind){case"struct":return"{ "+oc(e.type.fields,()=>"",i=>Object.entries(n).map(([s,o])=>{const a=i.find(c=>c.name===s);if(!a)throw new Error(`Field not found: ${s}`);return s+": "+br.formatIdlData(a,o,r)}).join(", "),i=>Object.entries(n).map(([s,o])=>s+": "+br.formatIdlData({name:"",type:i[s]},o,r)).join(", "))+" }";case"enum":{const i=Object.keys(n)[0],s=e.type.variants.find(a=>a.name===i);if(!s)throw new Error(`Unable to find variant: ${i}`);const o=n[i];return oc(s.fields,()=>i,a=>{const c=Object.keys(o).map(l=>{const u=o[l],f=a.find(g=>g.name===l);if(!f)throw new Error(`Field not found: ${l}`);return l+": "+br.formatIdlData(f,u,r)}).join(", ");return`${i} { ${c} }`},a=>{const c=Object.entries(o).map(([l,u])=>l+": "+br.formatIdlData({name:"",type:a[l]},u,r)).join(", ");return`${i} { ${c} }`})}case"type":return br.formatIdlType(e.type.alias)}}static flattenIdlAccounts(e,n){return e.map(r=>{const i=vW(r.name);if(r.hasOwnProperty("accounts")){const s=n?`${n} > ${i}`:i;return br.flattenIdlAccounts(r.accounts,s)}else return{...r,name:n?`${n} > ${i}`:i}}).flat()}}function vW(t){const e=t.replace(/([A-Z])/g," $1");return e.charAt(0).toUpperCase()+e.slice(1)}const ac=8;class bW{constructor(e){if(this.idl=e,!e.accounts){this.accountLayouts=new Map;return}const n=e.types;if(!n)throw new Error("Accounts require `idl.types`");const r=e.accounts.map(i=>{const s=n.find(o=>o.name===i.name);if(!s)throw new Error(`Account not found: ${i.name}`);return[i.name,nt.typeDefLayout({typeDef:s,types:n})]});this.accountLayouts=new Map(r)}async encode(e,n){const r=re.Buffer.alloc(1e3),i=this.accountLayouts.get(e);if(!i)throw new Error(`Unknown account: ${e}`);const s=i.encode(n,r),o=r.slice(0,s),a=this.accountDiscriminator(e);return re.Buffer.concat([a,o])}decode(e,n){if(this.accountDiscriminator(e).compare(n.slice(0,ac)))throw new Error("Invalid account discriminator");return this.decodeUnchecked(e,n)}decodeAny(e){const n=e.slice(0,ac),r=Array.from(this.accountLayouts.keys()).find(i=>this.accountDiscriminator(i).equals(n));if(!r)throw new Error("Account not found");return this.decodeUnchecked(r,e)}decodeUnchecked(e,n){const r=n.subarray(ac),i=this.accountLayouts.get(e);if(!i)throw new Error(`Unknown account: ${e}`);return i.decode(r)}memcmp(e,n){const r=this.accountDiscriminator(e);return{offset:0,bytes:jt.encode(n?re.Buffer.concat([r,n]):r)}}size(e){return ac+nt.typeSize({defined:{name:e}},this.idl)}accountDiscriminator(e){var n;const r=(n=this.idl.accounts)===null||n===void 0?void 0:n.find(i=>i.name===e);if(!r)throw new Error(`Account not found: ${e}`);return re.Buffer.from(r.discriminator)}}class EW{constructor(e){var n;if(!e.events){this.layouts=new Map;return}const r=e.types;if(!r)throw new Error("Events require `idl.types`");const i=e.events.map(s=>{const o=r.find(a=>a.name===s.name);if(!o)throw new Error(`Event not found: ${s.name}`);return[s.name,nt.typeDefLayout({typeDef:o,types:r})]});this.layouts=new Map(i),this.discriminators=new Map(((n=e.events)!==null&&n!==void 0?n:[]).map(s=>[bE(re.Buffer.from(s.discriminator)),s.name]))}decode(e){let n;try{n=hN(e)}catch{return null}const r=bE(n.slice(0,8)),i=this.discriminators.get(r);if(!i)return null;const s=this.layouts.get(i);if(!s)throw new Error(`Unknown event: ${i}`);return{data:s.decode(n.slice(8)),name:i}}}class xW{constructor(e){const n=e.types;if(!n){this.typeLayouts=new Map;return}const r=n.filter(i=>!i.generics).map(i=>[i.name,nt.typeDefLayout({typeDef:i,types:n})]);this.typeLayouts=new Map(r)}encode(e,n){const r=re.Buffer.alloc(1e3),i=this.typeLayouts.get(e);if(!i)throw new Error(`Unknown type: ${e}`);const s=i.encode(n,r);return r.slice(0,s)}decode(e,n){const r=this.typeLayouts.get(e);if(!r)throw new Error(`Unknown type: ${e}`);return r.decode(n)}}class HT{constructor(e){this.instruction=new _W(e),this.accounts=new bW(e),this.events=new EW(e),this.types=new xW(e)}}class vr{constructor(e,n){if(!Number.isInteger(e))throw new TypeError("span must be an integer");this.span=e,this.property=n}makeDestinationObject(){return{}}decode(e,n){throw new Error("Layout is abstract")}encode(e,n,r){throw new Error("Layout is abstract")}getSpan(e,n){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(e){const n=Object.create(this.constructor.prototype);return Object.assign(n,this),n.property=e,n}fromArray(e){}}var zp=vr;function SW(t,e){return e.property?t+"["+e.property+"]":t}class na extends vr{isCount(){throw new Error("ExternalLayout is abstract")}}class $T extends na{constructor(e,n,r){if(!(e instanceof vr))throw new TypeError("layout must be a Layout");if(n===void 0)n=0;else if(!Number.isInteger(n))throw new TypeError("offset must be integer or undefined");super(e.span,r||e.property),this.layout=e,this.offset=n}isCount(){return this.layout instanceof jp||this.layout instanceof VT}decode(e,n){return n===void 0&&(n=0),this.layout.decode(e,n+this.offset)}encode(e,n,r){return r===void 0&&(r=0),this.layout.encode(e,n,r+this.offset)}}class jp extends vr{constructor(e,n){if(super(e,n),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,n){return n===void 0&&(n=0),e.readUIntLE(n,this.span)}encode(e,n,r){return r===void 0&&(r=0),n.writeUIntLE(e,r,this.span),this.span}}class VT extends vr{constructor(e,n){if(super(e,n),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,n){return n===void 0&&(n=0),e.readUIntBE(n,this.span)}encode(e,n,r){return r===void 0&&(r=0),n.writeUIntBE(e,r,this.span),this.span}}const mm=Math.pow(2,32);function ZT(t){const e=Math.floor(t/mm),n=t-e*mm;return{hi32:e,lo32:n}}function KT(t,e){return t*mm+e}class AW extends vr{constructor(e){super(8,e)}decode(e,n){n===void 0&&(n=0);const r=e.readUInt32LE(n),i=e.readUInt32LE(n+4);return KT(i,r)}encode(e,n,r){r===void 0&&(r=0);const i=ZT(e);return n.writeUInt32LE(i.lo32,r),n.writeUInt32LE(i.hi32,r+4),8}}class IW extends vr{constructor(e){super(8,e)}decode(e,n){n===void 0&&(n=0);const r=e.readUInt32LE(n),i=e.readInt32LE(n+4);return KT(i,r)}encode(e,n,r){r===void 0&&(r=0);const i=ZT(e);return n.writeUInt32LE(i.lo32,r),n.writeInt32LE(i.hi32,r+4),8}}class kW extends vr{constructor(e,n,r){if(!(Array.isArray(e)&&e.reduce((s,o)=>s&&o instanceof vr,!0)))throw new TypeError("fields must be array of Layout instances");typeof n=="boolean"&&r===void 0&&(r=n,n=void 0);for(const s of e)if(0>s.span&&s.property===void 0)throw new Error("fields cannot contain unnamed variable-length layout");let i=-1;try{i=e.reduce((s,o)=>s+o.getSpan(),0)}catch{}super(i,n),this.fields=e,this.decodePrefixes=!!r}getSpan(e,n){if(0<=this.span)return this.span;n===void 0&&(n=0);let r=0;try{r=this.fields.reduce((i,s)=>{const o=s.getSpan(e,n);return n+=o,i+o},0)}catch{throw new RangeError("indeterminate span")}return r}decode(e,n){n===void 0&&(n=0);const r=this.makeDestinationObject();for(const i of this.fields)if(i.property!==void 0&&(r[i.property]=i.decode(e,n)),n+=i.getSpan(e,n),this.decodePrefixes&&e.length===n)break;return r}encode(e,n,r){r===void 0&&(r=0);const i=r;let s=0,o=0;for(const a of this.fields){let c=a.span;if(o=0<c?c:0,a.property!==void 0){const l=e[a.property];l!==void 0&&(o=a.encode(l,n,r),0>c&&(c=a.getSpan(n,r)))}s=r,r+=c}return s+o-i}fromArray(e){const n=this.makeDestinationObject();for(const r of this.fields)r.property!==void 0&&0<e.length&&(n[r.property]=e.shift());return n}layoutFor(e){if(typeof e!="string")throw new TypeError("property must be string");for(const n of this.fields)if(n.property===e)return n}offsetOf(e){if(typeof e!="string")throw new TypeError("property must be string");let n=0;for(const r of this.fields){if(r.property===e)return n;0>r.span?n=-1:0<=n&&(n+=r.span)}}}class GT{constructor(e){this.property=e}decode(){throw new Error("UnionDiscriminator is abstract")}encode(){throw new Error("UnionDiscriminator is abstract")}}class kE extends GT{constructor(e,n){if(!(e instanceof na&&e.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");super(n||e.property||"variant"),this.layout=e}decode(e,n){return this.layout.decode(e,n)}encode(e,n,r){return this.layout.encode(e,n,r)}}class YT extends vr{constructor(e,n,r){const i=e instanceof jp||e instanceof VT;if(i)e=new kE(new $T(e));else if(e instanceof na&&e.isCount())e=new kE(e);else if(!(e instanceof GT))throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(n===void 0&&(n=null),!(n===null||n instanceof vr))throw new TypeError("defaultLayout must be null or a Layout");if(n!==null){if(0>n.span)throw new Error("defaultLayout must have constant span");n.property===void 0&&(n=n.replicate("content"))}let s=-1;n&&(s=n.span,0<=s&&i&&(s+=e.layout.span)),super(s,r),this.discriminator=e,this.usesPrefixDiscriminator=i,this.defaultLayout=n,this.registry={};let o=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(a){return o(a)},this.configGetSourceVariant=function(a){o=a.bind(this)}}getSpan(e,n){if(0<=this.span)return this.span;n===void 0&&(n=0);const r=this.getVariant(e,n);if(!r)throw new Error("unable to determine span for unrecognized variant");return r.getSpan(e,n)}defaultGetSourceVariant(e){if(e.hasOwnProperty(this.discriminator.property)){if(this.defaultLayout&&e.hasOwnProperty(this.defaultLayout.property))return;const n=this.registry[e[this.discriminator.property]];if(n&&(!n.layout||e.hasOwnProperty(n.property)))return n}else for(const n in this.registry){const r=this.registry[n];if(e.hasOwnProperty(r.property))return r}throw new Error("unable to infer src variant")}decode(e,n){n===void 0&&(n=0);let r;const i=this.discriminator,s=i.decode(e,n);let o=this.registry[s];if(o===void 0){let a=0;o=this.defaultLayout,this.usesPrefixDiscriminator&&(a=i.layout.span),r=this.makeDestinationObject(),r[i.property]=s,r[o.property]=this.defaultLayout.decode(e,n+a)}else r=o.decode(e,n);return r}encode(e,n,r){r===void 0&&(r=0);const i=this.getSourceVariant(e);if(i===void 0){const s=this.discriminator,o=this.defaultLayout;let a=0;return this.usesPrefixDiscriminator&&(a=s.layout.span),s.encode(e[s.property],n,r),a+o.encode(e[o.property],n,r+a)}return i.encode(e,n,r)}addVariant(e,n,r){const i=new RW(this,e,n,r);return this.registry[e]=i,i}getVariant(e,n){let r=e;return re.Buffer.isBuffer(e)&&(n===void 0&&(n=0),r=this.discriminator.decode(e,n)),this.registry[r]}}class RW extends vr{constructor(e,n,r,i){if(!(e instanceof YT))throw new TypeError("union must be a Union");if(!Number.isInteger(n)||0>n)throw new TypeError("variant must be a (non-negative) integer");if(typeof r=="string"&&i===void 0&&(i=r,r=null),r){if(!(r instanceof vr))throw new TypeError("layout must be a Layout");if(e.defaultLayout!==null&&0<=r.span&&r.span>e.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if(typeof i!="string")throw new TypeError("variant must have a String property")}let s=e.span;0>e.span&&(s=r?r.span:0,0<=s&&e.usesPrefixDiscriminator&&(s+=e.discriminator.layout.span)),super(s,i),this.union=e,this.variant=n,this.layout=r||null}getSpan(e,n){if(0<=this.span)return this.span;n===void 0&&(n=0);let r=0;return this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),r+this.layout.getSpan(e,n+r)}decode(e,n){const r=this.makeDestinationObject();if(n===void 0&&(n=0),this!==this.union.getVariant(e,n))throw new Error("variant mismatch");let i=0;return this.union.usesPrefixDiscriminator&&(i=this.union.discriminator.layout.span),this.layout?r[this.property]=this.layout.decode(e,n+i):this.property?r[this.property]=!0:this.union.usesPrefixDiscriminator&&(r[this.union.discriminator.property]=this.variant),r}encode(e,n,r){r===void 0&&(r=0);let i=0;if(this.union.usesPrefixDiscriminator&&(i=this.union.discriminator.layout.span),this.layout&&!e.hasOwnProperty(this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,n,r);let s=i;if(this.layout&&(this.layout.encode(e[this.property],n,r+i),s+=this.layout.getSpan(n,r+i),0<=this.union.span&&s>this.union.span))throw new Error("encoded variant overruns containing union");return s}fromArray(e){if(this.layout)return this.layout.fromArray(e)}}class NW extends vr{constructor(e,n){if(!(e instanceof na&&e.isCount()||Number.isInteger(e)&&0<=e))throw new TypeError("length must be positive integer or an unsigned integer ExternalLayout");let r=-1;e instanceof na||(r=e),super(r,n),this.length=e}getSpan(e,n){let r=this.span;return 0>r&&(r=this.length.decode(e,n)),r}decode(e,n){n===void 0&&(n=0);let r=this.span;return 0>r&&(r=this.length.decode(e,n)),e.slice(n,n+r)}encode(e,n,r){let i=this.length;if(this.length instanceof na&&(i=e.length),!(re.Buffer.isBuffer(e)&&i===e.length))throw new TypeError(SW("Blob.encode",this)+" requires (length "+i+") Buffer as src");if(r+i>n.length)throw new RangeError("encoding overruns Buffer");return n.write(e.toString("hex"),r,i,"hex"),this.length instanceof na&&this.length.encode(i,n,r),i}}var TW=(t,e,n)=>new $T(t,e,n),MW=t=>new jp(1,t),us=t=>new jp(4,t),OW=t=>new AW(t),Ns=t=>new IW(t),bn=(t,e,n)=>new kW(t,e,n),qT=(t,e,n)=>new YT(t,e,n),xd=(t,e)=>new NW(t,e);class CW extends zp{constructor(e){super(-1,e),this.property=e,this.layout=bn([us("length"),us("lengthPadding"),xd(TW(us(),-8),"chars")],this.property)}encode(e,n,r=0){if(e==null)return this.layout.span;const i={chars:re.Buffer.from(e,"utf8")};return this.layout.encode(i,n,r)}decode(e,n=0){return this.layout.decode(e,n).chars.toString()}getSpan(e,n=0){return us().span+us().span+new ss(new Uint8Array(e).slice(n,n+4),10,"le").toNumber()}}function Up(t){return new CW(t)}function Xr(t){return xd(32,t)}const zr=qT(us("instruction"));zr.addVariant(0,bn([Ns("lamports"),Ns("space"),Xr("owner")]),"createAccount");zr.addVariant(1,bn([Xr("owner")]),"assign");zr.addVariant(2,bn([Ns("lamports")]),"transfer");zr.addVariant(3,bn([Xr("base"),Up("seed"),Ns("lamports"),Ns("space"),Xr("owner")]),"createAccountWithSeed");zr.addVariant(4,bn([Xr("authorized")]),"advanceNonceAccount");zr.addVariant(5,bn([Ns("lamports")]),"withdrawNonceAccount");zr.addVariant(6,bn([Xr("authorized")]),"initializeNonceAccount");zr.addVariant(7,bn([Xr("authorized")]),"authorizeNonceAccount");zr.addVariant(8,bn([Ns("space")]),"allocate");zr.addVariant(9,bn([Xr("base"),Up("seed"),Ns("space"),Xr("owner")]),"allocateWithSeed");zr.addVariant(10,bn([Xr("base"),Up("seed"),Xr("owner")]),"assignWithSeed");zr.addVariant(11,bn([Ns("lamports"),Up("seed"),Xr("owner")]),"transferWithSeed");Math.max(...Object.values(zr.registry).map(t=>t.span));class LW extends zp{constructor(e,n,r,i){super(e.span,i),this.layout=e,this.decoder=n,this.encoder=r}decode(e,n){return this.decoder(this.layout.decode(e,n))}encode(e,n,r){return this.layout.encode(this.encoder(e),n,r)}getSpan(e,n){return this.layout.getSpan(e,n)}}function RE(t){return new LW(xd(32),e=>new ie(e),e=>e.toBuffer(),t)}bn([us("version"),us("state"),RE("authorizedPubkey"),RE("nonce"),bn([OW("lamportsPerSignature")],"feeCalculator")]);new ie("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");new ie("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");var NE={exports:{}};(function(t,e){var n=typeof self<"u"?self:yW,r=function(){function s(){this.fetch=!1,this.DOMException=n.DOMException}return s.prototype=n,new s}();(function(s){(function(o){var a={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function c(d){return d&&DataView.prototype.isPrototypeOf(d)}if(a.arrayBuffer)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(d){return d&&l.indexOf(Object.prototype.toString.call(d))>-1};function f(d){if(typeof d!="string"&&(d=String(d)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(d))throw new TypeError("Invalid character in header field name");return d.toLowerCase()}function g(d){return typeof d!="string"&&(d=String(d)),d}function p(d){var h={next:function(){var v=d.shift();return{done:v===void 0,value:v}}};return a.iterable&&(h[Symbol.iterator]=function(){return h}),h}function _(d){this.map={},d instanceof _?d.forEach(function(h,v){this.append(v,h)},this):Array.isArray(d)?d.forEach(function(h){this.append(h[0],h[1])},this):d&&Object.getOwnPropertyNames(d).forEach(function(h){this.append(h,d[h])},this)}_.prototype.append=function(d,h){d=f(d),h=g(h);var v=this.map[d];this.map[d]=v?v+", "+h:h},_.prototype.delete=function(d){delete this.map[f(d)]},_.prototype.get=function(d){return d=f(d),this.has(d)?this.map[d]:null},_.prototype.has=function(d){return this.map.hasOwnProperty(f(d))},_.prototype.set=function(d,h){this.map[f(d)]=g(h)},_.prototype.forEach=function(d,h){for(var v in this.map)this.map.hasOwnProperty(v)&&d.call(h,this.map[v],v,this)},_.prototype.keys=function(){var d=[];return this.forEach(function(h,v){d.push(v)}),p(d)},_.prototype.values=function(){var d=[];return this.forEach(function(h){d.push(h)}),p(d)},_.prototype.entries=function(){var d=[];return this.forEach(function(h,v){d.push([v,h])}),p(d)},a.iterable&&(_.prototype[Symbol.iterator]=_.prototype.entries);function A(d){if(d.bodyUsed)return Promise.reject(new TypeError("Already read"));d.bodyUsed=!0}function S(d){return new Promise(function(h,v){d.onload=function(){h(d.result)},d.onerror=function(){v(d.error)}})}function E(d){var h=new FileReader,v=S(h);return h.readAsArrayBuffer(d),v}function b(d){var h=new FileReader,v=S(h);return h.readAsText(d),v}function x(d){for(var h=new Uint8Array(d),v=new Array(h.length),I=0;I<h.length;I++)v[I]=String.fromCharCode(h[I]);return v.join("")}function M(d){if(d.slice)return d.slice(0);var h=new Uint8Array(d.byteLength);return h.set(new Uint8Array(d)),h.buffer}function L(){return this.bodyUsed=!1,this._initBody=function(d){this._bodyInit=d,d?typeof d=="string"?this._bodyText=d:a.blob&&Blob.prototype.isPrototypeOf(d)?this._bodyBlob=d:a.formData&&FormData.prototype.isPrototypeOf(d)?this._bodyFormData=d:a.searchParams&&URLSearchParams.prototype.isPrototypeOf(d)?this._bodyText=d.toString():a.arrayBuffer&&a.blob&&c(d)?(this._bodyArrayBuffer=M(d.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(d)||u(d))?this._bodyArrayBuffer=M(d):this._bodyText=d=Object.prototype.toString.call(d):this._bodyText="",this.headers.get("content-type")||(typeof d=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):a.searchParams&&URLSearchParams.prototype.isPrototypeOf(d)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a.blob&&(this.blob=function(){var d=A(this);if(d)return d;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?A(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(E)}),this.text=function(){var d=A(this);if(d)return d;if(this._bodyBlob)return b(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(x(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a.formData&&(this.formData=function(){return this.text().then($)}),this.json=function(){return this.text().then(JSON.parse)},this}var z=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function D(d){var h=d.toUpperCase();return z.indexOf(h)>-1?h:d}function F(d,h){h=h||{};var v=h.body;if(d instanceof F){if(d.bodyUsed)throw new TypeError("Already read");this.url=d.url,this.credentials=d.credentials,h.headers||(this.headers=new _(d.headers)),this.method=d.method,this.mode=d.mode,this.signal=d.signal,!v&&d._bodyInit!=null&&(v=d._bodyInit,d.bodyUsed=!0)}else this.url=String(d);if(this.credentials=h.credentials||this.credentials||"same-origin",(h.headers||!this.headers)&&(this.headers=new _(h.headers)),this.method=D(h.method||this.method||"GET"),this.mode=h.mode||this.mode||null,this.signal=h.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&v)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(v)}F.prototype.clone=function(){return new F(this,{body:this._bodyInit})};function $(d){var h=new FormData;return d.trim().split("&").forEach(function(v){if(v){var I=v.split("="),k=I.shift().replace(/\+/g," "),O=I.join("=").replace(/\+/g," ");h.append(decodeURIComponent(k),decodeURIComponent(O))}}),h}function V(d){var h=new _,v=d.replace(/\r?\n[\t ]+/g," ");return v.split(/\r?\n/).forEach(function(I){var k=I.split(":"),O=k.shift().trim();if(O){var B=k.join(":").trim();h.append(O,B)}}),h}L.call(F.prototype);function G(d,h){h||(h={}),this.type="default",this.status=h.status===void 0?200:h.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in h?h.statusText:"OK",this.headers=new _(h.headers),this.url=h.url||"",this._initBody(d)}L.call(G.prototype),G.prototype.clone=function(){return new G(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new _(this.headers),url:this.url})},G.error=function(){var d=new G(null,{status:0,statusText:""});return d.type="error",d};var W=[301,302,303,307,308];G.redirect=function(d,h){if(W.indexOf(h)===-1)throw new RangeError("Invalid status code");return new G(null,{status:h,headers:{location:d}})},o.DOMException=s.DOMException;try{new o.DOMException}catch{o.DOMException=function(h,v){this.message=h,this.name=v;var I=Error(h);this.stack=I.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function N(d,h){return new Promise(function(v,I){var k=new F(d,h);if(k.signal&&k.signal.aborted)return I(new o.DOMException("Aborted","AbortError"));var O=new XMLHttpRequest;function B(){O.abort()}O.onload=function(){var T={status:O.status,statusText:O.statusText,headers:V(O.getAllResponseHeaders()||"")};T.url="responseURL"in O?O.responseURL:T.headers.get("X-Request-URL");var m="response"in O?O.response:O.responseText;v(new G(m,T))},O.onerror=function(){I(new TypeError("Network request failed"))},O.ontimeout=function(){I(new TypeError("Network request failed"))},O.onabort=function(){I(new o.DOMException("Aborted","AbortError"))},O.open(k.method,k.url,!0),k.credentials==="include"?O.withCredentials=!0:k.credentials==="omit"&&(O.withCredentials=!1),"responseType"in O&&a.blob&&(O.responseType="blob"),k.headers.forEach(function(T,m){O.setRequestHeader(m,T)}),k.signal&&(k.signal.addEventListener("abort",B),O.onreadystatechange=function(){O.readyState===4&&k.signal.removeEventListener("abort",B)}),O.send(typeof k._bodyInit>"u"?null:k._bodyInit)})}return N.polyfill=!0,s.fetch||(s.fetch=N,s.Headers=_,s.Request=F,s.Response=G),o.Headers=_,o.Request=F,o.Response=G,o.fetch=N,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e})(NE,NE.exports);$e.rustEnum([$e.struct([],"uninitialized"),$e.struct([$e.option($e.publicKey(),"authorityAddress")],"buffer"),$e.struct([$e.publicKey("programdataAddress")],"program"),$e.struct([$e.u64("slot"),$e.option($e.publicKey(),"upgradeAuthorityAddress")],"programData")],void 0,$e.u32());function Fp(t,e){var n,r;let i={};const s=t.args?t.args.length:0;if(e.length>s){if(e.length!==s+1)throw new Error(`provided too many arguments ${e} to instruction ${t==null?void 0:t.name} expecting: ${(r=(n=t.args)===null||n===void 0?void 0:n.map(o=>o.name))!==null&&r!==void 0?r:[]}`);i=e.pop()}return[e,i]}class Dh{static build(e,n,r){if(e.name==="_inner")throw new js("the _inner name is reserved");const i=(...s)=>{const[o,a]=Fp(e,[...s]);pN(e.accounts,a.accounts),DW(e,...s);const c=i.accounts(a.accounts);return a.remainingAccounts!==void 0&&c.push(...a.remainingAccounts),FT("debug-logs")&&console.log("Outgoing account metas:",c),new bt({keys:c,programId:r,data:n(e.name,JF(e,...o))})};return i.accounts=s=>Dh.accountsArray(s,e.accounts,r,e.name),i}static accountsArray(e,n,r,i){return e?n.map(s=>{if(sc(s)){const u=e[s.name];return Dh.accountsArray(u,s.accounts,r,i).flat()}let o;try{o=ai(e[s.name])}catch{throw new Error(`Wrong input type for account "${s.name}" in the instruction accounts object${i!==void 0?' for instruction "'+i+'"':""}. Expected PublicKey or string.`)}const a=s.optional&&o.equals(r),c=!!(s.writable&&!a),l=!!(s.signer&&!a);return{pubkey:o,isWritable:c,isSigner:l}}).flat():[]}}function DW(t,...e){}class PW{static build(e,n){return(...i)=>{var s,o,a;const[,c]=Fp(e,[...i]),l=new Je;if(c.preInstructions&&c.instructions)throw new Error("instructions is deprecated, use preInstructions");return(s=c.preInstructions)===null||s===void 0||s.forEach(u=>l.add(u)),(o=c.instructions)===null||o===void 0||o.forEach(u=>l.add(u)),l.add(n(...i)),(a=c.postInstructions)===null||a===void 0||a.forEach(u=>l.add(u)),l}}}class BW{static build(e,n,r,i){return async(...o)=>{var a;const c=n(...o),[,l]=Fp(e,[...o]);if(i.sendAndConfirm===void 0)throw new Error("This function requires 'Provider.sendAndConfirm' to be implemented.");try{return await i.sendAndConfirm(c,(a=l.signers)!==null&&a!==void 0?a:[],l.options)}catch(u){throw WT(u,r)}}}}class zW{static build(e,n,r,i){var s;return((s=e.accounts)!==null&&s!==void 0?s:[]).reduce((o,a)=>(o[a.name]=new jW(e,a,r,i,n),o),{})}}class jW{get size(){return this._size}get programId(){return this._programId}get provider(){return this._provider}get coder(){return this._coder}constructor(e,n,r,i,s){this._idlAccount=n,this._programId=r,this._provider=i??ym(),this._coder=s??new HT(e),this._size=this._coder.accounts.size(n.name)}async fetchNullable(e,n){const{data:r}=await this.fetchNullableAndContext(e,n);return r}async fetchNullableAndContext(e,n){const r=await this.getAccountInfoAndContext(e,n),{value:i,context:s}=r;return{data:i&&i.data.length!==0?this._coder.accounts.decode(this._idlAccount.name,i.data):null,context:s}}async fetch(e,n){const{data:r}=await this.fetchNullableAndContext(e,n);if(r===null)throw new Error(`Account does not exist or has no data ${e.toString()}`);return r}async fetchAndContext(e,n){const{data:r,context:i}=await this.fetchNullableAndContext(e,n);if(r===null)throw new Error(`Account does not exist ${e.toString()}`);return{data:r,context:i}}async fetchMultiple(e,n){return(await this.fetchMultipleAndContext(e,n)).map(i=>i?i.data:null)}async fetchMultipleAndContext(e,n){return(await lW(this._provider.connection,e.map(i=>ai(i)),n)).map(i=>{if(i==null)return null;const{account:s,context:o}=i;return{data:this._coder.accounts.decode(this._idlAccount.name,s.data),context:o}})}async all(e){const n=this.coder.accounts.memcmp(this._idlAccount.name,e instanceof re.Buffer?e:void 0),r=[];return(n==null?void 0:n.offset)!=null&&(n==null?void 0:n.bytes)!=null&&r.push({memcmp:{offset:n.offset,bytes:n.bytes}}),(n==null?void 0:n.dataSize)!=null&&r.push({dataSize:n.dataSize}),(await this._provider.connection.getProgramAccounts(this._programId,{commitment:this._provider.connection.commitment,filters:[...r,...Array.isArray(e)?e:[]]})).map(({pubkey:s,account:o})=>({publicKey:s,account:this._coder.accounts.decode(this._idlAccount.name,o.data)}))}subscribe(e,n){const r=Rl.get(e.toString());if(r)return r.ee;const i=new kI;e=ai(e);const s=this._provider.connection.onAccountChange(e,o=>{const a=this._coder.accounts.decode(this._idlAccount.name,o.data);i.emit("change",a)},n);return Rl.set(e.toString(),{ee:i,listener:s}),i}async unsubscribe(e){let n=Rl.get(e.toString());if(!n){console.warn("Address is not subscribed");return}Rl&&await this._provider.connection.removeAccountChangeListener(n.listener).then(()=>{Rl.delete(e.toString())}).catch(console.error)}async createInstruction(e,n){const r=this.size;if(this._provider.publicKey===void 0)throw new Error("This function requires the Provider interface implementor to have a 'publicKey' field.");return _n.createAccount({fromPubkey:this._provider.publicKey,newAccountPubkey:e.publicKey,space:n??r,lamports:await this._provider.connection.getMinimumBalanceForRentExemption(n??r),programId:this._programId})}async getAccountInfo(e,n){return await this._provider.connection.getAccountInfo(ai(e),n)}async getAccountInfoAndContext(e,n){return await this._provider.connection.getAccountInfoAndContext(ai(e),n)}}const Rl=new Map,wm="Program log: ",QT="Program data: ",UW=wm.length,FW=QT.length;class WW{constructor(e,n,r){this._programId=e,this._provider=n,this._eventParser=new XT(e,r),this._eventCallbacks=new Map,this._eventListeners=new Map,this._listenerIdCount=0}addEventListener(e,n){var r;let i=this._listenerIdCount;return this._listenerIdCount+=1,this._eventListeners.has(e)||this._eventListeners.set(e,[]),this._eventListeners.set(e,((r=this._eventListeners.get(e))!==null&&r!==void 0?r:[]).concat(i)),this._eventCallbacks.set(i,[e,n]),this._onLogsSubscriptionId!==void 0||(this._onLogsSubscriptionId=this._provider.connection.onLogs(this._programId,(s,o)=>{if(!s.err)for(const a of this._eventParser.parseLogs(s.logs)){const c=this._eventListeners.get(a.name);c&&c.forEach(l=>{const u=this._eventCallbacks.get(l);if(u){const[,f]=u;f(a.data,o.slot,s.signature)}})}})),i}async removeEventListener(e){const n=this._eventCallbacks.get(e);if(!n)throw new Error(`Event listener ${e} doesn't exist!`);const[r]=n;let i=this._eventListeners.get(r);if(!i)throw new Error(`Event listeners don't exist for ${r}!`);if(this._eventCallbacks.delete(e),i=i.filter(s=>s!==e),this._eventListeners.set(r,i),i.length===0&&this._eventListeners.delete(r),this._eventCallbacks.size===0){if(this._eventListeners.size!==0)throw new Error(`Expected event listeners size to be 0 but got ${this._eventListeners.size}`);this._onLogsSubscriptionId!==void 0&&(await this._provider.connection.removeOnLogsListener(this._onLogsSubscriptionId),this._onLogsSubscriptionId=void 0)}}}class XT{constructor(e,n){this.coder=n,this.programId=e}*parseLogs(e,n=!1){const r=new $W(e),i=new HW;let s=r.next();for(;s!==null;){let[o,a,c]=this.handleLog(i,s,n);o&&(yield o),a&&i.push(a),c&&i.pop(),s=r.next()}}handleLog(e,n,r){return e.stack.length>0&&e.program()===this.programId.toString()?this.handleProgramLog(n,r):[null,...this.handleSystemLog(n)]}handleProgramLog(e,n){if(e.startsWith(wm)||e.startsWith(QT)){const r=e.startsWith(wm)?e.slice(UW):e.slice(FW),i=this.coder.events.decode(r);if(n&&i===null)throw new Error(`Unable to decode event ${r}`);return[i,null,!1]}else return[null,...this.handleSystemLog(e)]}handleSystemLog(e){const n=e.split(":")[0];return n.match(/^Program (.*) success/g)!==null?[null,!0]:n.startsWith(`Program ${this.programId.toString()} invoke`)?[this.programId.toString(),!1]:n.includes("invoke")?["cpi",!1]:[null,!1]}}class HW{constructor(){this.stack=[]}program(){if(!this.stack.length)throw new Error("Expected the stack to have elements");return this.stack[this.stack.length-1]}push(e){this.stack.push(e)}pop(){if(!this.stack.length)throw new Error("Expected the stack to have elements");this.stack.pop()}}class $W{constructor(e){this.logs=e}next(){if(this.logs.length===0)return null;let e=this.logs[0];return this.logs=this.logs.slice(1),e}}class VW{static build(e,n,r,i,s,o,a){return async(...l)=>{var u;const f=n(...l),[,g]=Fp(e,[...l]);let p;if(i.simulate===void 0)throw new Error("This function requires 'Provider.simulate' to be implemented.");try{p=await i.simulate(f,g.signers,(u=g.options)===null||u===void 0?void 0:u.commitment)}catch(S){throw WT(S,r)}if(p===void 0)throw new Error("Unable to simulate transaction");const _=p.logs;if(!_)throw new Error("Simulated logs not found");const A=[];if(a.events){let S=new XT(o,s);for(const E of S.parseLogs(_))A.push(E)}return{events:A,raw:_}}}}function Rg(t){return new JT(xd(8),e=>W_.fromBuffer(e),e=>e.toBuffer(),t)}function sf(t){return new JT(xd(32),e=>new ie(e),e=>e.toBuffer(),t)}function Ng(t,e){return new ZW(t,e)}class JT extends zp{constructor(e,n,r,i){super(e.span,i),this.layout=e,this.decoder=n,this.encoder=r}decode(e,n){return this.decoder(this.layout.decode(e,n))}encode(e,n,r){return this.layout.encode(this.encoder(e),n,r)}getSpan(e,n){return this.layout.getSpan(e,n)}}class ZW extends zp{constructor(e,n){super(-1,n),this.layout=e,this.discriminator=us()}encode(e,n,r=0){return e==null?this.layout.span+this.discriminator.encode(0,n,r):(this.discriminator.encode(1,n,r),this.layout.encode(e,n,r+4)+4)}decode(e,n=0){const r=this.discriminator.decode(e,n);if(r===0)return null;if(r===1)return this.layout.decode(e,n+4);throw new Error("Invalid coption "+this.layout.property)}getSpan(e,n=0){return this.layout.getSpan(e,n+4)+4}}class W_ extends ss{toBuffer(){const e=super.toArray().reverse(),n=re.Buffer.from(e);if(n.length===8)return n;if(n.length>=8)throw new Error("u64 too large");const r=re.Buffer.alloc(8);return n.copy(r),r}static fromBuffer(e){if(e.length!==8)throw new Error(`Invalid buffer length: ${e.length}`);return new W_([...e].reverse().map(n=>`00${n.toString(16)}`.slice(-2)).join(""),16)}}const KW=bn([sf("mint"),sf("owner"),Rg("amount"),Ng(sf(),"delegate"),(t=>{const e=qT(MW("discriminator"),null,t);return e.addVariant(0,bn([]),"uninitialized"),e.addVariant(1,bn([]),"initialized"),e.addVariant(2,bn([]),"frozen"),e})("state"),Ng(Rg(),"isNative"),Rg("delegatedAmount"),Ng(sf(),"closeAuthority")]);function GW(t){return KW.decode(t)}class YW{constructor(e,n,r,i,s,o,a,c){this._args=e,this._accounts=n,this._provider=r,this._programId=i,this._idlIx=s,this._idlTypes=a,this._customResolver=c,this._accountStore=new qW(r,o,i)}args(e){this._args=e}async resolve(){this.resolveEventCpi(this._idlIx.accounts),this.resolveConst(this._idlIx.accounts);let e=0;for(;await this.resolvePdasAndRelations(this._idlIx.accounts)+await this.resolveCustom()>0;)if(e++,e===16)throw new Error("Reached maximum depth for account resolution")}resolveOptionals(e){Object.assign(this._accounts,this.resolveOptionalsHelper(e,this._idlIx.accounts))}get(e){const n=e.reduce((r,i)=>r&&r[i],this._accounts);if(n&&n.toBase58)return n}set(e,n){let r=this._accounts;e.forEach((i,s)=>{var o;s===e.length-1&&(r[i]=n),r[i]=(o=r[i])!==null&&o!==void 0?o:{},r=r[i]})}resolveOptionalsHelper(e,n){const r={};for(const i of n){const s=i.name,o=e[s];o!==void 0&&(e2(o)?sc(i)?r[s]=this.resolveOptionalsHelper(o,i.accounts):r[s]=t2(o):o!==null?r[s]=ai(o):i.optional&&(r[s]=this._programId))}return r}async resolveCustom(){if(this._customResolver){const{accounts:e,resolved:n}=await this._customResolver({args:this._args,accounts:this._accounts,provider:this._provider,programId:this._programId,idlIx:this._idlIx});return this._accounts=e,n}return 0}resolveEventCpi(e,n=[]){for(const r in e){const i=e[r];sc(i)&&this.resolveEventCpi(i.accounts,[...n,i.name]);const s=+r+1;if(s===e.length)return;const o=e[r].name,a=e[s].name;if(o==="eventAuthority"&&a==="program"){const c=[...n,o],l=[...n,a];this.get(c)||this.set(c,ie.findProgramAddressSync([re.Buffer.from("__event_authority")],this._programId)[0]),this.get(l)||this.set(l,this._programId);return}}}resolveConst(e,n=[]){for(const r of e){const i=r.name;if(sc(r))this.resolveConst(r.accounts,[...n,i]);else{const s=r;if((s.signer||s.address)&&!this.get([...n,i])){if(s.signer){if(!this._provider.wallet)throw new Error("This function requires the `Provider` interface implementor to have a `wallet` field.");this.set([...n,i],this._provider.wallet.publicKey)}s.address&&this.set([...n,i],ai(s.address))}}}}async resolvePdasAndRelations(e,n=[]){let r=0;for(const i of e){const s=i.name;if(sc(i))r+=await this.resolvePdasAndRelations(i.accounts,[...n,s]);else{const o=i;if((o.pda||o.relations)&&!this.get([...n,s])){r++;try{if(o.pda){const a=await Promise.all(o.pda.seeds.map(u=>this.toBuffer(u,n)));if(a.some(u=>!u))continue;const c=await this.parseProgramId(o,n),[l]=ie.findProgramAddressSync(a,c);this.set([...n,s],l)}}catch{}try{if(o.relations){const a=this.get([...n,o.relations[0]]);if(a){const c=await this._accountStore.fetchAccount({publicKey:a});this.set([...n,s],c[s])}}}catch{}}}}return r}async parseProgramId(e,n=[]){var r;if(!(!((r=e.pda)===null||r===void 0)&&r.program))return this._programId;const i=await this.toBuffer(e.pda.program,n);if(!i)throw new Error(`Program seed not resolved: ${e.name}`);return new ie(i)}async toBuffer(e,n=[]){switch(e.kind){case"const":return this.toBufferConst(e);case"arg":return await this.toBufferArg(e);case"account":return await this.toBufferAccount(e,n);default:throw new Error(`Unexpected seed: ${e}`)}}toBufferConst(e){return this.toBufferValue("bytes",e.value)}async toBufferArg(e){const[n,...r]=e.path.split("."),i=this._idlIx.args.findIndex(a=>a.name===n);if(i===-1)throw new Error(`Unable to find argument for seed: ${n}`);const s=r.reduce((a,c)=>(a??{})[c],this._args[i]);if(s===void 0)return;const o=this.getType(this._idlIx.args[i].type,r);return this.toBufferValue(o,s)}async toBufferAccount(e,n=[]){const[r,...i]=e.path.split("."),s=this.get([...n,r]);if(!s)return;if(!i.length)return this.toBufferValue("pubkey",s);if(!e.account)throw new Error(`Seed account is required in order to resolve type: ${e.path}`);let a=await this._accountStore.fetchAccount({publicKey:s,name:e.account}),c=i;for(;c.length>0;)a=a[c[0]],c=c.slice(1);if(a===void 0)return;const l=this.getType({defined:{name:e.account}},i);return this.toBufferValue(l,a)}toBufferValue(e,n){switch(e){case"u8":case"i8":return re.Buffer.from([n]);case"u16":case"i16":return new ss(n).toArrayLike(re.Buffer,"le",2);case"u32":case"i32":return new ss(n).toArrayLike(re.Buffer,"le",4);case"u64":case"i64":return new ss(n).toArrayLike(re.Buffer,"le",8);case"u128":case"i128":return new ss(n).toArrayLike(re.Buffer,"le",16);case"u256":case"i256":return new ss(n).toArrayLike(re.Buffer,"le",32);case"string":return re.Buffer.from(n);case"pubkey":return n.toBuffer();case"bytes":return re.Buffer.from(n);default:if(e!=null&&e.array)return re.Buffer.from(n);throw new Error(`Unexpected seed type: ${e}`)}}getType(e,n=[]){var r;const i=(r=e==null?void 0:e.defined)===null||r===void 0?void 0:r.name;if(i){if(i==="tokenAccount")switch(n.at(0)){case"mint":case"owner":return"pubkey";case"amount":case"delagatedAmount":return"u64";default:throw new Error(`Unknown token account path: ${n}`)}const s=this._idlTypes.find(u=>u.name===i);if(!s)throw new Error(`Type not found: ${i}`);const[o,...a]=n,l=s.type.fields.find(u=>u.name===o);if(!l)throw new Error(`Field not found: ${o}`);return this.getType(l.type,a)}return e}}class qW{constructor(e,n,r){this._provider=e,this._cache=new Map,this._idls={},this._idls[r.toBase58()]=n}async fetchAccount({publicKey:e,name:n}){const r=e.toBase58();if(!this._cache.has(r)){const i=await this._provider.connection.getAccountInfo(e);if(i===null)throw new Error(`Account not found: ${r}`);if(n==="tokenAccount"){const s=GW(i.data);this._cache.set(r,s)}else{const s=await this.getAccountsNs(i.owner);if(s){const o=Object.values(s)[0];if(o){const a=o.coder.accounts.decodeAny(i.data);this._cache.set(r,a)}}}}return this._cache.get(r)}async getAccountsNs(e){const n=e.toBase58();if(!this._idls[n]){const r=await Kc.fetchIdl(e,this._provider);if(r){const i=new Kc(r,this._provider);this._idls[n]=i.account}}return this._idls[n]}}class QW{static build(e,n,r,i,s,o,a,c,l,u,f){return(...g)=>new XW(g,i,s,o,a,c,e,n,r,l,u,f)}}function e2(t){return typeof t=="object"&&t!==null&&!("_bn"in t)}function t2(t,e){const n={};for(const r in t){const i=t[r];if(i===null)throw new Error("Failed to resolve optionals due to IDL type mismatch with input accounts!");n[r]=e2(i)?t2(i):ai(i)}return n}class XW{constructor(e,n,r,i,s,o,a,c,l,u,f,g){this._args=e,this._ixFn=n,this._txFn=r,this._rpcFn=i,this._simulateFn=s,this._viewFn=o,this._accounts={},this._remainingAccounts=[],this._signers=[],this._preInstructions=[],this._postInstructions=[],this._resolveAccounts=!0,this._accountsResolver=new YW(e,this._accounts,a,c,l,u,f,g)}args(e){this._args=e,this._accountsResolver.args(e)}accounts(e){return this.accountsPartial(e)}accountsPartial(e){return this._resolveAccounts=!0,this._accountsResolver.resolveOptionals(e),this}accountsStrict(e){return this._resolveAccounts=!1,this._accountsResolver.resolveOptionals(e),this}signers(e){return this._signers=this._signers.concat(e),this}remainingAccounts(e){return this._remainingAccounts=this._remainingAccounts.concat(e),this}preInstructions(e,n=!1){return n?this._preInstructions=e.concat(this._preInstructions):this._preInstructions=this._preInstructions.concat(e),this}postInstructions(e){return this._postInstructions=this._postInstructions.concat(e),this}async pubkeys(){return this._resolveAccounts&&await this._accountsResolver.resolve(),this._accounts}async rpc(e){return this._resolveAccounts&&await this._accountsResolver.resolve(),this._rpcFn(...this._args,{accounts:this._accounts,signers:this._signers,remainingAccounts:this._remainingAccounts,preInstructions:this._preInstructions,postInstructions:this._postInstructions,options:e})}async rpcAndKeys(e){return{pubkeys:await this.pubkeys(),signature:await this.rpc(e)}}async view(e){if(this._resolveAccounts&&await this._accountsResolver.resolve(),!this._viewFn)throw new Error("Method does not support views");return this._viewFn(...this._args,{accounts:this._accounts,signers:this._signers,remainingAccounts:this._remainingAccounts,preInstructions:this._preInstructions,postInstructions:this._postInstructions,options:e})}async simulate(e){return this._resolveAccounts&&await this._accountsResolver.resolve(),this._simulateFn(...this._args,{accounts:this._accounts,signers:this._signers,remainingAccounts:this._remainingAccounts,preInstructions:this._preInstructions,postInstructions:this._postInstructions,options:e})}async instruction(){return this._resolveAccounts&&await this._accountsResolver.resolve(),this._ixFn(...this._args,{accounts:this._accounts,signers:this._signers,remainingAccounts:this._remainingAccounts,preInstructions:this._preInstructions,postInstructions:this._postInstructions})}async prepare(){return{instruction:await this.instruction(),pubkeys:await this.pubkeys(),signers:this._signers}}async transaction(){return this._resolveAccounts&&await this._accountsResolver.resolve(),this._txFn(...this._args,{accounts:this._accounts,signers:this._signers,remainingAccounts:this._remainingAccounts,preInstructions:this._preInstructions,postInstructions:this._postInstructions})}}class JW{static build(e,n,r,i){const s=n.accounts.find(c=>c.writable),o=!!n.returns;return s||!o?void 0:async(...c)=>{let l=await r(...c);const u=`Program return: ${e} `;let f=l.raw.find(A=>A.startsWith(u));if(!f)throw new Error("View expected return log");let g=hN(f.slice(u.length)),p=n.returns;if(!p)throw new Error("View expected return type");return nt.fieldLayout({type:p},i.types).decode(g)}}}class e9{static build(e,n,r,i,s){const o={},a={},c={},l={},u={},f={},g=XF(e),p=e.accounts?zW.build(e,n,r,i):{};return e.instructions.forEach(_=>{const A=Dh.build(_,(z,D)=>n.instruction.encode(z,D),r),S=PW.build(_,A),E=BW.build(_,S,g,i),b=VW.build(_,S,g,i,n,r,e),x=JW.build(r,_,b,e),M=QW.build(i,r,_,A,S,E,b,x,p,e.types||[],s==null?void 0:s(_)),L=_.name;a[L]=A,c[L]=S,o[L]=E,l[L]=b,u[L]=M,x&&(f[L]=x)}),[o,a,c,p,l,u,f]}}class Kc{get programId(){return this._programId}get idl(){return this._idl}get rawIdl(){return this._rawIdl}get coder(){return this._coder}get provider(){return this._provider}constructor(e,n=ym(),r,i){const s=QF(e);this._idl=s,this._rawIdl=e,this._provider=n,this._programId=ai(e.address),this._coder=r??new HT(s),this._events=new WW(this._programId,n,this._coder);const[o,a,c,l,u,f,g]=e9.build(s,this._coder,this._programId,n,i);this.rpc=o,this.instruction=a,this.transaction=c,this.account=l,this.simulate=u,this.methods=f,this.views=g}static async at(e,n){const r=ai(e),i=await Kc.fetchIdl(r,n);if(!i)throw new Error(`IDL not found for program: ${e.toString()}`);return new Kc(i,n)}static async fetchIdl(e,n){n=n??ym();const r=ai(e),i=await KF(r),s=await n.connection.getAccountInfo(i);if(!s)return null;let o=qF(s.data.slice(8));const a=$F(o.data);return JSON.parse(ZF(a))}addEventListener(e,n){return this._events.addEventListener(e,n)}async removeEventListener(e){return await this._events.removeEventListener(e)}}new ie("11111111111111111111111111111111");const t9="3o3K93TeUMRxrcsWf2Eu6E7oX41Ffx9AWcxEZqC6KEqg",n9={name:"mess",version:"0.1.0",spec:"0.1.0",description:"Created with Anchor"},r9=[{name:"init",discriminator:[220,59,207,236,108,250,47,100],accounts:[{name:"chat",writable:!0,pda:{seeds:[{kind:"const",value:[103,108,111,98,97,108]},{kind:"account",path:"payer"}]}},{name:"payer",writable:!0,signer:!0},{name:"system_program",address:"11111111111111111111111111111111"}],args:[]},{name:"send",discriminator:[102,251,20,187,65,75,12,69],accounts:[{name:"chat",writable:!0},{name:"sender",signer:!0}],args:[{name:"text",type:"string"}]}],i9=[{name:"Chat",discriminator:[170,4,71,128,185,103,250,177]}],s9=[{name:"Chat",type:{kind:"struct",fields:[{name:"messages",type:{vec:{defined:{name:"Message"}}}}]}},{name:"Message",type:{kind:"struct",fields:[{name:"sender",type:"pubkey"},{name:"text",type:"string"}]}}],o9={address:t9,metadata:n9,instructions:r9,accounts:i9,types:s9};function a9(){const{connection:t}=i_(),{publicKey:e}=il(),n=nP(),[r,i]=j.useState(null),[s,o]=j.useState(null),[a,c]=j.useState(!1);return j.useEffect(()=>{if(n){const l=new Yu(t,n,{});i(new Kc(o9,l))}},[t,n]),j.useEffect(()=>{o(e?rR(e):null)},[e]),te.jsxs(te.Fragment,{children:[te.jsx(e5,{setChatPDA:o}),te.jsx(t5,{program:r,chatPDA:s,isLoadingChat:a,setIsLoadingChat:c})]})}const c9="Bitget";class l9 extends fd{constructor(e={}){super(),this.name=c9,this.url="https://web3.bitget.com",this.icon="data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjI1NiIgdmlld0JveD0iMCAwIDI1NiAyNTYiIHdpZHRoPSIyNTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxmaWx0ZXIgaWQ9ImEiIGNvbG9yLWludGVycG9sYXRpb24tZmlsdGVycz0ic1JHQiIgZmlsdGVyVW5pdHM9InVzZXJTcGFjZU9uVXNlIiBoZWlnaHQ9IjQ1MS40MzEiIHdpZHRoPSI1NjkuNTU4IiB4PSItOTAuMjQxMSIgeT0iLTY5LjczNjkiPjxmZUZsb29kIGZsb29kLW9wYWNpdHk9IjAiIHJlc3VsdD0iQmFja2dyb3VuZEltYWdlRml4Ii8+PGZlQmxlbmQgaW49IlNvdXJjZUdyYXBoaWMiIGluMj0iQmFja2dyb3VuZEltYWdlRml4IiBtb2RlPSJub3JtYWwiIHJlc3VsdD0ic2hhcGUiLz48ZmVHYXVzc2lhbkJsdXIgcmVzdWx0PSJlZmZlY3QxX2ZvcmVncm91bmRCbHVyXzIwMzVfMTEwNiIgc3RkRGV2aWF0aW9uPSI0OS4yMzA4Ii8+PC9maWx0ZXI+PGZpbHRlciBpZD0iYiIgY29sb3ItaW50ZXJwb2xhdGlvbi1maWx0ZXJzPSJzUkdCIiBmaWx0ZXJVbml0cz0idXNlclNwYWNlT25Vc2UiIGhlaWdodD0iMzcxLjUwNyIgd2lkdGg9IjM1MS41OTYiIHg9Ii0xNjAuNTExIiB5PSItMTY1Ljk4NyI+PGZlRmxvb2QgZmxvb2Qtb3BhY2l0eT0iMCIgcmVzdWx0PSJCYWNrZ3JvdW5kSW1hZ2VGaXgiLz48ZmVCbGVuZCBpbj0iU291cmNlR3JhcGhpYyIgaW4yPSJCYWNrZ3JvdW5kSW1hZ2VGaXgiIG1vZGU9Im5vcm1hbCIgcmVzdWx0PSJzaGFwZSIvPjxmZUdhdXNzaWFuQmx1ciByZXN1bHQ9ImVmZmVjdDFfZm9yZWdyb3VuZEJsdXJfMjAzNV8xMTA2IiBzdGREZXZpYXRpb249IjQ5LjIzMDgiLz48L2ZpbHRlcj48ZmlsdGVyIGlkPSJjIiBjb2xvci1pbnRlcnBvbGF0aW9uLWZpbHRlcnM9InNSR0IiIGZpbHRlclVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgaGVpZ2h0PSI0MjQuNDUyIiB3aWR0aD0iNDQ0Ljg1MSIgeD0iLTI0MS4wNzgiIHk9IjY3LjY0MiI+PGZlRmxvb2QgZmxvb2Qtb3BhY2l0eT0iMCIgcmVzdWx0PSJCYWNrZ3JvdW5kSW1hZ2VGaXgiLz48ZmVCbGVuZCBpbj0iU291cmNlR3JhcGhpYyIgaW4yPSJCYWNrZ3JvdW5kSW1hZ2VGaXgiIG1vZGU9Im5vcm1hbCIgcmVzdWx0PSJzaGFwZSIvPjxmZUdhdXNzaWFuQmx1ciByZXN1bHQ9ImVmZmVjdDFfZm9yZWdyb3VuZEJsdXJfMjAzNV8xMTA2IiBzdGREZXZpYXRpb249IjQ5LjIzMDgiLz48L2ZpbHRlcj48ZmlsdGVyIGlkPSJkIiBjb2xvci1pbnRlcnBvbGF0aW9uLWZpbHRlcnM9InNSR0IiIGZpbHRlclVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgaGVpZ2h0PSIzODUuMTA1IiB3aWR0aD0iNDMwLjE5MSIgeD0iLTIwLjM5NjgiIHk9Ii0yNDIuNzU4Ij48ZmVGbG9vZCBmbG9vZC1vcGFjaXR5PSIwIiByZXN1bHQ9IkJhY2tncm91bmRJbWFnZUZpeCIvPjxmZUJsZW5kIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9IkJhY2tncm91bmRJbWFnZUZpeCIgbW9kZT0ibm9ybWFsIiByZXN1bHQ9InNoYXBlIi8+PGZlR2F1c3NpYW5CbHVyIHJlc3VsdD0iZWZmZWN0MV9mb3JlZ3JvdW5kQmx1cl8yMDM1XzExMDYiIHN0ZERldmlhdGlvbj0iNDkuMjMwOCIvPjwvZmlsdGVyPjxjbGlwUGF0aCBpZD0iZSI+PHBhdGggZD0ibTAgMGgyNTZ2MjU2aC0yNTZ6Ii8+PC9jbGlwUGF0aD48ZyBjbGlwLXBhdGg9InVybCgjZSkiPjxwYXRoIGQ9Im0wIDBoMjU2djI1NmgtMjU2eiIgZmlsbD0iIzU0ZmZmNSIvPjxnIGZpbHRlcj0idXJsKCNhKSI+PHBhdGggZD0ibTEzLjQ4MDYgMTk4LjYwNWMtNDIuODA4MiAxMjAuNDM4IDE4Ni4xODA0IDg2LjQyMiAzMDYuMDI2NCA1NC4zNTkgMTIyLjY1OC00MC43MDUgMzcuODc5LTIyMC4xMzcxLTUwLjA5Mi0yMjQuMTA4Mi04Ny45NzItMy45NzExIDEwLjkwNyA4Mi45NjgyLTYzLjgyIDEwNy44MDAyLTc0LjcyNyAyNC44MzEtMTM4LjYwNDMtODguNTk3Ny0xOTIuMTE0NCA2MS45NDl6IiBmaWxsPSIjZmZmIi8+PC9nPjxnIGZpbHRlcj0idXJsKCNiKSI+PHBhdGggZD0ibTg1LjUxMTgtNDUuODIyNWMtMjIuNDU1Ni02MS4zNTM1LTEwMi40MzA3IDIxLjgyNzItMTM5LjYxMTMgNzEuMDg2OC0zNS40NjU3IDUzLjU4MzYgNTcuMTA4ODcgOTkuODg3NyA5My40MjAzIDc0Ljc3MjcgMzYuMzExNS0yNS4xMTQzLTMxLjU0NjMyLTMwLjAwMDctOS45NS02Mi42NTg1IDIxLjU5NjMtMzIuNjU3NzQgODQuMjEwMi02LjUwOSA1Ni4xNDEtODMuMjAxeiIgZmlsbD0iIzAwZmZmMCIgZmlsbC1vcGFjaXR5PSIuNjciLz48L2c+PGcgZmlsdGVyPSJ1cmwoI2MpIj48cGF0aCBkPSJtOTYuNDc5NiAyMjUuNDI0Yy0zMC42Mjk0LTEwMy4wNjEtMTYyLjU2MTQtNDguNzg3LTIyNC42OTg2LTguNzY3LTU5Ljc3MSA0Ny4zODUgODIuMTQ3OSAxODMuNjkxIDE0MS4wOTE1IDE3Ni43MTkgNTguOTQzNi02Ljk3My00Ny4yODQzLTY2LjMxMS0xMC44ODU0OC05NS4yMDYgMzYuMzk4NzgtMjguODk0IDEzMi43Nzg5OCA1Ni4wNzkgOTQuNDkyNTgtNzIuNzQ2eiIgZmlsbD0iIzlkODFmZiIvPjwvZz48ZyBmaWx0ZXI9InVybCgjZCkiPjxwYXRoIGQ9Im0yODIuMTItMTA3LjM1M2MtNjYuMDczLTc4LjY3OC0xNjAuNjU3LTEzLjYxNy0xOTkuNjkwNCAyOC43NDgzLTM0LjE1NTcgNDcuOTYwMSAxNDEuODQ1NCAxMzUuODM1OSAxOTAuNjkxNCAxMjAuNzc2MSA0OC44NDctMTUuMDU5OS02Ni42MDktNDYuMjIxNzgtNDUuODI0LTc1LjQ1OTMgMjAuNzg1LTI5LjIzNzYgMTM3LjQxNSAyNC4yODIyNCA1NC44MjMtNzQuMDY1MXoiIGZpbGw9IiM0ZDk0ZmYiLz48L2c+PHBhdGggY2xpcC1ydWxlPSJldmVub2RkIiBkPSJtOTMuMTg5IDE1Mi44MzZoNDMuNDg1bC00OS40NjU0LTQ5Ljc4NSA1MC4xMDE0LTQ5Ljc4NDcgMTMuNjQ1LTEzLjI2NjNoLTQ1LjEzNmwtNTcuNDgzMSA1Ny43NzczYy0yLjkwMSAyLjkxMTctMi44ODYxIDcuNjI0Ny4wMjk3IDEwLjUyMTd6bTI2LjE0MS00OS42NjhoLS4zMzVsLjMzMS0uMDA0em0wIDAgNDkuNDYxIDQ5Ljc4MS01MC4xMDEgNDkuNzg1LTEzLjY0NSAxMy4yNjZoNDUuMTM1bDU3LjQ4NC01Ny43NzRjMi45MDEtMi45MTIgMi44ODYtNy42MjQtLjAzLTEwLjUyMWwtNDQuODIzLTQ0LjUzN3oiIGZpbGw9IiMwMDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=",this.supportedTransactionVersions=null,this._readyState=typeof window>"u"||typeof document>"u"?Te.Unsupported:Te.NotDetected,this._connecting=!1,this._wallet=null,this._publicKey=null,this._readyState!==Te.Unsupported&&_p(()=>{var n,r;return(r=(n=window.bitkeep)==null?void 0:n.solana)!=null&&r.isBitKeep?(this._readyState=Te.Installed,this.emit("readyStateChange",this._readyState),!0):!1})}get publicKey(){return this._publicKey}get connecting(){return this._connecting}get readyState(){return this._readyState}async connect(){try{if(this.connected||this.connecting)return;if(this._readyState!==Te.Installed)throw new Ci;this._connecting=!0;const e=window.bitkeep.solana;let n;try{n=await e.getAccount()}catch(i){throw new ps(i==null?void 0:i.message,i)}let r;try{r=new ie(n)}catch(i){throw new wo(i==null?void 0:i.message,i)}this._wallet=e,this._publicKey=r,this.emit("connect",r)}catch(e){throw this.emit("error",e),e}finally{this._connecting=!1}}async disconnect(){const e=this._wallet;if(e){this._wallet=null,this._publicKey=null;try{await e.disconnect()}catch(n){this.emit("error",new ud(n==null?void 0:n.message,n))}}this.emit("disconnect")}async signTransaction(e){try{const n=this._wallet;if(!n)throw new Et;try{return await n.signTransaction(e)||e}catch(r){throw new Gn(r==null?void 0:r.message,r)}}catch(n){throw this.emit("error",n),n}}async signAllTransactions(e){try{const n=this._wallet;if(!n)throw new Et;try{return await n.signAllTransactions(e)||e}catch(r){throw new Gn(r==null?void 0:r.message,r)}}catch(n){throw this.emit("error",n),n}}async signMessage(e){try{const n=this._wallet;if(!n)throw new Et;try{const{signature:r}=await n.signMessage(e);return r}catch(r){throw new Gn(r==null?void 0:r.message,r)}}catch(n){throw this.emit("error",n),n}}}const u9="modulepreload",d9=function(t,e){return new URL(t,e).href},TE={},H_=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){const o=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),c=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));i=Promise.allSettled(n.map(l=>{if(l=d9(l,r),l in TE)return;TE[l]=!0;const u=l.endsWith(".css"),f=u?'[rel="stylesheet"]':"";if(!!r)for(let _=o.length-1;_>=0;_--){const A=o[_];if(A.href===l&&(!u||A.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${f}`))return;const p=document.createElement("link");if(p.rel=u?"stylesheet":u9,u||(p.as="script"),p.crossOrigin="",p.href=l,c&&p.setAttribute("nonce",c),document.head.appendChild(p),u)return new Promise((_,A)=>{p.addEventListener("load",_),p.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${l}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return e().catch(s)})},f9="Phantom";class h9 extends fd{constructor(e={}){super(),this.name=f9,this.url="https://phantom.app",this.icon="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDgiIGhlaWdodD0iMTA4IiB2aWV3Qm94PSIwIDAgMTA4IDEwOCIgZmlsbD0ibm9uZSI+CjxyZWN0IHdpZHRoPSIxMDgiIGhlaWdodD0iMTA4IiByeD0iMjYiIGZpbGw9IiNBQjlGRjIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00Ni41MjY3IDY5LjkyMjlDNDIuMDA1NCA3Ni44NTA5IDM0LjQyOTIgODUuNjE4MiAyNC4zNDggODUuNjE4MkMxOS41ODI0IDg1LjYxODIgMTUgODMuNjU2MyAxNSA3NS4xMzQyQzE1IDUzLjQzMDUgNDQuNjMyNiAxOS44MzI3IDcyLjEyNjggMTkuODMyN0M4Ny43NjggMTkuODMyNyA5NCAzMC42ODQ2IDk0IDQzLjAwNzlDOTQgNTguODI1OCA4My43MzU1IDc2LjkxMjIgNzMuNTMyMSA3Ni45MTIyQzcwLjI5MzkgNzYuOTEyMiA2OC43MDUzIDc1LjEzNDIgNjguNzA1MyA3Mi4zMTRDNjguNzA1MyA3MS41NzgzIDY4LjgyNzUgNzAuNzgxMiA2OS4wNzE5IDY5LjkyMjlDNjUuNTg5MyA3NS44Njk5IDU4Ljg2ODUgODEuMzg3OCA1Mi41NzU0IDgxLjM4NzhDNDcuOTkzIDgxLjM4NzggNDUuNjcxMyA3OC41MDYzIDQ1LjY3MTMgNzQuNDU5OEM0NS42NzEzIDcyLjk4ODQgNDUuOTc2OCA3MS40NTU2IDQ2LjUyNjcgNjkuOTIyOVpNODMuNjc2MSA0Mi41Nzk0QzgzLjY3NjEgNDYuMTcwNCA4MS41NTc1IDQ3Ljk2NTggNzkuMTg3NSA0Ny45NjU4Qzc2Ljc4MTYgNDcuOTY1OCA3NC42OTg5IDQ2LjE3MDQgNzQuNjk4OSA0Mi41Nzk0Qzc0LjY5ODkgMzguOTg4NSA3Ni43ODE2IDM3LjE5MzEgNzkuMTg3NSAzNy4xOTMxQzgxLjU1NzUgMzcuMTkzMSA4My42NzYxIDM4Ljk4ODUgODMuNjc2MSA0Mi41Nzk0Wk03MC4yMTAzIDQyLjU3OTVDNzAuMjEwMyA0Ni4xNzA0IDY4LjA5MTYgNDcuOTY1OCA2NS43MjE2IDQ3Ljk2NThDNjMuMzE1NyA0Ny45NjU4IDYxLjIzMyA0Ni4xNzA0IDYxLjIzMyA0Mi41Nzk1QzYxLjIzMyAzOC45ODg1IDYzLjMxNTcgMzcuMTkzMSA2NS43MjE2IDM3LjE5MzFDNjguMDkxNiAzNy4xOTMxIDcwLjIxMDMgMzguOTg4NSA3MC4yMTAzIDQyLjU3OTVaIiBmaWxsPSIjRkZGREY4Ii8+Cjwvc3ZnPg==",this.supportedTransactionVersions=new Set(["legacy",0]),this._readyState=typeof window>"u"||typeof document>"u"?Te.Unsupported:Te.NotDetected,this._disconnected=()=>{const n=this._wallet;n&&(n.off("disconnect",this._disconnected),n.off("accountChanged",this._accountChanged),this._wallet=null,this._publicKey=null,this.emit("error",new ld),this.emit("disconnect"))},this._accountChanged=n=>{const r=this._publicKey;if(r){try{n=new ie(n.toBytes())}catch(i){this.emit("error",new wo(i==null?void 0:i.message,i));return}r.equals(n)||(this._publicKey=n,this.emit("connect",n))}},this._connecting=!1,this._wallet=null,this._publicKey=null,this._readyState!==Te.Unsupported&&(Py()?(this._readyState=Te.Loadable,this.emit("readyStateChange",this._readyState)):_p(()=>{var n,r,i;return(r=(n=window.phantom)==null?void 0:n.solana)!=null&&r.isPhantom||(i=window.solana)!=null&&i.isPhantom?(this._readyState=Te.Installed,this.emit("readyStateChange",this._readyState),!0):!1}))}get publicKey(){return this._publicKey}get connecting(){return this._connecting}get readyState(){return this._readyState}async autoConnect(){this.readyState===Te.Installed&&await this.connect()}async connect(){var e;try{if(this.connected||this.connecting)return;if(this.readyState===Te.Loadable){const i=encodeURIComponent(window.location.href),s=encodeURIComponent(window.location.origin);window.location.href=`https://phantom.app/ul/browse/${i}?ref=${s}`;return}if(this.readyState!==Te.Installed)throw new Ci;this._connecting=!0;const n=((e=window.phantom)==null?void 0:e.solana)||window.solana;if(!n.isConnected)try{await n.connect()}catch(i){throw new hs(i==null?void 0:i.message,i)}if(!n.publicKey)throw new ps;let r;try{r=new ie(n.publicKey.toBytes())}catch(i){throw new wo(i==null?void 0:i.message,i)}n.on("disconnect",this._disconnected),n.on("accountChanged",this._accountChanged),this._wallet=n,this._publicKey=r,this.emit("connect",r)}catch(n){throw this.emit("error",n),n}finally{this._connecting=!1}}async disconnect(){const e=this._wallet;if(e){e.off("disconnect",this._disconnected),e.off("accountChanged",this._accountChanged),this._wallet=null,this._publicKey=null;try{await e.disconnect()}catch(n){this.emit("error",new ud(n==null?void 0:n.message,n))}}this.emit("disconnect")}async sendTransaction(e,n,r={}){try{const i=this._wallet;if(!i)throw new Et;try{const{signers:s,...o}=r;ys(e)?s!=null&&s.length&&e.sign(s):(e=await this.prepareTransaction(e,n,o),s!=null&&s.length&&e.partialSign(...s)),o.preflightCommitment=o.preflightCommitment||n.commitment;const{signature:a}=await i.signAndSendTransaction(e,o);return a}catch(s){throw s instanceof Tn?s:new gs(s==null?void 0:s.message,s)}}catch(i){throw this.emit("error",i),i}}async signTransaction(e){try{const n=this._wallet;if(!n)throw new Et;try{return await n.signTransaction(e)||e}catch(r){throw new Gn(r==null?void 0:r.message,r)}}catch(n){throw this.emit("error",n),n}}async signAllTransactions(e){try{const n=this._wallet;if(!n)throw new Et;try{return await n.signAllTransactions(e)||e}catch(r){throw new Gn(r==null?void 0:r.message,r)}}catch(n){throw this.emit("error",n),n}}async signMessage(e){try{const n=this._wallet;if(!n)throw new Et;try{const{signature:r}=await n.signMessage(e);return r}catch(r){throw new dd(r==null?void 0:r.message,r)}}catch(n){throw this.emit("error",n),n}}}const p9="Salmon";class g9 extends fd{constructor({network:e=zy.Mainnet}={}){super(),this.name=p9,this.url="https://salmonwallet.io",this.icon="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iODgiIGhlaWdodD0iODgiIHZpZXdCb3g9IjAgMCA4OCA4OCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9Ijg4IiBoZWlnaHQ9Ijg4IiByeD0iMzAiIGZpbGw9InVybCgjcGFpbnQwX2xpbmVhcl84NTVfNTgwKSIvPgo8cGF0aCBkPSJNNTkuODA1NSAyNy42M0M1Ni43OTU1IDI1LjgyMzkgNTMuNjIyMiAyNC41Mzg4IDUwLjM1OTcgMjMuODE0NEw0Ni45MDQyIDE2LjEyODdDNDYuNDkzMyAxNC44NTg1IDQ1LjMwMDIgMTQuMDAwMSA0My45NTM3IDE0LjAwMDFINDMuODE1QzQyLjQ2ODUgMTQuMDAwMSA0MS4yNzU0IDE0Ljg2MzUgNDAuODY0NSAxNi4xMjg3TDM3LjQwOSAyMy44MDk1QzM0LjE0MTYgMjQuNTM4OCAzMC45NTgzIDI1LjgyODkgMjcuOTQzNCAyNy42MzQ5QzIxLjk1MzIgMzkuMjYwMyAyMC4zMjk0IDUwLjU5MjggMjEuMTQxMyA2MS43NjY2QzI0LjY1MTMgNjUuMTY1NCAzMi40MzM2IDY5LjM2OCAzNi42MDcgNzEuMDMwMkMzOS4wNTI2IDcyLjAwMjcgMzkuODAwMSA3Mi40OTM5IDQyLjI1MDYgNzIuOTAwN0M0NC40Mjg5IDczLjUxNiA0NS4wODczIDczLjI3NzggNDYuNzU1NyA3My4xMDQyQzQ5LjMyNTEgNzIuNDE5NSA1MC4zOTQ0IDcxLjcyNDggNTEuNDM0IDcxLjE2NDFDNTUuODQ5OSA2OC44NzY4IDYzLjExNzQgNjUuMTcwNCA2Ni42Mjc0IDYxLjc3MTZDNjcuNTc3OSA0OC44MTE2IDY0Ljk5ODYgMzcuNTgzMiA1OS44MDU1IDI3LjYyNVYyNy42M1pNMzcuNTI3OCA1MS4xNDg1QzM1LjY0MTYgNTEuMTQ4NSAzNC4wODIyIDQ4LjkwMDkgMzQuMDgyMiA0Ni4xMzIyQzM0LjA4MjIgNDMuMzYzNiAzNS41ODcxIDQxLjA5NjEgMzcuNTE3OSA0MS4wOTYxQzM5LjQ0ODYgNDEuMDk2MSA0MC45OTgxIDQzLjM2MzYgNDAuOTYzNSA0Ni4xMzIyQzQwLjkyODggNDguOTAwOSAzOS40NDM3IDUxLjE0ODUgMzcuNTIyOCA1MS4xNDg1SDM3LjUyNzhaTTUwLjIzMSA1MS4xNDg1QzQ4LjMzOTkgNTEuMTQ4NSA0Ni43OTAzIDQ4LjkwMDkgNDYuNzkwMyA0Ni4xMzIyQzQ2Ljc5MDMgNDMuMzYzNiA0OC4yOTUzIDQxLjA5NjEgNTAuMjMxIDQxLjA5NjFDNTIuMTY2NyA0MS4wOTYxIDUzLjcwMTQgNDMuMzYzNiA1My42NjY3IDQ2LjEzMjJDNTMuNjMyMSA0OC45MDA5IDUyLjE1MTggNTEuMTQ4NSA1MC4yMzEgNTEuMTQ4NVoiIGZpbGw9IiNGQ0ZDRkMiLz4KPHBhdGggZD0iTTc1LjQwNTEgNTYuMTIwM0w3MC45NzkzIDQyLjE3MjlDNzAuNDM0NyA0MC40NjYxIDY4Ljg1NTUgMzkuMzA1MSA2Ny4wNjMzIDM5LjMwNTFDNjYuNTI4NyAzOS4zMDUxIDY2LjAwODkgMzkuNDA5MiA2NS41Mjg3IDM5LjYwMjhDNjcuNTQ4NSA0Ni4zMjU5IDY4LjM2MDQgNTMuNTc5OSA2Ny43MjY3IDYxLjQ4NEg3MS40ODQyQzc0LjI2NjUgNjEuNDg0IDc2LjI0MTcgNTguNzc0OSA3NS40MDAxIDU2LjEyMDNINzUuNDA1MVoiIGZpbGw9IiNGQ0ZDRkMiLz4KPHBhdGggZD0iTTEyLjE5MDggNTYuMzgzNUwxNi42MTY2IDQyLjQzNjFDMTcuMTYxMiA0MC43MjkyIDE4Ljc0MDUgMzkuNTY4MiAyMC41MzI2IDM5LjU2ODJDMjEuMDY3MiAzOS41NjgyIDIxLjU4NyAzOS42NzI0IDIyLjA2NzMgMzkuODY1OUMyMC4wNDc0IDQ2LjU4OSAxOS4yMzU1IDUzLjg0MzEgMTkuODY5MiA2MS43NDcxSDE2LjExMTdDMTMuMzI5NSA2MS43NDcxIDExLjM1NDIgNTkuMDM4IDEyLjE5NTggNTYuMzgzNUgxMi4xOTA4WiIgZmlsbD0iI0ZDRkNGQyIvPgo8ZGVmcz4KPGxpbmVhckdyYWRpZW50IGlkPSJwYWludDBfbGluZWFyXzg1NV81ODAiIHgxPSI0NCIgeTE9IjAiIHgyPSI0NCIgeTI9Ijg4IiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+CjxzdG9wIHN0b3AtY29sb3I9IiNGRjgxNzAiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjRkY1QzQ1Ii8+CjwvbGluZWFyR3JhZGllbnQ+CjwvZGVmcz4KPC9zdmc+",this.supportedTransactionVersions=null,this._readyState=typeof window>"u"||typeof document>"u"?Te.Unsupported:Te.Loadable,this._disconnected=()=>{const n=this._wallet;n&&(n.off("disconnect",this._disconnected),this._wallet=null,this._publicKey=null,this.emit("error",new ld),this.emit("disconnect"))},this._network=e,this._connecting=!1,this._wallet=null,this._publicKey=null,this._readyState!==Te.Unsupported&&_p(()=>window.salmon?(this._readyState=Te.Installed,this.emit("readyStateChange",this._readyState),!0):!1)}get publicKey(){return this._publicKey}get connecting(){return this._connecting}get connected(){var e;return!!((e=this._wallet)!=null&&e.connected)}get readyState(){return this._readyState}async connect(){try{if(this.connected||this.connecting)return;if(this._readyState!==Te.Loadable&&this._readyState!==Te.Installed)throw new Ci;this._connecting=!0;let e;try{e=(await H_(async()=>{const{default:i}=await import("./index-wcjhZ_fi.js");return{default:i}},[],import.meta.url)).default}catch(i){throw new RI(i==null?void 0:i.message,i)}let n;try{n=new e({network:this._network})}catch(i){throw new Go(i==null?void 0:i.message,i)}if(!n.connected)try{await n.connect()}catch(i){throw new hs(i==null?void 0:i.message,i)}if(!n.publicKey)throw new ps;let r;try{r=new ie(n.publicKey.toBytes())}catch(i){throw new wo(i==null?void 0:i.message,i)}n.on("disconnect",this._disconnected),this._wallet=n,this._publicKey=r,this.emit("connect",r)}catch(e){throw this.emit("error",e),e}finally{this._connecting=!1}}async disconnect(){const e=this._wallet;if(e){e.off("disconnect",this._disconnected),this._wallet=null,this._publicKey=null;try{await e.disconnect()}catch(n){this.emit("error",new ud(n==null?void 0:n.message,n))}}this.emit("disconnect")}async signTransaction(e){try{const n=this._wallet;if(!n)throw new Et;try{return await n.signTransaction(e)||e}catch(r){throw new Gn(r==null?void 0:r.message,r)}}catch(n){throw this.emit("error",n),n}}async signAllTransactions(e){try{const n=this._wallet;if(!n)throw new Et;try{return await n.signAllTransactions(e)||e}catch(r){throw new Gn(r==null?void 0:r.message,r)}}catch(n){throw this.emit("error",n),n}}async signMessage(e){try{const n=this._wallet;if(!n)throw new Et;try{return await n.signMessage(e,"utf8")}catch(r){throw new dd(r==null?void 0:r.message,r)}}catch(n){throw this.emit("error",n),n}}}const y9="data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjMxIiB2aWV3Qm94PSIwIDAgMzEgMzEiIHdpZHRoPSIzMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGxpbmVhckdyYWRpZW50IGlkPSJhIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjIwLjI1IiB4Mj0iMjYuNTcxIiB5MT0iMjcuMTczIiB5Mj0iMTkuODU4Ij48c3RvcCBvZmZzZXQ9Ii4wOCIgc3RvcC1jb2xvcj0iIzk5NDVmZiIvPjxzdG9wIG9mZnNldD0iLjMiIHN0b3AtY29sb3I9IiM4NzUyZjMiLz48c3RvcCBvZmZzZXQ9Ii41IiBzdG9wLWNvbG9yPSIjNTQ5N2Q1Ii8+PHN0b3Agb2Zmc2V0PSIuNiIgc3RvcC1jb2xvcj0iIzQzYjRjYSIvPjxzdG9wIG9mZnNldD0iLjcyIiBzdG9wLWNvbG9yPSIjMjhlMGI5Ii8+PHN0b3Agb2Zmc2V0PSIuOTciIHN0b3AtY29sb3I9IiMxOWZiOWIiLz48L2xpbmVhckdyYWRpZW50PjxnIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iLjA5NCI+PHBhdGggZD0ibTI2LjEwOSAzLjY0My05LjM2OSA2Ljk1OSAxLjczMy00LjEwNSA3LjYzNy0yLjg1M3oiIGZpbGw9IiNlMjc2MWIiIHN0cm9rZT0iI2UyNzYxYiIvPjxnIGZpbGw9IiNlNDc2MWIiIHN0cm9rZT0iI2U0NzYxYiI+PHBhdGggZD0ibTQuNDgxIDMuNjQzIDkuMjk0IDcuMDI0LTEuNjQ4LTQuMTcxem0xOC4yNTggMTYuMTMtMi40OTUgMy44MjMgNS4zMzkgMS40NjkgMS41MzUtNS4yMDctNC4zNzgtLjA4NXptLTE5LjI0Ny4wODUgMS41MjUgNS4yMDcgNS4zMzktMS40NjktMi40OTUtMy44MjN6Ii8+PHBhdGggZD0ibTEwLjA1NSAxMy4zMTMtMS40ODggMi4yNTEgNS4zMDEuMjM1LS4xODgtNS42OTd6bTEwLjQ4IDAtMy42NzItMy4yNzctLjEyMiA1Ljc2MyA1LjI5Mi0uMjM1LTEuNDk3LTIuMjUxem0tMTAuMTc4IDEwLjI4MyAzLjE4My0xLjU1NC0yLjc0OS0yLjE0Ny0uNDMzIDMuNzAxem02LjY5NS0xLjU1NCAzLjE5MiAxLjU1NC0uNDQzLTMuNzAxeiIvPjwvZz48cGF0aCBkPSJtMjAuMjQ0IDIzLjU5Ni0zLjE5Mi0xLjU1NC4yNTQgMi4wODEtLjAyOC44NzZ6bS05Ljg4NyAwIDIuOTY2IDEuNDAzLS4wMTktLjg3Ni4yMzUtMi4wODEtMy4xODMgMS41NTR6IiBmaWxsPSIjZDdjMWIzIiBzdHJva2U9IiNkN2MxYjMiLz48cGF0aCBkPSJtMTMuMzY5IDE4LjUyMS0yLjY1NS0uNzgxIDEuODc0LS44NTd6bTMuODUxIDAgLjc4MS0xLjYzOCAxLjg4My44NTctMi42NjUuNzgxeiIgZmlsbD0iIzIzMzQ0NyIgc3Ryb2tlPSIjMjMzNDQ3Ii8+PHBhdGggZD0ibTEwLjM1NyAyMy41OTYuNDUyLTMuODIzLTIuOTQ3LjA4NXptOS40MzUtMy44MjMuNDUyIDMuODIzIDIuNDk1LTMuNzM4em0yLjI0MS00LjIwOS01LjI5Mi4yMzUuNDkgMi43MjEuNzgyLTEuNjM4IDEuODgzLjg1N3ptLTExLjMxOCAyLjE3NSAxLjg4My0uODU3Ljc3MiAxLjYzOC40OTktMi43MjEtNS4zMDEtLjIzNXoiIGZpbGw9IiNjZDYxMTYiIHN0cm9rZT0iI2NkNjExNiIvPjxwYXRoIGQ9Im04LjU2NyAxNS41NjQgMi4yMjIgNC4zMzEtLjA3NS0yLjE1NnptMTEuMzI4IDIuMTc1LS4wOTQgMi4xNTYgMi4yMzItNC4zMzEtMi4xMzcgMi4xNzV6bS02LjAyNi0xLjk0LS40OTkgMi43MjEuNjIxIDMuMjExLjE0MS00LjIyOC0uMjY0LTEuNzA0em0yLjg3MiAwLS4yNTQgMS42OTUuMTEzIDQuMjM3LjYzMS0zLjIxMXoiIGZpbGw9IiNlNDc1MWYiIHN0cm9rZT0iI2U0NzUxZiIvPjxwYXRoIGQ9Im0xNy4yMyAxOC41Mi0uNjMxIDMuMjExLjQ1Mi4zMTEgMi43NS0yLjE0Ny4wOTQtMi4xNTZ6bS02LjUxNi0uNzgxLjA3NSAyLjE1NiAyLjc1IDIuMTQ3LjQ1Mi0uMzExLS42MjItMy4yMTF6IiBmaWxsPSIjZjY4NTFiIiBzdHJva2U9IiNmNjg1MWIiLz48cGF0aCBkPSJtMTcuMjc3IDI0Ljk5OS4wMjgtLjg3Ni0uMjM1LS4yMDdoLTMuNTVsLS4yMTcuMjA3LjAxOS44NzYtMi45NjYtMS40MDMgMS4wMzYuODQ4IDIuMSAxLjQ1OWgzLjYwNmwyLjEwOS0xLjQ1OSAxLjAzNi0uODQ4eiIgZmlsbD0iI2MwYWQ5ZSIgc3Ryb2tlPSIjYzBhZDllIi8+PHBhdGggZD0ibTE3LjA1MSAyMi4wNDItLjQ1Mi0uMzExaC0yLjYwOGwtLjQ1Mi4zMTEtLjIzNSAyLjA4MS4yMTctLjIwN2gzLjU1bC4yMzUuMjA3LS4yNTQtMi4wODF6IiBmaWxsPSIjMTYxNjE2IiBzdHJva2U9IiMxNjE2MTYiLz48cGF0aCBkPSJtMjYuNTA1IDExLjA1My44LTMuODQyLTEuMTk2LTMuNTY5LTkuMDU4IDYuNzIzIDMuNDg0IDIuOTQ3IDQuOTI1IDEuNDQxIDEuMDkyLTEuMjcxLS40NzEtLjMzOS43NTMtLjY4Ny0uNTg0LS40NTIuNzUzLS41NzQtLjQ5OS0uMzc3em0tMjMuMjExLTMuODQxLjggMy44NDItLjUwOC4zNzcuNzUzLjU3NC0uNTc0LjQ1Mi43NTMuNjg3LS40NzEuMzM5IDEuMDgzIDEuMjcxIDQuOTI1LTEuNDQxIDMuNDg0LTIuOTQ3LTkuMDU5LTYuNzIzeiIgZmlsbD0iIzc2M2QxNiIgc3Ryb2tlPSIjNzYzZDE2Ii8+PHBhdGggZD0ibTI1LjQ2IDE0Ljc1NC00LjkyNS0xLjQ0MSAxLjQ5NyAyLjI1MS0yLjIzMiA0LjMzMSAyLjkzOC0uMDM4aDQuMzc4bC0xLjY1Ny01LjEwNHptLTE1LjQwNS0xLjQ0MS00LjkyNSAxLjQ0MS0xLjYzOCA1LjEwNGg0LjM2OWwyLjkyOC4wMzgtMi4yMjItNC4zMzEgMS40ODgtMi4yNTF6bTYuNjg1IDIuNDg2LjMxMS01LjQzMyAxLjQzMS0zLjg3aC02LjM1NmwxLjQxMyAzLjg3LjMyOSA1LjQzMy4xMTMgMS43MTQuMDA5IDQuMjE5aDIuNjFsLjAxOS00LjIxOS4xMjItMS43MTR6IiBmaWxsPSIjZjY4NTFiIiBzdHJva2U9IiNmNjg1MWIiLz48L2c+PGNpcmNsZSBjeD0iMjMuNSIgY3k9IjIzLjUiIGZpbGw9IiMwMDAiIHI9IjYuNSIvPjxwYXRoIGQ9Im0yNy40NzMgMjUuNTQ1LTEuMzEgMS4zNjhjLS4wMjkuMDMtLjA2My4wNTMtLjEwMS4wN2EuMzEuMzEgMCAwIDEgLS4xMjEuMDI0aC02LjIwOWMtLjAzIDAtLjA1OS0uMDA4LS4wODMtLjAyNGEuMTUuMTUgMCAwIDEgLS4wNTYtLjA2NWMtLjAxMi0uMDI2LS4wMTUtLjA1Ni0uMDEtLjA4NHMuMDE4LS4wNTUuMDM5LS4wNzZsMS4zMTEtMS4zNjhjLjAyOC0uMDMuMDYzLS4wNTMuMTAxLS4wNjlhLjMxLjMxIDAgMCAxIC4xMjEtLjAyNWg2LjIwOGMuMDMgMCAuMDU5LjAwOC4wODMuMDI0YS4xNS4xNSAwIDAgMSAuMDU2LjA2NWMuMDEyLjAyNi4wMTUuMDU2LjAxLjA4NHMtLjAxOC4wNTUtLjAzOS4wNzZ6bS0xLjMxLTIuNzU2Yy0uMDI5LS4wMy0uMDYzLS4wNTMtLjEwMS0uMDdhLjMxLjMxIDAgMCAwIC0uMTIxLS4wMjRoLTYuMjA5Yy0uMDMgMC0uMDU5LjAwOC0uMDgzLjAyNHMtLjA0NC4wMzgtLjA1Ni4wNjUtLjAxNS4wNTYtLjAxLjA4NC4wMTguMDU1LjAzOS4wNzZsMS4zMTEgMS4zNjhjLjAyOC4wMy4wNjMuMDUzLjEwMS4wNjlhLjMxLjMxIDAgMCAwIC4xMjEuMDI1aDYuMjA4Yy4wMyAwIC4wNTktLjAwOC4wODMtLjAyNGEuMTUuMTUgMCAwIDAgLjA1Ni0uMDY1Yy4wMTItLjAyNi4wMTUtLjA1Ni4wMS0uMDg0cy0uMDE4LS4wNTUtLjAzOS0uMDc2em0tNi40MzEtLjk4M2g2LjIwOWEuMzEuMzEgMCAwIDAgLjEyMS0uMDI0Yy4wMzgtLjAxNi4wNzMtLjA0LjEwMS0uMDdsMS4zMS0xLjM2OGMuMDItLjAyMS4wMzQtLjA0Ny4wMzktLjA3NnMuMDAxLS4wNTgtLjAxLS4wODRhLjE1LjE1IDAgMCAwIC0uMDU2LS4wNjVjLS4wMjUtLjAxNi0uMDU0LS4wMjQtLjA4My0uMDI0aC02LjIwOGEuMzEuMzEgMCAwIDAgLS4xMjEuMDI1Yy0uMDM4LjAxNi0uMDcyLjA0LS4xMDEuMDY5bC0xLjMxIDEuMzY4Yy0uMDIuMDIxLS4wMzQuMDQ3LS4wMzkuMDc2cy0uMDAxLjA1OC4wMS4wODQuMDMxLjA0OS4wNTYuMDY1LjA1NC4wMjQuMDgzLjAyNHoiIGZpbGw9InVybCgjYSkiLz48L3N2Zz4=";var mt=function(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)},m9=function(t,e,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(t,n):i?i.value=n:e.set(t,n),n},Tf,ra,_m,vm,bm,Zn,Em,n2,r2,xm,Sm,Am,Im,km;class w9{constructor(){Tf.add(this),ra.set(this,{}),_m.set(this,"1.0.0"),vm.set(this,"MetaMask"),bm.set(this,y9),Zn.set(this,null),Em.set(this,(e,n)=>{var r;return(r=mt(this,ra,"f")[e])!=null&&r.push(n)||(mt(this,ra,"f")[e]=[n]),()=>mt(this,Tf,"m",r2).call(this,e,n)}),xm.set(this,async()=>{if(!mt(this,Zn,"f")){let e;try{e=(await H_(async()=>{const{default:n}=await import("./index-EO_1_XDp.js");return{default:n}},[],import.meta.url)).default}catch{throw new Error("Unable to load Solflare MetaMask SDK")}m9(this,Zn,new e,"f"),mt(this,Zn,"f").on("standard_change",n=>mt(this,Tf,"m",n2).call(this,"change",n))}return this.accounts.length||await mt(this,Zn,"f").connect(),{accounts:this.accounts}}),Sm.set(this,async()=>{mt(this,Zn,"f")&&await mt(this,Zn,"f").disconnect()}),Am.set(this,async(...e)=>{if(!mt(this,Zn,"f"))throw new Et;return await mt(this,Zn,"f").standardSignAndSendTransaction(...e)}),Im.set(this,async(...e)=>{if(!mt(this,Zn,"f"))throw new Et;return await mt(this,Zn,"f").standardSignTransaction(...e)}),km.set(this,async(...e)=>{if(!mt(this,Zn,"f"))throw new Et;return await mt(this,Zn,"f").standardSignMessage(...e)})}get version(){return mt(this,_m,"f")}get name(){return mt(this,vm,"f")}get icon(){return mt(this,bm,"f")}get chains(){return[jy,MI,OI]}get features(){return{[s_]:{version:"1.0.0",connect:mt(this,xm,"f")},[By]:{version:"1.0.0",disconnect:mt(this,Sm,"f")},[o_]:{version:"1.0.0",on:mt(this,Em,"f")},[ls]:{version:"1.0.0",supportedTransactionVersions:["legacy",0],signAndSendTransaction:mt(this,Am,"f")},[In]:{version:"1.0.0",supportedTransactionVersions:["legacy",0],signTransaction:mt(this,Im,"f")},[ja]:{version:"1.0.0",signMessage:mt(this,km,"f")}}}get accounts(){return mt(this,Zn,"f")?mt(this,Zn,"f").standardAccounts:[]}}ra=new WeakMap,_m=new WeakMap,vm=new WeakMap,bm=new WeakMap,Zn=new WeakMap,Em=new WeakMap,xm=new WeakMap,Sm=new WeakMap,Am=new WeakMap,Im=new WeakMap,km=new WeakMap,Tf=new WeakSet,n2=function(e,...n){var r;(r=mt(this,ra,"f")[e])==null||r.forEach(i=>i.apply(null,n))},r2=function(e,n){var r;mt(this,ra,"f")[e]=(r=mt(this,ra,"f")[e])==null?void 0:r.filter(i=>n!==i)};let ME=!1;function _9(){ME||(iB(new w9),ME=!0)}async function v9(){const t="solflare-detect-metamask";function e(){window.postMessage({target:"metamask-contentscript",data:{name:"metamask-provider",data:{id:t,jsonrpc:"2.0",method:"wallet_getSnaps"}}},window.location.origin)}function n(r){var s,o;const i=r.data;(i==null?void 0:i.target)==="metamask-inpage"&&((s=i.data)==null?void 0:s.name)==="metamask-provider"&&(((o=i.data.data)==null?void 0:o.id)===t?(window.removeEventListener("message",n),i.data.data.error||_9()):e())}window.addEventListener("message",n),window.setTimeout(()=>window.removeEventListener("message",n),5e3),e()}const b9="Solflare";class E9 extends fd{constructor(e={}){super(),this.name=b9,this.url="https://solflare.com",this.icon="data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjUwIiB2aWV3Qm94PSIwIDAgNTAgNTAiIHdpZHRoPSI1MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGxpbmVhckdyYWRpZW50IGlkPSJhIj48c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiNmZmMxMGIiLz48c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNmYjNmMmUiLz48L2xpbmVhckdyYWRpZW50PjxsaW5lYXJHcmFkaWVudCBpZD0iYiIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIHgxPSI2LjQ3ODM1IiB4Mj0iMzQuOTEwNyIgeGxpbms6aHJlZj0iI2EiIHkxPSI3LjkyIiB5Mj0iMzMuNjU5MyIvPjxyYWRpYWxHcmFkaWVudCBpZD0iYyIgY3g9IjAiIGN5PSIwIiBncmFkaWVudFRyYW5zZm9ybT0ibWF0cml4KDQuOTkyMTg4MzIgMTIuMDYzODc5NjMgLTEyLjE4MTEzNjU1IDUuMDQwNzEwNzQgMjIuNTIwMiAyMC42MTgzKSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIHI9IjEiIHhsaW5rOmhyZWY9IiNhIi8+PHBhdGggZD0ibTI1LjE3MDggNDcuOTEwNGMuNTI1IDAgLjk1MDcuNDIxLjk1MDcuOTQwM3MtLjQyNTcuOTQwMi0uOTUwNy45NDAyLS45NTA3LS40MjA5LS45NTA3LS45NDAyLjQyNTctLjk0MDMuOTUwNy0uOTQwM3ptLTEuMDMyOC00NC45MTU2NWMuNDY0Ni4wMzgzNi44Mzk4LjM5MDQuOTAyNy44NDY4MWwxLjEzMDcgOC4yMTU3NGMuMzc5OCAyLjcxNDMgMy42NTM1IDMuODkwNCA1LjY3NDMgMi4wNDU5bDExLjMyOTEtMTAuMzExNThjLjI3MzMtLjI0ODczLjY5ODktLjIzMTQ5Ljk1MDcuMDM4NTEuMjMwOS4yNDc3Mi4yMzc5LjYyNjk3LjAxNjEuODgyNzdsLTkuODc5MSAxMS4zOTU4Yy0xLjgxODcgMi4wOTQyLS40NzY4IDUuMzY0MyAyLjI5NTYgNS41OTc4bDguNzE2OC44NDAzYy40MzQxLjA0MTguNzUxNy40MjM0LjcwOTMuODUyNC0uMDM0OS4zNTM3LS4zMDc0LjYzOTUtLjY2MjguNjk0OWwtOS4xNTk0IDEuNDMwMmMtMi42NTkzLjM2MjUtMy44NjM2IDMuNTExNy0yLjEzMzkgNS41NTc2bDMuMjIgMy43OTYxYy4yNTk0LjMwNTguMjE4OC43NjE1LS4wOTA4IDEuMDE3OC0uMjYyMi4yMTcyLS42NDE5LjIyNTYtLjkxMzguMDIwM2wtMy45Njk0LTIuOTk3OGMtMi4xNDIxLTEuNjEwOS01LjIyOTctLjI0MTctNS40NTYxIDIuNDI0M2wtLjg3NDcgMTAuMzk3NmMtLjAzNjIuNDI5NS0uNDE3OC43NDg3LS44NTI1LjcxMy0uMzY5LS4wMzAzLS42NjcxLS4zMDk3LS43MTcxLS42NzIxbC0xLjM4NzEtMTAuMDQzN2MtLjM3MTctMi43MTQ0LTMuNjQ1NC0zLjg5MDQtNS42NzQzLTIuMDQ1OWwtMTIuMDUxOTUgMTAuOTc0Yy0uMjQ5NDcuMjI3MS0uNjM4MDkuMjExNC0uODY4LS4wMzUtLjIxMDk0LS4yMjYyLS4yMTczNS0uNTcyNC0uMDE0OTMtLjgwNmwxMC41MTgxOC0xMi4xMzg1YzEuODE4Ny0yLjA5NDIuNDg0OS01LjM2NDQtMi4yODc2LTUuNTk3OGwtOC43MTg3Mi0uODQwNWMtLjQzNDEzLS4wNDE4LS43NTE3Mi0uNDIzNS0uNzA5MzYtLjg1MjQuMDM0OTMtLjM1MzcuMzA3MzktLjYzOTQuNjYyNy0uNjk1bDkuMTUzMzgtMS40Mjk5YzIuNjU5NC0uMzYyNSAzLjg3MTgtMy41MTE3IDIuMTQyMS01LjU1NzZsLTIuMTkyLTIuNTg0MWMtLjMyMTctLjM3OTItLjI3MTMtLjk0NDMuMTEyNi0xLjI2MjEuMzI1My0uMjY5NC43OTYzLS4yNzk3IDEuMTMzNC0uMDI0OWwyLjY5MTggMi4wMzQ3YzIuMTQyMSAxLjYxMDkgNS4yMjk3LjI0MTcgNS40NTYxLTIuNDI0M2wuNzI0MS04LjU1OTk4Yy4wNDU3LS41NDA4LjUyNjUtLjk0MjU3IDEuMDczOS0uODk3Mzd6bS0yMy4xODczMyAyMC40Mzk2NWMuNTI1MDQgMCAuOTUwNjcuNDIxLjk1MDY3Ljk0MDNzLS40MjU2My45NDAzLS45NTA2Ny45NDAzYy0uNTI1MDQxIDAtLjk1MDY3LS40MjEtLjk1MDY3LS45NDAzcy40MjU2MjktLjk0MDMuOTUwNjctLjk0MDN6bTQ3LjY3OTczLS45NTQ3Yy41MjUgMCAuOTUwNy40MjEuOTUwNy45NDAzcy0uNDI1Ny45NDAyLS45NTA3Ljk0MDItLjk1MDctLjQyMDktLjk1MDctLjk0MDIuNDI1Ny0uOTQwMy45NTA3LS45NDAzem0tMjQuNjI5Ni0yMi40Nzk3Yy41MjUgMCAuOTUwNi40MjA5NzMuOTUwNi45NDAyNyAwIC41MTkzLS40MjU2Ljk0MDI3LS45NTA2Ljk0MDI3LS41MjUxIDAtLjk1MDctLjQyMDk3LS45NTA3LS45NDAyNyAwLS41MTkyOTcuNDI1Ni0uOTQwMjcuOTUwNy0uOTQwMjd6IiBmaWxsPSJ1cmwoI2IpIi8+PHBhdGggZD0ibTI0LjU3MSAzMi43NzkyYzQuOTU5NiAwIDguOTgwMi0zLjk3NjUgOC45ODAyLTguODgxOSAwLTQuOTA1My00LjAyMDYtOC44ODE5LTguOTgwMi04Ljg4MTlzLTguOTgwMiAzLjk3NjYtOC45ODAyIDguODgxOWMwIDQuOTA1NCA0LjAyMDYgOC44ODE5IDguOTgwMiA4Ljg4MTl6IiBmaWxsPSJ1cmwoI2MpIi8+PC9zdmc+",this.supportedTransactionVersions=new Set(["legacy",0]),this._readyState=typeof window>"u"||typeof document>"u"?Te.Unsupported:Te.Loadable,this._disconnected=()=>{const n=this._wallet;n&&(n.off("disconnect",this._disconnected),this._wallet=null,this._publicKey=null,this.emit("error",new ld),this.emit("disconnect"))},this._accountChanged=n=>{if(!n)return;const r=this._publicKey;if(r){try{n=new ie(n.toBytes())}catch(i){this.emit("error",new wo(i==null?void 0:i.message,i));return}r.equals(n)||(this._publicKey=n,this.emit("connect",n))}},this._connecting=!1,this._publicKey=null,this._wallet=null,this._config=e,this._readyState!==Te.Unsupported&&(_p(()=>{var n;return(n=window.solflare)!=null&&n.isSolflare||window.SolflareApp?(this._readyState=Te.Installed,this.emit("readyStateChange",this._readyState),!0):!1}),v9())}get publicKey(){return this._publicKey}get connecting(){return this._connecting}get connected(){var e;return!!((e=this._wallet)!=null&&e.connected)}get readyState(){return this._readyState}async autoConnect(){this.readyState===Te.Loadable&&Py()||await this.connect()}async connect(){try{if(this.connected||this.connecting)return;if(this._readyState!==Te.Loadable&&this._readyState!==Te.Installed)throw new Ci;if(this.readyState===Te.Loadable&&Py()){const i=encodeURIComponent(window.location.href),s=encodeURIComponent(window.location.origin);window.location.href=`https://solflare.com/ul/v1/browse/${i}?ref=${s}`;return}let e;try{e=(await H_(async()=>{const{default:i}=await import("./index-B9_xebrr.js");return{default:i}},[],import.meta.url)).default}catch(i){throw new RI(i==null?void 0:i.message,i)}let n;try{n=new e({network:this._config.network})}catch(i){throw new Go(i==null?void 0:i.message,i)}if(this._connecting=!0,!n.connected)try{await n.connect()}catch(i){throw new hs(i==null?void 0:i.message,i)}if(!n.publicKey)throw new hs;let r;try{r=new ie(n.publicKey.toBytes())}catch(i){throw new wo(i==null?void 0:i.message,i)}n.on("disconnect",this._disconnected),n.on("accountChanged",this._accountChanged),this._wallet=n,this._publicKey=r,this.emit("connect",r)}catch(e){throw this.emit("error",e),e}finally{this._connecting=!1}}async disconnect(){const e=this._wallet;if(e){e.off("disconnect",this._disconnected),e.off("accountChanged",this._accountChanged),this._wallet=null,this._publicKey=null;try{await e.disconnect()}catch(n){this.emit("error",new ud(n==null?void 0:n.message,n))}}this.emit("disconnect")}async sendTransaction(e,n,r={}){try{const i=this._wallet;if(!i)throw new Et;try{const{signers:s,...o}=r;return ys(e)?s!=null&&s.length&&e.sign(s):(e=await this.prepareTransaction(e,n,o),s!=null&&s.length&&e.partialSign(...s)),o.preflightCommitment=o.preflightCommitment||n.commitment,await i.signAndSendTransaction(e,o)}catch(s){throw s instanceof Tn?s:new gs(s==null?void 0:s.message,s)}}catch(i){throw this.emit("error",i),i}}async signTransaction(e){try{const n=this._wallet;if(!n)throw new Et;try{return await n.signTransaction(e)||e}catch(r){throw new Gn(r==null?void 0:r.message,r)}}catch(n){throw this.emit("error",n),n}}async signAllTransactions(e){try{const n=this._wallet;if(!n)throw new Et;try{return await n.signAllTransactions(e)||e}catch(r){throw new Gn(r==null?void 0:r.message,r)}}catch(n){throw this.emit("error",n),n}}async signMessage(e){try{const n=this._wallet;if(!n)throw new Et;try{return await n.signMessage(e,"utf8")}catch(r){throw new dd(r==null?void 0:r.message,r)}}catch(n){throw this.emit("error",n),n}}}function x9({children:t}){const e=j.useMemo(()=>"https://devnet.helius-rpc.com/?api-key=6244a448-5327-4ff4-aa0c-a613411ead97",[]),n=j.useMemo(()=>[new h9,new E9,new l9,new g9],[]);return te.jsx(qD,{endpoint:e,children:te.jsx(SB,{wallets:n,autoConnect:!0,children:te.jsx(TB,{children:t})})})}$S(document.getElementById("root")).render(te.jsx(j.StrictMode,{children:te.jsx(x9,{children:te.jsx(a9,{})})}));export{kI as E,ie as P,ls as S,Je as T,Dc as V,In as a,jt as b,ja as c,Ro as g}; diff --git a/assets/index-DDrF5s2C.css b/assets/index-DDrF5s2C.css new file mode 100644 index 0000000..14cff9a --- /dev/null +++ b/assets/index-DDrF5s2C.css @@ -0,0 +1 @@ +@import"https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap";*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}:root{--background: 0 0% 100%;--foreground: 222.2 84% 4.9%;--card: 0 0% 100%;--card-foreground: 222.2 84% 4.9%;--popover: 0 0% 100%;--popover-foreground: 222.2 84% 4.9%;--primary: 258, 58%, 42%;--primary-foreground: 210 40% 98%;--secondary: 210, 40%, 96%;--secondary-foreground: 222.2 47.4% 11.2%;--tertiary: 267, 92%, 9%;--accent: 263, 100%, 97%;--muted: 210 40% 96.1%;--muted-foreground: 215.4 16.3% 46.9%;--accent: 210 40% 96.1%;--accent-foreground: 222.2 47.4% 11.2%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 210 40% 98%;--border: 214.3 31.8% 91.4%;--input: 214.3 31.8% 91.4%;--ring: 222.2 84% 4.9%;--chart-1: 12 76% 61%;--chart-2: 173 58% 39%;--chart-3: 197 37% 24%;--chart-4: 43 74% 66%;--chart-5: 27 87% 67%;--radius: .5rem}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}.z-50{z-index:50}.mr-4{margin-right:1rem}.mr-auto{margin-right:auto}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.h-0{height:0px}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-9{height:2.25rem}.h-\[25\%\]{height:25%}.h-\[80px\]{height:80px}.h-dvh{height:100dvh}.h-full{height:100%}.w-10{width:2.5rem}.w-\[25\%\]{width:25%}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.max-w-\[200px\]{max-width:200px}.max-w-full{max-width:100%}.grow{flex-grow:1}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.resize{resize:both}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-x-3{-moz-column-gap:.75rem;column-gap:.75rem}.gap-y-2{row-gap:.5rem}.gap-y-3{row-gap:.75rem}.gap-y-4{row-gap:1rem}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.self-start{align-self:flex-start}.self-end{align-self:flex-end}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-bl-none{border-bottom-left-radius:0}.rounded-br-none{border-bottom-right-radius:0}.border{border-width:1px}.border-input{border-color:hsl(var(--input))}.bg-accent{background-color:hsl(var(--accent))}.bg-background{background-color:hsl(var(--background))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary-foreground{background-color:hsl(var(--primary-foreground))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-transparent{background-color:transparent}.p-2{padding:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.pb-4{padding-bottom:1rem}.pl-0{padding-left:0}.pt-4{padding-top:1rem}.text-center{text-align:center}.font-sans{font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[0\.6rem\]{font-size:.6rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.leading-none{line-height:1}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-tertiary{color:hsl(var(--tertiary))}.underline-offset-4{text-underline-offset:4px}.opacity-25{opacity:.25}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline{outline-style:solid}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-0{--tw-enter-opacity: 0}.zoom-in-95{--tw-enter-scale: .95}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.file\:text-foreground::file-selector-button{color:hsl(var(--foreground))}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-tertiary:hover{background-color:hsl(var(--tertiary))}.hover\:bg-transparent:hover{background-color:transparent}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-green-500:hover{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity))}.hover\:text-primary:hover{color:hsl(var(--primary))}.hover\:underline:hover{text-decoration-line:underline}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}@media (min-width: 640px){.sm\:ml-auto{margin-left:auto}.sm\:block{display:block}.sm\:w-\[200px\]{width:200px}.sm\:w-auto{width:auto}.sm\:max-w-\[400px\]{max-width:400px}.sm\:justify-between{justify-content:space-between}.sm\:gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.sm\:text-3xl{font-size:1.875rem;line-height:2.25rem}}@media (min-width: 768px){.md\:block{display:block}.md\:px-12{padding-left:3rem;padding-right:3rem}}.wallet-adapter-button{background-color:transparent;border:none;color:#fff;cursor:pointer;display:flex;align-items:center;font-family:DM Sans,Roboto,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:16px;font-weight:600;height:48px;line-height:48px;padding:0 24px;border-radius:4px}.wallet-adapter-button-trigger{background-color:#512da8}.wallet-adapter-button:not([disabled]):focus-visible{outline-color:#fff}.wallet-adapter-button:not([disabled]):hover{background-color:#1a1f2e}.wallet-adapter-button[disabled]{background:#404144;color:#999;cursor:not-allowed}.wallet-adapter-button-end-icon,.wallet-adapter-button-start-icon,.wallet-adapter-button-end-icon img,.wallet-adapter-button-start-icon img{display:flex;align-items:center;justify-content:center;width:24px;height:24px}.wallet-adapter-button-end-icon{margin-left:12px}.wallet-adapter-button-start-icon{margin-right:12px}.wallet-adapter-collapse{width:100%}.wallet-adapter-dropdown{position:relative;display:inline-block}.wallet-adapter-dropdown-list{position:absolute;z-index:99;display:grid;grid-template-rows:1fr;grid-row-gap:10px;padding:10px;top:100%;right:0;margin:0;list-style:none;background:#2c2d30;border-radius:10px;box-shadow:0 8px 20px #0009;opacity:0;visibility:hidden;transition:opacity .2s ease,transform .2s ease,visibility .2s;font-family:DM Sans,Roboto,Helvetica Neue,Helvetica,Arial,sans-serif}.wallet-adapter-dropdown-list-active{opacity:1;visibility:visible;transform:translateY(10px)}.wallet-adapter-dropdown-list-item{display:flex;flex-direction:row;justify-content:center;align-items:center;border:none;outline:none;cursor:pointer;white-space:nowrap;box-sizing:border-box;padding:0 20px;width:100%;border-radius:6px;font-size:14px;font-weight:600;height:37px;color:#fff}.wallet-adapter-dropdown-list-item:not([disabled]):hover{background-color:#1a1f2e}.wallet-adapter-modal-collapse-button svg{align-self:center;fill:#999}.wallet-adapter-modal-collapse-button.wallet-adapter-modal-collapse-button-active svg{transform:rotate(180deg);transition:transform ease-in .15s}.wallet-adapter-modal{position:fixed;top:0;left:0;right:0;bottom:0;opacity:0;transition:opacity linear .15s;background:#00000080;z-index:1040;overflow-y:auto}.wallet-adapter-modal.wallet-adapter-modal-fade-in{opacity:1}.wallet-adapter-modal-button-close{display:flex;align-items:center;justify-content:center;position:absolute;top:18px;right:18px;padding:12px;cursor:pointer;background:#1a1f2e;border:none;border-radius:50%}.wallet-adapter-modal-button-close:focus-visible{outline-color:#fff}.wallet-adapter-modal-button-close svg{fill:#777;transition:fill .2s ease 0s}.wallet-adapter-modal-button-close:hover svg{fill:#fff}.wallet-adapter-modal-overlay{background:#00000080;position:fixed;top:0;left:0;bottom:0;right:0}.wallet-adapter-modal-container{display:flex;margin:3rem;min-height:calc(100vh - 6rem);align-items:center;justify-content:center}@media (max-width: 480px){.wallet-adapter-modal-container{margin:1rem;min-height:calc(100vh - 2rem)}}.wallet-adapter-modal-wrapper{box-sizing:border-box;position:relative;display:flex;align-items:center;flex-direction:column;z-index:1050;max-width:400px;border-radius:10px;background:#10141f;box-shadow:0 8px 20px #0009;font-family:DM Sans,Roboto,Helvetica Neue,Helvetica,Arial,sans-serif;flex:1}.wallet-adapter-modal-wrapper .wallet-adapter-button{width:100%}.wallet-adapter-modal-title{font-weight:500;font-size:24px;line-height:36px;margin:0;padding:64px 48px 48px;text-align:center;color:#fff}@media (max-width: 374px){.wallet-adapter-modal-title{font-size:18px}}.wallet-adapter-modal-list{margin:0 0 12px;padding:0;width:100%;list-style:none}.wallet-adapter-modal-list .wallet-adapter-button{font-weight:400;border-radius:0;font-size:18px}.wallet-adapter-modal-list .wallet-adapter-button-end-icon,.wallet-adapter-modal-list .wallet-adapter-button-start-icon,.wallet-adapter-modal-list .wallet-adapter-button-end-icon img,.wallet-adapter-modal-list .wallet-adapter-button-start-icon img{width:28px;height:28px}.wallet-adapter-modal-list .wallet-adapter-button span{margin-left:auto;font-size:14px;opacity:.6}.wallet-adapter-modal-list-more{cursor:pointer;border:none;padding:12px 24px 24px 12px;align-self:flex-end;display:flex;align-items:center;background-color:transparent;color:#fff}.wallet-adapter-modal-list-more svg{transition:all .1s ease;fill:#fff;margin-left:.5rem}.wallet-adapter-modal-list-more-icon-rotate{transform:rotate(180deg)}.wallet-adapter-modal-middle{width:100%;display:flex;flex-direction:column;align-items:center;padding:0 24px 24px;box-sizing:border-box}.wallet-adapter-modal-middle-button{display:block;cursor:pointer;margin-top:48px;width:100%;background-color:#512da8;padding:12px;font-size:18px;border:none;border-radius:8px;color:#fff} diff --git a/assets/index-EO_1_XDp.js b/assets/index-EO_1_XDp.js new file mode 100644 index 0000000..2ed7993 --- /dev/null +++ b/assets/index-EO_1_XDp.js @@ -0,0 +1,3 @@ +import{g as q,S as Q,a as X,c as Y,P as Z,T as $,V as I}from"./index-CmbStJ2c.js";var G={exports:{}};(function(i){var t=Object.prototype.hasOwnProperty,e="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(e=!1));function r(v,c,s){this.fn=v,this.context=c,this.once=s||!1}function a(v,c,s,l,y){if(typeof s!="function")throw new TypeError("The listener must be a function");var h=new r(s,l||v,y),u=e?e+c:c;return v._events[u]?v._events[u].fn?v._events[u]=[v._events[u],h]:v._events[u].push(h):(v._events[u]=h,v._eventsCount++),v}function d(v,c){--v._eventsCount===0?v._events=new n:delete v._events[c]}function _(){this._events=new n,this._eventsCount=0}_.prototype.eventNames=function(){var c=[],s,l;if(this._eventsCount===0)return c;for(l in s=this._events)t.call(s,l)&&c.push(e?l.slice(1):l);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(s)):c},_.prototype.listeners=function(c){var s=e?e+c:c,l=this._events[s];if(!l)return[];if(l.fn)return[l.fn];for(var y=0,h=l.length,u=new Array(h);y<h;y++)u[y]=l[y].fn;return u},_.prototype.listenerCount=function(c){var s=e?e+c:c,l=this._events[s];return l?l.fn?1:l.length:0},_.prototype.emit=function(c,s,l,y,h,u){var g=e?e+c:c;if(!this._events[g])return!1;var o=this._events[g],p=arguments.length,m,f;if(o.fn){switch(o.once&&this.removeListener(c,o.fn,void 0,!0),p){case 1:return o.fn.call(o.context),!0;case 2:return o.fn.call(o.context,s),!0;case 3:return o.fn.call(o.context,s,l),!0;case 4:return o.fn.call(o.context,s,l,y),!0;case 5:return o.fn.call(o.context,s,l,y,h),!0;case 6:return o.fn.call(o.context,s,l,y,h,u),!0}for(f=1,m=new Array(p-1);f<p;f++)m[f-1]=arguments[f];o.fn.apply(o.context,m)}else{var A=o.length,b;for(f=0;f<A;f++)switch(o[f].once&&this.removeListener(c,o[f].fn,void 0,!0),p){case 1:o[f].fn.call(o[f].context);break;case 2:o[f].fn.call(o[f].context,s);break;case 3:o[f].fn.call(o[f].context,s,l);break;case 4:o[f].fn.call(o[f].context,s,l,y);break;default:if(!m)for(b=1,m=new Array(p-1);b<p;b++)m[b-1]=arguments[b];o[f].fn.apply(o[f].context,m)}}return!0},_.prototype.on=function(c,s,l){return a(this,c,s,l,!1)},_.prototype.once=function(c,s,l){return a(this,c,s,l,!0)},_.prototype.removeListener=function(c,s,l,y){var h=e?e+c:c;if(!this._events[h])return this;if(!s)return d(this,h),this;var u=this._events[h];if(u.fn)u.fn===s&&(!y||u.once)&&(!l||u.context===l)&&d(this,h);else{for(var g=0,o=[],p=u.length;g<p;g++)(u[g].fn!==s||y&&!u[g].once||l&&u[g].context!==l)&&o.push(u[g]);o.length?this._events[h]=o.length===1?o[0]:o:d(this,h)}return this},_.prototype.removeAllListeners=function(c){var s;return c?(s=e?e+c:c,this._events[s]&&d(this,s)):(this._events=new n,this._eventsCount=0),this},_.prototype.off=_.prototype.removeListener,_.prototype.addListener=_.prototype.on,_.prefixed=e,_.EventEmitter=_,i.exports=_})(G);var ee=G.exports;const te=q(ee);function ne(i){if(i.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),e=0;e<t.length;e++)t[e]=255;for(var n=0;n<i.length;n++){var r=i.charAt(n),a=r.charCodeAt(0);if(t[a]!==255)throw new TypeError(r+" is ambiguous");t[a]=n}var d=i.length,_=i.charAt(0),v=Math.log(d)/Math.log(256),c=Math.log(256)/Math.log(d);function s(h){if(h instanceof Uint8Array||(ArrayBuffer.isView(h)?h=new Uint8Array(h.buffer,h.byteOffset,h.byteLength):Array.isArray(h)&&(h=Uint8Array.from(h))),!(h instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(h.length===0)return"";for(var u=0,g=0,o=0,p=h.length;o!==p&&h[o]===0;)o++,u++;for(var m=(p-o)*c+1>>>0,f=new Uint8Array(m);o!==p;){for(var A=h[o],b=0,E=m-1;(A!==0||b<g)&&E!==-1;E--,b++)A+=256*f[E]>>>0,f[E]=A%d>>>0,A=A/d>>>0;if(A!==0)throw new Error("Non-zero carry");g=b,o++}for(var x=m-g;x!==m&&f[x]===0;)x++;for(var z=_.repeat(u);x<m;++x)z+=i.charAt(f[x]);return z}function l(h){if(typeof h!="string")throw new TypeError("Expected String");if(h.length===0)return new Uint8Array;for(var u=0,g=0,o=0;h[u]===_;)g++,u++;for(var p=(h.length-u)*v+1>>>0,m=new Uint8Array(p);h[u];){var f=t[h.charCodeAt(u)];if(f===255)return;for(var A=0,b=p-1;(f!==0||A<o)&&b!==-1;b--,A++)f+=d*m[b]>>>0,m[b]=f%256>>>0,f=f/256>>>0;if(f!==0)throw new Error("Non-zero carry");o=A,u++}for(var E=p-o;E!==p&&m[E]===0;)E++;for(var x=new Uint8Array(g+(p-E)),z=g;E!==p;)x[z++]=m[E++];return x}function y(h){var u=l(h);if(u)return u;throw new Error("Non-base"+d+" character")}return{encode:s,decodeUnsafe:l,decode:y}}var ie=ne;const re=ie,se="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";var oe=re(se);const M=q(oe);let U;const ae=new Uint8Array(16);function ce(){if(!U&&(U=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!U))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return U(ae)}const w=[];for(let i=0;i<256;++i)w.push((i+256).toString(16).slice(1));function le(i,t=0){return w[i[t+0]]+w[i[t+1]]+w[i[t+2]]+w[i[t+3]]+"-"+w[i[t+4]]+w[i[t+5]]+"-"+w[i[t+6]]+w[i[t+7]]+"-"+w[i[t+8]]+w[i[t+9]]+"-"+w[i[t+10]]+w[i[t+11]]+w[i[t+12]]+w[i[t+13]]+w[i[t+14]]+w[i[t+15]]}const de=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),V={randomUUID:de};function he(i,t,e){if(V.randomUUID&&!t&&!i)return V.randomUUID();i=i||{};const n=i.random||(i.rng||ce)();return n[6]=n[6]&15|64,n[8]=n[8]&63|128,le(n)}function P(i){return i.version===void 0}function j(i){return P(i)?i.serialize({verifySignatures:!1,requireAllSignatures:!1}):i.serialize()}var B=function(i,t,e,n){function r(a){return a instanceof e?a:new e(function(d){d(a)})}return new(e||(e=Promise))(function(a,d){function _(s){try{c(n.next(s))}catch(l){d(l)}}function v(s){try{c(n.throw(s))}catch(l){d(l)}}function c(s){s.done?a(s.value):r(s.value).then(_,v)}c((n=n.apply(i,t||[])).next())})};function F(i){return B(this,void 0,void 0,function*(){try{return yield i.request({method:"wallet_getSnaps"}),!0}catch{return!1}})}function ue(){return B(this,void 0,void 0,function*(){try{const i=window.ethereum;if(!i)return null;if(i.providers&&Array.isArray(i.providers)){const t=i.providers;for(const e of t)if(yield F(e))return e}if(i.detected&&Array.isArray(i.detected)){const t=i.detected;for(const e of t)if(yield F(e))return e}return(yield F(i))?i:null}catch(i){return console.error(i),null}})}const fe="solana:mainnet",ve="solana:devnet",_e="solana:testnet",pe="solana:localnet",J=[fe,ve,_e,pe];function H(i){return J.includes(i)}var T=function(i,t,e,n){if(e==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?i!==t||!n:!t.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?n:e==="a"?n.call(i):n?n.value:t.get(i)},C=function(i,t,e,n,r){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?i!==t||!r:!t.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?r.call(i,e):r?r.value=e:t.set(i,e),e},K,O,k,N,L,W;const me=J,ge=[Q,X,Y];class R{get address(){return T(this,K,"f")}get publicKey(){return T(this,O,"f").slice()}get chains(){return T(this,k,"f").slice()}get features(){return T(this,N,"f").slice()}get label(){return T(this,L,"f")}get icon(){return T(this,W,"f")}constructor({address:t,publicKey:e,label:n,icon:r}){K.set(this,void 0),O.set(this,void 0),k.set(this,void 0),N.set(this,void 0),L.set(this,void 0),W.set(this,void 0),new.target===R&&Object.freeze(this),C(this,K,t,"f"),C(this,O,e,"f"),C(this,k,me,"f"),C(this,N,ge,"f"),C(this,L,n,"f"),C(this,W,r,"f")}}K=new WeakMap,O=new WeakMap,k=new WeakMap,N=new WeakMap,L=new WeakMap,W=new WeakMap;var S=function(i,t,e,n){function r(a){return a instanceof e?a:new e(function(d){d(a)})}return new(e||(e=Promise))(function(a,d){function _(s){try{c(n.next(s))}catch(l){d(l)}}function v(s){try{c(n.throw(s))}catch(l){d(l)}}function c(s){s.done?a(s.value):r(s.value).then(_,v)}c((n=n.apply(i,t||[])).next())})};class D extends te{constructor(t){super(),this._network="mainnet-beta",this._iframeParams={},this._element=null,this._iframe=null,this._publicKey=null,this._account=null,this._isConnected=!1,this._connectHandler=null,this._messageHandlers={},this._handleEvent=e=>{var n,r;switch(e.type){case"connect":{this._collapseIframe(),!((n=e.data)===null||n===void 0)&&n.publicKey?(this._publicKey=e.data.publicKey,this._isConnected=!0,this._connectHandler&&(this._connectHandler.resolve(),this._connectHandler=null),this._connected()):(this._connectHandler&&(this._connectHandler.reject(),this._connectHandler=null),this._disconnected());return}case"disconnect":{this._connectHandler&&(this._connectHandler.reject(),this._connectHandler=null),this._disconnected();return}case"accountChanged":{!((r=e.data)===null||r===void 0)&&r.publicKey?(this._publicKey=e.data.publicKey,this.emit("accountChanged",this.publicKey),this._standardConnected()):(this.emit("accountChanged",void 0),this._standardDisconnected());return}default:return}},this._handleResize=e=>{e.resizeMode==="full"?e.params.mode==="fullscreen"?this._expandIframe():e.params.mode==="hide"&&this._collapseIframe():e.resizeMode==="coordinates"&&this._resizeIframe(e.params)},this._handleMessage=e=>{var n;if(((n=e.data)===null||n===void 0?void 0:n.channel)!=="solflareIframeToWalletAdapter")return;const r=e.data.data||{};if(r.type==="event")this._handleEvent(r.event);else if(r.type==="resize")this._handleResize(r);else if(r.type==="response"&&this._messageHandlers[r.id]){const{resolve:a,reject:d}=this._messageHandlers[r.id];delete this._messageHandlers[r.id],r.error?d(r.error):a(r.result)}},this._removeElement=()=>{this._element&&(this._element.remove(),this._element=null)},this._removeDanglingElements=()=>{const e=document.getElementsByClassName("solflare-metamask-wallet-adapter-iframe");for(const n of e)n.parentElement&&n.remove()},this._injectElement=()=>{this._removeElement(),this._removeDanglingElements();const e=Object.assign(Object.assign({},this._iframeParams),{mm:!0,v:1,cluster:this._network||"mainnet-beta",origin:window.location.origin||"",title:document.title||""}),n=Object.keys(e).map(a=>`${a}=${encodeURIComponent(e[a])}`).join("&"),r=`${D.IFRAME_URL}?${n}`;this._element=document.createElement("div"),this._element.className="solflare-metamask-wallet-adapter-iframe",this._element.innerHTML=` + <iframe src='${r}' style='position: fixed; top: 0; bottom: 0; left: 0; right: 0; width: 100%; height: 100%; border: none; border-radius: 0; z-index: 99999; color-scheme: auto;' allowtransparency='true'></iframe> + `,document.body.appendChild(this._element),this._iframe=this._element.querySelector("iframe"),window.addEventListener("message",this._handleMessage,!1)},this._collapseIframe=()=>{this._iframe&&(this._iframe.style.top="",this._iframe.style.right="",this._iframe.style.height="2px",this._iframe.style.width="2px")},this._expandIframe=()=>{this._iframe&&(this._iframe.style.top="0px",this._iframe.style.bottom="0px",this._iframe.style.left="0px",this._iframe.style.right="0px",this._iframe.style.width="100%",this._iframe.style.height="100%")},this._resizeIframe=e=>{this._iframe&&(this._iframe.style.top=isFinite(e.top)?`${e.top}px`:"",this._iframe.style.bottom=isFinite(e.bottom)?`${e.bottom}px`:"",this._iframe.style.left=isFinite(e.left)?`${e.left}px`:"",this._iframe.style.right=isFinite(e.right)?`${e.right}px`:"",this._iframe.style.width=isFinite(e.width)?`${e.width}px`:e.width,this._iframe.style.height=isFinite(e.height)?`${e.height}px`:e.height)},this._sendIframeMessage=e=>{if(!this.connected||!this.publicKey)throw new Error("Wallet not connected");return new Promise((n,r)=>{var a,d;const _=he();this._messageHandlers[_]={resolve:n,reject:r},(d=(a=this._iframe)===null||a===void 0?void 0:a.contentWindow)===null||d===void 0||d.postMessage({channel:"solflareWalletAdapterToIframe",data:Object.assign({id:_},e)},"*")})},this._connected=()=>{this._isConnected=!0,this.emit("connect",this.publicKey),this._standardConnected()},this._disconnected=()=>{this._publicKey=null,this._isConnected=!1,window.removeEventListener("message",this._handleMessage,!1),this._removeElement(),this.emit("disconnect"),this._standardDisconnected()},this._standardConnected=()=>{if(!this.publicKey)return;const e=this.publicKey.toString();(!this._account||this._account.address!==e)&&(this._account=new R({address:e,publicKey:this.publicKey.toBytes()}),this.emit("standard_change",{accounts:this.standardAccounts}))},this._standardDisconnected=()=>{this._account&&(this._account=null,this.emit("standard_change",{accounts:this.standardAccounts}))},t!=null&&t.network&&(this._network=t==null?void 0:t.network),window.SolflareMetaMaskParams&&(this._iframeParams=Object.assign(Object.assign({},this._iframeParams),window.SolflareMetaMaskParams)),t!=null&&t.params&&(this._iframeParams=Object.assign(Object.assign({},this._iframeParams),t==null?void 0:t.params))}get publicKey(){return this._publicKey?new Z(this._publicKey):null}get standardAccount(){return this._account}get standardAccounts(){return this._account?[this._account]:[]}get isConnected(){return this._isConnected}get connected(){return this.isConnected}get autoApprove(){return!1}connect(){return S(this,void 0,void 0,function*(){this.connected||(this._injectElement(),yield new Promise((t,e)=>{this._connectHandler={resolve:t,reject:e}}))})}disconnect(){return S(this,void 0,void 0,function*(){yield this._sendIframeMessage({method:"disconnect"}),this._disconnected()})}signTransaction(t){var e;return S(this,void 0,void 0,function*(){if(!this.connected||!this.publicKey)throw new Error("Wallet not connected");try{const n=j(t),r=yield this._sendIframeMessage({method:"signTransactionV2",params:{transaction:M.encode(n)}}),{transaction:a}=r;return P(t)?$.from(M.decode(a)):I.deserialize(M.decode(a))}catch(n){throw new Error(((e=n==null?void 0:n.toString)===null||e===void 0?void 0:e.call(n))||"Failed to sign transaction")}})}signAllTransactions(t){var e;return S(this,void 0,void 0,function*(){if(!this.connected||!this.publicKey)throw new Error("Wallet not connected");try{const n=t.map(a=>j(a)),{transactions:r}=yield this._sendIframeMessage({method:"signAllTransactionsV2",params:{transactions:n.map(a=>M.encode(a))}});return r.map((a,d)=>P(t[d])?$.from(M.decode(a)):I.deserialize(M.decode(a)))}catch(n){throw new Error(((e=n==null?void 0:n.toString)===null||e===void 0?void 0:e.call(n))||"Failed to sign transactions")}})}signAndSendTransaction(t,e){var n;return S(this,void 0,void 0,function*(){if(!this.connected||!this.publicKey)throw new Error("Wallet not connected");try{const r=j(t),{signature:a}=yield this._sendIframeMessage({method:"signAndSendTransaction",params:{transaction:M.encode(r),options:e}});return a}catch(r){throw new Error(((n=r==null?void 0:r.toString)===null||n===void 0?void 0:n.call(r))||"Failed to sign and send transaction")}})}signMessage(t,e="utf8"){var n;return S(this,void 0,void 0,function*(){if(!this.connected||!this.publicKey)throw new Error("Wallet not connected");try{const{signature:r}=yield this._sendIframeMessage({method:"signMessage",params:{data:M.encode(t),display:e}});return Uint8Array.from(M.decode(r))}catch(r){throw new Error(((n=r==null?void 0:r.toString)===null||n===void 0?void 0:n.call(r))||"Failed to sign message")}})}sign(t,e="utf8"){return S(this,void 0,void 0,function*(){return yield this.signMessage(t,e)})}static isSupported(){return S(this,void 0,void 0,function*(){return!!(yield ue())})}standardSignAndSendTransaction(...t){return S(this,void 0,void 0,function*(){if(!this.connected)throw new Error("not connected");const e=[];if(t.length===1){const{transaction:n,account:r,chain:a,options:d}=t[0],{minContextSlot:_,preflightCommitment:v,skipPreflight:c,maxRetries:s}=d||{};if(r!==this._account)throw new Error("invalid account");if(!H(a))throw new Error("invalid chain");const l=yield this.signAndSendTransaction(I.deserialize(n),{preflightCommitment:v,minContextSlot:_,maxRetries:s,skipPreflight:c});e.push({signature:M.decode(l)})}else if(t.length>1)for(const n of t)e.push(...yield this.standardSignAndSendTransaction(n));return e})}standardSignTransaction(...t){return S(this,void 0,void 0,function*(){if(!this.connected)throw new Error("not connected");const e=[];if(t.length===1){const{transaction:n,account:r,chain:a}=t[0];if(r!==this._account)throw new Error("invalid account");if(a&&!H(a))throw new Error("invalid chain");const d=yield this.signTransaction(I.deserialize(n));e.push({signedTransaction:d.serialize()})}else if(t.length>1){let n;for(const d of t){if(d.account!==this._account)throw new Error("invalid account");if(d.chain){if(!H(d.chain))throw new Error("invalid chain");if(n){if(d.chain!==n)throw new Error("conflicting chain")}else n=d.chain}}const r=t.map(({transaction:d})=>I.deserialize(d)),a=yield this.signAllTransactions(r);e.push(...a.map(d=>({signedTransaction:d.serialize()})))}return e})}standardSignMessage(...t){return S(this,void 0,void 0,function*(){if(!this.connected)throw new Error("not connected");const e=[];if(t.length===1){const{message:n,account:r}=t[0];if(r!==this._account)throw new Error("invalid account");const a=yield this.signMessage(n);e.push({signedMessage:n,signature:a})}else if(t.length>1)for(const n of t)e.push(...yield this.standardSignMessage(n));return e})}}D.IFRAME_URL="https://widget.solflare.com/";export{R as StandardSolflareMetaMaskWalletAccount,D as default}; diff --git a/assets/index-wcjhZ_fi.js b/assets/index-wcjhZ_fi.js new file mode 100644 index 0000000..8ef177a --- /dev/null +++ b/assets/index-wcjhZ_fi.js @@ -0,0 +1 @@ +import{E as m,P as g,b as _}from"./index-CmbStJ2c.js";var A=function(){var s=function(o,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(n[t]=r[t])},s(o,e)};return function(o,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");s(o,e);function n(){this.constructor=o}o.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),x=function(s){A(o,s);function o(){return s!==null&&s.apply(this,arguments)||this}return o}(m),f=function(s,o,e,n){function r(t){return t instanceof e?t:new e(function(a){a(t)})}return new(e||(e=Promise))(function(t,a){function u(c){try{i(n.next(c))}catch(d){a(d)}}function l(c){try{i(n.throw(c))}catch(d){a(d)}}function i(c){c.done?t(c.value):r(c.value).then(u,l)}i((n=n.apply(s,o||[])).next())})};class j extends m{constructor(o,e){if(super(),this._network=e,this._publicKey=null,this._popup=null,this._handlerAdded=!1,this._nextRequestId=1,this._autoApprove=!1,this._responsePromises=new Map,this.handleMessage=n=>{var r;if(this._injectedProvider&&n.source===window||n.origin===((r=this._providerUrl)===null||r===void 0?void 0:r.origin)&&n.source===this._popup){if(n.data.method==="connected"){const t=new g(n.data.params.publicKey);(!this._publicKey||!this._publicKey.equals(t))&&(this._publicKey&&!this._publicKey.equals(t)&&this.handleDisconnect(),this._publicKey=t,this._autoApprove=!!n.data.params.autoApprove,this.emit("connect",this._publicKey))}else if(n.data.method==="disconnected")this.handleDisconnect();else if(n.data.result||n.data.error){const t=this._responsePromises.get(n.data.id);if(t){const[a,u]=t;n.data.result?a(n.data.result):u(new Error(n.data.error))}}}},this._beforeUnload=()=>{this.disconnect()},O(o))this._injectedProvider=o;else if(E(o))this._providerUrl=new URL(o),this._providerUrl.hash=new URLSearchParams({origin:window.location.origin,network:this._network}).toString();else throw new Error("provider parameter must be an injected provider or a URL string.")}handleConnect(){var o;return this._handlerAdded||(this._handlerAdded=!0,window.addEventListener("message",this.handleMessage),window.addEventListener("beforeunload",this._beforeUnload)),this._injectedProvider?new Promise(e=>{this.sendRequest("connect",{}),e()}):(window.name="parent",this._popup=window.open((o=this._providerUrl)===null||o===void 0?void 0:o.toString(),"_blank","location,resizable,width=460,height=675"),new Promise(e=>{this.once("connect",e)}))}handleDisconnect(){this._handlerAdded&&(this._handlerAdded=!1,window.removeEventListener("message",this.handleMessage),window.removeEventListener("beforeunload",this._beforeUnload)),this._publicKey&&(this._publicKey=null,this.emit("disconnect")),this._responsePromises.forEach(([,o],e)=>{this._responsePromises.delete(e),o(new Error("Wallet disconnected"))})}sendRequest(o,e){return f(this,void 0,void 0,function*(){if(o!=="connect"&&!this.connected)throw new Error("Wallet not connected");const n=this._nextRequestId;return++this._nextRequestId,new Promise((r,t)=>{var a,u,l,i;this._responsePromises.set(n,[r,t]),this._injectedProvider?this._injectedProvider.postMessage({jsonrpc:"2.0",id:n,method:o,params:Object.assign({network:this._network},e)}):((a=this._popup)===null||a===void 0||a.postMessage({jsonrpc:"2.0",id:n,method:o,params:e},(l=(u=this._providerUrl)===null||u===void 0?void 0:u.origin)!==null&&l!==void 0?l:""),this.autoApprove||(i=this._popup)===null||i===void 0||i.focus())})})}get publicKey(){return this._publicKey}get connected(){return this._publicKey!==null}get autoApprove(){return this._autoApprove}connect(){return f(this,void 0,void 0,function*(){this._popup&&this._popup.close(),yield this.handleConnect()})}disconnect(){return f(this,void 0,void 0,function*(){this._injectedProvider&&(yield this.sendRequest("disconnect",{})),this._popup&&this._popup.close(),this.handleDisconnect()})}sign(o,e){return f(this,void 0,void 0,function*(){if(!(o instanceof Uint8Array))throw new Error("Data must be an instance of Uint8Array");const n=yield this.sendRequest("sign",{data:o,display:e}),r=_.decode(n.signature),t=new g(n.publicKey);return{signature:r,publicKey:t}})}signTransaction(o){return f(this,void 0,void 0,function*(){const e=yield this.sendRequest("signTransaction",{message:_.encode(o.serializeMessage())}),n=_.decode(e.signature),r=new g(e.publicKey);return o.addSignature(r,n),o})}signAllTransactions(o){return f(this,void 0,void 0,function*(){const e=yield this.sendRequest("signAllTransactions",{messages:o.map(t=>_.encode(t.serializeMessage()))}),n=e.signatures.map(t=>_.decode(t)),r=new g(e.publicKey);return o=o.map((t,a)=>(t.addSignature(r,n[a]),t)),o})}diffieHellman(o){return f(this,void 0,void 0,function*(){if(!(o instanceof Uint8Array))throw new Error("Data must be an instance of Uint8Array");return yield this.sendRequest("diffieHellman",{publicKey:o})})}}function E(s){return typeof s=="string"}function O(s){return k(s)&&"postMessage"in s&&typeof s.postMessage=="function"}function k(s){return typeof s=="object"&&s!==null}var P=function(){var s=function(o,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(n[t]=r[t])},s(o,e)};return function(o,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");s(o,e);function n(){this.constructor=o}o.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),v=function(s,o,e,n){function r(t){return t instanceof e?t:new e(function(a){a(t)})}return new(e||(e=Promise))(function(t,a){function u(c){try{i(n.next(c))}catch(d){a(d)}}function l(c){try{i(n.throw(c))}catch(d){a(d)}}function i(c){c.done?t(c.value):r(c.value).then(u,l)}i((n=n.apply(s,o||[])).next())})},w=function(s,o){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},n,r,t,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(i){return function(c){return l([i,c])}}function l(i){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,r&&(t=i[0]&2?r.return:i[0]?r.throw||((t=r.return)&&t.call(r),0):r.next)&&!(t=t.call(r,i[1])).done)return t;switch(r=0,t&&(i=[i[0]&2,t.value]),i[0]){case 0:case 1:t=i;break;case 4:return e.label++,{value:i[1],done:!1};case 5:e.label++,r=i[1],i=[0];continue;case 7:i=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(i[0]===6||i[0]===2)){e=0;continue}if(i[0]===3&&(!t||i[1]>t[0]&&i[1]<t[3])){e.label=i[1];break}if(i[0]===6&&e.label<t[1]){e.label=t[1],t=i;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(i);break}t[2]&&e.ops.pop(),e.trys.pop();continue}i=o.call(s,e)}catch(c){i=[6,c],r=0}finally{n=t=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}},K=function(s){P(o,s);function o(e,n){var r=s.call(this)||this;return r._instance=null,r._handleConnect=function(){r.emit("connect")},r._handleDisconnect=function(){window.clearInterval(r._pollTimer),r.emit("disconnect")},r._provider=e,r._network=n,r}return Object.defineProperty(o.prototype,"publicKey",{get:function(){return this._instance.publicKey||null},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"connected",{get:function(){return this._instance.connected||!1},enumerable:!1,configurable:!0}),o.prototype.connect=function(){return v(this,void 0,void 0,function(){var e=this;return w(this,function(n){switch(n.label){case 0:return this._instance=new j(this._provider,this._network),this._instance.on("connect",this._handleConnect),this._instance.on("disconnect",this._handleDisconnect),this._pollTimer=window.setInterval(function(){var r,t;((t=(r=e._instance)===null||r===void 0?void 0:r._popup)===null||t===void 0?void 0:t.closed)!==!1&&e._handleDisconnect()},200),[4,this._instance.connect()];case 1:return n.sent(),[2]}})})},o.prototype.disconnect=function(){return v(this,void 0,void 0,function(){return w(this,function(e){switch(e.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return this._instance.removeAllListeners("connect"),this._instance.removeAllListeners("disconnect"),[4,this._instance.disconnect()];case 1:return e.sent(),[2]}})})},o.prototype.signTransaction=function(e){return v(this,void 0,void 0,function(){return w(this,function(n){switch(n.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return[4,this._instance.signTransaction(e)];case 1:return[2,n.sent()]}})})},o.prototype.signAllTransactions=function(e){return v(this,void 0,void 0,function(){return w(this,function(n){switch(n.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return[4,this._instance.signAllTransactions(e)];case 1:return[2,n.sent()]}})})},o.prototype.signMessage=function(e,n){return n===void 0&&(n="hex"),v(this,void 0,void 0,function(){var r;return w(this,function(t){switch(t.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return[4,this._instance.sign(e,n)];case 1:return r=t.sent().signature,[2,Uint8Array.from(r)]}})})},o}(x),T=function(){var s=function(o,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(n[t]=r[t])},s(o,e)};return function(o,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");s(o,e);function n(){this.constructor=o}o.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),y=function(s,o,e,n){function r(t){return t instanceof e?t:new e(function(a){a(t)})}return new(e||(e=Promise))(function(t,a){function u(c){try{i(n.next(c))}catch(d){a(d)}}function l(c){try{i(n.throw(c))}catch(d){a(d)}}function i(c){c.done?t(c.value):r(c.value).then(u,l)}i((n=n.apply(s,o||[])).next())})},b=function(s,o){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},n,r,t,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(i){return function(c){return l([i,c])}}function l(i){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,r&&(t=i[0]&2?r.return:i[0]?r.throw||((t=r.return)&&t.call(r),0):r.next)&&!(t=t.call(r,i[1])).done)return t;switch(r=0,t&&(i=[i[0]&2,t.value]),i[0]){case 0:case 1:t=i;break;case 4:return e.label++,{value:i[1],done:!1};case 5:e.label++,r=i[1],i=[0];continue;case 7:i=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(i[0]===6||i[0]===2)){e=0;continue}if(i[0]===3&&(!t||i[1]>t[0]&&i[1]<t[3])){e.label=i[1];break}if(i[0]===6&&e.label<t[1]){e.label=t[1],t=i;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(i);break}t[2]&&e.ops.pop(),e.trys.pop();continue}i=o.call(s,e)}catch(c){i=[6,c],r=0}finally{n=t=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}},S=function(s){T(o,s);function o(e,n){var r=s.call(this)||this;return r._provider=e,r._network=n,r}return Object.defineProperty(o.prototype,"publicKey",{get:function(){return this._provider.publicKey},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"connected",{get:function(){return this._provider.isConnected},enumerable:!1,configurable:!0}),o.prototype.connect=function(){return y(this,void 0,void 0,function(){var e;return b(this,function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),this.connected)throw new Error("Wallet already connected");return[4,this._provider.connect()];case 1:return n.sent(),this.emit("connect"),[3,3];case 2:throw e=n.sent(),this.emit("disconnect"),e;case 3:return[2]}})})},o.prototype.disconnect=function(){return y(this,void 0,void 0,function(){return b(this,function(e){switch(e.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return[4,this._provider.disconnect()];case 1:return e.sent(),this.emit("disconnect"),[2]}})})},o.prototype.signTransaction=function(e){return y(this,void 0,void 0,function(){return b(this,function(n){switch(n.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return[4,this._provider.signTransaction(e,this._network)];case 1:return[2,n.sent()]}})})},o.prototype.signAllTransactions=function(e){return y(this,void 0,void 0,function(){return b(this,function(n){switch(n.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return[4,this._provider.signAllTransactions(e,this._network)];case 1:return[2,n.sent()]}})})},o.prototype.signMessage=function(e){return y(this,void 0,void 0,function(){var n;return b(this,function(r){switch(r.label){case 0:if(!this.connected)throw new Error("Wallet not connected");if(!(e instanceof Uint8Array))throw new Error("Data must be an instance of Uint8Array");return[4,this._provider.signMessage(e)];case 1:return n=r.sent().signature,[2,n]}})})},o}(x),I=function(){var s=function(o,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(n[t]=r[t])},s(o,e)};return function(o,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");s(o,e);function n(){this.constructor=o}o.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),h=function(s,o,e,n){function r(t){return t instanceof e?t:new e(function(a){a(t)})}return new(e||(e=Promise))(function(t,a){function u(c){try{i(n.next(c))}catch(d){a(d)}}function l(c){try{i(n.throw(c))}catch(d){a(d)}}function i(c){c.done?t(c.value):r(c.value).then(u,l)}i((n=n.apply(s,o||[])).next())})},p=function(s,o){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},n,r,t,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(i){return function(c){return l([i,c])}}function l(i){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,r&&(t=i[0]&2?r.return:i[0]?r.throw||((t=r.return)&&t.call(r),0):r.next)&&!(t=t.call(r,i[1])).done)return t;switch(r=0,t&&(i=[i[0]&2,t.value]),i[0]){case 0:case 1:t=i;break;case 4:return e.label++,{value:i[1],done:!1};case 5:e.label++,r=i[1],i=[0];continue;case 7:i=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(i[0]===6||i[0]===2)){e=0;continue}if(i[0]===3&&(!t||i[1]>t[0]&&i[1]<t[3])){e.label=i[1];break}if(i[0]===6&&e.label<t[1]){e.label=t[1],t=i;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(i);break}t[2]&&e.ops.pop(),e.trys.pop();continue}i=o.call(s,e)}catch(c){i=[6,c],r=0}finally{n=t=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}},U=function(s){I(o,s);function o(e){var n=s.call(this)||this;return n._network="mainnet-beta",n._adapterInstance=null,n._connectHandler=null,n._connected=function(){n._connectHandler&&(n._connectHandler.resolve(),n._connectHandler=null),n.emit("connect",n.publicKey)},n._disconnected=function(){n._connectHandler&&(n._connectHandler.reject(),n._connectHandler=null),n._adapterInstance=null,n.emit("disconnect")},e!=null&&e.network&&(n._network=e==null?void 0:e.network),e!=null&&e.provider?n._provider=e==null?void 0:e.provider:window.salmon?n._provider=window.salmon:n._provider="https://app.salmonwallet.io",n}return Object.defineProperty(o.prototype,"publicKey",{get:function(){var e;return((e=this._adapterInstance)===null||e===void 0?void 0:e.publicKey)||null},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"isConnected",{get:function(){var e;return!!(!((e=this._adapterInstance)===null||e===void 0)&&e.connected)},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"connected",{get:function(){return this.isConnected},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"autoApprove",{get:function(){return!1},enumerable:!1,configurable:!0}),o.prototype.connect=function(){return h(this,void 0,void 0,function(){var e=this;return p(this,function(n){switch(n.label){case 0:return this.connected?[2]:(typeof this._provider=="string"?this._adapterInstance=new K(this._provider,this._network):this._adapterInstance=new S(this._provider,this._network),this._adapterInstance.on("connect",this._connected),this._adapterInstance.on("disconnect",this._disconnected),this._adapterInstance.connect(),[4,new Promise(function(r,t){e._connectHandler={resolve:r,reject:t}})]);case 1:return n.sent(),[2]}})})},o.prototype.disconnect=function(){return h(this,void 0,void 0,function(){return p(this,function(e){switch(e.label){case 0:return this._adapterInstance?[4,this._adapterInstance.disconnect()]:[2];case 1:return e.sent(),[2]}})})},o.prototype.signTransaction=function(e){return h(this,void 0,void 0,function(){return p(this,function(n){switch(n.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return[4,this._adapterInstance.signTransaction(e)];case 1:return[2,n.sent()]}})})},o.prototype.signAllTransactions=function(e){return h(this,void 0,void 0,function(){return p(this,function(n){switch(n.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return[4,this._adapterInstance.signAllTransactions(e)];case 1:return[2,n.sent()]}})})},o.prototype.signMessage=function(e,n){return n===void 0&&(n="utf8"),h(this,void 0,void 0,function(){return p(this,function(r){switch(r.label){case 0:if(!this.connected)throw new Error("Wallet not connected");return[4,this._adapterInstance.signMessage(e,n)];case 1:return[2,r.sent()]}})})},o.prototype.sign=function(e,n){return n===void 0&&(n="utf8"),h(this,void 0,void 0,function(){return p(this,function(r){switch(r.label){case 0:return[4,this.signMessage(e,n)];case 1:return[2,r.sent()]}})})},o}(m);export{U as default}; diff --git a/assets/message-square-more-ddp2B-0G.svg b/assets/message-square-more-ddp2B-0G.svg new file mode 100644 index 0000000..4b71c52 --- /dev/null +++ b/assets/message-square-more-ddp2B-0G.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-message-square-more"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/><path d="M8 10h.01"/><path d="M12 10h.01"/><path d="M16 10h.01"/></svg> \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..5ee1289 --- /dev/null +++ b/index.html @@ -0,0 +1,14 @@ +<!doctype html> +<html lang="en"> + <head> + <meta charset="UTF-8" /> + <link rel="icon" type="image/svg+xml" href="./assets/message-square-more-ddp2B-0G.svg" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>Mess</title> + <script type="module" crossorigin src="./assets/index-CmbStJ2c.js"></script> + <link rel="stylesheet" crossorigin href="./assets/index-DDrF5s2C.css"> + </head> + <body> + <div id="root" class="w-full h-dvh flex flex-col gap-y-4 px-4 md:px-12 font-sans"></div> + </body> +</html>