@farcaster/miniapp-sdk 0.0.0-canary-20250630212339

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,190 @@
1
+ "use strict";var miniapp=(()=>{var xv=Object.create;var fs=Object.defineProperty;var Sv=Object.getOwnPropertyDescriptor;var Ev=Object.getOwnPropertyNames;var Iv=Object.getPrototypeOf,Rv=Object.prototype.hasOwnProperty;var Mt=(t,e)=>()=>(t&&(e=t(t=0)),e);var Vt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),kt=(t,e)=>{for(var r in e)fs(t,r,{get:e[r],enumerable:!0})},Lm=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ev(e))!Rv.call(t,n)&&n!==r&&fs(t,n,{get:()=>e[n],enumerable:!(i=Sv(e,n))||i.enumerable});return t};var Sr=(t,e,r)=>(r=t!=null?xv(Iv(t)):{},Lm(e||!t||!t.__esModule?fs(r,"default",{value:t,enumerable:!0}):r,t)),ou=t=>Lm(fs({},"__esModule",{value:!0}),t);var ty=Vt(pa=>{"use strict";pa.byteLength=z1;pa.toByteArray=U1;pa.fromByteArray=j1;var gr=[],or=[],B1=typeof Uint8Array<"u"?Uint8Array:Array,ih="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(In=0,Q0=ih.length;In<Q0;++In)gr[In]=ih[In],or[ih.charCodeAt(In)]=In;var In,Q0;or[45]=62;or[95]=63;function ey(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var i=r===e?0:4-r%4;return[r,i]}function z1(t){var e=ey(t),r=e[0],i=e[1];return(r+i)*3/4-i}function C1(t,e,r){return(e+r)*3/4-r}function U1(t){var e,r=ey(t),i=r[0],n=r[1],o=new B1(C1(t,i,n)),s=0,c=n>0?i-4:i,u;for(u=0;u<c;u+=4)e=or[t.charCodeAt(u)]<<18|or[t.charCodeAt(u+1)]<<12|or[t.charCodeAt(u+2)]<<6|or[t.charCodeAt(u+3)],o[s++]=e>>16&255,o[s++]=e>>8&255,o[s++]=e&255;return n===2&&(e=or[t.charCodeAt(u)]<<2|or[t.charCodeAt(u+1)]>>4,o[s++]=e&255),n===1&&(e=or[t.charCodeAt(u)]<<10|or[t.charCodeAt(u+1)]<<4|or[t.charCodeAt(u+2)]>>2,o[s++]=e>>8&255,o[s++]=e&255),o}function D1(t){return gr[t>>18&63]+gr[t>>12&63]+gr[t>>6&63]+gr[t&63]}function M1(t,e,r){for(var i,n=[],o=e;o<r;o+=3)i=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),n.push(D1(i));return n.join("")}function j1(t){for(var e,r=t.length,i=r%3,n=[],o=16383,s=0,c=r-i;s<c;s+=o)n.push(M1(t,s,s+o>c?c:s+o));return i===1?(e=t[r-1],n.push(gr[e>>2]+gr[e<<4&63]+"==")):i===2&&(e=(t[r-2]<<8)+t[r-1],n.push(gr[e>>10]+gr[e>>4&63]+gr[e<<2&63]+"=")),n.join("")}});var ry=Vt(oh=>{oh.read=function(t,e,r,i,n){var o,s,c=n*8-i-1,u=(1<<c)-1,p=u>>1,m=-7,_=r?n-1:0,w=r?-1:1,g=t[e+_];for(_+=w,o=g&(1<<-m)-1,g>>=-m,m+=c;m>0;o=o*256+t[e+_],_+=w,m-=8);for(s=o&(1<<-m)-1,o>>=-m,m+=i;m>0;s=s*256+t[e+_],_+=w,m-=8);if(o===0)o=1-p;else{if(o===u)return s?NaN:(g?-1:1)*(1/0);s=s+Math.pow(2,i),o=o-p}return(g?-1:1)*s*Math.pow(2,o-i)};oh.write=function(t,e,r,i,n,o){var s,c,u,p=o*8-n-1,m=(1<<p)-1,_=m>>1,w=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=i?0:o-1,A=i?1:-1,I=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,s=m):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+_>=1?e+=w/u:e+=w*Math.pow(2,1-_),e*u>=2&&(s++,u/=2),s+_>=m?(c=0,s=m):s+_>=1?(c=(e*u-1)*Math.pow(2,n),s=s+_):(c=e*Math.pow(2,_-1)*Math.pow(2,n),s=0));n>=8;t[r+g]=c&255,g+=A,c/=256,n-=8);for(s=s<<n|c,p+=n;p>0;t[r+g]=s&255,g+=A,s/=256,p-=8);t[r+g-A]|=I*128}});var _o=Vt(li=>{"use strict";var sh=ty(),ci=ry(),ny=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;li.Buffer=P;li.SlowBuffer=q1;li.INSPECT_MAX_BYTES=50;var ma=2147483647;li.kMaxLength=ma;P.TYPED_ARRAY_SUPPORT=F1();!P.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 F1(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}Object.defineProperty(P.prototype,"parent",{enumerable:!0,get:function(){if(P.isBuffer(this))return this.buffer}});Object.defineProperty(P.prototype,"offset",{enumerable:!0,get:function(){if(P.isBuffer(this))return this.byteOffset}});function Nr(t){if(t>ma)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,P.prototype),e}function P(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return lh(t)}return ay(t,e,r)}P.poolSize=8192;function ay(t,e,r){if(typeof t=="string")return V1(t,e);if(ArrayBuffer.isView(t))return W1(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(yr(t,ArrayBuffer)||t&&yr(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(yr(t,SharedArrayBuffer)||t&&yr(t.buffer,SharedArrayBuffer)))return ch(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let i=t.valueOf&&t.valueOf();if(i!=null&&i!==t)return P.from(i,e,r);let n=K1(t);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return P.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}P.from=function(t,e,r){return ay(t,e,r)};Object.setPrototypeOf(P.prototype,Uint8Array.prototype);Object.setPrototypeOf(P,Uint8Array);function cy(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function Z1(t,e,r){return cy(t),t<=0?Nr(t):e!==void 0?typeof r=="string"?Nr(t).fill(e,r):Nr(t).fill(e):Nr(t)}P.alloc=function(t,e,r){return Z1(t,e,r)};function lh(t){return cy(t),Nr(t<0?0:fh(t)|0)}P.allocUnsafe=function(t){return lh(t)};P.allocUnsafeSlow=function(t){return lh(t)};function V1(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!P.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=uy(t,e)|0,i=Nr(r),n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}function ah(t){let e=t.length<0?0:fh(t.length)|0,r=Nr(e);for(let i=0;i<e;i+=1)r[i]=t[i]&255;return r}function W1(t){if(yr(t,Uint8Array)){let e=new Uint8Array(t);return ch(e.buffer,e.byteOffset,e.byteLength)}return ah(t)}function ch(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let i;return e===void 0&&r===void 0?i=new Uint8Array(t):r===void 0?i=new Uint8Array(t,e):i=new Uint8Array(t,e,r),Object.setPrototypeOf(i,P.prototype),i}function K1(t){if(P.isBuffer(t)){let e=fh(t.length)|0,r=Nr(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||hh(t.length)?Nr(0):ah(t);if(t.type==="Buffer"&&Array.isArray(t.data))return ah(t.data)}function fh(t){if(t>=ma)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ma.toString(16)+" bytes");return t|0}function q1(t){return+t!=t&&(t=0),P.alloc(+t)}P.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==P.prototype};P.compare=function(e,r){if(yr(e,Uint8Array)&&(e=P.from(e,e.offset,e.byteLength)),yr(r,Uint8Array)&&(r=P.from(r,r.offset,r.byteLength)),!P.isBuffer(e)||!P.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let i=e.length,n=r.length;for(let o=0,s=Math.min(i,n);o<s;++o)if(e[o]!==r[o]){i=e[o],n=r[o];break}return i<n?-1:n<i?1:0};P.isEncoding=function(e){switch(String(e).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}};P.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return P.alloc(0);let i;if(r===void 0)for(r=0,i=0;i<e.length;++i)r+=e[i].length;let n=P.allocUnsafe(r),o=0;for(i=0;i<e.length;++i){let s=e[i];if(yr(s,Uint8Array))o+s.length>n.length?(P.isBuffer(s)||(s=P.from(s)),s.copy(n,o)):Uint8Array.prototype.set.call(n,s,o);else if(P.isBuffer(s))s.copy(n,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=s.length}return n};function uy(t,e){if(P.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||yr(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&r===0)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return uh(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return _y(t).length;default:if(n)return i?-1:uh(t).length;e=(""+e).toLowerCase(),n=!0}}P.byteLength=uy;function H1(t,e,r){let i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return iS(this,e,r);case"utf8":case"utf-8":return fy(this,e,r);case"ascii":return rS(this,e,r);case"latin1":case"binary":return nS(this,e,r);case"base64":return eS(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return oS(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}P.prototype._isBuffer=!0;function Rn(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}P.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<e;r+=2)Rn(this,r,r+1);return this};P.prototype.swap32=function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<e;r+=4)Rn(this,r,r+3),Rn(this,r+1,r+2);return this};P.prototype.swap64=function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<e;r+=8)Rn(this,r,r+7),Rn(this,r+1,r+6),Rn(this,r+2,r+5),Rn(this,r+3,r+4);return this};P.prototype.toString=function(){let e=this.length;return e===0?"":arguments.length===0?fy(this,0,e):H1.apply(this,arguments)};P.prototype.toLocaleString=P.prototype.toString;P.prototype.equals=function(e){if(!P.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:P.compare(this,e)===0};P.prototype.inspect=function(){let e="",r=li.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"};ny&&(P.prototype[ny]=P.prototype.inspect);P.prototype.compare=function(e,r,i,n,o){if(yr(e,Uint8Array)&&(e=P.from(e,e.offset,e.byteLength)),!P.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),i===void 0&&(i=e?e.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),r<0||i>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&r>=i)return 0;if(n>=o)return-1;if(r>=i)return 1;if(r>>>=0,i>>>=0,n>>>=0,o>>>=0,this===e)return 0;let s=o-n,c=i-r,u=Math.min(s,c),p=this.slice(n,o),m=e.slice(r,i);for(let _=0;_<u;++_)if(p[_]!==m[_]){s=p[_],c=m[_];break}return s<c?-1:c<s?1:0};function ly(t,e,r,i,n){if(t.length===0)return-1;if(typeof r=="string"?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,hh(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0)if(n)r=0;else return-1;if(typeof e=="string"&&(e=P.from(e,i)),P.isBuffer(e))return e.length===0?-1:iy(t,e,r,i,n);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):iy(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function iy(t,e,r,i,n){let o=1,s=t.length,c=e.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,s/=2,c/=2,r/=2}function u(m,_){return o===1?m[_]:m.readUInt16BE(_*o)}let p;if(n){let m=-1;for(p=r;p<s;p++)if(u(t,p)===u(e,m===-1?0:p-m)){if(m===-1&&(m=p),p-m+1===c)return m*o}else m!==-1&&(p-=p-m),m=-1}else for(r+c>s&&(r=s-c),p=r;p>=0;p--){let m=!0;for(let _=0;_<c;_++)if(u(t,p+_)!==u(e,_)){m=!1;break}if(m)return p}return-1}P.prototype.includes=function(e,r,i){return this.indexOf(e,r,i)!==-1};P.prototype.indexOf=function(e,r,i){return ly(this,e,r,i,!0)};P.prototype.lastIndexOf=function(e,r,i){return ly(this,e,r,i,!1)};function G1(t,e,r,i){r=Number(r)||0;let n=t.length-r;i?(i=Number(i),i>n&&(i=n)):i=n;let o=e.length;i>o/2&&(i=o/2);let s;for(s=0;s<i;++s){let c=parseInt(e.substr(s*2,2),16);if(hh(c))return s;t[r+s]=c}return s}function J1(t,e,r,i){return ga(uh(e,t.length-r),t,r,i)}function Y1(t,e,r,i){return ga(uS(e),t,r,i)}function X1(t,e,r,i){return ga(_y(e),t,r,i)}function Q1(t,e,r,i){return ga(lS(e,t.length-r),t,r,i)}P.prototype.write=function(e,r,i,n){if(r===void 0)n="utf8",i=this.length,r=0;else if(i===void 0&&typeof r=="string")n=r,i=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-r;if((i===void 0||i>o)&&(i=o),e.length>0&&(i<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let s=!1;for(;;)switch(n){case"hex":return G1(this,e,r,i);case"utf8":case"utf-8":return J1(this,e,r,i);case"ascii":case"latin1":case"binary":return Y1(this,e,r,i);case"base64":return X1(this,e,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Q1(this,e,r,i);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}};P.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function eS(t,e,r){return e===0&&r===t.length?sh.fromByteArray(t):sh.fromByteArray(t.slice(e,r))}function fy(t,e,r){r=Math.min(t.length,r);let i=[],n=e;for(;n<r;){let o=t[n],s=null,c=o>239?4:o>223?3:o>191?2:1;if(n+c<=r){let u,p,m,_;switch(c){case 1:o<128&&(s=o);break;case 2:u=t[n+1],(u&192)===128&&(_=(o&31)<<6|u&63,_>127&&(s=_));break;case 3:u=t[n+1],p=t[n+2],(u&192)===128&&(p&192)===128&&(_=(o&15)<<12|(u&63)<<6|p&63,_>2047&&(_<55296||_>57343)&&(s=_));break;case 4:u=t[n+1],p=t[n+2],m=t[n+3],(u&192)===128&&(p&192)===128&&(m&192)===128&&(_=(o&15)<<18|(u&63)<<12|(p&63)<<6|m&63,_>65535&&_<1114112&&(s=_))}}s===null?(s=65533,c=1):s>65535&&(s-=65536,i.push(s>>>10&1023|55296),s=56320|s&1023),i.push(s),n+=c}return tS(i)}var oy=4096;function tS(t){let e=t.length;if(e<=oy)return String.fromCharCode.apply(String,t);let r="",i=0;for(;i<e;)r+=String.fromCharCode.apply(String,t.slice(i,i+=oy));return r}function rS(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]&127);return i}function nS(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}function iS(t,e,r){let i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);let n="";for(let o=e;o<r;++o)n+=fS[t[o]];return n}function oS(t,e,r){let i=t.slice(e,r),n="";for(let o=0;o<i.length-1;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}P.prototype.slice=function(e,r){let i=this.length;e=~~e,r=r===void 0?i:~~r,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),r<e&&(r=e);let n=this.subarray(e,r);return Object.setPrototypeOf(n,P.prototype),n};function Et(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}P.prototype.readUintLE=P.prototype.readUIntLE=function(e,r,i){e=e>>>0,r=r>>>0,i||Et(e,r,this.length);let n=this[e],o=1,s=0;for(;++s<r&&(o*=256);)n+=this[e+s]*o;return n};P.prototype.readUintBE=P.prototype.readUIntBE=function(e,r,i){e=e>>>0,r=r>>>0,i||Et(e,r,this.length);let n=this[e+--r],o=1;for(;r>0&&(o*=256);)n+=this[e+--r]*o;return n};P.prototype.readUint8=P.prototype.readUInt8=function(e,r){return e=e>>>0,r||Et(e,1,this.length),this[e]};P.prototype.readUint16LE=P.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||Et(e,2,this.length),this[e]|this[e+1]<<8};P.prototype.readUint16BE=P.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||Et(e,2,this.length),this[e]<<8|this[e+1]};P.prototype.readUint32LE=P.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||Et(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};P.prototype.readUint32BE=P.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||Et(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};P.prototype.readBigUInt64LE=qr(function(e){e=e>>>0,ui(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&yo(e,this.length-8);let n=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+i*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))});P.prototype.readBigUInt64BE=qr(function(e){e=e>>>0,ui(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&yo(e,this.length-8);let n=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],o=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i;return(BigInt(n)<<BigInt(32))+BigInt(o)});P.prototype.readIntLE=function(e,r,i){e=e>>>0,r=r>>>0,i||Et(e,r,this.length);let n=this[e],o=1,s=0;for(;++s<r&&(o*=256);)n+=this[e+s]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*r)),n};P.prototype.readIntBE=function(e,r,i){e=e>>>0,r=r>>>0,i||Et(e,r,this.length);let n=r,o=1,s=this[e+--n];for(;n>0&&(o*=256);)s+=this[e+--n]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*r)),s};P.prototype.readInt8=function(e,r){return e=e>>>0,r||Et(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};P.prototype.readInt16LE=function(e,r){e=e>>>0,r||Et(e,2,this.length);let i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i};P.prototype.readInt16BE=function(e,r){e=e>>>0,r||Et(e,2,this.length);let i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i};P.prototype.readInt32LE=function(e,r){return e=e>>>0,r||Et(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};P.prototype.readInt32BE=function(e,r){return e=e>>>0,r||Et(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};P.prototype.readBigInt64LE=qr(function(e){e=e>>>0,ui(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&yo(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(i<<24);return(BigInt(n)<<BigInt(32))+BigInt(r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)});P.prototype.readBigInt64BE=qr(function(e){e=e>>>0,ui(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&yo(e,this.length-8);let n=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i)});P.prototype.readFloatLE=function(e,r){return e=e>>>0,r||Et(e,4,this.length),ci.read(this,e,!0,23,4)};P.prototype.readFloatBE=function(e,r){return e=e>>>0,r||Et(e,4,this.length),ci.read(this,e,!1,23,4)};P.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||Et(e,8,this.length),ci.read(this,e,!0,52,8)};P.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||Et(e,8,this.length),ci.read(this,e,!1,52,8)};function qt(t,e,r,i,n,o){if(!P.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<o)throw new RangeError('"value" argument is out of bounds');if(r+i>t.length)throw new RangeError("Index out of range")}P.prototype.writeUintLE=P.prototype.writeUIntLE=function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){let c=Math.pow(2,8*i)-1;qt(this,e,r,i,c,0)}let o=1,s=0;for(this[r]=e&255;++s<i&&(o*=256);)this[r+s]=e/o&255;return r+i};P.prototype.writeUintBE=P.prototype.writeUIntBE=function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){let c=Math.pow(2,8*i)-1;qt(this,e,r,i,c,0)}let o=i-1,s=1;for(this[r+o]=e&255;--o>=0&&(s*=256);)this[r+o]=e/s&255;return r+i};P.prototype.writeUint8=P.prototype.writeUInt8=function(e,r,i){return e=+e,r=r>>>0,i||qt(this,e,r,1,255,0),this[r]=e&255,r+1};P.prototype.writeUint16LE=P.prototype.writeUInt16LE=function(e,r,i){return e=+e,r=r>>>0,i||qt(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};P.prototype.writeUint16BE=P.prototype.writeUInt16BE=function(e,r,i){return e=+e,r=r>>>0,i||qt(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};P.prototype.writeUint32LE=P.prototype.writeUInt32LE=function(e,r,i){return e=+e,r=r>>>0,i||qt(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};P.prototype.writeUint32BE=P.prototype.writeUInt32BE=function(e,r,i){return e=+e,r=r>>>0,i||qt(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function dy(t,e,r,i,n){yy(e,i,n,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s,r}function hy(t,e,r,i,n){yy(e,i,n,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o=o>>8,t[r+6]=o,o=o>>8,t[r+5]=o,o=o>>8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s=s>>8,t[r+2]=s,s=s>>8,t[r+1]=s,s=s>>8,t[r]=s,r+8}P.prototype.writeBigUInt64LE=qr(function(e,r=0){return dy(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});P.prototype.writeBigUInt64BE=qr(function(e,r=0){return hy(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});P.prototype.writeIntLE=function(e,r,i,n){if(e=+e,r=r>>>0,!n){let u=Math.pow(2,8*i-1);qt(this,e,r,i,u-1,-u)}let o=0,s=1,c=0;for(this[r]=e&255;++o<i&&(s*=256);)e<0&&c===0&&this[r+o-1]!==0&&(c=1),this[r+o]=(e/s>>0)-c&255;return r+i};P.prototype.writeIntBE=function(e,r,i,n){if(e=+e,r=r>>>0,!n){let u=Math.pow(2,8*i-1);qt(this,e,r,i,u-1,-u)}let o=i-1,s=1,c=0;for(this[r+o]=e&255;--o>=0&&(s*=256);)e<0&&c===0&&this[r+o+1]!==0&&(c=1),this[r+o]=(e/s>>0)-c&255;return r+i};P.prototype.writeInt8=function(e,r,i){return e=+e,r=r>>>0,i||qt(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};P.prototype.writeInt16LE=function(e,r,i){return e=+e,r=r>>>0,i||qt(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};P.prototype.writeInt16BE=function(e,r,i){return e=+e,r=r>>>0,i||qt(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};P.prototype.writeInt32LE=function(e,r,i){return e=+e,r=r>>>0,i||qt(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};P.prototype.writeInt32BE=function(e,r,i){return e=+e,r=r>>>0,i||qt(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};P.prototype.writeBigInt64LE=qr(function(e,r=0){return dy(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});P.prototype.writeBigInt64BE=qr(function(e,r=0){return hy(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function py(t,e,r,i,n,o){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function my(t,e,r,i,n){return e=+e,r=r>>>0,n||py(t,e,r,4,34028234663852886e22,-34028234663852886e22),ci.write(t,e,r,i,23,4),r+4}P.prototype.writeFloatLE=function(e,r,i){return my(this,e,r,!0,i)};P.prototype.writeFloatBE=function(e,r,i){return my(this,e,r,!1,i)};function gy(t,e,r,i,n){return e=+e,r=r>>>0,n||py(t,e,r,8,17976931348623157e292,-17976931348623157e292),ci.write(t,e,r,i,52,8),r+8}P.prototype.writeDoubleLE=function(e,r,i){return gy(this,e,r,!0,i)};P.prototype.writeDoubleBE=function(e,r,i){return gy(this,e,r,!1,i)};P.prototype.copy=function(e,r,i,n){if(!P.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),r>=e.length&&(r=e.length),r||(r=0),n>0&&n<i&&(n=i),n===i||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-r<n-i&&(n=e.length-r+i);let o=n-i;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,i,n):Uint8Array.prototype.set.call(e,this.subarray(i,n),r),o};P.prototype.fill=function(e,r,i,n){if(typeof e=="string"){if(typeof r=="string"?(n=r,r=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!P.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(e.length===1){let s=e.charCodeAt(0);(n==="utf8"&&s<128||n==="latin1")&&(e=s)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(r<0||this.length<r||this.length<i)throw new RangeError("Out of range index");if(i<=r)return this;r=r>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);let o;if(typeof e=="number")for(o=r;o<i;++o)this[o]=e;else{let s=P.isBuffer(e)?e:P.from(e,n),c=s.length;if(c===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<i-r;++o)this[o+r]=s[o%c]}return this};var ai={};function dh(t,e,r){ai[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(n){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:n,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}dh("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);dh("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);dh("ERR_OUT_OF_RANGE",function(t,e,r){let i=`The value of "${t}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=sy(String(r)):typeof r=="bigint"&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=sy(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i},RangeError);function sy(t){let e="",r=t.length,i=t[0]==="-"?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function sS(t,e,r){ui(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&yo(e,t.length-(r+1))}function yy(t,e,r,i,n,o){if(t>r||t<e){let s=typeof e=="bigint"?"n":"",c;throw o>3?e===0||e===BigInt(0)?c=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`:c=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`:c=`>= ${e}${s} and <= ${r}${s}`,new ai.ERR_OUT_OF_RANGE("value",c,t)}sS(i,n,o)}function ui(t,e){if(typeof t!="number")throw new ai.ERR_INVALID_ARG_TYPE(e,"number",t)}function yo(t,e,r){throw Math.floor(t)!==t?(ui(t,r),new ai.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new ai.ERR_BUFFER_OUT_OF_BOUNDS:new ai.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}var aS=/[^+/0-9A-Za-z-_]/g;function cS(t){if(t=t.split("=")[0],t=t.trim().replace(aS,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function uh(t,e){e=e||1/0;let r,i=t.length,n=null,o=[];for(let s=0;s<i;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function uS(t){let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function lS(t,e){let r,i,n,o=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),i=r>>8,n=r%256,o.push(n),o.push(i);return o}function _y(t){return sh.toByteArray(cS(t))}function ga(t,e,r,i){let n;for(n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function yr(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function hh(t){return t!==t}var fS=function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let i=r*16;for(let n=0;n<16;++n)e[i+n]=t[r]+t[n]}return e}();function qr(t){return typeof BigInt>"u"?dS:t}function dS(){throw new Error("BigInt not supported")}});var My=Vt(()=>{});var Dh=Vt((jy,Uh)=>{(function(t,e){"use strict";function r(S,a){if(!S)throw new Error(a||"Assertion failed")}function i(S,a){S.super_=a;var f=function(){};f.prototype=a.prototype,S.prototype=new f,S.prototype.constructor=S}function n(S,a,f){if(n.isBN(S))return S;this.negative=0,this.words=null,this.length=0,this.red=null,S!==null&&((a==="le"||a==="be")&&(f=a,a=10),this._init(S||0,a||10,f||"be"))}typeof t=="object"?t.exports=n:e.BN=n,n.BN=n,n.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=My().Buffer}catch{}n.isBN=function(a){return a instanceof n?!0:a!==null&&typeof a=="object"&&a.constructor.wordSize===n.wordSize&&Array.isArray(a.words)},n.max=function(a,f){return a.cmp(f)>0?a:f},n.min=function(a,f){return a.cmp(f)<0?a:f},n.prototype._init=function(a,f,d){if(typeof a=="number")return this._initNumber(a,f,d);if(typeof a=="object")return this._initArray(a,f,d);f==="hex"&&(f=16),r(f===(f|0)&&f>=2&&f<=36),a=a.toString().replace(/\s+/g,"");var h=0;a[0]==="-"&&(h++,this.negative=1),h<a.length&&(f===16?this._parseHex(a,h,d):(this._parseBase(a,f,h),d==="le"&&this._initArray(this.toArray(),f,d)))},n.prototype._initNumber=function(a,f,d){a<0&&(this.negative=1,a=-a),a<67108864?(this.words=[a&67108863],this.length=1):a<4503599627370496?(this.words=[a&67108863,a/67108864&67108863],this.length=2):(r(a<9007199254740992),this.words=[a&67108863,a/67108864&67108863,1],this.length=3),d==="le"&&this._initArray(this.toArray(),f,d)},n.prototype._initArray=function(a,f,d){if(r(typeof a.length=="number"),a.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(a.length/3),this.words=new Array(this.length);for(var h=0;h<this.length;h++)this.words[h]=0;var y,x,k=0;if(d==="be")for(h=a.length-1,y=0;h>=0;h-=3)x=a[h]|a[h-1]<<8|a[h-2]<<16,this.words[y]|=x<<k&67108863,this.words[y+1]=x>>>26-k&67108863,k+=24,k>=26&&(k-=26,y++);else if(d==="le")for(h=0,y=0;h<a.length;h+=3)x=a[h]|a[h+1]<<8|a[h+2]<<16,this.words[y]|=x<<k&67108863,this.words[y+1]=x>>>26-k&67108863,k+=24,k>=26&&(k-=26,y++);return this._strip()};function s(S,a){var f=S.charCodeAt(a);if(f>=48&&f<=57)return f-48;if(f>=65&&f<=70)return f-55;if(f>=97&&f<=102)return f-87;r(!1,"Invalid character in "+S)}function c(S,a,f){var d=s(S,f);return f-1>=a&&(d|=s(S,f-1)<<4),d}n.prototype._parseHex=function(a,f,d){this.length=Math.ceil((a.length-f)/6),this.words=new Array(this.length);for(var h=0;h<this.length;h++)this.words[h]=0;var y=0,x=0,k;if(d==="be")for(h=a.length-1;h>=f;h-=2)k=c(a,f,h)<<y,this.words[x]|=k&67108863,y>=18?(y-=18,x+=1,this.words[x]|=k>>>26):y+=8;else{var b=a.length-f;for(h=b%2===0?f+1:f;h<a.length;h+=2)k=c(a,f,h)<<y,this.words[x]|=k&67108863,y>=18?(y-=18,x+=1,this.words[x]|=k>>>26):y+=8}this._strip()};function u(S,a,f,d){for(var h=0,y=0,x=Math.min(S.length,f),k=a;k<x;k++){var b=S.charCodeAt(k)-48;h*=d,b>=49?y=b-49+10:b>=17?y=b-17+10:y=b,r(b>=0&&y<d,"Invalid character"),h+=y}return h}n.prototype._parseBase=function(a,f,d){this.words=[0],this.length=1;for(var h=0,y=1;y<=67108863;y*=f)h++;h--,y=y/f|0;for(var x=a.length-d,k=x%h,b=Math.min(x,x-k)+d,l=0,v=d;v<b;v+=h)l=u(a,v,v+h,f),this.imuln(y),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(k!==0){var U=1;for(l=u(a,v,a.length,f),v=0;v<k;v++)U*=f;this.imuln(U),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this._strip()},n.prototype.copy=function(a){a.words=new Array(this.length);for(var f=0;f<this.length;f++)a.words[f]=this.words[f];a.length=this.length,a.negative=this.negative,a.red=this.red};function p(S,a){S.words=a.words,S.length=a.length,S.negative=a.negative,S.red=a.red}if(n.prototype._move=function(a){p(a,this)},n.prototype.clone=function(){var a=new n(null);return this.copy(a),a},n.prototype._expand=function(a){for(;this.length<a;)this.words[this.length++]=0;return this},n.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{n.prototype[Symbol.for("nodejs.util.inspect.custom")]=m}catch{n.prototype.inspect=m}else n.prototype.inspect=m;function m(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var _=["","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"],w=[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],g=[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];n.prototype.toString=function(a,f){a=a||10,f=f|0||1;var d;if(a===16||a==="hex"){d="";for(var h=0,y=0,x=0;x<this.length;x++){var k=this.words[x],b=((k<<h|y)&16777215).toString(16);y=k>>>24-h&16777215,h+=2,h>=26&&(h-=26,x--),y!==0||x!==this.length-1?d=_[6-b.length]+b+d:d=b+d}for(y!==0&&(d=y.toString(16)+d);d.length%f!==0;)d="0"+d;return this.negative!==0&&(d="-"+d),d}if(a===(a|0)&&a>=2&&a<=36){var l=w[a],v=g[a];d="";var U=this.clone();for(U.negative=0;!U.isZero();){var M=U.modrn(v).toString(a);U=U.idivn(v),U.isZero()?d=M+d:d=_[l-M.length]+M+d}for(this.isZero()&&(d="0"+d);d.length%f!==0;)d="0"+d;return this.negative!==0&&(d="-"+d),d}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var a=this.words[0];return this.length===2?a+=this.words[1]*67108864:this.length===3&&this.words[2]===1?a+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-a:a},n.prototype.toJSON=function(){return this.toString(16,2)},o&&(n.prototype.toBuffer=function(a,f){return this.toArrayLike(o,a,f)}),n.prototype.toArray=function(a,f){return this.toArrayLike(Array,a,f)};var A=function(a,f){return a.allocUnsafe?a.allocUnsafe(f):new a(f)};n.prototype.toArrayLike=function(a,f,d){this._strip();var h=this.byteLength(),y=d||Math.max(1,h);r(h<=y,"byte array longer than desired length"),r(y>0,"Requested array length <= 0");var x=A(a,y),k=f==="le"?"LE":"BE";return this["_toArrayLike"+k](x,h),x},n.prototype._toArrayLikeLE=function(a,f){for(var d=0,h=0,y=0,x=0;y<this.length;y++){var k=this.words[y]<<x|h;a[d++]=k&255,d<a.length&&(a[d++]=k>>8&255),d<a.length&&(a[d++]=k>>16&255),x===6?(d<a.length&&(a[d++]=k>>24&255),h=0,x=0):(h=k>>>24,x+=2)}if(d<a.length)for(a[d++]=h;d<a.length;)a[d++]=0},n.prototype._toArrayLikeBE=function(a,f){for(var d=a.length-1,h=0,y=0,x=0;y<this.length;y++){var k=this.words[y]<<x|h;a[d--]=k&255,d>=0&&(a[d--]=k>>8&255),d>=0&&(a[d--]=k>>16&255),x===6?(d>=0&&(a[d--]=k>>24&255),h=0,x=0):(h=k>>>24,x+=2)}if(d>=0)for(a[d--]=h;d>=0;)a[d--]=0},Math.clz32?n.prototype._countBits=function(a){return 32-Math.clz32(a)}:n.prototype._countBits=function(a){var f=a,d=0;return f>=4096&&(d+=13,f>>>=13),f>=64&&(d+=7,f>>>=7),f>=8&&(d+=4,f>>>=4),f>=2&&(d+=2,f>>>=2),d+f},n.prototype._zeroBits=function(a){if(a===0)return 26;var f=a,d=0;return(f&8191)===0&&(d+=13,f>>>=13),(f&127)===0&&(d+=7,f>>>=7),(f&15)===0&&(d+=4,f>>>=4),(f&3)===0&&(d+=2,f>>>=2),(f&1)===0&&d++,d},n.prototype.bitLength=function(){var a=this.words[this.length-1],f=this._countBits(a);return(this.length-1)*26+f};function I(S){for(var a=new Array(S.bitLength()),f=0;f<a.length;f++){var d=f/26|0,h=f%26;a[f]=S.words[d]>>>h&1}return a}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var a=0,f=0;f<this.length;f++){var d=this._zeroBits(this.words[f]);if(a+=d,d!==26)break}return a},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(a){return this.negative!==0?this.abs().inotn(a).iaddn(1):this.clone()},n.prototype.fromTwos=function(a){return this.testn(a-1)?this.notn(a).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return this.negative!==0},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(a){for(;this.length<a.length;)this.words[this.length++]=0;for(var f=0;f<a.length;f++)this.words[f]=this.words[f]|a.words[f];return this._strip()},n.prototype.ior=function(a){return r((this.negative|a.negative)===0),this.iuor(a)},n.prototype.or=function(a){return this.length>a.length?this.clone().ior(a):a.clone().ior(this)},n.prototype.uor=function(a){return this.length>a.length?this.clone().iuor(a):a.clone().iuor(this)},n.prototype.iuand=function(a){var f;this.length>a.length?f=a:f=this;for(var d=0;d<f.length;d++)this.words[d]=this.words[d]&a.words[d];return this.length=f.length,this._strip()},n.prototype.iand=function(a){return r((this.negative|a.negative)===0),this.iuand(a)},n.prototype.and=function(a){return this.length>a.length?this.clone().iand(a):a.clone().iand(this)},n.prototype.uand=function(a){return this.length>a.length?this.clone().iuand(a):a.clone().iuand(this)},n.prototype.iuxor=function(a){var f,d;this.length>a.length?(f=this,d=a):(f=a,d=this);for(var h=0;h<d.length;h++)this.words[h]=f.words[h]^d.words[h];if(this!==f)for(;h<f.length;h++)this.words[h]=f.words[h];return this.length=f.length,this._strip()},n.prototype.ixor=function(a){return r((this.negative|a.negative)===0),this.iuxor(a)},n.prototype.xor=function(a){return this.length>a.length?this.clone().ixor(a):a.clone().ixor(this)},n.prototype.uxor=function(a){return this.length>a.length?this.clone().iuxor(a):a.clone().iuxor(this)},n.prototype.inotn=function(a){r(typeof a=="number"&&a>=0);var f=Math.ceil(a/26)|0,d=a%26;this._expand(f),d>0&&f--;for(var h=0;h<f;h++)this.words[h]=~this.words[h]&67108863;return d>0&&(this.words[h]=~this.words[h]&67108863>>26-d),this._strip()},n.prototype.notn=function(a){return this.clone().inotn(a)},n.prototype.setn=function(a,f){r(typeof a=="number"&&a>=0);var d=a/26|0,h=a%26;return this._expand(d+1),f?this.words[d]=this.words[d]|1<<h:this.words[d]=this.words[d]&~(1<<h),this._strip()},n.prototype.iadd=function(a){var f;if(this.negative!==0&&a.negative===0)return this.negative=0,f=this.isub(a),this.negative^=1,this._normSign();if(this.negative===0&&a.negative!==0)return a.negative=0,f=this.isub(a),a.negative=1,f._normSign();var d,h;this.length>a.length?(d=this,h=a):(d=a,h=this);for(var y=0,x=0;x<h.length;x++)f=(d.words[x]|0)+(h.words[x]|0)+y,this.words[x]=f&67108863,y=f>>>26;for(;y!==0&&x<d.length;x++)f=(d.words[x]|0)+y,this.words[x]=f&67108863,y=f>>>26;if(this.length=d.length,y!==0)this.words[this.length]=y,this.length++;else if(d!==this)for(;x<d.length;x++)this.words[x]=d.words[x];return this},n.prototype.add=function(a){var f;return a.negative!==0&&this.negative===0?(a.negative=0,f=this.sub(a),a.negative^=1,f):a.negative===0&&this.negative!==0?(this.negative=0,f=a.sub(this),this.negative=1,f):this.length>a.length?this.clone().iadd(a):a.clone().iadd(this)},n.prototype.isub=function(a){if(a.negative!==0){a.negative=0;var f=this.iadd(a);return a.negative=1,f._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(a),this.negative=1,this._normSign();var d=this.cmp(a);if(d===0)return this.negative=0,this.length=1,this.words[0]=0,this;var h,y;d>0?(h=this,y=a):(h=a,y=this);for(var x=0,k=0;k<y.length;k++)f=(h.words[k]|0)-(y.words[k]|0)+x,x=f>>26,this.words[k]=f&67108863;for(;x!==0&&k<h.length;k++)f=(h.words[k]|0)+x,x=f>>26,this.words[k]=f&67108863;if(x===0&&k<h.length&&h!==this)for(;k<h.length;k++)this.words[k]=h.words[k];return this.length=Math.max(this.length,k),h!==this&&(this.negative=1),this._strip()},n.prototype.sub=function(a){return this.clone().isub(a)};function R(S,a,f){f.negative=a.negative^S.negative;var d=S.length+a.length|0;f.length=d,d=d-1|0;var h=S.words[0]|0,y=a.words[0]|0,x=h*y,k=x&67108863,b=x/67108864|0;f.words[0]=k;for(var l=1;l<d;l++){for(var v=b>>>26,U=b&67108863,M=Math.min(l,a.length-1),Z=Math.max(0,l-S.length+1);Z<=M;Z++){var te=l-Z|0;h=S.words[te]|0,y=a.words[Z]|0,x=h*y+U,v+=x/67108864|0,U=x&67108863}f.words[l]=U|0,b=v|0}return b!==0?f.words[l]=b|0:f.length--,f._strip()}var T=function(a,f,d){var h=a.words,y=f.words,x=d.words,k=0,b,l,v,U=h[0]|0,M=U&8191,Z=U>>>13,te=h[1]|0,oe=te&8191,ue=te>>>13,Le=h[2]|0,de=Le&8191,pe=Le>>>13,Yt=h[3]|0,Se=Yt&8191,Ne=Yt>>>13,as=h[4]|0,qe=as&8191,He=as>>>13,cs=h[5]|0,Ue=cs&8191,De=cs>>>13,qn=h[6]|0,Me=qn&8191,je=qn>>>13,Oi=h[7]|0,Fe=Oi&8191,Ze=Oi>>>13,us=h[8]|0,Ge=us&8191,Je=us>>>13,ls=h[9]|0,Qe=ls&8191,et=ls>>>13,Sm=y[0]|0,tt=Sm&8191,rt=Sm>>>13,Em=y[1]|0,nt=Em&8191,it=Em>>>13,Im=y[2]|0,ot=Im&8191,st=Im>>>13,Rm=y[3]|0,at=Rm&8191,ct=Rm>>>13,km=y[4]|0,ut=km&8191,lt=km>>>13,Am=y[5]|0,ft=Am&8191,dt=Am>>>13,Om=y[6]|0,ht=Om&8191,pt=Om>>>13,Nm=y[7]|0,mt=Nm&8191,gt=Nm>>>13,Tm=y[8]|0,yt=Tm&8191,_t=Tm>>>13,$m=y[9]|0,bt=$m&8191,vt=$m>>>13;d.negative=a.negative^f.negative,d.length=19,b=Math.imul(M,tt),l=Math.imul(M,rt),l=l+Math.imul(Z,tt)|0,v=Math.imul(Z,rt);var Mc=(k+b|0)+((l&8191)<<13)|0;k=(v+(l>>>13)|0)+(Mc>>>26)|0,Mc&=67108863,b=Math.imul(oe,tt),l=Math.imul(oe,rt),l=l+Math.imul(ue,tt)|0,v=Math.imul(ue,rt),b=b+Math.imul(M,nt)|0,l=l+Math.imul(M,it)|0,l=l+Math.imul(Z,nt)|0,v=v+Math.imul(Z,it)|0;var jc=(k+b|0)+((l&8191)<<13)|0;k=(v+(l>>>13)|0)+(jc>>>26)|0,jc&=67108863,b=Math.imul(de,tt),l=Math.imul(de,rt),l=l+Math.imul(pe,tt)|0,v=Math.imul(pe,rt),b=b+Math.imul(oe,nt)|0,l=l+Math.imul(oe,it)|0,l=l+Math.imul(ue,nt)|0,v=v+Math.imul(ue,it)|0,b=b+Math.imul(M,ot)|0,l=l+Math.imul(M,st)|0,l=l+Math.imul(Z,ot)|0,v=v+Math.imul(Z,st)|0;var Fc=(k+b|0)+((l&8191)<<13)|0;k=(v+(l>>>13)|0)+(Fc>>>26)|0,Fc&=67108863,b=Math.imul(Se,tt),l=Math.imul(Se,rt),l=l+Math.imul(Ne,tt)|0,v=Math.imul(Ne,rt),b=b+Math.imul(de,nt)|0,l=l+Math.imul(de,it)|0,l=l+Math.imul(pe,nt)|0,v=v+Math.imul(pe,it)|0,b=b+Math.imul(oe,ot)|0,l=l+Math.imul(oe,st)|0,l=l+Math.imul(ue,ot)|0,v=v+Math.imul(ue,st)|0,b=b+Math.imul(M,at)|0,l=l+Math.imul(M,ct)|0,l=l+Math.imul(Z,at)|0,v=v+Math.imul(Z,ct)|0;var Zc=(k+b|0)+((l&8191)<<13)|0;k=(v+(l>>>13)|0)+(Zc>>>26)|0,Zc&=67108863,b=Math.imul(qe,tt),l=Math.imul(qe,rt),l=l+Math.imul(He,tt)|0,v=Math.imul(He,rt),b=b+Math.imul(Se,nt)|0,l=l+Math.imul(Se,it)|0,l=l+Math.imul(Ne,nt)|0,v=v+Math.imul(Ne,it)|0,b=b+Math.imul(de,ot)|0,l=l+Math.imul(de,st)|0,l=l+Math.imul(pe,ot)|0,v=v+Math.imul(pe,st)|0,b=b+Math.imul(oe,at)|0,l=l+Math.imul(oe,ct)|0,l=l+Math.imul(ue,at)|0,v=v+Math.imul(ue,ct)|0,b=b+Math.imul(M,ut)|0,l=l+Math.imul(M,lt)|0,l=l+Math.imul(Z,ut)|0,v=v+Math.imul(Z,lt)|0;var Vc=(k+b|0)+((l&8191)<<13)|0;k=(v+(l>>>13)|0)+(Vc>>>26)|0,Vc&=67108863,b=Math.imul(Ue,tt),l=Math.imul(Ue,rt),l=l+Math.imul(De,tt)|0,v=Math.imul(De,rt),b=b+Math.imul(qe,nt)|0,l=l+Math.imul(qe,it)|0,l=l+Math.imul(He,nt)|0,v=v+Math.imul(He,it)|0,b=b+Math.imul(Se,ot)|0,l=l+Math.imul(Se,st)|0,l=l+Math.imul(Ne,ot)|0,v=v+Math.imul(Ne,st)|0,b=b+Math.imul(de,at)|0,l=l+Math.imul(de,ct)|0,l=l+Math.imul(pe,at)|0,v=v+Math.imul(pe,ct)|0,b=b+Math.imul(oe,ut)|0,l=l+Math.imul(oe,lt)|0,l=l+Math.imul(ue,ut)|0,v=v+Math.imul(ue,lt)|0,b=b+Math.imul(M,ft)|0,l=l+Math.imul(M,dt)|0,l=l+Math.imul(Z,ft)|0,v=v+Math.imul(Z,dt)|0;var Wc=(k+b|0)+((l&8191)<<13)|0;k=(v+(l>>>13)|0)+(Wc>>>26)|0,Wc&=67108863,b=Math.imul(Me,tt),l=Math.imul(Me,rt),l=l+Math.imul(je,tt)|0,v=Math.imul(je,rt),b=b+Math.imul(Ue,nt)|0,l=l+Math.imul(Ue,it)|0,l=l+Math.imul(De,nt)|0,v=v+Math.imul(De,it)|0,b=b+Math.imul(qe,ot)|0,l=l+Math.imul(qe,st)|0,l=l+Math.imul(He,ot)|0,v=v+Math.imul(He,st)|0,b=b+Math.imul(Se,at)|0,l=l+Math.imul(Se,ct)|0,l=l+Math.imul(Ne,at)|0,v=v+Math.imul(Ne,ct)|0,b=b+Math.imul(de,ut)|0,l=l+Math.imul(de,lt)|0,l=l+Math.imul(pe,ut)|0,v=v+Math.imul(pe,lt)|0,b=b+Math.imul(oe,ft)|0,l=l+Math.imul(oe,dt)|0,l=l+Math.imul(ue,ft)|0,v=v+Math.imul(ue,dt)|0,b=b+Math.imul(M,ht)|0,l=l+Math.imul(M,pt)|0,l=l+Math.imul(Z,ht)|0,v=v+Math.imul(Z,pt)|0;var Kc=(k+b|0)+((l&8191)<<13)|0;k=(v+(l>>>13)|0)+(Kc>>>26)|0,Kc&=67108863,b=Math.imul(Fe,tt),l=Math.imul(Fe,rt),l=l+Math.imul(Ze,tt)|0,v=Math.imul(Ze,rt),b=b+Math.imul(Me,nt)|0,l=l+Math.imul(Me,it)|0,l=l+Math.imul(je,nt)|0,v=v+Math.imul(je,it)|0,b=b+Math.imul(Ue,ot)|0,l=l+Math.imul(Ue,st)|0,l=l+Math.imul(De,ot)|0,v=v+Math.imul(De,st)|0,b=b+Math.imul(qe,at)|0,l=l+Math.imul(qe,ct)|0,l=l+Math.imul(He,at)|0,v=v+Math.imul(He,ct)|0,b=b+Math.imul(Se,ut)|0,l=l+Math.imul(Se,lt)|0,l=l+Math.imul(Ne,ut)|0,v=v+Math.imul(Ne,lt)|0,b=b+Math.imul(de,ft)|0,l=l+Math.imul(de,dt)|0,l=l+Math.imul(pe,ft)|0,v=v+Math.imul(pe,dt)|0,b=b+Math.imul(oe,ht)|0,l=l+Math.imul(oe,pt)|0,l=l+Math.imul(ue,ht)|0,v=v+Math.imul(ue,pt)|0,b=b+Math.imul(M,mt)|0,l=l+Math.imul(M,gt)|0,l=l+Math.imul(Z,mt)|0,v=v+Math.imul(Z,gt)|0;var qc=(k+b|0)+((l&8191)<<13)|0;k=(v+(l>>>13)|0)+(qc>>>26)|0,qc&=67108863,b=Math.imul(Ge,tt),l=Math.imul(Ge,rt),l=l+Math.imul(Je,tt)|0,v=Math.imul(Je,rt),b=b+Math.imul(Fe,nt)|0,l=l+Math.imul(Fe,it)|0,l=l+Math.imul(Ze,nt)|0,v=v+Math.imul(Ze,it)|0,b=b+Math.imul(Me,ot)|0,l=l+Math.imul(Me,st)|0,l=l+Math.imul(je,ot)|0,v=v+Math.imul(je,st)|0,b=b+Math.imul(Ue,at)|0,l=l+Math.imul(Ue,ct)|0,l=l+Math.imul(De,at)|0,v=v+Math.imul(De,ct)|0,b=b+Math.imul(qe,ut)|0,l=l+Math.imul(qe,lt)|0,l=l+Math.imul(He,ut)|0,v=v+Math.imul(He,lt)|0,b=b+Math.imul(Se,ft)|0,l=l+Math.imul(Se,dt)|0,l=l+Math.imul(Ne,ft)|0,v=v+Math.imul(Ne,dt)|0,b=b+Math.imul(de,ht)|0,l=l+Math.imul(de,pt)|0,l=l+Math.imul(pe,ht)|0,v=v+Math.imul(pe,pt)|0,b=b+Math.imul(oe,mt)|0,l=l+Math.imul(oe,gt)|0,l=l+Math.imul(ue,mt)|0,v=v+Math.imul(ue,gt)|0,b=b+Math.imul(M,yt)|0,l=l+Math.imul(M,_t)|0,l=l+Math.imul(Z,yt)|0,v=v+Math.imul(Z,_t)|0;var Hc=(k+b|0)+((l&8191)<<13)|0;k=(v+(l>>>13)|0)+(Hc>>>26)|0,Hc&=67108863,b=Math.imul(Qe,tt),l=Math.imul(Qe,rt),l=l+Math.imul(et,tt)|0,v=Math.imul(et,rt),b=b+Math.imul(Ge,nt)|0,l=l+Math.imul(Ge,it)|0,l=l+Math.imul(Je,nt)|0,v=v+Math.imul(Je,it)|0,b=b+Math.imul(Fe,ot)|0,l=l+Math.imul(Fe,st)|0,l=l+Math.imul(Ze,ot)|0,v=v+Math.imul(Ze,st)|0,b=b+Math.imul(Me,at)|0,l=l+Math.imul(Me,ct)|0,l=l+Math.imul(je,at)|0,v=v+Math.imul(je,ct)|0,b=b+Math.imul(Ue,ut)|0,l=l+Math.imul(Ue,lt)|0,l=l+Math.imul(De,ut)|0,v=v+Math.imul(De,lt)|0,b=b+Math.imul(qe,ft)|0,l=l+Math.imul(qe,dt)|0,l=l+Math.imul(He,ft)|0,v=v+Math.imul(He,dt)|0,b=b+Math.imul(Se,ht)|0,l=l+Math.imul(Se,pt)|0,l=l+Math.imul(Ne,ht)|0,v=v+Math.imul(Ne,pt)|0,b=b+Math.imul(de,mt)|0,l=l+Math.imul(de,gt)|0,l=l+Math.imul(pe,mt)|0,v=v+Math.imul(pe,gt)|0,b=b+Math.imul(oe,yt)|0,l=l+Math.imul(oe,_t)|0,l=l+Math.imul(ue,yt)|0,v=v+Math.imul(ue,_t)|0,b=b+Math.imul(M,bt)|0,l=l+Math.imul(M,vt)|0,l=l+Math.imul(Z,bt)|0,v=v+Math.imul(Z,vt)|0;var Gc=(k+b|0)+((l&8191)<<13)|0;k=(v+(l>>>13)|0)+(Gc>>>26)|0,Gc&=67108863,b=Math.imul(Qe,nt),l=Math.imul(Qe,it),l=l+Math.imul(et,nt)|0,v=Math.imul(et,it),b=b+Math.imul(Ge,ot)|0,l=l+Math.imul(Ge,st)|0,l=l+Math.imul(Je,ot)|0,v=v+Math.imul(Je,st)|0,b=b+Math.imul(Fe,at)|0,l=l+Math.imul(Fe,ct)|0,l=l+Math.imul(Ze,at)|0,v=v+Math.imul(Ze,ct)|0,b=b+Math.imul(Me,ut)|0,l=l+Math.imul(Me,lt)|0,l=l+Math.imul(je,ut)|0,v=v+Math.imul(je,lt)|0,b=b+Math.imul(Ue,ft)|0,l=l+Math.imul(Ue,dt)|0,l=l+Math.imul(De,ft)|0,v=v+Math.imul(De,dt)|0,b=b+Math.imul(qe,ht)|0,l=l+Math.imul(qe,pt)|0,l=l+Math.imul(He,ht)|0,v=v+Math.imul(He,pt)|0,b=b+Math.imul(Se,mt)|0,l=l+Math.imul(Se,gt)|0,l=l+Math.imul(Ne,mt)|0,v=v+Math.imul(Ne,gt)|0,b=b+Math.imul(de,yt)|0,l=l+Math.imul(de,_t)|0,l=l+Math.imul(pe,yt)|0,v=v+Math.imul(pe,_t)|0,b=b+Math.imul(oe,bt)|0,l=l+Math.imul(oe,vt)|0,l=l+Math.imul(ue,bt)|0,v=v+Math.imul(ue,vt)|0;var Jc=(k+b|0)+((l&8191)<<13)|0;k=(v+(l>>>13)|0)+(Jc>>>26)|0,Jc&=67108863,b=Math.imul(Qe,ot),l=Math.imul(Qe,st),l=l+Math.imul(et,ot)|0,v=Math.imul(et,st),b=b+Math.imul(Ge,at)|0,l=l+Math.imul(Ge,ct)|0,l=l+Math.imul(Je,at)|0,v=v+Math.imul(Je,ct)|0,b=b+Math.imul(Fe,ut)|0,l=l+Math.imul(Fe,lt)|0,l=l+Math.imul(Ze,ut)|0,v=v+Math.imul(Ze,lt)|0,b=b+Math.imul(Me,ft)|0,l=l+Math.imul(Me,dt)|0,l=l+Math.imul(je,ft)|0,v=v+Math.imul(je,dt)|0,b=b+Math.imul(Ue,ht)|0,l=l+Math.imul(Ue,pt)|0,l=l+Math.imul(De,ht)|0,v=v+Math.imul(De,pt)|0,b=b+Math.imul(qe,mt)|0,l=l+Math.imul(qe,gt)|0,l=l+Math.imul(He,mt)|0,v=v+Math.imul(He,gt)|0,b=b+Math.imul(Se,yt)|0,l=l+Math.imul(Se,_t)|0,l=l+Math.imul(Ne,yt)|0,v=v+Math.imul(Ne,_t)|0,b=b+Math.imul(de,bt)|0,l=l+Math.imul(de,vt)|0,l=l+Math.imul(pe,bt)|0,v=v+Math.imul(pe,vt)|0;var Yc=(k+b|0)+((l&8191)<<13)|0;k=(v+(l>>>13)|0)+(Yc>>>26)|0,Yc&=67108863,b=Math.imul(Qe,at),l=Math.imul(Qe,ct),l=l+Math.imul(et,at)|0,v=Math.imul(et,ct),b=b+Math.imul(Ge,ut)|0,l=l+Math.imul(Ge,lt)|0,l=l+Math.imul(Je,ut)|0,v=v+Math.imul(Je,lt)|0,b=b+Math.imul(Fe,ft)|0,l=l+Math.imul(Fe,dt)|0,l=l+Math.imul(Ze,ft)|0,v=v+Math.imul(Ze,dt)|0,b=b+Math.imul(Me,ht)|0,l=l+Math.imul(Me,pt)|0,l=l+Math.imul(je,ht)|0,v=v+Math.imul(je,pt)|0,b=b+Math.imul(Ue,mt)|0,l=l+Math.imul(Ue,gt)|0,l=l+Math.imul(De,mt)|0,v=v+Math.imul(De,gt)|0,b=b+Math.imul(qe,yt)|0,l=l+Math.imul(qe,_t)|0,l=l+Math.imul(He,yt)|0,v=v+Math.imul(He,_t)|0,b=b+Math.imul(Se,bt)|0,l=l+Math.imul(Se,vt)|0,l=l+Math.imul(Ne,bt)|0,v=v+Math.imul(Ne,vt)|0;var Xc=(k+b|0)+((l&8191)<<13)|0;k=(v+(l>>>13)|0)+(Xc>>>26)|0,Xc&=67108863,b=Math.imul(Qe,ut),l=Math.imul(Qe,lt),l=l+Math.imul(et,ut)|0,v=Math.imul(et,lt),b=b+Math.imul(Ge,ft)|0,l=l+Math.imul(Ge,dt)|0,l=l+Math.imul(Je,ft)|0,v=v+Math.imul(Je,dt)|0,b=b+Math.imul(Fe,ht)|0,l=l+Math.imul(Fe,pt)|0,l=l+Math.imul(Ze,ht)|0,v=v+Math.imul(Ze,pt)|0,b=b+Math.imul(Me,mt)|0,l=l+Math.imul(Me,gt)|0,l=l+Math.imul(je,mt)|0,v=v+Math.imul(je,gt)|0,b=b+Math.imul(Ue,yt)|0,l=l+Math.imul(Ue,_t)|0,l=l+Math.imul(De,yt)|0,v=v+Math.imul(De,_t)|0,b=b+Math.imul(qe,bt)|0,l=l+Math.imul(qe,vt)|0,l=l+Math.imul(He,bt)|0,v=v+Math.imul(He,vt)|0;var Qc=(k+b|0)+((l&8191)<<13)|0;k=(v+(l>>>13)|0)+(Qc>>>26)|0,Qc&=67108863,b=Math.imul(Qe,ft),l=Math.imul(Qe,dt),l=l+Math.imul(et,ft)|0,v=Math.imul(et,dt),b=b+Math.imul(Ge,ht)|0,l=l+Math.imul(Ge,pt)|0,l=l+Math.imul(Je,ht)|0,v=v+Math.imul(Je,pt)|0,b=b+Math.imul(Fe,mt)|0,l=l+Math.imul(Fe,gt)|0,l=l+Math.imul(Ze,mt)|0,v=v+Math.imul(Ze,gt)|0,b=b+Math.imul(Me,yt)|0,l=l+Math.imul(Me,_t)|0,l=l+Math.imul(je,yt)|0,v=v+Math.imul(je,_t)|0,b=b+Math.imul(Ue,bt)|0,l=l+Math.imul(Ue,vt)|0,l=l+Math.imul(De,bt)|0,v=v+Math.imul(De,vt)|0;var eu=(k+b|0)+((l&8191)<<13)|0;k=(v+(l>>>13)|0)+(eu>>>26)|0,eu&=67108863,b=Math.imul(Qe,ht),l=Math.imul(Qe,pt),l=l+Math.imul(et,ht)|0,v=Math.imul(et,pt),b=b+Math.imul(Ge,mt)|0,l=l+Math.imul(Ge,gt)|0,l=l+Math.imul(Je,mt)|0,v=v+Math.imul(Je,gt)|0,b=b+Math.imul(Fe,yt)|0,l=l+Math.imul(Fe,_t)|0,l=l+Math.imul(Ze,yt)|0,v=v+Math.imul(Ze,_t)|0,b=b+Math.imul(Me,bt)|0,l=l+Math.imul(Me,vt)|0,l=l+Math.imul(je,bt)|0,v=v+Math.imul(je,vt)|0;var tu=(k+b|0)+((l&8191)<<13)|0;k=(v+(l>>>13)|0)+(tu>>>26)|0,tu&=67108863,b=Math.imul(Qe,mt),l=Math.imul(Qe,gt),l=l+Math.imul(et,mt)|0,v=Math.imul(et,gt),b=b+Math.imul(Ge,yt)|0,l=l+Math.imul(Ge,_t)|0,l=l+Math.imul(Je,yt)|0,v=v+Math.imul(Je,_t)|0,b=b+Math.imul(Fe,bt)|0,l=l+Math.imul(Fe,vt)|0,l=l+Math.imul(Ze,bt)|0,v=v+Math.imul(Ze,vt)|0;var ru=(k+b|0)+((l&8191)<<13)|0;k=(v+(l>>>13)|0)+(ru>>>26)|0,ru&=67108863,b=Math.imul(Qe,yt),l=Math.imul(Qe,_t),l=l+Math.imul(et,yt)|0,v=Math.imul(et,_t),b=b+Math.imul(Ge,bt)|0,l=l+Math.imul(Ge,vt)|0,l=l+Math.imul(Je,bt)|0,v=v+Math.imul(Je,vt)|0;var nu=(k+b|0)+((l&8191)<<13)|0;k=(v+(l>>>13)|0)+(nu>>>26)|0,nu&=67108863,b=Math.imul(Qe,bt),l=Math.imul(Qe,vt),l=l+Math.imul(et,bt)|0,v=Math.imul(et,vt);var iu=(k+b|0)+((l&8191)<<13)|0;return k=(v+(l>>>13)|0)+(iu>>>26)|0,iu&=67108863,x[0]=Mc,x[1]=jc,x[2]=Fc,x[3]=Zc,x[4]=Vc,x[5]=Wc,x[6]=Kc,x[7]=qc,x[8]=Hc,x[9]=Gc,x[10]=Jc,x[11]=Yc,x[12]=Xc,x[13]=Qc,x[14]=eu,x[15]=tu,x[16]=ru,x[17]=nu,x[18]=iu,k!==0&&(x[19]=k,d.length++),d};Math.imul||(T=R);function B(S,a,f){f.negative=a.negative^S.negative,f.length=S.length+a.length;for(var d=0,h=0,y=0;y<f.length-1;y++){var x=h;h=0;for(var k=d&67108863,b=Math.min(y,a.length-1),l=Math.max(0,y-S.length+1);l<=b;l++){var v=y-l,U=S.words[v]|0,M=a.words[l]|0,Z=U*M,te=Z&67108863;x=x+(Z/67108864|0)|0,te=te+k|0,k=te&67108863,x=x+(te>>>26)|0,h+=x>>>26,x&=67108863}f.words[y]=k,d=x,x=h}return d!==0?f.words[y]=d:f.length--,f._strip()}function $(S,a,f){return B(S,a,f)}n.prototype.mulTo=function(a,f){var d,h=this.length+a.length;return this.length===10&&a.length===10?d=T(this,a,f):h<63?d=R(this,a,f):h<1024?d=B(this,a,f):d=$(this,a,f),d};function C(S,a){this.x=S,this.y=a}C.prototype.makeRBT=function(a){for(var f=new Array(a),d=n.prototype._countBits(a)-1,h=0;h<a;h++)f[h]=this.revBin(h,d,a);return f},C.prototype.revBin=function(a,f,d){if(a===0||a===d-1)return a;for(var h=0,y=0;y<f;y++)h|=(a&1)<<f-y-1,a>>=1;return h},C.prototype.permute=function(a,f,d,h,y,x){for(var k=0;k<x;k++)h[k]=f[a[k]],y[k]=d[a[k]]},C.prototype.transform=function(a,f,d,h,y,x){this.permute(x,a,f,d,h,y);for(var k=1;k<y;k<<=1)for(var b=k<<1,l=Math.cos(2*Math.PI/b),v=Math.sin(2*Math.PI/b),U=0;U<y;U+=b)for(var M=l,Z=v,te=0;te<k;te++){var oe=d[U+te],ue=h[U+te],Le=d[U+te+k],de=h[U+te+k],pe=M*Le-Z*de;de=M*de+Z*Le,Le=pe,d[U+te]=oe+Le,h[U+te]=ue+de,d[U+te+k]=oe-Le,h[U+te+k]=ue-de,te!==b&&(pe=l*M-v*Z,Z=l*Z+v*M,M=pe)}},C.prototype.guessLen13b=function(a,f){var d=Math.max(f,a)|1,h=d&1,y=0;for(d=d/2|0;d;d=d>>>1)y++;return 1<<y+1+h},C.prototype.conjugate=function(a,f,d){if(!(d<=1))for(var h=0;h<d/2;h++){var y=a[h];a[h]=a[d-h-1],a[d-h-1]=y,y=f[h],f[h]=-f[d-h-1],f[d-h-1]=-y}},C.prototype.normalize13b=function(a,f){for(var d=0,h=0;h<f/2;h++){var y=Math.round(a[2*h+1]/f)*8192+Math.round(a[2*h]/f)+d;a[h]=y&67108863,y<67108864?d=0:d=y/67108864|0}return a},C.prototype.convert13b=function(a,f,d,h){for(var y=0,x=0;x<f;x++)y=y+(a[x]|0),d[2*x]=y&8191,y=y>>>13,d[2*x+1]=y&8191,y=y>>>13;for(x=2*f;x<h;++x)d[x]=0;r(y===0),r((y&-8192)===0)},C.prototype.stub=function(a){for(var f=new Array(a),d=0;d<a;d++)f[d]=0;return f},C.prototype.mulp=function(a,f,d){var h=2*this.guessLen13b(a.length,f.length),y=this.makeRBT(h),x=this.stub(h),k=new Array(h),b=new Array(h),l=new Array(h),v=new Array(h),U=new Array(h),M=new Array(h),Z=d.words;Z.length=h,this.convert13b(a.words,a.length,k,h),this.convert13b(f.words,f.length,v,h),this.transform(k,x,b,l,h,y),this.transform(v,x,U,M,h,y);for(var te=0;te<h;te++){var oe=b[te]*U[te]-l[te]*M[te];l[te]=b[te]*M[te]+l[te]*U[te],b[te]=oe}return this.conjugate(b,l,h),this.transform(b,l,Z,x,h,y),this.conjugate(Z,x,h),this.normalize13b(Z,h),d.negative=a.negative^f.negative,d.length=a.length+f.length,d._strip()},n.prototype.mul=function(a){var f=new n(null);return f.words=new Array(this.length+a.length),this.mulTo(a,f)},n.prototype.mulf=function(a){var f=new n(null);return f.words=new Array(this.length+a.length),$(this,a,f)},n.prototype.imul=function(a){return this.clone().mulTo(a,this)},n.prototype.imuln=function(a){var f=a<0;f&&(a=-a),r(typeof a=="number"),r(a<67108864);for(var d=0,h=0;h<this.length;h++){var y=(this.words[h]|0)*a,x=(y&67108863)+(d&67108863);d>>=26,d+=y/67108864|0,d+=x>>>26,this.words[h]=x&67108863}return d!==0&&(this.words[h]=d,this.length++),f?this.ineg():this},n.prototype.muln=function(a){return this.clone().imuln(a)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(a){var f=I(a);if(f.length===0)return new n(1);for(var d=this,h=0;h<f.length&&f[h]===0;h++,d=d.sqr());if(++h<f.length)for(var y=d.sqr();h<f.length;h++,y=y.sqr())f[h]!==0&&(d=d.mul(y));return d},n.prototype.iushln=function(a){r(typeof a=="number"&&a>=0);var f=a%26,d=(a-f)/26,h=67108863>>>26-f<<26-f,y;if(f!==0){var x=0;for(y=0;y<this.length;y++){var k=this.words[y]&h,b=(this.words[y]|0)-k<<f;this.words[y]=b|x,x=k>>>26-f}x&&(this.words[y]=x,this.length++)}if(d!==0){for(y=this.length-1;y>=0;y--)this.words[y+d]=this.words[y];for(y=0;y<d;y++)this.words[y]=0;this.length+=d}return this._strip()},n.prototype.ishln=function(a){return r(this.negative===0),this.iushln(a)},n.prototype.iushrn=function(a,f,d){r(typeof a=="number"&&a>=0);var h;f?h=(f-f%26)/26:h=0;var y=a%26,x=Math.min((a-y)/26,this.length),k=67108863^67108863>>>y<<y,b=d;if(h-=x,h=Math.max(0,h),b){for(var l=0;l<x;l++)b.words[l]=this.words[l];b.length=x}if(x!==0)if(this.length>x)for(this.length-=x,l=0;l<this.length;l++)this.words[l]=this.words[l+x];else this.words[0]=0,this.length=1;var v=0;for(l=this.length-1;l>=0&&(v!==0||l>=h);l--){var U=this.words[l]|0;this.words[l]=v<<26-y|U>>>y,v=U&k}return b&&v!==0&&(b.words[b.length++]=v),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},n.prototype.ishrn=function(a,f,d){return r(this.negative===0),this.iushrn(a,f,d)},n.prototype.shln=function(a){return this.clone().ishln(a)},n.prototype.ushln=function(a){return this.clone().iushln(a)},n.prototype.shrn=function(a){return this.clone().ishrn(a)},n.prototype.ushrn=function(a){return this.clone().iushrn(a)},n.prototype.testn=function(a){r(typeof a=="number"&&a>=0);var f=a%26,d=(a-f)/26,h=1<<f;if(this.length<=d)return!1;var y=this.words[d];return!!(y&h)},n.prototype.imaskn=function(a){r(typeof a=="number"&&a>=0);var f=a%26,d=(a-f)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=d)return this;if(f!==0&&d++,this.length=Math.min(d,this.length),f!==0){var h=67108863^67108863>>>f<<f;this.words[this.length-1]&=h}return this._strip()},n.prototype.maskn=function(a){return this.clone().imaskn(a)},n.prototype.iaddn=function(a){return r(typeof a=="number"),r(a<67108864),a<0?this.isubn(-a):this.negative!==0?this.length===1&&(this.words[0]|0)<=a?(this.words[0]=a-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(a),this.negative=1,this):this._iaddn(a)},n.prototype._iaddn=function(a){this.words[0]+=a;for(var f=0;f<this.length&&this.words[f]>=67108864;f++)this.words[f]-=67108864,f===this.length-1?this.words[f+1]=1:this.words[f+1]++;return this.length=Math.max(this.length,f+1),this},n.prototype.isubn=function(a){if(r(typeof a=="number"),r(a<67108864),a<0)return this.iaddn(-a);if(this.negative!==0)return this.negative=0,this.iaddn(a),this.negative=1,this;if(this.words[0]-=a,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var f=0;f<this.length&&this.words[f]<0;f++)this.words[f]+=67108864,this.words[f+1]-=1;return this._strip()},n.prototype.addn=function(a){return this.clone().iaddn(a)},n.prototype.subn=function(a){return this.clone().isubn(a)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(a,f,d){var h=a.length+d,y;this._expand(h);var x,k=0;for(y=0;y<a.length;y++){x=(this.words[y+d]|0)+k;var b=(a.words[y]|0)*f;x-=b&67108863,k=(x>>26)-(b/67108864|0),this.words[y+d]=x&67108863}for(;y<this.length-d;y++)x=(this.words[y+d]|0)+k,k=x>>26,this.words[y+d]=x&67108863;if(k===0)return this._strip();for(r(k===-1),k=0,y=0;y<this.length;y++)x=-(this.words[y]|0)+k,k=x>>26,this.words[y]=x&67108863;return this.negative=1,this._strip()},n.prototype._wordDiv=function(a,f){var d=this.length-a.length,h=this.clone(),y=a,x=y.words[y.length-1]|0,k=this._countBits(x);d=26-k,d!==0&&(y=y.ushln(d),h.iushln(d),x=y.words[y.length-1]|0);var b=h.length-y.length,l;if(f!=="mod"){l=new n(null),l.length=b+1,l.words=new Array(l.length);for(var v=0;v<l.length;v++)l.words[v]=0}var U=h.clone()._ishlnsubmul(y,1,b);U.negative===0&&(h=U,l&&(l.words[b]=1));for(var M=b-1;M>=0;M--){var Z=(h.words[y.length+M]|0)*67108864+(h.words[y.length+M-1]|0);for(Z=Math.min(Z/x|0,67108863),h._ishlnsubmul(y,Z,M);h.negative!==0;)Z--,h.negative=0,h._ishlnsubmul(y,1,M),h.isZero()||(h.negative^=1);l&&(l.words[M]=Z)}return l&&l._strip(),h._strip(),f!=="div"&&d!==0&&h.iushrn(d),{div:l||null,mod:h}},n.prototype.divmod=function(a,f,d){if(r(!a.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var h,y,x;return this.negative!==0&&a.negative===0?(x=this.neg().divmod(a,f),f!=="mod"&&(h=x.div.neg()),f!=="div"&&(y=x.mod.neg(),d&&y.negative!==0&&y.iadd(a)),{div:h,mod:y}):this.negative===0&&a.negative!==0?(x=this.divmod(a.neg(),f),f!=="mod"&&(h=x.div.neg()),{div:h,mod:x.mod}):(this.negative&a.negative)!==0?(x=this.neg().divmod(a.neg(),f),f!=="div"&&(y=x.mod.neg(),d&&y.negative!==0&&y.isub(a)),{div:x.div,mod:y}):a.length>this.length||this.cmp(a)<0?{div:new n(0),mod:this}:a.length===1?f==="div"?{div:this.divn(a.words[0]),mod:null}:f==="mod"?{div:null,mod:new n(this.modrn(a.words[0]))}:{div:this.divn(a.words[0]),mod:new n(this.modrn(a.words[0]))}:this._wordDiv(a,f)},n.prototype.div=function(a){return this.divmod(a,"div",!1).div},n.prototype.mod=function(a){return this.divmod(a,"mod",!1).mod},n.prototype.umod=function(a){return this.divmod(a,"mod",!0).mod},n.prototype.divRound=function(a){var f=this.divmod(a);if(f.mod.isZero())return f.div;var d=f.div.negative!==0?f.mod.isub(a):f.mod,h=a.ushrn(1),y=a.andln(1),x=d.cmp(h);return x<0||y===1&&x===0?f.div:f.div.negative!==0?f.div.isubn(1):f.div.iaddn(1)},n.prototype.modrn=function(a){var f=a<0;f&&(a=-a),r(a<=67108863);for(var d=(1<<26)%a,h=0,y=this.length-1;y>=0;y--)h=(d*h+(this.words[y]|0))%a;return f?-h:h},n.prototype.modn=function(a){return this.modrn(a)},n.prototype.idivn=function(a){var f=a<0;f&&(a=-a),r(a<=67108863);for(var d=0,h=this.length-1;h>=0;h--){var y=(this.words[h]|0)+d*67108864;this.words[h]=y/a|0,d=y%a}return this._strip(),f?this.ineg():this},n.prototype.divn=function(a){return this.clone().idivn(a)},n.prototype.egcd=function(a){r(a.negative===0),r(!a.isZero());var f=this,d=a.clone();f.negative!==0?f=f.umod(a):f=f.clone();for(var h=new n(1),y=new n(0),x=new n(0),k=new n(1),b=0;f.isEven()&&d.isEven();)f.iushrn(1),d.iushrn(1),++b;for(var l=d.clone(),v=f.clone();!f.isZero();){for(var U=0,M=1;(f.words[0]&M)===0&&U<26;++U,M<<=1);if(U>0)for(f.iushrn(U);U-- >0;)(h.isOdd()||y.isOdd())&&(h.iadd(l),y.isub(v)),h.iushrn(1),y.iushrn(1);for(var Z=0,te=1;(d.words[0]&te)===0&&Z<26;++Z,te<<=1);if(Z>0)for(d.iushrn(Z);Z-- >0;)(x.isOdd()||k.isOdd())&&(x.iadd(l),k.isub(v)),x.iushrn(1),k.iushrn(1);f.cmp(d)>=0?(f.isub(d),h.isub(x),y.isub(k)):(d.isub(f),x.isub(h),k.isub(y))}return{a:x,b:k,gcd:d.iushln(b)}},n.prototype._invmp=function(a){r(a.negative===0),r(!a.isZero());var f=this,d=a.clone();f.negative!==0?f=f.umod(a):f=f.clone();for(var h=new n(1),y=new n(0),x=d.clone();f.cmpn(1)>0&&d.cmpn(1)>0;){for(var k=0,b=1;(f.words[0]&b)===0&&k<26;++k,b<<=1);if(k>0)for(f.iushrn(k);k-- >0;)h.isOdd()&&h.iadd(x),h.iushrn(1);for(var l=0,v=1;(d.words[0]&v)===0&&l<26;++l,v<<=1);if(l>0)for(d.iushrn(l);l-- >0;)y.isOdd()&&y.iadd(x),y.iushrn(1);f.cmp(d)>=0?(f.isub(d),h.isub(y)):(d.isub(f),y.isub(h))}var U;return f.cmpn(1)===0?U=h:U=y,U.cmpn(0)<0&&U.iadd(a),U},n.prototype.gcd=function(a){if(this.isZero())return a.abs();if(a.isZero())return this.abs();var f=this.clone(),d=a.clone();f.negative=0,d.negative=0;for(var h=0;f.isEven()&&d.isEven();h++)f.iushrn(1),d.iushrn(1);do{for(;f.isEven();)f.iushrn(1);for(;d.isEven();)d.iushrn(1);var y=f.cmp(d);if(y<0){var x=f;f=d,d=x}else if(y===0||d.cmpn(1)===0)break;f.isub(d)}while(!0);return d.iushln(h)},n.prototype.invm=function(a){return this.egcd(a).a.umod(a)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(a){return this.words[0]&a},n.prototype.bincn=function(a){r(typeof a=="number");var f=a%26,d=(a-f)/26,h=1<<f;if(this.length<=d)return this._expand(d+1),this.words[d]|=h,this;for(var y=h,x=d;y!==0&&x<this.length;x++){var k=this.words[x]|0;k+=y,y=k>>>26,k&=67108863,this.words[x]=k}return y!==0&&(this.words[x]=y,this.length++),this},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(a){var f=a<0;if(this.negative!==0&&!f)return-1;if(this.negative===0&&f)return 1;this._strip();var d;if(this.length>1)d=1;else{f&&(a=-a),r(a<=67108863,"Number is too big");var h=this.words[0]|0;d=h===a?0:h<a?-1:1}return this.negative!==0?-d|0:d},n.prototype.cmp=function(a){if(this.negative!==0&&a.negative===0)return-1;if(this.negative===0&&a.negative!==0)return 1;var f=this.ucmp(a);return this.negative!==0?-f|0:f},n.prototype.ucmp=function(a){if(this.length>a.length)return 1;if(this.length<a.length)return-1;for(var f=0,d=this.length-1;d>=0;d--){var h=this.words[d]|0,y=a.words[d]|0;if(h!==y){h<y?f=-1:h>y&&(f=1);break}}return f},n.prototype.gtn=function(a){return this.cmpn(a)===1},n.prototype.gt=function(a){return this.cmp(a)===1},n.prototype.gten=function(a){return this.cmpn(a)>=0},n.prototype.gte=function(a){return this.cmp(a)>=0},n.prototype.ltn=function(a){return this.cmpn(a)===-1},n.prototype.lt=function(a){return this.cmp(a)===-1},n.prototype.lten=function(a){return this.cmpn(a)<=0},n.prototype.lte=function(a){return this.cmp(a)<=0},n.prototype.eqn=function(a){return this.cmpn(a)===0},n.prototype.eq=function(a){return this.cmp(a)===0},n.red=function(a){return new ne(a)},n.prototype.toRed=function(a){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),a.convertTo(this)._forceRed(a)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(a){return this.red=a,this},n.prototype.forceRed=function(a){return r(!this.red,"Already a number in reduction context"),this._forceRed(a)},n.prototype.redAdd=function(a){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,a)},n.prototype.redIAdd=function(a){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,a)},n.prototype.redSub=function(a){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,a)},n.prototype.redISub=function(a){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,a)},n.prototype.redShl=function(a){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,a)},n.prototype.redMul=function(a){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.mul(this,a)},n.prototype.redIMul=function(a){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.imul(this,a)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(a){return r(this.red&&!a.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,a)};var Q={k256:null,p224:null,p192:null,p25519:null};function J(S,a){this.name=S,this.p=new n(a,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}J.prototype._tmp=function(){var a=new n(null);return a.words=new Array(Math.ceil(this.n/13)),a},J.prototype.ireduce=function(a){var f=a,d;do this.split(f,this.tmp),f=this.imulK(f),f=f.iadd(this.tmp),d=f.bitLength();while(d>this.n);var h=d<this.n?-1:f.ucmp(this.p);return h===0?(f.words[0]=0,f.length=1):h>0?f.isub(this.p):f.strip!==void 0?f.strip():f._strip(),f},J.prototype.split=function(a,f){a.iushrn(this.n,0,f)},J.prototype.imulK=function(a){return a.imul(this.k)};function Y(){J.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(Y,J),Y.prototype.split=function(a,f){for(var d=4194303,h=Math.min(a.length,9),y=0;y<h;y++)f.words[y]=a.words[y];if(f.length=h,a.length<=9){a.words[0]=0,a.length=1;return}var x=a.words[9];for(f.words[f.length++]=x&d,y=10;y<a.length;y++){var k=a.words[y]|0;a.words[y-10]=(k&d)<<4|x>>>22,x=k}x>>>=22,a.words[y-10]=x,x===0&&a.length>10?a.length-=10:a.length-=9},Y.prototype.imulK=function(a){a.words[a.length]=0,a.words[a.length+1]=0,a.length+=2;for(var f=0,d=0;d<a.length;d++){var h=a.words[d]|0;f+=h*977,a.words[d]=f&67108863,f=h*64+(f/67108864|0)}return a.words[a.length-1]===0&&(a.length--,a.words[a.length-1]===0&&a.length--),a};function X(){J.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(X,J);function ee(){J.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(ee,J);function Re(){J.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(Re,J),Re.prototype.imulK=function(a){for(var f=0,d=0;d<a.length;d++){var h=(a.words[d]|0)*19+f,y=h&67108863;h>>>=26,a.words[d]=y,f=h}return f!==0&&(a.words[a.length++]=f),a},n._prime=function(a){if(Q[a])return Q[a];var f;if(a==="k256")f=new Y;else if(a==="p224")f=new X;else if(a==="p192")f=new ee;else if(a==="p25519")f=new Re;else throw new Error("Unknown prime "+a);return Q[a]=f,f};function ne(S){if(typeof S=="string"){var a=n._prime(S);this.m=a.p,this.prime=a}else r(S.gtn(1),"modulus must be greater than 1"),this.m=S,this.prime=null}ne.prototype._verify1=function(a){r(a.negative===0,"red works only with positives"),r(a.red,"red works only with red numbers")},ne.prototype._verify2=function(a,f){r((a.negative|f.negative)===0,"red works only with positives"),r(a.red&&a.red===f.red,"red works only with red numbers")},ne.prototype.imod=function(a){return this.prime?this.prime.ireduce(a)._forceRed(this):(p(a,a.umod(this.m)._forceRed(this)),a)},ne.prototype.neg=function(a){return a.isZero()?a.clone():this.m.sub(a)._forceRed(this)},ne.prototype.add=function(a,f){this._verify2(a,f);var d=a.add(f);return d.cmp(this.m)>=0&&d.isub(this.m),d._forceRed(this)},ne.prototype.iadd=function(a,f){this._verify2(a,f);var d=a.iadd(f);return d.cmp(this.m)>=0&&d.isub(this.m),d},ne.prototype.sub=function(a,f){this._verify2(a,f);var d=a.sub(f);return d.cmpn(0)<0&&d.iadd(this.m),d._forceRed(this)},ne.prototype.isub=function(a,f){this._verify2(a,f);var d=a.isub(f);return d.cmpn(0)<0&&d.iadd(this.m),d},ne.prototype.shl=function(a,f){return this._verify1(a),this.imod(a.ushln(f))},ne.prototype.imul=function(a,f){return this._verify2(a,f),this.imod(a.imul(f))},ne.prototype.mul=function(a,f){return this._verify2(a,f),this.imod(a.mul(f))},ne.prototype.isqr=function(a){return this.imul(a,a.clone())},ne.prototype.sqr=function(a){return this.mul(a,a)},ne.prototype.sqrt=function(a){if(a.isZero())return a.clone();var f=this.m.andln(3);if(r(f%2===1),f===3){var d=this.m.add(new n(1)).iushrn(2);return this.pow(a,d)}for(var h=this.m.subn(1),y=0;!h.isZero()&&h.andln(1)===0;)y++,h.iushrn(1);r(!h.isZero());var x=new n(1).toRed(this),k=x.redNeg(),b=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new n(2*l*l).toRed(this);this.pow(l,b).cmp(k)!==0;)l.redIAdd(k);for(var v=this.pow(l,h),U=this.pow(a,h.addn(1).iushrn(1)),M=this.pow(a,h),Z=y;M.cmp(x)!==0;){for(var te=M,oe=0;te.cmp(x)!==0;oe++)te=te.redSqr();r(oe<Z);var ue=this.pow(v,new n(1).iushln(Z-oe-1));U=U.redMul(ue),v=ue.redSqr(),M=M.redMul(v),Z=oe}return U},ne.prototype.invm=function(a){var f=a._invmp(this.m);return f.negative!==0?(f.negative=0,this.imod(f).redNeg()):this.imod(f)},ne.prototype.pow=function(a,f){if(f.isZero())return new n(1).toRed(this);if(f.cmpn(1)===0)return a.clone();var d=4,h=new Array(1<<d);h[0]=new n(1).toRed(this),h[1]=a;for(var y=2;y<h.length;y++)h[y]=this.mul(h[y-1],a);var x=h[0],k=0,b=0,l=f.bitLength()%26;for(l===0&&(l=26),y=f.length-1;y>=0;y--){for(var v=f.words[y],U=l-1;U>=0;U--){var M=v>>U&1;if(x!==h[0]&&(x=this.sqr(x)),M===0&&k===0){b=0;continue}k<<=1,k|=M,b++,!(b!==d&&(y!==0||U!==0))&&(x=this.mul(x,h[k]),b=0,k=0)}l=26}return x},ne.prototype.convertTo=function(a){var f=a.umod(this.m);return f===a?f.clone():f},ne.prototype.convertFrom=function(a){var f=a.clone();return f.red=null,f},n.mont=function(a){return new fe(a)};function fe(S){ne.call(this,S),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(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(fe,ne),fe.prototype.convertTo=function(a){return this.imod(a.ushln(this.shift))},fe.prototype.convertFrom=function(a){var f=this.imod(a.mul(this.rinv));return f.red=null,f},fe.prototype.imul=function(a,f){if(a.isZero()||f.isZero())return a.words[0]=0,a.length=1,a;var d=a.imul(f),h=d.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=d.isub(h).iushrn(this.shift),x=y;return y.cmp(this.m)>=0?x=y.isub(this.m):y.cmpn(0)<0&&(x=y.iadd(this.m)),x._forceRed(this)},fe.prototype.mul=function(a,f){if(a.isZero()||f.isZero())return new n(0)._forceRed(this);var d=a.mul(f),h=d.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=d.isub(h).iushrn(this.shift),x=y;return y.cmp(this.m)>=0?x=y.isub(this.m):y.cmpn(0)<0&&(x=y.iadd(this.m)),x._forceRed(this)},fe.prototype.invm=function(a){var f=this.imod(a._invmp(this.m).mul(this.r2));return f._forceRed(this)}})(typeof Uh>"u"||Uh,jy)});var Vy=Vt((Mh,Zy)=>{var Oa=_o(),br=Oa.Buffer;function Fy(t,e){for(var r in t)e[r]=t[r]}br.from&&br.alloc&&br.allocUnsafe&&br.allocUnsafeSlow?Zy.exports=Oa:(Fy(Oa,Mh),Mh.Buffer=Pn);function Pn(t,e,r){return br(t,e,r)}Pn.prototype=Object.create(br.prototype);Fy(br,Pn);Pn.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return br(t,e,r)};Pn.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=br(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i};Pn.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return br(t)};Pn.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Oa.SlowBuffer(t)}});var Ky=Vt((NL,Wy)=>{"use strict";var Na=Vy().Buffer;function dE(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var i=0;i<t.length;i++){var n=t.charAt(i),o=n.charCodeAt(0);if(e[o]!==255)throw new TypeError(n+" is ambiguous");e[o]=i}var s=t.length,c=t.charAt(0),u=Math.log(s)/Math.log(256),p=Math.log(256)/Math.log(s);function m(g){if((Array.isArray(g)||g instanceof Uint8Array)&&(g=Na.from(g)),!Na.isBuffer(g))throw new TypeError("Expected Buffer");if(g.length===0)return"";for(var A=0,I=0,R=0,T=g.length;R!==T&&g[R]===0;)R++,A++;for(var B=(T-R)*p+1>>>0,$=new Uint8Array(B);R!==T;){for(var C=g[R],Q=0,J=B-1;(C!==0||Q<I)&&J!==-1;J--,Q++)C+=256*$[J]>>>0,$[J]=C%s>>>0,C=C/s>>>0;if(C!==0)throw new Error("Non-zero carry");I=Q,R++}for(var Y=B-I;Y!==B&&$[Y]===0;)Y++;for(var X=c.repeat(A);Y<B;++Y)X+=t.charAt($[Y]);return X}function _(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return Na.alloc(0);for(var A=0,I=0,R=0;g[A]===c;)I++,A++;for(var T=(g.length-A)*u+1>>>0,B=new Uint8Array(T);A<g.length;){var $=g.charCodeAt(A);if($>255)return;var C=e[$];if(C===255)return;for(var Q=0,J=T-1;(C!==0||Q<R)&&J!==-1;J--,Q++)C+=s*B[J]>>>0,B[J]=C%256>>>0,C=C/256>>>0;if(C!==0)throw new Error("Non-zero carry");R=Q,A++}for(var Y=T-R;Y!==T&&B[Y]===0;)Y++;var X=Na.allocUnsafe(I+(T-Y));X.fill(0,0,I);for(var ee=I;Y!==T;)X[ee++]=B[Y++];return X}function w(g){var A=_(g);if(A)return A;throw new Error("Non-base"+s+" character")}return{encode:m,decodeUnsafe:_,decode:w}}Wy.exports=dE});var jh=Vt((TL,qy)=>{var hE=Ky(),pE="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";qy.exports=hE(pE)});var Hy=Vt(Wh=>{"use strict";function zr(t,e,r){return e<=t&&t<=r}function Ba(t){if(t===void 0)return{};if(t===Object(t))return t;throw TypeError("Could not convert argument to dictionary")}function gE(t){for(var e=String(t),r=e.length,i=0,n=[];i<r;){var o=e.charCodeAt(i);if(o<55296||o>57343)n.push(o);else if(56320<=o&&o<=57343)n.push(65533);else if(55296<=o&&o<=56319)if(i===r-1)n.push(65533);else{var s=t.charCodeAt(i+1);if(56320<=s&&s<=57343){var c=o&1023,u=s&1023;n.push(65536+(c<<10)+u),i+=1}else n.push(65533)}i+=1}return n}function yE(t){for(var e="",r=0;r<t.length;++r){var i=t[r];i<=65535?e+=String.fromCharCode(i):(i-=65536,e+=String.fromCharCode((i>>10)+55296,(i&1023)+56320))}return e}var Ta=-1;function Vh(t){this.tokens=[].slice.call(t)}Vh.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():Ta},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 pi=-1;function Zh(t,e){if(t)throw TypeError("Decoder error");return e||65533}var $a="utf-8";function La(t,e){if(!(this instanceof La))return new La(t,e);if(t=t!==void 0?String(t).toLowerCase():$a,t!==$a)throw new Error("Encoding not supported. Only utf-8 is supported");e=Ba(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})}La.prototype={decode:function(e,r){var i;typeof e=="object"&&e instanceof ArrayBuffer?i=new Uint8Array(e):typeof e=="object"&&"buffer"in e&&e.buffer instanceof ArrayBuffer?i=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):i=new Uint8Array(0),r=Ba(r),this._streaming||(this._decoder=new _E({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!r.stream;for(var n=new Vh(i),o=[],s;!n.endOfStream()&&(s=this._decoder.handler(n,n.read()),s!==pi);)s!==null&&(Array.isArray(s)?o.push.apply(o,s):o.push(s));if(!this._streaming){do{if(s=this._decoder.handler(n,n.read()),s===pi)break;s!==null&&(Array.isArray(s)?o.push.apply(o,s):o.push(s))}while(!n.endOfStream());this._decoder=null}return o.length&&["utf-8"].indexOf(this.encoding)!==-1&&!this._ignoreBOM&&!this._BOMseen&&(o[0]===65279?(this._BOMseen=!0,o.shift()):this._BOMseen=!0),yE(o)}};function Pa(t,e){if(!(this instanceof Pa))return new Pa(t,e);if(t=t!==void 0?String(t).toLowerCase():$a,t!==$a)throw new Error("Encoding not supported. Only utf-8 is supported");e=Ba(e),this._streaming=!1,this._encoder=null,this._options={fatal:!!e.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}Pa.prototype={encode:function(e,r){e=e?String(e):"",r=Ba(r),this._streaming||(this._encoder=new bE(this._options)),this._streaming=!!r.stream;for(var i=[],n=new Vh(gE(e)),o;!n.endOfStream()&&(o=this._encoder.handler(n,n.read()),o!==pi);)Array.isArray(o)?i.push.apply(i,o):i.push(o);if(!this._streaming){for(;o=this._encoder.handler(n,n.read()),o!==pi;)Array.isArray(o)?i.push.apply(i,o):i.push(o);this._encoder=null}return new Uint8Array(i)}};function _E(t){var e=t.fatal,r=0,i=0,n=0,o=128,s=191;this.handler=function(c,u){if(u===Ta&&n!==0)return n=0,Zh(e);if(u===Ta)return pi;if(n===0){if(zr(u,0,127))return u;if(zr(u,194,223))n=1,r=u-192;else if(zr(u,224,239))u===224&&(o=160),u===237&&(s=159),n=2,r=u-224;else if(zr(u,240,244))u===240&&(o=144),u===244&&(s=143),n=3,r=u-240;else return Zh(e);return r=r<<6*n,null}if(!zr(u,o,s))return r=n=i=0,o=128,s=191,c.prepend(u),Zh(e);if(o=128,s=191,i+=1,r+=u-128<<6*(n-i),i!==n)return null;var p=r;return r=n=i=0,p}}function bE(t){var e=t.fatal;this.handler=function(r,i){if(i===Ta)return pi;if(zr(i,0,127))return i;var n,o;zr(i,128,2047)?(n=1,o=192):zr(i,2048,65535)?(n=2,o=224):zr(i,65536,1114111)&&(n=3,o=240);for(var s=[(i>>6*n)+o];n>0;){var c=i>>6*(n-1);s.push(128|c&63),n-=1}return s}}Wh.TextEncoder=Pa;Wh.TextDecoder=La});var Qy=Vt(Ae=>{"use strict";var vE=Ae&&Ae.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}),wE=Ae&&Ae.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),vr=Ae&&Ae.__decorate||function(t,e,r,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,i);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(o=(n<3?s(o):n>3?s(e,r,o):s(e,r))||o);return n>3&&o&&Object.defineProperty(e,r,o),o},xE=Ae&&Ae.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.hasOwnProperty.call(t,r)&&vE(e,t,r);return wE(e,t),e},Gy=Ae&&Ae.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ae,"__esModule",{value:!0});Ae.deserializeUnchecked=Ae.deserialize=Ae.serialize=Ae.BinaryReader=Ae.BinaryWriter=Ae.BorshError=Ae.baseDecode=Ae.baseEncode=void 0;var sn=Gy(Dh()),Jy=Gy(jh()),SE=xE(Hy()),EE=typeof TextDecoder!="function"?SE.TextDecoder:TextDecoder,IE=new EE("utf-8",{fatal:!0});function RE(t){return typeof t=="string"&&(t=Buffer.from(t,"utf8")),Jy.default.encode(Buffer.from(t))}Ae.baseEncode=RE;function kE(t){return Buffer.from(Jy.default.decode(t))}Ae.baseDecode=kE;var Kh=1024,At=class extends Error{constructor(e){super(e),this.fieldPath=[],this.originalMessage=e}addToFieldPath(e){this.fieldPath.splice(0,0,e),this.message=this.originalMessage+": "+this.fieldPath.join(".")}};Ae.BorshError=At;var za=class{constructor(){this.buf=Buffer.alloc(Kh),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=Buffer.concat([this.buf,Buffer.alloc(Kh)]))}writeU8(e){this.maybeResize(),this.buf.writeUInt8(e,this.length),this.length+=1}writeU16(e){this.maybeResize(),this.buf.writeUInt16LE(e,this.length),this.length+=2}writeU32(e){this.maybeResize(),this.buf.writeUInt32LE(e,this.length),this.length+=4}writeU64(e){this.maybeResize(),this.writeBuffer(Buffer.from(new sn.default(e).toArray("le",8)))}writeU128(e){this.maybeResize(),this.writeBuffer(Buffer.from(new sn.default(e).toArray("le",16)))}writeU256(e){this.maybeResize(),this.writeBuffer(Buffer.from(new sn.default(e).toArray("le",32)))}writeU512(e){this.maybeResize(),this.writeBuffer(Buffer.from(new sn.default(e).toArray("le",64)))}writeBuffer(e){this.buf=Buffer.concat([Buffer.from(this.buf.subarray(0,this.length)),e,Buffer.alloc(Kh)]),this.length+=e.length}writeString(e){this.maybeResize();let r=Buffer.from(e,"utf8");this.writeU32(r.length),this.writeBuffer(r)}writeFixedArray(e){this.writeBuffer(Buffer.from(e))}writeArray(e,r){this.maybeResize(),this.writeU32(e.length);for(let i of e)this.maybeResize(),r(i)}toArray(){return this.buf.subarray(0,this.length)}};Ae.BinaryWriter=za;function wr(t,e,r){let i=r.value;r.value=function(...n){try{return i.apply(this,n)}catch(o){if(o instanceof RangeError){let s=o.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(s)>=0)throw new At("Reached the end of buffer when deserializing")}throw o}}}var jt=class{constructor(e){this.buf=e,this.offset=0}readU8(){let e=this.buf.readUInt8(this.offset);return this.offset+=1,e}readU16(){let e=this.buf.readUInt16LE(this.offset);return this.offset+=2,e}readU32(){let e=this.buf.readUInt32LE(this.offset);return this.offset+=4,e}readU64(){let e=this.readBuffer(8);return new sn.default(e,"le")}readU128(){let e=this.readBuffer(16);return new sn.default(e,"le")}readU256(){let e=this.readBuffer(32);return new sn.default(e,"le")}readU512(){let e=this.readBuffer(64);return new sn.default(e,"le")}readBuffer(e){if(this.offset+e>this.buf.length)throw new At(`Expected buffer length ${e} isn't within bounds`);let r=this.buf.slice(this.offset,this.offset+e);return this.offset+=e,r}readString(){let e=this.readU32(),r=this.readBuffer(e);try{return IE.decode(r)}catch(i){throw new At(`Error decoding UTF-8 string: ${i}`)}}readFixedArray(e){return new Uint8Array(this.readBuffer(e))}readArray(e){let r=this.readU32(),i=Array();for(let n=0;n<r;++n)i.push(e());return i}};vr([wr],jt.prototype,"readU8",null);vr([wr],jt.prototype,"readU16",null);vr([wr],jt.prototype,"readU32",null);vr([wr],jt.prototype,"readU64",null);vr([wr],jt.prototype,"readU128",null);vr([wr],jt.prototype,"readU256",null);vr([wr],jt.prototype,"readU512",null);vr([wr],jt.prototype,"readString",null);vr([wr],jt.prototype,"readFixedArray",null);vr([wr],jt.prototype,"readArray",null);Ae.BinaryReader=jt;function Yy(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Bn(t,e,r,i,n){try{if(typeof i=="string")n[`write${Yy(i)}`](r);else if(i instanceof Array)if(typeof i[0]=="number"){if(r.length!==i[0])throw new At(`Expecting byte array of length ${i[0]}, but got ${r.length} bytes`);n.writeFixedArray(r)}else if(i.length===2&&typeof i[1]=="number"){if(r.length!==i[1])throw new At(`Expecting byte array of length ${i[1]}, but got ${r.length} bytes`);for(let o=0;o<i[1];o++)Bn(t,null,r[o],i[0],n)}else n.writeArray(r,o=>{Bn(t,e,o,i[0],n)});else if(i.kind!==void 0)switch(i.kind){case"option":{r==null?n.writeU8(0):(n.writeU8(1),Bn(t,e,r,i.type,n));break}case"map":{n.writeU32(r.size),r.forEach((o,s)=>{Bn(t,e,s,i.key,n),Bn(t,e,o,i.value,n)});break}default:throw new At(`FieldType ${i} unrecognized`)}else Xy(t,r,n)}catch(o){throw o instanceof At&&o.addToFieldPath(e),o}}function Xy(t,e,r){if(typeof e.borshSerialize=="function"){e.borshSerialize(r);return}let i=t.get(e.constructor);if(!i)throw new At(`Class ${e.constructor.name} is missing in schema`);if(i.kind==="struct")i.fields.map(([n,o])=>{Bn(t,n,e[n],o,r)});else if(i.kind==="enum"){let n=e[i.field];for(let o=0;o<i.values.length;++o){let[s,c]=i.values[o];if(s===n){r.writeU8(o),Bn(t,s,e[s],c,r);break}}}else throw new At(`Unexpected schema kind: ${i.kind} for ${e.constructor.name}`)}function AE(t,e,r=za){let i=new r;return Xy(t,e,i),i.toArray()}Ae.serialize=AE;function zn(t,e,r,i){try{if(typeof r=="string")return i[`read${Yy(r)}`]();if(r instanceof Array){if(typeof r[0]=="number")return i.readFixedArray(r[0]);if(typeof r[1]=="number"){let n=[];for(let o=0;o<r[1];o++)n.push(zn(t,null,r[0],i));return n}else return i.readArray(()=>zn(t,e,r[0],i))}if(r.kind==="option")return i.readU8()?zn(t,e,r.type,i):void 0;if(r.kind==="map"){let n=new Map,o=i.readU32();for(let s=0;s<o;s++){let c=zn(t,e,r.key,i),u=zn(t,e,r.value,i);n.set(c,u)}return n}return qh(t,r,i)}catch(n){throw n instanceof At&&n.addToFieldPath(e),n}}function qh(t,e,r){if(typeof e.borshDeserialize=="function")return e.borshDeserialize(r);let i=t.get(e);if(!i)throw new At(`Class ${e.name} is missing in schema`);if(i.kind==="struct"){let n={};for(let[o,s]of t.get(e).fields)n[o]=zn(t,o,s,r);return new e(n)}if(i.kind==="enum"){let n=r.readU8();if(n>=i.values.length)throw new At(`Enum index: ${n} is out of range`);let[o,s]=i.values[n],c=zn(t,o,s,r);return new e({[o]:c})}throw new At(`Unexpected schema kind: ${i.kind} for ${e.constructor.name}`)}function OE(t,e,r,i=jt){let n=new i(r),o=qh(t,e,n);if(n.offset<r.length)throw new At(`Unexpected ${r.length-n.offset} bytes after deserialized data`);return o}Ae.deserialize=OE;function NE(t,e,r,i=jt){let n=new i(r);return qh(t,e,n)}Ae.deserializeUnchecked=NE});var Yh=Vt(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});L.s16=L.s8=L.nu64be=L.u48be=L.u40be=L.u32be=L.u24be=L.u16be=L.nu64=L.u48=L.u40=L.u32=L.u24=L.u16=L.u8=L.offset=L.greedy=L.Constant=L.UTF8=L.CString=L.Blob=L.Boolean=L.BitField=L.BitStructure=L.VariantLayout=L.Union=L.UnionLayoutDiscriminator=L.UnionDiscriminator=L.Structure=L.Sequence=L.DoubleBE=L.Double=L.FloatBE=L.Float=L.NearInt64BE=L.NearInt64=L.NearUInt64BE=L.NearUInt64=L.IntBE=L.Int=L.UIntBE=L.UInt=L.OffsetLayout=L.GreedyCount=L.ExternalLayout=L.bindConstructorLayout=L.nameWithProperty=L.Layout=L.uint8ArrayToBuffer=L.checkUint8Array=void 0;L.constant=L.utf8=L.cstr=L.blob=L.unionLayoutDiscriminator=L.union=L.seq=L.bits=L.struct=L.f64be=L.f64=L.f32be=L.f32=L.ns64be=L.s48be=L.s40be=L.s32be=L.s24be=L.s16be=L.ns64=L.s48=L.s40=L.s32=L.s24=void 0;var Gh=_o();function yi(t){if(!(t instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}L.checkUint8Array=yi;function ve(t){return yi(t),Gh.Buffer.from(t.buffer,t.byteOffset,t.length)}L.uint8ArrayToBuffer=ve;var we=class{constructor(e,r){if(!Number.isInteger(e))throw new TypeError("span must be an integer");this.span=e,this.property=r}makeDestinationObject(){return{}}getSpan(e,r){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(e){let r=Object.create(this.constructor.prototype);return Object.assign(r,this),r.property=e,r}fromArray(e){}};L.Layout=we;function Jh(t,e){return e.property?t+"["+e.property+"]":t}L.nameWithProperty=Jh;function TE(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 we))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(r,i){return e.encode(this,r,i)},writable:!0}),Object.defineProperty(t,"decode",{value(r,i){return e.decode(r,i)},writable:!0})}L.bindConstructorLayout=TE;var Lt=class extends we{isCount(){throw new Error("ExternalLayout is abstract")}};L.ExternalLayout=Lt;var Ca=class extends Lt{constructor(e=1,r){if(!Number.isInteger(e)||0>=e)throw new TypeError("elementSpan must be a (positive) integer");super(-1,r),this.elementSpan=e}isCount(){return!0}decode(e,r=0){yi(e);let i=e.length-r;return Math.floor(i/this.elementSpan)}encode(e,r,i){return 0}};L.GreedyCount=Ca;var Eo=class extends Lt{constructor(e,r=0,i){if(!(e instanceof we))throw new TypeError("layout must be a Layout");if(!Number.isInteger(r))throw new TypeError("offset must be integer or undefined");super(e.span,i||e.property),this.layout=e,this.offset=r}isCount(){return this.layout instanceof Jt||this.layout instanceof er}decode(e,r=0){return this.layout.decode(e,r+this.offset)}encode(e,r,i=0){return this.layout.encode(e,r,i+this.offset)}};L.OffsetLayout=Eo;var Jt=class extends we{constructor(e,r){if(super(e,r),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,r=0){return ve(e).readUIntLE(r,this.span)}encode(e,r,i=0){return ve(r).writeUIntLE(e,i,this.span),this.span}};L.UInt=Jt;var er=class extends we{constructor(e,r){if(super(e,r),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,r=0){return ve(e).readUIntBE(r,this.span)}encode(e,r,i=0){return ve(r).writeUIntBE(e,i,this.span),this.span}};L.UIntBE=er;var Cr=class extends we{constructor(e,r){if(super(e,r),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,r=0){return ve(e).readIntLE(r,this.span)}encode(e,r,i=0){return ve(r).writeIntLE(e,i,this.span),this.span}};L.Int=Cr;var an=class extends we{constructor(e,r){if(super(e,r),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,r=0){return ve(e).readIntBE(r,this.span)}encode(e,r,i=0){return ve(r).writeIntBE(e,i,this.span),this.span}};L.IntBE=an;var Hh=Math.pow(2,32);function ec(t){let e=Math.floor(t/Hh),r=t-e*Hh;return{hi32:e,lo32:r}}function tc(t,e){return t*Hh+e}var Ua=class extends we{constructor(e){super(8,e)}decode(e,r=0){let i=ve(e),n=i.readUInt32LE(r),o=i.readUInt32LE(r+4);return tc(o,n)}encode(e,r,i=0){let n=ec(e),o=ve(r);return o.writeUInt32LE(n.lo32,i),o.writeUInt32LE(n.hi32,i+4),8}};L.NearUInt64=Ua;var Da=class extends we{constructor(e){super(8,e)}decode(e,r=0){let i=ve(e),n=i.readUInt32BE(r),o=i.readUInt32BE(r+4);return tc(n,o)}encode(e,r,i=0){let n=ec(e),o=ve(r);return o.writeUInt32BE(n.hi32,i),o.writeUInt32BE(n.lo32,i+4),8}};L.NearUInt64BE=Da;var Ma=class extends we{constructor(e){super(8,e)}decode(e,r=0){let i=ve(e),n=i.readUInt32LE(r),o=i.readInt32LE(r+4);return tc(o,n)}encode(e,r,i=0){let n=ec(e),o=ve(r);return o.writeUInt32LE(n.lo32,i),o.writeInt32LE(n.hi32,i+4),8}};L.NearInt64=Ma;var ja=class extends we{constructor(e){super(8,e)}decode(e,r=0){let i=ve(e),n=i.readInt32BE(r),o=i.readUInt32BE(r+4);return tc(n,o)}encode(e,r,i=0){let n=ec(e),o=ve(r);return o.writeInt32BE(n.hi32,i),o.writeUInt32BE(n.lo32,i+4),8}};L.NearInt64BE=ja;var Fa=class extends we{constructor(e){super(4,e)}decode(e,r=0){return ve(e).readFloatLE(r)}encode(e,r,i=0){return ve(r).writeFloatLE(e,i),4}};L.Float=Fa;var Za=class extends we{constructor(e){super(4,e)}decode(e,r=0){return ve(e).readFloatBE(r)}encode(e,r,i=0){return ve(r).writeFloatBE(e,i),4}};L.FloatBE=Za;var Va=class extends we{constructor(e){super(8,e)}decode(e,r=0){return ve(e).readDoubleLE(r)}encode(e,r,i=0){return ve(r).writeDoubleLE(e,i),8}};L.Double=Va;var Wa=class extends we{constructor(e){super(8,e)}decode(e,r=0){return ve(e).readDoubleBE(r)}encode(e,r,i=0){return ve(r).writeDoubleBE(e,i),8}};L.DoubleBE=Wa;var Ka=class extends we{constructor(e,r,i){if(!(e instanceof we))throw new TypeError("elementLayout must be a Layout");if(!(r instanceof Lt&&r.isCount()||Number.isInteger(r)&&0<=r))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let n=-1;!(r instanceof Lt)&&0<e.span&&(n=r*e.span),super(n,i),this.elementLayout=e,this.count=r}getSpan(e,r=0){if(0<=this.span)return this.span;let i=0,n=this.count;if(n instanceof Lt&&(n=n.decode(e,r)),0<this.elementLayout.span)i=n*this.elementLayout.span;else{let o=0;for(;o<n;)i+=this.elementLayout.getSpan(e,r+i),++o}return i}decode(e,r=0){let i=[],n=0,o=this.count;for(o instanceof Lt&&(o=o.decode(e,r));n<o;)i.push(this.elementLayout.decode(e,r)),r+=this.elementLayout.getSpan(e,r),n+=1;return i}encode(e,r,i=0){let n=this.elementLayout,o=e.reduce((s,c)=>s+n.encode(c,r,i+s),0);return this.count instanceof Lt&&this.count.encode(e.length,r,i),o}};L.Sequence=Ka;var qa=class extends we{constructor(e,r,i){if(!(Array.isArray(e)&&e.reduce((o,s)=>o&&s instanceof we,!0)))throw new TypeError("fields must be array of Layout instances");typeof r=="boolean"&&i===void 0&&(i=r,r=void 0);for(let o of e)if(0>o.span&&o.property===void 0)throw new Error("fields cannot contain unnamed variable-length layout");let n=-1;try{n=e.reduce((o,s)=>o+s.getSpan(),0)}catch{}super(n,r),this.fields=e,this.decodePrefixes=!!i}getSpan(e,r=0){if(0<=this.span)return this.span;let i=0;try{i=this.fields.reduce((n,o)=>{let s=o.getSpan(e,r);return r+=s,n+s},0)}catch{throw new RangeError("indeterminate span")}return i}decode(e,r=0){yi(e);let i=this.makeDestinationObject();for(let n of this.fields)if(n.property!==void 0&&(i[n.property]=n.decode(e,r)),r+=n.getSpan(e,r),this.decodePrefixes&&e.length===r)break;return i}encode(e,r,i=0){let n=i,o=0,s=0;for(let c of this.fields){let u=c.span;if(s=0<u?u:0,c.property!==void 0){let p=e[c.property];p!==void 0&&(s=c.encode(p,r,i),0>u&&(u=c.getSpan(r,i)))}o=i,i+=u}return o+s-n}fromArray(e){let r=this.makeDestinationObject();for(let i of this.fields)i.property!==void 0&&0<e.length&&(r[i.property]=e.shift());return r}layoutFor(e){if(typeof e!="string")throw new TypeError("property must be string");for(let r of this.fields)if(r.property===e)return r}offsetOf(e){if(typeof e!="string")throw new TypeError("property must be string");let r=0;for(let i of this.fields){if(i.property===e)return r;0>i.span?r=-1:0<=r&&(r+=i.span)}}};L.Structure=qa;var Io=class{constructor(e){this.property=e}decode(e,r){throw new Error("UnionDiscriminator is abstract")}encode(e,r,i){throw new Error("UnionDiscriminator is abstract")}};L.UnionDiscriminator=Io;var gi=class extends Io{constructor(e,r){if(!(e instanceof Lt&&e.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");super(r||e.property||"variant"),this.layout=e}decode(e,r){return this.layout.decode(e,r)}encode(e,r,i){return this.layout.encode(e,r,i)}};L.UnionLayoutDiscriminator=gi;var Ro=class extends we{constructor(e,r,i){let n;if(e instanceof Jt||e instanceof er)n=new gi(new Eo(e));else if(e instanceof Lt&&e.isCount())n=new gi(e);else if(e instanceof Io)n=e;else throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(r===void 0&&(r=null),!(r===null||r instanceof we))throw new TypeError("defaultLayout must be null or a Layout");if(r!==null){if(0>r.span)throw new Error("defaultLayout must have constant span");r.property===void 0&&(r=r.replicate("content"))}let o=-1;r&&(o=r.span,0<=o&&(e instanceof Jt||e instanceof er)&&(o+=n.layout.span)),super(o,i),this.discriminator=n,this.usesPrefixDiscriminator=e instanceof Jt||e instanceof er,this.defaultLayout=r,this.registry={};let s=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(c){return s(c)},this.configGetSourceVariant=function(c){s=c.bind(this)}}getSpan(e,r=0){if(0<=this.span)return this.span;let i=this.getVariant(e,r);if(!i)throw new Error("unable to determine span for unrecognized variant");return i.getSpan(e,r)}defaultGetSourceVariant(e){if(Object.prototype.hasOwnProperty.call(e,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(e,this.defaultLayout.property))return;let r=this.registry[e[this.discriminator.property]];if(r&&(!r.layout||r.property&&Object.prototype.hasOwnProperty.call(e,r.property)))return r}else for(let r in this.registry){let i=this.registry[r];if(i.property&&Object.prototype.hasOwnProperty.call(e,i.property))return i}throw new Error("unable to infer src variant")}decode(e,r=0){let i,n=this.discriminator,o=n.decode(e,r),s=this.registry[o];if(s===void 0){let c=this.defaultLayout,u=0;this.usesPrefixDiscriminator&&(u=n.layout.span),i=this.makeDestinationObject(),i[n.property]=o,i[c.property]=c.decode(e,r+u)}else i=s.decode(e,r);return i}encode(e,r,i=0){let n=this.getSourceVariant(e);if(n===void 0){let o=this.discriminator,s=this.defaultLayout,c=0;return this.usesPrefixDiscriminator&&(c=o.layout.span),o.encode(e[o.property],r,i),c+s.encode(e[s.property],r,i+c)}return n.encode(e,r,i)}addVariant(e,r,i){let n=new Ha(this,e,r,i);return this.registry[e]=n,n}getVariant(e,r=0){let i;return e instanceof Uint8Array?i=this.discriminator.decode(e,r):i=e,this.registry[i]}};L.Union=Ro;var Ha=class extends we{constructor(e,r,i,n){if(!(e instanceof Ro))throw new TypeError("union must be a Union");if(!Number.isInteger(r)||0>r)throw new TypeError("variant must be a (non-negative) integer");if(typeof i=="string"&&n===void 0&&(n=i,i=null),i){if(!(i instanceof we))throw new TypeError("layout must be a Layout");if(e.defaultLayout!==null&&0<=i.span&&i.span>e.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if(typeof n!="string")throw new TypeError("variant must have a String property")}let o=e.span;0>e.span&&(o=i?i.span:0,0<=o&&e.usesPrefixDiscriminator&&(o+=e.discriminator.layout.span)),super(o,n),this.union=e,this.variant=r,this.layout=i||null}getSpan(e,r=0){if(0<=this.span)return this.span;let i=0;this.union.usesPrefixDiscriminator&&(i=this.union.discriminator.layout.span);let n=0;return this.layout&&(n=this.layout.getSpan(e,r+i)),i+n}decode(e,r=0){let i=this.makeDestinationObject();if(this!==this.union.getVariant(e,r))throw new Error("variant mismatch");let n=0;return this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),this.layout?i[this.property]=this.layout.decode(e,r+n):this.property?i[this.property]=!0:this.union.usesPrefixDiscriminator&&(i[this.union.discriminator.property]=this.variant),i}encode(e,r,i=0){let n=0;if(this.union.usesPrefixDiscriminator&&(n=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,r,i);let o=n;if(this.layout&&(this.layout.encode(e[this.property],r,i+n),o+=this.layout.getSpan(r,i+n),0<=this.union.span&&o>this.union.span))throw new Error("encoded variant overruns containing union");return o}fromArray(e){if(this.layout)return this.layout.fromArray(e)}};L.VariantLayout=Ha;function mi(t){return 0>t&&(t+=4294967296),t}var ko=class extends we{constructor(e,r,i){if(!(e instanceof Jt||e instanceof er))throw new TypeError("word must be a UInt or UIntBE layout");if(typeof r=="string"&&i===void 0&&(i=r,r=!1),4<e.span)throw new RangeError("word cannot exceed 32 bits");super(e.span,i),this.word=e,this.msb=!!r,this.fields=[];let n=0;this._packedSetValue=function(o){return n=mi(o),this},this._packedGetValue=function(){return n}}decode(e,r=0){let i=this.makeDestinationObject(),n=this.word.decode(e,r);this._packedSetValue(n);for(let o of this.fields)o.property!==void 0&&(i[o.property]=o.decode(e));return i}encode(e,r,i=0){let n=this.word.decode(r,i);this._packedSetValue(n);for(let o of this.fields)if(o.property!==void 0){let s=e[o.property];s!==void 0&&o.encode(s)}return this.word.encode(this._packedGetValue(),r,i)}addField(e,r){let i=new Ao(this,e,r);return this.fields.push(i),i}addBoolean(e){let r=new Ga(this,e);return this.fields.push(r),r}fieldFor(e){if(typeof e!="string")throw new TypeError("property must be string");for(let r of this.fields)if(r.property===e)return r}};L.BitStructure=ko;var Ao=class{constructor(e,r,i){if(!(e instanceof ko))throw new TypeError("container must be a BitStructure");if(!Number.isInteger(r)||0>=r)throw new TypeError("bits must be positive integer");let n=8*e.span,o=e.fields.reduce((s,c)=>s+c.bits,0);if(r+o>n)throw new Error("bits too long for span remainder ("+(n-o)+" of "+n+" remain)");this.container=e,this.bits=r,this.valueMask=(1<<r)-1,r===32&&(this.valueMask=4294967295),this.start=o,this.container.msb&&(this.start=n-o-r),this.wordMask=mi(this.valueMask<<this.start),this.property=i}decode(e,r){let i=this.container._packedGetValue();return mi(i&this.wordMask)>>>this.start}encode(e){if(typeof e!="number"||!Number.isInteger(e)||e!==mi(e&this.valueMask))throw new TypeError(Jh("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);let r=this.container._packedGetValue(),i=mi(e<<this.start);this.container._packedSetValue(mi(r&~this.wordMask)|i)}};L.BitField=Ao;var Ga=class extends Ao{constructor(e,r){super(e,1,r)}decode(e,r){return!!super.decode(e,r)}encode(e){typeof e=="boolean"&&(e=+e),super.encode(e)}};L.Boolean=Ga;var Ja=class extends we{constructor(e,r){if(!(e instanceof Lt&&e.isCount()||Number.isInteger(e)&&0<=e))throw new TypeError("length must be positive integer or an unsigned integer ExternalLayout");let i=-1;e instanceof Lt||(i=e),super(i,r),this.length=e}getSpan(e,r){let i=this.span;return 0>i&&(i=this.length.decode(e,r)),i}decode(e,r=0){let i=this.span;return 0>i&&(i=this.length.decode(e,r)),ve(e).slice(r,r+i)}encode(e,r,i){let n=this.length;if(this.length instanceof Lt&&(n=e.length),!(e instanceof Uint8Array&&n===e.length))throw new TypeError(Jh("Blob.encode",this)+" requires (length "+n+") Uint8Array as src");if(i+n>r.length)throw new RangeError("encoding overruns Uint8Array");let o=ve(e);return ve(r).write(o.toString("hex"),i,n,"hex"),this.length instanceof Lt&&this.length.encode(n,r,i),n}};L.Blob=Ja;var Ya=class extends we{constructor(e){super(-1,e)}getSpan(e,r=0){yi(e);let i=r;for(;i<e.length&&e[i]!==0;)i+=1;return 1+i-r}decode(e,r=0){let i=this.getSpan(e,r);return ve(e).slice(r,r+i-1).toString("utf-8")}encode(e,r,i=0){typeof e!="string"&&(e=String(e));let n=Gh.Buffer.from(e,"utf8"),o=n.length;if(i+o>r.length)throw new RangeError("encoding overruns Buffer");let s=ve(r);return n.copy(s,i),s[i+o]=0,o+1}};L.CString=Ya;var Xa=class extends we{constructor(e,r){if(typeof e=="string"&&r===void 0&&(r=e,e=void 0),e===void 0)e=-1;else if(!Number.isInteger(e))throw new TypeError("maxSpan must be an integer");super(-1,r),this.maxSpan=e}getSpan(e,r=0){return yi(e),e.length-r}decode(e,r=0){let i=this.getSpan(e,r);if(0<=this.maxSpan&&this.maxSpan<i)throw new RangeError("text length exceeds maxSpan");return ve(e).slice(r,r+i).toString("utf-8")}encode(e,r,i=0){typeof e!="string"&&(e=String(e));let n=Gh.Buffer.from(e,"utf8"),o=n.length;if(0<=this.maxSpan&&this.maxSpan<o)throw new RangeError("text length exceeds maxSpan");if(i+o>r.length)throw new RangeError("encoding overruns Buffer");return n.copy(ve(r),i),o}};L.UTF8=Xa;var Qa=class extends we{constructor(e,r){super(0,r),this.value=e}decode(e,r){return this.value}encode(e,r,i){return 0}};L.Constant=Qa;L.greedy=(t,e)=>new Ca(t,e);L.offset=(t,e,r)=>new Eo(t,e,r);L.u8=t=>new Jt(1,t);L.u16=t=>new Jt(2,t);L.u24=t=>new Jt(3,t);L.u32=t=>new Jt(4,t);L.u40=t=>new Jt(5,t);L.u48=t=>new Jt(6,t);L.nu64=t=>new Ua(t);L.u16be=t=>new er(2,t);L.u24be=t=>new er(3,t);L.u32be=t=>new er(4,t);L.u40be=t=>new er(5,t);L.u48be=t=>new er(6,t);L.nu64be=t=>new Da(t);L.s8=t=>new Cr(1,t);L.s16=t=>new Cr(2,t);L.s24=t=>new Cr(3,t);L.s32=t=>new Cr(4,t);L.s40=t=>new Cr(5,t);L.s48=t=>new Cr(6,t);L.ns64=t=>new Ma(t);L.s16be=t=>new an(2,t);L.s24be=t=>new an(3,t);L.s32be=t=>new an(4,t);L.s40be=t=>new an(5,t);L.s48be=t=>new an(6,t);L.ns64be=t=>new ja(t);L.f32=t=>new Fa(t);L.f32be=t=>new Za(t);L.f64=t=>new Va(t);L.f64be=t=>new Wa(t);L.struct=(t,e,r)=>new qa(t,e,r);L.bits=(t,e,r)=>new ko(t,e,r);L.seq=(t,e,r)=>new Ka(t,e,r);L.union=(t,e,r)=>new Ro(t,e,r);L.unionLayoutDiscriminator=(t,e)=>new gi(t,e);L.blob=(t,e)=>new Ja(t,e);L.cstr=t=>new Ya(t);L.utf8=(t,e)=>new Xa(t,e);L.constant=(t,e)=>new Qa(t,e)});function To(){if(!oc&&(oc=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!oc))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return oc(ZA)}var oc,ZA,cp=Mt(()=>{ZA=new Uint8Array(16)});var __,b_=Mt(()=>{__=/^(?:[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 VA(t){return typeof t=="string"&&__.test(t)}var un,$o=Mt(()=>{b_();un=VA});function WA(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=(Ot[t[e+0]]+Ot[t[e+1]]+Ot[t[e+2]]+Ot[t[e+3]]+"-"+Ot[t[e+4]]+Ot[t[e+5]]+"-"+Ot[t[e+6]]+Ot[t[e+7]]+"-"+Ot[t[e+8]]+Ot[t[e+9]]+"-"+Ot[t[e+10]]+Ot[t[e+11]]+Ot[t[e+12]]+Ot[t[e+13]]+Ot[t[e+14]]+Ot[t[e+15]]).toLowerCase();if(!un(r))throw TypeError("Stringified UUID is invalid");return r}var Ot,sc,ln,Lo=Mt(()=>{$o();Ot=[];for(sc=0;sc<256;++sc)Ot.push((sc+256).toString(16).substr(1));ln=WA});function KA(t,e,r){var i=e&&r||0,n=e||new Array(16);t=t||{};var o=t.node||v_,s=t.clockseq!==void 0?t.clockseq:up;if(o==null||s==null){var c=t.random||(t.rng||To)();o==null&&(o=v_=[c[0]|1,c[1],c[2],c[3],c[4],c[5]]),s==null&&(s=up=(c[6]<<8|c[7])&16383)}var u=t.msecs!==void 0?t.msecs:Date.now(),p=t.nsecs!==void 0?t.nsecs:fp+1,m=u-lp+(p-fp)/1e4;if(m<0&&t.clockseq===void 0&&(s=s+1&16383),(m<0||u>lp)&&t.nsecs===void 0&&(p=0),p>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");lp=u,fp=p,up=s,u+=122192928e5;var _=((u&268435455)*1e4+p)%4294967296;n[i++]=_>>>24&255,n[i++]=_>>>16&255,n[i++]=_>>>8&255,n[i++]=_&255;var w=u/4294967296*1e4&268435455;n[i++]=w>>>8&255,n[i++]=w&255,n[i++]=w>>>24&15|16,n[i++]=w>>>16&255,n[i++]=s>>>8|128,n[i++]=s&255;for(var g=0;g<6;++g)n[i+g]=o[g];return e||ln(n)}var v_,up,lp,fp,w_,x_=Mt(()=>{cp();Lo();lp=0,fp=0;w_=KA});function qA(t){if(!un(t))throw TypeError("Invalid UUID");var e,r=new Uint8Array(16);return r[0]=(e=parseInt(t.slice(0,8),16))>>>24,r[1]=e>>>16&255,r[2]=e>>>8&255,r[3]=e&255,r[4]=(e=parseInt(t.slice(9,13),16))>>>8,r[5]=e&255,r[6]=(e=parseInt(t.slice(14,18),16))>>>8,r[7]=e&255,r[8]=(e=parseInt(t.slice(19,23),16))>>>8,r[9]=e&255,r[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,r[11]=e/4294967296&255,r[12]=e>>>24&255,r[13]=e>>>16&255,r[14]=e>>>8&255,r[15]=e&255,r}var ac,dp=Mt(()=>{$o();ac=qA});function HA(t){t=unescape(encodeURIComponent(t));for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r));return e}function cc(t,e,r){function i(n,o,s,c){if(typeof n=="string"&&(n=HA(n)),typeof o=="string"&&(o=ac(o)),o.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var u=new Uint8Array(16+n.length);if(u.set(o),u.set(n,o.length),u=r(u),u[6]=u[6]&15|e,u[8]=u[8]&63|128,s){c=c||0;for(var p=0;p<16;++p)s[c+p]=u[p];return s}return ln(u)}try{i.name=t}catch{}return i.DNS=GA,i.URL=JA,i}var GA,JA,hp=Mt(()=>{Lo();dp();GA="6ba7b810-9dad-11d1-80b4-00c04fd430c8",JA="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});function YA(t){if(typeof t=="string"){var e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(var r=0;r<e.length;++r)t[r]=e.charCodeAt(r)}return XA(QA(eO(t),t.length*8))}function XA(t){for(var e=[],r=t.length*32,i="0123456789abcdef",n=0;n<r;n+=8){var o=t[n>>5]>>>n%32&255,s=parseInt(i.charAt(o>>>4&15)+i.charAt(o&15),16);e.push(s)}return e}function S_(t){return(t+64>>>9<<4)+14+1}function QA(t,e){t[e>>5]|=128<<e%32,t[S_(e)-1]=e;for(var r=1732584193,i=-271733879,n=-1732584194,o=271733878,s=0;s<t.length;s+=16){var c=r,u=i,p=n,m=o;r=Bt(r,i,n,o,t[s],7,-680876936),o=Bt(o,r,i,n,t[s+1],12,-389564586),n=Bt(n,o,r,i,t[s+2],17,606105819),i=Bt(i,n,o,r,t[s+3],22,-1044525330),r=Bt(r,i,n,o,t[s+4],7,-176418897),o=Bt(o,r,i,n,t[s+5],12,1200080426),n=Bt(n,o,r,i,t[s+6],17,-1473231341),i=Bt(i,n,o,r,t[s+7],22,-45705983),r=Bt(r,i,n,o,t[s+8],7,1770035416),o=Bt(o,r,i,n,t[s+9],12,-1958414417),n=Bt(n,o,r,i,t[s+10],17,-42063),i=Bt(i,n,o,r,t[s+11],22,-1990404162),r=Bt(r,i,n,o,t[s+12],7,1804603682),o=Bt(o,r,i,n,t[s+13],12,-40341101),n=Bt(n,o,r,i,t[s+14],17,-1502002290),i=Bt(i,n,o,r,t[s+15],22,1236535329),r=zt(r,i,n,o,t[s+1],5,-165796510),o=zt(o,r,i,n,t[s+6],9,-1069501632),n=zt(n,o,r,i,t[s+11],14,643717713),i=zt(i,n,o,r,t[s],20,-373897302),r=zt(r,i,n,o,t[s+5],5,-701558691),o=zt(o,r,i,n,t[s+10],9,38016083),n=zt(n,o,r,i,t[s+15],14,-660478335),i=zt(i,n,o,r,t[s+4],20,-405537848),r=zt(r,i,n,o,t[s+9],5,568446438),o=zt(o,r,i,n,t[s+14],9,-1019803690),n=zt(n,o,r,i,t[s+3],14,-187363961),i=zt(i,n,o,r,t[s+8],20,1163531501),r=zt(r,i,n,o,t[s+13],5,-1444681467),o=zt(o,r,i,n,t[s+2],9,-51403784),n=zt(n,o,r,i,t[s+7],14,1735328473),i=zt(i,n,o,r,t[s+12],20,-1926607734),r=Ct(r,i,n,o,t[s+5],4,-378558),o=Ct(o,r,i,n,t[s+8],11,-2022574463),n=Ct(n,o,r,i,t[s+11],16,1839030562),i=Ct(i,n,o,r,t[s+14],23,-35309556),r=Ct(r,i,n,o,t[s+1],4,-1530992060),o=Ct(o,r,i,n,t[s+4],11,1272893353),n=Ct(n,o,r,i,t[s+7],16,-155497632),i=Ct(i,n,o,r,t[s+10],23,-1094730640),r=Ct(r,i,n,o,t[s+13],4,681279174),o=Ct(o,r,i,n,t[s],11,-358537222),n=Ct(n,o,r,i,t[s+3],16,-722521979),i=Ct(i,n,o,r,t[s+6],23,76029189),r=Ct(r,i,n,o,t[s+9],4,-640364487),o=Ct(o,r,i,n,t[s+12],11,-421815835),n=Ct(n,o,r,i,t[s+15],16,530742520),i=Ct(i,n,o,r,t[s+2],23,-995338651),r=Ut(r,i,n,o,t[s],6,-198630844),o=Ut(o,r,i,n,t[s+7],10,1126891415),n=Ut(n,o,r,i,t[s+14],15,-1416354905),i=Ut(i,n,o,r,t[s+5],21,-57434055),r=Ut(r,i,n,o,t[s+12],6,1700485571),o=Ut(o,r,i,n,t[s+3],10,-1894986606),n=Ut(n,o,r,i,t[s+10],15,-1051523),i=Ut(i,n,o,r,t[s+1],21,-2054922799),r=Ut(r,i,n,o,t[s+8],6,1873313359),o=Ut(o,r,i,n,t[s+15],10,-30611744),n=Ut(n,o,r,i,t[s+6],15,-1560198380),i=Ut(i,n,o,r,t[s+13],21,1309151649),r=Ut(r,i,n,o,t[s+4],6,-145523070),o=Ut(o,r,i,n,t[s+11],10,-1120210379),n=Ut(n,o,r,i,t[s+2],15,718787259),i=Ut(i,n,o,r,t[s+9],21,-343485551),r=fn(r,c),i=fn(i,u),n=fn(n,p),o=fn(o,m)}return[r,i,n,o]}function eO(t){if(t.length===0)return[];for(var e=t.length*8,r=new Uint32Array(S_(e)),i=0;i<e;i+=8)r[i>>5]|=(t[i/8]&255)<<i%32;return r}function fn(t,e){var r=(t&65535)+(e&65535),i=(t>>16)+(e>>16)+(r>>16);return i<<16|r&65535}function tO(t,e){return t<<e|t>>>32-e}function uc(t,e,r,i,n,o){return fn(tO(fn(fn(e,t),fn(i,o)),n),r)}function Bt(t,e,r,i,n,o,s){return uc(e&r|~e&i,t,e,n,o,s)}function zt(t,e,r,i,n,o,s){return uc(e&i|r&~i,t,e,n,o,s)}function Ct(t,e,r,i,n,o,s){return uc(e^r^i,t,e,n,o,s)}function Ut(t,e,r,i,n,o,s){return uc(r^(e|~i),t,e,n,o,s)}var E_,I_=Mt(()=>{E_=YA});var rO,R_,k_=Mt(()=>{hp();I_();rO=cc("v3",48,E_),R_=rO});function nO(t,e,r){t=t||{};var i=t.random||(t.rng||To)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){r=r||0;for(var n=0;n<16;++n)e[r+n]=i[n];return e}return ln(i)}var A_,O_=Mt(()=>{cp();Lo();A_=nO});function iO(t,e,r,i){switch(t){case 0:return e&r^~e&i;case 1:return e^r^i;case 2:return e&r^e&i^r&i;case 3:return e^r^i}}function pp(t,e){return t<<e|t>>>32-e}function oO(t){var e=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof t=="string"){var i=unescape(encodeURIComponent(t));t=[];for(var n=0;n<i.length;++n)t.push(i.charCodeAt(n))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);for(var o=t.length/4+2,s=Math.ceil(o/16),c=new Array(s),u=0;u<s;++u){for(var p=new Uint32Array(16),m=0;m<16;++m)p[m]=t[u*64+m*4]<<24|t[u*64+m*4+1]<<16|t[u*64+m*4+2]<<8|t[u*64+m*4+3];c[u]=p}c[s-1][14]=(t.length-1)*8/Math.pow(2,32),c[s-1][14]=Math.floor(c[s-1][14]),c[s-1][15]=(t.length-1)*8&4294967295;for(var _=0;_<s;++_){for(var w=new Uint32Array(80),g=0;g<16;++g)w[g]=c[_][g];for(var A=16;A<80;++A)w[A]=pp(w[A-3]^w[A-8]^w[A-14]^w[A-16],1);for(var I=r[0],R=r[1],T=r[2],B=r[3],$=r[4],C=0;C<80;++C){var Q=Math.floor(C/20),J=pp(I,5)+iO(Q,R,T,B)+$+e[Q]+w[C]>>>0;$=B,B=T,T=pp(R,30)>>>0,R=I,I=J}r[0]=r[0]+I>>>0,r[1]=r[1]+R>>>0,r[2]=r[2]+T>>>0,r[3]=r[3]+B>>>0,r[4]=r[4]+$>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var N_,T_=Mt(()=>{N_=oO});var sO,$_,L_=Mt(()=>{hp();T_();sO=cc("v5",80,N_),$_=sO});var P_,B_=Mt(()=>{P_="00000000-0000-0000-0000-000000000000"});function aO(t){if(!un(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}var z_,C_=Mt(()=>{$o();z_=aO});var mp={};kt(mp,{NIL:()=>P_,parse:()=>ac,stringify:()=>ln,v1:()=>w_,v3:()=>R_,v4:()=>A_,v5:()=>$_,validate:()=>un,version:()=>z_});var gp=Mt(()=>{x_();k_();O_();L_();B_();C_();$o();Lo();dp()});var D_=Vt((N4,U_)=>{"use strict";var cO=(gp(),ou(mp)).v4,uO=function(t,e,r,i){if(typeof t!="string")throw new TypeError(t+" must be a string");i=i||{};let n=typeof i.version=="number"?i.version:2;if(n!==1&&n!==2)throw new TypeError(n+" must be 1 or 2");let o={method:t};if(n===2&&(o.jsonrpc="2.0"),e){if(typeof e!="object"&&!Array.isArray(e))throw new TypeError(e+" must be an object, array or omitted");o.params=e}if(typeof r>"u"){let s=typeof i.generator=="function"?i.generator:function(){return cO()};o.id=s(o,i)}else n===2&&r===null?i.notificationIdNull&&(o.id=null):o.id=r;return o};U_.exports=uO});var j_=Vt((T4,M_)=>{"use strict";var lO=(gp(),ou(mp)).v4,fO=D_(),Po=function(t,e){if(!(this instanceof Po))return new Po(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 lO()},version:typeof e.version<"u"?e.version:2,notificationIdNull:typeof e.notificationIdNull=="boolean"?e.notificationIdNull:!1},this.callServer=t};M_.exports=Po;Po.prototype.request=function(t,e,r,i){let n=this,o=null,s=Array.isArray(t)&&typeof e=="function";if(this.options.version===1&&s)throw new TypeError("JSON-RPC 1.0 does not support batching");if(s||!s&&t&&typeof t=="object"&&typeof e=="function")i=e,o=t;else{typeof r=="function"&&(i=r,r=void 0);let p=typeof i=="function";try{o=fO(t,e,r,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(m){if(p)return i(m);throw m}if(!p)return o}let u;try{u=JSON.stringify(o,this.options.replacer)}catch(p){return i(p)}return this.callServer(u,function(p,m){n._parseResponse(p,m,i)}),o};Po.prototype._parseResponse=function(t,e,r){if(t){r(t);return}if(!e)return r();let i;try{i=JSON.parse(e,this.options.reviver)}catch(n){return r(n)}if(r.length===3)if(Array.isArray(i)){let n=function(s){return typeof s.error<"u"},o=function(s){return!n(s)};return r(null,i.filter(n),i.filter(o))}else return r(null,i.error,i.result);r(null,i)}});var Z_=Vt(($4,yp)=>{"use strict";var dO=Object.prototype.hasOwnProperty,Ft="~";function Bo(){}Object.create&&(Bo.prototype=Object.create(null),new Bo().__proto__||(Ft=!1));function hO(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function F_(t,e,r,i,n){if(typeof r!="function")throw new TypeError("The listener must be a function");var o=new hO(r,i||t,n),s=Ft?Ft+e:e;return t._events[s]?t._events[s].fn?t._events[s]=[t._events[s],o]:t._events[s].push(o):(t._events[s]=o,t._eventsCount++),t}function lc(t,e){--t._eventsCount===0?t._events=new Bo:delete t._events[e]}function Dt(){this._events=new Bo,this._eventsCount=0}Dt.prototype.eventNames=function(){var e=[],r,i;if(this._eventsCount===0)return e;for(i in r=this._events)dO.call(r,i)&&e.push(Ft?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(r)):e};Dt.prototype.listeners=function(e){var r=Ft?Ft+e:e,i=this._events[r];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,o=i.length,s=new Array(o);n<o;n++)s[n]=i[n].fn;return s};Dt.prototype.listenerCount=function(e){var r=Ft?Ft+e:e,i=this._events[r];return i?i.fn?1:i.length:0};Dt.prototype.emit=function(e,r,i,n,o,s){var c=Ft?Ft+e:e;if(!this._events[c])return!1;var u=this._events[c],p=arguments.length,m,_;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),p){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,r),!0;case 3:return u.fn.call(u.context,r,i),!0;case 4:return u.fn.call(u.context,r,i,n),!0;case 5:return u.fn.call(u.context,r,i,n,o),!0;case 6:return u.fn.call(u.context,r,i,n,o,s),!0}for(_=1,m=new Array(p-1);_<p;_++)m[_-1]=arguments[_];u.fn.apply(u.context,m)}else{var w=u.length,g;for(_=0;_<w;_++)switch(u[_].once&&this.removeListener(e,u[_].fn,void 0,!0),p){case 1:u[_].fn.call(u[_].context);break;case 2:u[_].fn.call(u[_].context,r);break;case 3:u[_].fn.call(u[_].context,r,i);break;case 4:u[_].fn.call(u[_].context,r,i,n);break;default:if(!m)for(g=1,m=new Array(p-1);g<p;g++)m[g-1]=arguments[g];u[_].fn.apply(u[_].context,m)}}return!0};Dt.prototype.on=function(e,r,i){return F_(this,e,r,i,!1)};Dt.prototype.once=function(e,r,i){return F_(this,e,r,i,!0)};Dt.prototype.removeListener=function(e,r,i,n){var o=Ft?Ft+e:e;if(!this._events[o])return this;if(!r)return lc(this,o),this;var s=this._events[o];if(s.fn)s.fn===r&&(!n||s.once)&&(!i||s.context===i)&&lc(this,o);else{for(var c=0,u=[],p=s.length;c<p;c++)(s[c].fn!==r||n&&!s[c].once||i&&s[c].context!==i)&&u.push(s[c]);u.length?this._events[o]=u.length===1?u[0]:u:lc(this,o)}return this};Dt.prototype.removeAllListeners=function(e){var r;return e?(r=Ft?Ft+e:e,this._events[r]&&lc(this,r)):(this._events=new Bo,this._eventsCount=0),this};Dt.prototype.off=Dt.prototype.removeListener;Dt.prototype.addListener=Dt.prototype.on;Dt.prefixed=Ft;Dt.EventEmitter=Dt;typeof yp<"u"&&(yp.exports=Dt)});var i$={};kt(i$,{AddMiniApp:()=>Hn,Back:()=>fu,ComposeCast:()=>Pm,Context:()=>Fm,DEFAULT_READY_OPTIONS:()=>cu,Errors:()=>Ni,Ethereum:()=>jm,Haptics:()=>Bm,Manifest:()=>du,QuickAuth:()=>vm,Ready:()=>uu,SendToken:()=>zm,SignIn:()=>yn,SolanaConnection:()=>Ec,SwapToken:()=>Cm,ViewCast:()=>Um,ViewProfile:()=>Dm,ViewToken:()=>Mm,actionLaunchFrameSchema:()=>D0,actionLaunchMiniAppSchema:()=>M0,actionSchema:()=>F0,actionViewTokenSchema:()=>j0,aspectRatioSchema:()=>th,buttonSchema:()=>Z0,buttonTitleSchema:()=>mo,caip19TokenSchema:()=>Qd,createSimpleStringSchema:()=>Kr,createSolanaWalletProvider:()=>Yp,default:()=>n$,domainManifestSchema:()=>P1,domainMiniAppConfigSchema:()=>nh,domainSchema:()=>eh,encodedJsonFarcasterSignatureSchema:()=>rh,eventFrameAddedSchema:()=>q0,eventFrameRemovedSchema:()=>G0,eventMiniAppAddedSchema:()=>K0,eventMiniAppRemovedSchema:()=>H0,eventNotificationsEnabledSchema:()=>J0,frameHost:()=>WT,hexColorSchema:()=>si,jsonFarcasterSignatureHeaderSchema:()=>k1,miniAppEmbedNextSchema:()=>V0,miniAppHost:()=>le,miniAppHostCapabilityList:()=>hu,miniAppNameSchema:()=>oi,notificationDetailsSchema:()=>go,notificationsDisabledSchema:()=>Y0,quickAuth:()=>Ai,safeParseFrameEmbed:()=>A1,safeParseMiniAppEmbed:()=>W0,sdk:()=>xm,secureUrlSchema:()=>xt,sendNotificationRequestSchema:()=>O1,sendNotificationResponseSchema:()=>N1,serverEventSchema:()=>T1,unwrapSolanaProviderRequest:()=>em,wrapSolanaProviderRequest:()=>xT});var Hn={};kt(Hn,{InvalidDomainManifest:()=>su,RejectedByUser:()=>au});var Ni={};kt(Ni,{BaseError:()=>Fr});var Fr=class extends Error{name="BaseError";cause;constructor(e,r={}){super(e,r.cause?{cause:r.cause}:void 0),this.cause=r.cause}};var su=class extends Fr{name="AddMiniApp.InvalidDomainManifest";constructor(){super("Invalid domain manifest")}},au=class extends Fr{name="AddMiniApp.RejectedByUser";constructor(){super("Add miniapp rejected by user")}};var Pm={};var Bm={};var uu={};kt(uu,{DEFAULT_READY_OPTIONS:()=>cu});var cu={disableNativeGestures:!1};var yn={};kt(yn,{RejectedByUser:()=>lu});var lu=class extends Fr{name="SignIn.RejectedByUser";constructor(){super("Sign in rejected by user")}};var zm={};var Cm={};var Um={};var Dm={};var Mm={};var jm={};var fu={};kt(fu,{DEFAULT_BACK_STATE:()=>kv});var kv={visible:!1};var Fm={};var du={};kt(du,{getMiniAppConfig:()=>Av});function Av(t){return t.miniapp||t.frame}var hu=["wallet.getEthereumProvider","wallet.getSolanaProvider","actions.ready","actions.openUrl","actions.close","actions.setPrimaryButton","actions.addMiniApp","actions.signIn","actions.viewCast","actions.viewProfile","actions.composeCast","actions.viewToken","actions.sendToken","actions.swapToken","haptics.impactOccurred","haptics.notificationOccurred","haptics.selectionChanged","back"];var V={};kt(V,{$brand:()=>ds,$input:()=>Af,$output:()=>kf,NEVER:()=>p1,ZodAny:()=>i0,ZodArray:()=>a0,ZodBase64:()=>Dd,ZodBase64URL:()=>Md,ZodBigInt:()=>po,ZodBigIntFormat:()=>Zd,ZodBoolean:()=>ho,ZodCIDRv4:()=>Cd,ZodCIDRv6:()=>Ud,ZodCUID:()=>Nd,ZodCUID2:()=>Td,ZodCatch:()=>k0,ZodCustom:()=>ha,ZodDate:()=>la,ZodDefault:()=>w0,ZodDiscriminatedUnion:()=>c0,ZodE164:()=>jd,ZodEmail:()=>Rd,ZodEmoji:()=>Ad,ZodEnum:()=>lo,ZodError:()=>ux,ZodFile:()=>_0,ZodGUID:()=>na,ZodIPv4:()=>Bd,ZodIPv6:()=>zd,ZodISODate:()=>Qs,ZodISODateTime:()=>Xs,ZodISODuration:()=>ta,ZodISOTime:()=>ea,ZodIntersection:()=>u0,ZodIssueCode:()=>d1,ZodJWT:()=>Fd,ZodKSUID:()=>Pd,ZodLazy:()=>L0,ZodLiteral:()=>g0,ZodMap:()=>h0,ZodNaN:()=>O0,ZodNanoID:()=>Od,ZodNever:()=>o0,ZodNonOptional:()=>Jd,ZodNull:()=>r0,ZodNullable:()=>v0,ZodNumber:()=>fo,ZodNumberFormat:()=>ii,ZodObject:()=>fa,ZodOptional:()=>Gd,ZodPipe:()=>Yd,ZodPrefault:()=>S0,ZodPromise:()=>B0,ZodReadonly:()=>N0,ZodRealError:()=>ni,ZodRecord:()=>qd,ZodSet:()=>p0,ZodString:()=>ca,ZodStringFormat:()=>Pe,ZodSuccess:()=>R0,ZodSymbol:()=>e0,ZodTemplateLiteral:()=>$0,ZodTransform:()=>b0,ZodTuple:()=>f0,ZodType:()=>ge,ZodULID:()=>$d,ZodURL:()=>kd,ZodUUID:()=>Or,ZodUndefined:()=>t0,ZodUnion:()=>Kd,ZodUnknown:()=>Vd,ZodVoid:()=>s0,ZodXID:()=>Ld,_ZodString:()=>Id,_default:()=>x0,any:()=>Fx,array:()=>Wd,base64:()=>Ox,base64url:()=>Nx,bigint:()=>Cx,boolean:()=>Qg,catch:()=>A0,check:()=>z0,cidrv4:()=>kx,cidrv6:()=>Ax,clone:()=>Xt,coerce:()=>Xd,config:()=>Ye,core:()=>Ar,cuid:()=>vx,cuid2:()=>wx,custom:()=>a1,date:()=>Vx,discriminatedUnion:()=>Gx,e164:()=>Tx,email:()=>fx,emoji:()=>_x,endsWith:()=>ro,enum:()=>m0,file:()=>t1,flattenError:()=>ji,float32:()=>Lx,float64:()=>Px,formatError:()=>Fi,function:()=>hd,getErrorMap:()=>g1,globalRegistry:()=>mr,gt:()=>Rr,gte:()=>Kt,guid:()=>dx,includes:()=>eo,instanceof:()=>c1,int:()=>Ed,int32:()=>Bx,int64:()=>Ux,intersection:()=>l0,ipv4:()=>Ix,ipv6:()=>Rx,iso:()=>ra,json:()=>l1,jwt:()=>$x,keyof:()=>Wx,ksuid:()=>Ex,lazy:()=>P0,length:()=>ri,literal:()=>y0,locales:()=>Hi,looseObject:()=>Hx,lowercase:()=>Xi,lt:()=>Ir,lte:()=>ir,map:()=>Xx,maxLength:()=>ti,maxSize:()=>ei,mime:()=>no,minLength:()=>Wr,minSize:()=>En,multipleOf:()=>Sn,nan:()=>i1,nanoid:()=>bx,nativeEnum:()=>e1,negative:()=>id,never:()=>ua,nonnegative:()=>sd,nonoptional:()=>I0,nonpositive:()=>od,normalize:()=>io,null:()=>n0,nullable:()=>sa,nullish:()=>r1,number:()=>Xg,object:()=>Kx,optional:()=>oa,overwrite:()=>kr,parse:()=>bd,parseAsync:()=>vd,partialRecord:()=>Yx,pipe:()=>aa,positive:()=>nd,prefault:()=>E0,preprocess:()=>f1,prettifyError:()=>Ru,promise:()=>s1,property:()=>ad,readonly:()=>T0,record:()=>d0,refine:()=>C0,regex:()=>Yi,regexes:()=>wn,registry:()=>Os,safeParse:()=>wd,safeParseAsync:()=>xd,set:()=>Qx,setErrorMap:()=>m1,size:()=>Ji,startsWith:()=>to,strictObject:()=>qx,string:()=>Sd,stringbool:()=>u1,success:()=>n1,superRefine:()=>U0,symbol:()=>Mx,templateLiteral:()=>o1,toJSONSchema:()=>pd,toLowerCase:()=>so,toUpperCase:()=>ao,transform:()=>Hd,treeifyError:()=>Iu,trim:()=>oo,tuple:()=>Jx,uint32:()=>zx,uint64:()=>Dx,ulid:()=>xx,undefined:()=>jx,union:()=>da,unknown:()=>ia,uppercase:()=>Qi,url:()=>yx,uuid:()=>hx,uuidv4:()=>px,uuidv6:()=>mx,uuidv7:()=>gx,void:()=>Zx,xid:()=>Sx});var Ar={};kt(Ar,{$ZodAny:()=>Ql,$ZodArray:()=>Ki,$ZodAsyncError:()=>pr,$ZodBase64:()=>Vl,$ZodBase64URL:()=>Wl,$ZodBigInt:()=>Rs,$ZodBigIntFormat:()=>Gl,$ZodBoolean:()=>Wi,$ZodCIDRv4:()=>jl,$ZodCIDRv6:()=>Fl,$ZodCUID:()=>Nl,$ZodCUID2:()=>Tl,$ZodCatch:()=>vf,$ZodCheck:()=>Ve,$ZodCheckBigIntFormat:()=>sl,$ZodCheckEndsWith:()=>_l,$ZodCheckGreaterThan:()=>xs,$ZodCheckIncludes:()=>gl,$ZodCheckLengthEquals:()=>dl,$ZodCheckLessThan:()=>ws,$ZodCheckLowerCase:()=>pl,$ZodCheckMaxLength:()=>ll,$ZodCheckMaxSize:()=>al,$ZodCheckMimeType:()=>vl,$ZodCheckMinLength:()=>fl,$ZodCheckMinSize:()=>cl,$ZodCheckMultipleOf:()=>il,$ZodCheckNumberFormat:()=>ol,$ZodCheckOverwrite:()=>wl,$ZodCheckProperty:()=>bl,$ZodCheckRegex:()=>hl,$ZodCheckSizeEquals:()=>ul,$ZodCheckStartsWith:()=>yl,$ZodCheckStringFormat:()=>Yn,$ZodCheckUpperCase:()=>ml,$ZodCustom:()=>Rf,$ZodDate:()=>rf,$ZodDefault:()=>gf,$ZodDiscriminatedUnion:()=>of,$ZodE164:()=>Kl,$ZodEmail:()=>Rl,$ZodEmoji:()=>Al,$ZodEnum:()=>lf,$ZodError:()=>Mi,$ZodFile:()=>df,$ZodFunction:()=>Ys,$ZodGUID:()=>El,$ZodIPv4:()=>Dl,$ZodIPv6:()=>Ml,$ZodISODate:()=>zl,$ZodISODateTime:()=>Bl,$ZodISODuration:()=>Ul,$ZodISOTime:()=>Cl,$ZodIntersection:()=>sf,$ZodJWT:()=>ql,$ZodKSUID:()=>Pl,$ZodLazy:()=>If,$ZodLiteral:()=>ff,$ZodMap:()=>cf,$ZodNaN:()=>wf,$ZodNanoID:()=>Ol,$ZodNever:()=>ef,$ZodNonOptional:()=>_f,$ZodNull:()=>Xl,$ZodNullable:()=>mf,$ZodNumber:()=>Is,$ZodNumberFormat:()=>Hl,$ZodObject:()=>nf,$ZodOptional:()=>pf,$ZodPipe:()=>qi,$ZodPrefault:()=>yf,$ZodPromise:()=>Ef,$ZodReadonly:()=>xf,$ZodRealError:()=>Jn,$ZodRecord:()=>af,$ZodRegistry:()=>Xn,$ZodSet:()=>uf,$ZodString:()=>Vi,$ZodStringFormat:()=>Te,$ZodSuccess:()=>bf,$ZodSymbol:()=>Jl,$ZodTemplateLiteral:()=>Sf,$ZodTransform:()=>hf,$ZodTuple:()=>xn,$ZodType:()=>ae,$ZodULID:()=>$l,$ZodURL:()=>kl,$ZodUUID:()=>Il,$ZodUndefined:()=>Yl,$ZodUnion:()=>ks,$ZodUnknown:()=>Vr,$ZodVoid:()=>tf,$ZodXID:()=>Ll,$brand:()=>ds,$constructor:()=>O,$input:()=>Af,$output:()=>kf,Doc:()=>Zi,JSONSchema:()=>Gg,JSONSchemaGenerator:()=>uo,_any:()=>Yf,_array:()=>co,_base64:()=>qs,_base64url:()=>Hs,_bigint:()=>Vf,_boolean:()=>Ff,_catch:()=>rx,_cidrv4:()=>Ws,_cidrv6:()=>Ks,_coercedBigint:()=>Wf,_coercedBoolean:()=>Zf,_coercedDate:()=>td,_coercedNumber:()=>zf,_coercedString:()=>Nf,_cuid:()=>Us,_cuid2:()=>Ds,_custom:()=>ld,_date:()=>ed,_default:()=>Qw,_discriminatedUnion:()=>Fw,_e164:()=>Gs,_email:()=>Ns,_emoji:()=>zs,_endsWith:()=>ro,_enum:()=>qw,_file:()=>ud,_float32:()=>Uf,_float64:()=>Df,_gt:()=>Rr,_gte:()=>Kt,_guid:()=>Gi,_includes:()=>eo,_int:()=>Cf,_int32:()=>Mf,_int64:()=>Kf,_intersection:()=>Zw,_ipv4:()=>Zs,_ipv6:()=>Vs,_isoDate:()=>$f,_isoDateTime:()=>Tf,_isoDuration:()=>Pf,_isoTime:()=>Lf,_jwt:()=>Js,_ksuid:()=>Fs,_lazy:()=>sx,_length:()=>ri,_literal:()=>Gw,_lowercase:()=>Xi,_lt:()=>Ir,_lte:()=>ir,_map:()=>Ww,_max:()=>ir,_maxLength:()=>ti,_maxSize:()=>ei,_mime:()=>no,_min:()=>Kt,_minLength:()=>Wr,_minSize:()=>En,_multipleOf:()=>Sn,_nan:()=>rd,_nanoid:()=>Cs,_nativeEnum:()=>Hw,_negative:()=>id,_never:()=>Xf,_nonnegative:()=>sd,_nonoptional:()=>ex,_nonpositive:()=>od,_normalize:()=>io,_null:()=>Jf,_nullable:()=>Xw,_number:()=>Bf,_optional:()=>Yw,_overwrite:()=>kr,_parse:()=>ps,_parseAsync:()=>gs,_pipe:()=>nx,_positive:()=>nd,_promise:()=>ax,_property:()=>ad,_readonly:()=>ix,_record:()=>Vw,_refine:()=>fd,_regex:()=>Yi,_safeParse:()=>_s,_safeParseAsync:()=>bs,_set:()=>Kw,_size:()=>Ji,_startsWith:()=>to,_string:()=>Of,_stringbool:()=>dd,_success:()=>tx,_symbol:()=>Hf,_templateLiteral:()=>ox,_toLowerCase:()=>so,_toUpperCase:()=>ao,_transform:()=>Jw,_trim:()=>oo,_tuple:()=>cd,_uint32:()=>jf,_uint64:()=>qf,_ulid:()=>Ms,_undefined:()=>Gf,_union:()=>jw,_unknown:()=>Qn,_uppercase:()=>Qi,_url:()=>Bs,_uuid:()=>Ts,_uuidv4:()=>$s,_uuidv6:()=>Ls,_uuidv7:()=>Ps,_void:()=>Qf,_xid:()=>js,clone:()=>Xt,config:()=>Ye,flattenError:()=>ji,formatError:()=>Fi,function:()=>hd,globalConfig:()=>Ti,globalRegistry:()=>mr,isValidBase64:()=>Zl,isValidBase64URL:()=>cg,isValidJWT:()=>ug,locales:()=>Hi,parse:()=>ms,parseAsync:()=>ys,prettifyError:()=>Ru,regexes:()=>wn,registry:()=>Os,safeParse:()=>ku,safeParseAsync:()=>Au,toDotPath:()=>Vm,toJSONSchema:()=>pd,treeifyError:()=>Iu,util:()=>K,version:()=>xl});function O(t,e,r){function i(c,u){var p;Object.defineProperty(c,"_zod",{value:c._zod??{},enumerable:!1}),(p=c._zod).traits??(p.traits=new Set),c._zod.traits.add(t),e(c,u);for(let m in s.prototype)m in c||Object.defineProperty(c,m,{value:s.prototype[m].bind(c)});c._zod.constr=s,c._zod.def=u}let n=r?.Parent??Object;class o extends n{}Object.defineProperty(o,"name",{value:t});function s(c){var u;let p=r?.Parent?new o:this;i(p,c),(u=p._zod).deferred??(u.deferred=[]);for(let m of p._zod.deferred)m();return p}return Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:c=>r?.Parent&&c instanceof r.Parent?!0:c?._zod?.traits?.has(t)}),Object.defineProperty(s,"name",{value:t}),s}var ds=Symbol("zod_brand"),pr=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ti={};function Ye(t){return t&&Object.assign(Ti,t),Ti}var K={};kt(K,{BIGINT_FORMAT_RANGES:()=>Su,Class:()=>mu,NUMBER_FORMAT_RANGES:()=>xu,aborted:()=>bn,allowsEval:()=>bu,assert:()=>Lv,assertEqual:()=>Ov,assertIs:()=>Tv,assertNever:()=>$v,assertNotEqual:()=>Nv,assignProp:()=>_u,cached:()=>Pi,cleanEnum:()=>Wv,cleanRegex:()=>Bi,clone:()=>Xt,createTransparentProxy:()=>Uv,defineLazy:()=>Ie,esc:()=>_n,escapeRegex:()=>Er,extend:()=>jv,finalizeIssue:()=>Qt,floatSafeRemainder:()=>yu,getElementAtPath:()=>Pv,getEnumValues:()=>Li,getLengthableOrigin:()=>Di,getParsedType:()=>Cv,getSizableOrigin:()=>Ui,isObject:()=>Gn,isPlainObject:()=>zi,issue:()=>Eu,joinValues:()=>z,jsonStringifyReplacer:()=>gu,merge:()=>Fv,normalizeParams:()=>j,nullish:()=>Zr,numKeys:()=>zv,omit:()=>Mv,optionalKeys:()=>wu,partial:()=>Zv,pick:()=>Dv,prefixIssues:()=>Wt,primitiveTypes:()=>vu,promiseAllObject:()=>Bv,propertyKeyTypes:()=>Ci,randomString:()=>hs,required:()=>Vv,stringifyPrimitive:()=>q,unwrapMessage:()=>$i});function Ov(t){return t}function Nv(t){return t}function Tv(t){}function $v(t){throw new Error}function Lv(t){}function Li(t){let e=Object.values(t).filter(i=>typeof i=="number");return Object.entries(t).filter(([i,n])=>e.indexOf(+i)===-1).map(([i,n])=>n)}function z(t,e="|"){return t.map(r=>q(r)).join(e)}function gu(t,e){return typeof e=="bigint"?e.toString():e}function Pi(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Zr(t){return t==null}function Bi(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function yu(t,e){let r=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,n=r>i?r:i,o=Number.parseInt(t.toFixed(n).replace(".","")),s=Number.parseInt(e.toFixed(n).replace(".",""));return o%s/10**n}function Ie(t,e,r){Object.defineProperty(t,e,{get(){{let n=r();return t[e]=n,n}throw new Error("cached value already set")},set(n){Object.defineProperty(t,e,{value:n})},configurable:!0})}function _u(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Pv(t,e){return e?e.reduce((r,i)=>r?.[i],t):t}function Bv(t){let e=Object.keys(t),r=e.map(i=>t[i]);return Promise.all(r).then(i=>{let n={};for(let o=0;o<e.length;o++)n[e[o]]=i[o];return n})}function hs(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<t;i++)r+=e[Math.floor(Math.random()*e.length)];return r}function _n(t){return JSON.stringify(t)}function Gn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var bu=Pi(()=>{try{let t=Function;return new t(""),!0}catch{return!1}});function zi(t){if(Gn(t)===!1)return!1;let e=t.constructor;if(e===void 0)return!0;let r=e.prototype;return!(Gn(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function zv(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}var Cv=t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},Ci=new Set(["string","number","symbol"]),vu=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Er(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xt(t,e,r){let i=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(i._zod.parent=t),i}function j(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function Uv(t){let e;return new Proxy({},{get(r,i,n){return e??(e=t()),Reflect.get(e,i,n)},set(r,i,n,o){return e??(e=t()),Reflect.set(e,i,n,o)},has(r,i){return e??(e=t()),Reflect.has(e,i)},deleteProperty(r,i){return e??(e=t()),Reflect.deleteProperty(e,i)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,i){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,i)},defineProperty(r,i,n){return e??(e=t()),Reflect.defineProperty(e,i,n)}})}function q(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function wu(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}var xu={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Su={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Dv(t,e){let r={},i=t._zod.def;for(let n in e){if(!(n in i.shape))throw new Error(`Unrecognized key: "${n}"`);e[n]&&(r[n]=i.shape[n])}return Xt(t,{...t._zod.def,shape:r,checks:[]})}function Mv(t,e){let r={...t._zod.def.shape},i=t._zod.def;for(let n in e){if(!(n in i.shape))throw new Error(`Unrecognized key: "${n}"`);e[n]&&delete r[n]}return Xt(t,{...t._zod.def,shape:r,checks:[]})}function jv(t,e){let r={...t._zod.def,get shape(){let i={...t._zod.def.shape,...e};return _u(this,"shape",i),i},checks:[]};return Xt(t,r)}function Fv(t,e){return Xt(t,{...t._zod.def,get shape(){let r={...t._zod.def.shape,...e._zod.def.shape};return _u(this,"shape",r),r},catchall:e._zod.def.catchall,checks:[]})}function Zv(t,e,r){let i=e._zod.def.shape,n={...i};if(r)for(let o in r){if(!(o in i))throw new Error(`Unrecognized key: "${o}"`);r[o]&&(n[o]=t?new t({type:"optional",innerType:i[o]}):i[o])}else for(let o in i)n[o]=t?new t({type:"optional",innerType:i[o]}):i[o];return Xt(e,{...e._zod.def,shape:n,checks:[]})}function Vv(t,e,r){let i=e._zod.def.shape,n={...i};if(r)for(let o in r){if(!(o in n))throw new Error(`Unrecognized key: "${o}"`);r[o]&&(n[o]=new t({type:"nonoptional",innerType:i[o]}))}else for(let o in i)n[o]=new t({type:"nonoptional",innerType:i[o]});return Xt(e,{...e._zod.def,shape:n,checks:[]})}function bn(t,e=0){for(let r=e;r<t.issues.length;r++)if(t.issues[r].continue!==!0)return!0;return!1}function Wt(t,e){return e.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(t),r})}function $i(t){return typeof t=="string"?t:t?.message}function Qt(t,e,r){let i={...t,path:t.path??[]};if(!t.message){let n=$i(t.inst?._zod.def?.error?.(t))??$i(e?.error?.(t))??$i(r.customError?.(t))??$i(r.localeError?.(t))??"Invalid input";i.message=n}return delete i.inst,delete i.continue,e?.reportInput||delete i.input,i}function Ui(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function Di(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function Eu(...t){let[e,r,i]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:i}:{...e}}function Wv(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}var mu=class{constructor(...e){}};var Zm=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),Object.defineProperty(t,"message",{get(){return JSON.stringify(e,gu,2)},enumerable:!0})},Mi=O("$ZodError",Zm),Jn=O("$ZodError",Zm,{Parent:Error});function ji(t,e=r=>r.message){let r={},i=[];for(let n of t.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(e(n))):i.push(e(n));return{formErrors:i,fieldErrors:r}}function Fi(t,e){let r=e||function(o){return o.message},i={_errors:[]},n=o=>{for(let s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(c=>n({issues:c}));else if(s.code==="invalid_key")n({issues:s.issues});else if(s.code==="invalid_element")n({issues:s.issues});else if(s.path.length===0)i._errors.push(r(s));else{let c=i,u=0;for(;u<s.path.length;){let p=s.path[u];u===s.path.length-1?(c[p]=c[p]||{_errors:[]},c[p]._errors.push(r(s))):c[p]=c[p]||{_errors:[]},c=c[p],u++}}};return n(t),i}function Iu(t,e){let r=e||function(o){return o.message},i={errors:[]},n=(o,s=[])=>{var c,u;for(let p of o.issues)if(p.code==="invalid_union"&&p.errors.length)p.errors.map(m=>n({issues:m},p.path));else if(p.code==="invalid_key")n({issues:p.issues},p.path);else if(p.code==="invalid_element")n({issues:p.issues},p.path);else{let m=[...s,...p.path];if(m.length===0){i.errors.push(r(p));continue}let _=i,w=0;for(;w<m.length;){let g=m[w],A=w===m.length-1;typeof g=="string"?(_.properties??(_.properties={}),(c=_.properties)[g]??(c[g]={errors:[]}),_=_.properties[g]):(_.items??(_.items=[]),(u=_.items)[g]??(u[g]={errors:[]}),_=_.items[g]),A&&_.errors.push(r(p)),w++}}};return n(t),i}function Vm(t){let e=[];for(let r of t)typeof r=="number"?e.push(`[${r}]`):typeof r=="symbol"?e.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?e.push(`[${JSON.stringify(r)}]`):(e.length&&e.push("."),e.push(r));return e.join("")}function Ru(t){let e=[],r=[...t.issues].sort((i,n)=>i.path.length-n.path.length);for(let i of r)e.push(`\u2716 ${i.message}`),i.path?.length&&e.push(` \u2192 at ${Vm(i.path)}`);return e.join(`
2
+ `)}var ps=t=>(e,r,i,n)=>{let o=i?Object.assign(i,{async:!1}):{async:!1},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new pr;if(s.issues.length){let c=new(n?.Err??t)(s.issues.map(u=>Qt(u,o,Ye())));throw Error.captureStackTrace(c,n?.callee),c}return s.value},ms=ps(Jn),gs=t=>async(e,r,i,n)=>{let o=i?Object.assign(i,{async:!0}):{async:!0},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let c=new(n?.Err??t)(s.issues.map(u=>Qt(u,o,Ye())));throw Error.captureStackTrace(c,n?.callee),c}return s.value},ys=gs(Jn),_s=t=>(e,r,i)=>{let n=i?{...i,async:!1}:{async:!1},o=e._zod.run({value:r,issues:[]},n);if(o instanceof Promise)throw new pr;return o.issues.length?{success:!1,error:new(t??Mi)(o.issues.map(s=>Qt(s,n,Ye())))}:{success:!0,data:o.value}},ku=_s(Jn),bs=t=>async(e,r,i)=>{let n=i?Object.assign(i,{async:!0}):{async:!0},o=e._zod.run({value:r,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new t(o.issues.map(s=>Qt(s,n,Ye())))}:{success:!0,data:o.value}},Au=bs(Jn);var wn={};kt(wn,{_emoji:()=>Wm,base64:()=>Zu,base64url:()=>vs,bigint:()=>Ju,boolean:()=>Qu,browserEmail:()=>ew,cidrv4:()=>ju,cidrv6:()=>Fu,cuid:()=>Ou,cuid2:()=>Nu,date:()=>Ku,datetime:()=>Hu,domain:()=>tw,duration:()=>Bu,e164:()=>Wu,email:()=>Cu,emoji:()=>Uu,extendedDuration:()=>qv,guid:()=>zu,hostname:()=>Vu,html5Email:()=>Yv,integer:()=>Yu,ipv4:()=>Du,ipv6:()=>Mu,ksuid:()=>Lu,lowercase:()=>rl,nanoid:()=>Pu,null:()=>el,number:()=>Xu,rfc5322Email:()=>Xv,string:()=>Gu,time:()=>qu,ulid:()=>Tu,undefined:()=>tl,unicodeEmail:()=>Qv,uppercase:()=>nl,uuid:()=>vn,uuid4:()=>Hv,uuid6:()=>Gv,uuid7:()=>Jv,xid:()=>$u});var Ou=/^[cC][^\s-]{8,}$/,Nu=/^[0-9a-z]+$/,Tu=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,$u=/^[0-9a-vA-V]{20}$/,Lu=/^[A-Za-z0-9]{27}$/,Pu=/^[a-zA-Z0-9_-]{21}$/,Bu=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,qv=/^[-+]?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)?)??$/,zu=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,vn=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,Hv=vn(4),Gv=vn(6),Jv=vn(7),Cu=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Yv=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Xv=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Qv=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,ew=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Wm="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Uu(){return new RegExp(Wm,"u")}var Du=/^(?:(?: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])$/,Mu=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,ju=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,Fu=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Zu=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,vs=/^[A-Za-z0-9_-]*$/,Vu=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,tw=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Wu=/^\+(?:[0-9]){6,14}[0-9]$/,Km="((\\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])))",Ku=new RegExp(`^${Km}$`);function qm(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 qu(t){return new RegExp(`^${qm(t)}$`)}function Hu(t){let e=`${Km}T${qm(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}var Gu=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Ju=/^\d+n?$/,Yu=/^\d+$/,Xu=/^-?\d+(?:\.\d+)?/i,Qu=/true|false/i,el=/null/i;var tl=/undefined/i;var rl=/^[^A-Z]*$/,nl=/^[^a-z]*$/;var Ve=O("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),Gm={number:"number",bigint:"bigint",object:"date"},ws=O("$ZodCheckLessThan",(t,e)=>{Ve.init(t,e);let r=Gm[typeof e.value];t._zod.onattach.push(i=>{let n=i._zod.bag,o=(e.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(e.inclusive?n.maximum=e.value:n.exclusiveMaximum=e.value)}),t._zod.check=i=>{(e.inclusive?i.value<=e.value:i.value<e.value)||i.issues.push({origin:r,code:"too_big",maximum:e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),xs=O("$ZodCheckGreaterThan",(t,e)=>{Ve.init(t,e);let r=Gm[typeof e.value];t._zod.onattach.push(i=>{let n=i._zod.bag,o=(e.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?n.minimum=e.value:n.exclusiveMinimum=e.value)}),t._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:r,code:"too_small",minimum:e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),il=O("$ZodCheckMultipleOf",(t,e)=>{Ve.init(t,e),t._zod.onattach.push(r=>{var i;(i=r._zod.bag).multipleOf??(i.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):yu(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),ol=O("$ZodCheckNumberFormat",(t,e)=>{Ve.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),i=r?"int":"number",[n,o]=xu[e.format];t._zod.onattach.push(s=>{let c=s._zod.bag;c.format=e.format,c.minimum=n,c.maximum=o,r&&(c.pattern=Yu)}),t._zod.check=s=>{let c=s.value;if(r){if(!Number.isInteger(c)){s.issues.push({expected:i,format:e.format,code:"invalid_type",input:c,inst:t});return}if(!Number.isSafeInteger(c)){c>0?s.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,continue:!e.abort}):s.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,continue:!e.abort});return}}c<n&&s.issues.push({origin:"number",input:c,code:"too_small",minimum:n,inclusive:!0,inst:t,continue:!e.abort}),c>o&&s.issues.push({origin:"number",input:c,code:"too_big",maximum:o,inst:t})}}),sl=O("$ZodCheckBigIntFormat",(t,e)=>{Ve.init(t,e);let[r,i]=Su[e.format];t._zod.onattach.push(n=>{let o=n._zod.bag;o.format=e.format,o.minimum=r,o.maximum=i}),t._zod.check=n=>{let o=n.value;o<r&&n.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:!0,inst:t,continue:!e.abort}),o>i&&n.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inst:t})}}),al=O("$ZodCheckMaxSize",(t,e)=>{Ve.init(t,e),t._zod.when=r=>{let i=r.value;return!Zr(i)&&i.size!==void 0},t._zod.onattach.push(r=>{let i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(r._zod.bag.maximum=e.maximum)}),t._zod.check=r=>{let i=r.value;i.size<=e.maximum||r.issues.push({origin:Ui(i),code:"too_big",maximum:e.maximum,input:i,inst:t,continue:!e.abort})}}),cl=O("$ZodCheckMinSize",(t,e)=>{Ve.init(t,e),t._zod.when=r=>{let i=r.value;return!Zr(i)&&i.size!==void 0},t._zod.onattach.push(r=>{let i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(r._zod.bag.minimum=e.minimum)}),t._zod.check=r=>{let i=r.value;i.size>=e.minimum||r.issues.push({origin:Ui(i),code:"too_small",minimum:e.minimum,input:i,inst:t,continue:!e.abort})}}),ul=O("$ZodCheckSizeEquals",(t,e)=>{Ve.init(t,e),t._zod.when=r=>{let i=r.value;return!Zr(i)&&i.size!==void 0},t._zod.onattach.push(r=>{let i=r._zod.bag;i.minimum=e.size,i.maximum=e.size,i.size=e.size}),t._zod.check=r=>{let i=r.value,n=i.size;if(n===e.size)return;let o=n>e.size;r.issues.push({origin:Ui(i),...o?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},input:r.value,inst:t,continue:!e.abort})}}),ll=O("$ZodCheckMaxLength",(t,e)=>{Ve.init(t,e),t._zod.when=r=>{let i=r.value;return!Zr(i)&&i.length!==void 0},t._zod.onattach.push(r=>{let i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(r._zod.bag.maximum=e.maximum)}),t._zod.check=r=>{let i=r.value;if(i.length<=e.maximum)return;let o=Di(i);r.issues.push({origin:o,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),fl=O("$ZodCheckMinLength",(t,e)=>{Ve.init(t,e),t._zod.when=r=>{let i=r.value;return!Zr(i)&&i.length!==void 0},t._zod.onattach.push(r=>{let i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(r._zod.bag.minimum=e.minimum)}),t._zod.check=r=>{let i=r.value;if(i.length>=e.minimum)return;let o=Di(i);r.issues.push({origin:o,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),dl=O("$ZodCheckLengthEquals",(t,e)=>{Ve.init(t,e),t._zod.when=r=>{let i=r.value;return!Zr(i)&&i.length!==void 0},t._zod.onattach.push(r=>{let i=r._zod.bag;i.minimum=e.length,i.maximum=e.length,i.length=e.length}),t._zod.check=r=>{let i=r.value,n=i.length;if(n===e.length)return;let o=Di(i),s=n>e.length;r.issues.push({origin:o,...s?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},input:r.value,inst:t,continue:!e.abort})}}),Yn=O("$ZodCheckStringFormat",(t,e)=>{var r;Ve.init(t,e),t._zod.onattach.push(i=>{let n=i._zod.bag;n.format=e.format,e.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(e.pattern))}),(r=t._zod).check??(r.check=i=>{if(!e.pattern)throw new Error("Not implemented.");e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})})}),hl=O("$ZodCheckRegex",(t,e)=>{Yn.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),pl=O("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=rl),Yn.init(t,e)}),ml=O("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=nl),Yn.init(t,e)}),gl=O("$ZodCheckIncludes",(t,e)=>{Ve.init(t,e);let r=Er(e.includes),i=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=i,t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),t._zod.check=n=>{n.value.includes(e.includes,e.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:n.value,inst:t,continue:!e.abort})}}),yl=O("$ZodCheckStartsWith",(t,e)=>{Ve.init(t,e);let r=new RegExp(`^${Er(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),t._zod.check=i=>{i.value.startsWith(e.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:i.value,inst:t,continue:!e.abort})}}),_l=O("$ZodCheckEndsWith",(t,e)=>{Ve.init(t,e);let r=new RegExp(`.*${Er(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),t._zod.check=i=>{i.value.endsWith(e.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:i.value,inst:t,continue:!e.abort})}});function Hm(t,e,r){t.issues.length&&e.issues.push(...Wt(r,t.issues))}var bl=O("$ZodCheckProperty",(t,e)=>{Ve.init(t,e),t._zod.check=r=>{let i=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(i instanceof Promise)return i.then(n=>Hm(n,r,e.property));Hm(i,r,e.property)}}),vl=O("$ZodCheckMimeType",(t,e)=>{Ve.init(t,e);let r=new Set(e.mime);t._zod.onattach.push(i=>{i._zod.bag.mime=e.mime}),t._zod.check=i=>{r.has(i.value.type)||i.issues.push({code:"invalid_value",values:e.mime,input:i.value.type,path:["type"],inst:t})}}),wl=O("$ZodCheckOverwrite",(t,e)=>{Ve.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});var Zi=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let i=e.split(`
3
+ `).filter(s=>s),n=Math.min(...i.map(s=>s.length-s.trimStart().length)),o=i.map(s=>s.slice(n)).map(s=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let e=Function,r=this?.args,n=[...(this?.content??[""]).map(o=>` ${o}`)];return new e(...r,n.join(`
4
+ `))}};var xl={major:4,minor:0,patch:0};var ae=O("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.id=e.type+"_"+hs(10),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=xl;let i=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&i.unshift(t);for(let n of i)for(let o of n._zod.onattach)o(t);if(i.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let n=(o,s,c)=>{let u=bn(o),p;for(let m of s){if(m._zod.when){if(!m._zod.when(o))continue}else if(u)continue;let _=o.issues.length,w=m._zod.check(o);if(w instanceof Promise&&c?.async===!1)throw new pr;if(p||w instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await w,o.issues.length!==_&&(u||(u=bn(o,_)))});else{if(o.issues.length===_)continue;u||(u=bn(o,_))}}return p?p.then(()=>o):o};t._zod.run=(o,s)=>{let c=t._zod.parse(o,s);if(c instanceof Promise){if(s.async===!1)throw new pr;return c.then(u=>n(u,i,s))}return n(c,i,s)}}t["~standard"]={validate:n=>{try{let o=ku(t,n);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return Au(t,n).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}}),Vi=O("$ZodString",(t,e)=>{ae.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Gu(t._zod.bag),t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),Te=O("$ZodStringFormat",(t,e)=>{Yn.init(t,e),Vi.init(t,e)}),El=O("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=zu),Te.init(t,e)}),Il=O("$ZodUUID",(t,e)=>{if(e.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(i===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=vn(i))}else e.pattern??(e.pattern=vn());Te.init(t,e)}),Rl=O("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Cu),Te.init(t,e)}),kl=O("$ZodURL",(t,e)=>{Te.init(t,e),t._zod.check=r=>{try{let i=new URL(r.value);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Vu.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort}));return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),Al=O("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=Uu()),Te.init(t,e)}),Ol=O("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Pu),Te.init(t,e)}),Nl=O("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=Ou),Te.init(t,e)}),Tl=O("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Nu),Te.init(t,e)}),$l=O("$ZodULID",(t,e)=>{e.pattern??(e.pattern=Tu),Te.init(t,e)}),Ll=O("$ZodXID",(t,e)=>{e.pattern??(e.pattern=$u),Te.init(t,e)}),Pl=O("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Lu),Te.init(t,e)}),Bl=O("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=Hu(e)),Te.init(t,e)}),zl=O("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Ku),Te.init(t,e)}),Cl=O("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=qu(e)),Te.init(t,e)}),Ul=O("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=Bu),Te.init(t,e)}),Dl=O("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=Du),Te.init(t,e),t._zod.onattach.push(r=>{let i=r._zod.bag;i.format="ipv4"})}),Ml=O("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=Mu),Te.init(t,e),t._zod.onattach.push(r=>{let i=r._zod.bag;i.format="ipv6"}),t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),jl=O("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=ju),Te.init(t,e)}),Fl=O("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=Fu),Te.init(t,e),t._zod.check=r=>{let[i,n]=r.value.split("/");try{if(!n)throw new Error;let o=Number(n);if(`${o}`!==n)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${i}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function Zl(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}var Vl=O("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=Zu),Te.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),t._zod.check=r=>{Zl(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function cg(t){if(!vs.test(t))return!1;let e=t.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return Zl(r)}var Wl=O("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=vs),Te.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),t._zod.check=r=>{cg(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),Kl=O("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Wu),Te.init(t,e)});function ug(t,e=null){try{let r=t.split(".");if(r.length!==3)return!1;let[i]=r,n=JSON.parse(atob(i));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||e&&(!("alg"in n)||n.alg!==e))}catch{return!1}}var ql=O("$ZodJWT",(t,e)=>{Te.init(t,e),t._zod.check=r=>{ug(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),Is=O("$ZodNumber",(t,e)=>{ae.init(t,e),t._zod.pattern=t._zod.bag.pattern??Xu,t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let o=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:t,...o?{received:o}:{}}),r}}),Hl=O("$ZodNumber",(t,e)=>{ol.init(t,e),Is.init(t,e)}),Wi=O("$ZodBoolean",(t,e)=>{ae.init(t,e),t._zod.pattern=Qu,t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:t}),r}}),Rs=O("$ZodBigInt",(t,e)=>{ae.init(t,e),t._zod.pattern=Ju,t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=BigInt(r.value)}catch{}let{value:n}=r;return typeof n=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:n,inst:t}),r}}),Gl=O("$ZodBigInt",(t,e)=>{sl.init(t,e),Rs.init(t,e)}),Jl=O("$ZodSymbol",(t,e)=>{ae.init(t,e),t._zod.parse=(r,i)=>{let{value:n}=r;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:t}),r}}),Yl=O("$ZodUndefined",(t,e)=>{ae.init(t,e),t._zod.pattern=tl,t._zod.values=new Set([void 0]),t._zod.parse=(r,i)=>{let{value:n}=r;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:t}),r}}),Xl=O("$ZodNull",(t,e)=>{ae.init(t,e),t._zod.pattern=el,t._zod.values=new Set([null]),t._zod.parse=(r,i)=>{let{value:n}=r;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:t}),r}}),Ql=O("$ZodAny",(t,e)=>{ae.init(t,e),t._zod.parse=r=>r}),Vr=O("$ZodUnknown",(t,e)=>{ae.init(t,e),t._zod.parse=r=>r}),ef=O("$ZodNever",(t,e)=>{ae.init(t,e),t._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),tf=O("$ZodVoid",(t,e)=>{ae.init(t,e),t._zod.parse=(r,i)=>{let{value:n}=r;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:t}),r}}),rf=O("$ZodDate",(t,e)=>{ae.init(t,e),t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,o=n instanceof Date;return o&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...o?{received:"Invalid Date"}:{},inst:t}),r}});function Ym(t,e,r){t.issues.length&&e.issues.push(...Wt(r,t.issues)),e.value[r]=t.value}var Ki=O("$ZodArray",(t,e)=>{ae.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:t}),r;r.value=Array(n.length);let o=[];for(let s=0;s<n.length;s++){let c=n[s],u=e.element._zod.run({value:c,issues:[]},i);u instanceof Promise?o.push(u.then(p=>Ym(p,r,s))):Ym(u,r,s)}return o.length?Promise.all(o).then(()=>r):r}});function Ss(t,e,r){t.issues.length&&e.issues.push(...Wt(r,t.issues)),e.value[r]=t.value}function Xm(t,e,r,i){t.issues.length?i[r]===void 0?r in i?e.value[r]=void 0:e.value[r]=t.value:e.issues.push(...Wt(r,t.issues)):t.value===void 0?r in i&&(e.value[r]=void 0):e.value[r]=t.value}var nf=O("$ZodObject",(t,e)=>{ae.init(t,e);let r=Pi(()=>{let _=Object.keys(e.shape);for(let g of _)if(!(e.shape[g]instanceof ae))throw new Error(`Invalid element at key "${g}": expected a Zod schema`);let w=wu(e.shape);return{shape:e.shape,keys:_,keySet:new Set(_),numKeys:_.length,optionalKeys:new Set(w)}});Ie(t._zod,"propValues",()=>{let _=e.shape,w={};for(let g in _){let A=_[g]._zod;if(A.values){w[g]??(w[g]=new Set);for(let I of A.values)w[g].add(I)}}return w});let i=_=>{let w=new Zi(["shape","payload","ctx"]),{keys:g,optionalKeys:A}=r.value,I=B=>{let $=_n(B);return`shape[${$}]._zod.run({ value: input[${$}], issues: [] }, ctx)`};w.write("const input = payload.value;");let R=Object.create(null);for(let B of g)R[B]=hs(15);w.write("const newResult = {}");for(let B of g)if(A.has(B)){let $=R[B];w.write(`const ${$} = ${I(B)};`);let C=_n(B);w.write(`
5
+ if (${$}.issues.length) {
6
+ if (input[${C}] === undefined) {
7
+ if (${C} in input) {
8
+ newResult[${C}] = undefined;
9
+ }
10
+ } else {
11
+ payload.issues = payload.issues.concat(
12
+ ${$}.issues.map((iss) => ({
13
+ ...iss,
14
+ path: iss.path ? [${C}, ...iss.path] : [${C}],
15
+ }))
16
+ );
17
+ }
18
+ } else if (${$}.value === undefined) {
19
+ if (${C} in input) newResult[${C}] = undefined;
20
+ } else {
21
+ newResult[${C}] = ${$}.value;
22
+ }
23
+ `)}else{let $=R[B];w.write(`const ${$} = ${I(B)};`),w.write(`
24
+ if (${$}.issues.length) payload.issues = payload.issues.concat(${$}.issues.map(iss => ({
25
+ ...iss,
26
+ path: iss.path ? [${_n(B)}, ...iss.path] : [${_n(B)}]
27
+ })));`),w.write(`newResult[${_n(B)}] = ${$}.value`)}w.write("payload.value = newResult;"),w.write("return payload;");let T=w.compile();return(B,$)=>T(_,B,$)},n,o=Gn,s=!Ti.jitless,u=s&&bu.value,{catchall:p}=e,m;t._zod.parse=(_,w)=>{m??(m=r.value);let g=_.value;if(!o(g))return _.issues.push({expected:"object",code:"invalid_type",input:g,inst:t}),_;let A=[];if(s&&u&&w?.async===!1&&w.jitless!==!0)n||(n=i(e.shape)),_=n(_,w);else{_.value={};let $=m.shape;for(let C of m.keys){let Q=$[C],J=Q._zod.run({value:g[C],issues:[]},w),Y=Q._zod.optin==="optional"&&Q._zod.optout==="optional";J instanceof Promise?A.push(J.then(X=>Y?Xm(X,_,C,g):Ss(X,_,C))):Y?Xm(J,_,C,g):Ss(J,_,C)}}if(!p)return A.length?Promise.all(A).then(()=>_):_;let I=[],R=m.keySet,T=p._zod,B=T.def.type;for(let $ of Object.keys(g)){if(R.has($))continue;if(B==="never"){I.push($);continue}let C=T.run({value:g[$],issues:[]},w);C instanceof Promise?A.push(C.then(Q=>Ss(Q,_,$))):Ss(C,_,$)}return I.length&&_.issues.push({code:"unrecognized_keys",keys:I,input:g,inst:t}),A.length?Promise.all(A).then(()=>_):_}});function Qm(t,e,r,i){for(let n of t)if(n.issues.length===0)return e.value=n.value,e;return e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(n=>n.issues.map(o=>Qt(o,i,Ye())))}),e}var ks=O("$ZodUnion",(t,e)=>{ae.init(t,e),Ie(t._zod,"values",()=>{if(e.options.every(r=>r._zod.values))return new Set(e.options.flatMap(r=>Array.from(r._zod.values)))}),Ie(t._zod,"pattern",()=>{if(e.options.every(r=>r._zod.pattern)){let r=e.options.map(i=>i._zod.pattern);return new RegExp(`^(${r.map(i=>Bi(i.source)).join("|")})$`)}}),t._zod.parse=(r,i)=>{let n=!1,o=[];for(let s of e.options){let c=s._zod.run({value:r.value,issues:[]},i);if(c instanceof Promise)o.push(c),n=!0;else{if(c.issues.length===0)return c;o.push(c)}}return n?Promise.all(o).then(s=>Qm(s,r,t,i)):Qm(o,r,t,i)}}),of=O("$ZodDiscriminatedUnion",(t,e)=>{ks.init(t,e);let r=t._zod.parse;Ie(t._zod,"propValues",()=>{let n={};for(let o of e.options){let s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let[c,u]of Object.entries(s)){n[c]||(n[c]=new Set);for(let p of u)n[c].add(p)}}return n});let i=Pi(()=>{let n=e.options,o=new Map;for(let s of n){let c=s._zod.propValues[e.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let u of c){if(o.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);o.set(u,s)}}return o});t._zod.parse=(n,o)=>{let s=n.value;if(!Gn(s))return n.issues.push({code:"invalid_type",expected:"object",input:s,inst:t}),n;let c=i.value.get(s?.[e.discriminator]);return c?c._zod.run(n,o):e.unionFallback?r(n,o):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:s,path:[e.discriminator],inst:t}),n)}}),sf=O("$ZodIntersection",(t,e)=>{ae.init(t,e),t._zod.parse=(r,i)=>{let{value:n}=r,o=e.left._zod.run({value:n,issues:[]},i),s=e.right._zod.run({value:n,issues:[]},i);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([u,p])=>eg(r,u,p)):eg(r,o,s)}});function Sl(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(zi(t)&&zi(e)){let r=Object.keys(e),i=Object.keys(t).filter(o=>r.indexOf(o)!==-1),n={...t,...e};for(let o of i){let s=Sl(t[o],e[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};n[o]=s.data}return{valid:!0,data:n}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let i=0;i<t.length;i++){let n=t[i],o=e[i],s=Sl(n,o);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function eg(t,e,r){if(e.issues.length&&t.issues.push(...e.issues),r.issues.length&&t.issues.push(...r.issues),bn(t))return t;let i=Sl(e.value,r.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return t.value=i.data,t}var xn=O("$ZodTuple",(t,e)=>{ae.init(t,e);let r=e.items,i=r.length-[...r].reverse().findIndex(n=>n._zod.optin!=="optional");t._zod.parse=(n,o)=>{let s=n.value;if(!Array.isArray(s))return n.issues.push({input:s,inst:t,expected:"tuple",code:"invalid_type"}),n;n.value=[];let c=[];if(!e.rest){let p=s.length>r.length,m=s.length<i-1;if(p||m)return n.issues.push({input:s,inst:t,origin:"array",...p?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length}}),n}let u=-1;for(let p of r){if(u++,u>=s.length&&u>=i)continue;let m=p._zod.run({value:s[u],issues:[]},o);m instanceof Promise?c.push(m.then(_=>Es(_,n,u))):Es(m,n,u)}if(e.rest){let p=s.slice(r.length);for(let m of p){u++;let _=e.rest._zod.run({value:m,issues:[]},o);_ instanceof Promise?c.push(_.then(w=>Es(w,n,u))):Es(_,n,u)}}return c.length?Promise.all(c).then(()=>n):n}});function Es(t,e,r){t.issues.length&&e.issues.push(...Wt(r,t.issues)),e.value[r]=t.value}var af=O("$ZodRecord",(t,e)=>{ae.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!zi(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:t}),r;let o=[];if(e.keyType._zod.values){let s=e.keyType._zod.values;r.value={};for(let u of s)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){let p=e.valueType._zod.run({value:n[u],issues:[]},i);p instanceof Promise?o.push(p.then(m=>{m.issues.length&&r.issues.push(...Wt(u,m.issues)),r.value[u]=m.value})):(p.issues.length&&r.issues.push(...Wt(u,p.issues)),r.value[u]=p.value)}let c;for(let u in n)s.has(u)||(c=c??[],c.push(u));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:t,keys:c})}else{r.value={};for(let s of Reflect.ownKeys(n)){if(s==="__proto__")continue;let c=e.keyType._zod.run({value:s,issues:[]},i);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(c.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:c.issues.map(p=>Qt(p,i,Ye())),input:s,path:[s],inst:t}),r.value[c.value]=c.value;continue}let u=e.valueType._zod.run({value:n[s],issues:[]},i);u instanceof Promise?o.push(u.then(p=>{p.issues.length&&r.issues.push(...Wt(s,p.issues)),r.value[c.value]=p.value})):(u.issues.length&&r.issues.push(...Wt(s,u.issues)),r.value[c.value]=u.value)}}return o.length?Promise.all(o).then(()=>r):r}}),cf=O("$ZodMap",(t,e)=>{ae.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:t}),r;let o=[];r.value=new Map;for(let[s,c]of n){let u=e.keyType._zod.run({value:s,issues:[]},i),p=e.valueType._zod.run({value:c,issues:[]},i);u instanceof Promise||p instanceof Promise?o.push(Promise.all([u,p]).then(([m,_])=>{tg(m,_,r,s,n,t,i)})):tg(u,p,r,s,n,t,i)}return o.length?Promise.all(o).then(()=>r):r}});function tg(t,e,r,i,n,o,s){t.issues.length&&(Ci.has(typeof i)?r.issues.push(...Wt(i,t.issues)):r.issues.push({origin:"map",code:"invalid_key",input:n,inst:o,issues:t.issues.map(c=>Qt(c,s,Ye()))})),e.issues.length&&(Ci.has(typeof i)?r.issues.push(...Wt(i,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:o,key:i,issues:e.issues.map(c=>Qt(c,s,Ye()))})),r.value.set(t.value,e.value)}var uf=O("$ZodSet",(t,e)=>{ae.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:t,expected:"set",code:"invalid_type"}),r;let o=[];r.value=new Set;for(let s of n){let c=e.valueType._zod.run({value:s,issues:[]},i);c instanceof Promise?o.push(c.then(u=>rg(u,r))):rg(c,r)}return o.length?Promise.all(o).then(()=>r):r}});function rg(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}var lf=O("$ZodEnum",(t,e)=>{ae.init(t,e);let r=Li(e.entries);t._zod.values=new Set(r),t._zod.pattern=new RegExp(`^(${r.filter(i=>Ci.has(typeof i)).map(i=>typeof i=="string"?Er(i):i.toString()).join("|")})$`),t._zod.parse=(i,n)=>{let o=i.value;return t._zod.values.has(o)||i.issues.push({code:"invalid_value",values:r,input:o,inst:t}),i}}),ff=O("$ZodLiteral",(t,e)=>{ae.init(t,e),t._zod.values=new Set(e.values),t._zod.pattern=new RegExp(`^(${e.values.map(r=>typeof r=="string"?Er(r):r?r.toString():String(r)).join("|")})$`),t._zod.parse=(r,i)=>{let n=r.value;return t._zod.values.has(n)||r.issues.push({code:"invalid_value",values:e.values,input:n,inst:t}),r}}),df=O("$ZodFile",(t,e)=>{ae.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:t}),r}}),hf=O("$ZodTransform",(t,e)=>{ae.init(t,e),t._zod.parse=(r,i)=>{let n=e.transform(r.value,r);if(i.async)return(n instanceof Promise?n:Promise.resolve(n)).then(s=>(r.value=s,r));if(n instanceof Promise)throw new pr;return r.value=n,r}}),pf=O("$ZodOptional",(t,e)=>{ae.init(t,e),t._zod.optin="optional",t._zod.optout="optional",Ie(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),Ie(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Bi(r.source)})?$`):void 0}),t._zod.parse=(r,i)=>r.value===void 0?r:e.innerType._zod.run(r,i)}),mf=O("$ZodNullable",(t,e)=>{ae.init(t,e),Ie(t._zod,"optin",()=>e.innerType._zod.optin),Ie(t._zod,"optout",()=>e.innerType._zod.optout),Ie(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Bi(r.source)}|null)$`):void 0}),Ie(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,i)=>r.value===null?r:e.innerType._zod.run(r,i)}),gf=O("$ZodDefault",(t,e)=>{ae.init(t,e),t._zod.optin="optional",Ie(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,i)=>{if(r.value===void 0)return r.value=e.defaultValue,r;let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>ng(o,e)):ng(n,e)}});function ng(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var yf=O("$ZodPrefault",(t,e)=>{ae.init(t,e),t._zod.optin="optional",Ie(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,i)=>(r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,i))}),_f=O("$ZodNonOptional",(t,e)=>{ae.init(t,e),Ie(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),t._zod.parse=(r,i)=>{let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>ig(o,t)):ig(n,t)}});function ig(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}var bf=O("$ZodSuccess",(t,e)=>{ae.init(t,e),t._zod.parse=(r,i)=>{let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>(r.value=o.issues.length===0,r)):(r.value=n.issues.length===0,r)}}),vf=O("$ZodCatch",(t,e)=>{ae.init(t,e),Ie(t._zod,"optin",()=>e.innerType._zod.optin),Ie(t._zod,"optout",()=>e.innerType._zod.optout),Ie(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,i)=>{let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>Qt(s,i,Ye()))},input:r.value}),r.issues=[]),r)):(r.value=n.value,n.issues.length&&(r.value=e.catchValue({...r,error:{issues:n.issues.map(o=>Qt(o,i,Ye()))},input:r.value}),r.issues=[]),r)}}),wf=O("$ZodNaN",(t,e)=>{ae.init(t,e),t._zod.parse=(r,i)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:t,expected:"nan",code:"invalid_type"}),r)}),qi=O("$ZodPipe",(t,e)=>{ae.init(t,e),Ie(t._zod,"values",()=>e.in._zod.values),Ie(t._zod,"optin",()=>e.in._zod.optin),Ie(t._zod,"optout",()=>e.out._zod.optout),t._zod.parse=(r,i)=>{let n=e.in._zod.run(r,i);return n instanceof Promise?n.then(o=>og(o,e,i)):og(n,e,i)}});function og(t,e,r){return bn(t)?t:e.out._zod.run({value:t.value,issues:t.issues},r)}var xf=O("$ZodReadonly",(t,e)=>{ae.init(t,e),Ie(t._zod,"propValues",()=>e.innerType._zod.propValues),Ie(t._zod,"optin",()=>e.innerType._zod.optin),Ie(t._zod,"optout",()=>e.innerType._zod.optout),t._zod.parse=(r,i)=>{let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(sg):sg(n)}});function sg(t){return t.value=Object.freeze(t.value),t}var Sf=O("$ZodTemplateLiteral",(t,e)=>{ae.init(t,e);let r=[];for(let i of e.parts)if(i instanceof ae){if(!i._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);let n=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${i._zod.traits}`);let o=n.startsWith("^")?1:0,s=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(o,s))}else if(i===null||vu.has(typeof i))r.push(Er(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);t._zod.pattern=new RegExp(`^${r.join("")}$`),t._zod.parse=(i,n)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:t,expected:"template_literal",code:"invalid_type"}),i):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:t,code:"invalid_format",format:"template_literal",pattern:t._zod.pattern.source}),i)}),Ef=O("$ZodPromise",(t,e)=>{ae.init(t,e),t._zod.parse=(r,i)=>Promise.resolve(r.value).then(n=>e.innerType._zod.run({value:n,issues:[]},i))}),If=O("$ZodLazy",(t,e)=>{ae.init(t,e),Ie(t._zod,"innerType",()=>e.getter()),Ie(t._zod,"pattern",()=>t._zod.innerType._zod.pattern),Ie(t._zod,"propValues",()=>t._zod.innerType._zod.propValues),Ie(t._zod,"optin",()=>t._zod.innerType._zod.optin),Ie(t._zod,"optout",()=>t._zod.innerType._zod.optout),t._zod.parse=(r,i)=>t._zod.innerType._zod.run(r,i)}),Rf=O("$ZodCustom",(t,e)=>{Ve.init(t,e),ae.init(t,e),t._zod.parse=(r,i)=>r,t._zod.check=r=>{let i=r.value,n=e.fn(i);if(n instanceof Promise)return n.then(o=>ag(o,r,i,t));ag(n,r,i,t)}});function ag(t,e,r,i){if(!t){let n={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(n.params=i._zod.def.params),e.issues.push(Eu(n))}}var Hi={};kt(Hi,{ar:()=>fg,az:()=>dg,be:()=>pg,ca:()=>mg,cs:()=>gg,de:()=>yg,en:()=>As,es:()=>_g,fa:()=>bg,fi:()=>vg,fr:()=>wg,frCA:()=>xg,he:()=>Sg,hu:()=>Eg,id:()=>Ig,it:()=>Rg,ja:()=>kg,kh:()=>Ag,ko:()=>Og,mk:()=>Ng,ms:()=>Tg,nl:()=>$g,no:()=>Lg,ota:()=>Pg,pl:()=>Bg,pt:()=>zg,ru:()=>Ug,sl:()=>Dg,sv:()=>Mg,ta:()=>jg,th:()=>Fg,tr:()=>Zg,ua:()=>Vg,ur:()=>Wg,vi:()=>Kg,zhCN:()=>qg,zhTW:()=>Hg});var rw=()=>{let t={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"};return n=>{switch(n.code){case"invalid_type":return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${r(n.input)}`;case"invalid_value":return n.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${q(n.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${z(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${n.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${n.prefix}"`:o.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${o.suffix}"`:o.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${o.includes}"`:o.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${o.pattern}`:`${i[o.format]??n.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${n.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${z(n.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function fg(){return{localeError:rw()}}var nw=()=>{let t={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${n.expected}, daxil olan ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${q(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${z(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${o}${n.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${o.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:o.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${o.suffix}" il\u0259 bitm\u0259lidir`:o.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${o.includes}" daxil olmal\u0131d\u0131r`:o.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${o.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${i[o.format]??n.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${z(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${n.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function dg(){return{localeError:nw()}}function hg(t,e,r,i){let n=Math.abs(t),o=n%10,s=n%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?r:i}var iw=()=>{let t={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u043B\u0456\u043A";case"object":{if(Array.isArray(n))return"\u043C\u0430\u0441\u0456\u045E";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"};return n=>{switch(n.code){case"invalid_type":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${r(n.input)}`;case"invalid_value":return n.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${q(n.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${z(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);if(s){let c=Number(n.maximum),u=hg(c,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${n.maximum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);if(s){let c=Number(n.minimum),u=hg(c,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${n.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${i[o.format]??n.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${z(n.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${n.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function pg(){return{localeError:iw()}}var ow=()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return n=>{switch(n.code){case"invalid_type":return`Tipus inv\xE0lid: s'esperava ${n.expected}, s'ha rebut ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${q(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${z(n.values," o ")}`;case"too_big":{let o=n.inclusive?"com a m\xE0xim":"menys de",s=e(n.origin);return s?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${o} ${n.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"com a m\xEDnim":"m\xE9s de",s=e(n.origin);return s?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${o} ${n.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${o.prefix}"`:o.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format inv\xE0lid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${o.pattern}`:`Format inv\xE0lid per a ${i[o.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${z(n.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${n.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${n.origin}`;default:return"Entrada inv\xE0lida"}}};function mg(){return{localeError:ow()}}var sw=()=>{let t={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u010D\xEDslo";case"string":return"\u0159et\u011Bzec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(n))return"pole";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"};return n=>{switch(n.code){case"invalid_type":return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${n.expected}, obdr\u017Eeno ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${q(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${z(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${o.includes}"`:o.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${i[o.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${z(n.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${n.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${n.origin}`;default:return"Neplatn\xFD vstup"}}};function gg(){return{localeError:sw()}}var aw=()=>{let t={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"Zahl";case"object":{if(Array.isArray(n))return"Array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return n=>{switch(n.code){case"invalid_type":return`Ung\xFCltige Eingabe: erwartet ${n.expected}, erhalten ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${q(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${z(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ist`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ist`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ung\xFCltiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ung\xFCltiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ung\xFCltiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${o.pattern} entsprechen`:`Ung\xFCltig: ${i[o.format]??n.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${z(n.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${n.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${n.origin}`;default:return"Ung\xFCltige Eingabe"}}};function yg(){return{localeError:aw()}}var cw=t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},uw=()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function e(i){return t[i]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return i=>{switch(i.code){case"invalid_type":return`Invalid input: expected ${i.expected}, received ${cw(i.input)}`;case"invalid_value":return i.values.length===1?`Invalid input: expected ${q(i.values[0])}`:`Invalid option: expected one of ${z(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=e(i.origin);return o?`Too big: expected ${i.origin??"value"} to have ${n}${i.maximum.toString()} ${o.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=e(i.origin);return o?`Too small: expected ${i.origin} to have ${n}${i.minimum.toString()} ${o.unit}`:`Too small: expected ${i.origin} to be ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Invalid string: must start with "${n.prefix}"`:n.format==="ends_with"?`Invalid string: must end with "${n.suffix}"`:n.format==="includes"?`Invalid string: must include "${n.includes}"`:n.format==="regex"?`Invalid string: must match pattern ${n.pattern}`:`Invalid ${r[n.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${z(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function As(){return{localeError:uw()}}var lw=()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(n))return"arreglo";if(n===null)return"nulo";if(Object.getPrototypeOf(n)!==Object.prototype)return n.constructor.name}}return o},i={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return n=>{switch(n.code){case"invalid_type":return`Entrada inv\xE1lida: se esperaba ${n.expected}, recibido ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${q(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${z(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Demasiado grande: se esperaba que ${n.origin??"valor"} tuviera ${o}${n.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${n.origin??"valor"} fuera ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Demasiado peque\xF1o: se esperaba que ${n.origin} tuviera ${o}${n.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${n.origin} fuera ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inv\xE1lida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${o.pattern}`:`Inv\xE1lido ${i[o.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${z(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${n.origin}`;default:return"Entrada inv\xE1lida"}}};function _g(){return{localeError:lw()}}var fw=()=>{let t={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(n))return"\u0622\u0631\u0627\u06CC\u0647";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"};return n=>{switch(n.code){case"invalid_type":return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${r(n.input)} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;case"invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${q(n.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${z(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:o.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:o.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${o.includes}" \u0628\u0627\u0634\u062F`:o.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${o.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${i[o.format]??n.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${n.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${z(n.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${n.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${n.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function bg(){return{localeError:fw()}}var dw=()=>{let t={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return n=>{switch(n.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${n.expected}, oli ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${q(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${z(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${o}${n.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${o}${n.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${o.includes}"`:o.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${o.pattern}`:`Virheellinen ${i[o.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${z(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};function vg(){return{localeError:dw()}}var hw=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"nombre";case"object":{if(Array.isArray(n))return"tableau";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return n=>{switch(n.code){case"invalid_type":return`Entr\xE9e invalide : ${n.expected} attendu, ${r(n.input)} re\xE7u`;case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${q(n.values[0])} attendu`:`Option invalide : une valeur parmi ${z(n.values,"|")} attendue`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Trop grand : ${n.origin??"valeur"} doit ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${n.origin??"valeur"} doit \xEAtre ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Trop petit : ${n.origin} doit ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Trop petit : ${n.origin} doit \xEAtre ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${o.pattern}`:`${i[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${z(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function wg(){return{localeError:hw()}}var pw=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return n=>{switch(n.code){case"invalid_type":return`Entr\xE9e invalide : attendu ${n.expected}, re\xE7u ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${q(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${z(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u2264":"<",s=e(n.origin);return s?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${o}${n.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"\u2265":">",s=e(n.origin);return s?`Trop petit : attendu que ${n.origin} ait ${o}${n.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${n.origin} soit ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${o.pattern}`:`${i[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${z(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function xg(){return{localeError:pw()}}var mw=()=>{let t={string:{unit:"\u05D0\u05D5\u05EA\u05D9\u05D5\u05EA",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u05E7\u05DC\u05D8",email:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",url:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",emoji:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",date:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",time:"\u05D6\u05DE\u05DF ISO",duration:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",ipv4:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",ipv6:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",cidrv4:"\u05D8\u05D5\u05D5\u05D7 IPv4",cidrv6:"\u05D8\u05D5\u05D5\u05D7 IPv6",base64:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",base64url:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",json_string:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",e164:"\u05DE\u05E1\u05E4\u05E8 E.164",jwt:"JWT",template_literal:"\u05E7\u05DC\u05D8"};return n=>{switch(n.code){case"invalid_type":return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${n.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${r(n.input)}`;case"invalid_value":return n.values.length===1?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${q(n.values[0])}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05D0\u05D7\u05EA \u05DE\u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA ${z(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${n.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${o}${n.maximum.toString()} ${s.unit??"elements"}`:`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${n.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${n.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${o}${n.minimum.toString()} ${s.unit}`:`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${n.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1"${o.prefix}"`:o.format==="ends_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${o.suffix}"`:o.format==="includes"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${o.includes}"`:o.format==="regex"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${o.pattern}`:`${i[o.format]??n.format} \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${n.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${n.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${n.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${z(n.keys,", ")}`;case"invalid_key":return`\u05DE\u05E4\u05EA\u05D7 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n.origin}`;case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n.origin}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function Sg(){return{localeError:mw()}}var gw=()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"sz\xE1m";case"object":{if(Array.isArray(n))return"t\xF6mb";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"};return n=>{switch(n.code){case"invalid_type":return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${n.expected}, a kapott \xE9rt\xE9k ${r(n.input)}`;case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${q(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${z(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${n.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${o}${n.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\xC9rv\xE9nytelen string: "${o.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:o.format==="ends_with"?`\xC9rv\xE9nytelen string: "${o.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:o.format==="includes"?`\xC9rv\xE9nytelen string: "${o.includes}" \xE9rt\xE9ket kell tartalmaznia`:o.format==="regex"?`\xC9rv\xE9nytelen string: ${o.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${i[o.format]??n.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${z(n.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${n.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${n.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function Eg(){return{localeError:gw()}}var yw=()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Input tidak valid: diharapkan ${n.expected}, diterima ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${q(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${z(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${o}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Terlalu kecil: diharapkan ${n.origin} memiliki ${o}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${i[o.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${z(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}};function Ig(){return{localeError:yw()}}var _w=()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"numero";case"object":{if(Array.isArray(n))return"vettore";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Input non valido: atteso ${n.expected}, ricevuto ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Input non valido: atteso ${q(n.values[0])}`:`Opzione non valida: atteso uno tra ${z(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Troppo grande: ${n.origin??"valore"} deve avere ${o}${n.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Troppo piccolo: ${n.origin} deve avere ${o}${n.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${n.origin} deve essere ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Invalid ${i[o.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${z(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}};function Rg(){return{localeError:_w()}}var bw=()=>{let t={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u6570\u5024";case"object":{if(Array.isArray(n))return"\u914D\u5217";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"};return n=>{switch(n.code){case"invalid_type":return`\u7121\u52B9\u306A\u5165\u529B: ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${r(n.input)}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${q(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${z(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${s.unit??"\u8981\u7D20"}${o}\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${o}\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${s.unit}${o}\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${o}\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${o.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${i[o.format]??n.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${n.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${n.keys.length>1?"\u7FA4":""}: ${z(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function kg(){return{localeError:bw()}}var vw=()=>{let t={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"\u1798\u17B7\u1793\u1798\u17C2\u1793\u1787\u17B6\u179B\u17C1\u1781 (NaN)":"\u179B\u17C1\u1781";case"object":{if(Array.isArray(n))return"\u17A2\u17B6\u179A\u17C1 (Array)";if(n===null)return"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"};return n=>{switch(n.code){case"invalid_type":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${r(n.input)}`;case"invalid_value":return n.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${q(n.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${z(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${n.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${o} ${n.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${o.prefix}"`:o.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${o.suffix}"`:o.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${o.includes}"`:o.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${o.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${i[o.format]??n.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${n.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${z(n.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function Ag(){return{localeError:vw()}}var ww=()=>{let t={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"};return n=>{switch(n.code){case"invalid_type":return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${r(n.input)}\uC785\uB2C8\uB2E4`;case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${q(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${z(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",c=e(n.origin),u=c?.unit??"\uC694\uC18C";return c?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${u} ${o}${s}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${o}${s}`}case"too_small":{let o=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",c=e(n.origin),u=c?.unit??"\uC694\uC18C";return c?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${u} ${o}${s}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${o}${s}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:o.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${o.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${i[o.format]??n.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${z(n.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${n.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${n.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function Og(){return{localeError:ww()}}var xw=()=>{let t={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0431\u0440\u043E\u0458";case"object":{if(Array.isArray(n))return"\u043D\u0438\u0437\u0430";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"};return n=>{switch(n.code){case"invalid_type":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${q(n.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${z(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${o}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${o}${n.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${o.pattern}`:`Invalid ${i[o.format]??n.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${z(n.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${n.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${n.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function Ng(){return{localeError:xw()}}var Sw=()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"nombor";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Input tidak sah: dijangka ${n.expected}, diterima ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${q(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${z(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Terlalu besar: dijangka ${n.origin??"nilai"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Terlalu kecil: dijangka ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${i[o.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${z(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}};function Tg(){return{localeError:Sw()}}var Ew=()=>{let t={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"getal";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return n=>{switch(n.code){case"invalid_type":return`Ongeldige invoer: verwacht ${n.expected}, ontving ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${q(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${z(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Te lang: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} ${s.unit??"elementen"} bevat`:`Te lang: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} is`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Te kort: verwacht dat ${n.origin} ${o}${n.minimum.toString()} ${s.unit} bevat`:`Te kort: verwacht dat ${n.origin} ${o}${n.minimum.toString()} is`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${i[o.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${z(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}};function $g(){return{localeError:Ew()}}var Iw=()=>{let t={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"tall";case"object":{if(Array.isArray(n))return"liste";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Ugyldig input: forventet ${n.expected}, fikk ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${q(n.values[0])}`:`Ugyldig valg: forventet en av ${z(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`For lite(n): forventet ${n.origin} til \xE5 ha ${o}${n.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${i[o.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${z(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};function Lg(){return{localeError:Iw()}}var Rw=()=>{let t={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"numara";case"object":{if(Array.isArray(n))return"saf";if(n===null)return"gayb";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"};return n=>{switch(n.code){case"invalid_type":return`F\xE2sit giren: umulan ${n.expected}, al\u0131nan ${r(n.input)}`;case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${q(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${z(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${o}${n.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${o}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${o}${n.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${o}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=n;return o.format==="starts_with"?`F\xE2sit metin: "${o.prefix}" ile ba\u015Flamal\u0131.`:o.format==="ends_with"?`F\xE2sit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`F\xE2sit metin: "${o.includes}" ihtiv\xE2 etmeli.`:o.format==="regex"?`F\xE2sit metin: ${o.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${i[o.format]??n.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${z(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${n.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function Pg(){return{localeError:Rw()}}var kw=()=>{let t={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"liczba";case"object":{if(Array.isArray(n))return"tablica";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"};return n=>{switch(n.code){case"invalid_type":return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${n.expected}, otrzymano ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${q(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${z(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${o.prefix}"`:o.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${o.suffix}"`:o.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${o.includes}"`:o.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${o.pattern}`:`Nieprawid\u0142ow(y/a/e) ${i[o.format]??n.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${z(n.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${n.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${n.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function Bg(){return{localeError:kw()}}var Aw=()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(n))return"array";if(n===null)return"nulo";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return n=>{switch(n.code){case"invalid_type":return`Tipo inv\xE1lido: esperado ${n.expected}, recebido ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${q(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${z(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${o}${n.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Muito pequeno: esperado que ${n.origin} tivesse ${o}${n.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${o.prefix}"`:o.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${o.suffix}"`:o.format==="includes"?`Texto inv\xE1lido: deve incluir "${o.includes}"`:o.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${o.pattern}`:`${i[o.format]??n.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${z(n.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${n.origin}`;default:return"Campo inv\xE1lido"}}};function zg(){return{localeError:Aw()}}function Cg(t,e,r,i){let n=Math.abs(t),o=n%10,s=n%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?r:i}var Ow=()=>{let t={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(n))return"\u043C\u0430\u0441\u0441\u0438\u0432";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"};return n=>{switch(n.code){case"invalid_type":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${r(n.input)}`;case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${q(n.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${z(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);if(s){let c=Number(n.maximum),u=Cg(c,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${n.maximum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);if(s){let c=Number(n.minimum),u=Cg(c,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${n.minimum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${i[o.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${z(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function Ug(){return{localeError:Ow()}}var Nw=()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0161tevilo";case"object":{if(Array.isArray(n))return"tabela";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"};return n=>{switch(n.code){case"invalid_type":return`Neveljaven vnos: pri\u010Dakovano ${n.expected}, prejeto ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${q(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${z(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${o}${n.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${o}${n.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${i[o.format]??n.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${z(n.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};function Dg(){return{localeError:Nw()}}var Tw=()=>{let t={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"antal";case"object":{if(Array.isArray(n))return"lista";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return n=>{switch(n.code){case"invalid_type":return`Ogiltig inmatning: f\xF6rv\xE4ntat ${n.expected}, fick ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${q(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${z(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${o.includes}"`:o.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${o.pattern}"`:`Ogiltig(t) ${i[o.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${z(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${n.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function Mg(){return{localeError:Tw()}}var $w=()=>{let t={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"\u0B8E\u0BA3\u0BCD \u0B85\u0BB2\u0BCD\u0BB2\u0BBE\u0BA4\u0BA4\u0BC1":"\u0B8E\u0BA3\u0BCD";case"object":{if(Array.isArray(n))return"\u0B85\u0BA3\u0BBF";if(n===null)return"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r(n.input)}`;case"invalid_value":return n.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${q(n.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${z(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${n.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${o}${n.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${o}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${o.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${i[o.format]??n.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${z(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function jg(){return{localeError:$w()}}var Lw=()=>{let t={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02 (NaN)":"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02";case"object":{if(Array.isArray(n))return"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)";if(n===null)return"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"};return n=>{switch(n.code){case"invalid_type":return`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${r(n.input)}`;case"invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${q(n.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${z(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=e(n.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=e(n.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${o.prefix}"`:o.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${o.suffix}"`:o.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${o.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:o.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${o.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${i[o.format]??n.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${n.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${z(n.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function Fg(){return{localeError:Lw()}}var Pw=t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},Bw=()=>{let t={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(i){return t[i]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"};return i=>{switch(i.code){case"invalid_type":return`Ge\xE7ersiz de\u011Fer: beklenen ${i.expected}, al\u0131nan ${Pw(i.input)}`;case"invalid_value":return i.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${q(i.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${z(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=e(i.origin);return o?`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${n}${i.maximum.toString()} ${o.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=e(i.origin);return o?`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${n}${i.minimum.toString()} ${o.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Ge\xE7ersiz metin: "${n.prefix}" ile ba\u015Flamal\u0131`:n.format==="ends_with"?`Ge\xE7ersiz metin: "${n.suffix}" ile bitmeli`:n.format==="includes"?`Ge\xE7ersiz metin: "${n.includes}" i\xE7ermeli`:n.format==="regex"?`Ge\xE7ersiz metin: ${n.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[n.format]??i.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${i.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${i.keys.length>1?"lar":""}: ${z(i.keys,", ")}`;case"invalid_key":return`${i.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${i.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function Zg(){return{localeError:Bw()}}var zw=()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(n))return"\u043C\u0430\u0441\u0438\u0432";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"};return n=>{switch(n.code){case"invalid_type":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${r(n.input)}`;case"invalid_value":return n.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${q(n.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${z(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${i[o.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${z(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${n.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function Vg(){return{localeError:zw()}}var Cw=()=>{let t={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0646\u0645\u0628\u0631";case"object":{if(Array.isArray(n))return"\u0622\u0631\u06D2";if(n===null)return"\u0646\u0644";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"};return n=>{switch(n.code){case"invalid_type":return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${r(n.input)} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${q(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${z(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${o}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${o}${n.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${o}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${o.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${i[o.format]??n.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${n.keys.length>1?"\u0632":""}: ${z(n.keys,"\u060C ")}`;case"invalid_key":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function Wg(){return{localeError:Cw()}}var Uw=()=>{let t={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"s\u1ED1";case"object":{if(Array.isArray(n))return"m\u1EA3ng";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"};return n=>{switch(n.code){case"invalid_type":return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${r(n.input)}`;case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${q(n.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${z(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${o.prefix}"`:o.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${o.suffix}"`:o.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${o.includes}"`:o.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${o.pattern}`:`${i[o.format]??n.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${n.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${z(n.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function Kg(){return{localeError:Uw()}}var Dw=()=>{let t={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"\u975E\u6570\u5B57(NaN)":"\u6570\u5B57";case"object":{if(Array.isArray(n))return"\u6570\u7EC4";if(n===null)return"\u7A7A\u503C(null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"};return n=>{switch(n.code){case"invalid_type":return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${r(n.input)}`;case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${q(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${z(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${o}${n.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.prefix}" \u5F00\u5934`:o.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.suffix}" \u7ED3\u5C3E`:o.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${o.pattern}`:`\u65E0\u6548${i[o.format]??n.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${z(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${n.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function qg(){return{localeError:Dw()}}var Mw=()=>{let t={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"};return n=>{switch(n.code){case"invalid_type":return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${n.expected}\uFF0C\u4F46\u6536\u5230 ${r(n.input)}`;case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${q(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${z(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${o}${n.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${o}${n.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.prefix}" \u958B\u982D`:o.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.suffix}" \u7D50\u5C3E`:o.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${o.pattern}`:`\u7121\u6548\u7684 ${i[o.format]??n.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${z(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function Hg(){return{localeError:Mw()}}var kf=Symbol("ZodOutput"),Af=Symbol("ZodInput"),Xn=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let i=r[0];if(this._map.set(e,i),i&&typeof i=="object"&&"id"in i){if(this._idmap.has(i.id))throw new Error(`ID ${i.id} already exists in the registry`);this._idmap.set(i.id,e)}return this}remove(e){return this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let i={...this.get(r)??{}};return delete i.id,{...i,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}};function Os(){return new Xn}var mr=Os();function Of(t,e){return new t({type:"string",...j(e)})}function Nf(t,e){return new t({type:"string",coerce:!0,...j(e)})}function Ns(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...j(e)})}function Gi(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...j(e)})}function Ts(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...j(e)})}function $s(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...j(e)})}function Ls(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...j(e)})}function Ps(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...j(e)})}function Bs(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...j(e)})}function zs(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...j(e)})}function Cs(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...j(e)})}function Us(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...j(e)})}function Ds(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...j(e)})}function Ms(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...j(e)})}function js(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...j(e)})}function Fs(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...j(e)})}function Zs(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...j(e)})}function Vs(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...j(e)})}function Ws(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...j(e)})}function Ks(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...j(e)})}function qs(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...j(e)})}function Hs(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...j(e)})}function Gs(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...j(e)})}function Js(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...j(e)})}function Tf(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...j(e)})}function $f(t,e){return new t({type:"string",format:"date",check:"string_format",...j(e)})}function Lf(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...j(e)})}function Pf(t,e){return new t({type:"string",format:"duration",check:"string_format",...j(e)})}function Bf(t,e){return new t({type:"number",checks:[],...j(e)})}function zf(t,e){return new t({type:"number",coerce:!0,checks:[],...j(e)})}function Cf(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...j(e)})}function Uf(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...j(e)})}function Df(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...j(e)})}function Mf(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...j(e)})}function jf(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...j(e)})}function Ff(t,e){return new t({type:"boolean",...j(e)})}function Zf(t,e){return new t({type:"boolean",coerce:!0,...j(e)})}function Vf(t,e){return new t({type:"bigint",...j(e)})}function Wf(t,e){return new t({type:"bigint",coerce:!0,...j(e)})}function Kf(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...j(e)})}function qf(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...j(e)})}function Hf(t,e){return new t({type:"symbol",...j(e)})}function Gf(t,e){return new t({type:"undefined",...j(e)})}function Jf(t,e){return new t({type:"null",...j(e)})}function Yf(t){return new t({type:"any"})}function Qn(t){return new t({type:"unknown"})}function Xf(t,e){return new t({type:"never",...j(e)})}function Qf(t,e){return new t({type:"void",...j(e)})}function ed(t,e){return new t({type:"date",...j(e)})}function td(t,e){return new t({type:"date",coerce:!0,...j(e)})}function rd(t,e){return new t({type:"nan",...j(e)})}function Ir(t,e){return new ws({check:"less_than",...j(e),value:t,inclusive:!1})}function ir(t,e){return new ws({check:"less_than",...j(e),value:t,inclusive:!0})}function Rr(t,e){return new xs({check:"greater_than",...j(e),value:t,inclusive:!1})}function Kt(t,e){return new xs({check:"greater_than",...j(e),value:t,inclusive:!0})}function nd(t){return Rr(0,t)}function id(t){return Ir(0,t)}function od(t){return ir(0,t)}function sd(t){return Kt(0,t)}function Sn(t,e){return new il({check:"multiple_of",...j(e),value:t})}function ei(t,e){return new al({check:"max_size",...j(e),maximum:t})}function En(t,e){return new cl({check:"min_size",...j(e),minimum:t})}function Ji(t,e){return new ul({check:"size_equals",...j(e),size:t})}function ti(t,e){return new ll({check:"max_length",...j(e),maximum:t})}function Wr(t,e){return new fl({check:"min_length",...j(e),minimum:t})}function ri(t,e){return new dl({check:"length_equals",...j(e),length:t})}function Yi(t,e){return new hl({check:"string_format",format:"regex",...j(e),pattern:t})}function Xi(t){return new pl({check:"string_format",format:"lowercase",...j(t)})}function Qi(t){return new ml({check:"string_format",format:"uppercase",...j(t)})}function eo(t,e){return new gl({check:"string_format",format:"includes",...j(e),includes:t})}function to(t,e){return new yl({check:"string_format",format:"starts_with",...j(e),prefix:t})}function ro(t,e){return new _l({check:"string_format",format:"ends_with",...j(e),suffix:t})}function ad(t,e,r){return new bl({check:"property",property:t,schema:e,...j(r)})}function no(t,e){return new vl({check:"mime_type",mime:t,...j(e)})}function kr(t){return new wl({check:"overwrite",tx:t})}function io(t){return kr(e=>e.normalize(t))}function oo(){return kr(t=>t.trim())}function so(){return kr(t=>t.toLowerCase())}function ao(){return kr(t=>t.toUpperCase())}function co(t,e,r){return new t({type:"array",element:e,...j(r)})}function jw(t,e,r){return new t({type:"union",options:e,...j(r)})}function Fw(t,e,r,i){return new t({type:"union",options:r,discriminator:e,...j(i)})}function Zw(t,e,r){return new t({type:"intersection",left:e,right:r})}function cd(t,e,r,i){let n=r instanceof ae,o=n?i:r,s=n?r:null;return new t({type:"tuple",items:e,rest:s,...j(o)})}function Vw(t,e,r,i){return new t({type:"record",keyType:e,valueType:r,...j(i)})}function Ww(t,e,r,i){return new t({type:"map",keyType:e,valueType:r,...j(i)})}function Kw(t,e,r){return new t({type:"set",valueType:e,...j(r)})}function qw(t,e,r){let i=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new t({type:"enum",entries:i,...j(r)})}function Hw(t,e,r){return new t({type:"enum",entries:e,...j(r)})}function Gw(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...j(r)})}function ud(t,e){return new t({type:"file",...j(e)})}function Jw(t,e){return new t({type:"transform",transform:e})}function Yw(t,e){return new t({type:"optional",innerType:e})}function Xw(t,e){return new t({type:"nullable",innerType:e})}function Qw(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():r}})}function ex(t,e,r){return new t({type:"nonoptional",innerType:e,...j(r)})}function tx(t,e){return new t({type:"success",innerType:e})}function rx(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function nx(t,e,r){return new t({type:"pipe",in:e,out:r})}function ix(t,e){return new t({type:"readonly",innerType:e})}function ox(t,e,r){return new t({type:"template_literal",parts:e,...j(r)})}function sx(t,e){return new t({type:"lazy",getter:e})}function ax(t,e){return new t({type:"promise",innerType:e})}function ld(t,e,r){let i=j(r);return i.abort??(i.abort=!0),new t({type:"custom",check:"custom",fn:e,...i})}function fd(t,e,r){return new t({type:"custom",check:"custom",fn:e,...j(r)})}function dd(t,e){let{case:r,error:i,truthy:n,falsy:o}=j(e),s=new Set(n??["true","1","yes","on","y","enabled"]),c=new Set(o??["false","0","no","off","n","disabled"]),u=t.Pipe??qi,p=t.Boolean??Wi,m=t.Unknown??Vr,_=new m({type:"unknown",checks:[{_zod:{check:w=>{if(typeof w.value=="string"){let g=w.value;r!=="sensitive"&&(g=g.toLowerCase()),s.has(g)?w.value=!0:c.has(g)?w.value=!1:w.issues.push({code:"invalid_value",expected:"stringbool",values:[...s,...c],input:w.value,inst:_})}else w.issues.push({code:"invalid_type",expected:"string",input:w.value})},def:{check:"custom"},onattach:[]}}],error:i});return new u({type:"pipe",in:_,out:new p({type:"boolean",error:i}),error:i})}var Ys=class{constructor(e){this._def=e,this.def=e}implement(e){if(typeof e!="function")throw new Error("implement() must be called with a function");let r=(...i)=>{let n=this._def.input?ms(this._def.input,i,void 0,{callee:r}):i;if(!Array.isArray(n))throw new Error("Invalid arguments schema: not an array or tuple schema.");let o=e(...n);return this._def.output?ms(this._def.output,o,void 0,{callee:r}):o};return r}implementAsync(e){if(typeof e!="function")throw new Error("implement() must be called with a function");let r=async(...i)=>{let n=this._def.input?await ys(this._def.input,i,void 0,{callee:r}):i;if(!Array.isArray(n))throw new Error("Invalid arguments schema: not an array or tuple schema.");let o=await e(...n);return this._def.output?ys(this._def.output,o,void 0,{callee:r}):o};return r}input(...e){let r=this.constructor;return Array.isArray(e[0])?new r({type:"function",input:new xn({type:"tuple",items:e[0],rest:e[1]}),output:this._def.output}):new r({type:"function",input:e[0],output:this._def.output})}output(e){let r=this.constructor;return new r({type:"function",input:this._def.input,output:e})}};function hd(t){return new Ys({type:"function",input:Array.isArray(t?.input)?cd(xn,t?.input):t?.input??co(Ki,Qn(Vr)),output:t?.output??Qn(Vr)})}var uo=class{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??mr,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,r={path:[],schemaPath:[]}){var i;let n=e._zod.def,o={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},s=this.seen.get(e);if(s)return s.count++,r.schemaPath.includes(e)&&(s.cycle=r.path),s.schema;let c={schema:{},count:1,cycle:void 0};this.seen.set(e,c),e._zod.toJSONSchema&&(c.schema=e._zod.toJSONSchema());let u={...r,schemaPath:[...r.schemaPath,e],path:r.path},p=e._zod.parent;if(p)c.ref=p,this.process(p,u),this.seen.get(p).isParent=!0;else{let w=c.schema;switch(n.type){case"string":{let g=w;g.type="string";let{minimum:A,maximum:I,format:R,patterns:T,contentEncoding:B}=e._zod.bag;if(typeof A=="number"&&(g.minLength=A),typeof I=="number"&&(g.maxLength=I),R&&(g.format=o[R]??R,g.format===""&&delete g.format),B&&(g.contentEncoding=B),T&&T.size>0){let $=[...T];$.length===1?g.pattern=$[0].source:$.length>1&&(c.schema.allOf=[...$.map(C=>({...this.target==="draft-7"?{type:"string"}:{},pattern:C.source}))])}break}case"number":{let g=w,{minimum:A,maximum:I,format:R,multipleOf:T,exclusiveMaximum:B,exclusiveMinimum:$}=e._zod.bag;typeof R=="string"&&R.includes("int")?g.type="integer":g.type="number",typeof $=="number"&&(g.exclusiveMinimum=$),typeof A=="number"&&(g.minimum=A,typeof $=="number"&&($>=A?delete g.minimum:delete g.exclusiveMinimum)),typeof B=="number"&&(g.exclusiveMaximum=B),typeof I=="number"&&(g.maximum=I,typeof B=="number"&&(B<=I?delete g.maximum:delete g.exclusiveMaximum)),typeof T=="number"&&(g.multipleOf=T);break}case"boolean":{let g=w;g.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"undefined":{let g=w;g.type="null";break}case"null":{w.type="null";break}case"any":break;case"unknown":break;case"never":{w.not={};break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let g=w,{minimum:A,maximum:I}=e._zod.bag;typeof A=="number"&&(g.minItems=A),typeof I=="number"&&(g.maxItems=I),g.type="array",g.items=this.process(n.element,{...u,path:[...u.path,"items"]});break}case"object":{let g=w;g.type="object",g.properties={};let A=n.shape;for(let T in A)g.properties[T]=this.process(A[T],{...u,path:[...u.path,"properties",T]});let I=new Set(Object.keys(A)),R=new Set([...I].filter(T=>{let B=n.shape[T]._zod;return this.io==="input"?B.optin===void 0:B.optout===void 0}));R.size>0&&(g.required=Array.from(R)),n.catchall?._zod.def.type==="never"?g.additionalProperties=!1:n.catchall?n.catchall&&(g.additionalProperties=this.process(n.catchall,{...u,path:[...u.path,"additionalProperties"]})):this.io==="output"&&(g.additionalProperties=!1);break}case"union":{let g=w;g.anyOf=n.options.map((A,I)=>this.process(A,{...u,path:[...u.path,"anyOf",I]}));break}case"intersection":{let g=w,A=this.process(n.left,{...u,path:[...u.path,"allOf",0]}),I=this.process(n.right,{...u,path:[...u.path,"allOf",1]}),R=B=>"allOf"in B&&Object.keys(B).length===1,T=[...R(A)?A.allOf:[A],...R(I)?I.allOf:[I]];g.allOf=T;break}case"tuple":{let g=w;g.type="array";let A=n.items.map((T,B)=>this.process(T,{...u,path:[...u.path,"prefixItems",B]}));if(this.target==="draft-2020-12"?g.prefixItems=A:g.items=A,n.rest){let T=this.process(n.rest,{...u,path:[...u.path,"items"]});this.target==="draft-2020-12"?g.items=T:g.additionalItems=T}n.rest&&(g.items=this.process(n.rest,{...u,path:[...u.path,"items"]}));let{minimum:I,maximum:R}=e._zod.bag;typeof I=="number"&&(g.minItems=I),typeof R=="number"&&(g.maxItems=R);break}case"record":{let g=w;g.type="object",g.propertyNames=this.process(n.keyType,{...u,path:[...u.path,"propertyNames"]}),g.additionalProperties=this.process(n.valueType,{...u,path:[...u.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let g=w,A=Li(n.entries);A.every(I=>typeof I=="number")&&(g.type="number"),A.every(I=>typeof I=="string")&&(g.type="string"),g.enum=A;break}case"literal":{let g=w,A=[];for(let I of n.values)if(I===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof I=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");A.push(Number(I))}else A.push(I);if(A.length!==0)if(A.length===1){let I=A[0];g.type=I===null?"null":typeof I,g.const=I}else A.every(I=>typeof I=="number")&&(g.type="number"),A.every(I=>typeof I=="string")&&(g.type="string"),A.every(I=>typeof I=="boolean")&&(g.type="string"),A.every(I=>I===null)&&(g.type="null"),g.enum=A;break}case"file":{let g=w,A={type:"string",format:"binary",contentEncoding:"binary"},{minimum:I,maximum:R,mime:T}=e._zod.bag;I!==void 0&&(A.minLength=I),R!==void 0&&(A.maxLength=R),T?T.length===1?(A.contentMediaType=T[0],Object.assign(g,A)):g.anyOf=T.map(B=>({...A,contentMediaType:B})):Object.assign(g,A);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let g=this.process(n.innerType,u);w.anyOf=[g,{type:"null"}];break}case"nonoptional":{this.process(n.innerType,u),c.ref=n.innerType;break}case"success":{let g=w;g.type="boolean";break}case"default":{this.process(n.innerType,u),c.ref=n.innerType,w.default=n.defaultValue;break}case"prefault":{this.process(n.innerType,u),c.ref=n.innerType,this.io==="input"&&(w._prefault=n.defaultValue);break}case"catch":{this.process(n.innerType,u),c.ref=n.innerType;let g;try{g=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}w.default=g;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let g=w,A=e._zod.pattern;if(!A)throw new Error("Pattern not found in template literal");g.type="string",g.pattern=A.source;break}case"pipe":{let g=this.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;this.process(g,u),c.ref=g;break}case"readonly":{this.process(n.innerType,u),c.ref=n.innerType,w.readOnly=!0;break}case"promise":{this.process(n.innerType,u),c.ref=n.innerType;break}case"optional":{this.process(n.innerType,u),c.ref=n.innerType;break}case"lazy":{let g=e._zod.innerType;this.process(g,u),c.ref=g;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}default:}}let m=this.metadataRegistry.get(e);return m&&Object.assign(c.schema,m),this.io==="input"&&wt(e)&&(delete c.schema.examples,delete c.schema.default),this.io==="input"&&c.schema._prefault&&((i=c.schema).default??(i.default=c.schema._prefault)),delete c.schema._prefault,this.seen.get(e).schema}emit(e,r){let i={cycles:r?.cycles??"ref",reused:r?.reused??"inline",external:r?.external??void 0},n=this.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=m=>{let _=this.target==="draft-2020-12"?"$defs":"definitions";if(i.external){let I=i.external.registry.get(m[0])?.id;if(I)return{ref:i.external.uri(I)};let R=m[1].defId??m[1].schema.id??`schema${this.counter++}`;return m[1].defId=R,{defId:R,ref:`${i.external.uri("__shared")}#/${_}/${R}`}}if(m[1]===n)return{ref:"#"};let g=`#/${_}/`,A=m[1].schema.id??`__schema${this.counter++}`;return{defId:A,ref:g+A}},s=m=>{if(m[1].schema.$ref)return;let _=m[1],{ref:w,defId:g}=o(m);_.def={..._.schema},g&&(_.defId=g);let A=_.schema;for(let I in A)delete A[I];A.$ref=w};for(let m of this.seen.entries()){let _=m[1];if(e===m[0]){s(m);continue}if(i.external){let g=i.external.registry.get(m[0])?.id;if(e!==m[0]&&g){s(m);continue}}if(this.metadataRegistry.get(m[0])?.id){s(m);continue}if(_.cycle){if(i.cycles==="throw")throw new Error(`Cycle detected: #/${_.cycle?.join("/")}/<root>
28
+
29
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);i.cycles==="ref"&&s(m);continue}if(_.count>1&&i.reused==="ref"){s(m);continue}}let c=(m,_)=>{let w=this.seen.get(m),g=w.def??w.schema,A={...g};if(w.ref===null)return;let I=w.ref;if(w.ref=null,I){c(I,_);let R=this.seen.get(I).schema;R.$ref&&_.target==="draft-7"?(g.allOf=g.allOf??[],g.allOf.push(R)):(Object.assign(g,R),Object.assign(g,A))}w.isParent||this.override({zodSchema:m,jsonSchema:g})};for(let m of[...this.seen.entries()].reverse())c(m[0],{target:this.target});let u={};this.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?u.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),Object.assign(u,n.def);let p=i.external?.defs??{};for(let m of this.seen.entries()){let _=m[1];_.def&&_.defId&&(p[_.defId]=_.def)}!i.external&&Object.keys(p).length>0&&(this.target==="draft-2020-12"?u.$defs=p:u.definitions=p);try{return JSON.parse(JSON.stringify(u))}catch{throw new Error("Error converting schema to JSON.")}}};function pd(t,e){if(t instanceof Xn){let i=new uo(e),n={};for(let c of t._idmap.entries()){let[u,p]=c;i.process(p)}let o={},s={registry:t,uri:e?.uri||(c=>c),defs:n};for(let c of t._idmap.entries()){let[u,p]=c;o[u]=i.emit(p,{...e,external:s})}if(Object.keys(n).length>0){let c=i.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[c]:n}}return{schemas:o}}let r=new uo(e);return r.process(t),r.emit(t,e)}function wt(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let n=t._zod.def;switch(n.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return wt(n.element,r);case"object":{for(let o in n.shape)if(wt(n.shape[o],r))return!0;return!1}case"union":{for(let o of n.options)if(wt(o,r))return!0;return!1}case"intersection":return wt(n.left,r)||wt(n.right,r);case"tuple":{for(let o of n.items)if(wt(o,r))return!0;return!!(n.rest&&wt(n.rest,r))}case"record":return wt(n.keyType,r)||wt(n.valueType,r);case"map":return wt(n.keyType,r)||wt(n.valueType,r);case"set":return wt(n.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return wt(n.innerType,r);case"lazy":return wt(n.getter(),r);case"default":return wt(n.innerType,r);case"prefault":return wt(n.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return wt(n.in,r)||wt(n.out,r);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${n.type}`)}var Gg={};var ra={};kt(ra,{ZodISODate:()=>Qs,ZodISODateTime:()=>Xs,ZodISODuration:()=>ta,ZodISOTime:()=>ea,date:()=>gd,datetime:()=>md,duration:()=>_d,time:()=>yd});var Xs=O("ZodISODateTime",(t,e)=>{Bl.init(t,e),Pe.init(t,e)});function md(t){return Tf(Xs,t)}var Qs=O("ZodISODate",(t,e)=>{zl.init(t,e),Pe.init(t,e)});function gd(t){return $f(Qs,t)}var ea=O("ZodISOTime",(t,e)=>{Cl.init(t,e),Pe.init(t,e)});function yd(t){return Lf(ea,t)}var ta=O("ZodISODuration",(t,e)=>{Ul.init(t,e),Pe.init(t,e)});function _d(t){return Pf(ta,t)}var Yg=(t,e)=>{Mi.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>Fi(t,r)},flatten:{value:r=>ji(t,r)},addIssue:{value:r=>t.issues.push(r)},addIssues:{value:r=>t.issues.push(...r)},isEmpty:{get(){return t.issues.length===0}}})},ux=O("ZodError",Yg),ni=O("ZodError",Yg,{Parent:Error});var bd=ps(ni),vd=gs(ni),wd=_s(ni),xd=bs(ni);var ge=O("ZodType",(t,e)=>(ae.init(t,e),t.def=e,Object.defineProperty(t,"_def",{value:e}),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),t.clone=(r,i)=>Xt(t,r,i),t.brand=()=>t,t.register=(r,i)=>(r.add(t,i),t),t.parse=(r,i)=>bd(t,r,i,{callee:t.parse}),t.safeParse=(r,i)=>wd(t,r,i),t.parseAsync=async(r,i)=>vd(t,r,i,{callee:t.parseAsync}),t.safeParseAsync=async(r,i)=>xd(t,r,i),t.spa=t.safeParseAsync,t.refine=(r,i)=>t.check(C0(r,i)),t.superRefine=r=>t.check(U0(r)),t.overwrite=r=>t.check(kr(r)),t.optional=()=>oa(t),t.nullable=()=>sa(t),t.nullish=()=>oa(sa(t)),t.nonoptional=r=>I0(t,r),t.array=()=>Wd(t),t.or=r=>da([t,r]),t.and=r=>l0(t,r),t.transform=r=>aa(t,Hd(r)),t.default=r=>x0(t,r),t.prefault=r=>E0(t,r),t.catch=r=>A0(t,r),t.pipe=r=>aa(t,r),t.readonly=()=>T0(t),t.describe=r=>{let i=t.clone();return mr.add(i,{description:r}),i},Object.defineProperty(t,"description",{get(){return mr.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return mr.get(t);let i=t.clone();return mr.add(i,r[0]),i},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),Id=O("_ZodString",(t,e)=>{Vi.init(t,e),ge.init(t,e);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,t.regex=(...i)=>t.check(Yi(...i)),t.includes=(...i)=>t.check(eo(...i)),t.startsWith=(...i)=>t.check(to(...i)),t.endsWith=(...i)=>t.check(ro(...i)),t.min=(...i)=>t.check(Wr(...i)),t.max=(...i)=>t.check(ti(...i)),t.length=(...i)=>t.check(ri(...i)),t.nonempty=(...i)=>t.check(Wr(1,...i)),t.lowercase=i=>t.check(Xi(i)),t.uppercase=i=>t.check(Qi(i)),t.trim=()=>t.check(oo()),t.normalize=(...i)=>t.check(io(...i)),t.toLowerCase=()=>t.check(so()),t.toUpperCase=()=>t.check(ao())}),ca=O("ZodString",(t,e)=>{Vi.init(t,e),Id.init(t,e),t.email=r=>t.check(Ns(Rd,r)),t.url=r=>t.check(Bs(kd,r)),t.jwt=r=>t.check(Js(Fd,r)),t.emoji=r=>t.check(zs(Ad,r)),t.guid=r=>t.check(Gi(na,r)),t.uuid=r=>t.check(Ts(Or,r)),t.uuidv4=r=>t.check($s(Or,r)),t.uuidv6=r=>t.check(Ls(Or,r)),t.uuidv7=r=>t.check(Ps(Or,r)),t.nanoid=r=>t.check(Cs(Od,r)),t.guid=r=>t.check(Gi(na,r)),t.cuid=r=>t.check(Us(Nd,r)),t.cuid2=r=>t.check(Ds(Td,r)),t.ulid=r=>t.check(Ms($d,r)),t.base64=r=>t.check(qs(Dd,r)),t.base64url=r=>t.check(Hs(Md,r)),t.xid=r=>t.check(js(Ld,r)),t.ksuid=r=>t.check(Fs(Pd,r)),t.ipv4=r=>t.check(Zs(Bd,r)),t.ipv6=r=>t.check(Vs(zd,r)),t.cidrv4=r=>t.check(Ws(Cd,r)),t.cidrv6=r=>t.check(Ks(Ud,r)),t.e164=r=>t.check(Gs(jd,r)),t.datetime=r=>t.check(md(r)),t.date=r=>t.check(gd(r)),t.time=r=>t.check(yd(r)),t.duration=r=>t.check(_d(r))});function Sd(t){return Of(ca,t)}var Pe=O("ZodStringFormat",(t,e)=>{Te.init(t,e),Id.init(t,e)}),Rd=O("ZodEmail",(t,e)=>{Rl.init(t,e),Pe.init(t,e)});function fx(t){return Ns(Rd,t)}var na=O("ZodGUID",(t,e)=>{El.init(t,e),Pe.init(t,e)});function dx(t){return Gi(na,t)}var Or=O("ZodUUID",(t,e)=>{Il.init(t,e),Pe.init(t,e)});function hx(t){return Ts(Or,t)}function px(t){return $s(Or,t)}function mx(t){return Ls(Or,t)}function gx(t){return Ps(Or,t)}var kd=O("ZodURL",(t,e)=>{kl.init(t,e),Pe.init(t,e)});function yx(t){return Bs(kd,t)}var Ad=O("ZodEmoji",(t,e)=>{Al.init(t,e),Pe.init(t,e)});function _x(t){return zs(Ad,t)}var Od=O("ZodNanoID",(t,e)=>{Ol.init(t,e),Pe.init(t,e)});function bx(t){return Cs(Od,t)}var Nd=O("ZodCUID",(t,e)=>{Nl.init(t,e),Pe.init(t,e)});function vx(t){return Us(Nd,t)}var Td=O("ZodCUID2",(t,e)=>{Tl.init(t,e),Pe.init(t,e)});function wx(t){return Ds(Td,t)}var $d=O("ZodULID",(t,e)=>{$l.init(t,e),Pe.init(t,e)});function xx(t){return Ms($d,t)}var Ld=O("ZodXID",(t,e)=>{Ll.init(t,e),Pe.init(t,e)});function Sx(t){return js(Ld,t)}var Pd=O("ZodKSUID",(t,e)=>{Pl.init(t,e),Pe.init(t,e)});function Ex(t){return Fs(Pd,t)}var Bd=O("ZodIPv4",(t,e)=>{Dl.init(t,e),Pe.init(t,e)});function Ix(t){return Zs(Bd,t)}var zd=O("ZodIPv6",(t,e)=>{Ml.init(t,e),Pe.init(t,e)});function Rx(t){return Vs(zd,t)}var Cd=O("ZodCIDRv4",(t,e)=>{jl.init(t,e),Pe.init(t,e)});function kx(t){return Ws(Cd,t)}var Ud=O("ZodCIDRv6",(t,e)=>{Fl.init(t,e),Pe.init(t,e)});function Ax(t){return Ks(Ud,t)}var Dd=O("ZodBase64",(t,e)=>{Vl.init(t,e),Pe.init(t,e)});function Ox(t){return qs(Dd,t)}var Md=O("ZodBase64URL",(t,e)=>{Wl.init(t,e),Pe.init(t,e)});function Nx(t){return Hs(Md,t)}var jd=O("ZodE164",(t,e)=>{Kl.init(t,e),Pe.init(t,e)});function Tx(t){return Gs(jd,t)}var Fd=O("ZodJWT",(t,e)=>{ql.init(t,e),Pe.init(t,e)});function $x(t){return Js(Fd,t)}var fo=O("ZodNumber",(t,e)=>{Is.init(t,e),ge.init(t,e),t.gt=(i,n)=>t.check(Rr(i,n)),t.gte=(i,n)=>t.check(Kt(i,n)),t.min=(i,n)=>t.check(Kt(i,n)),t.lt=(i,n)=>t.check(Ir(i,n)),t.lte=(i,n)=>t.check(ir(i,n)),t.max=(i,n)=>t.check(ir(i,n)),t.int=i=>t.check(Ed(i)),t.safe=i=>t.check(Ed(i)),t.positive=i=>t.check(Rr(0,i)),t.nonnegative=i=>t.check(Kt(0,i)),t.negative=i=>t.check(Ir(0,i)),t.nonpositive=i=>t.check(ir(0,i)),t.multipleOf=(i,n)=>t.check(Sn(i,n)),t.step=(i,n)=>t.check(Sn(i,n)),t.finite=()=>t;let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function Xg(t){return Bf(fo,t)}var ii=O("ZodNumberFormat",(t,e)=>{Hl.init(t,e),fo.init(t,e)});function Ed(t){return Cf(ii,t)}function Lx(t){return Uf(ii,t)}function Px(t){return Df(ii,t)}function Bx(t){return Mf(ii,t)}function zx(t){return jf(ii,t)}var ho=O("ZodBoolean",(t,e)=>{Wi.init(t,e),ge.init(t,e)});function Qg(t){return Ff(ho,t)}var po=O("ZodBigInt",(t,e)=>{Rs.init(t,e),ge.init(t,e),t.gte=(i,n)=>t.check(Kt(i,n)),t.min=(i,n)=>t.check(Kt(i,n)),t.gt=(i,n)=>t.check(Rr(i,n)),t.gte=(i,n)=>t.check(Kt(i,n)),t.min=(i,n)=>t.check(Kt(i,n)),t.lt=(i,n)=>t.check(Ir(i,n)),t.lte=(i,n)=>t.check(ir(i,n)),t.max=(i,n)=>t.check(ir(i,n)),t.positive=i=>t.check(Rr(BigInt(0),i)),t.negative=i=>t.check(Ir(BigInt(0),i)),t.nonpositive=i=>t.check(ir(BigInt(0),i)),t.nonnegative=i=>t.check(Kt(BigInt(0),i)),t.multipleOf=(i,n)=>t.check(Sn(i,n));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});function Cx(t){return Vf(po,t)}var Zd=O("ZodBigIntFormat",(t,e)=>{Gl.init(t,e),po.init(t,e)});function Ux(t){return Kf(Zd,t)}function Dx(t){return qf(Zd,t)}var e0=O("ZodSymbol",(t,e)=>{Jl.init(t,e),ge.init(t,e)});function Mx(t){return Hf(e0,t)}var t0=O("ZodUndefined",(t,e)=>{Yl.init(t,e),ge.init(t,e)});function jx(t){return Gf(t0,t)}var r0=O("ZodNull",(t,e)=>{Xl.init(t,e),ge.init(t,e)});function n0(t){return Jf(r0,t)}var i0=O("ZodAny",(t,e)=>{Ql.init(t,e),ge.init(t,e)});function Fx(){return Yf(i0)}var Vd=O("ZodUnknown",(t,e)=>{Vr.init(t,e),ge.init(t,e)});function ia(){return Qn(Vd)}var o0=O("ZodNever",(t,e)=>{ef.init(t,e),ge.init(t,e)});function ua(t){return Xf(o0,t)}var s0=O("ZodVoid",(t,e)=>{tf.init(t,e),ge.init(t,e)});function Zx(t){return Qf(s0,t)}var la=O("ZodDate",(t,e)=>{rf.init(t,e),ge.init(t,e),t.min=(i,n)=>t.check(Kt(i,n)),t.max=(i,n)=>t.check(ir(i,n));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});function Vx(t){return ed(la,t)}var a0=O("ZodArray",(t,e)=>{Ki.init(t,e),ge.init(t,e),t.element=e.element,t.min=(r,i)=>t.check(Wr(r,i)),t.nonempty=r=>t.check(Wr(1,r)),t.max=(r,i)=>t.check(ti(r,i)),t.length=(r,i)=>t.check(ri(r,i)),t.unwrap=()=>t.element});function Wd(t,e){return co(a0,t,e)}function Wx(t){let e=t._zod.def.shape;return y0(Object.keys(e))}var fa=O("ZodObject",(t,e)=>{nf.init(t,e),ge.init(t,e),K.defineLazy(t,"shape",()=>Object.fromEntries(Object.entries(t._zod.def.shape))),t.keyof=()=>m0(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:ia()}),t.loose=()=>t.clone({...t._zod.def,catchall:ia()}),t.strict=()=>t.clone({...t._zod.def,catchall:ua()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=r=>K.extend(t,r),t.merge=r=>K.merge(t,r),t.pick=r=>K.pick(t,r),t.omit=r=>K.omit(t,r),t.partial=(...r)=>K.partial(Gd,t,r[0]),t.required=(...r)=>K.required(Jd,t,r[0])});function Kx(t,e){let r={type:"object",get shape(){return K.assignProp(this,"shape",{...t}),this.shape},...K.normalizeParams(e)};return new fa(r)}function qx(t,e){return new fa({type:"object",get shape(){return K.assignProp(this,"shape",{...t}),this.shape},catchall:ua(),...K.normalizeParams(e)})}function Hx(t,e){return new fa({type:"object",get shape(){return K.assignProp(this,"shape",{...t}),this.shape},catchall:ia(),...K.normalizeParams(e)})}var Kd=O("ZodUnion",(t,e)=>{ks.init(t,e),ge.init(t,e),t.options=e.options});function da(t,e){return new Kd({type:"union",options:t,...K.normalizeParams(e)})}var c0=O("ZodDiscriminatedUnion",(t,e)=>{Kd.init(t,e),of.init(t,e)});function Gx(t,e,r){return new c0({type:"union",options:e,discriminator:t,...K.normalizeParams(r)})}var u0=O("ZodIntersection",(t,e)=>{sf.init(t,e),ge.init(t,e)});function l0(t,e){return new u0({type:"intersection",left:t,right:e})}var f0=O("ZodTuple",(t,e)=>{xn.init(t,e),ge.init(t,e),t.rest=r=>t.clone({...t._zod.def,rest:r})});function Jx(t,e,r){let i=e instanceof ae,n=i?r:e,o=i?e:null;return new f0({type:"tuple",items:t,rest:o,...K.normalizeParams(n)})}var qd=O("ZodRecord",(t,e)=>{af.init(t,e),ge.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function d0(t,e,r){return new qd({type:"record",keyType:t,valueType:e,...K.normalizeParams(r)})}function Yx(t,e,r){return new qd({type:"record",keyType:da([t,ua()]),valueType:e,...K.normalizeParams(r)})}var h0=O("ZodMap",(t,e)=>{cf.init(t,e),ge.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function Xx(t,e,r){return new h0({type:"map",keyType:t,valueType:e,...K.normalizeParams(r)})}var p0=O("ZodSet",(t,e)=>{uf.init(t,e),ge.init(t,e),t.min=(...r)=>t.check(En(...r)),t.nonempty=r=>t.check(En(1,r)),t.max=(...r)=>t.check(ei(...r)),t.size=(...r)=>t.check(Ji(...r))});function Qx(t,e){return new p0({type:"set",valueType:t,...K.normalizeParams(e)})}var lo=O("ZodEnum",(t,e)=>{lf.init(t,e),ge.init(t,e),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(i,n)=>{let o={};for(let s of i)if(r.has(s))o[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new lo({...e,checks:[],...K.normalizeParams(n),entries:o})},t.exclude=(i,n)=>{let o={...e.entries};for(let s of i)if(r.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new lo({...e,checks:[],...K.normalizeParams(n),entries:o})}});function m0(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new lo({type:"enum",entries:r,...K.normalizeParams(e)})}function e1(t,e){return new lo({type:"enum",entries:t,...K.normalizeParams(e)})}var g0=O("ZodLiteral",(t,e)=>{ff.init(t,e),ge.init(t,e),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function y0(t,e){return new g0({type:"literal",values:Array.isArray(t)?t:[t],...K.normalizeParams(e)})}var _0=O("ZodFile",(t,e)=>{df.init(t,e),ge.init(t,e),t.min=(r,i)=>t.check(En(r,i)),t.max=(r,i)=>t.check(ei(r,i)),t.mime=(r,i)=>t.check(no(Array.isArray(r)?r:[r],i))});function t1(t){return ud(_0,t)}var b0=O("ZodTransform",(t,e)=>{hf.init(t,e),ge.init(t,e),t._zod.parse=(r,i)=>{r.addIssue=o=>{if(typeof o=="string")r.issues.push(K.issue(o,r.value,e));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=t),s.continue??(s.continue=!0),r.issues.push(K.issue(s))}};let n=e.transform(r.value,r);return n instanceof Promise?n.then(o=>(r.value=o,r)):(r.value=n,r)}});function Hd(t){return new b0({type:"transform",transform:t})}var Gd=O("ZodOptional",(t,e)=>{pf.init(t,e),ge.init(t,e),t.unwrap=()=>t._zod.def.innerType});function oa(t){return new Gd({type:"optional",innerType:t})}var v0=O("ZodNullable",(t,e)=>{mf.init(t,e),ge.init(t,e),t.unwrap=()=>t._zod.def.innerType});function sa(t){return new v0({type:"nullable",innerType:t})}function r1(t){return oa(sa(t))}var w0=O("ZodDefault",(t,e)=>{gf.init(t,e),ge.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function x0(t,e){return new w0({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}var S0=O("ZodPrefault",(t,e)=>{yf.init(t,e),ge.init(t,e),t.unwrap=()=>t._zod.def.innerType});function E0(t,e){return new S0({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}var Jd=O("ZodNonOptional",(t,e)=>{_f.init(t,e),ge.init(t,e),t.unwrap=()=>t._zod.def.innerType});function I0(t,e){return new Jd({type:"nonoptional",innerType:t,...K.normalizeParams(e)})}var R0=O("ZodSuccess",(t,e)=>{bf.init(t,e),ge.init(t,e),t.unwrap=()=>t._zod.def.innerType});function n1(t){return new R0({type:"success",innerType:t})}var k0=O("ZodCatch",(t,e)=>{vf.init(t,e),ge.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function A0(t,e){return new k0({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var O0=O("ZodNaN",(t,e)=>{wf.init(t,e),ge.init(t,e)});function i1(t){return rd(O0,t)}var Yd=O("ZodPipe",(t,e)=>{qi.init(t,e),ge.init(t,e),t.in=e.in,t.out=e.out});function aa(t,e){return new Yd({type:"pipe",in:t,out:e})}var N0=O("ZodReadonly",(t,e)=>{xf.init(t,e),ge.init(t,e)});function T0(t){return new N0({type:"readonly",innerType:t})}var $0=O("ZodTemplateLiteral",(t,e)=>{Sf.init(t,e),ge.init(t,e)});function o1(t,e){return new $0({type:"template_literal",parts:t,...K.normalizeParams(e)})}var L0=O("ZodLazy",(t,e)=>{If.init(t,e),ge.init(t,e),t.unwrap=()=>t._zod.def.getter()});function P0(t){return new L0({type:"lazy",getter:t})}var B0=O("ZodPromise",(t,e)=>{Ef.init(t,e),ge.init(t,e),t.unwrap=()=>t._zod.def.innerType});function s1(t){return new B0({type:"promise",innerType:t})}var ha=O("ZodCustom",(t,e)=>{Rf.init(t,e),ge.init(t,e)});function z0(t,e){let r=new Ve({check:"custom",...K.normalizeParams(e)});return r._zod.check=t,r}function a1(t,e){return ld(ha,t??(()=>!0),e)}function C0(t,e={}){return fd(ha,t,e)}function U0(t,e){let r=z0(i=>(i.addIssue=n=>{if(typeof n=="string")i.issues.push(K.issue(n,i.value,r._zod.def));else{let o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=i.value),o.inst??(o.inst=r),o.continue??(o.continue=!r._zod.def.abort),i.issues.push(K.issue(o))}},t(i.value,i)),e);return r}function c1(t,e={error:`Input not instance of ${t.name}`}){let r=new ha({type:"custom",check:"custom",fn:i=>i instanceof t,abort:!0,...K.normalizeParams(e)});return r._zod.bag.Class=t,r}var u1=(...t)=>dd({Pipe:Yd,Boolean:ho,Unknown:Vd},...t);function l1(t){let e=P0(()=>da([Sd(t),Xg(),Qg(),n0(),Wd(e),d0(Sd(),e)]));return e}function f1(t,e){return aa(Hd(t),e)}var d1={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"},h1=Object.freeze({status:"aborted"}),p1=h1;function m1(t){Ye({customError:t})}function g1(){return Ye().customError}var Xd={};kt(Xd,{bigint:()=>v1,boolean:()=>b1,date:()=>w1,number:()=>_1,string:()=>y1});function y1(t){return Nf(ca,t)}function _1(t){return zf(fo,t)}function b1(t){return Zf(ho,t)}function v1(t){return Wf(po,t)}function w1(t){return td(la,t)}Ye(As());var x1=/[@#$%^&*+=\/\\|~«»]/,S1=/(!{2,}|\?{2,}|-{2,})/,E1=/[\u{1F300}-\u{1F9FF}]|[\u{2702}-\u{27B0}]|[\u{2600}-\u{26FF}]|[\u{2B00}-\u{2BFF}]/u,Kr=({max:t,noSpaces:e}={})=>(e?V.string().max(t??Number.POSITIVE_INFINITY).regex(/^\S*$/,"Spaces are not allowed"):V.string().max(t??Number.POSITIVE_INFINITY)).refine(i=>!E1.test(i),{message:"Emojis and symbols are not allowed"}).refine(i=>!x1.test(i),{message:"Special characters (@, #, $, %, ^, &, *, +, =, /, \\, |, ~, \xAB, \xBB) are not allowed"}).refine(i=>!S1.test(i),{message:"Repeated punctuations (!!, ??, --) are not allowed"}),xt=V.string().url().startsWith("https://",{message:"Must be an https url"}).max(1024).refine(t=>!t.includes(" "),{message:"URL must not contain spaces"}).refine(t=>{try{let e=new URL(t).hostname;return!(e==="localhost"||e.endsWith(".localhost")||/^(\d{1,3}\.){3}\d{1,3}$/.test(e)||e.startsWith("[")&&e.endsWith("]"))}catch{return!1}},{message:"URL must not use IP addresses or localhost"}),oi=V.string().max(32),mo=V.string().max(32),I1=/^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}\/(?:[-a-z0-9]{3,8}:[-.%a-zA-Z0-9]{1,128}(?:\/[-.%a-zA-Z0-9]{1,78})?|native)$/,Qd=V.string().regex(I1,{message:"Invalid CAIP-19 asset ID"}),si=V.string().regex(/^#([0-9A-F]{3}|[0-9A-F]{6})$/i,{message:"Invalid hex color code. It should be in the format #RRGGBB or #RGB."}),R1=/^(?!.*\.\.)([a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,eh=V.string().max(1024).regex(R1,{message:"Must be a valid domain name (e.g., example.com, sub.example.com)"}).refine(t=>!t.includes("://"),{message:"Domain must not include protocol (http://, https://, etc.)"}).refine(t=>!t.includes("/"),{message:"Domain must not include path separators"}).refine(t=>!t.includes("@"),{message:"Domain must not include @ symbol"}).refine(t=>!t.includes(":"),{message:"Domain must not include port numbers"}),th=V.union([V.literal("1:1"),V.literal("3:2")]),rh=V.object({header:V.string(),payload:V.string(),signature:V.string()}),k1=V.object({fid:V.number(),type:V.literal("app_key"),key:V.string().startsWith("0x")});var D0=V.object({type:V.literal("launch_frame"),name:oi,url:xt.optional(),splashImageUrl:xt.optional(),splashBackgroundColor:si.optional()}),M0=V.object({type:V.literal("launch_miniapp"),name:oi,url:xt.optional(),splashImageUrl:xt.optional(),splashBackgroundColor:si.optional()}),j0=V.object({type:V.literal("view_token"),token:Qd}),F0=V.discriminatedUnion("type",[M0,j0,D0]),Z0=V.object({title:mo,action:F0}),V0=V.object({version:V.literal("next"),imageUrl:xt,aspectRatio:th.optional(),button:Z0}),W0=t=>V0.safeParse(t),A1=W0;var go=V.object({url:V.string(),token:V.string()}),O1=V.object({notificationId:V.string().max(128),title:V.string().max(32),body:V.string().max(128),targetUrl:xt,tokens:V.string().array().max(100)}),N1=V.object({result:V.object({successfulTokens:V.array(V.string()),invalidTokens:V.array(V.string()),rateLimitedTokens:V.array(V.string())})});var K0=V.object({event:V.literal("miniapp_added"),notificationDetails:go.optional()}),q0=V.object({event:V.literal("frame_added"),notificationDetails:go.optional()}),H0=V.object({event:V.literal("miniapp_removed")}),G0=V.object({event:V.literal("frame_removed")}),J0=V.object({event:V.literal("notifications_enabled"),notificationDetails:go.required()}),Y0=V.object({event:V.literal("notifications_disabled")}),T1=V.discriminatedUnion("event",[K0,H0,J0,Y0,q0,G0]);var $1=V.enum(["games","social","finance","utility","productivity","health-fitness","news-media","music","shopping","education","developer-tools","entertainment","art-creativity"]),L1=["eip155:1","eip155:8453","eip155:42161","eip155:421614","eip155:84532","eip155:666666666","eip155:100","eip155:10","eip155:11155420","eip155:137","eip155:11155111","eip155:7777777","eip155:130","eip155:10143","eip155:42220","solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"];function X0(t){let e=new Set(t);return Array.from(e)}var nh=V.object({version:V.union([V.literal("0.0.0"),V.literal("0.0.1"),V.literal("1"),V.literal("next")]),name:oi,iconUrl:xt,homeUrl:xt,imageUrl:xt.optional(),buttonTitle:mo.optional(),splashImageUrl:xt.optional(),splashBackgroundColor:si.optional(),webhookUrl:xt.optional(),subtitle:Kr({max:30}).optional(),description:Kr({max:170}).optional(),screenshotUrls:V.array(xt).max(3).optional(),primaryCategory:$1.optional(),tags:V.array(Kr({max:20,noSpaces:!0})).max(5).optional(),heroImageUrl:xt.optional(),tagline:Kr({max:30}).optional(),ogTitle:Kr({max:30}).optional(),ogDescription:Kr({max:100}).optional(),ogImageUrl:xt.optional(),noindex:V.boolean().optional(),requiredChains:V.array(V.enum(L1)).transform(X0).optional(),requiredCapabilities:V.array(V.enum(hu)).transform(X0).optional(),castShareUrl:xt.optional(),canonicalDomain:eh.optional()}).refine(t=>{if(t.castShareUrl===void 0)return!0;try{let e=new URL(t.homeUrl).hostname,r=new URL(t.castShareUrl).hostname;return e===r}catch{return!1}},{message:"castShareUrl must have the same domain as homeUrl",path:["castShareUrl"]}),P1=V.object({accountAssociation:rh,miniapp:nh.optional(),frame:nh.optional()}).refine(t=>t.frame&&t.miniapp?JSON.stringify(t.frame)===JSON.stringify(t.miniapp):!0,{message:'If both "frame" and "miniapp" are provided, they must be identical',path:["frame","miniapp"]});var se=Sr(_o());function bo(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function hS(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Hr(t,...e){if(!hS(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function by(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");bo(t.outputLen),bo(t.blockLen)}function Tr(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 ya(t,e){Hr(t);let r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}var kn=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function vy(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function _a(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function cr(t,e){return t<<32-e|t>>>e}var ph=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function pS(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function mh(t){for(let e=0;e<t.length;e++)t[e]=pS(t[e])}function wy(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function Jr(t){return typeof t=="string"&&(t=wy(t)),Hr(t),t}function gh(...t){let e=0;for(let i=0;i<t.length;i++){let n=t[i];Hr(n),e+=n.length}let r=new Uint8Array(e);for(let i=0,n=0;i<t.length;i++){let o=t[i];r.set(o,n),n+=o.length}return r}var Gr=class{clone(){return this._cloneInto()}};function fi(t){let e=i=>t().update(Jr(i)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function xy(t){let e=(i,n)=>t(n).update(Jr(i)).digest(),r=t({});return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=i=>t(i),e}function ba(t=32){if(kn&&typeof kn.getRandomValues=="function")return kn.getRandomValues(new Uint8Array(t));if(kn&&typeof kn.randomBytes=="function")return kn.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}function mS(t,e,r,i){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,i);let n=BigInt(32),o=BigInt(4294967295),s=Number(r>>n&o),c=Number(r&o),u=i?4:0,p=i?0:4;t.setUint32(e+u,s,i),t.setUint32(e+p,c,i)}function Sy(t,e,r){return t&e^~t&r}function Ey(t,e,r){return t&e^t&r^e&r}var di=class extends Gr{constructor(e,r,i,n){super(),this.blockLen=e,this.outputLen=r,this.padOffset=i,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=_a(this.buffer)}update(e){Tr(this);let{view:r,buffer:i,blockLen:n}=this;e=Jr(e);let o=e.length;for(let s=0;s<o;){let c=Math.min(n-this.pos,o-s);if(c===n){let u=_a(e);for(;n<=o-s;s+=n)this.process(u,s);continue}i.set(e.subarray(s,s+c),this.pos),this.pos+=c,s+=c,this.pos===n&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Tr(this),ya(e,this),this.finished=!0;let{buffer:r,view:i,blockLen:n,isLE:o}=this,{pos:s}=this;r[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>n-s&&(this.process(i,0),s=0);for(let _=s;_<n;_++)r[_]=0;mS(i,n-8,BigInt(this.length*8),o),this.process(i,0);let c=_a(e),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let p=u/4,m=this.get();if(p>m.length)throw new Error("_sha2: outputLen bigger than state");for(let _=0;_<p;_++)c.setUint32(4*_,m[_],o)}digest(){let{buffer:e,outputLen:r}=this;this.digestInto(e);let i=e.slice(0,r);return this.destroy(),i}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:r,buffer:i,length:n,finished:o,destroyed:s,pos:c}=this;return e.length=n,e.pos=c,e.finished=o,e.destroyed=s,n%r&&e.buffer.set(i),e}};var va=BigInt(4294967295),yh=BigInt(32);function Iy(t,e=!1){return e?{h:Number(t&va),l:Number(t>>yh&va)}:{h:Number(t>>yh&va)|0,l:Number(t&va)|0}}function _h(t,e=!1){let r=new Uint32Array(t.length),i=new Uint32Array(t.length);for(let n=0;n<t.length;n++){let{h:o,l:s}=Iy(t[n],e);[r[n],i[n]]=[o,s]}return[r,i]}var gS=(t,e)=>BigInt(t>>>0)<<yh|BigInt(e>>>0),yS=(t,e,r)=>t>>>r,_S=(t,e,r)=>t<<32-r|e>>>r,bS=(t,e,r)=>t>>>r|e<<32-r,vS=(t,e,r)=>t<<32-r|e>>>r,wS=(t,e,r)=>t<<64-r|e>>>r-32,xS=(t,e,r)=>t>>>r-32|e<<64-r,SS=(t,e)=>e,ES=(t,e)=>t,bh=(t,e,r)=>t<<r|e>>>32-r,vh=(t,e,r)=>e<<r|t>>>32-r,wh=(t,e,r)=>e<<r-32|t>>>64-r,xh=(t,e,r)=>t<<r-32|e>>>64-r;function IS(t,e,r,i){let n=(e>>>0)+(i>>>0);return{h:t+r+(n/2**32|0)|0,l:n|0}}var RS=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),kS=(t,e,r,i)=>e+r+i+(t/2**32|0)|0,AS=(t,e,r,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(i>>>0),OS=(t,e,r,i,n)=>e+r+i+n+(t/2**32|0)|0,NS=(t,e,r,i,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(i>>>0)+(n>>>0),TS=(t,e,r,i,n,o)=>e+r+i+n+o+(t/2**32|0)|0;var $S={fromBig:Iy,split:_h,toBig:gS,shrSH:yS,shrSL:_S,rotrSH:bS,rotrSL:vS,rotrBH:wS,rotrBL:xS,rotr32H:SS,rotr32L:ES,rotlSH:bh,rotlSL:vh,rotlBH:wh,rotlBL:xh,add:IS,add3L:RS,add3H:kS,add4L:AS,add4H:OS,add5H:TS,add5L:NS},he=$S;var[LS,PS]=he.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))),Yr=new Uint32Array(80),Xr=new Uint32Array(80),Sh=class extends di{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(){let{Ah:e,Al:r,Bh:i,Bl:n,Ch:o,Cl:s,Dh:c,Dl:u,Eh:p,El:m,Fh:_,Fl:w,Gh:g,Gl:A,Hh:I,Hl:R}=this;return[e,r,i,n,o,s,c,u,p,m,_,w,g,A,I,R]}set(e,r,i,n,o,s,c,u,p,m,_,w,g,A,I,R){this.Ah=e|0,this.Al=r|0,this.Bh=i|0,this.Bl=n|0,this.Ch=o|0,this.Cl=s|0,this.Dh=c|0,this.Dl=u|0,this.Eh=p|0,this.El=m|0,this.Fh=_|0,this.Fl=w|0,this.Gh=g|0,this.Gl=A|0,this.Hh=I|0,this.Hl=R|0}process(e,r){for(let $=0;$<16;$++,r+=4)Yr[$]=e.getUint32(r),Xr[$]=e.getUint32(r+=4);for(let $=16;$<80;$++){let C=Yr[$-15]|0,Q=Xr[$-15]|0,J=he.rotrSH(C,Q,1)^he.rotrSH(C,Q,8)^he.shrSH(C,Q,7),Y=he.rotrSL(C,Q,1)^he.rotrSL(C,Q,8)^he.shrSL(C,Q,7),X=Yr[$-2]|0,ee=Xr[$-2]|0,Re=he.rotrSH(X,ee,19)^he.rotrBH(X,ee,61)^he.shrSH(X,ee,6),ne=he.rotrSL(X,ee,19)^he.rotrBL(X,ee,61)^he.shrSL(X,ee,6),fe=he.add4L(Y,ne,Xr[$-7],Xr[$-16]),S=he.add4H(fe,J,Re,Yr[$-7],Yr[$-16]);Yr[$]=S|0,Xr[$]=fe|0}let{Ah:i,Al:n,Bh:o,Bl:s,Ch:c,Cl:u,Dh:p,Dl:m,Eh:_,El:w,Fh:g,Fl:A,Gh:I,Gl:R,Hh:T,Hl:B}=this;for(let $=0;$<80;$++){let C=he.rotrSH(_,w,14)^he.rotrSH(_,w,18)^he.rotrBH(_,w,41),Q=he.rotrSL(_,w,14)^he.rotrSL(_,w,18)^he.rotrBL(_,w,41),J=_&g^~_&I,Y=w&A^~w&R,X=he.add5L(B,Q,Y,PS[$],Xr[$]),ee=he.add5H(X,T,C,J,LS[$],Yr[$]),Re=X|0,ne=he.rotrSH(i,n,28)^he.rotrBH(i,n,34)^he.rotrBH(i,n,39),fe=he.rotrSL(i,n,28)^he.rotrBL(i,n,34)^he.rotrBL(i,n,39),S=i&o^i&c^o&c,a=n&s^n&u^s&u;T=I|0,B=R|0,I=g|0,R=A|0,g=_|0,A=w|0,{h:_,l:w}=he.add(p|0,m|0,ee|0,Re|0),p=c|0,m=u|0,c=o|0,u=s|0,o=i|0,s=n|0;let f=he.add3L(Re,fe,a);i=he.add3H(f,ee,ne,S),n=f|0}({h:i,l:n}=he.add(this.Ah|0,this.Al|0,i|0,n|0)),{h:o,l:s}=he.add(this.Bh|0,this.Bl|0,o|0,s|0),{h:c,l:u}=he.add(this.Ch|0,this.Cl|0,c|0,u|0),{h:p,l:m}=he.add(this.Dh|0,this.Dl|0,p|0,m|0),{h:_,l:w}=he.add(this.Eh|0,this.El|0,_|0,w|0),{h:g,l:A}=he.add(this.Fh|0,this.Fl|0,g|0,A|0),{h:I,l:R}=he.add(this.Gh|0,this.Gl|0,I|0,R|0),{h:T,l:B}=he.add(this.Hh|0,this.Hl|0,T|0,B|0),this.set(i,n,o,s,c,u,p,m,_,w,g,A,I,R,T,B)}roundClean(){Yr.fill(0),Xr.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)}};var Ry=fi(()=>new Sh);var Sa={};kt(Sa,{aInRange:()=>Ht,abool:()=>ur,abytes:()=>hi,bitGet:()=>MS,bitLen:()=>kh,bitMask:()=>wo,bitSet:()=>jS,bytesToHex:()=>Lr,bytesToNumberBE:()=>Pr,bytesToNumberLE:()=>en,concatBytes:()=>Br,createHmacDrbg:()=>Ah,ensureBytes:()=>We,equalBytes:()=>US,hexToBytes:()=>On,hexToNumber:()=>Rh,inRange:()=>vo,isBytes:()=>Qr,memoized:()=>Tn,notImplemented:()=>ZS,numberToBytesBE:()=>tn,numberToBytesLE:()=>Nn,numberToHexUnpadded:()=>An,numberToVarBytesBE:()=>CS,utf8ToBytes:()=>DS,validateObject:()=>_r});var wa=BigInt(0),xa=BigInt(1),BS=BigInt(2);function Qr(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function hi(t){if(!Qr(t))throw new Error("Uint8Array expected")}function ur(t,e){if(typeof e!="boolean")throw new Error(t+" boolean expected, got "+e)}var zS=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Lr(t){hi(t);let e="";for(let r=0;r<t.length;r++)e+=zS[t[r]];return e}function An(t){let e=t.toString(16);return e.length&1?"0"+e:e}function Rh(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?wa:BigInt("0x"+t)}var $r={_0:48,_9:57,A:65,F:70,a:97,f:102};function ky(t){if(t>=$r._0&&t<=$r._9)return t-$r._0;if(t>=$r.A&&t<=$r.F)return t-($r.A-10);if(t>=$r.a&&t<=$r.f)return t-($r.a-10)}function On(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);let e=t.length,r=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);let i=new Uint8Array(r);for(let n=0,o=0;n<r;n++,o+=2){let s=ky(t.charCodeAt(o)),c=ky(t.charCodeAt(o+1));if(s===void 0||c===void 0){let u=t[o]+t[o+1];throw new Error('hex string expected, got non-hex character "'+u+'" at index '+o)}i[n]=s*16+c}return i}function Pr(t){return Rh(Lr(t))}function en(t){return hi(t),Rh(Lr(Uint8Array.from(t).reverse()))}function tn(t,e){return On(t.toString(16).padStart(e*2,"0"))}function Nn(t,e){return tn(t,e).reverse()}function CS(t){return On(An(t))}function We(t,e,r){let i;if(typeof e=="string")try{i=On(e)}catch(o){throw new Error(t+" must be hex string or Uint8Array, cause: "+o)}else if(Qr(e))i=Uint8Array.from(e);else throw new Error(t+" must be hex string or Uint8Array");let n=i.length;if(typeof r=="number"&&n!==r)throw new Error(t+" of length "+r+" expected, got "+n);return i}function Br(...t){let e=0;for(let i=0;i<t.length;i++){let n=t[i];hi(n),e+=n.length}let r=new Uint8Array(e);for(let i=0,n=0;i<t.length;i++){let o=t[i];r.set(o,n),n+=o.length}return r}function US(t,e){if(t.length!==e.length)return!1;let r=0;for(let i=0;i<t.length;i++)r|=t[i]^e[i];return r===0}function DS(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}var Eh=t=>typeof t=="bigint"&&wa<=t;function vo(t,e,r){return Eh(t)&&Eh(e)&&Eh(r)&&e<=t&&t<r}function Ht(t,e,r,i){if(!vo(e,r,i))throw new Error("expected valid "+t+": "+r+" <= n < "+i+", got "+e)}function kh(t){let e;for(e=0;t>wa;t>>=xa,e+=1);return e}function MS(t,e){return t>>BigInt(e)&xa}function jS(t,e,r){return t|(r?xa:wa)<<BigInt(e)}var wo=t=>(BS<<BigInt(t-1))-xa,Ih=t=>new Uint8Array(t),Ay=t=>Uint8Array.from(t);function Ah(t,e,r){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 r!="function")throw new Error("hmacFn must be a function");let i=Ih(t),n=Ih(t),o=0,s=()=>{i.fill(1),n.fill(0),o=0},c=(..._)=>r(n,i,..._),u=(_=Ih())=>{n=c(Ay([0]),_),i=c(),_.length!==0&&(n=c(Ay([1]),_),i=c())},p=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let _=0,w=[];for(;_<e;){i=c();let g=i.slice();w.push(g),_+=i.length}return Br(...w)};return(_,w)=>{s(),u(_);let g;for(;!(g=w(p()));)u();return s(),g}}var FS={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"||Qr(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 _r(t,e,r={}){let i=(n,o,s)=>{let c=FS[o];if(typeof c!="function")throw new Error("invalid validator function");let u=t[n];if(!(s&&u===void 0)&&!c(u,t))throw new Error("param "+String(n)+" is invalid. Expected "+o+", got "+u)};for(let[n,o]of Object.entries(e))i(n,o,!1);for(let[n,o]of Object.entries(r))i(n,o,!0);return t}var ZS=()=>{throw new Error("not implemented")};function Tn(t){let e=new WeakMap;return(r,...i)=>{let n=e.get(r);if(n!==void 0)return n;let o=t(r,...i);return e.set(r,o),o}}var St=BigInt(0),Be=BigInt(1),$n=BigInt(2),VS=BigInt(3),Oh=BigInt(4),Oy=BigInt(5),Ny=BigInt(8),WS=BigInt(9),KS=BigInt(16);function ke(t,e){let r=t%e;return r>=St?r:e+r}function qS(t,e,r){if(e<St)throw new Error("invalid exponent, negatives unsupported");if(r<=St)throw new Error("invalid modulus");if(r===Be)return St;let i=Be;for(;e>St;)e&Be&&(i=i*t%r),t=t*t%r,e>>=Be;return i}function ze(t,e,r){let i=t;for(;e-- >St;)i*=i,i%=r;return i}function Ea(t,e){if(t===St)throw new Error("invert: expected non-zero number");if(e<=St)throw new Error("invert: expected positive modulus, got "+e);let r=ke(t,e),i=e,n=St,o=Be,s=Be,c=St;for(;r!==St;){let p=i/r,m=i%r,_=n-s*p,w=o-c*p;i=r,r=m,n=s,o=c,s=_,c=w}if(i!==Be)throw new Error("invert: does not exist");return ke(n,e)}function HS(t){let e=(t-Be)/$n,r,i,n;for(r=t-Be,i=0;r%$n===St;r/=$n,i++);for(n=$n;n<t&&qS(n,e,t)!==t-Be;n++)if(n>1e3)throw new Error("Cannot find square root: likely non-prime P");if(i===1){let s=(t+Be)/Oh;return function(u,p){let m=u.pow(p,s);if(!u.eql(u.sqr(m),p))throw new Error("Cannot find square root");return m}}let o=(r+Be)/$n;return function(c,u){if(c.pow(u,e)===c.neg(c.ONE))throw new Error("Cannot find square root");let p=i,m=c.pow(c.mul(c.ONE,n),r),_=c.pow(u,o),w=c.pow(u,r);for(;!c.eql(w,c.ONE);){if(c.eql(w,c.ZERO))return c.ZERO;let g=1;for(let I=c.sqr(w);g<p&&!c.eql(I,c.ONE);g++)I=c.sqr(I);let A=c.pow(m,Be<<BigInt(p-g-1));m=c.sqr(A),_=c.mul(_,A),w=c.mul(w,m),p=g}return _}}function GS(t){if(t%Oh===VS){let e=(t+Be)/Oh;return function(i,n){let o=i.pow(n,e);if(!i.eql(i.sqr(o),n))throw new Error("Cannot find square root");return o}}if(t%Ny===Oy){let e=(t-Oy)/Ny;return function(i,n){let o=i.mul(n,$n),s=i.pow(o,e),c=i.mul(n,s),u=i.mul(i.mul(c,$n),s),p=i.mul(c,i.sub(u,i.ONE));if(!i.eql(i.sqr(p),n))throw new Error("Cannot find square root");return p}}return t%KS,HS(t)}var Ty=(t,e)=>(ke(t,e)&Be)===Be,JS=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Nh(t){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=JS.reduce((i,n)=>(i[n]="function",i),e);return _r(t,r)}function YS(t,e,r){if(r<St)throw new Error("invalid exponent, negatives unsupported");if(r===St)return t.ONE;if(r===Be)return e;let i=t.ONE,n=e;for(;r>St;)r&Be&&(i=t.mul(i,n)),n=t.sqr(n),r>>=Be;return i}function XS(t,e){let r=new Array(e.length),i=e.reduce((o,s,c)=>t.is0(s)?o:(r[c]=o,t.mul(o,s)),t.ONE),n=t.inv(i);return e.reduceRight((o,s,c)=>t.is0(s)?o:(r[c]=t.mul(o,r[c]),t.mul(o,s)),n),r}function Th(t,e){let r=e!==void 0?e:t.toString(2).length,i=Math.ceil(r/8);return{nBitLength:r,nByteLength:i}}function rn(t,e,r=!1,i={}){if(t<=St)throw new Error("invalid field: expected ORDER > 0, got "+t);let{nBitLength:n,nByteLength:o}=Th(t,e);if(o>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let s,c=Object.freeze({ORDER:t,isLE:r,BITS:n,BYTES:o,MASK:wo(n),ZERO:St,ONE:Be,create:u=>ke(u,t),isValid:u=>{if(typeof u!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof u);return St<=u&&u<t},is0:u=>u===St,isOdd:u=>(u&Be)===Be,neg:u=>ke(-u,t),eql:(u,p)=>u===p,sqr:u=>ke(u*u,t),add:(u,p)=>ke(u+p,t),sub:(u,p)=>ke(u-p,t),mul:(u,p)=>ke(u*p,t),pow:(u,p)=>YS(c,u,p),div:(u,p)=>ke(u*Ea(p,t),t),sqrN:u=>u*u,addN:(u,p)=>u+p,subN:(u,p)=>u-p,mulN:(u,p)=>u*p,inv:u=>Ea(u,t),sqrt:i.sqrt||(u=>(s||(s=GS(t)),s(c,u))),invertBatch:u=>XS(c,u),cmov:(u,p,m)=>m?p:u,toBytes:u=>r?Nn(u,o):tn(u,o),fromBytes:u=>{if(u.length!==o)throw new Error("Field.fromBytes: expected "+o+" bytes, got "+u.length);return r?en(u):Pr(u)}});return Object.freeze(c)}function $y(t){if(typeof t!="bigint")throw new Error("field order must be bigint");let e=t.toString(2).length;return Math.ceil(e/8)}function $h(t){let e=$y(t);return e+Math.ceil(e/2)}function Ly(t,e,r=!1){let i=t.length,n=$y(e),o=$h(e);if(i<16||i<o||i>1024)throw new Error("expected "+o+"-1024 bytes of input, got "+i);let s=r?en(t):Pr(t),c=ke(s,e-Be)+Be;return r?Nn(c,n):tn(c,n)}var Py=BigInt(0),Ia=BigInt(1);function Lh(t,e){let r=e.negate();return t?r:e}function By(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function Ph(t,e){By(t,e);let r=Math.ceil(e/t)+1,i=2**(t-1);return{windows:r,windowSize:i}}function QS(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((r,i)=>{if(!(r instanceof e))throw new Error("invalid point at index "+i)})}function eE(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((r,i)=>{if(!e.isValid(r))throw new Error("invalid scalar at index "+i)})}var Bh=new WeakMap,zy=new WeakMap;function zh(t){return zy.get(t)||1}function Ra(t,e){return{constTimeNegate:Lh,hasPrecomputes(r){return zh(r)!==1},unsafeLadder(r,i,n=t.ZERO){let o=r;for(;i>Py;)i&Ia&&(n=n.add(o)),o=o.double(),i>>=Ia;return n},precomputeWindow(r,i){let{windows:n,windowSize:o}=Ph(i,e),s=[],c=r,u=c;for(let p=0;p<n;p++){u=c,s.push(u);for(let m=1;m<o;m++)u=u.add(c),s.push(u);c=u.double()}return s},wNAF(r,i,n){let{windows:o,windowSize:s}=Ph(r,e),c=t.ZERO,u=t.BASE,p=BigInt(2**r-1),m=2**r,_=BigInt(r);for(let w=0;w<o;w++){let g=w*s,A=Number(n&p);n>>=_,A>s&&(A-=m,n+=Ia);let I=g,R=g+Math.abs(A)-1,T=w%2!==0,B=A<0;A===0?u=u.add(Lh(T,i[I])):c=c.add(Lh(B,i[R]))}return{p:c,f:u}},wNAFUnsafe(r,i,n,o=t.ZERO){let{windows:s,windowSize:c}=Ph(r,e),u=BigInt(2**r-1),p=2**r,m=BigInt(r);for(let _=0;_<s;_++){let w=_*c;if(n===Py)break;let g=Number(n&u);if(n>>=m,g>c&&(g-=p,n+=Ia),g===0)continue;let A=i[w+Math.abs(g)-1];g<0&&(A=A.negate()),o=o.add(A)}return o},getPrecomputes(r,i,n){let o=Bh.get(i);return o||(o=this.precomputeWindow(i,r),r!==1&&Bh.set(i,n(o))),o},wNAFCached(r,i,n){let o=zh(r);return this.wNAF(o,this.getPrecomputes(o,r,n),i)},wNAFCachedUnsafe(r,i,n,o){let s=zh(r);return s===1?this.unsafeLadder(r,i,o):this.wNAFUnsafe(s,this.getPrecomputes(s,r,n),i,o)},setWindowSize(r,i){By(i,e),zy.set(r,i),Bh.delete(r)}}}function ka(t,e,r,i){if(QS(r,t),eE(i,e),r.length!==i.length)throw new Error("arrays of points and scalars must have equal length");let n=t.ZERO,o=kh(BigInt(r.length)),s=o>12?o-3:o>4?o-2:o?2:1,c=(1<<s)-1,u=new Array(c+1).fill(n),p=Math.floor((e.BITS-1)/s)*s,m=n;for(let _=p;_>=0;_-=s){u.fill(n);for(let g=0;g<i.length;g++){let A=i[g],I=Number(A>>BigInt(_)&BigInt(c));u[I]=u[I].add(r[g])}let w=n;for(let g=u.length-1,A=n;g>0;g--)A=A.add(u[g]),w=w.add(A);if(m=m.add(w),_!==0)for(let g=0;g<s;g++)m=m.double()}return m}function xo(t){return Nh(t.Fp),_r(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Th(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}var lr=BigInt(0),Gt=BigInt(1),Aa=BigInt(2),tE=BigInt(8),rE={zip215:!0};function nE(t){let e=xo(t);return _r(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function Cy(t){let e=nE(t),{Fp:r,n:i,prehash:n,hash:o,randomBytes:s,nByteLength:c,h:u}=e,p=Aa<<BigInt(c*8)-Gt,m=r.create,_=rn(e.n,e.nBitLength),w=e.uvRatio||((d,h)=>{try{return{isValid:!0,value:r.sqrt(d*r.inv(h))}}catch{return{isValid:!1,value:lr}}}),g=e.adjustScalarBytes||(d=>d),A=e.domain||((d,h,y)=>{if(ur("phflag",y),h.length||y)throw new Error("Contexts/pre-hash are not supported");return d});function I(d,h){Ht("coordinate "+d,h,lr,p)}function R(d){if(!(d instanceof $))throw new Error("ExtendedPoint expected")}let T=Tn((d,h)=>{let{ex:y,ey:x,ez:k}=d,b=d.is0();h==null&&(h=b?tE:r.inv(k));let l=m(y*h),v=m(x*h),U=m(k*h);if(b)return{x:lr,y:Gt};if(U!==Gt)throw new Error("invZ was invalid");return{x:l,y:v}}),B=Tn(d=>{let{a:h,d:y}=e;if(d.is0())throw new Error("bad point: ZERO");let{ex:x,ey:k,ez:b,et:l}=d,v=m(x*x),U=m(k*k),M=m(b*b),Z=m(M*M),te=m(v*h),oe=m(M*m(te+U)),ue=m(Z+m(y*m(v*U)));if(oe!==ue)throw new Error("bad point: equation left != right (1)");let Le=m(x*k),de=m(b*l);if(Le!==de)throw new Error("bad point: equation left != right (2)");return!0});class ${constructor(h,y,x,k){this.ex=h,this.ey=y,this.ez=x,this.et=k,I("x",h),I("y",y),I("z",x),I("t",k),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(h){if(h instanceof $)throw new Error("extended point not allowed");let{x:y,y:x}=h||{};return I("x",y),I("y",x),new $(y,x,Gt,m(y*x))}static normalizeZ(h){let y=r.invertBatch(h.map(x=>x.ez));return h.map((x,k)=>x.toAffine(y[k])).map($.fromAffine)}static msm(h,y){return ka($,_,h,y)}_setWindowSize(h){J.setWindowSize(this,h)}assertValidity(){B(this)}equals(h){R(h);let{ex:y,ey:x,ez:k}=this,{ex:b,ey:l,ez:v}=h,U=m(y*v),M=m(b*k),Z=m(x*v),te=m(l*k);return U===M&&Z===te}is0(){return this.equals($.ZERO)}negate(){return new $(m(-this.ex),this.ey,this.ez,m(-this.et))}double(){let{a:h}=e,{ex:y,ey:x,ez:k}=this,b=m(y*y),l=m(x*x),v=m(Aa*m(k*k)),U=m(h*b),M=y+x,Z=m(m(M*M)-b-l),te=U+l,oe=te-v,ue=U-l,Le=m(Z*oe),de=m(te*ue),pe=m(Z*ue),Yt=m(oe*te);return new $(Le,de,Yt,pe)}add(h){R(h);let{a:y,d:x}=e,{ex:k,ey:b,ez:l,et:v}=this,{ex:U,ey:M,ez:Z,et:te}=h;if(y===BigInt(-1)){let Ue=m((b-k)*(M+U)),De=m((b+k)*(M-U)),qn=m(De-Ue);if(qn===lr)return this.double();let Me=m(l*Aa*te),je=m(v*Aa*Z),Oi=je+Me,Fe=De+Ue,Ze=je-Me,us=m(Oi*qn),Ge=m(Fe*Ze),Je=m(Oi*Ze),ls=m(qn*Fe);return new $(us,Ge,ls,Je)}let oe=m(k*U),ue=m(b*M),Le=m(v*x*te),de=m(l*Z),pe=m((k+b)*(U+M)-oe-ue),Yt=de-Le,Se=de+Le,Ne=m(ue-y*oe),as=m(pe*Yt),qe=m(Se*Ne),He=m(pe*Ne),cs=m(Yt*Se);return new $(as,qe,cs,He)}subtract(h){return this.add(h.negate())}wNAF(h){return J.wNAFCached(this,h,$.normalizeZ)}multiply(h){let y=h;Ht("scalar",y,Gt,i);let{p:x,f:k}=this.wNAF(y);return $.normalizeZ([x,k])[0]}multiplyUnsafe(h,y=$.ZERO){let x=h;return Ht("scalar",x,lr,i),x===lr?Q:this.is0()||x===Gt?this:J.wNAFCachedUnsafe(this,x,$.normalizeZ,y)}isSmallOrder(){return this.multiplyUnsafe(u).is0()}isTorsionFree(){return J.unsafeLadder(this,i).is0()}toAffine(h){return T(this,h)}clearCofactor(){let{h}=e;return h===Gt?this:this.multiplyUnsafe(h)}static fromHex(h,y=!1){let{d:x,a:k}=e,b=r.BYTES;h=We("pointHex",h,b),ur("zip215",y);let l=h.slice(),v=h[b-1];l[b-1]=v&-129;let U=en(l),M=y?p:r.ORDER;Ht("pointHex.y",U,lr,M);let Z=m(U*U),te=m(Z-Gt),oe=m(x*Z-k),{isValid:ue,value:Le}=w(te,oe);if(!ue)throw new Error("Point.fromHex: invalid y coordinate");let de=(Le&Gt)===Gt,pe=(v&128)!==0;if(!y&&Le===lr&&pe)throw new Error("Point.fromHex: x=0 and x_0=1");return pe!==de&&(Le=m(-Le)),$.fromAffine({x:Le,y:U})}static fromPrivateKey(h){return ee(h).point}toRawBytes(){let{x:h,y}=this.toAffine(),x=Nn(y,r.BYTES);return x[x.length-1]|=h&Gt?128:0,x}toHex(){return Lr(this.toRawBytes())}}$.BASE=new $(e.Gx,e.Gy,Gt,m(e.Gx*e.Gy)),$.ZERO=new $(lr,Gt,Gt,lr);let{BASE:C,ZERO:Q}=$,J=Ra($,c*8);function Y(d){return ke(d,i)}function X(d){return Y(en(d))}function ee(d){let h=r.BYTES;d=We("private key",d,h);let y=We("hashed private key",o(d),2*h),x=g(y.slice(0,h)),k=y.slice(h,2*h),b=X(x),l=C.multiply(b),v=l.toRawBytes();return{head:x,prefix:k,scalar:b,point:l,pointBytes:v}}function Re(d){return ee(d).pointBytes}function ne(d=new Uint8Array,...h){let y=Br(...h);return X(o(A(y,We("context",d),!!n)))}function fe(d,h,y={}){d=We("message",d),n&&(d=n(d));let{prefix:x,scalar:k,pointBytes:b}=ee(h),l=ne(y.context,x,d),v=C.multiply(l).toRawBytes(),U=ne(y.context,v,b,d),M=Y(l+U*k);Ht("signature.s",M,lr,i);let Z=Br(v,Nn(M,r.BYTES));return We("result",Z,r.BYTES*2)}let S=rE;function a(d,h,y,x=S){let{context:k,zip215:b}=x,l=r.BYTES;d=We("signature",d,2*l),h=We("message",h),y=We("publicKey",y,l),b!==void 0&&ur("zip215",b),n&&(h=n(h));let v=en(d.slice(l,2*l)),U,M,Z;try{U=$.fromHex(y,b),M=$.fromHex(d.slice(0,l),b),Z=C.multiplyUnsafe(v)}catch{return!1}if(!b&&U.isSmallOrder())return!1;let te=ne(k,M.toRawBytes(),U.toRawBytes(),h);return M.add(U.multiplyUnsafe(te)).subtract(Z).clearCofactor().equals($.ZERO)}return C._setWindowSize(8),{CURVE:e,getPublicKey:Re,sign:fe,verify:a,ExtendedPoint:$,utils:{getExtendedPublicKey:ee,randomPrivateKey:()=>s(r.BYTES),precompute(d=8,h=$.BASE){return h._setWindowSize(d),h.multiply(BigInt(3)),h}}}}var Ch=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),Uy=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),IL=BigInt(0),iE=BigInt(1),Dy=BigInt(2),RL=BigInt(3),oE=BigInt(5),sE=BigInt(8);function aE(t){let e=BigInt(10),r=BigInt(20),i=BigInt(40),n=BigInt(80),o=Ch,c=t*t%o*t%o,u=ze(c,Dy,o)*c%o,p=ze(u,iE,o)*t%o,m=ze(p,oE,o)*p%o,_=ze(m,e,o)*m%o,w=ze(_,r,o)*_%o,g=ze(w,i,o)*w%o,A=ze(g,n,o)*g%o,I=ze(A,n,o)*g%o,R=ze(I,e,o)*m%o;return{pow_p_5_8:ze(R,Dy,o)*t%o,b2:c}}function cE(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function uE(t,e){let r=Ch,i=ke(e*e*e,r),n=ke(i*i*e,r),o=aE(t*n).pow_p_5_8,s=ke(t*i*o,r),c=ke(e*s*s,r),u=s,p=ke(s*Uy,r),m=c===t,_=c===ke(-t,r),w=c===ke(-t*Uy,r);return m&&(s=u),(_||w)&&(s=p),Ty(s,r)&&(s=ke(-s,r)),{isValid:m||_,value:s}}var lE=rn(Ch,void 0,!0),fE={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:lE,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:sE,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:Ry,randomBytes:ba,adjustScalarBytes:cE,uvRatio:uE},Ln=Cy(fE);var Tp=Sr(Dh()),Rt=Sr(jh());var mE=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]),nn=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),on=new Uint32Array(64),Fh=class extends di{constructor(){super(64,32,8,!1),this.A=nn[0]|0,this.B=nn[1]|0,this.C=nn[2]|0,this.D=nn[3]|0,this.E=nn[4]|0,this.F=nn[5]|0,this.G=nn[6]|0,this.H=nn[7]|0}get(){let{A:e,B:r,C:i,D:n,E:o,F:s,G:c,H:u}=this;return[e,r,i,n,o,s,c,u]}set(e,r,i,n,o,s,c,u){this.A=e|0,this.B=r|0,this.C=i|0,this.D=n|0,this.E=o|0,this.F=s|0,this.G=c|0,this.H=u|0}process(e,r){for(let _=0;_<16;_++,r+=4)on[_]=e.getUint32(r,!1);for(let _=16;_<64;_++){let w=on[_-15],g=on[_-2],A=cr(w,7)^cr(w,18)^w>>>3,I=cr(g,17)^cr(g,19)^g>>>10;on[_]=I+on[_-7]+A+on[_-16]|0}let{A:i,B:n,C:o,D:s,E:c,F:u,G:p,H:m}=this;for(let _=0;_<64;_++){let w=cr(c,6)^cr(c,11)^cr(c,25),g=m+w+Sy(c,u,p)+mE[_]+on[_]|0,I=(cr(i,2)^cr(i,13)^cr(i,22))+Ey(i,n,o)|0;m=p,p=u,u=c,c=s+g|0,s=o,o=n,n=i,i=g+I|0}i=i+this.A|0,n=n+this.B|0,o=o+this.C|0,s=s+this.D|0,c=c+this.E|0,u=u+this.F|0,p=p+this.G|0,m=m+this.H|0,this.set(i,n,o,s,c,u,p,m)}roundClean(){on.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var So=fi(()=>new Fh);var Si=Sr(Qy()),E=Sr(Yh()),Ib=Sr(Yh());var $E=1,LE=2,PE=3,BE=4,zE=5,CE=6,UE=7,DE=8,ME=9,jE=10,FE=-32700,ZE=-32603,VE=-32602,WE=-32601,KE=-32600,qE=-32016,HE=-32015,GE=-32014,JE=-32013,YE=-32012,XE=-32011,QE=-32010,eI=-32009,tI=-32008,rI=-32007,nI=-32006,iI=-32005,oI=-32004,sI=-32003,aI=-32002,cI=-32001,uI=28e5,lI=2800001,fI=2800002,dI=2800003,hI=2800004,pI=2800005,mI=2800006,gI=2800007,yI=2800008,_I=2800009,bI=2800010,vI=323e4,wI=32300001,xI=3230002,SI=3230003,EI=3230004,II=361e4,RI=3610001,kI=3610002,AI=3610003,OI=3610004,NI=3610005,TI=3610006,$I=3610007,LI=3611e3,PI=3704e3,BI=3704001,zI=3704002,CI=3704003,UI=3704004,DI=4128e3,MI=4128001,jI=4128002,FI=4615e3,ZI=4615001,VI=4615002,WI=4615003,KI=4615004,qI=4615005,HI=4615006,GI=4615007,JI=4615008,YI=4615009,XI=4615010,QI=4615011,eR=4615012,tR=4615013,rR=4615014,nR=4615015,iR=4615016,oR=4615017,sR=4615018,aR=4615019,cR=4615020,uR=4615021,lR=4615022,fR=4615023,dR=4615024,hR=4615025,pR=4615026,mR=4615027,gR=4615028,yR=4615029,_R=4615030,bR=4615031,vR=4615032,wR=4615033,xR=4615034,SR=4615035,ER=4615036,IR=4615037,RR=4615038,kR=4615039,AR=4615040,OR=4615041,NR=4615042,TR=4615043,$R=4615044,LR=4615045,PR=4615046,BR=4615047,zR=4615048,CR=4615049,UR=4615050,DR=4615051,MR=4615052,jR=4615053,FR=4615054,ZR=5508e3,VR=5508001,WR=5508002,KR=5508003,qR=5508004,HR=5508005,GR=5508006,JR=5508007,YR=5508008,XR=5508009,QR=5508010,ek=5508011,tk=5663e3,rk=5663001,nk=5663002,ik=5663003,ok=5663004,sk=5663005,ak=5663006,ck=5663007,uk=5663008,lk=5663009,fk=5663010,dk=5663011,hk=5663012,pk=5663013,mk=5663014,gk=5663015,yk=5663016,_k=5663017,bk=5663018,vk=5663019,wk=705e4,xk=7050001,Sk=7050002,Ek=7050003,Ik=7050004,Rk=7050005,kk=7050006,Ak=7050007,Ok=7050008,Nk=7050009,Tk=7050010,$k=7050011,Lk=7050012,Pk=7050013,Bk=7050014,zk=7050015,Ck=7050016,Uk=7050017,Dk=7050018,Mk=7050019,jk=7050020,Fk=7050021,Zk=7050022,Vk=7050023,Wk=7050024,Kk=7050025,qk=7050026,Hk=7050027,Gk=7050028,Jk=7050029,Yk=7050030,Xk=7050031,Qk=7050032,eA=7050033,tA=7050034,rA=7050035,nA=7050036,Xh=8078e3,Qh=8078001,e_=8078002,t_=8078003,ep=8078004,tp=8078005,rp=8078006,iA=8078007,oA=8078008,sA=8078009,aA=8078010,np=8078011,cA=8078012,r_=8078013,n_=8078014,uA=8078015,lA=8078016,fA=8078017,dA=8078018,hA=8078019,i_=8078020,o_=8078021,pA=8078022,mA=81e5,gA=8100001,yA=8100002,_A=8100003,bA=819e4,vA=8190001,wA=8190002,xA=8190003,SA=8190004,EA=99e5,IA=9900001,RA=9900002,kA=9900003,AA=9900004;function s_(t){return Array.isArray(t)?"%5B"+t.map(s_).join("%2C%20")+"%5D":typeof t=="bigint"?`${t}n`:encodeURIComponent(String(t!=null&&Object.getPrototypeOf(t)===null?{...t}:t))}function OA([t,e]){return`${t}=${s_(e)}`}function NA(t){let e=Object.entries(t).map(OA).join("&");return btoa(e)}var UL={[vI]:"Account not found at address: $address",[EI]:"Not all accounts were decoded. Encoded accounts found at addresses: $addresses.",[SI]:"Expected decoded account at address: $address",[xI]:"Failed to decode account data at address: $address",[wI]:"Accounts not found at addresses: $addresses",[_I]:"Unable to find a viable program address bump seed.",[fI]:"$putativeAddress is not a base58-encoded address.",[uI]:"Expected base58 encoded address to decode to a byte array of length 32. Actual length: $actualLength.",[dI]:"The `CryptoKey` must be an `Ed25519` public key.",[yI]:"Invalid seeds; point must fall off the Ed25519 curve.",[hI]:"Expected given program derived address to have the following format: [Address, ProgramDerivedAddressBump].",[mI]:"A maximum of $maxSeeds seeds, including the bump seed, may be supplied when creating an address. Received: $actual.",[gI]:"The seed at index $index with length $actual exceeds the maximum length of $maxSeedLength bytes.",[pI]:"Expected program derived address bump to be in the range [0, 255], got: $bump.",[bI]:"Program address cannot end with PDA marker.",[lI]:"Expected base58-encoded address string of length in the range [32, 44]. Actual length: $actualLength.",[BE]:"Expected base58-encoded blockash string of length in the range [32, 44]. Actual length: $actualLength.",[$E]:"The network has progressed past the last block for which this transaction could have been committed.",[Xh]:"Codec [$codecDescription] cannot decode empty byte arrays.",[pA]:"Enum codec cannot use lexical values [$stringValues] as discriminators. Either remove all lexical values or set `useValuesAsDiscriminators` to `false`.",[i_]:"Sentinel [$hexSentinel] must not be present in encoded bytes [$hexEncodedBytes].",[tp]:"Encoder and decoder must have the same fixed size, got [$encoderFixedSize] and [$decoderFixedSize].",[rp]:"Encoder and decoder must have the same max size, got [$encoderMaxSize] and [$decoderMaxSize].",[ep]:"Encoder and decoder must either both be fixed-size or variable-size.",[oA]:"Enum discriminator out of range. Expected a number in [$formattedValidDiscriminators], got $discriminator.",[e_]:"Expected a fixed-size codec, got a variable-size one.",[r_]:"Codec [$codecDescription] expected a positive byte length, got $bytesLength.",[t_]:"Expected a variable-size codec, got a fixed-size one.",[hA]:"Codec [$codecDescription] expected zero-value [$hexZeroValue] to have the same size as the provided fixed-size item [$expectedSize bytes].",[Qh]:"Codec [$codecDescription] expected $expected bytes, got $bytesLength.",[dA]:"Expected byte array constant [$hexConstant] to be present in data [$hexData] at offset [$offset].",[sA]:"Invalid discriminated union variant. Expected one of [$variants], got $value.",[aA]:"Invalid enum variant. Expected one of [$stringValues] or a number in [$formattedNumericalValues], got $variant.",[uA]:"Invalid literal union variant. Expected one of [$variants], got $value.",[iA]:"Expected [$codecDescription] to have $expected items, got $actual.",[cA]:"Invalid value $value for base $base with alphabet $alphabet.",[lA]:"Literal union discriminator out of range. Expected a number between $minRange and $maxRange, got $discriminator.",[np]:"Codec [$codecDescription] expected number to be in the range [$min, $max], got $value.",[n_]:"Codec [$codecDescription] expected offset to be in the range [0, $bytesLength], got $offset.",[o_]:"Expected sentinel [$hexSentinel] to be present in decoded bytes [$hexDecodedBytes].",[fA]:"Union variant out of range. Expected an index between $minRange and $maxRange, got $variant.",[LI]:"No random values implementation could be found.",[YI]:"instruction requires an uninitialized account",[fR]:"instruction tries to borrow reference for an account which is already borrowed",[dR]:"instruction left account with an outstanding borrowed reference",[uR]:"program other than the account's owner changed the size of the account data",[qI]:"account data too small for instruction",[lR]:"instruction expected an executable account",[PR]:"An account does not have enough lamports to be rent-exempt",[zR]:"Program arithmetic overflowed",[LR]:"Failed to serialize or deserialize account data: $encodedData",[FR]:"Builtin programs must consume compute units",[vR]:"Cross-program invocation call depth too deep",[RR]:"Computational budget exceeded",[pR]:"custom program error: #$code",[oR]:"instruction contains duplicate accounts",[hR]:"instruction modifications of multiply-passed account differ",[_R]:"executable accounts must be rent exempt",[gR]:"instruction changed executable accounts data",[yR]:"instruction changed the balance of an executable account",[sR]:"instruction changed executable bit of an account",[rR]:"instruction modified data of an account it does not own",[tR]:"instruction spent from the balance of an account it does not own",[ZI]:"generic instruction error",[UR]:"Provided owner is not allowed",[TR]:"Account is immutable",[$R]:"Incorrect authority provided",[GI]:"incorrect program id for instruction",[HI]:"insufficient funds for instruction",[KI]:"invalid account data for instruction",[BR]:"Invalid account owner",[VI]:"invalid program argument",[mR]:"program returned invalid error code",[WI]:"invalid instruction data",[IR]:"Failed to reallocate account data",[ER]:"Provided seeds do not result in a valid address",[DR]:"Accounts data allocations exceeded the maximum allowed per transaction",[MR]:"Max accounts exceeded",[jR]:"Max instruction trace length exceeded",[SR]:"Length of the seed is too long for address generation",[wR]:"An account required by the instruction is missing",[JI]:"missing required signature for instruction",[eR]:"instruction illegally modified the program id of an account",[cR]:"insufficient account keys for instruction",[kR]:"Cross-program invocation with unauthorized signer or writable account",[AR]:"Failed to create program execution environment",[NR]:"Program failed to compile",[OR]:"Program failed to complete",[iR]:"instruction modified data of a read-only account",[nR]:"instruction changed the balance of a read-only account",[xR]:"Cross-program invocation reentrancy not allowed for this instruction",[aR]:"instruction modified rent epoch of an account",[QI]:"sum of account balances before and after instruction do not match",[XI]:"instruction requires an initialized account",[FI]:"",[bR]:"Unsupported program id",[CR]:"Unsupported sysvar",[DI]:"The instruction does not have any accounts.",[MI]:"The instruction does not have any data.",[jI]:"Expected instruction to have progress address $expectedProgramAddress, got $actualProgramAddress.",[zE]:"Expected base58 encoded blockhash to decode to a byte array of length 32. Actual length: $actualLength.",[LE]:"The nonce `$expectedNonceValue` is no longer valid. It has advanced to `$actualNonceValue`",[RA]:"Invariant violation: Found no abortable iterable cache entry for key `$cacheKey`. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant",[AA]:"Invariant violation: This data publisher does not publish to the channel named `$channelName`. Supported channels include $supportedChannelNames.",[IA]:"Invariant violation: WebSocket message iterator state is corrupt; iterated without first resolving existing message promise. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant",[EA]:"Invariant violation: WebSocket message iterator is missing state storage. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant",[kA]:"Invariant violation: Switch statement non-exhaustive. Received unexpected value `$unexpectedValue`. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant",[ZE]:"JSON-RPC error: Internal JSON-RPC error ($__serverMessage)",[VE]:"JSON-RPC error: Invalid method parameter(s) ($__serverMessage)",[KE]:"JSON-RPC error: The JSON sent is not a valid `Request` object ($__serverMessage)",[WE]:"JSON-RPC error: The method does not exist / is not available ($__serverMessage)",[FE]:"JSON-RPC error: An error occurred on the server while parsing the JSON text ($__serverMessage)",[YE]:"$__serverMessage",[cI]:"$__serverMessage",[oI]:"$__serverMessage",[GE]:"$__serverMessage",[QE]:"$__serverMessage",[eI]:"$__serverMessage",[qE]:"Minimum context slot has not been reached",[iI]:"Node is unhealthy; behind by $numSlotsBehind slots",[tI]:"No snapshot",[aI]:"Transaction simulation failed",[rI]:"$__serverMessage",[XE]:"Transaction history is not available from this node",[nI]:"$__serverMessage",[JE]:"Transaction signature length mismatch",[sI]:"Transaction signature verification failure",[HE]:"$__serverMessage",[PI]:"Key pair bytes must be of length 64, got $byteLength.",[BI]:"Expected private key bytes with length 32. Actual length: $actualLength.",[zI]:"Expected base58-encoded signature to decode to a byte array of length 64. Actual length: $actualLength.",[UI]:"The provided private key does not match the provided public key.",[CI]:"Expected base58-encoded signature string of length in the range [64, 88]. Actual length: $actualLength.",[CE]:"Lamports value must be in the range [0, 2e64-1]",[UE]:"`$value` cannot be parsed as a `BigInt`",[jE]:"$message",[DE]:"`$value` cannot be parsed as a `Number`",[PE]:"No nonce account could be found at address `$nonceAccountAddress`",[bA]:"The notification name must end in 'Notifications' and the API must supply a subscription plan creator function for the notification '$notificationName'.",[wA]:"WebSocket was closed before payload could be added to the send buffer",[xA]:"WebSocket connection closed",[SA]:"WebSocket failed to connect",[vA]:"Failed to obtain a subscription id from the server",[_A]:"Could not find an API plan for RPC method: `$method`",[mA]:"The $argumentLabel argument to the `$methodName` RPC method$optionalPathLabel was `$value`. This number is unsafe for use with the Solana JSON-RPC because it exceeds `Number.MAX_SAFE_INTEGER`.",[yA]:"HTTP error ($statusCode): $message",[gA]:"HTTP header(s) forbidden: $headers. Learn more at https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_header_name.",[ZR]:"Multiple distinct signers were identified for address `$address`. Please ensure that you are using the same signer instance for each address.",[VR]:"The provided value does not implement the `KeyPairSigner` interface",[KR]:"The provided value does not implement the `MessageModifyingSigner` interface",[qR]:"The provided value does not implement the `MessagePartialSigner` interface",[WR]:"The provided value does not implement any of the `MessageSigner` interfaces",[GR]:"The provided value does not implement the `TransactionModifyingSigner` interface",[JR]:"The provided value does not implement the `TransactionPartialSigner` interface",[YR]:"The provided value does not implement the `TransactionSendingSigner` interface",[HR]:"The provided value does not implement any of the `TransactionSigner` interfaces",[XR]:"More than one `TransactionSendingSigner` was identified.",[QR]:"No `TransactionSendingSigner` was identified. Please provide a valid `ITransactionWithSingleSendingSigner` transaction.",[ek]:"Wallet account signers do not support signing multiple messages/transactions in a single operation",[$I]:"Cannot export a non-extractable key.",[RI]:"No digest implementation could be found.",[II]:"Cryptographic operations are only allowed in secure browser contexts. Read more here: https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts.",[kI]:`This runtime does not support the generation of Ed25519 key pairs.
30
+
31
+ Install @solana/webcrypto-ed25519-polyfill and call its \`install\` function before generating keys in environments that do not support Ed25519.
32
+
33
+ For a list of runtimes that currently support Ed25519 operations, visit https://github.com/WICG/webcrypto-secure-curves/issues/20.`,[AI]:"No signature verification implementation could be found.",[OI]:"No key generation implementation could be found.",[NI]:"No signing implementation could be found.",[TI]:"No key export implementation could be found.",[ME]:"Timestamp value must be in the range [-(2n ** 63n), (2n ** 63n) - 1]. `$value` given",[Ck]:"Transaction processing left an account with an outstanding borrowed reference",[xk]:"Account in use",[Sk]:"Account loaded twice",[Ek]:"Attempt to debit an account but found no record of a prior credit.",[Vk]:"Transaction loads an address table account that doesn't exist",[Ak]:"This transaction has already been processed",[Ok]:"Blockhash not found",[Nk]:"Loader call chain is too deep",[zk]:"Transactions are currently disabled due to cluster maintenance",[Yk]:"Transaction contains a duplicate instruction ($index) that is not allowed",[Rk]:"Insufficient funds for fee",[Xk]:"Transaction results in an account ($accountIndex) with insufficient funds for rent",[kk]:"This account may not be used to pay transaction fees",[$k]:"Transaction contains an invalid account reference",[Kk]:"Transaction loads an address table account with invalid data",[qk]:"Transaction address table lookup uses an invalid index",[Wk]:"Transaction loads an address table account with an invalid owner",[eA]:"LoadedAccountsDataSizeLimit set for transaction must be greater than 0.",[Pk]:"This program may not be used for executing instructions",[Hk]:"Transaction leaves an account with a lower balance than rent-exempt minimum",[Mk]:"Transaction loads a writable account that cannot be written",[Qk]:"Transaction exceeded max loaded accounts data size cap",[Tk]:"Transaction requires a fee but has no signature present",[Ik]:"Attempt to load a program that does not exist",[rA]:"Execution of the program referenced by account at index $accountIndex is temporarily restricted.",[tA]:"ResanitizationNeeded",[Bk]:"Transaction failed to sanitize accounts offsets correctly",[Lk]:"Transaction did not pass signature verification",[Zk]:"Transaction locked too many accounts",[nA]:"Sum of account balances before and after transaction do not match",[wk]:"The transaction failed with the error `$errorName`",[Dk]:"Transaction version is unsupported",[Fk]:"Transaction would exceed account data limit within the block",[Jk]:"Transaction would exceed total account data limit",[jk]:"Transaction would exceed max account limit within the block",[Uk]:"Transaction would exceed max Block Cost Limit",[Gk]:"Transaction would exceed max Vote Cost Limit",[gk]:"Attempted to sign a transaction with an address that is not a signer for it",[fk]:"Transaction is missing an address at index: $index.",[yk]:"Transaction has no expected signers therefore it cannot be encoded",[nk]:"Transaction does not have a blockhash lifetime",[ik]:"Transaction is not a durable nonce transaction",[sk]:"Contents of these address lookup tables unknown: $lookupTableAddresses",[ak]:"Lookup of address at index $highestRequestedIndex failed for lookup table `$lookupTableAddress`. Highest known index is $highestKnownIndex. The lookup table may have been extended since its contents were retrieved",[uk]:"No fee payer set in CompiledTransaction",[ck]:"Could not find program address at index $index",[bk]:"Failed to estimate the compute unit consumption for this transaction message. This is likely because simulating the transaction failed. Inspect the `cause` property of this error to learn more",[vk]:"Transaction failed when it was simulated in order to estimate the compute unit consumption. The compute unit estimate provided is for a transaction that failed when simulated and may not be representative of the compute units this transaction would consume if successful. Inspect the `cause` property of this error to learn more",[dk]:"Transaction is missing a fee payer.",[hk]:"Could not determine this transaction's signature. Make sure that the transaction has been signed by its fee payer.",[mk]:"Transaction first instruction is not advance nonce account instruction.",[pk]:"Transaction with no instructions cannot be durable nonce transaction.",[tk]:"This transaction includes an address (`$programAddress`) which is both invoked and set as the fee payer. Program addresses may not pay fees",[rk]:"This transaction includes an address (`$programAddress`) which is both invoked and marked writable. Program addresses may not be writable",[_k]:"The transaction message expected the transaction to have $signerAddressesLength signatures, got $signaturesLength.",[lk]:"Transaction is missing signatures for addresses: $addresses.",[ok]:"Transaction version must be in the range [0, 127]. `$actualVersion` given"};function TA(t,e={}){{let r=`Solana error #${t}; Decode this error by running \`npx @solana/errors decode -- ${t}`;return Object.keys(e).length&&(r+=` '${NA(e)}'`),`${r}\``}}var cn=class extends Error{cause=this.cause;context;constructor(...[t,e]){let r,i;if(e){let{cause:o,...s}=e;o&&(i={cause:o}),Object.keys(s).length>0&&(r=s)}let n=TA(t,r);super(n,i),this.context={__code:t,...r},this.name="SolanaError"}};function $A(t,e){return"fixedSize"in e?e.fixedSize:e.getSizeFromValue(t)}function a_(t){return Object.freeze({...t,encode:e=>{let r=new Uint8Array($A(e,t));return t.write(e,r,0),r}})}function c_(t){return Object.freeze({...t,decode:(e,r=0)=>t.read(e,r)[0]})}function _i(t){return"fixedSize"in t&&typeof t.fixedSize=="number"}function u_(t,e){if(_i(t)!==_i(e))throw new cn(ep);if(_i(t)&&_i(e)&&t.fixedSize!==e.fixedSize)throw new cn(tp,{decoderFixedSize:e.fixedSize,encoderFixedSize:t.fixedSize});if(!_i(t)&&!_i(e)&&t.maxSize!==e.maxSize)throw new cn(rp,{decoderMaxSize:e.maxSize,encoderMaxSize:t.maxSize});return{...e,...t,decode:e.decode,encode:t.encode,read:e.read,write:t.write}}function l_(t,e,r=0){if(e.length-r<=0)throw new cn(Xh,{codecDescription:t})}function f_(t,e,r,i=0){let n=r.length-i;if(n<e)throw new cn(Qh,{bytesLength:n,codecDescription:t,expected:e})}function LA(t,e,r,i){if(i<e||i>r)throw new cn(np,{codecDescription:t,max:r,min:e,value:i})}function d_(t){return t?.endian!==1}function PA(t){return a_({fixedSize:t.size,write(e,r,i){t.range&&LA(t.name,t.range[0],t.range[1],e);let n=new ArrayBuffer(t.size);return t.set(new DataView(n),e,d_(t.config)),r.set(new Uint8Array(n),i),i+t.size}})}function BA(t){return c_({fixedSize:t.size,read(e,r=0){l_(t.name,e,r),f_(t.name,t.size,e,r);let i=new DataView(zA(e,r,t.size));return[t.get(i,d_(t.config)),r+t.size]}})}function zA(t,e,r){let i=t.byteOffset+(e??0),n=r??t.byteLength;return t.buffer.slice(i,i+n)}var ip=(t={})=>PA({config:t,name:"u64",range:[0n,BigInt("0xffffffffffffffff")],set:(e,r,i)=>e.setBigUint64(0,BigInt(r),i),size:8}),CA=(t={})=>BA({config:t,get:(e,r)=>e.getBigUint64(0,r),name:"u64",size:8}),h_=(t={})=>u_(ip(t),CA(t));var op=class extends TypeError{constructor(e,r){let i,{message:n,explanation:o,...s}=e,{path:c}=e,u=c.length===0?n:`At path: ${c.join(".")} -- ${n}`;super(o??u),o!=null&&(this.cause=u),Object.assign(this,s),this.name=this.constructor.name,this.failures=()=>i??(i=[e,...r()])}};function UA(t){return Oo(t)&&typeof t[Symbol.iterator]=="function"}function Oo(t){return typeof t=="object"&&t!=null}function rc(t){return Oo(t)&&!Array.isArray(t)}function fr(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function DA(t){let{done:e,value:r}=t.next();return e?void 0:r}function MA(t,e,r,i){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});let{path:n,branch:o}=e,{type:s}=r,{refinement:c,message:u=`Expected a value of type \`${s}\`${c?` with refinement \`${c}\``:""}, but received: \`${fr(i)}\``}=t;return{value:i,type:s,refinement:c,key:n[n.length-1],path:n,branch:o,...t,message:u}}function*p_(t,e,r,i){UA(t)||(t=[t]);for(let n of t){let o=MA(n,e,r,i);o&&(yield o)}}function*sp(t,e,r={}){let{path:i=[],branch:n=[t],coerce:o=!1,mask:s=!1}=r,c={path:i,branch:n,mask:s};o&&(t=e.coercer(t,c));let u="valid";for(let p of e.validator(t,c))p.explanation=r.message,u="not_valid",yield[p,void 0];for(let[p,m,_]of e.entries(t,c)){let w=sp(m,_,{path:p===void 0?i:[...i,p],branch:p===void 0?n:[...n,m],coerce:o,mask:s,message:r.message});for(let g of w)g[0]?(u=g[0].refinement!=null?"not_refined":"not_valid",yield[g[0],void 0]):o&&(m=g[1],p===void 0?t=m:t instanceof Map?t.set(p,m):t instanceof Set?t.add(m):Oo(t)&&(m!==void 0||p in t)&&(t[p]=m))}if(u!=="not_valid")for(let p of e.refiner(t,c))p.explanation=r.message,u="not_refined",yield[p,void 0];u==="valid"&&(yield[void 0,t])}var sr=class{constructor(e){let{type:r,schema:i,validator:n,refiner:o,coercer:s=u=>u,entries:c=function*(){}}=e;this.type=r,this.schema=i,this.entries=c,this.coercer=s,n?this.validator=(u,p)=>{let m=n(u,p);return p_(m,p,this,u)}:this.validator=()=>[],o?this.refiner=(u,p)=>{let m=o(u,p);return p_(m,p,this,u)}:this.refiner=()=>[]}assert(e,r){return m_(e,this,r)}create(e,r){return W(e,this,r)}is(e){return g_(e,this)}mask(e,r){return jA(e,this,r)}validate(e,r={}){return No(e,this,r)}};function m_(t,e,r){let i=No(t,e,{message:r});if(i[0])throw i[0]}function W(t,e,r){let i=No(t,e,{coerce:!0,message:r});if(i[0])throw i[0];return i[1]}function jA(t,e,r){let i=No(t,e,{coerce:!0,mask:!0,message:r});if(i[0])throw i[0];return i[1]}function g_(t,e){return!No(t,e)[0]}function No(t,e,r={}){let i=sp(t,e,r),n=DA(i);return n[0]?[new op(n[0],function*(){for(let s of i)s[0]&&(yield s[0])}),void 0]:[void 0,n[1]]}function Cn(t,e){return new sr({type:t,schema:null,validator:e})}function y_(){return Cn("any",()=>!0)}function H(t){return new sr({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(let[r,i]of e.entries())yield[r,i,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${fr(e)}`}})}function dr(){return Cn("boolean",t=>typeof t=="boolean")}function nc(t){return Cn("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${fr(e)}`)}function Ce(t){let e=fr(t),r=typeof t;return new sr({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(i){return i===t||`Expected the literal \`${e}\`, but received: ${fr(i)}`}})}function FA(){return Cn("never",()=>!1)}function G(t){return new sr({...t,validator:(e,r)=>e===null||t.validator(e,r),refiner:(e,r)=>e===null||t.refiner(e,r)})}function N(){return Cn("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${fr(t)}`)}function ie(t){return new sr({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function ap(t,e){return new sr({type:"record",schema:null,*entries(r){if(Oo(r))for(let i in r){let n=r[i];yield[i,i,t],yield[i,n,e]}},validator(r){return rc(r)||`Expected an object, but received: ${fr(r)}`},coercer(r){return rc(r)?{...r}:r}})}function F(){return Cn("string",t=>typeof t=="string"||`Expected a string, but received: ${fr(t)}`)}function ic(t){let e=FA();return new sr({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){let i=Math.max(t.length,r.length);for(let n=0;n<i;n++)yield[n,r[n],t[n]||e]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${fr(r)}`},coercer(r){return Array.isArray(r)?r.slice():r}})}function D(t){let e=Object.keys(t);return new sr({type:"type",schema:t,*entries(r){if(Oo(r))for(let i of e)yield[i,r[i],t[i]]},validator(r){return rc(r)||`Expected an object, but received: ${fr(r)}`},coercer(r){return rc(r)?{...r}:r}})}function Pt(t){let e=t.map(r=>r.type).join(" | ");return new sr({type:"union",schema:null,coercer(r,i){for(let n of t){let[o,s]=n.validate(r,{coerce:!0,mask:i.mask});if(!o)return s}return r},validator(r,i){let n=[];for(let o of t){let[...s]=sp(r,o,i),[c]=s;if(c[0])for(let[u]of s)u&&n.push(u);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${fr(r)}`,...n]}})}function Un(){return Cn("unknown",()=>!0)}function bi(t,e,r){return new sr({...t,coercer:(i,n)=>g_(i,e)?t.coercer(r(i,n),n):t.coercer(i,n)})}var Rb=Sr(j_());var W_=Sr(_o(),1);var Dn=Sr(Z_(),1);var V_=Dn.default;var pO=class extends Dn.default{socket;constructor(t,e,r){super(),this.socket=new window.WebSocket(t,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(t,e,r){let i=r||e;try{this.socket.send(t),i()}catch(n){i(n)}}close(t,e){this.socket.close(t,e)}addEventListener(t,e,r){this.socket.addEventListener(t,e,r)}};function K_(t,e){return new pO(t,e)}var mO=class{encode(t){return JSON.stringify(t)}decode(t){return JSON.parse(t)}},q_=class extends Dn.default{address;rpc_id;queue;options;autoconnect;ready;reconnect;reconnect_timer_id;reconnect_interval;max_reconnects;rest_options;current_reconnects;generate_request_id;socket;webSocketFactory;dataPack;constructor(t,e="ws://localhost:8080",{autoconnect:r=!0,reconnect:i=!0,reconnect_interval:n=1e3,max_reconnects:o=5,...s}={},c,u){super(),this.webSocketFactory=t,this.queue={},this.rpc_id=0,this.address=e,this.autoconnect=r,this.ready=!1,this.reconnect=i,this.reconnect_timer_id=void 0,this.reconnect_interval=n,this.max_reconnects=o,this.rest_options=s,this.current_reconnects=0,this.generate_request_id=c||(()=>typeof this.rpc_id=="number"?++this.rpc_id:Number(this.rpc_id)+1),u?this.dataPack=u:this.dataPack=new mO,this.autoconnect&&this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}connect(){this.socket||this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}call(t,e,r,i){return!i&&typeof r=="object"&&(i=r,r=null),new Promise((n,o)=>{if(!this.ready)return o(new Error("socket not ready"));let s=this.generate_request_id(t,e),c={jsonrpc:"2.0",method:t,params:e||void 0,id:s};this.socket.send(this.dataPack.encode(c),i,u=>{if(u)return o(u);this.queue[s]={promise:[n,o]},r&&(this.queue[s].timeout=setTimeout(()=>{delete this.queue[s],o(new Error("reply timeout"))},r))})})}async login(t){let e=await this.call("rpc.login",t);if(!e)throw new Error("authentication failed");return e}async listMethods(){return await this.call("__listMethods")}notify(t,e){return new Promise((r,i)=>{if(!this.ready)return i(new Error("socket not ready"));let n={jsonrpc:"2.0",method:t,params:e};this.socket.send(this.dataPack.encode(n),o=>{if(o)return i(o);r()})})}async subscribe(t){typeof t=="string"&&(t=[t]);let e=await this.call("rpc.on",t);if(typeof t=="string"&&e[t]!=="ok")throw new Error("Failed subscribing to an event '"+t+"' with: "+e[t]);return e}async unsubscribe(t){typeof t=="string"&&(t=[t]);let e=await this.call("rpc.off",t);if(typeof t=="string"&&e[t]!=="ok")throw new Error("Failed unsubscribing from an event with: "+e);return e}close(t,e){this.socket.close(t||1e3,e)}setAutoReconnect(t){this.reconnect=t}setReconnectInterval(t){this.reconnect_interval=t}setMaxReconnects(t){this.max_reconnects=t}_connect(t,e){clearTimeout(this.reconnect_timer_id),this.socket=this.webSocketFactory(t,e),this.socket.addEventListener("open",()=>{this.ready=!0,this.emit("open"),this.current_reconnects=0}),this.socket.addEventListener("message",({data:r})=>{r instanceof ArrayBuffer&&(r=W_.Buffer.from(r).toString());try{r=this.dataPack.decode(r)}catch{return}if(r.notification&&this.listeners(r.notification).length){if(!Object.keys(r.params).length)return this.emit(r.notification);let i=[r.notification];if(r.params.constructor===Object)i.push(r.params);else for(let n=0;n<r.params.length;n++)i.push(r.params[n]);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?.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(t,e),this.reconnect_interval)))})}};var J_=[],Y_=[],X_=[],gO=BigInt(0),zo=BigInt(1),yO=BigInt(2),_O=BigInt(7),bO=BigInt(256),vO=BigInt(113);for(let t=0,e=zo,r=1,i=0;t<24;t++){[r,i]=[i,(2*r+3*i)%5],J_.push(2*(5*i+r)),Y_.push((t+1)*(t+2)/2%64);let n=gO;for(let o=0;o<7;o++)e=(e<<zo^(e>>_O)*vO)%bO,e&yO&&(n^=zo<<(zo<<BigInt(o))-zo);X_.push(n)}var[wO,xO]=_h(X_,!0),H_=(t,e,r)=>r>32?wh(t,e,r):bh(t,e,r),G_=(t,e,r)=>r>32?xh(t,e,r):vh(t,e,r);function SO(t,e=24){let r=new Uint32Array(10);for(let i=24-e;i<24;i++){for(let s=0;s<10;s++)r[s]=t[s]^t[s+10]^t[s+20]^t[s+30]^t[s+40];for(let s=0;s<10;s+=2){let c=(s+8)%10,u=(s+2)%10,p=r[u],m=r[u+1],_=H_(p,m,1)^r[c],w=G_(p,m,1)^r[c+1];for(let g=0;g<50;g+=10)t[s+g]^=_,t[s+g+1]^=w}let n=t[2],o=t[3];for(let s=0;s<24;s++){let c=Y_[s],u=H_(n,o,c),p=G_(n,o,c),m=J_[s];n=t[m],o=t[m+1],t[m]=u,t[m+1]=p}for(let s=0;s<50;s+=10){for(let c=0;c<10;c++)r[c]=t[s+c];for(let c=0;c<10;c++)t[s+c]^=~r[(c+2)%10]&r[(c+4)%10]}t[0]^=wO[i],t[1]^=xO[i]}r.fill(0)}var fc=class t extends Gr{constructor(e,r,i,n=!1,o=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=i,this.enableXOF=n,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,bo(i),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=vy(this.state)}keccak(){ph||mh(this.state32),SO(this.state32,this.rounds),ph||mh(this.state32),this.posOut=0,this.pos=0}update(e){Tr(this);let{blockLen:r,state:i}=this;e=Jr(e);let n=e.length;for(let o=0;o<n;){let s=Math.min(r-this.pos,n-o);for(let c=0;c<s;c++)i[this.pos++]^=e[o++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:r,pos:i,blockLen:n}=this;e[i]^=r,(r&128)!==0&&i===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){Tr(this,!1),Hr(e),this.finish();let r=this.state,{blockLen:i}=this;for(let n=0,o=e.length;n<o;){this.posOut>=i&&this.keccak();let s=Math.min(i-this.posOut,o-n);e.set(r.subarray(this.posOut,this.posOut+s),n),this.posOut+=s,n+=s}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return bo(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(ya(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){let{blockLen:r,suffix:i,outputLen:n,rounds:o,enableXOF:s}=this;return e||(e=new t(r,i,n,s,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=i,e.outputLen=n,e.enableXOF=s,e.destroyed=this.destroyed,e}},dn=(t,e,r)=>fi(()=>new fc(e,t,r)),F4=dn(6,144,224/8),Z4=dn(6,136,256/8),V4=dn(6,104,384/8),W4=dn(6,72,512/8),K4=dn(1,144,224/8),_p=dn(1,136,256/8),q4=dn(1,104,384/8),H4=dn(1,72,512/8),Q_=(t,e,r)=>xy((i={})=>new fc(e,t,i.dkLen===void 0?r:i.dkLen,!0)),G4=Q_(31,168,128/8),J4=Q_(31,136,256/8);var dc=class extends Gr{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,by(e);let i=Jr(r);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;let n=this.blockLen,o=new Uint8Array(n);o.set(i.length>n?e.create().update(i).digest():i);for(let s=0;s<o.length;s++)o[s]^=54;this.iHash.update(o),this.oHash=e.create();for(let s=0;s<o.length;s++)o[s]^=106;this.oHash.update(o),o.fill(0)}update(e){return Tr(this),this.iHash.update(e),this}digestInto(e){Tr(this),Hr(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));let{oHash:r,iHash:i,finished:n,destroyed:o,blockLen:s,outputLen:c}=this;return e=e,e.finished=n,e.destroyed=o,e.blockLen=s,e.outputLen=c,e.oHash=r._cloneInto(e.oHash),e.iHash=i._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},bp=(t,e,r)=>new dc(t,e).update(r).digest();bp.create=(t,e)=>new dc(t,e);function eb(t){t.lowS!==void 0&&ur("lowS",t.lowS),t.prehash!==void 0&&ur("prehash",t.prehash)}function EO(t){let e=xo(t);_r(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:r,Fp:i,a:n}=e;if(r){if(!i.eql(n,i.ZERO))throw new Error("invalid endomorphism, can only be defined for Koblitz curves that have a=0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error("invalid endomorphism, expected beta: bigint and splitScalar: function")}return Object.freeze({...e})}var{bytesToNumberBE:IO,hexToBytes:RO}=Sa,vp=class extends Error{constructor(e=""){super(e)}},Ur={Err:vp,_tlv:{encode:(t,e)=>{let{Err:r}=Ur;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(e.length&1)throw new r("tlv.encode: unpadded data");let i=e.length/2,n=An(i);if(n.length/2&128)throw new r("tlv.encode: long form length too big");let o=i>127?An(n.length/2|128):"";return An(t)+o+n+e},decode(t,e){let{Err:r}=Ur,i=0;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(e.length<2||e[i++]!==t)throw new r("tlv.decode: wrong tlv");let n=e[i++],o=!!(n&128),s=0;if(!o)s=n;else{let u=n&127;if(!u)throw new r("tlv.decode(long): indefinite length not supported");if(u>4)throw new r("tlv.decode(long): byte length is too big");let p=e.subarray(i,i+u);if(p.length!==u)throw new r("tlv.decode: length bytes not complete");if(p[0]===0)throw new r("tlv.decode(long): zero leftmost byte");for(let m of p)s=s<<8|m;if(i+=u,s<128)throw new r("tlv.decode(long): not minimal encoding")}let c=e.subarray(i,i+s);if(c.length!==s)throw new r("tlv.decode: wrong value length");return{v:c,l:e.subarray(i+s)}}},_int:{encode(t){let{Err:e}=Ur;if(t<Dr)throw new e("integer: negative integers are not allowed");let r=An(t);if(Number.parseInt(r[0],16)&8&&(r="00"+r),r.length&1)throw new e("unexpected DER parsing assertion: unpadded hex");return r},decode(t){let{Err:e}=Ur;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 IO(t)}},toSig(t){let{Err:e,_int:r,_tlv:i}=Ur,n=typeof t=="string"?RO(t):t;hi(n);let{v:o,l:s}=i.decode(48,n);if(s.length)throw new e("invalid signature: left bytes after parsing");let{v:c,l:u}=i.decode(2,o),{v:p,l:m}=i.decode(2,u);if(m.length)throw new e("invalid signature: left bytes after parsing");return{r:r.decode(c),s:r.decode(p)}},hexFromSig(t){let{_tlv:e,_int:r}=Ur,i=e.encode(2,r.encode(t.r)),n=e.encode(2,r.encode(t.s)),o=i+n;return e.encode(48,o)}},Dr=BigInt(0),It=BigInt(1),iP=BigInt(2),tb=BigInt(3),oP=BigInt(4);function kO(t){let e=EO(t),{Fp:r}=e,i=rn(e.n,e.nBitLength),n=e.toBytes||((I,R,T)=>{let B=R.toAffine();return Br(Uint8Array.from([4]),r.toBytes(B.x),r.toBytes(B.y))}),o=e.fromBytes||(I=>{let R=I.subarray(1),T=r.fromBytes(R.subarray(0,r.BYTES)),B=r.fromBytes(R.subarray(r.BYTES,2*r.BYTES));return{x:T,y:B}});function s(I){let{a:R,b:T}=e,B=r.sqr(I),$=r.mul(B,I);return r.add(r.add($,r.mul(I,R)),T)}if(!r.eql(r.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function c(I){return vo(I,It,e.n)}function u(I){let{allowedPrivateKeyLengths:R,nByteLength:T,wrapPrivateKey:B,n:$}=e;if(R&&typeof I!="bigint"){if(Qr(I)&&(I=Lr(I)),typeof I!="string"||!R.includes(I.length))throw new Error("invalid private key");I=I.padStart(T*2,"0")}let C;try{C=typeof I=="bigint"?I:Pr(We("private key",I,T))}catch{throw new Error("invalid private key, expected hex or "+T+" bytes, got "+typeof I)}return B&&(C=ke(C,$)),Ht("private key",C,It,$),C}function p(I){if(!(I instanceof w))throw new Error("ProjectivePoint expected")}let m=Tn((I,R)=>{let{px:T,py:B,pz:$}=I;if(r.eql($,r.ONE))return{x:T,y:B};let C=I.is0();R==null&&(R=C?r.ONE:r.inv($));let Q=r.mul(T,R),J=r.mul(B,R),Y=r.mul($,R);if(C)return{x:r.ZERO,y:r.ZERO};if(!r.eql(Y,r.ONE))throw new Error("invZ was invalid");return{x:Q,y:J}}),_=Tn(I=>{if(I.is0()){if(e.allowInfinityPoint&&!r.is0(I.py))return;throw new Error("bad point: ZERO")}let{x:R,y:T}=I.toAffine();if(!r.isValid(R)||!r.isValid(T))throw new Error("bad point: x or y not FE");let B=r.sqr(T),$=s(R);if(!r.eql(B,$))throw new Error("bad point: equation left != right");if(!I.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class w{constructor(R,T,B){if(this.px=R,this.py=T,this.pz=B,R==null||!r.isValid(R))throw new Error("x required");if(T==null||!r.isValid(T))throw new Error("y required");if(B==null||!r.isValid(B))throw new Error("z required");Object.freeze(this)}static fromAffine(R){let{x:T,y:B}=R||{};if(!R||!r.isValid(T)||!r.isValid(B))throw new Error("invalid affine point");if(R instanceof w)throw new Error("projective point not allowed");let $=C=>r.eql(C,r.ZERO);return $(T)&&$(B)?w.ZERO:new w(T,B,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(R){let T=r.invertBatch(R.map(B=>B.pz));return R.map((B,$)=>B.toAffine(T[$])).map(w.fromAffine)}static fromHex(R){let T=w.fromAffine(o(We("pointHex",R)));return T.assertValidity(),T}static fromPrivateKey(R){return w.BASE.multiply(u(R))}static msm(R,T){return ka(w,i,R,T)}_setWindowSize(R){A.setWindowSize(this,R)}assertValidity(){_(this)}hasEvenY(){let{y:R}=this.toAffine();if(r.isOdd)return!r.isOdd(R);throw new Error("Field doesn't support isOdd")}equals(R){p(R);let{px:T,py:B,pz:$}=this,{px:C,py:Q,pz:J}=R,Y=r.eql(r.mul(T,J),r.mul(C,$)),X=r.eql(r.mul(B,J),r.mul(Q,$));return Y&&X}negate(){return new w(this.px,r.neg(this.py),this.pz)}double(){let{a:R,b:T}=e,B=r.mul(T,tb),{px:$,py:C,pz:Q}=this,J=r.ZERO,Y=r.ZERO,X=r.ZERO,ee=r.mul($,$),Re=r.mul(C,C),ne=r.mul(Q,Q),fe=r.mul($,C);return fe=r.add(fe,fe),X=r.mul($,Q),X=r.add(X,X),J=r.mul(R,X),Y=r.mul(B,ne),Y=r.add(J,Y),J=r.sub(Re,Y),Y=r.add(Re,Y),Y=r.mul(J,Y),J=r.mul(fe,J),X=r.mul(B,X),ne=r.mul(R,ne),fe=r.sub(ee,ne),fe=r.mul(R,fe),fe=r.add(fe,X),X=r.add(ee,ee),ee=r.add(X,ee),ee=r.add(ee,ne),ee=r.mul(ee,fe),Y=r.add(Y,ee),ne=r.mul(C,Q),ne=r.add(ne,ne),ee=r.mul(ne,fe),J=r.sub(J,ee),X=r.mul(ne,Re),X=r.add(X,X),X=r.add(X,X),new w(J,Y,X)}add(R){p(R);let{px:T,py:B,pz:$}=this,{px:C,py:Q,pz:J}=R,Y=r.ZERO,X=r.ZERO,ee=r.ZERO,Re=e.a,ne=r.mul(e.b,tb),fe=r.mul(T,C),S=r.mul(B,Q),a=r.mul($,J),f=r.add(T,B),d=r.add(C,Q);f=r.mul(f,d),d=r.add(fe,S),f=r.sub(f,d),d=r.add(T,$);let h=r.add(C,J);return d=r.mul(d,h),h=r.add(fe,a),d=r.sub(d,h),h=r.add(B,$),Y=r.add(Q,J),h=r.mul(h,Y),Y=r.add(S,a),h=r.sub(h,Y),ee=r.mul(Re,d),Y=r.mul(ne,a),ee=r.add(Y,ee),Y=r.sub(S,ee),ee=r.add(S,ee),X=r.mul(Y,ee),S=r.add(fe,fe),S=r.add(S,fe),a=r.mul(Re,a),d=r.mul(ne,d),S=r.add(S,a),a=r.sub(fe,a),a=r.mul(Re,a),d=r.add(d,a),fe=r.mul(S,d),X=r.add(X,fe),fe=r.mul(h,d),Y=r.mul(f,Y),Y=r.sub(Y,fe),fe=r.mul(f,S),ee=r.mul(h,ee),ee=r.add(ee,fe),new w(Y,X,ee)}subtract(R){return this.add(R.negate())}is0(){return this.equals(w.ZERO)}wNAF(R){return A.wNAFCached(this,R,w.normalizeZ)}multiplyUnsafe(R){let{endo:T,n:B}=e;Ht("scalar",R,Dr,B);let $=w.ZERO;if(R===Dr)return $;if(this.is0()||R===It)return this;if(!T||A.hasPrecomputes(this))return A.wNAFCachedUnsafe(this,R,w.normalizeZ);let{k1neg:C,k1:Q,k2neg:J,k2:Y}=T.splitScalar(R),X=$,ee=$,Re=this;for(;Q>Dr||Y>Dr;)Q&It&&(X=X.add(Re)),Y&It&&(ee=ee.add(Re)),Re=Re.double(),Q>>=It,Y>>=It;return C&&(X=X.negate()),J&&(ee=ee.negate()),ee=new w(r.mul(ee.px,T.beta),ee.py,ee.pz),X.add(ee)}multiply(R){let{endo:T,n:B}=e;Ht("scalar",R,It,B);let $,C;if(T){let{k1neg:Q,k1:J,k2neg:Y,k2:X}=T.splitScalar(R),{p:ee,f:Re}=this.wNAF(J),{p:ne,f:fe}=this.wNAF(X);ee=A.constTimeNegate(Q,ee),ne=A.constTimeNegate(Y,ne),ne=new w(r.mul(ne.px,T.beta),ne.py,ne.pz),$=ee.add(ne),C=Re.add(fe)}else{let{p:Q,f:J}=this.wNAF(R);$=Q,C=J}return w.normalizeZ([$,C])[0]}multiplyAndAddUnsafe(R,T,B){let $=w.BASE,C=(J,Y)=>Y===Dr||Y===It||!J.equals($)?J.multiplyUnsafe(Y):J.multiply(Y),Q=C(this,T).add(C(R,B));return Q.is0()?void 0:Q}toAffine(R){return m(this,R)}isTorsionFree(){let{h:R,isTorsionFree:T}=e;if(R===It)return!0;if(T)return T(w,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:R,clearCofactor:T}=e;return R===It?this:T?T(w,this):this.multiplyUnsafe(e.h)}toRawBytes(R=!0){return ur("isCompressed",R),this.assertValidity(),n(w,this,R)}toHex(R=!0){return ur("isCompressed",R),Lr(this.toRawBytes(R))}}w.BASE=new w(e.Gx,e.Gy,r.ONE),w.ZERO=new w(r.ZERO,r.ONE,r.ZERO);let g=e.nBitLength,A=Ra(w,e.endo?Math.ceil(g/2):g);return{CURVE:e,ProjectivePoint:w,normPrivateKeyToScalar:u,weierstrassEquation:s,isWithinCurveOrder:c}}function AO(t){let e=xo(t);return _r(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function rb(t){let e=AO(t),{Fp:r,n:i}=e,n=r.BYTES+1,o=2*r.BYTES+1;function s(a){return ke(a,i)}function c(a){return Ea(a,i)}let{ProjectivePoint:u,normPrivateKeyToScalar:p,weierstrassEquation:m,isWithinCurveOrder:_}=kO({...e,toBytes(a,f,d){let h=f.toAffine(),y=r.toBytes(h.x),x=Br;return ur("isCompressed",d),d?x(Uint8Array.from([f.hasEvenY()?2:3]),y):x(Uint8Array.from([4]),y,r.toBytes(h.y))},fromBytes(a){let f=a.length,d=a[0],h=a.subarray(1);if(f===n&&(d===2||d===3)){let y=Pr(h);if(!vo(y,It,r.ORDER))throw new Error("Point is not on curve");let x=m(y),k;try{k=r.sqrt(x)}catch(v){let U=v instanceof Error?": "+v.message:"";throw new Error("Point is not on curve"+U)}let b=(k&It)===It;return(d&1)===1!==b&&(k=r.neg(k)),{x:y,y:k}}else if(f===o&&d===4){let y=r.fromBytes(h.subarray(0,r.BYTES)),x=r.fromBytes(h.subarray(r.BYTES,2*r.BYTES));return{x:y,y:x}}else{let y=n,x=o;throw new Error("invalid Point, expected length of "+y+", or uncompressed "+x+", got "+f)}}}),w=a=>Lr(tn(a,e.nByteLength));function g(a){let f=i>>It;return a>f}function A(a){return g(a)?s(-a):a}let I=(a,f,d)=>Pr(a.slice(f,d));class R{constructor(f,d,h){this.r=f,this.s=d,this.recovery=h,this.assertValidity()}static fromCompact(f){let d=e.nByteLength;return f=We("compactSignature",f,d*2),new R(I(f,0,d),I(f,d,2*d))}static fromDER(f){let{r:d,s:h}=Ur.toSig(We("DER",f));return new R(d,h)}assertValidity(){Ht("r",this.r,It,i),Ht("s",this.s,It,i)}addRecoveryBit(f){return new R(this.r,this.s,f)}recoverPublicKey(f){let{r:d,s:h,recovery:y}=this,x=J(We("msgHash",f));if(y==null||![0,1,2,3].includes(y))throw new Error("recovery id invalid");let k=y===2||y===3?d+e.n:d;if(k>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");let b=(y&1)===0?"02":"03",l=u.fromHex(b+w(k)),v=c(k),U=s(-x*v),M=s(h*v),Z=u.BASE.multiplyAndAddUnsafe(l,U,M);if(!Z)throw new Error("point at infinify");return Z.assertValidity(),Z}hasHighS(){return g(this.s)}normalizeS(){return this.hasHighS()?new R(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return On(this.toDERHex())}toDERHex(){return Ur.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return On(this.toCompactHex())}toCompactHex(){return w(this.r)+w(this.s)}}let T={isValidPrivateKey(a){try{return p(a),!0}catch{return!1}},normPrivateKeyToScalar:p,randomPrivateKey:()=>{let a=$h(e.n);return Ly(e.randomBytes(a),e.n)},precompute(a=8,f=u.BASE){return f._setWindowSize(a),f.multiply(BigInt(3)),f}};function B(a,f=!0){return u.fromPrivateKey(a).toRawBytes(f)}function $(a){let f=Qr(a),d=typeof a=="string",h=(f||d)&&a.length;return f?h===n||h===o:d?h===2*n||h===2*o:a instanceof u}function C(a,f,d=!0){if($(a))throw new Error("first arg must be private key");if(!$(f))throw new Error("second arg must be public key");return u.fromHex(f).multiply(p(a)).toRawBytes(d)}let Q=e.bits2int||function(a){if(a.length>8192)throw new Error("input is too large");let f=Pr(a),d=a.length*8-e.nBitLength;return d>0?f>>BigInt(d):f},J=e.bits2int_modN||function(a){return s(Q(a))},Y=wo(e.nBitLength);function X(a){return Ht("num < 2^"+e.nBitLength,a,Dr,Y),tn(a,e.nByteLength)}function ee(a,f,d=Re){if(["recovered","canonical"].some(oe=>oe in d))throw new Error("sign() legacy options not supported");let{hash:h,randomBytes:y}=e,{lowS:x,prehash:k,extraEntropy:b}=d;x==null&&(x=!0),a=We("msgHash",a),eb(d),k&&(a=We("prehashed msgHash",h(a)));let l=J(a),v=p(f),U=[X(v),X(l)];if(b!=null&&b!==!1){let oe=b===!0?y(r.BYTES):b;U.push(We("extraEntropy",oe))}let M=Br(...U),Z=l;function te(oe){let ue=Q(oe);if(!_(ue))return;let Le=c(ue),de=u.BASE.multiply(ue).toAffine(),pe=s(de.x);if(pe===Dr)return;let Yt=s(Le*s(Z+pe*v));if(Yt===Dr)return;let Se=(de.x===pe?0:2)|Number(de.y&It),Ne=Yt;return x&&g(Yt)&&(Ne=A(Yt),Se^=1),new R(pe,Ne,Se)}return{seed:M,k2sig:te}}let Re={lowS:e.lowS,prehash:!1},ne={lowS:e.lowS,prehash:!1};function fe(a,f,d=Re){let{seed:h,k2sig:y}=ee(a,f,d),x=e;return Ah(x.hash.outputLen,x.nByteLength,x.hmac)(h,y)}u.BASE._setWindowSize(8);function S(a,f,d,h=ne){let y=a;f=We("msgHash",f),d=We("publicKey",d);let{lowS:x,prehash:k,format:b}=h;if(eb(h),"strict"in h)throw new Error("options.strict was renamed to lowS");if(b!==void 0&&b!=="compact"&&b!=="der")throw new Error("format must be compact or der");let l=typeof y=="string"||Qr(y),v=!l&&!b&&typeof y=="object"&&y!==null&&typeof y.r=="bigint"&&typeof y.s=="bigint";if(!l&&!v)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let U,M;try{if(v&&(U=new R(y.r,y.s)),l){try{b!=="compact"&&(U=R.fromDER(y))}catch(Se){if(!(Se instanceof Ur.Err))throw Se}!U&&b!=="der"&&(U=R.fromCompact(y))}M=u.fromHex(d)}catch{return!1}if(!U||x&&U.hasHighS())return!1;k&&(f=e.hash(f));let{r:Z,s:te}=U,oe=J(f),ue=c(te),Le=s(oe*ue),de=s(Z*ue),pe=u.BASE.multiplyAndAddUnsafe(M,Le,de)?.toAffine();return pe?s(pe.x)===Z:!1}return{CURVE:e,getPublicKey:B,getSharedSecret:C,sign:fe,verify:S,ProjectivePoint:u,Signature:R,utils:T}}function OO(t){return{hash:t,hmac:(e,...r)=>bp(t,e,gh(...r)),randomBytes:ba}}function nb(t,e){let r=i=>rb({...t,...OO(i)});return{...r(e),create:r}}var sb=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),ib=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),NO=BigInt(1),wp=BigInt(2),ob=(t,e)=>(t+e/wp)/e;function TO(t){let e=sb,r=BigInt(3),i=BigInt(6),n=BigInt(11),o=BigInt(22),s=BigInt(23),c=BigInt(44),u=BigInt(88),p=t*t*t%e,m=p*p*t%e,_=ze(m,r,e)*m%e,w=ze(_,r,e)*m%e,g=ze(w,wp,e)*p%e,A=ze(g,n,e)*g%e,I=ze(A,o,e)*A%e,R=ze(I,c,e)*I%e,T=ze(R,u,e)*R%e,B=ze(T,c,e)*I%e,$=ze(B,r,e)*m%e,C=ze($,s,e)*A%e,Q=ze(C,i,e)*p%e,J=ze(Q,wp,e);if(!xp.eql(xp.sqr(J),t))throw new Error("Cannot find square root");return J}var xp=rn(sb,void 0,void 0,{sqrt:TO}),Co=nb({a:BigInt(0),b:BigInt(7),Fp:xp,n:ib,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{let e=ib,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),i=-NO*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),n=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,s=BigInt("0x100000000000000000000000000000000"),c=ob(o*t,e),u=ob(-i*t,e),p=ke(t-c*r-u*n,e),m=ke(-c*i-u*o,e),_=p>s,w=m>s;if(_&&(p=e-p),w&&(m=e-m),p>s||m>s)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:_,k1:p,k2neg:w,k2:m}}}},So),pP=BigInt(0);var mP=Co.ProjectivePoint;var EP=Ln.utils.randomPrivateKey,ab=()=>{let t=Ln.utils.randomPrivateKey(),e=$p(t),r=new Uint8Array(64);return r.set(t),r.set(e,32),{publicKey:e,secretKey:r}},$p=Ln.getPublicKey;function cb(t){try{return Ln.ExtendedPoint.fromHex(t),!0}catch{return!1}}var Kp=(t,e)=>Ln.sign(t,e.slice(0,32)),$O=Ln.verify,_e=t=>se.Buffer.isBuffer(t)?t:t instanceof Uint8Array?se.Buffer.from(t.buffer,t.byteOffset,t.byteLength):se.Buffer.from(t),Lp=class{constructor(e){Object.assign(this,e)}encode(){return se.Buffer.from((0,Si.serialize)(mc,this))}static decode(e){return(0,Si.deserialize)(mc,this,e)}static decodeUnchecked(e){return(0,Si.deserializeUnchecked)(mc,this,e)}};var mc=new Map,kb,LO=32,mn=32;function PO(t){return t._bn!==void 0}var ub=1,ce=class t extends Lp{constructor(e){if(super({}),this._bn=void 0,PO(e))this._bn=e._bn;else{if(typeof e=="string"){let r=Rt.default.decode(e);if(r.length!=mn)throw new Error("Invalid public key input");this._bn=new Tp.default(r)}else this._bn=new Tp.default(e);if(this._bn.byteLength()>mn)throw new Error("Invalid public key input")}}static unique(){let e=new t(ub);return ub+=1,new t(e.toBuffer())}equals(e){return this._bn.eq(e._bn)}toBase58(){return Rt.default.encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){let e=this.toBuffer();return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}toBuffer(){let e=this._bn.toArrayLike(se.Buffer);if(e.length===mn)return e;let r=se.Buffer.alloc(32);return e.copy(r,32-e.length),r}get[Symbol.toStringTag](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(e,r,i){let n=se.Buffer.concat([e.toBuffer(),se.Buffer.from(r),i.toBuffer()]),o=So(n);return new t(o)}static createProgramAddressSync(e,r){let i=se.Buffer.alloc(0);e.forEach(function(o){if(o.length>LO)throw new TypeError("Max seed length exceeded");i=se.Buffer.concat([i,_e(o)])}),i=se.Buffer.concat([i,r.toBuffer(),se.Buffer.from("ProgramDerivedAddress")]);let n=So(i);if(cb(n))throw new Error("Invalid seeds, address must fall off the curve");return new t(n)}static async createProgramAddress(e,r){return this.createProgramAddressSync(e,r)}static findProgramAddressSync(e,r){let i=255,n;for(;i!=0;){try{let o=e.concat(se.Buffer.from([i]));n=this.createProgramAddressSync(o,r)}catch(o){if(o instanceof TypeError)throw o;i--;continue}return[n,i]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(e,r){return this.findProgramAddressSync(e,r)}static isOnCurve(e){let r=new t(e);return cb(r.toBytes())}};kb=ce;ce.default=new kb("11111111111111111111111111111111");mc.set(ce,{kind:"struct",fields:[["_bn","u256"]]});var IP=new ce("BPFLoader1111111111111111111111111111111111"),Fn=1232,qp=127,gc=64,yc=class extends Error{constructor(e){super(`Signature ${e} has expired: block height exceeded.`),this.signature=void 0,this.signature=e}};Object.defineProperty(yc.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});var _c=class extends Error{constructor(e,r){super(`Transaction was not confirmed in ${r.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(_c.prototype,"name",{value:"TransactionExpiredTimeoutError"});var jn=class extends Error{constructor(e){super(`Signature ${e} has expired: the nonce is no longer valid.`),this.signature=void 0,this.signature=e}};Object.defineProperty(jn.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});var wi=class{constructor(e,r){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=e,this.accountKeysFromLookups=r}keySegments(){let e=[this.staticAccountKeys];return this.accountKeysFromLookups&&(e.push(this.accountKeysFromLookups.writable),e.push(this.accountKeysFromLookups.readonly)),e}get(e){for(let r of this.keySegments()){if(e<r.length)return r[e];e-=r.length}}get length(){return this.keySegments().flat().length}compileInstructions(e){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let i=new Map;this.keySegments().flat().forEach((o,s)=>{i.set(o.toBase58(),s)});let n=o=>{let s=i.get(o.toBase58());if(s===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return s};return e.map(o=>({programIdIndex:n(o.programId),accountKeyIndexes:o.keys.map(s=>n(s.pubkey)),data:o.data}))}},ye=(t="publicKey")=>E.blob(32,t),BO=(t="signature")=>E.blob(64,t),vi=(t="string")=>{let e=E.struct([E.u32("length"),E.u32("lengthPadding"),E.blob(E.offset(E.u32(),-8),"chars")],t),r=e.decode.bind(e),i=e.encode.bind(e),n=e;return n.decode=(o,s)=>r(o,s).chars.toString(),n.encode=(o,s,c)=>{let u={chars:se.Buffer.from(o,"utf8")};return i(u,s,c)},n.alloc=o=>E.u32().span+E.u32().span+se.Buffer.from(o,"utf8").length,n},zO=(t="authorized")=>E.struct([ye("staker"),ye("withdrawer")],t),CO=(t="lockup")=>E.struct([E.ns64("unixTimestamp"),E.ns64("epoch"),ye("custodian")],t),UO=(t="voteInit")=>E.struct([ye("nodePubkey"),ye("authorizedVoter"),ye("authorizedWithdrawer"),E.u8("commission")],t),DO=(t="voteAuthorizeWithSeedArgs")=>E.struct([E.u32("voteAuthorizationType"),ye("currentAuthorityDerivedKeyOwnerPubkey"),vi("currentAuthorityDerivedKeySeed"),ye("newAuthorized")],t);function Ab(t,e){let r=n=>{if(n.span>=0)return n.span;if(typeof n.alloc=="function")return n.alloc(e[n.property]);if("count"in n&&"elementLayout"in n){let o=e[n.property];if(Array.isArray(o))return o.length*r(n.elementLayout)}else if("fields"in n)return Ab({layout:n},e[n.property]);return 0},i=0;return t.layout.fields.forEach(n=>{i+=r(n)}),i}function tr(t){let e=0,r=0;for(;;){let i=t.shift();if(e|=(i&127)<<r*7,r+=1,(i&128)===0)break}return e}function rr(t,e){let r=e;for(;;){let i=r&127;if(r>>=7,r==0){t.push(i);break}else i|=128,t.push(i)}}function Ee(t,e){if(!t)throw new Error(e||"Assertion failed")}var bc=class t{constructor(e,r){this.payer=void 0,this.keyMetaMap=void 0,this.payer=e,this.keyMetaMap=r}static compile(e,r){let i=new Map,n=s=>{let c=s.toBase58(),u=i.get(c);return u===void 0&&(u={isSigner:!1,isWritable:!1,isInvoked:!1},i.set(c,u)),u},o=n(r);o.isSigner=!0,o.isWritable=!0;for(let s of e){n(s.programId).isInvoked=!0;for(let c of s.keys){let u=n(c.pubkey);u.isSigner||=c.isSigner,u.isWritable||=c.isWritable}}return new t(r,i)}getMessageComponents(){let e=[...this.keyMetaMap.entries()];Ee(e.length<=256,"Max static account keys length exceeded");let r=e.filter(([,u])=>u.isSigner&&u.isWritable),i=e.filter(([,u])=>u.isSigner&&!u.isWritable),n=e.filter(([,u])=>!u.isSigner&&u.isWritable),o=e.filter(([,u])=>!u.isSigner&&!u.isWritable),s={numRequiredSignatures:r.length+i.length,numReadonlySignedAccounts:i.length,numReadonlyUnsignedAccounts:o.length};{Ee(r.length>0,"Expected at least one writable signer key");let[u]=r[0];Ee(u===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}let c=[...r.map(([u])=>new ce(u)),...i.map(([u])=>new ce(u)),...n.map(([u])=>new ce(u)),...o.map(([u])=>new ce(u))];return[s,c]}extractTableLookup(e){let[r,i]=this.drainKeysFoundInLookupTable(e.state.addresses,s=>!s.isSigner&&!s.isInvoked&&s.isWritable),[n,o]=this.drainKeysFoundInLookupTable(e.state.addresses,s=>!s.isSigner&&!s.isInvoked&&!s.isWritable);if(!(r.length===0&&n.length===0))return[{accountKey:e.key,writableIndexes:r,readonlyIndexes:n},{writable:i,readonly:o}]}drainKeysFoundInLookupTable(e,r){let i=new Array,n=new Array;for(let[o,s]of this.keyMetaMap.entries())if(r(s)){let c=new ce(o),u=e.findIndex(p=>p.equals(c));u>=0&&(Ee(u<256,"Max lookup table index exceeded"),i.push(u),n.push(c),this.keyMetaMap.delete(o))}return[i,n]}},Ob="Reached end of buffer unexpectedly";function jr(t){if(t.length===0)throw new Error(Ob);return t.shift()}function nr(t,...e){let[r]=e;if(e.length===2?r+(e[1]??0)>t.length:r>=t.length)throw new Error(Ob);return t.splice(...e)}var gn=class t{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(r=>new ce(r)),this.recentBlockhash=e.recentBlockhash,this.instructions=e.instructions,this.instructions.forEach(r=>this.indexToProgramIds.set(r.programIdIndex,this.accountKeys[r.programIdIndex]))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map(e=>({programIdIndex:e.programIdIndex,accountKeyIndexes:e.accounts,data:Rt.default.decode(e.data)}))}get addressTableLookups(){return[]}getAccountKeys(){return new wi(this.staticAccountKeys)}static compile(e){let r=bc.compile(e.instructions,e.payerKey),[i,n]=r.getMessageComponents(),s=new wi(n).compileInstructions(e.instructions).map(c=>({programIdIndex:c.programIdIndex,accounts:c.accountKeyIndexes,data:Rt.default.encode(c.data)}));return new t({header:i,accountKeys:n,recentBlockhash:e.recentBlockhash,instructions:s})}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){let r=this.header.numRequiredSignatures;if(e>=this.header.numRequiredSignatures){let i=e-r,o=this.accountKeys.length-r-this.header.numReadonlyUnsignedAccounts;return i<o}else{let i=r-this.header.numReadonlySignedAccounts;return e<i}}isProgramId(e){return this.indexToProgramIds.has(e)}programIds(){return[...this.indexToProgramIds.values()]}nonProgramIds(){return this.accountKeys.filter((e,r)=>!this.isProgramId(r))}serialize(){let e=this.accountKeys.length,r=[];rr(r,e);let i=this.instructions.map(_=>{let{accounts:w,programIdIndex:g}=_,A=Array.from(Rt.default.decode(_.data)),I=[];rr(I,w.length);let R=[];return rr(R,A.length),{programIdIndex:g,keyIndicesCount:se.Buffer.from(I),keyIndices:w,dataLength:se.Buffer.from(R),data:A}}),n=[];rr(n,i.length);let o=se.Buffer.alloc(Fn);se.Buffer.from(n).copy(o);let s=n.length;i.forEach(_=>{let g=E.struct([E.u8("programIdIndex"),E.blob(_.keyIndicesCount.length,"keyIndicesCount"),E.seq(E.u8("keyIndex"),_.keyIndices.length,"keyIndices"),E.blob(_.dataLength.length,"dataLength"),E.seq(E.u8("userdatum"),_.data.length,"data")]).encode(_,o,s);s+=g}),o=o.slice(0,s);let c=E.struct([E.blob(1,"numRequiredSignatures"),E.blob(1,"numReadonlySignedAccounts"),E.blob(1,"numReadonlyUnsignedAccounts"),E.blob(r.length,"keyCount"),E.seq(ye("key"),e,"keys"),ye("recentBlockhash")]),u={numRequiredSignatures:se.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:se.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:se.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:se.Buffer.from(r),keys:this.accountKeys.map(_=>_e(_.toBytes())),recentBlockhash:Rt.default.decode(this.recentBlockhash)},p=se.Buffer.alloc(2048),m=c.encode(u,p);return o.copy(p,m),p.slice(0,m+o.length)}static from(e){let r=[...e],i=jr(r);if(i!==(i&qp))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");let n=jr(r),o=jr(r),s=tr(r),c=[];for(let w=0;w<s;w++){let g=nr(r,0,mn);c.push(new ce(se.Buffer.from(g)))}let u=nr(r,0,mn),p=tr(r),m=[];for(let w=0;w<p;w++){let g=jr(r),A=tr(r),I=nr(r,0,A),R=tr(r),T=nr(r,0,R),B=Rt.default.encode(se.Buffer.from(T));m.push({programIdIndex:g,accounts:I,data:B})}let _={header:{numRequiredSignatures:i,numReadonlySignedAccounts:n,numReadonlyUnsignedAccounts:o},recentBlockhash:Rt.default.encode(se.Buffer.from(u)),accountKeys:c,instructions:m};return new t(_)}},vc=class t{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(let r of this.addressTableLookups)e+=r.readonlyIndexes.length+r.writableIndexes.length;return e}getAccountKeys(e){let r;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");r=e.accountKeysFromLookups}else if(e&&"addressLookupTableAccounts"in e&&e.addressLookupTableAccounts)r=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 wi(this.staticAccountKeys,r)}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){let r=this.header.numRequiredSignatures,i=this.staticAccountKeys.length;if(e>=i){let n=e-i,o=this.addressTableLookups.reduce((s,c)=>s+c.writableIndexes.length,0);return n<o}else if(e>=this.header.numRequiredSignatures){let n=e-r,s=i-r-this.header.numReadonlyUnsignedAccounts;return n<s}else{let n=r-this.header.numReadonlySignedAccounts;return e<n}}resolveAddressTableLookups(e){let r={writable:[],readonly:[]};for(let i of this.addressTableLookups){let n=e.find(o=>o.key.equals(i.accountKey));if(!n)throw new Error(`Failed to find address lookup table account for table key ${i.accountKey.toBase58()}`);for(let o of i.writableIndexes)if(o<n.state.addresses.length)r.writable.push(n.state.addresses[o]);else throw new Error(`Failed to find address for index ${o} in address lookup table ${i.accountKey.toBase58()}`);for(let o of i.readonlyIndexes)if(o<n.state.addresses.length)r.readonly.push(n.state.addresses[o]);else throw new Error(`Failed to find address for index ${o} in address lookup table ${i.accountKey.toBase58()}`)}return r}static compile(e){let r=bc.compile(e.instructions,e.payerKey),i=new Array,n={writable:new Array,readonly:new Array},o=e.addressLookupTableAccounts||[];for(let m of o){let _=r.extractTableLookup(m);if(_!==void 0){let[w,{writable:g,readonly:A}]=_;i.push(w),n.writable.push(...g),n.readonly.push(...A)}}let[s,c]=r.getMessageComponents(),p=new wi(c,n).compileInstructions(e.instructions);return new t({header:s,staticAccountKeys:c,recentBlockhash:e.recentBlockhash,compiledInstructions:p,addressTableLookups:i})}serialize(){let e=Array();rr(e,this.staticAccountKeys.length);let r=this.serializeInstructions(),i=Array();rr(i,this.compiledInstructions.length);let n=this.serializeAddressTableLookups(),o=Array();rr(o,this.addressTableLookups.length);let s=E.struct([E.u8("prefix"),E.struct([E.u8("numRequiredSignatures"),E.u8("numReadonlySignedAccounts"),E.u8("numReadonlyUnsignedAccounts")],"header"),E.blob(e.length,"staticAccountKeysLength"),E.seq(ye(),this.staticAccountKeys.length,"staticAccountKeys"),ye("recentBlockhash"),E.blob(i.length,"instructionsLength"),E.blob(r.length,"serializedInstructions"),E.blob(o.length,"addressTableLookupsLength"),E.blob(n.length,"serializedAddressTableLookups")]),c=new Uint8Array(Fn),p=s.encode({prefix:128,header:this.header,staticAccountKeysLength:new Uint8Array(e),staticAccountKeys:this.staticAccountKeys.map(m=>m.toBytes()),recentBlockhash:Rt.default.decode(this.recentBlockhash),instructionsLength:new Uint8Array(i),serializedInstructions:r,addressTableLookupsLength:new Uint8Array(o),serializedAddressTableLookups:n},c);return c.slice(0,p)}serializeInstructions(){let e=0,r=new Uint8Array(Fn);for(let i of this.compiledInstructions){let n=Array();rr(n,i.accountKeyIndexes.length);let o=Array();rr(o,i.data.length);let s=E.struct([E.u8("programIdIndex"),E.blob(n.length,"encodedAccountKeyIndexesLength"),E.seq(E.u8(),i.accountKeyIndexes.length,"accountKeyIndexes"),E.blob(o.length,"encodedDataLength"),E.blob(i.data.length,"data")]);e+=s.encode({programIdIndex:i.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(n),accountKeyIndexes:i.accountKeyIndexes,encodedDataLength:new Uint8Array(o),data:i.data},r,e)}return r.slice(0,e)}serializeAddressTableLookups(){let e=0,r=new Uint8Array(Fn);for(let i of this.addressTableLookups){let n=Array();rr(n,i.writableIndexes.length);let o=Array();rr(o,i.readonlyIndexes.length);let s=E.struct([ye("accountKey"),E.blob(n.length,"encodedWritableIndexesLength"),E.seq(E.u8(),i.writableIndexes.length,"writableIndexes"),E.blob(o.length,"encodedReadonlyIndexesLength"),E.seq(E.u8(),i.readonlyIndexes.length,"readonlyIndexes")]);e+=s.encode({accountKey:i.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(n),writableIndexes:i.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(o),readonlyIndexes:i.readonlyIndexes},r,e)}return r.slice(0,e)}static deserialize(e){let r=[...e],i=jr(r),n=i&qp;Ee(i!==n,"Expected versioned message but received legacy message");let o=n;Ee(o===0,`Expected versioned message with version 0 but found version ${o}`);let s={numRequiredSignatures:jr(r),numReadonlySignedAccounts:jr(r),numReadonlyUnsignedAccounts:jr(r)},c=[],u=tr(r);for(let A=0;A<u;A++)c.push(new ce(nr(r,0,mn)));let p=Rt.default.encode(nr(r,0,mn)),m=tr(r),_=[];for(let A=0;A<m;A++){let I=jr(r),R=tr(r),T=nr(r,0,R),B=tr(r),$=new Uint8Array(nr(r,0,B));_.push({programIdIndex:I,accountKeyIndexes:T,data:$})}let w=tr(r),g=[];for(let A=0;A<w;A++){let I=new ce(nr(r,0,mn)),R=tr(r),T=nr(r,0,R),B=tr(r),$=nr(r,0,B);g.push({accountKey:I,writableIndexes:T,readonlyIndexes:$})}return new t({header:s,staticAccountKeys:c,recentBlockhash:p,compiledInstructions:_,addressTableLookups:g})}},kc={deserializeMessageVersion(t){let e=t[0],r=e&qp;return r===e?"legacy":r},deserialize:t=>{let e=kc.deserializeMessageVersion(t);if(e==="legacy")return gn.from(t);if(e===0)return vc.deserialize(t);throw new Error(`Transaction message version ${e} deserialization is not supported`)}},hn=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}({}),MO=se.Buffer.alloc(gc).fill(0),Oe=class{constructor(e){this.keys=void 0,this.programId=void 0,this.data=se.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:r,isWritable:i})=>({pubkey:e.toJSON(),isSigner:r,isWritable:i})),programId:this.programId.toJSON(),data:[...this.data]}}},xe=class t{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")){let{minContextSlot:r,nonceInfo:i}=e;this.minNonceContextSlot=r,this.nonceInfo=i}else if(Object.prototype.hasOwnProperty.call(e,"lastValidBlockHeight")){let{blockhash:r,lastValidBlockHeight:i}=e;this.recentBlockhash=r,this.lastValidBlockHeight=i}else{let{recentBlockhash:r,nonceInfo:i}=e;i&&(this.nonceInfo=i),this.recentBlockhash=r}}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(r=>{"instructions"in r?this.instructions=this.instructions.concat(r.instructions):"data"in r&&"programId"in r&&"keys"in r?this.instructions.push(r):this.instructions.push(new Oe(r))}),this}compileMessage(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;let e,r;if(this.nonceInfo?(e=this.nonceInfo.nonce,this.instructions[0]!=this.nonceInfo.nonceInstruction?r=[this.nonceInfo.nonceInstruction,...this.instructions]:r=this.instructions):(e=this.recentBlockhash,r=this.instructions),!e)throw new Error("Transaction recentBlockhash required");r.length<1&&console.warn("No instructions provided");let i;if(this.feePayer)i=this.feePayer;else if(this.signatures.length>0&&this.signatures[0].publicKey)i=this.signatures[0].publicKey;else throw new Error("Transaction fee payer required");for(let I=0;I<r.length;I++)if(r[I].programId===void 0)throw new Error(`Transaction instruction index ${I} has undefined program id`);let n=[],o=[];r.forEach(I=>{I.keys.forEach(T=>{o.push({...T})});let R=I.programId.toString();n.includes(R)||n.push(R)}),n.forEach(I=>{o.push({pubkey:new ce(I),isSigner:!1,isWritable:!1})});let s=[];o.forEach(I=>{let R=I.pubkey.toString(),T=s.findIndex(B=>B.pubkey.toString()===R);T>-1?(s[T].isWritable=s[T].isWritable||I.isWritable,s[T].isSigner=s[T].isSigner||I.isSigner):s.push(I)}),s.sort(function(I,R){if(I.isSigner!==R.isSigner)return I.isSigner?-1:1;if(I.isWritable!==R.isWritable)return I.isWritable?-1:1;let T={localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"};return I.pubkey.toBase58().localeCompare(R.pubkey.toBase58(),"en",T)});let c=s.findIndex(I=>I.pubkey.equals(i));if(c>-1){let[I]=s.splice(c,1);I.isSigner=!0,I.isWritable=!0,s.unshift(I)}else s.unshift({pubkey:i,isSigner:!0,isWritable:!0});for(let I of this.signatures){let R=s.findIndex(T=>T.pubkey.equals(I.publicKey));if(R>-1)s[R].isSigner||(s[R].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: ${I.publicKey.toString()}`)}let u=0,p=0,m=0,_=[],w=[];s.forEach(({pubkey:I,isSigner:R,isWritable:T})=>{R?(_.push(I.toString()),u+=1,T||(p+=1)):(w.push(I.toString()),T||(m+=1))});let g=_.concat(w),A=r.map(I=>{let{data:R,programId:T}=I;return{programIdIndex:g.indexOf(T.toString()),accounts:I.keys.map(B=>g.indexOf(B.pubkey.toString())),data:Rt.default.encode(R)}});return A.forEach(I=>{Ee(I.programIdIndex>=0),I.accounts.forEach(R=>Ee(R>=0))}),new gn({header:{numRequiredSignatures:u,numReadonlySignedAccounts:p,numReadonlyUnsignedAccounts:m},accountKeys:g,recentBlockhash:e,instructions:A})}_compile(){let e=this.compileMessage(),r=e.accountKeys.slice(0,e.header.numRequiredSignatures);return this.signatures.length===r.length&&this.signatures.every((n,o)=>r[o].equals(n.publicKey))||(this.signatures=r.map(i=>({signature:null,publicKey:i}))),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");let r=new Set;this.signatures=e.filter(i=>{let n=i.toString();return r.has(n)?!1:(r.add(n),!0)}).map(i=>({signature:null,publicKey:i}))}sign(...e){if(e.length===0)throw new Error("No signers");let r=new Set,i=[];for(let o of e){let s=o.publicKey.toString();r.has(s)||(r.add(s),i.push(o))}this.signatures=i.map(o=>({signature:null,publicKey:o.publicKey}));let n=this._compile();this._partialSign(n,...i)}partialSign(...e){if(e.length===0)throw new Error("No signers");let r=new Set,i=[];for(let o of e){let s=o.publicKey.toString();r.has(s)||(r.add(s),i.push(o))}let n=this._compile();this._partialSign(n,...i)}_partialSign(e,...r){let i=e.serialize();r.forEach(n=>{let o=Kp(i,n.secretKey);this._addSignature(n.publicKey,_e(o))})}addSignature(e,r){this._compile(),this._addSignature(e,r)}_addSignature(e,r){Ee(r.length===64);let i=this.signatures.findIndex(n=>e.equals(n.publicKey));if(i<0)throw new Error(`unknown signer: ${e.toString()}`);this.signatures[i].signature=se.Buffer.from(r)}verifySignatures(e=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),e)}_getMessageSignednessErrors(e,r){let i={};for(let{signature:n,publicKey:o}of this.signatures)n===null?r&&(i.missing||=[]).push(o):$O(n,e,o.toBytes())||(i.invalid||=[]).push(o);return i.invalid||i.missing?i:void 0}serialize(e){let{requireAllSignatures:r,verifySignatures:i}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},e),n=this.serializeMessage();if(i){let o=this._getMessageSignednessErrors(n,r);if(o){let s="Signature verification failed.";throw o.invalid&&(s+=`
34
+ Invalid signature for public key${o.invalid.length===1?"":"(s)"} [\`${o.invalid.map(c=>c.toBase58()).join("`, `")}\`].`),o.missing&&(s+=`
35
+ Missing signature for public key${o.missing.length===1?"":"(s)"} [\`${o.missing.map(c=>c.toBase58()).join("`, `")}\`].`),new Error(s)}}return this._serialize(n)}_serialize(e){let{signatures:r}=this,i=[];rr(i,r.length);let n=i.length+r.length*64+e.length,o=se.Buffer.alloc(n);return Ee(r.length<256),se.Buffer.from(i).copy(o,0),r.forEach(({signature:s},c)=>{s!==null&&(Ee(s.length===64,"signature has invalid length"),se.Buffer.from(s).copy(o,i.length+c*64))}),e.copy(o,i.length+r.length*64),Ee(o.length<=Fn,`Transaction too large: ${o.length} > ${Fn}`),o}get keys(){return Ee(this.instructions.length===1),this.instructions[0].keys.map(e=>e.pubkey)}get programId(){return Ee(this.instructions.length===1),this.instructions[0].programId}get data(){return Ee(this.instructions.length===1),this.instructions[0].data}static from(e){let r=[...e],i=tr(r),n=[];for(let o=0;o<i;o++){let s=nr(r,0,gc);n.push(Rt.default.encode(se.Buffer.from(s)))}return t.populate(gn.from(r),n)}static populate(e,r=[]){let i=new t;return i.recentBlockhash=e.recentBlockhash,e.header.numRequiredSignatures>0&&(i.feePayer=e.accountKeys[0]),r.forEach((n,o)=>{let s={signature:n==Rt.default.encode(MO)?null:Rt.default.decode(n),publicKey:e.accountKeys[o]};i.signatures.push(s)}),e.instructions.forEach(n=>{let o=n.accounts.map(s=>{let c=e.accountKeys[s];return{pubkey:c,isSigner:i.signatures.some(u=>u.publicKey.toString()===c.toString())||e.isAccountSigner(s),isWritable:e.isAccountWritable(s)}});i.instructions.push(new Oe({keys:o,programId:e.accountKeys[n.programIdIndex],data:Rt.default.decode(n.data)}))}),i._message=e,i._json=i.toJSON(),i}};var wc=class t{get version(){return this.message.version}constructor(e,r){if(this.signatures=void 0,this.message=void 0,r!==void 0)Ee(r.length===e.header.numRequiredSignatures,"Expected signatures length to be equal to the number of required signatures"),this.signatures=r;else{let i=[];for(let n=0;n<e.header.numRequiredSignatures;n++)i.push(new Uint8Array(gc));this.signatures=i}this.message=e}serialize(){let e=this.message.serialize(),r=Array();rr(r,this.signatures.length);let i=E.struct([E.blob(r.length,"encodedSignaturesLength"),E.seq(BO(),this.signatures.length,"signatures"),E.blob(e.length,"serializedMessage")]),n=new Uint8Array(2048),o=i.encode({encodedSignaturesLength:new Uint8Array(r),signatures:this.signatures,serializedMessage:e},n);return n.slice(0,o)}static deserialize(e){let r=[...e],i=[],n=tr(r);for(let s=0;s<n;s++)i.push(new Uint8Array(nr(r,0,gc)));let o=kc.deserialize(new Uint8Array(r));return new t(o,i)}sign(e){let r=this.message.serialize(),i=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures);for(let n of e){let o=i.findIndex(s=>s.equals(n.publicKey));Ee(o>=0,`Cannot sign with non signer key ${n.publicKey.toBase58()}`),this.signatures[o]=Kp(r,n.secretKey)}}addSignature(e,r){Ee(r.byteLength===64,"Signature must be 64 bytes long");let n=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex(o=>o.equals(e));Ee(n>=0,`Can not add signature; \`${e.toBase58()}\` is not required to sign this transaction`),this.signatures[n]=r}},jO=160,FO=64,ZO=jO/FO,Nb=1e3/ZO,Mr=new ce("SysvarC1ock11111111111111111111111111111111"),RP=new ce("SysvarEpochSchedu1e111111111111111111111111"),kP=new ce("Sysvar1nstructions1111111111111111111111111"),Sp=new ce("SysvarRecentB1ockHashes11111111111111111111"),jo=new ce("SysvarRent111111111111111111111111111111111"),AP=new ce("SysvarRewards111111111111111111111111111111"),OP=new ce("SysvarS1otHashes111111111111111111111111111"),NP=new ce("SysvarS1otHistory11111111111111111111111111"),Ep=new ce("SysvarStakeHistory1111111111111111111111111"),Fo=class extends Error{constructor({action:e,signature:r,transactionMessage:i,logs:n}){let o=n?`Logs:
36
+ ${JSON.stringify(n.slice(-10),null,2)}. `:"",s="\nCatch the `SendTransactionError` and call `getLogs()` on it for full details.",c;switch(e){case"send":c=`Transaction ${r} resulted in an error.
37
+ ${i}. `+o+s;break;case"simulate":c=`Simulation failed.
38
+ Message: ${i}.
39
+ `+o+s;break;default:c=`Unknown action '${(u=>u)(e)}'`}super(c),this.signature=void 0,this.transactionMessage=void 0,this.transactionLogs=void 0,this.signature=r,this.transactionMessage=i,this.transactionLogs=n||void 0}get transactionError(){return{message:this.transactionMessage,logs:Array.isArray(this.transactionLogs)?this.transactionLogs:void 0}}get logs(){let 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((r,i)=>{e.getTransaction(this.signature).then(n=>{if(n&&n.meta&&n.meta.logMessages){let o=n.meta.logMessages;this.transactionLogs=o,r(o)}else i(new Error("Log messages not found"))}).catch(i)})),await this.transactionLogs}};var re=class extends Error{constructor({code:e,message:r,data:i},n){super(n!=null?`${n}: ${r}`:r),this.code=void 0,this.data=void 0,this.code=e,this.data=i,this.name="SolanaJSONRPCError"}};async function lb(t,e,r,i){let n=i&&{skipPreflight:i.skipPreflight,preflightCommitment:i.preflightCommitment||i.commitment,maxRetries:i.maxRetries,minContextSlot:i.minContextSlot},o=await t.sendTransaction(e,r,n),s;if(e.recentBlockhash!=null&&e.lastValidBlockHeight!=null)s=(await t.confirmTransaction({abortSignal:i?.abortSignal,signature:o,blockhash:e.recentBlockhash,lastValidBlockHeight:e.lastValidBlockHeight},i&&i.commitment)).value;else if(e.minNonceContextSlot!=null&&e.nonceInfo!=null){let{nonceInstruction:c}=e.nonceInfo,u=c.keys[0].pubkey;s=(await t.confirmTransaction({abortSignal:i?.abortSignal,minContextSlot:e.minNonceContextSlot,nonceAccountPubkey:u,nonceValue:e.nonceInfo.nonce,signature:o},i&&i.commitment)).value}else i?.abortSignal!=null&&console.warn("sendAndConfirmTransaction(): A transaction with a deprecated confirmation strategy was supplied along with an `abortSignal`. Only transactions having `lastValidBlockHeight` or a combination of `nonceInfo` and `minNonceContextSlot` are abortable."),s=(await t.confirmTransaction(o,i&&i.commitment)).value;if(s.err)throw o!=null?new Fo({action:"send",signature:o,transactionMessage:`Status: (${JSON.stringify(s)})`}):new Error(`Transaction ${o} failed (${JSON.stringify(s)})`);return o}function Mn(t){return new Promise(e=>setTimeout(e,t))}function be(t,e){let r=t.layout.span>=0?t.layout.span:Ab(t,e),i=se.Buffer.alloc(r),n=Object.assign({instruction:t.index},e);return t.layout.encode(n,i),i}var VO=E.nu64("lamportsPerSignature"),Tb=E.struct([E.u32("version"),E.u32("state"),ye("authorizedPubkey"),ye("nonce"),E.struct([VO],"feeCalculator")]),fb=Tb.span,Pp=class t{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){let r=Tb.decode(_e(e),0);return new t({authorizedPubkey:new ce(r.authorizedPubkey),nonce:new ce(r.nonce).toString(),feeCalculator:r.feeCalculator})}};function xi(t){let e=(0,Ib.blob)(8,t),r=e.decode.bind(e),i=e.encode.bind(e),n=e,o=h_();return n.decode=(s,c)=>{let u=r(s,c);return o.decode(u)},n.encode=(s,c,u)=>{let p=o.encode(s);return i(p,c,u)},n}var ar=Object.freeze({Create:{index:0,layout:E.struct([E.u32("instruction"),E.ns64("lamports"),E.ns64("space"),ye("programId")])},Assign:{index:1,layout:E.struct([E.u32("instruction"),ye("programId")])},Transfer:{index:2,layout:E.struct([E.u32("instruction"),xi("lamports")])},CreateWithSeed:{index:3,layout:E.struct([E.u32("instruction"),ye("base"),vi("seed"),E.ns64("lamports"),E.ns64("space"),ye("programId")])},AdvanceNonceAccount:{index:4,layout:E.struct([E.u32("instruction")])},WithdrawNonceAccount:{index:5,layout:E.struct([E.u32("instruction"),E.ns64("lamports")])},InitializeNonceAccount:{index:6,layout:E.struct([E.u32("instruction"),ye("authorized")])},AuthorizeNonceAccount:{index:7,layout:E.struct([E.u32("instruction"),ye("authorized")])},Allocate:{index:8,layout:E.struct([E.u32("instruction"),E.ns64("space")])},AllocateWithSeed:{index:9,layout:E.struct([E.u32("instruction"),ye("base"),vi("seed"),E.ns64("space"),ye("programId")])},AssignWithSeed:{index:10,layout:E.struct([E.u32("instruction"),ye("base"),vi("seed"),ye("programId")])},TransferWithSeed:{index:11,layout:E.struct([E.u32("instruction"),xi("lamports"),vi("seed"),ye("programId")])},UpgradeNonceAccount:{index:12,layout:E.struct([E.u32("instruction")])}}),Zt=class t{constructor(){}static createAccount(e){let r=ar.Create,i=be(r,{lamports:e.lamports,space:e.space,programId:_e(e.programId.toBuffer())});return new Oe({keys:[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:i})}static transfer(e){let r,i;if("basePubkey"in e){let n=ar.TransferWithSeed;r=be(n,{lamports:BigInt(e.lamports),seed:e.seed,programId:_e(e.programId.toBuffer())}),i=[{pubkey:e.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]}else{let n=ar.Transfer;r=be(n,{lamports:BigInt(e.lamports)}),i=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]}return new Oe({keys:i,programId:this.programId,data:r})}static assign(e){let r,i;if("basePubkey"in e){let n=ar.AssignWithSeed;r=be(n,{base:_e(e.basePubkey.toBuffer()),seed:e.seed,programId:_e(e.programId.toBuffer())}),i=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]}else{let n=ar.Assign;r=be(n,{programId:_e(e.programId.toBuffer())}),i=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]}return new Oe({keys:i,programId:this.programId,data:r})}static createAccountWithSeed(e){let r=ar.CreateWithSeed,i=be(r,{base:_e(e.basePubkey.toBuffer()),seed:e.seed,lamports:e.lamports,space:e.space,programId:_e(e.programId.toBuffer())}),n=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!1,isWritable:!0}];return e.basePubkey.equals(e.fromPubkey)||n.push({pubkey:e.basePubkey,isSigner:!0,isWritable:!1}),new Oe({keys:n,programId:this.programId,data:i})}static createNonceAccount(e){let r=new xe;"basePubkey"in e&&"seed"in e?r.add(t.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:fb,programId:this.programId})):r.add(t.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,lamports:e.lamports,space:fb,programId:this.programId}));let i={noncePubkey:e.noncePubkey,authorizedPubkey:e.authorizedPubkey};return r.add(this.nonceInitialize(i)),r}static nonceInitialize(e){let r=ar.InitializeNonceAccount,i=be(r,{authorized:_e(e.authorizedPubkey.toBuffer())}),n={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:Sp,isSigner:!1,isWritable:!1},{pubkey:jo,isSigner:!1,isWritable:!1}],programId:this.programId,data:i};return new Oe(n)}static nonceAdvance(e){let r=ar.AdvanceNonceAccount,i=be(r),n={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:Sp,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:i};return new Oe(n)}static nonceWithdraw(e){let r=ar.WithdrawNonceAccount,i=be(r,{lamports:e.lamports});return new Oe({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0},{pubkey:Sp,isSigner:!1,isWritable:!1},{pubkey:jo,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static nonceAuthorize(e){let r=ar.AuthorizeNonceAccount,i=be(r,{authorized:_e(e.newAuthorizedPubkey.toBuffer())});return new Oe({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static allocate(e){let r,i;if("basePubkey"in e){let n=ar.AllocateWithSeed;r=be(n,{base:_e(e.basePubkey.toBuffer()),seed:e.seed,space:e.space,programId:_e(e.programId.toBuffer())}),i=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]}else{let n=ar.Allocate;r=be(n,{space:e.space}),i=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]}return new Oe({keys:i,programId:this.programId,data:r})}};Zt.programId=new ce("11111111111111111111111111111111");var WO=Fn-300,Bp=class t{constructor(){}static getMinNumSignatures(e){return 2*(Math.ceil(e/t.chunkSize)+1+1)}static async load(e,r,i,n,o){{let _=await e.getMinimumBalanceForRentExemption(o.length),w=await e.getAccountInfo(i.publicKey,"confirmed"),g=null;if(w!==null){if(w.executable)return console.error("Program load failed, account is already executable"),!1;w.data.length!==o.length&&(g=g||new xe,g.add(Zt.allocate({accountPubkey:i.publicKey,space:o.length}))),w.owner.equals(n)||(g=g||new xe,g.add(Zt.assign({accountPubkey:i.publicKey,programId:n}))),w.lamports<_&&(g=g||new xe,g.add(Zt.transfer({fromPubkey:r.publicKey,toPubkey:i.publicKey,lamports:_-w.lamports})))}else g=new xe().add(Zt.createAccount({fromPubkey:r.publicKey,newAccountPubkey:i.publicKey,lamports:_>0?_:1,space:o.length,programId:n}));g!==null&&await lb(e,g,[r,i],{commitment:"confirmed"})}let s=E.struct([E.u32("instruction"),E.u32("offset"),E.u32("bytesLength"),E.u32("bytesLengthPadding"),E.seq(E.u8("byte"),E.offset(E.u32(),-8),"bytes")]),c=t.chunkSize,u=0,p=o,m=[];for(;p.length>0;){let _=p.slice(0,c),w=se.Buffer.alloc(c+16);s.encode({instruction:0,offset:u,bytes:_,bytesLength:0,bytesLengthPadding:0},w);let g=new xe().add({keys:[{pubkey:i.publicKey,isSigner:!0,isWritable:!0}],programId:n,data:w});m.push(lb(e,g,[r,i],{commitment:"confirmed"})),e._rpcEndpoint.includes("solana.com")&&await Mn(1e3/4),u+=c,p=p.slice(c)}await Promise.all(m);{let _=E.struct([E.u32("instruction")]),w=se.Buffer.alloc(_.span);_.encode({instruction:1},w);let g=new xe().add({keys:[{pubkey:i.publicKey,isSigner:!0,isWritable:!0},{pubkey:jo,isSigner:!1,isWritable:!1}],programId:n,data:w}),A="processed",I=await e.sendTransaction(g,[r,i],{preflightCommitment:A}),{context:R,value:T}=await e.confirmTransaction({signature:I,lastValidBlockHeight:g.lastValidBlockHeight,blockhash:g.recentBlockhash},A);if(T.err)throw new Error(`Transaction ${I} failed (${JSON.stringify(T)})`);for(;;){try{if(await e.getSlot({commitment:A})>R.slot)break}catch{}await new Promise(B=>setTimeout(B,Math.round(Nb/2)))}}return!0}};Bp.chunkSize=WO;var TP=new ce("BPFLoader2111111111111111111111111111111111");function KO(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ip,db;function qO(){if(db)return Ip;db=1;var t=Object.prototype.toString,e=Object.keys||function(i){var n=[];for(var o in i)n.push(o);return n};function r(i,n){var o,s,c,u,p,m,_;if(i===!0)return"true";if(i===!1)return"false";switch(typeof i){case"object":if(i===null)return null;if(i.toJSON&&typeof i.toJSON=="function")return r(i.toJSON(),n);if(_=t.call(i),_==="[object Array]"){for(c="[",s=i.length-1,o=0;o<s;o++)c+=r(i[o],!0)+",";return s>-1&&(c+=r(i[o],!0)),c+"]"}else if(_==="[object Object]"){for(u=e(i).sort(),s=u.length,c="",o=0;o<s;)p=u[o],m=r(i[p],!1),m!==void 0&&(c&&(c+=","),c+=JSON.stringify(p)+":"+m),o++;return"{"+c+"}"}else return JSON.stringify(i);case"function":case"undefined":return n?null:void 0;case"string":return JSON.stringify(i);default:return isFinite(i)?i:null}}return Ip=function(i){var n=r(i,!1);if(n!==void 0)return""+n},Ip}var HO=qO(),hb=KO(HO),Uo=32;function Rp(t){let e=0;for(;t>1;)t/=2,e++;return e}function GO(t){return t===0?1:(t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,t|=t>>32,t+1)}var zp=class{constructor(e,r,i,n,o){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=r,this.warmup=i,this.firstNormalEpoch=n,this.firstNormalSlot=o}getEpoch(e){return this.getEpochAndSlotIndex(e)[0]}getEpochAndSlotIndex(e){if(e<this.firstNormalSlot){let r=Rp(GO(e+Uo+1))-Rp(Uo)-1,i=this.getSlotsInEpoch(r),n=e-(i-Uo);return[r,n]}else{let r=e-this.firstNormalSlot,i=Math.floor(r/this.slotsPerEpoch),n=this.firstNormalEpoch+i,o=r%this.slotsPerEpoch;return[n,o]}}getFirstSlotInEpoch(e){return e<=this.firstNormalEpoch?(Math.pow(2,e)-1)*Uo:(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+Rp(Uo)):this.slotsPerEpoch}},JO=globalThis.fetch,Cp=class extends q_{constructor(e,r,i){let n=o=>{let s=K_(o,{autoconnect:!0,max_reconnects:5,reconnect:!0,reconnect_interval:1e3,...r});return"socket"in s?this.underlyingSocket=s.socket:this.underlyingSocket=s,s};super(n,e,r,i),this.underlyingSocket=void 0}call(...e){let r=this.underlyingSocket?.readyState;return r===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 "+r+")"))}notify(...e){let r=this.underlyingSocket?.readyState;return r===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 "+r+")"))}};function YO(t,e){let r;try{r=t.layout.decode(e)}catch(i){throw new Error("invalid instruction; "+i)}if(r.typeIndex!==t.index)throw new Error(`invalid account data; account type mismatch ${r.typeIndex} != ${t.index}`);return r}var pb=56,xc=class{constructor(e){this.key=void 0,this.state=void 0,this.key=e.key,this.state=e.state}isActive(){let e=BigInt("0xffffffffffffffff");return this.state.deactivationSlot===e}static deserialize(e){let r=YO(XO,e),i=e.length-pb;Ee(i>=0,"lookup table is invalid"),Ee(i%32===0,"lookup table is invalid");let n=i/32,{addresses:o}=E.struct([E.seq(ye(),n,"addresses")]).decode(e.slice(pb));return{deactivationSlot:r.deactivationSlot,lastExtendedSlot:r.lastExtendedSlot,lastExtendedSlotStartIndex:r.lastExtendedStartIndex,authority:r.authority.length!==0?new ce(r.authority[0]):void 0,addresses:o.map(s=>new ce(s))}}},XO={index:1,layout:E.struct([E.u32("typeIndex"),xi("deactivationSlot"),E.nu64("lastExtendedSlot"),E.u8("lastExtendedStartIndex"),E.u8(),E.seq(ye(),E.offset(E.u8(),-1),"authority")])},QO=/^[^:]+:\/\/([^:[]+|\[[^\]]+\])(:\d+)?(.*)/i;function eN(t){let e=t.match(QO);if(e==null)throw TypeError(`Failed to validate endpoint URL \`${t}\``);let[r,i,n,o]=e,s=t.startsWith("https:")?"wss:":"ws:",c=n==null?null:parseInt(n.slice(1),10),u=c==null?"":`:${c+1}`;return`${s}//${i}${u}${o}`}var Ke=bi(nc(ce),F(),t=>new ce(t)),$b=ic([F(),Ce("base64")]),Hp=bi(nc(se.Buffer),$b,t=>se.Buffer.from(t[0],"base64")),tN=30*1e3;function rN(t){if(/^https?:/.test(t)===!1)throw new TypeError("Endpoint URL must start with `http:` or `https:`.");return t}function $e(t){let e,r;if(typeof t=="string")e=t;else if(t){let{commitment:i,...n}=t;e=i,r=n}return{commitment:e,config:r}}function mb(t){return t.map(e=>"memcmp"in e?{...e,memcmp:{...e.memcmp,encoding:e.memcmp.encoding??"base58"}}:e)}function Lb(t){return Pt([D({jsonrpc:Ce("2.0"),id:F(),result:t}),D({jsonrpc:Ce("2.0"),id:F(),error:D({code:Un(),message:F(),data:ie(y_())})})])}var nN=Lb(Un());function me(t){return bi(Lb(t),nN,e=>"error"in e?e:{...e,result:W(e.result,t)})}function Xe(t){return me(D({context:D({slot:N()}),value:t}))}function Ac(t){return D({context:D({slot:N()}),value:t})}function kp(t,e){return t===0?new vc({header:e.header,staticAccountKeys:e.accountKeys.map(r=>new ce(r)),recentBlockhash:e.recentBlockhash,compiledInstructions:e.instructions.map(r=>({programIdIndex:r.programIdIndex,accountKeyIndexes:r.accounts,data:Rt.default.decode(r.data)})),addressTableLookups:e.addressTableLookups}):new gn(e)}var iN=D({foundation:N(),foundationTerm:N(),initial:N(),taper:N(),terminal:N()}),oN=me(H(G(D({epoch:N(),effectiveSlot:N(),amount:N(),postBalance:N(),commission:ie(G(N()))})))),sN=H(D({slot:N(),prioritizationFee:N()})),aN=D({total:N(),validator:N(),foundation:N(),epoch:N()}),cN=D({epoch:N(),slotIndex:N(),slotsInEpoch:N(),absoluteSlot:N(),blockHeight:ie(N()),transactionCount:ie(N())}),uN=D({slotsPerEpoch:N(),leaderScheduleSlotOffset:N(),warmup:dr(),firstNormalEpoch:N(),firstNormalSlot:N()}),lN=ap(F(),H(N())),Zn=G(Pt([D({}),F()])),fN=D({err:Zn}),dN=Ce("receivedSignature"),hN=D({"solana-core":F(),"feature-set":ie(N())}),pN=D({program:F(),programId:Ke,parsed:Un()}),mN=D({programId:Ke,accounts:H(Ke),data:F()}),gb=Xe(D({err:G(Pt([D({}),F()])),logs:G(H(F())),accounts:ie(G(H(G(D({executable:dr(),owner:F(),lamports:N(),data:H(F()),rentEpoch:ie(N())}))))),unitsConsumed:ie(N()),returnData:ie(G(D({programId:F(),data:ic([F(),Ce("base64")])}))),innerInstructions:ie(G(H(D({index:N(),instructions:H(Pt([pN,mN]))}))))})),gN=Xe(D({byIdentity:ap(F(),H(N())),range:D({firstSlot:N(),lastSlot:N()})}));function yN(t,e,r,i,n,o){let s=r||JO,c;o!=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 u;return i&&(u=async(m,_)=>{let w=await new Promise((g,A)=>{try{i(m,_,(I,R)=>g([I,R]))}catch(I){A(I)}});return await s(...w)}),new Rb.default(async(m,_)=>{let w={method:"POST",body:m,agent:c,headers:Object.assign({"Content-Type":"application/json"},e||{},yT)};try{let g=5,A,I=500;for(;u?A=await u(t,w):A=await s(t,w),!(A.status!==429||n===!0||(g-=1,g===0));)console.error(`Server responded with ${A.status} ${A.statusText}. Retrying after ${I}ms delay...`),await Mn(I),I*=2;let R=await A.text();A.ok?_(null,R):_(new Error(`${A.status} ${A.statusText}: ${R}`))}catch(g){g instanceof Error&&_(g)}},{})}function _N(t){return(e,r)=>new Promise((i,n)=>{t.request(e,r,(o,s)=>{if(o){n(o);return}i(s)})})}function bN(t){return e=>new Promise((r,i)=>{e.length===0&&r([]);let n=e.map(o=>t.request(o.methodName,o.args));t.request(n,(o,s)=>{if(o){i(o);return}r(s)})})}var vN=me(iN),wN=me(aN),xN=me(sN),SN=me(cN),EN=me(uN),IN=me(lN),RN=me(N()),kN=Xe(D({total:N(),circulating:N(),nonCirculating:N(),nonCirculatingAccounts:H(Ke)})),Up=D({amount:F(),uiAmount:G(N()),decimals:N(),uiAmountString:ie(F())}),AN=Xe(H(D({address:Ke,amount:F(),uiAmount:G(N()),decimals:N(),uiAmountString:ie(F())}))),ON=Xe(H(D({pubkey:Ke,account:D({executable:dr(),owner:Ke,lamports:N(),data:Hp,rentEpoch:N()})}))),Dp=D({program:F(),parsed:Un(),space:N()}),NN=Xe(H(D({pubkey:Ke,account:D({executable:dr(),owner:Ke,lamports:N(),data:Dp,rentEpoch:N()})}))),TN=Xe(H(D({lamports:N(),address:Ke}))),Zo=D({executable:dr(),owner:Ke,lamports:N(),data:Hp,rentEpoch:N()}),$N=D({pubkey:Ke,account:Zo}),LN=bi(Pt([nc(se.Buffer),Dp]),Pt([$b,Dp]),t=>Array.isArray(t)?W(t,Hp):t),Mp=D({executable:dr(),owner:Ke,lamports:N(),data:LN,rentEpoch:N()}),PN=D({pubkey:Ke,account:Mp}),BN=D({state:Pt([Ce("active"),Ce("inactive"),Ce("activating"),Ce("deactivating")]),active:N(),inactive:N()}),zN=me(H(D({signature:F(),slot:N(),err:Zn,memo:G(F()),blockTime:ie(G(N()))}))),CN=me(H(D({signature:F(),slot:N(),err:Zn,memo:G(F()),blockTime:ie(G(N()))}))),UN=D({subscription:N(),result:Ac(Zo)}),DN=D({pubkey:Ke,account:Zo}),MN=D({subscription:N(),result:Ac(DN)}),jN=D({parent:N(),slot:N(),root:N()}),FN=D({subscription:N(),result:jN}),ZN=Pt([D({type:Pt([Ce("firstShredReceived"),Ce("completed"),Ce("optimisticConfirmation"),Ce("root")]),slot:N(),timestamp:N()}),D({type:Ce("createdBank"),parent:N(),slot:N(),timestamp:N()}),D({type:Ce("frozen"),slot:N(),timestamp:N(),stats:D({numTransactionEntries:N(),numSuccessfulTransactions:N(),numFailedTransactions:N(),maxTransactionsPerEntry:N()})}),D({type:Ce("dead"),slot:N(),timestamp:N(),err:F()})]),VN=D({subscription:N(),result:ZN}),WN=D({subscription:N(),result:Ac(Pt([fN,dN]))}),KN=D({subscription:N(),result:N()}),qN=D({pubkey:F(),gossip:G(F()),tpu:G(F()),rpc:G(F()),version:G(F())}),yb=D({votePubkey:F(),nodePubkey:F(),activatedStake:N(),epochVoteAccount:dr(),epochCredits:H(ic([N(),N(),N()])),commission:N(),lastVote:N(),rootSlot:G(N())}),HN=me(D({current:H(yb),delinquent:H(yb)})),GN=Pt([Ce("processed"),Ce("confirmed"),Ce("finalized")]),JN=D({slot:N(),confirmations:G(N()),err:Zn,confirmationStatus:ie(GN)}),YN=Xe(H(G(JN))),XN=me(N()),Pb=D({accountKey:Ke,writableIndexes:H(N()),readonlyIndexes:H(N())}),Gp=D({signatures:H(F()),message:D({accountKeys:H(F()),header:D({numRequiredSignatures:N(),numReadonlySignedAccounts:N(),numReadonlyUnsignedAccounts:N()}),instructions:H(D({accounts:H(N()),data:F(),programIdIndex:N()})),recentBlockhash:F(),addressTableLookups:ie(H(Pb))})}),Bb=D({pubkey:Ke,signer:dr(),writable:dr(),source:ie(Pt([Ce("transaction"),Ce("lookupTable")]))}),zb=D({accountKeys:H(Bb),signatures:H(F())}),Cb=D({parsed:Un(),program:F(),programId:Ke}),Ub=D({accounts:H(Ke),data:F(),programId:Ke}),QN=Pt([Ub,Cb]),eT=Pt([D({parsed:Un(),program:F(),programId:F()}),D({accounts:H(F()),data:F(),programId:F()})]),Db=bi(QN,eT,t=>"accounts"in t?W(t,Ub):W(t,Cb)),Mb=D({signatures:H(F()),message:D({accountKeys:H(Bb),instructions:H(Db),recentBlockhash:F(),addressTableLookups:ie(G(H(Pb)))})}),Sc=D({accountIndex:N(),mint:F(),owner:ie(F()),programId:ie(F()),uiTokenAmount:Up}),jb=D({writable:H(Ke),readonly:H(Ke)}),Oc=D({err:Zn,fee:N(),innerInstructions:ie(G(H(D({index:N(),instructions:H(D({accounts:H(N()),data:F(),programIdIndex:N()}))})))),preBalances:H(N()),postBalances:H(N()),logMessages:ie(G(H(F()))),preTokenBalances:ie(G(H(Sc))),postTokenBalances:ie(G(H(Sc))),loadedAddresses:ie(jb),computeUnitsConsumed:ie(N())}),Jp=D({err:Zn,fee:N(),innerInstructions:ie(G(H(D({index:N(),instructions:H(Db)})))),preBalances:H(N()),postBalances:H(N()),logMessages:ie(G(H(F()))),preTokenBalances:ie(G(H(Sc))),postTokenBalances:ie(G(H(Sc))),loadedAddresses:ie(jb),computeUnitsConsumed:ie(N())}),Ei=Pt([Ce(0),Ce("legacy")]),Vn=D({pubkey:F(),lamports:N(),postBalance:G(N()),rewardType:G(F()),commission:ie(G(N()))}),tT=me(G(D({blockhash:F(),previousBlockhash:F(),parentSlot:N(),transactions:H(D({transaction:Gp,meta:G(Oc),version:ie(Ei)})),rewards:ie(H(Vn)),blockTime:G(N()),blockHeight:G(N())}))),rT=me(G(D({blockhash:F(),previousBlockhash:F(),parentSlot:N(),rewards:ie(H(Vn)),blockTime:G(N()),blockHeight:G(N())}))),nT=me(G(D({blockhash:F(),previousBlockhash:F(),parentSlot:N(),transactions:H(D({transaction:zb,meta:G(Oc),version:ie(Ei)})),rewards:ie(H(Vn)),blockTime:G(N()),blockHeight:G(N())}))),iT=me(G(D({blockhash:F(),previousBlockhash:F(),parentSlot:N(),transactions:H(D({transaction:Mb,meta:G(Jp),version:ie(Ei)})),rewards:ie(H(Vn)),blockTime:G(N()),blockHeight:G(N())}))),oT=me(G(D({blockhash:F(),previousBlockhash:F(),parentSlot:N(),transactions:H(D({transaction:zb,meta:G(Jp),version:ie(Ei)})),rewards:ie(H(Vn)),blockTime:G(N()),blockHeight:G(N())}))),sT=me(G(D({blockhash:F(),previousBlockhash:F(),parentSlot:N(),rewards:ie(H(Vn)),blockTime:G(N()),blockHeight:G(N())}))),aT=me(G(D({blockhash:F(),previousBlockhash:F(),parentSlot:N(),transactions:H(D({transaction:Gp,meta:G(Oc)})),rewards:ie(H(Vn)),blockTime:G(N())}))),_b=me(G(D({blockhash:F(),previousBlockhash:F(),parentSlot:N(),signatures:H(F()),blockTime:G(N())}))),Ap=me(G(D({slot:N(),meta:G(Oc),blockTime:ie(G(N())),transaction:Gp,version:ie(Ei)}))),hc=me(G(D({slot:N(),transaction:Mb,meta:G(Jp),blockTime:ie(G(N())),version:ie(Ei)}))),cT=Xe(D({blockhash:F(),lastValidBlockHeight:N()})),uT=Xe(dr()),lT=D({slot:N(),numTransactions:N(),numSlots:N(),samplePeriodSecs:N()}),fT=me(H(lT)),dT=Xe(G(D({feeCalculator:D({lamportsPerSignature:N()})}))),hT=me(F()),pT=me(F()),mT=D({err:Zn,logs:H(F()),signature:F()}),gT=D({result:Ac(mT),subscription:N()}),yT={"solana-client":"js/1.0.0-maintenance"},Ec=class{constructor(e,r){this._commitment=void 0,this._confirmTransactionInitialTimeout=void 0,this._rpcEndpoint=void 0,this._rpcWsEndpoint=void 0,this._rpcClient=void 0,this._rpcRequest=void 0,this._rpcBatchRequest=void 0,this._rpcWebSocket=void 0,this._rpcWebSocketConnected=!1,this._rpcWebSocketHeartbeat=null,this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketGeneration=0,this._disableBlockhashCaching=!1,this._pollingBlockhash=!1,this._blockhashInfo={latestBlockhash:null,lastFetch:0,transactionSignatures:[],simulatedSignatures:[]},this._nextClientSubscriptionId=0,this._subscriptionDisposeFunctionsByClientSubscriptionId={},this._subscriptionHashByClientSubscriptionId={},this._subscriptionStateChangeCallbacksByHash={},this._subscriptionCallbacksByServerSubscriptionId={},this._subscriptionsByHash={},this._subscriptionsAutoDisposedByRpc=new Set,this.getBlockHeight=(()=>{let p={};return async m=>{let{commitment:_,config:w}=$e(m),g=this._buildArgs([],_,void 0,w),A=hb(g);return p[A]=p[A]??(async()=>{try{let I=await this._rpcRequest("getBlockHeight",g),R=W(I,me(N()));if("error"in R)throw new re(R.error,"failed to get block height information");return R.result}finally{delete p[A]}})(),await p[A]}})();let i,n,o,s,c,u;r&&typeof r=="string"?this._commitment=r:r&&(this._commitment=r.commitment,this._confirmTransactionInitialTimeout=r.confirmTransactionInitialTimeout,i=r.wsEndpoint,n=r.httpHeaders,o=r.fetch,s=r.fetchMiddleware,c=r.disableRetryOnRateLimit,u=r.httpAgent),this._rpcEndpoint=rN(e),this._rpcWsEndpoint=i||eN(e),this._rpcClient=yN(e,n,o,s,c,u),this._rpcRequest=_N(this._rpcClient),this._rpcBatchRequest=bN(this._rpcClient),this._rpcWebSocket=new Cp(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,r){let{commitment:i,config:n}=$e(r),o=this._buildArgs([e.toBase58()],i,void 0,n),s=await this._rpcRequest("getBalance",o),c=W(s,Xe(N()));if("error"in c)throw new re(c.error,`failed to get balance for ${e.toBase58()}`);return c.result}async getBalance(e,r){return await this.getBalanceAndContext(e,r).then(i=>i.value).catch(i=>{throw new Error("failed to get balance of account "+e.toBase58()+": "+i)})}async getBlockTime(e){let r=await this._rpcRequest("getBlockTime",[e]),i=W(r,me(G(N())));if("error"in i)throw new re(i.error,`failed to get block time for slot ${e}`);return i.result}async getMinimumLedgerSlot(){let e=await this._rpcRequest("minimumLedgerSlot",[]),r=W(e,me(N()));if("error"in r)throw new re(r.error,"failed to get minimum ledger slot");return r.result}async getFirstAvailableBlock(){let e=await this._rpcRequest("getFirstAvailableBlock",[]),r=W(e,RN);if("error"in r)throw new re(r.error,"failed to get first available block");return r.result}async getSupply(e){let r={};typeof e=="string"?r={commitment:e}:e?r={...e,commitment:e&&e.commitment||this.commitment}:r={commitment:this.commitment};let i=await this._rpcRequest("getSupply",[r]),n=W(i,kN);if("error"in n)throw new re(n.error,"failed to get supply");return n.result}async getTokenSupply(e,r){let i=this._buildArgs([e.toBase58()],r),n=await this._rpcRequest("getTokenSupply",i),o=W(n,Xe(Up));if("error"in o)throw new re(o.error,"failed to get token supply");return o.result}async getTokenAccountBalance(e,r){let i=this._buildArgs([e.toBase58()],r),n=await this._rpcRequest("getTokenAccountBalance",i),o=W(n,Xe(Up));if("error"in o)throw new re(o.error,"failed to get token account balance");return o.result}async getTokenAccountsByOwner(e,r,i){let{commitment:n,config:o}=$e(i),s=[e.toBase58()];"mint"in r?s.push({mint:r.mint.toBase58()}):s.push({programId:r.programId.toBase58()});let c=this._buildArgs(s,n,"base64",o),u=await this._rpcRequest("getTokenAccountsByOwner",c),p=W(u,ON);if("error"in p)throw new re(p.error,`failed to get token accounts owned by account ${e.toBase58()}`);return p.result}async getParsedTokenAccountsByOwner(e,r,i){let n=[e.toBase58()];"mint"in r?n.push({mint:r.mint.toBase58()}):n.push({programId:r.programId.toBase58()});let o=this._buildArgs(n,i,"jsonParsed"),s=await this._rpcRequest("getTokenAccountsByOwner",o),c=W(s,NN);if("error"in c)throw new re(c.error,`failed to get token accounts owned by account ${e.toBase58()}`);return c.result}async getLargestAccounts(e){let r={...e,commitment:e&&e.commitment||this.commitment},i=r.filter||r.commitment?[r]:[],n=await this._rpcRequest("getLargestAccounts",i),o=W(n,TN);if("error"in o)throw new re(o.error,"failed to get largest accounts");return o.result}async getTokenLargestAccounts(e,r){let i=this._buildArgs([e.toBase58()],r),n=await this._rpcRequest("getTokenLargestAccounts",i),o=W(n,AN);if("error"in o)throw new re(o.error,"failed to get token largest accounts");return o.result}async getAccountInfoAndContext(e,r){let{commitment:i,config:n}=$e(r),o=this._buildArgs([e.toBase58()],i,"base64",n),s=await this._rpcRequest("getAccountInfo",o),c=W(s,Xe(G(Zo)));if("error"in c)throw new re(c.error,`failed to get info about account ${e.toBase58()}`);return c.result}async getParsedAccountInfo(e,r){let{commitment:i,config:n}=$e(r),o=this._buildArgs([e.toBase58()],i,"jsonParsed",n),s=await this._rpcRequest("getAccountInfo",o),c=W(s,Xe(G(Mp)));if("error"in c)throw new re(c.error,`failed to get info about account ${e.toBase58()}`);return c.result}async getAccountInfo(e,r){try{return(await this.getAccountInfoAndContext(e,r)).value}catch(i){throw new Error("failed to get info about account "+e.toBase58()+": "+i)}}async getMultipleParsedAccounts(e,r){let{commitment:i,config:n}=$e(r),o=e.map(p=>p.toBase58()),s=this._buildArgs([o],i,"jsonParsed",n),c=await this._rpcRequest("getMultipleAccounts",s),u=W(c,Xe(H(G(Mp))));if("error"in u)throw new re(u.error,`failed to get info for accounts ${o}`);return u.result}async getMultipleAccountsInfoAndContext(e,r){let{commitment:i,config:n}=$e(r),o=e.map(p=>p.toBase58()),s=this._buildArgs([o],i,"base64",n),c=await this._rpcRequest("getMultipleAccounts",s),u=W(c,Xe(H(G(Zo))));if("error"in u)throw new re(u.error,`failed to get info for accounts ${o}`);return u.result}async getMultipleAccountsInfo(e,r){return(await this.getMultipleAccountsInfoAndContext(e,r)).value}async getStakeActivation(e,r,i){let{commitment:n,config:o}=$e(r),s=this._buildArgs([e.toBase58()],n,void 0,{...o,epoch:i??o?.epoch}),c=await this._rpcRequest("getStakeActivation",s),u=W(c,me(BN));if("error"in u)throw new re(u.error,`failed to get Stake Activation ${e.toBase58()}`);return u.result}async getProgramAccounts(e,r){let{commitment:i,config:n}=$e(r),{encoding:o,...s}=n||{},c=this._buildArgs([e.toBase58()],i,o||"base64",{...s,...s.filters?{filters:mb(s.filters)}:null}),u=await this._rpcRequest("getProgramAccounts",c),p=H($N),m=s.withContext===!0?W(u,Xe(p)):W(u,me(p));if("error"in m)throw new re(m.error,`failed to get accounts owned by program ${e.toBase58()}`);return m.result}async getParsedProgramAccounts(e,r){let{commitment:i,config:n}=$e(r),o=this._buildArgs([e.toBase58()],i,"jsonParsed",n),s=await this._rpcRequest("getProgramAccounts",o),c=W(s,me(H(PN)));if("error"in c)throw new re(c.error,`failed to get accounts owned by program ${e.toBase58()}`);return c.result}async confirmTransaction(e,r){let i;if(typeof e=="string")i=e;else{let o=e;if(o.abortSignal?.aborted)return Promise.reject(o.abortSignal.reason);i=o.signature}let n;try{n=Rt.default.decode(i)}catch{throw new Error("signature must be base58 encoded: "+i)}return Ee(n.length===64,"signature has invalid length"),typeof e=="string"?await this.confirmTransactionUsingLegacyTimeoutStrategy({commitment:r||this.commitment,signature:i}):"lastValidBlockHeight"in e?await this.confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:r||this.commitment,strategy:e}):await this.confirmTransactionUsingDurableNonceStrategy({commitment:r||this.commitment,strategy:e})}getCancellationPromise(e){return new Promise((r,i)=>{e!=null&&(e.aborted?i(e.reason):e.addEventListener("abort",()=>{i(e.reason)}))})}getTransactionConfirmationPromise({commitment:e,signature:r}){let i,n,o=!1,s=new Promise((u,p)=>{try{i=this.onSignature(r,(_,w)=>{i=void 0;let g={context:w,value:_};u({__type:hn.PROCESSED,response:g})},e);let m=new Promise(_=>{i==null?_():n=this._onSubscriptionStateChange(i,w=>{w==="subscribed"&&_()})});(async()=>{if(await m,o)return;let _=await this.getSignatureStatus(r);if(o||_==null)return;let{context:w,value:g}=_;if(g!=null)if(g?.err)p(g.err);else{switch(e){case"confirmed":case"single":case"singleGossip":{if(g.confirmationStatus==="processed")return;break}case"finalized":case"max":case"root":{if(g.confirmationStatus==="processed"||g.confirmationStatus==="confirmed")return;break}case"processed":case"recent":}o=!0,u({__type:hn.PROCESSED,response:{context:w,value:g}})}})()}catch(m){p(m)}});return{abortConfirmation:()=>{n&&(n(),n=void 0),i!=null&&(this.removeSignatureListener(i),i=void 0)},confirmationPromise:s}}async confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:e,strategy:{abortSignal:r,lastValidBlockHeight:i,signature:n}}){let o=!1,s=new Promise(_=>{let w=async()=>{try{return await this.getBlockHeight(e)}catch{return-1}};(async()=>{let g=await w();if(!o){for(;g<=i;)if(await Mn(1e3),o||(g=await w(),o))return;_({__type:hn.BLOCKHEIGHT_EXCEEDED})}})()}),{abortConfirmation:c,confirmationPromise:u}=this.getTransactionConfirmationPromise({commitment:e,signature:n}),p=this.getCancellationPromise(r),m;try{let _=await Promise.race([p,u,s]);if(_.__type===hn.PROCESSED)m=_.response;else throw new yc(n)}finally{o=!0,c()}return m}async confirmTransactionUsingDurableNonceStrategy({commitment:e,strategy:{abortSignal:r,minContextSlot:i,nonceAccountPubkey:n,nonceValue:o,signature:s}}){let c=!1,u=new Promise(g=>{let A=o,I=null,R=async()=>{try{let{context:T,value:B}=await this.getNonceAndContext(n,{commitment:e,minContextSlot:i});return I=T.slot,B?.nonce}catch{return A}};(async()=>{if(A=await R(),!c)for(;;){if(o!==A){g({__type:hn.NONCE_INVALID,slotInWhichNonceDidAdvance:I});return}if(await Mn(2e3),c||(A=await R(),c))return}})()}),{abortConfirmation:p,confirmationPromise:m}=this.getTransactionConfirmationPromise({commitment:e,signature:s}),_=this.getCancellationPromise(r),w;try{let g=await Promise.race([_,m,u]);if(g.__type===hn.PROCESSED)w=g.response;else{let A;for(;;){let I=await this.getSignatureStatus(s);if(I==null)break;if(I.context.slot<(g.slotInWhichNonceDidAdvance??i)){await Mn(400);continue}A=I;break}if(A?.value){let I=e||"finalized",{confirmationStatus:R}=A.value;switch(I){case"processed":case"recent":if(R!=="processed"&&R!=="confirmed"&&R!=="finalized")throw new jn(s);break;case"confirmed":case"single":case"singleGossip":if(R!=="confirmed"&&R!=="finalized")throw new jn(s);break;case"finalized":case"max":case"root":if(R!=="finalized")throw new jn(s);break;default:}w={context:A.context,value:{err:A.value.err}}}else throw new jn(s)}}finally{c=!0,p()}return w}async confirmTransactionUsingLegacyTimeoutStrategy({commitment:e,signature:r}){let i,n=new Promise(u=>{let p=this._confirmTransactionInitialTimeout||6e4;switch(e){case"processed":case"recent":case"single":case"confirmed":case"singleGossip":{p=this._confirmTransactionInitialTimeout||3e4;break}}i=setTimeout(()=>u({__type:hn.TIMED_OUT,timeoutMs:p}),p)}),{abortConfirmation:o,confirmationPromise:s}=this.getTransactionConfirmationPromise({commitment:e,signature:r}),c;try{let u=await Promise.race([s,n]);if(u.__type===hn.PROCESSED)c=u.response;else throw new _c(r,u.timeoutMs/1e3)}finally{clearTimeout(i),o()}return c}async getClusterNodes(){let e=await this._rpcRequest("getClusterNodes",[]),r=W(e,me(H(qN)));if("error"in r)throw new re(r.error,"failed to get cluster nodes");return r.result}async getVoteAccounts(e){let r=this._buildArgs([],e),i=await this._rpcRequest("getVoteAccounts",r),n=W(i,HN);if("error"in n)throw new re(n.error,"failed to get vote accounts");return n.result}async getSlot(e){let{commitment:r,config:i}=$e(e),n=this._buildArgs([],r,void 0,i),o=await this._rpcRequest("getSlot",n),s=W(o,me(N()));if("error"in s)throw new re(s.error,"failed to get slot");return s.result}async getSlotLeader(e){let{commitment:r,config:i}=$e(e),n=this._buildArgs([],r,void 0,i),o=await this._rpcRequest("getSlotLeader",n),s=W(o,me(F()));if("error"in s)throw new re(s.error,"failed to get slot leader");return s.result}async getSlotLeaders(e,r){let i=[e,r],n=await this._rpcRequest("getSlotLeaders",i),o=W(n,me(H(Ke)));if("error"in o)throw new re(o.error,"failed to get slot leaders");return o.result}async getSignatureStatus(e,r){let{context:i,value:n}=await this.getSignatureStatuses([e],r);Ee(n.length===1);let o=n[0];return{context:i,value:o}}async getSignatureStatuses(e,r){let i=[e];r&&i.push(r);let n=await this._rpcRequest("getSignatureStatuses",i),o=W(n,YN);if("error"in o)throw new re(o.error,"failed to get signature status");return o.result}async getTransactionCount(e){let{commitment:r,config:i}=$e(e),n=this._buildArgs([],r,void 0,i),o=await this._rpcRequest("getTransactionCount",n),s=W(o,me(N()));if("error"in s)throw new re(s.error,"failed to get transaction count");return s.result}async getTotalSupply(e){return(await this.getSupply({commitment:e,excludeNonCirculatingAccountsList:!0})).value.total}async getInflationGovernor(e){let r=this._buildArgs([],e),i=await this._rpcRequest("getInflationGovernor",r),n=W(i,vN);if("error"in n)throw new re(n.error,"failed to get inflation");return n.result}async getInflationReward(e,r,i){let{commitment:n,config:o}=$e(i),s=this._buildArgs([e.map(p=>p.toBase58())],n,void 0,{...o,epoch:r??o?.epoch}),c=await this._rpcRequest("getInflationReward",s),u=W(c,oN);if("error"in u)throw new re(u.error,"failed to get inflation reward");return u.result}async getInflationRate(){let e=await this._rpcRequest("getInflationRate",[]),r=W(e,wN);if("error"in r)throw new re(r.error,"failed to get inflation rate");return r.result}async getEpochInfo(e){let{commitment:r,config:i}=$e(e),n=this._buildArgs([],r,void 0,i),o=await this._rpcRequest("getEpochInfo",n),s=W(o,SN);if("error"in s)throw new re(s.error,"failed to get epoch info");return s.result}async getEpochSchedule(){let e=await this._rpcRequest("getEpochSchedule",[]),r=W(e,EN);if("error"in r)throw new re(r.error,"failed to get epoch schedule");let i=r.result;return new zp(i.slotsPerEpoch,i.leaderScheduleSlotOffset,i.warmup,i.firstNormalEpoch,i.firstNormalSlot)}async getLeaderSchedule(){let e=await this._rpcRequest("getLeaderSchedule",[]),r=W(e,IN);if("error"in r)throw new re(r.error,"failed to get leader schedule");return r.result}async getMinimumBalanceForRentExemption(e,r){let i=this._buildArgs([e],r),n=await this._rpcRequest("getMinimumBalanceForRentExemption",i),o=W(n,XN);return"error"in o?(console.warn("Unable to fetch minimum balance for rent exemption"),0):o.result}async getRecentBlockhashAndContext(e){let{context:r,value:{blockhash:i}}=await this.getLatestBlockhashAndContext(e);return{context:r,value:{blockhash:i,feeCalculator:{get lamportsPerSignature(){throw new Error("The capability to fetch `lamportsPerSignature` using the `getRecentBlockhash` API is no longer offered by the network. Use the `getFeeForMessage` API to obtain the fee for a given message.")},toJSON(){return{}}}}}}async getRecentPerformanceSamples(e){let r=await this._rpcRequest("getRecentPerformanceSamples",e?[e]:[]),i=W(r,fT);if("error"in i)throw new re(i.error,"failed to get recent performance samples");return i.result}async getFeeCalculatorForBlockhash(e,r){let i=this._buildArgs([e],r),n=await this._rpcRequest("getFeeCalculatorForBlockhash",i),o=W(n,dT);if("error"in o)throw new re(o.error,"failed to get fee calculator");let{context:s,value:c}=o.result;return{context:s,value:c!==null?c.feeCalculator:null}}async getFeeForMessage(e,r){let i=_e(e.serialize()).toString("base64"),n=this._buildArgs([i],r),o=await this._rpcRequest("getFeeForMessage",n),s=W(o,Xe(G(N())));if("error"in s)throw new re(s.error,"failed to get fee for message");if(s.result===null)throw new Error("invalid blockhash");return s.result}async getRecentPrioritizationFees(e){let r=e?.lockedWritableAccounts?.map(s=>s.toBase58()),i=r?.length?[r]:[],n=await this._rpcRequest("getRecentPrioritizationFees",i),o=W(n,xN);if("error"in o)throw new re(o.error,"failed to get recent prioritization fees");return o.result}async getRecentBlockhash(e){try{return(await this.getRecentBlockhashAndContext(e)).value}catch(r){throw new Error("failed to get recent blockhash: "+r)}}async getLatestBlockhash(e){try{return(await this.getLatestBlockhashAndContext(e)).value}catch(r){throw new Error("failed to get recent blockhash: "+r)}}async getLatestBlockhashAndContext(e){let{commitment:r,config:i}=$e(e),n=this._buildArgs([],r,void 0,i),o=await this._rpcRequest("getLatestBlockhash",n),s=W(o,cT);if("error"in s)throw new re(s.error,"failed to get latest blockhash");return s.result}async isBlockhashValid(e,r){let{commitment:i,config:n}=$e(r),o=this._buildArgs([e],i,void 0,n),s=await this._rpcRequest("isBlockhashValid",o),c=W(s,uT);if("error"in c)throw new re(c.error,"failed to determine if the blockhash `"+e+"`is valid");return c.result}async getVersion(){let e=await this._rpcRequest("getVersion",[]),r=W(e,me(hN));if("error"in r)throw new re(r.error,"failed to get version");return r.result}async getGenesisHash(){let e=await this._rpcRequest("getGenesisHash",[]),r=W(e,me(F()));if("error"in r)throw new re(r.error,"failed to get genesis hash");return r.result}async getBlock(e,r){let{commitment:i,config:n}=$e(r),o=this._buildArgsAtLeastConfirmed([e],i,void 0,n),s=await this._rpcRequest("getBlock",o);try{switch(n?.transactionDetails){case"accounts":{let c=W(s,nT);if("error"in c)throw c.error;return c.result}case"none":{let c=W(s,rT);if("error"in c)throw c.error;return c.result}default:{let c=W(s,tT);if("error"in c)throw c.error;let{result:u}=c;return u?{...u,transactions:u.transactions.map(({transaction:p,meta:m,version:_})=>({meta:m,transaction:{...p,message:kp(_,p.message)},version:_}))}:null}}}catch(c){throw new re(c,"failed to get confirmed block")}}async getParsedBlock(e,r){let{commitment:i,config:n}=$e(r),o=this._buildArgsAtLeastConfirmed([e],i,"jsonParsed",n),s=await this._rpcRequest("getBlock",o);try{switch(n?.transactionDetails){case"accounts":{let c=W(s,oT);if("error"in c)throw c.error;return c.result}case"none":{let c=W(s,sT);if("error"in c)throw c.error;return c.result}default:{let c=W(s,iT);if("error"in c)throw c.error;return c.result}}}catch(c){throw new re(c,"failed to get block")}}async getBlockProduction(e){let r,i;if(typeof e=="string")i=e;else if(e){let{commitment:c,...u}=e;i=c,r=u}let n=this._buildArgs([],i,"base64",r),o=await this._rpcRequest("getBlockProduction",n),s=W(o,gN);if("error"in s)throw new re(s.error,"failed to get block production information");return s.result}async getTransaction(e,r){let{commitment:i,config:n}=$e(r),o=this._buildArgsAtLeastConfirmed([e],i,void 0,n),s=await this._rpcRequest("getTransaction",o),c=W(s,Ap);if("error"in c)throw new re(c.error,"failed to get transaction");let u=c.result;return u&&{...u,transaction:{...u.transaction,message:kp(u.version,u.transaction.message)}}}async getParsedTransaction(e,r){let{commitment:i,config:n}=$e(r),o=this._buildArgsAtLeastConfirmed([e],i,"jsonParsed",n),s=await this._rpcRequest("getTransaction",o),c=W(s,hc);if("error"in c)throw new re(c.error,"failed to get transaction");return c.result}async getParsedTransactions(e,r){let{commitment:i,config:n}=$e(r),o=e.map(u=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([u],i,"jsonParsed",n)}));return(await this._rpcBatchRequest(o)).map(u=>{let p=W(u,hc);if("error"in p)throw new re(p.error,"failed to get transactions");return p.result})}async getTransactions(e,r){let{commitment:i,config:n}=$e(r),o=e.map(u=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([u],i,void 0,n)}));return(await this._rpcBatchRequest(o)).map(u=>{let p=W(u,Ap);if("error"in p)throw new re(p.error,"failed to get transactions");let m=p.result;return m&&{...m,transaction:{...m.transaction,message:kp(m.version,m.transaction.message)}}})}async getConfirmedBlock(e,r){let i=this._buildArgsAtLeastConfirmed([e],r),n=await this._rpcRequest("getBlock",i),o=W(n,aT);if("error"in o)throw new re(o.error,"failed to get confirmed block");let s=o.result;if(!s)throw new Error("Confirmed block "+e+" not found");let c={...s,transactions:s.transactions.map(({transaction:u,meta:p})=>{let m=new gn(u.message);return{meta:p,transaction:{...u,message:m}}})};return{...c,transactions:c.transactions.map(({transaction:u,meta:p})=>({meta:p,transaction:xe.populate(u.message,u.signatures)}))}}async getBlocks(e,r,i){let n=this._buildArgsAtLeastConfirmed(r!==void 0?[e,r]:[e],i),o=await this._rpcRequest("getBlocks",n),s=W(o,me(H(N())));if("error"in s)throw new re(s.error,"failed to get blocks");return s.result}async getBlockSignatures(e,r){let i=this._buildArgsAtLeastConfirmed([e],r,void 0,{transactionDetails:"signatures",rewards:!1}),n=await this._rpcRequest("getBlock",i),o=W(n,_b);if("error"in o)throw new re(o.error,"failed to get block");let s=o.result;if(!s)throw new Error("Block "+e+" not found");return s}async getConfirmedBlockSignatures(e,r){let i=this._buildArgsAtLeastConfirmed([e],r,void 0,{transactionDetails:"signatures",rewards:!1}),n=await this._rpcRequest("getBlock",i),o=W(n,_b);if("error"in o)throw new re(o.error,"failed to get confirmed block");let s=o.result;if(!s)throw new Error("Confirmed block "+e+" not found");return s}async getConfirmedTransaction(e,r){let i=this._buildArgsAtLeastConfirmed([e],r),n=await this._rpcRequest("getTransaction",i),o=W(n,Ap);if("error"in o)throw new re(o.error,"failed to get transaction");let s=o.result;if(!s)return s;let c=new gn(s.transaction.message),u=s.transaction.signatures;return{...s,transaction:xe.populate(c,u)}}async getParsedConfirmedTransaction(e,r){let i=this._buildArgsAtLeastConfirmed([e],r,"jsonParsed"),n=await this._rpcRequest("getTransaction",i),o=W(n,hc);if("error"in o)throw new re(o.error,"failed to get confirmed transaction");return o.result}async getParsedConfirmedTransactions(e,r){let i=e.map(s=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([s],r,"jsonParsed")}));return(await this._rpcBatchRequest(i)).map(s=>{let c=W(s,hc);if("error"in c)throw new re(c.error,"failed to get confirmed transactions");return c.result})}async getConfirmedSignaturesForAddress(e,r,i){let n={},o=await this.getFirstAvailableBlock();for(;!("until"in n)&&(r--,!(r<=0||r<o));)try{let u=await this.getConfirmedBlockSignatures(r,"finalized");u.signatures.length>0&&(n.until=u.signatures[u.signatures.length-1].toString())}catch(u){if(u instanceof Error&&u.message.includes("skipped"))continue;throw u}let s=await this.getSlot("finalized");for(;!("before"in n)&&(i++,!(i>s));)try{let u=await this.getConfirmedBlockSignatures(i);u.signatures.length>0&&(n.before=u.signatures[u.signatures.length-1].toString())}catch(u){if(u instanceof Error&&u.message.includes("skipped"))continue;throw u}return(await this.getConfirmedSignaturesForAddress2(e,n)).map(u=>u.signature)}async getConfirmedSignaturesForAddress2(e,r,i){let n=this._buildArgsAtLeastConfirmed([e.toBase58()],i,void 0,r),o=await this._rpcRequest("getConfirmedSignaturesForAddress2",n),s=W(o,zN);if("error"in s)throw new re(s.error,"failed to get confirmed signatures for address");return s.result}async getSignaturesForAddress(e,r,i){let n=this._buildArgsAtLeastConfirmed([e.toBase58()],i,void 0,r),o=await this._rpcRequest("getSignaturesForAddress",n),s=W(o,CN);if("error"in s)throw new re(s.error,"failed to get signatures for address");return s.result}async getAddressLookupTable(e,r){let{context:i,value:n}=await this.getAccountInfoAndContext(e,r),o=null;return n!==null&&(o=new xc({key:e,state:xc.deserialize(n.data)})),{context:i,value:o}}async getNonceAndContext(e,r){let{context:i,value:n}=await this.getAccountInfoAndContext(e,r),o=null;return n!==null&&(o=Pp.fromAccountData(n.data)),{context:i,value:o}}async getNonce(e,r){return await this.getNonceAndContext(e,r).then(i=>i.value).catch(i=>{throw new Error("failed to get nonce for account "+e.toBase58()+": "+i)})}async requestAirdrop(e,r){let i=await this._rpcRequest("requestAirdrop",[e.toBase58(),r]),n=W(i,hT);if("error"in n)throw new re(n.error,`airdrop to ${e.toBase58()} failed`);return n.result}async _blockhashWithExpiryBlockHeight(e){if(!e){for(;this._pollingBlockhash;)await Mn(100);let i=Date.now()-this._blockhashInfo.lastFetch>=tN;if(this._blockhashInfo.latestBlockhash!==null&&!i)return this._blockhashInfo.latestBlockhash}return await this._pollNewBlockhash()}async _pollNewBlockhash(){this._pollingBlockhash=!0;try{let e=Date.now(),r=this._blockhashInfo.latestBlockhash,i=r?r.blockhash:null;for(let n=0;n<50;n++){let o=await this.getLatestBlockhash("finalized");if(i!==o.blockhash)return this._blockhashInfo={latestBlockhash:o,lastFetch:Date.now(),transactionSignatures:[],simulatedSignatures:[]},o;await Mn(Nb/2)}throw new Error(`Unable to obtain a new blockhash after ${Date.now()-e}ms`)}finally{this._pollingBlockhash=!1}}async getStakeMinimumDelegation(e){let{commitment:r,config:i}=$e(e),n=this._buildArgs([],r,"base64",i),o=await this._rpcRequest("getStakeMinimumDelegation",n),s=W(o,Xe(N()));if("error"in s)throw new re(s.error,"failed to get stake minimum delegation");return s.result}async simulateTransaction(e,r,i){if("message"in e){let I=e.serialize(),R=se.Buffer.from(I).toString("base64");if(Array.isArray(r)||i!==void 0)throw new Error("Invalid arguments");let T=r||{};T.encoding="base64","commitment"in T||(T.commitment=this.commitment),r&&typeof r=="object"&&"innerInstructions"in r&&(T.innerInstructions=r.innerInstructions);let B=[R,T],$=await this._rpcRequest("simulateTransaction",B),C=W($,gb);if("error"in C)throw new Error("failed to simulate transaction: "+C.error.message);return C.result}let n;if(e instanceof xe){let A=e;n=new xe,n.feePayer=A.feePayer,n.instructions=e.instructions,n.nonceInfo=A.nonceInfo,n.signatures=A.signatures}else n=xe.populate(e),n._message=n._json=void 0;if(r!==void 0&&!Array.isArray(r))throw new Error("Invalid arguments");let o=r;if(n.nonceInfo&&o)n.sign(...o);else{let A=this._disableBlockhashCaching;for(;;){let I=await this._blockhashWithExpiryBlockHeight(A);if(n.lastValidBlockHeight=I.lastValidBlockHeight,n.recentBlockhash=I.blockhash,!o)break;if(n.sign(...o),!n.signature)throw new Error("!signature");let R=n.signature.toString("base64");if(!this._blockhashInfo.simulatedSignatures.includes(R)&&!this._blockhashInfo.transactionSignatures.includes(R)){this._blockhashInfo.simulatedSignatures.push(R);break}else A=!0}}let s=n._compile(),c=s.serialize(),p=n._serialize(c).toString("base64"),m={encoding:"base64",commitment:this.commitment};if(i){let A=(Array.isArray(i)?i:s.nonProgramIds()).map(I=>I.toBase58());m.accounts={encoding:"base64",addresses:A}}o&&(m.sigVerify=!0),r&&typeof r=="object"&&"innerInstructions"in r&&(m.innerInstructions=r.innerInstructions);let _=[p,m],w=await this._rpcRequest("simulateTransaction",_),g=W(w,gb);if("error"in g){let A;if("data"in g.error&&(A=g.error.data.logs,A&&Array.isArray(A))){let I=`
40
+ `,R=I+A.join(I);console.error(g.error.message,R)}throw new Fo({action:"simulate",signature:"",transactionMessage:g.error.message,logs:A})}return g.result}async sendTransaction(e,r,i){if("version"in e){if(r&&Array.isArray(r))throw new Error("Invalid arguments");let s=e.serialize();return await this.sendRawTransaction(s,r)}if(r===void 0||!Array.isArray(r))throw new Error("Invalid arguments");let n=r;if(e.nonceInfo)e.sign(...n);else{let s=this._disableBlockhashCaching;for(;;){let c=await this._blockhashWithExpiryBlockHeight(s);if(e.lastValidBlockHeight=c.lastValidBlockHeight,e.recentBlockhash=c.blockhash,e.sign(...n),!e.signature)throw new Error("!signature");let u=e.signature.toString("base64");if(this._blockhashInfo.transactionSignatures.includes(u))s=!0;else{this._blockhashInfo.transactionSignatures.push(u);break}}}let o=e.serialize();return await this.sendRawTransaction(o,i)}async sendRawTransaction(e,r){let i=_e(e).toString("base64");return await this.sendEncodedTransaction(i,r)}async sendEncodedTransaction(e,r){let i={encoding:"base64"},n=r&&r.skipPreflight,o=n===!0?"processed":r&&r.preflightCommitment||this.commitment;r&&r.maxRetries!=null&&(i.maxRetries=r.maxRetries),r&&r.minContextSlot!=null&&(i.minContextSlot=r.minContextSlot),n&&(i.skipPreflight=n),o&&(i.preflightCommitment=o);let s=[e,i],c=await this._rpcRequest("sendTransaction",s),u=W(c,pT);if("error"in u){let p;throw"data"in u.error&&(p=u.error.data.logs),new Fo({action:n?"send":"simulate",signature:"",transactionMessage:u.error.message,logs:p})}return u.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(([r,i])=>{this._setSubscription(r,{...i,state:"pending"})})}_setSubscription(e,r){let i=this._subscriptionsByHash[e]?.state;if(this._subscriptionsByHash[e]=r,i!==r.state){let n=this._subscriptionStateChangeCallbacksByHash[e];n&&n.forEach(o=>{try{o(r.state)}catch{}})}}_onSubscriptionStateChange(e,r){let i=this._subscriptionHashByClientSubscriptionId[e];if(i==null)return()=>{};let n=this._subscriptionStateChangeCallbacksByHash[i]||=new Set;return n.add(r),()=>{n.delete(r),n.size===0&&delete this._subscriptionStateChangeCallbacksByHash[i]}}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(i){i instanceof Error&&console.log(`Error when closing socket connection: ${i.message}`)}},500));return}if(this._rpcWebSocketIdleTimeout!==null&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketConnected=!0),!this._rpcWebSocketConnected){this._rpcWebSocket.connect();return}let e=this._rpcWebSocketGeneration,r=()=>e===this._rpcWebSocketGeneration;await Promise.all(Object.keys(this._subscriptionsByHash).map(async i=>{let n=this._subscriptionsByHash[i];if(n!==void 0)switch(n.state){case"pending":case"unsubscribed":if(n.callbacks.size===0){delete this._subscriptionsByHash[i],n.state==="unsubscribed"&&delete this._subscriptionCallbacksByServerSubscriptionId[n.serverSubscriptionId],await this._updateSubscriptions();return}await(async()=>{let{args:o,method:s}=n;try{this._setSubscription(i,{...n,state:"subscribing"});let c=await this._rpcWebSocket.call(s,o);this._setSubscription(i,{...n,serverSubscriptionId:c,state:"subscribed"}),this._subscriptionCallbacksByServerSubscriptionId[c]=n.callbacks,await this._updateSubscriptions()}catch(c){if(console.error(`Received ${c instanceof Error?"":"JSON-RPC "}error calling \`${s}\``,{args:o,error:c}),!r())return;this._setSubscription(i,{...n,state:"pending"}),await this._updateSubscriptions()}})();break;case"subscribed":n.callbacks.size===0&&await(async()=>{let{serverSubscriptionId:o,unsubscribeMethod:s}=n;if(this._subscriptionsAutoDisposedByRpc.has(o))this._subscriptionsAutoDisposedByRpc.delete(o);else{this._setSubscription(i,{...n,state:"unsubscribing"}),this._setSubscription(i,{...n,state:"unsubscribing"});try{await this._rpcWebSocket.call(s,[o])}catch(c){if(c instanceof Error&&console.error(`${s} error:`,c.message),!r())return;this._setSubscription(i,{...n,state:"subscribed"}),await this._updateSubscriptions();return}}this._setSubscription(i,{...n,state:"unsubscribed"}),await this._updateSubscriptions()})();break}}))}_handleServerNotification(e,r){let i=this._subscriptionCallbacksByServerSubscriptionId[e];i!==void 0&&i.forEach(n=>{try{n(...r)}catch(o){console.error(o)}})}_wsOnAccountNotification(e){let{result:r,subscription:i}=W(e,UN);this._handleServerNotification(i,[r.value,r.context])}_makeSubscription(e,r){let i=this._nextClientSubscriptionId++,n=hb([e.method,r]),o=this._subscriptionsByHash[n];return o===void 0?this._subscriptionsByHash[n]={...e,args:r,callbacks:new Set([e.callback]),state:"pending"}:o.callbacks.add(e.callback),this._subscriptionHashByClientSubscriptionId[i]=n,this._subscriptionDisposeFunctionsByClientSubscriptionId[i]=async()=>{delete this._subscriptionDisposeFunctionsByClientSubscriptionId[i],delete this._subscriptionHashByClientSubscriptionId[i];let s=this._subscriptionsByHash[n];Ee(s!==void 0,`Could not find a \`Subscription\` when tearing down client subscription #${i}`),s.callbacks.delete(e.callback),await this._updateSubscriptions()},this._updateSubscriptions(),i}onAccountChange(e,r,i){let{commitment:n,config:o}=$e(i),s=this._buildArgs([e.toBase58()],n||this._commitment||"finalized","base64",o);return this._makeSubscription({callback:r,method:"accountSubscribe",unsubscribeMethod:"accountUnsubscribe"},s)}async removeAccountChangeListener(e){await this._unsubscribeClientSubscription(e,"account change")}_wsOnProgramAccountNotification(e){let{result:r,subscription:i}=W(e,MN);this._handleServerNotification(i,[{accountId:r.value.pubkey,accountInfo:r.value.account},r.context])}onProgramAccountChange(e,r,i,n){let{commitment:o,config:s}=$e(i),c=this._buildArgs([e.toBase58()],o||this._commitment||"finalized","base64",s||(n?{filters:mb(n)}:void 0));return this._makeSubscription({callback:r,method:"programSubscribe",unsubscribeMethod:"programUnsubscribe"},c)}async removeProgramAccountChangeListener(e){await this._unsubscribeClientSubscription(e,"program account change")}onLogs(e,r,i){let n=this._buildArgs([typeof e=="object"?{mentions:[e.toString()]}:e],i||this._commitment||"finalized");return this._makeSubscription({callback:r,method:"logsSubscribe",unsubscribeMethod:"logsUnsubscribe"},n)}async removeOnLogsListener(e){await this._unsubscribeClientSubscription(e,"logs")}_wsOnLogsNotification(e){let{result:r,subscription:i}=W(e,gT);this._handleServerNotification(i,[r.value,r.context])}_wsOnSlotNotification(e){let{result:r,subscription:i}=W(e,FN);this._handleServerNotification(i,[r])}onSlotChange(e){return this._makeSubscription({callback:e,method:"slotSubscribe",unsubscribeMethod:"slotUnsubscribe"},[])}async removeSlotChangeListener(e){await this._unsubscribeClientSubscription(e,"slot change")}_wsOnSlotUpdatesNotification(e){let{result:r,subscription:i}=W(e,VN);this._handleServerNotification(i,[r])}onSlotUpdate(e){return this._makeSubscription({callback:e,method:"slotsUpdatesSubscribe",unsubscribeMethod:"slotsUpdatesUnsubscribe"},[])}async removeSlotUpdateListener(e){await this._unsubscribeClientSubscription(e,"slot update")}async _unsubscribeClientSubscription(e,r){let i=this._subscriptionDisposeFunctionsByClientSubscriptionId[e];i?await i():console.warn(`Ignored unsubscribe request because an active subscription with id \`${e}\` for '${r}' events could not be found.`)}_buildArgs(e,r,i,n){let o=r||this._commitment;if(o||i||n){let s={};i&&(s.encoding=i),o&&(s.commitment=o),n&&(s=Object.assign(s,n)),e.push(s)}return e}_buildArgsAtLeastConfirmed(e,r,i,n){let o=r||this._commitment;if(o&&!["confirmed","finalized"].includes(o))throw new Error("Using Connection with default commitment: `"+this._commitment+"`, but method requires at least `confirmed`");return this._buildArgs(e,r,i,n)}_wsOnSignatureNotification(e){let{result:r,subscription:i}=W(e,WN);r.value!=="receivedSignature"&&this._subscriptionsAutoDisposedByRpc.add(i),this._handleServerNotification(i,r.value==="receivedSignature"?[{type:"received"},r.context]:[{type:"status",result:r.value},r.context])}onSignature(e,r,i){let n=this._buildArgs([e],i||this._commitment||"finalized"),o=this._makeSubscription({callback:(s,c)=>{if(s.type==="status"){r(s.result,c);try{this.removeSignatureListener(o)}catch{}}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},n);return o}onSignatureWithOptions(e,r,i){let{commitment:n,...o}={...i,commitment:i&&i.commitment||this._commitment||"finalized"},s=this._buildArgs([e],n,void 0,o),c=this._makeSubscription({callback:(u,p)=>{r(u,p);try{this.removeSignatureListener(c)}catch{}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},s);return c}async removeSignatureListener(e){await this._unsubscribeClientSubscription(e,"signature result")}_wsOnRootNotification(e){let{result:r,subscription:i}=W(e,KN);this._handleServerNotification(i,[r])}onRootChange(e){return this._makeSubscription({callback:e,method:"rootSubscribe",unsubscribeMethod:"rootUnsubscribe"},[])}async removeRootChangeListener(e){await this._unsubscribeClientSubscription(e,"root change")}},jp=class t{constructor(e){this._keypair=void 0,this._keypair=e??ab()}static generate(){return new t(ab())}static fromSecretKey(e,r){if(e.byteLength!==64)throw new Error("bad secret key size");let i=e.slice(32,64);if(!r||!r.skipValidation){let n=e.slice(0,32),o=$p(n);for(let s=0;s<32;s++)if(i[s]!==o[s])throw new Error("provided secretKey is invalid")}return new t({publicKey:i,secretKey:e})}static fromSeed(e){let r=$p(e),i=new Uint8Array(64);return i.set(e),i.set(r,32),new t({publicKey:r,secretKey:i})}get publicKey(){return new ce(this._keypair.publicKey)}get secretKey(){return new Uint8Array(this._keypair.secretKey)}},Do=Object.freeze({CreateLookupTable:{index:0,layout:E.struct([E.u32("instruction"),xi("recentSlot"),E.u8("bumpSeed")])},FreezeLookupTable:{index:1,layout:E.struct([E.u32("instruction")])},ExtendLookupTable:{index:2,layout:E.struct([E.u32("instruction"),xi(),E.seq(ye(),E.offset(E.u32(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:E.struct([E.u32("instruction")])},CloseLookupTable:{index:4,layout:E.struct([E.u32("instruction")])}});var Fp=class{constructor(){}static createLookupTable(e){let[r,i]=ce.findProgramAddressSync([e.authority.toBuffer(),ip().encode(e.recentSlot)],this.programId),n=Do.CreateLookupTable,o=be(n,{recentSlot:BigInt(e.recentSlot),bumpSeed:i}),s=[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1},{pubkey:e.payer,isSigner:!0,isWritable:!0},{pubkey:Zt.programId,isSigner:!1,isWritable:!1}];return[new Oe({programId:this.programId,keys:s,data:o}),r]}static freezeLookupTable(e){let r=Do.FreezeLookupTable,i=be(r),n=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return new Oe({programId:this.programId,keys:n,data:i})}static extendLookupTable(e){let r=Do.ExtendLookupTable,i=be(r,{addresses:e.addresses.map(o=>o.toBytes())}),n=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return e.payer&&n.push({pubkey:e.payer,isSigner:!0,isWritable:!0},{pubkey:Zt.programId,isSigner:!1,isWritable:!1}),new Oe({programId:this.programId,keys:n,data:i})}static deactivateLookupTable(e){let r=Do.DeactivateLookupTable,i=be(r),n=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return new Oe({programId:this.programId,keys:n,data:i})}static closeLookupTable(e){let r=Do.CloseLookupTable,i=be(r),n=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1},{pubkey:e.recipient,isSigner:!1,isWritable:!0}];return new Oe({programId:this.programId,keys:n,data:i})}};Fp.programId=new ce("AddressLookupTab1e1111111111111111111111111");var pc=Object.freeze({RequestUnits:{index:0,layout:E.struct([E.u8("instruction"),E.u32("units"),E.u32("additionalFee")])},RequestHeapFrame:{index:1,layout:E.struct([E.u8("instruction"),E.u32("bytes")])},SetComputeUnitLimit:{index:2,layout:E.struct([E.u8("instruction"),E.u32("units")])},SetComputeUnitPrice:{index:3,layout:E.struct([E.u8("instruction"),xi("microLamports")])}}),Zp=class{constructor(){}static requestUnits(e){let r=pc.RequestUnits,i=be(r,e);return new Oe({keys:[],programId:this.programId,data:i})}static requestHeapFrame(e){let r=pc.RequestHeapFrame,i=be(r,e);return new Oe({keys:[],programId:this.programId,data:i})}static setComputeUnitLimit(e){let r=pc.SetComputeUnitLimit,i=be(r,e);return new Oe({keys:[],programId:this.programId,data:i})}static setComputeUnitPrice(e){let r=pc.SetComputeUnitPrice,i=be(r,{microLamports:BigInt(e.microLamports)});return new Oe({keys:[],programId:this.programId,data:i})}};Zp.programId=new ce("ComputeBudget111111111111111111111111111111");var bb=64,vb=32,wb=64,xb=E.struct([E.u8("numSignatures"),E.u8("padding"),E.u16("signatureOffset"),E.u16("signatureInstructionIndex"),E.u16("publicKeyOffset"),E.u16("publicKeyInstructionIndex"),E.u16("messageDataOffset"),E.u16("messageDataSize"),E.u16("messageInstructionIndex")]),Vp=class t{constructor(){}static createInstructionWithPublicKey(e){let{publicKey:r,message:i,signature:n,instructionIndex:o}=e;Ee(r.length===vb,`Public Key must be ${vb} bytes but received ${r.length} bytes`),Ee(n.length===wb,`Signature must be ${wb} bytes but received ${n.length} bytes`);let s=xb.span,c=s+r.length,u=c+n.length,p=1,m=se.Buffer.alloc(u+i.length),_=o??65535;return xb.encode({numSignatures:p,padding:0,signatureOffset:c,signatureInstructionIndex:_,publicKeyOffset:s,publicKeyInstructionIndex:_,messageDataOffset:u,messageDataSize:i.length,messageInstructionIndex:_},m),m.fill(r,s),m.fill(n,c),m.fill(i,u),new Oe({keys:[],programId:t.programId,data:m})}static createInstructionWithPrivateKey(e){let{privateKey:r,message:i,instructionIndex:n}=e;Ee(r.length===bb,`Private key must be ${bb} bytes but received ${r.length} bytes`);try{let o=jp.fromSecretKey(r),s=o.publicKey.toBytes(),c=Kp(i,o.secretKey);return this.createInstructionWithPublicKey({publicKey:s,message:i,signature:c,instructionIndex:n})}catch(o){throw new Error(`Error creating instruction; ${o}`)}}};Vp.programId=new ce("Ed25519SigVerify111111111111111111111111111");var _T=(t,e)=>{let r=Co.sign(t,e);return[r.toCompactRawBytes(),r.recovery]};Co.utils.isValidPrivateKey;var bT=Co.getPublicKey,Sb=32,Op=20,Eb=64,vT=11,Np=E.struct([E.u8("numSignatures"),E.u16("signatureOffset"),E.u8("signatureInstructionIndex"),E.u16("ethAddressOffset"),E.u8("ethAddressInstructionIndex"),E.u16("messageDataOffset"),E.u16("messageDataSize"),E.u8("messageInstructionIndex"),E.blob(20,"ethAddress"),E.blob(64,"signature"),E.u8("recoveryId")]),Wp=class t{constructor(){}static publicKeyToEthAddress(e){Ee(e.length===Eb,`Public key must be ${Eb} bytes but received ${e.length} bytes`);try{return se.Buffer.from(_p(_e(e))).slice(-Op)}catch(r){throw new Error(`Error constructing Ethereum address: ${r}`)}}static createInstructionWithPublicKey(e){let{publicKey:r,message:i,signature:n,recoveryId:o,instructionIndex:s}=e;return t.createInstructionWithEthAddress({ethAddress:t.publicKeyToEthAddress(r),message:i,signature:n,recoveryId:o,instructionIndex:s})}static createInstructionWithEthAddress(e){let{ethAddress:r,message:i,signature:n,recoveryId:o,instructionIndex:s=0}=e,c;typeof r=="string"?r.startsWith("0x")?c=se.Buffer.from(r.substr(2),"hex"):c=se.Buffer.from(r,"hex"):c=r,Ee(c.length===Op,`Address must be ${Op} bytes but received ${c.length} bytes`);let u=1+vT,p=u,m=u+c.length,_=m+n.length+1,w=1,g=se.Buffer.alloc(Np.span+i.length);return Np.encode({numSignatures:w,signatureOffset:m,signatureInstructionIndex:s,ethAddressOffset:p,ethAddressInstructionIndex:s,messageDataOffset:_,messageDataSize:i.length,messageInstructionIndex:s,signature:_e(n),ethAddress:_e(c),recoveryId:o},g),g.fill(_e(i),Np.span),new Oe({keys:[],programId:t.programId,data:g})}static createInstructionWithPrivateKey(e){let{privateKey:r,message:i,instructionIndex:n}=e;Ee(r.length===Sb,`Private key must be ${Sb} bytes but received ${r.length} bytes`);try{let o=_e(r),s=bT(o,!1).slice(1),c=se.Buffer.from(_p(_e(i))),[u,p]=_T(c,o);return this.createInstructionWithPublicKey({publicKey:s,message:i,signature:u,recoveryId:p,instructionIndex:n})}catch(o){throw new Error(`Error creating instruction; ${o}`)}}};Wp.programId=new ce("KeccakSecp256k11111111111111111111111111111");var Fb,wT=new ce("StakeConfig11111111111111111111111111111111");var Vo=class{constructor(e,r,i){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=e,this.epoch=r,this.custodian=i}};Fb=Vo;Vo.default=new Fb(0,0,ce.default);var pn=Object.freeze({Initialize:{index:0,layout:E.struct([E.u32("instruction"),zO(),CO()])},Authorize:{index:1,layout:E.struct([E.u32("instruction"),ye("newAuthorized"),E.u32("stakeAuthorizationType")])},Delegate:{index:2,layout:E.struct([E.u32("instruction")])},Split:{index:3,layout:E.struct([E.u32("instruction"),E.ns64("lamports")])},Withdraw:{index:4,layout:E.struct([E.u32("instruction"),E.ns64("lamports")])},Deactivate:{index:5,layout:E.struct([E.u32("instruction")])},Merge:{index:7,layout:E.struct([E.u32("instruction")])},AuthorizeWithSeed:{index:8,layout:E.struct([E.u32("instruction"),ye("newAuthorized"),E.u32("stakeAuthorizationType"),vi("authoritySeed"),ye("authorityOwner")])}}),$P=Object.freeze({Staker:{index:0},Withdrawer:{index:1}}),Ic=class{constructor(){}static initialize(e){let{stakePubkey:r,authorized:i,lockup:n}=e,o=n||Vo.default,s=pn.Initialize,c=be(s,{authorized:{staker:_e(i.staker.toBuffer()),withdrawer:_e(i.withdrawer.toBuffer())},lockup:{unixTimestamp:o.unixTimestamp,epoch:o.epoch,custodian:_e(o.custodian.toBuffer())}}),u={keys:[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:jo,isSigner:!1,isWritable:!1}],programId:this.programId,data:c};return new Oe(u)}static createAccountWithSeed(e){let r=new xe;r.add(Zt.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:this.space,programId:this.programId}));let{stakePubkey:i,authorized:n,lockup:o}=e;return r.add(this.initialize({stakePubkey:i,authorized:n,lockup:o}))}static createAccount(e){let r=new xe;r.add(Zt.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,lamports:e.lamports,space:this.space,programId:this.programId}));let{stakePubkey:i,authorized:n,lockup:o}=e;return r.add(this.initialize({stakePubkey:i,authorized:n,lockup:o}))}static delegate(e){let{stakePubkey:r,authorizedPubkey:i,votePubkey:n}=e,o=pn.Delegate,s=be(o);return new xe().add({keys:[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!1},{pubkey:Mr,isSigner:!1,isWritable:!1},{pubkey:Ep,isSigner:!1,isWritable:!1},{pubkey:wT,isSigner:!1,isWritable:!1},{pubkey:i,isSigner:!0,isWritable:!1}],programId:this.programId,data:s})}static authorize(e){let{stakePubkey:r,authorizedPubkey:i,newAuthorizedPubkey:n,stakeAuthorizationType:o,custodianPubkey:s}=e,c=pn.Authorize,u=be(c,{newAuthorized:_e(n.toBuffer()),stakeAuthorizationType:o.index}),p=[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:Mr,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!0,isWritable:!1}];return s&&p.push({pubkey:s,isSigner:!0,isWritable:!1}),new xe().add({keys:p,programId:this.programId,data:u})}static authorizeWithSeed(e){let{stakePubkey:r,authorityBase:i,authoritySeed:n,authorityOwner:o,newAuthorizedPubkey:s,stakeAuthorizationType:c,custodianPubkey:u}=e,p=pn.AuthorizeWithSeed,m=be(p,{newAuthorized:_e(s.toBuffer()),stakeAuthorizationType:c.index,authoritySeed:n,authorityOwner:_e(o.toBuffer())}),_=[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!0,isWritable:!1},{pubkey:Mr,isSigner:!1,isWritable:!1}];return u&&_.push({pubkey:u,isSigner:!0,isWritable:!1}),new xe().add({keys:_,programId:this.programId,data:m})}static splitInstruction(e){let{stakePubkey:r,authorizedPubkey:i,splitStakePubkey:n,lamports:o}=e,s=pn.Split,c=be(s,{lamports:o});return new Oe({keys:[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!0,isWritable:!1}],programId:this.programId,data:c})}static split(e,r){let i=new xe;return i.add(Zt.createAccount({fromPubkey:e.authorizedPubkey,newAccountPubkey:e.splitStakePubkey,lamports:r,space:this.space,programId:this.programId})),i.add(this.splitInstruction(e))}static splitWithSeed(e,r){let{stakePubkey:i,authorizedPubkey:n,splitStakePubkey:o,basePubkey:s,seed:c,lamports:u}=e,p=new xe;return p.add(Zt.allocate({accountPubkey:o,basePubkey:s,seed:c,space:this.space,programId:this.programId})),r&&r>0&&p.add(Zt.transfer({fromPubkey:e.authorizedPubkey,toPubkey:o,lamports:r})),p.add(this.splitInstruction({stakePubkey:i,authorizedPubkey:n,splitStakePubkey:o,lamports:u}))}static merge(e){let{stakePubkey:r,sourceStakePubKey:i,authorizedPubkey:n}=e,o=pn.Merge,s=be(o);return new xe().add({keys:[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:Mr,isSigner:!1,isWritable:!1},{pubkey:Ep,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:s})}static withdraw(e){let{stakePubkey:r,authorizedPubkey:i,toPubkey:n,lamports:o,custodianPubkey:s}=e,c=pn.Withdraw,u=be(c,{lamports:o}),p=[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:Mr,isSigner:!1,isWritable:!1},{pubkey:Ep,isSigner:!1,isWritable:!1},{pubkey:i,isSigner:!0,isWritable:!1}];return s&&p.push({pubkey:s,isSigner:!0,isWritable:!1}),new xe().add({keys:p,programId:this.programId,data:u})}static deactivate(e){let{stakePubkey:r,authorizedPubkey:i}=e,n=pn.Deactivate,o=be(n);return new xe().add({keys:[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:Mr,isSigner:!1,isWritable:!1},{pubkey:i,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}};Ic.programId=new ce("Stake11111111111111111111111111111111111111");Ic.space=200;var Mo=Object.freeze({InitializeAccount:{index:0,layout:E.struct([E.u32("instruction"),UO()])},Authorize:{index:1,layout:E.struct([E.u32("instruction"),ye("newAuthorized"),E.u32("voteAuthorizationType")])},Withdraw:{index:3,layout:E.struct([E.u32("instruction"),E.ns64("lamports")])},UpdateValidatorIdentity:{index:4,layout:E.struct([E.u32("instruction")])},AuthorizeWithSeed:{index:10,layout:E.struct([E.u32("instruction"),DO()])}}),LP=Object.freeze({Voter:{index:0},Withdrawer:{index:1}}),Rc=class t{constructor(){}static initializeAccount(e){let{votePubkey:r,nodePubkey:i,voteInit:n}=e,o=Mo.InitializeAccount,s=be(o,{voteInit:{nodePubkey:_e(n.nodePubkey.toBuffer()),authorizedVoter:_e(n.authorizedVoter.toBuffer()),authorizedWithdrawer:_e(n.authorizedWithdrawer.toBuffer()),commission:n.commission}}),c={keys:[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:jo,isSigner:!1,isWritable:!1},{pubkey:Mr,isSigner:!1,isWritable:!1},{pubkey:i,isSigner:!0,isWritable:!1}],programId:this.programId,data:s};return new Oe(c)}static createAccount(e){let r=new xe;return r.add(Zt.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.votePubkey,lamports:e.lamports,space:this.space,programId:this.programId})),r.add(this.initializeAccount({votePubkey:e.votePubkey,nodePubkey:e.voteInit.nodePubkey,voteInit:e.voteInit}))}static authorize(e){let{votePubkey:r,authorizedPubkey:i,newAuthorizedPubkey:n,voteAuthorizationType:o}=e,s=Mo.Authorize,c=be(s,{newAuthorized:_e(n.toBuffer()),voteAuthorizationType:o.index}),u=[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:Mr,isSigner:!1,isWritable:!1},{pubkey:i,isSigner:!0,isWritable:!1}];return new xe().add({keys:u,programId:this.programId,data:c})}static authorizeWithSeed(e){let{currentAuthorityDerivedKeyBasePubkey:r,currentAuthorityDerivedKeyOwnerPubkey:i,currentAuthorityDerivedKeySeed:n,newAuthorizedPubkey:o,voteAuthorizationType:s,votePubkey:c}=e,u=Mo.AuthorizeWithSeed,p=be(u,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:_e(i.toBuffer()),currentAuthorityDerivedKeySeed:n,newAuthorized:_e(o.toBuffer()),voteAuthorizationType:s.index}}),m=[{pubkey:c,isSigner:!1,isWritable:!0},{pubkey:Mr,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return new xe().add({keys:m,programId:this.programId,data:p})}static withdraw(e){let{votePubkey:r,authorizedWithdrawerPubkey:i,lamports:n,toPubkey:o}=e,s=Mo.Withdraw,c=be(s,{lamports:n}),u=[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:o,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!0,isWritable:!1}];return new xe().add({keys:u,programId:this.programId,data:c})}static safeWithdraw(e,r,i){if(e.lamports>r-i)throw new Error("Withdraw will leave vote account with insufficient funds.");return t.withdraw(e)}static updateValidatorIdentity(e){let{votePubkey:r,authorizedWithdrawerPubkey:i,nodePubkey:n}=e,o=Mo.UpdateValidatorIdentity,s=be(o),c=[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1},{pubkey:i,isSigner:!0,isWritable:!1}];return new xe().add({keys:c,programId:this.programId,data:s})}};Rc.programId=new ce("Vote111111111111111111111111111111111111111");Rc.space=3762;var PP=new ce("Va1idator1nfo111111111111111111111111111111"),BP=D({name:F(),website:ie(F()),details:ie(F()),iconUrl:ie(F()),keybaseUsername:ie(F())});var zP=new ce("Vote111111111111111111111111111111111111111"),CP=E.struct([ye("nodePubkey"),ye("authorizedWithdrawer"),E.u8("commission"),E.nu64(),E.seq(E.struct([E.nu64("slot"),E.u32("confirmationCount")]),E.offset(E.u32(),-8),"votes"),E.u8("rootSlotValid"),E.nu64("rootSlot"),E.nu64(),E.seq(E.struct([E.nu64("epoch"),ye("authorizedVoter")]),E.offset(E.u32(),-8),"authorizedVoters"),E.struct([E.seq(E.struct([ye("authorizedPubkey"),E.nu64("epochOfLastAuthorizedSwitch"),E.nu64("targetEpoch")]),32,"buf"),E.nu64("idx"),E.u8("isEmpty")],"priorVoters"),E.nu64(),E.seq(E.struct([E.nu64("epoch"),E.nu64("credits"),E.nu64("prevCredits")]),E.offset(E.u32(),-8),"epochCredits"),E.struct([E.nu64("slot"),E.nu64("timestamp")],"lastTimestamp")]);var Yp=t=>({request:t,signMessage:e=>t({method:"signMessage",params:{message:e}}),signTransaction:e=>t({method:"signTransaction",params:{transaction:e}}),signAndSendTransaction:e=>t({method:"signAndSendTransaction",params:e})});function Xp(t){return Buffer.from(t.serialize({verifySignatures:!1})).toString("base64")}function Qp(t){let e=Buffer.from(t,"base64");return kc.deserializeMessageVersion(e)==="legacy"?wc.deserialize(e):xe.from(e)}function xT(t){return async r=>{if(r.method==="connect")return await t(r);if(r.method==="signMessage")return await t(r);if(r.method==="signAndSendTransaction"){let{transaction:i,options:n}=r.params,o={transaction:Qp(i),options:n};return await t({method:"signAndSendTransaction",params:o})}if(r.method==="signTransaction"){let{transaction:i}=r.params,n={transaction:Qp(i)},{signedTransaction:o}=await t({method:"signTransaction",params:n});return{signedTransaction:Xp(o)}}}}function em(t){return async r=>{if(r.method==="connect")return await t(r);if(r.method==="signMessage")return await t(r);if(r.method==="signAndSendTransaction"){let{transaction:i,options:n}=r.params,o={transaction:Xp(i)};return await t({method:"signAndSendTransaction",params:o})}if(r.method==="signTransaction"){let{transaction:i}=r.params,n={transaction:Xp(i)},{signedTransaction:o}=await t({method:"signTransaction",params:n});return{signedTransaction:Qp(o)}}}}var Zb=({miniAppHost:t,emitter:e})=>{let r,i=null;return{visible:!1,get onback(){return i},set onback(n){i&&e.removeListener("backNavigationTriggered",i),i=n,n&&e.addListener("backNavigationTriggered",n)},async show(){await t.updateBackState({visible:!0}),this.visible=!0},async hide(){await t.updateBackState({visible:!1}),this.visible=!1},async enableWebNavigation(){r=ST({back:this,emitter:e})},async disableWebNavigation(){r?.(),r=void 0}}};function ST({emitter:t,back:e}){let r=ET();if(r)return IT({emitter:t,back:e,navigation:r});if(typeof window<"u")return RT({emitter:t,back:e,window})}function ET(){if(typeof window<"u"&&window.navigation!==void 0)return window.navigation}function IT({emitter:t,back:e,navigation:r}){function i(){r.canGoBack?e.show():e.hide()}function n(){e.visible&&r.canGoBack&&r.back()}return r.addEventListener("navigatesuccess",i),t.addListener("backNavigationTriggered",n),()=>{r.removeEventListener("navigatesuccess",i),t.removeListener("backNavigationTriggered",n)}}function RT({emitter:t,back:e,window:r}){e.show();function i(){e.visible&&r.history.back()}return t.addListener("backNavigationTriggered",i),()=>{t.removeListener("backNavigationTriggered",i)}}var Vb="0.1.1";function Wb(){return Vb}var Nc=class t extends Error{constructor(e,r={}){let i=(()=>{if(r.cause instanceof t){if(r.cause.details)return r.cause.details;if(r.cause.shortMessage)return r.cause.shortMessage}return r.cause?.message?r.cause.message:r.details})(),n=r.cause instanceof t&&r.cause.docsPath||r.docsPath,s=`https://oxlib.sh${n??""}`,c=[e||"An error occurred.",...r.metaMessages?["",...r.metaMessages]:[],...i||n?["",i?`Details: ${i}`:void 0,n?`See: ${s}`:void 0]:[]].filter(u=>typeof u=="string").join(`
41
+ `);super(c,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:`ox@${Wb()}`}),this.cause=r.cause,this.details=i,this.docs=s,this.docsPath=n,this.shortMessage=e}walk(e){return Kb(this,e)}};function Kb(t,e){return e?.(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause?Kb(t.cause,e):e?null:t}function Tc(t,e={}){let{raw:r=!1}=e,i=t;if(r)return t;if(i.error){let{code:n}=i.error,o=n===Wn.code?Wn:n===Wo.code?Wo:n===es.code?es:n===Xo.code?Xo:n===Jo.code?Jo:n===Qo.code?Qo:n===Go.code?Go:n===ts.code?ts:n===Ko.code?Ko:n===qo.code?qo:n===Ho.code?Ho:n===Yo.code?Yo:Nt;throw new o(i.error)}return i.result}var Nt=class extends Error{constructor(e){let{code:r,message:i,data:n}=e;super(i),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.BaseError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=r,this.data=n}},Wo=class t extends Nt{constructor(e={}){super({message:"Missing or invalid parameters.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.InvalidInputError"})}};Object.defineProperty(Wo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});var Ko=class t extends Nt{constructor(e={}){super({message:"Requested resource not found.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.ResourceNotFoundError"})}};Object.defineProperty(Ko,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});var qo=class t extends Nt{constructor(e={}){super({message:"Requested resource not available.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.ResourceUnavailableError"})}};Object.defineProperty(qo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});var Ho=class t extends Nt{constructor(e={}){super({message:"Transaction creation failed.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.TransactionRejectedError"})}};Object.defineProperty(Ho,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});var Go=class t extends Nt{constructor(e={}){super({message:"Method is not implemented.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.MethodNotSupportedError"})}};Object.defineProperty(Go,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});var Jo=class t extends Nt{constructor(e={}){super({message:"Rate limit exceeded.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.LimitExceededError"})}};Object.defineProperty(Jo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});var Yo=class t extends Nt{constructor(e={}){super({message:"JSON-RPC version not supported.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.VersionNotSupportedError"})}};Object.defineProperty(Yo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});var Xo=class t extends Nt{constructor(e={}){super({message:"Input is not a valid JSON-RPC request.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.InvalidRequestError"})}};Object.defineProperty(Xo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});var Qo=class t extends Nt{constructor(e={}){super({message:"Method does not exist.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.MethodNotFoundError"})}};Object.defineProperty(Qo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});var es=class t extends Nt{constructor(e={}){super({message:"Invalid method parameters.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.InvalidParamsError"})}};Object.defineProperty(es,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});var Wn=class t extends Nt{constructor(e={}){super({message:"Internal JSON-RPC error.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.InternalErrorError"})}};Object.defineProperty(Wn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});var ts=class t extends Nt{constructor(e={}){super({message:"Failed to parse JSON-RPC response.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.ParseError"})}};Object.defineProperty(ts,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});var xr=class extends Error{constructor(e,r){super(r),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderRpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=e,this.details=r}},rs=class extends xr{constructor({message:e="The user rejected the request."}={}){super(4001,e),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.UserRejectedRequestError"})}};Object.defineProperty(rs,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});var ns=class extends xr{constructor({message:e="The requested method and/or account has not been authorized by the user."}={}){super(4100,e),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.UnauthorizedError"})}};Object.defineProperty(ns,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});var is=class extends xr{constructor({message:e="The provider does not support the requested method."}={}){super(4200,e),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.UnsupportedMethodError"})}};Object.defineProperty(is,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});var os=class extends xr{constructor({message:e="The provider is disconnected from all chains."}={}){super(4900,e),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.DisconnectedError"})}};Object.defineProperty(os,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});var ss=class extends xr{constructor({message:e="The provider is not connected to the requested chain."}={}){super(4901,e),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.ChainDisconnectedError"})}};Object.defineProperty(ss,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});function Hb(){let t=new Dn.default;return{get eventNames(){return t.eventNames.bind(t)},get listenerCount(){return t.listenerCount.bind(t)},get listeners(){return t.listeners.bind(t)},addListener:t.addListener.bind(t),emit:t.emit.bind(t),off:t.off.bind(t),on:t.on.bind(t),once:t.once.bind(t),removeAllListeners:t.removeAllListeners.bind(t),removeListener:t.removeListener.bind(t)}}function Gb(t,e={}){let{includeEvents:r=!0}=e;if(!t)throw new tm;return{...r?{on:t.on?.bind(t),removeListener:t.removeListener?.bind(t)}:{},async request(i){let n=await t.request(i);return n&&typeof n=="object"&&"jsonrpc"in n?Tc(n):n}}}var tm=class extends Nc{constructor(){super("`provider` is undefined."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.IsUndefinedError"})}};function Jb(t={}){let e=t.id??0;return{prepare(r){return OT({id:e++,...r})},get id(){return e}}}function OT(t){return{...t,jsonrpc:"2.0"}}var Xb=Symbol("Comlink.proxy"),TT=Symbol("Comlink.endpoint"),$T=Symbol("Comlink.releaseProxy"),rm=Symbol("Comlink.finalizer"),Lc=Symbol("Comlink.thrown"),Qb=t=>typeof t=="object"&&t!==null||typeof t=="function",LT={canHandle:t=>Qb(t)&&t[Xb],serialize(t){let{port1:e,port2:r}=new MessageChannel;return tv(t,e),[r,[r]]},deserialize(t){return t.start(),im(t)}},PT={canHandle:t=>Qb(t)&&Lc in t,serialize({value:t}){let e;return t instanceof Error?e={isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:e={isError:!1,value:t},[e,[]]},deserialize(t){throw t.isError?Object.assign(new Error(t.value.message),t.value):t.value}},ev=new Map([["proxy",LT],["throw",PT]]);function BT(t,e){for(let r of t)if(e===r||r==="*"||r instanceof RegExp&&r.test(e))return!0;return!1}function tv(t,e=globalThis,r=["*"]){e.addEventListener("message",function i(n){if(!n||!n.data)return;if(!BT(r,n.origin)){console.warn(`Invalid origin '${n.origin}' for comlink proxy`);return}let{id:o,type:s,path:c}=Object.assign({path:[]},n.data),u=(n.data.argumentList||[]).map(Kn),p;try{let m=c.slice(0,-1).reduce((w,g)=>w[g],t),_=c.reduce((w,g)=>w[g],t);switch(s){case"GET":p=_;break;case"SET":m[c.slice(-1)[0]]=Kn(n.data.value),p=!0;break;case"APPLY":p=_.apply(m,u);break;case"CONSTRUCT":{let w=new _(...u);p=jT(w)}break;case"ENDPOINT":{let{port1:w,port2:g}=new MessageChannel;tv(t,g),p=MT(w,[w])}break;case"RELEASE":p=void 0;break;default:return}}catch(m){p={value:m,[Lc]:0}}Promise.resolve(p).catch(m=>({value:m,[Lc]:0})).then(m=>{let[_,w]=zc(m);e.postMessage(Object.assign(Object.assign({},_),{id:o}),w),s==="RELEASE"&&(e.removeEventListener("message",i),rv(e),rm in t&&typeof t[rm]=="function"&&t[rm]())}).catch(m=>{let[_,w]=zc({value:new TypeError("Unserializable return value"),[Lc]:0});e.postMessage(Object.assign(Object.assign({},_),{id:o}),w)})}),e.start&&e.start()}function zT(t){return t.constructor.name==="MessagePort"}function rv(t){zT(t)&&t.close()}function im(t,e){let r=new Map;return t.addEventListener("message",function(n){let{data:o}=n;if(!o||!o.id)return;let s=r.get(o.id);if(s)try{s(o)}finally{r.delete(o.id)}}),nm(t,r,[],e)}function $c(t){if(t)throw new Error("Proxy has been released and is not useable")}function nv(t){return Ii(t,new Map,{type:"RELEASE"}).then(()=>{rv(t)})}var Pc=new WeakMap,Bc="FinalizationRegistry"in globalThis&&new FinalizationRegistry(t=>{let e=(Pc.get(t)||0)-1;Pc.set(t,e),e===0&&nv(t)});function CT(t,e){let r=(Pc.get(e)||0)+1;Pc.set(e,r),Bc&&Bc.register(t,e,t)}function UT(t){Bc&&Bc.unregister(t)}function nm(t,e,r=[],i=function(){}){let n=!1,o=new Proxy(i,{get(s,c){if($c(n),c===$T)return()=>{UT(o),nv(t),e.clear(),n=!0};if(c==="then"){if(r.length===0)return{then:()=>o};let u=Ii(t,e,{type:"GET",path:r.map(p=>p.toString())}).then(Kn);return u.then.bind(u)}return nm(t,e,[...r,c])},set(s,c,u){$c(n);let[p,m]=zc(u);return Ii(t,e,{type:"SET",path:[...r,c].map(_=>_.toString()),value:p},m).then(Kn)},apply(s,c,u){$c(n);let p=r[r.length-1];if(p===TT)return Ii(t,e,{type:"ENDPOINT"}).then(Kn);if(p==="bind")return nm(t,e,r.slice(0,-1));let[m,_]=Yb(u);return Ii(t,e,{type:"APPLY",path:r.map(w=>w.toString()),argumentList:m},_).then(Kn)},construct(s,c){$c(n);let[u,p]=Yb(c);return Ii(t,e,{type:"CONSTRUCT",path:r.map(m=>m.toString()),argumentList:u},p).then(Kn)}});return CT(o,t),o}function DT(t){return Array.prototype.concat.apply([],t)}function Yb(t){let e=t.map(zc);return[e.map(r=>r[0]),DT(e.map(r=>r[1]))]}var iv=new WeakMap;function MT(t,e){return iv.set(t,e),t}function jT(t){return Object.assign(t,{[Xb]:!0})}function ov(t,e=globalThis,r="*"){return{postMessage:(i,n)=>t.postMessage(i,r,n),addEventListener:e.addEventListener.bind(e),removeEventListener:e.removeEventListener.bind(e)}}function zc(t){for(let[e,r]of ev)if(r.canHandle(t)){let[i,n]=r.serialize(t);return[{type:"HANDLER",name:e,value:i},n]}return[{type:"RAW",value:t},iv.get(t)||[]]}function Kn(t){switch(t.type){case"HANDLER":return ev.get(t.name).deserialize(t.value);case"RAW":return t.value}}function Ii(t,e,r,i){return new Promise(n=>{let o=FT();e.set(o,n),t.start&&t.start(),t.postMessage(Object.assign({id:o},r),i)})}function FT(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}var ZT={postMessage(){},addEventListener:()=>{},removeEventListener:()=>{}},VT={postMessage:t=>{console.debug("[webview:req]",t),window.ReactNativeWebView.postMessage(JSON.stringify(t))},addEventListener:(t,e,...r)=>{document.addEventListener("FarcasterFrameCallback",e,...r)},removeEventListener:(t,e)=>{document.removeEventListener("FarcasterFrameCallback",e)}},sv=typeof window>"u"?ZT:window?.ReactNativeWebView?VT:ov(window?.parent??window);var le=im(sv),WT=le;var om=Hb(),KT=Jb();function qT({code:t,details:e}){switch(t){case 4001:return new rs;case 4100:return new ns;case 4200:return new is;case 4900:return new os;case 4901:return new ss;default:return new xr(t,e??"Unknown provider RPC error")}}var Ri=Gb({...om,async request(t){let e=KT.prepare(t);try{let r=await le.ethProviderRequestV2(e).then(i=>Tc(i,{request:e,raw:!0}));if(r.error)throw qT(r.error);return r.result}catch(r){if(r instanceof Error&&r.message.match(/cannot read property 'apply'/i))return await le.ethProviderRequest(e);throw r instanceof xr||r instanceof Nt?r:new Wn({message:r instanceof Error?r.message:void 0})}}});async function av(){try{let t=await le.getCapabilities();return!t.includes("wallet.getEthereumProvider")&&!t.includes("wallet.getEvmProvider")?void 0:Ri}catch{return Ri}}function cv(t){let e=new CustomEvent("eip6963:announceProvider",{detail:Object.freeze(t)});window.dispatchEvent(e);let r=()=>window.dispatchEvent(e);return window.addEventListener("eip6963:requestProvider",r),()=>window.removeEventListener("eip6963:requestProvider",r)}typeof document<"u"&&(document.addEventListener("eip6963:requestProvider",()=>{le.eip6963RequestProvider()}),document.addEventListener("FarcasterFrameEthProviderEvent",t=>{if(t instanceof MessageEvent){let e=t.data;om.emit(e.event,...e.params)}}),document.addEventListener("FarcasterFrameEvent",t=>{if(t instanceof MessageEvent){let e=t.data;e.event==="eip6963:announceProvider"&&cv({info:e.info,provider:Ri})}}));typeof window<"u"&&(window.addEventListener("eip6963:requestProvider",()=>{le.eip6963RequestProvider()}),window.addEventListener("message",t=>{if(t instanceof MessageEvent&&t.data.type==="frameEthProviderEvent"){let e=t.data;om.emit(e.event,...e.params)}}),window.addEventListener("message",t=>{if(t instanceof MessageEvent&&t.data.type==="frameEvent"){let e=t.data.event;e.event==="eip6963:announceProvider"&&cv({info:e.info,provider:Ri})}}));var vm={};kt(vm,{quickAuth:()=>Ai});var HT=new TextEncoder,Cc=new TextDecoder,lB=2**32;var GT=t=>{let e=atob(t),r=new Uint8Array(e.length);for(let i=0;i<e.length;i++)r[i]=e.charCodeAt(i);return r},uv=t=>{let e=t;e instanceof Uint8Array&&(e=Cc.decode(e)),e=e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return GT(e)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}};var lv=uv;function YT(t){return typeof t=="object"&&t!==null}function sm(t){if(!YT(t)||Object.prototype.toString.call(t)!=="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}var Tt=class extends Error{constructor(e,r){super(e,r),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}};Tt.code="ERR_JOSE_GENERIC";var am=class extends Tt{constructor(e,r,i="unspecified",n="unspecified"){super(e,{cause:{claim:i,reason:n,payload:r}}),this.code="ERR_JWT_CLAIM_VALIDATION_FAILED",this.claim=i,this.reason=n,this.payload=r}};am.code="ERR_JWT_CLAIM_VALIDATION_FAILED";var cm=class extends Tt{constructor(e,r,i="unspecified",n="unspecified"){super(e,{cause:{claim:i,reason:n,payload:r}}),this.code="ERR_JWT_EXPIRED",this.claim=i,this.reason=n,this.payload=r}};cm.code="ERR_JWT_EXPIRED";var um=class extends Tt{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}};um.code="ERR_JOSE_ALG_NOT_ALLOWED";var lm=class extends Tt{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}};lm.code="ERR_JOSE_NOT_SUPPORTED";var fm=class extends Tt{constructor(e="decryption operation failed",r){super(e,r),this.code="ERR_JWE_DECRYPTION_FAILED"}};fm.code="ERR_JWE_DECRYPTION_FAILED";var dm=class extends Tt{constructor(){super(...arguments),this.code="ERR_JWE_INVALID"}};dm.code="ERR_JWE_INVALID";var hm=class extends Tt{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}};hm.code="ERR_JWS_INVALID";var hr=class extends Tt{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}};hr.code="ERR_JWT_INVALID";var pm=class extends Tt{constructor(){super(...arguments),this.code="ERR_JWK_INVALID"}};pm.code="ERR_JWK_INVALID";var mm=class extends Tt{constructor(){super(...arguments),this.code="ERR_JWKS_INVALID"}};mm.code="ERR_JWKS_INVALID";var gm=class extends Tt{constructor(e="no applicable key found in the JSON Web Key Set",r){super(e,r),this.code="ERR_JWKS_NO_MATCHING_KEY"}};gm.code="ERR_JWKS_NO_MATCHING_KEY";var ym=class extends Tt{constructor(e="multiple matching keys found in the JSON Web Key Set",r){super(e,r),this.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS"}};ym.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";var _m=class extends Tt{constructor(e="request timed out",r){super(e,r),this.code="ERR_JWKS_TIMEOUT"}};_m.code="ERR_JWKS_TIMEOUT";var bm=class extends Tt{constructor(e="signature verification failed",r){super(e,r),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}};bm.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";function fv(t){if(typeof t!="string")throw new hr("JWTs must use Compact JWS serialization, JWT must be a string");let{1:e,length:r}=t.split(".");if(r===5)throw new hr("Only JWTs using Compact JWS serialization can be decoded");if(r!==3)throw new hr("Invalid JWT");if(!e)throw new hr("JWTs must contain a payload");let i;try{i=lv(e)}catch{throw new hr("Failed to base64url decode the payload")}let n;try{n=JSON.parse(Cc.decode(i))}catch{throw new hr("Failed to parse the decoded payload as JSON")}if(!sm(n))throw new hr("Invalid JWT Claims Set");return n}function dv(t){return fv(t)}var Uc=class t extends Error{constructor(e,r={}){let i=(()=>{if(r.cause instanceof t){if(r.cause.details)return r.cause.details;if(r.cause.shortMessage)return r.cause.shortMessage}return r.cause&&"details"in r.cause&&typeof r.cause.details=="string"?r.cause.details:r.cause?.message?r.cause.message:r.details})(),n=[e||"An error occurred.",...r.metaMessages?["",...r.metaMessages]:[],...i?["",i?`Details: ${i}`:void 0]:[]].filter(o=>typeof o=="string").join(`
42
+ `);super(n,r.cause?{cause:r.cause}:void 0),this.name="BaseError",this.cause=r.cause,this.details=i,this.shortMessage=e}},ki=class extends Uc{constructor({status:e}){super(`Request failed with status ${e}`),this.name="RequestFailedError"}},Dc=class extends Uc{constructor(e){super(e),this.name="InvalidToken"}};async function hv({origin:t}){let e=await fetch(`${t}/nonce`,{method:"POST"});if(!e.ok)throw new ki({status:e.status});return await e.json()}async function pv({origin:t},e){let r=await fetch(`${t}/verify-siwf`,{method:"POST",headers:new Headers({"Content-Type":"application/json"}),body:JSON.stringify(e)});if(!r.ok)throw new ki({status:r.status});let i=await r.json();if(i.valid===!1)throw new Dc(i.message??"unknown");return{token:i.token}}function mv(t={}){return{origin:t.origin??"https://auth.farcaster.xyz"}}function gv(t={}){let e=mv(t);return{generateNonce:()=>hv(e),verifySiwf:r=>pv(e,r)}}var XT=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,QT=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;function yv(t){let{scheme:e,statement:r,...i}=t.match(XT)?.groups??{},{chainId:n,expirationTime:o,issuedAt:s,notBefore:c,requestId:u,...p}=t.match(QT)?.groups??{},m=t.split("Resources:")[1]?.split(`
43
+ - `).slice(1);return{...i,...p,...n?{chainId:Number(n)}:{},...o?{expirationTime:new Date(o)}:{},...s?{issuedAt:new Date(s)}:{},...c?{notBefore:new Date(c)}:{},...u?{requestId:u}:{},...m?{resources:m}:{},...e?{scheme:e}:{},...r?{statement:r}:{}}}var Ai=(()=>{let t,e;async function r(i){let n=gv({origin:i.quickAuthServerOrigin}),{nonce:o}=await n.generateNonce(),s=await le.signIn({nonce:o,acceptAuthAddress:!0});if(s.result){let c=yv(s.result.message);if(!c.domain)throw new Error("Missing domain on SIWE message");let u=await n.verifySiwf({domain:c.domain,message:s.result.message,signature:s.result.signature});return t={token:u.token,payload:dv(u.token)},u}throw s.error.type==="rejected_by_user"?new yn.RejectedByUser:new Error("Unreachable")}return{get token(){if(t&&new Date(t.payload.exp*1e3)>new Date(Date.now()+15e3))return t.token},async getToken(i={}){let n=i.force??!1;return t&&!n&&new Date(t.payload.exp*1e3)>new Date(Date.now()+15e3)?{token:t.token}:(e||(e=r(i)),e.finally(()=>{e=void 0}),e)},async fetch(i,n){let{token:o}=await this.getToken(),s=new Headers(n?.headers);return s.set("Authorization",`Bearer ${o}`),fetch(i,{...n,headers:s})}}})();function t$(){let t=new V_;return{get eventNames(){return t.eventNames.bind(t)},get listenerCount(){return t.listenerCount.bind(t)},get listeners(){return t.listeners.bind(t)},addListener:t.addListener.bind(t),emit:t.emit.bind(t),off:t.off.bind(t),on:t.on.bind(t),once:t.once.bind(t),removeAllListeners:t.removeAllListeners.bind(t),removeListener:t.removeListener.bind(t)}}var $t=t$();var{solanaProviderRequest:_v}=le,bv;_v&&(bv=Yp(em(_v)));async function wm(){let t;try{t=await le.getCapabilities()}catch{}if(t?.includes("wallet.getSolanaProvider"))return bv}var vv=null;async function r$(t=50){if(vv===!0)return!0;if(typeof window>"u"||!window.ReactNativeWebView&&window===window.parent)return!1;let e=await Promise.race([le.context.then(r=>!!r),new Promise(r=>{setTimeout(()=>r(!1),t)})]).catch(()=>!1);return e&&(vv=!0),e}var wv=async()=>{let t=await le.addMiniApp();if(t.result)return t.result;throw t.error.type==="invalid_domain_manifest"?new Hn.InvalidDomainManifest:t.error.type==="rejected_by_user"?new Hn.RejectedByUser:new Error("Unreachable")},xm={...$t,getCapabilities:le.getCapabilities,getChains:le.getChains,isInMiniApp:r$,context:le.context,back:Zb({miniAppHost:le,emitter:$t}),quickAuth:Ai,actions:{setPrimaryButton:le.setPrimaryButton.bind(le),ready:async(t={})=>await le.ready(t),close:le.close.bind(le),viewCast:le.viewCast.bind(le),viewProfile:le.viewProfile.bind(le),signIn:async t=>{let e=await le.signIn(t);if(e.result)return e.result;throw e.error.type==="rejected_by_user"?new yn.RejectedByUser:new Error("Unreachable")},openUrl:t=>{let e=typeof t=="string"?t:t.url;return le.openUrl(e.trim())},addFrame:wv,addMiniApp:wv,composeCast(t={}){return le.composeCast(t)},viewToken:le.viewToken.bind(le),sendToken:le.sendToken.bind(le),swapToken:le.swapToken.bind(le)},experimental:{getSolanaProvider:wm,quickAuth(t){return Ai.getToken(t)}},wallet:{ethProvider:Ri,getEthereumProvider:av,getSolanaProvider:wm},haptics:{impactOccurred:le.impactOccurred.bind(le),notificationOccurred:le.notificationOccurred.bind(le),selectionChanged:le.selectionChanged.bind(le)}};typeof document<"u"&&document.addEventListener("FarcasterFrameEvent",t=>{if(t instanceof MessageEvent){let e=t.data;e.event==="primary_button_clicked"?$t.emit("primaryButtonClicked"):e.event==="miniapp_added"?$t.emit("miniAppAdded",{notificationDetails:e.notificationDetails}):e.event==="miniapp_add_rejected"?$t.emit("miniAppAddRejected",{reason:e.reason}):e.event==="miniapp_removed"?$t.emit("miniAppRemoved"):e.event==="notifications_enabled"?$t.emit("notificationsEnabled",{notificationDetails:e.notificationDetails}):e.event==="notifications_disabled"?$t.emit("notificationsDisabled"):e.event==="back_navigation_triggered"&&$t.emit("backNavigationTriggered")}});typeof window<"u"&&window.addEventListener("message",t=>{if(t instanceof MessageEvent&&t.data.type==="frameEvent"){let e=t.data.event;e.event==="primary_button_clicked"?$t.emit("primaryButtonClicked"):e.event==="miniapp_added"?$t.emit("miniAppAdded",{notificationDetails:e.notificationDetails}):e.event==="miniapp_add_rejected"?$t.emit("miniAppAddRejected",{reason:e.reason}):e.event==="miniapp_removed"?$t.emit("miniAppRemoved"):e.event==="notifications_enabled"?$t.emit("notificationsEnabled",{notificationDetails:e.notificationDetails}):e.event==="notifications_disabled"?$t.emit("notificationsDisabled"):e.event==="back_navigation_triggered"&&$t.emit("backNavigationTriggered")}});var n$=xm;return ou(i$);})();
44
+ /*! Bundled license information:
45
+
46
+ ieee754/index.js:
47
+ (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
48
+
49
+ buffer/index.js:
50
+ (*!
51
+ * The buffer module from node.js, for the browser.
52
+ *
53
+ * @author Feross Aboukhadijeh <https://feross.org>
54
+ * @license MIT
55
+ *)
56
+
57
+ safe-buffer/index.js:
58
+ (*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
59
+
60
+ @solana/buffer-layout/lib/Layout.js:
61
+ (**
62
+ * Support for translating between Uint8Array instances and JavaScript
63
+ * native types.
64
+ *
65
+ * {@link module:Layout~Layout|Layout} is the basis of a class
66
+ * hierarchy that associates property names with sequences of encoded
67
+ * bytes.
68
+ *
69
+ * Layouts are supported for these scalar (numeric) types:
70
+ * * {@link module:Layout~UInt|Unsigned integers in little-endian
71
+ * format} with {@link module:Layout.u8|8-bit}, {@link
72
+ * module:Layout.u16|16-bit}, {@link module:Layout.u24|24-bit},
73
+ * {@link module:Layout.u32|32-bit}, {@link
74
+ * module:Layout.u40|40-bit}, and {@link module:Layout.u48|48-bit}
75
+ * representation ranges;
76
+ * * {@link module:Layout~UIntBE|Unsigned integers in big-endian
77
+ * format} with {@link module:Layout.u16be|16-bit}, {@link
78
+ * module:Layout.u24be|24-bit}, {@link module:Layout.u32be|32-bit},
79
+ * {@link module:Layout.u40be|40-bit}, and {@link
80
+ * module:Layout.u48be|48-bit} representation ranges;
81
+ * * {@link module:Layout~Int|Signed integers in little-endian
82
+ * format} with {@link module:Layout.s8|8-bit}, {@link
83
+ * module:Layout.s16|16-bit}, {@link module:Layout.s24|24-bit},
84
+ * {@link module:Layout.s32|32-bit}, {@link
85
+ * module:Layout.s40|40-bit}, and {@link module:Layout.s48|48-bit}
86
+ * representation ranges;
87
+ * * {@link module:Layout~IntBE|Signed integers in big-endian format}
88
+ * with {@link module:Layout.s16be|16-bit}, {@link
89
+ * module:Layout.s24be|24-bit}, {@link module:Layout.s32be|32-bit},
90
+ * {@link module:Layout.s40be|40-bit}, and {@link
91
+ * module:Layout.s48be|48-bit} representation ranges;
92
+ * * 64-bit integral values that decode to an exact (if magnitude is
93
+ * less than 2^53) or nearby integral Number in {@link
94
+ * module:Layout.nu64|unsigned little-endian}, {@link
95
+ * module:Layout.nu64be|unsigned big-endian}, {@link
96
+ * module:Layout.ns64|signed little-endian}, and {@link
97
+ * module:Layout.ns64be|unsigned big-endian} encodings;
98
+ * * 32-bit floating point values with {@link
99
+ * module:Layout.f32|little-endian} and {@link
100
+ * module:Layout.f32be|big-endian} representations;
101
+ * * 64-bit floating point values with {@link
102
+ * module:Layout.f64|little-endian} and {@link
103
+ * module:Layout.f64be|big-endian} representations;
104
+ * * {@link module:Layout.const|Constants} that take no space in the
105
+ * encoded expression.
106
+ *
107
+ * and for these aggregate types:
108
+ * * {@link module:Layout.seq|Sequence}s of instances of a {@link
109
+ * module:Layout~Layout|Layout}, with JavaScript representation as
110
+ * an Array and constant or data-dependent {@link
111
+ * module:Layout~Sequence#count|length};
112
+ * * {@link module:Layout.struct|Structure}s that aggregate a
113
+ * heterogeneous sequence of {@link module:Layout~Layout|Layout}
114
+ * instances, with JavaScript representation as an Object;
115
+ * * {@link module:Layout.union|Union}s that support multiple {@link
116
+ * module:Layout~VariantLayout|variant layouts} over a fixed
117
+ * (padded) or variable (not padded) span of bytes, using an
118
+ * unsigned integer at the start of the data or a separate {@link
119
+ * module:Layout.unionLayoutDiscriminator|layout element} to
120
+ * determine which layout to use when interpreting the buffer
121
+ * contents;
122
+ * * {@link module:Layout.bits|BitStructure}s that contain a sequence
123
+ * of individual {@link
124
+ * module:Layout~BitStructure#addField|BitField}s packed into an 8,
125
+ * 16, 24, or 32-bit unsigned integer starting at the least- or
126
+ * most-significant bit;
127
+ * * {@link module:Layout.cstr|C strings} of varying length;
128
+ * * {@link module:Layout.blob|Blobs} of fixed- or variable-{@link
129
+ * module:Layout~Blob#length|length} raw data.
130
+ *
131
+ * All {@link module:Layout~Layout|Layout} instances are immutable
132
+ * after construction, to prevent internal state from becoming
133
+ * inconsistent.
134
+ *
135
+ * @local Layout
136
+ * @local ExternalLayout
137
+ * @local GreedyCount
138
+ * @local OffsetLayout
139
+ * @local UInt
140
+ * @local UIntBE
141
+ * @local Int
142
+ * @local IntBE
143
+ * @local NearUInt64
144
+ * @local NearUInt64BE
145
+ * @local NearInt64
146
+ * @local NearInt64BE
147
+ * @local Float
148
+ * @local FloatBE
149
+ * @local Double
150
+ * @local DoubleBE
151
+ * @local Sequence
152
+ * @local Structure
153
+ * @local UnionDiscriminator
154
+ * @local UnionLayoutDiscriminator
155
+ * @local Union
156
+ * @local VariantLayout
157
+ * @local BitStructure
158
+ * @local BitField
159
+ * @local Boolean
160
+ * @local Blob
161
+ * @local CString
162
+ * @local Constant
163
+ * @local bindConstructorLayout
164
+ * @module Layout
165
+ * @license MIT
166
+ * @author Peter A. Bigot
167
+ * @see {@link https://github.com/pabigot/buffer-layout|buffer-layout on GitHub}
168
+ *)
169
+
170
+ @noble/hashes/esm/utils.js:
171
+ (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
172
+
173
+ @noble/curves/esm/abstract/utils.js:
174
+ @noble/curves/esm/abstract/modular.js:
175
+ @noble/curves/esm/abstract/curve.js:
176
+ @noble/curves/esm/abstract/edwards.js:
177
+ @noble/curves/esm/ed25519.js:
178
+ @noble/curves/esm/abstract/weierstrass.js:
179
+ @noble/curves/esm/_shortw_utils.js:
180
+ @noble/curves/esm/secp256k1.js:
181
+ (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
182
+
183
+ comlink/dist/esm/comlink.mjs:
184
+ (**
185
+ * @license
186
+ * Copyright 2019 Google LLC
187
+ * SPDX-License-Identifier: Apache-2.0
188
+ *)
189
+ */
190
+ //# sourceMappingURL=index.min.js.map