@farcaster/frame-sdk 0.1.13 → 0.2.0
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.
- package/dist/index.min.js +51 -12
- package/dist/index.min.js.map +4 -4
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
package/dist/index.min.js
CHANGED
|
@@ -1,18 +1,57 @@
|
|
|
1
|
-
"use strict";var frame=(()=>{var Jp=Object.create;var Mi=Object.defineProperty;var Xp=Object.getOwnPropertyDescriptor;var Qp=Object.getOwnPropertyNames;var e0=Object.getPrototypeOf,t0=Object.prototype.hasOwnProperty;var Ut=(r,e)=>()=>(r&&(e=r(r=0)),e);var $t=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Qt=(r,e)=>{for(var t in e)Mi(r,t,{get:e[t],enumerable:!0})},Nf=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Qp(e))!t0.call(r,s)&&s!==t&&Mi(r,s,{get:()=>e[s],enumerable:!(n=Xp(e,s))||n.enumerable});return r};var Sr=(r,e,t)=>(t=r!=null?Jp(e0(r)):{},Nf(e||!r||!r.__esModule?Mi(t,"default",{value:r,enumerable:!0}):t,r)),Pa=r=>Nf(Mi({},"__esModule",{value:!0}),r);var kl=$t(Wi=>{"use strict";Wi.byteLength=Am;Wi.toByteArray=km;Wi.fromByteArray=Nm;var yr=[],sr=[],xm=typeof Uint8Array<"u"?Uint8Array:Array,tc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Cn=0,Al=tc.length;Cn<Al;++Cn)yr[Cn]=tc[Cn],sr[tc.charCodeAt(Cn)]=Cn;var Cn,Al;sr[45]=62;sr[95]=63;function Il(r){var e=r.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}function Am(r){var e=Il(r),t=e[0],n=e[1];return(t+n)*3/4-n}function Im(r,e,t){return(e+t)*3/4-t}function km(r){var e,t=Il(r),n=t[0],s=t[1],i=new xm(Im(r,n,s)),o=0,c=s>0?n-4:n,u;for(u=0;u<c;u+=4)e=sr[r.charCodeAt(u)]<<18|sr[r.charCodeAt(u+1)]<<12|sr[r.charCodeAt(u+2)]<<6|sr[r.charCodeAt(u+3)],i[o++]=e>>16&255,i[o++]=e>>8&255,i[o++]=e&255;return s===2&&(e=sr[r.charCodeAt(u)]<<2|sr[r.charCodeAt(u+1)]>>4,i[o++]=e&255),s===1&&(e=sr[r.charCodeAt(u)]<<10|sr[r.charCodeAt(u+1)]<<4|sr[r.charCodeAt(u+2)]>>2,i[o++]=e>>8&255,i[o++]=e&255),i}function Om(r){return yr[r>>18&63]+yr[r>>12&63]+yr[r>>6&63]+yr[r&63]}function Tm(r,e,t){for(var n,s=[],i=e;i<t;i+=3)n=(r[i]<<16&16711680)+(r[i+1]<<8&65280)+(r[i+2]&255),s.push(Om(n));return s.join("")}function Nm(r){for(var e,t=r.length,n=t%3,s=[],i=16383,o=0,c=t-n;o<c;o+=i)s.push(Tm(r,o,o+i>c?c:o+i));return n===1?(e=r[t-1],s.push(yr[e>>2]+yr[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],s.push(yr[e>>10]+yr[e>>4&63]+yr[e<<2&63]+"=")),s.join("")}});var Ol=$t(rc=>{rc.read=function(r,e,t,n,s){var i,o,c=s*8-n-1,u=(1<<c)-1,p=u>>1,m=-7,b=t?s-1:0,x=t?-1:1,S=r[e+b];for(b+=x,i=S&(1<<-m)-1,S>>=-m,m+=c;m>0;i=i*256+r[e+b],b+=x,m-=8);for(o=i&(1<<-m)-1,i>>=-m,m+=n;m>0;o=o*256+r[e+b],b+=x,m-=8);if(i===0)i=1-p;else{if(i===u)return o?NaN:(S?-1:1)*(1/0);o=o+Math.pow(2,n),i=i-p}return(S?-1:1)*o*Math.pow(2,i-n)};rc.write=function(r,e,t,n,s,i){var o,c,u,p=i*8-s-1,m=(1<<p)-1,b=m>>1,x=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=n?0:i-1,T=n?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,o=m):(o=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+b>=1?e+=x/u:e+=x*Math.pow(2,1-b),e*u>=2&&(o++,u/=2),o+b>=m?(c=0,o=m):o+b>=1?(c=(e*u-1)*Math.pow(2,s),o=o+b):(c=e*Math.pow(2,b-1)*Math.pow(2,s),o=0));s>=8;r[t+S]=c&255,S+=T,c/=256,s-=8);for(o=o<<s|c,p+=s;p>0;r[t+S]=o&255,S+=T,o/=256,p-=8);r[t+S-T]|=I*128}});var Ws=$t(_s=>{"use strict";var nc=kl(),gs=Ol(),Tl=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;_s.Buffer=N;_s.SlowBuffer=Um;_s.INSPECT_MAX_BYTES=50;var qi=2147483647;_s.kMaxLength=qi;N.TYPED_ARRAY_SUPPORT=Lm();!N.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 Lm(){try{let r=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}Object.defineProperty(N.prototype,"parent",{enumerable:!0,get:function(){if(N.isBuffer(this))return this.buffer}});Object.defineProperty(N.prototype,"offset",{enumerable:!0,get:function(){if(N.isBuffer(this))return this.byteOffset}});function Or(r){if(r>qi)throw new RangeError('The value "'+r+'" is invalid for option "size"');let e=new Uint8Array(r);return Object.setPrototypeOf(e,N.prototype),e}function N(r,e,t){if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return ac(r)}return Cl(r,e,t)}N.poolSize=8192;function Cl(r,e,t){if(typeof r=="string")return Cm(r,e);if(ArrayBuffer.isView(r))return Pm(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(_r(r,ArrayBuffer)||r&&_r(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(_r(r,SharedArrayBuffer)||r&&_r(r.buffer,SharedArrayBuffer)))return ic(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=r.valueOf&&r.valueOf();if(n!=null&&n!==r)return N.from(n,e,t);let s=Mm(r);if(s)return s;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return N.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}N.from=function(r,e,t){return Cl(r,e,t)};Object.setPrototypeOf(N.prototype,Uint8Array.prototype);Object.setPrototypeOf(N,Uint8Array);function Pl(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function Bm(r,e,t){return Pl(r),r<=0?Or(r):e!==void 0?typeof t=="string"?Or(r).fill(e,t):Or(r).fill(e):Or(r)}N.alloc=function(r,e,t){return Bm(r,e,t)};function ac(r){return Pl(r),Or(r<0?0:cc(r)|0)}N.allocUnsafe=function(r){return ac(r)};N.allocUnsafeSlow=function(r){return ac(r)};function Cm(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!N.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let t=Ml(r,e)|0,n=Or(t),s=n.write(r,e);return s!==t&&(n=n.slice(0,s)),n}function sc(r){let e=r.length<0?0:cc(r.length)|0,t=Or(e);for(let n=0;n<e;n+=1)t[n]=r[n]&255;return t}function Pm(r){if(_r(r,Uint8Array)){let e=new Uint8Array(r);return ic(e.buffer,e.byteOffset,e.byteLength)}return sc(r)}function ic(r,e,t){if(e<0||r.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');let n;return e===void 0&&t===void 0?n=new Uint8Array(r):t===void 0?n=new Uint8Array(r,e):n=new Uint8Array(r,e,t),Object.setPrototypeOf(n,N.prototype),n}function Mm(r){if(N.isBuffer(r)){let e=cc(r.length)|0,t=Or(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r.length!="number"||fc(r.length)?Or(0):sc(r);if(r.type==="Buffer"&&Array.isArray(r.data))return sc(r.data)}function cc(r){if(r>=qi)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+qi.toString(16)+" bytes");return r|0}function Um(r){return+r!=r&&(r=0),N.alloc(+r)}N.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==N.prototype};N.compare=function(e,t){if(_r(e,Uint8Array)&&(e=N.from(e,e.offset,e.byteLength)),_r(t,Uint8Array)&&(t=N.from(t,t.offset,t.byteLength)),!N.isBuffer(e)||!N.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,s=t.length;for(let i=0,o=Math.min(n,s);i<o;++i)if(e[i]!==t[i]){n=e[i],s=t[i];break}return n<s?-1:s<n?1:0};N.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}};N.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return N.alloc(0);let n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;let s=N.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){let o=e[n];if(_r(o,Uint8Array))i+o.length>s.length?(N.isBuffer(o)||(o=N.from(o)),o.copy(s,i)):Uint8Array.prototype.set.call(s,o,i);else if(N.isBuffer(o))o.copy(s,i);else throw new TypeError('"list" argument must be an Array of Buffers');i+=o.length}return s};function Ml(r,e){if(N.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||_r(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);let t=r.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&t===0)return 0;let s=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return oc(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return jl(r).length;default:if(s)return n?-1:oc(r).length;e=(""+e).toLowerCase(),s=!0}}N.byteLength=Ml;function Dm(r,e,t){let n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return Gm(this,e,t);case"utf8":case"utf-8":return Dl(this,e,t);case"ascii":return Km(this,e,t);case"latin1":case"binary":return Hm(this,e,t);case"base64":return qm(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Zm(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}N.prototype._isBuffer=!0;function Pn(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}N.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 t=0;t<e;t+=2)Pn(this,t,t+1);return this};N.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 t=0;t<e;t+=4)Pn(this,t,t+3),Pn(this,t+1,t+2);return this};N.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 t=0;t<e;t+=8)Pn(this,t,t+7),Pn(this,t+1,t+6),Pn(this,t+2,t+5),Pn(this,t+3,t+4);return this};N.prototype.toString=function(){let e=this.length;return e===0?"":arguments.length===0?Dl(this,0,e):Dm.apply(this,arguments)};N.prototype.toLocaleString=N.prototype.toString;N.prototype.equals=function(e){if(!N.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:N.compare(this,e)===0};N.prototype.inspect=function(){let e="",t=_s.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"};Tl&&(N.prototype[Tl]=N.prototype.inspect);N.prototype.compare=function(e,t,n,s,i){if(_r(e,Uint8Array)&&(e=N.from(e,e.offset,e.byteLength)),!N.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),s===void 0&&(s=0),i===void 0&&(i=this.length),t<0||n>e.length||s<0||i>this.length)throw new RangeError("out of range index");if(s>=i&&t>=n)return 0;if(s>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,s>>>=0,i>>>=0,this===e)return 0;let o=i-s,c=n-t,u=Math.min(o,c),p=this.slice(s,i),m=e.slice(t,n);for(let b=0;b<u;++b)if(p[b]!==m[b]){o=p[b],c=m[b];break}return o<c?-1:c<o?1:0};function Ul(r,e,t,n,s){if(r.length===0)return-1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,fc(t)&&(t=s?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(s)return-1;t=r.length-1}else if(t<0)if(s)t=0;else return-1;if(typeof e=="string"&&(e=N.from(e,n)),N.isBuffer(e))return e.length===0?-1:Nl(r,e,t,n,s);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?s?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):Nl(r,[e],t,n,s);throw new TypeError("val must be string, number or Buffer")}function Nl(r,e,t,n,s){let i=1,o=r.length,c=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||e.length<2)return-1;i=2,o/=2,c/=2,t/=2}function u(m,b){return i===1?m[b]:m.readUInt16BE(b*i)}let p;if(s){let m=-1;for(p=t;p<o;p++)if(u(r,p)===u(e,m===-1?0:p-m)){if(m===-1&&(m=p),p-m+1===c)return m*i}else m!==-1&&(p-=p-m),m=-1}else for(t+c>o&&(t=o-c),p=t;p>=0;p--){let m=!0;for(let b=0;b<c;b++)if(u(r,p+b)!==u(e,b)){m=!1;break}if(m)return p}return-1}N.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1};N.prototype.indexOf=function(e,t,n){return Ul(this,e,t,n,!0)};N.prototype.lastIndexOf=function(e,t,n){return Ul(this,e,t,n,!1)};function zm(r,e,t,n){t=Number(t)||0;let s=r.length-t;n?(n=Number(n),n>s&&(n=s)):n=s;let i=e.length;n>i/2&&(n=i/2);let o;for(o=0;o<n;++o){let c=parseInt(e.substr(o*2,2),16);if(fc(c))return o;r[t+o]=c}return o}function Fm(r,e,t,n){return ji(oc(e,r.length-t),r,t,n)}function $m(r,e,t,n){return ji(Qm(e),r,t,n)}function Vm(r,e,t,n){return ji(jl(e),r,t,n)}function Wm(r,e,t,n){return ji(eg(e,r.length-t),r,t,n)}N.prototype.write=function(e,t,n,s){if(t===void 0)s="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")s=t,n=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(n)?(n=n>>>0,s===void 0&&(s="utf8")):(s=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let i=this.length-t;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");s||(s="utf8");let o=!1;for(;;)switch(s){case"hex":return zm(this,e,t,n);case"utf8":case"utf-8":return Fm(this,e,t,n);case"ascii":case"latin1":case"binary":return $m(this,e,t,n);case"base64":return Vm(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Wm(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+s);s=(""+s).toLowerCase(),o=!0}};N.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function qm(r,e,t){return e===0&&t===r.length?nc.fromByteArray(r):nc.fromByteArray(r.slice(e,t))}function Dl(r,e,t){t=Math.min(r.length,t);let n=[],s=e;for(;s<t;){let i=r[s],o=null,c=i>239?4:i>223?3:i>191?2:1;if(s+c<=t){let u,p,m,b;switch(c){case 1:i<128&&(o=i);break;case 2:u=r[s+1],(u&192)===128&&(b=(i&31)<<6|u&63,b>127&&(o=b));break;case 3:u=r[s+1],p=r[s+2],(u&192)===128&&(p&192)===128&&(b=(i&15)<<12|(u&63)<<6|p&63,b>2047&&(b<55296||b>57343)&&(o=b));break;case 4:u=r[s+1],p=r[s+2],m=r[s+3],(u&192)===128&&(p&192)===128&&(m&192)===128&&(b=(i&15)<<18|(u&63)<<12|(p&63)<<6|m&63,b>65535&&b<1114112&&(o=b))}}o===null?(o=65533,c=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),s+=c}return jm(n)}var Ll=4096;function jm(r){let e=r.length;if(e<=Ll)return String.fromCharCode.apply(String,r);let t="",n=0;for(;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=Ll));return t}function Km(r,e,t){let n="";t=Math.min(r.length,t);for(let s=e;s<t;++s)n+=String.fromCharCode(r[s]&127);return n}function Hm(r,e,t){let n="";t=Math.min(r.length,t);for(let s=e;s<t;++s)n+=String.fromCharCode(r[s]);return n}function Gm(r,e,t){let n=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>n)&&(t=n);let s="";for(let i=e;i<t;++i)s+=tg[r[i]];return s}function Zm(r,e,t){let n=r.slice(e,t),s="";for(let i=0;i<n.length-1;i+=2)s+=String.fromCharCode(n[i]+n[i+1]*256);return s}N.prototype.slice=function(e,t){let n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);let s=this.subarray(e,t);return Object.setPrototypeOf(s,N.prototype),s};function wt(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}N.prototype.readUintLE=N.prototype.readUIntLE=function(e,t,n){e=e>>>0,t=t>>>0,n||wt(e,t,this.length);let s=this[e],i=1,o=0;for(;++o<t&&(i*=256);)s+=this[e+o]*i;return s};N.prototype.readUintBE=N.prototype.readUIntBE=function(e,t,n){e=e>>>0,t=t>>>0,n||wt(e,t,this.length);let s=this[e+--t],i=1;for(;t>0&&(i*=256);)s+=this[e+--t]*i;return s};N.prototype.readUint8=N.prototype.readUInt8=function(e,t){return e=e>>>0,t||wt(e,1,this.length),this[e]};N.prototype.readUint16LE=N.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||wt(e,2,this.length),this[e]|this[e+1]<<8};N.prototype.readUint16BE=N.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||wt(e,2,this.length),this[e]<<8|this[e+1]};N.prototype.readUint32LE=N.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||wt(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};N.prototype.readUint32BE=N.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||wt(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};N.prototype.readBigUInt64LE=Kr(function(e){e=e>>>0,ys(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&Vs(e,this.length-8);let s=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(s)+(BigInt(i)<<BigInt(32))});N.prototype.readBigUInt64BE=Kr(function(e){e=e>>>0,ys(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&Vs(e,this.length-8);let s=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(s)<<BigInt(32))+BigInt(i)});N.prototype.readIntLE=function(e,t,n){e=e>>>0,t=t>>>0,n||wt(e,t,this.length);let s=this[e],i=1,o=0;for(;++o<t&&(i*=256);)s+=this[e+o]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*t)),s};N.prototype.readIntBE=function(e,t,n){e=e>>>0,t=t>>>0,n||wt(e,t,this.length);let s=t,i=1,o=this[e+--s];for(;s>0&&(i*=256);)o+=this[e+--s]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o};N.prototype.readInt8=function(e,t){return e=e>>>0,t||wt(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};N.prototype.readInt16LE=function(e,t){e=e>>>0,t||wt(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};N.prototype.readInt16BE=function(e,t){e=e>>>0,t||wt(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};N.prototype.readInt32LE=function(e,t){return e=e>>>0,t||wt(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};N.prototype.readInt32BE=function(e,t){return e=e>>>0,t||wt(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};N.prototype.readBigInt64LE=Kr(function(e){e=e>>>0,ys(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&Vs(e,this.length-8);let s=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(s)<<BigInt(32))+BigInt(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)});N.prototype.readBigInt64BE=Kr(function(e){e=e>>>0,ys(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&Vs(e,this.length-8);let s=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(s)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)});N.prototype.readFloatLE=function(e,t){return e=e>>>0,t||wt(e,4,this.length),gs.read(this,e,!0,23,4)};N.prototype.readFloatBE=function(e,t){return e=e>>>0,t||wt(e,4,this.length),gs.read(this,e,!1,23,4)};N.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||wt(e,8,this.length),gs.read(this,e,!0,52,8)};N.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||wt(e,8,this.length),gs.read(this,e,!1,52,8)};function qt(r,e,t,n,s,i){if(!N.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>s||e<i)throw new RangeError('"value" argument is out of bounds');if(t+n>r.length)throw new RangeError("Index out of range")}N.prototype.writeUintLE=N.prototype.writeUIntLE=function(e,t,n,s){if(e=+e,t=t>>>0,n=n>>>0,!s){let c=Math.pow(2,8*n)-1;qt(this,e,t,n,c,0)}let i=1,o=0;for(this[t]=e&255;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n};N.prototype.writeUintBE=N.prototype.writeUIntBE=function(e,t,n,s){if(e=+e,t=t>>>0,n=n>>>0,!s){let c=Math.pow(2,8*n)-1;qt(this,e,t,n,c,0)}let i=n-1,o=1;for(this[t+i]=e&255;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n};N.prototype.writeUint8=N.prototype.writeUInt8=function(e,t,n){return e=+e,t=t>>>0,n||qt(this,e,t,1,255,0),this[t]=e&255,t+1};N.prototype.writeUint16LE=N.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=t>>>0,n||qt(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2};N.prototype.writeUint16BE=N.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=t>>>0,n||qt(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2};N.prototype.writeUint32LE=N.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=t>>>0,n||qt(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4};N.prototype.writeUint32BE=N.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=t>>>0,n||qt(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function zl(r,e,t,n,s){ql(e,n,s,r,t,7);let i=Number(e&BigInt(4294967295));r[t++]=i,i=i>>8,r[t++]=i,i=i>>8,r[t++]=i,i=i>>8,r[t++]=i;let o=Number(e>>BigInt(32)&BigInt(4294967295));return r[t++]=o,o=o>>8,r[t++]=o,o=o>>8,r[t++]=o,o=o>>8,r[t++]=o,t}function Fl(r,e,t,n,s){ql(e,n,s,r,t,7);let i=Number(e&BigInt(4294967295));r[t+7]=i,i=i>>8,r[t+6]=i,i=i>>8,r[t+5]=i,i=i>>8,r[t+4]=i;let o=Number(e>>BigInt(32)&BigInt(4294967295));return r[t+3]=o,o=o>>8,r[t+2]=o,o=o>>8,r[t+1]=o,o=o>>8,r[t]=o,t+8}N.prototype.writeBigUInt64LE=Kr(function(e,t=0){return zl(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});N.prototype.writeBigUInt64BE=Kr(function(e,t=0){return Fl(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});N.prototype.writeIntLE=function(e,t,n,s){if(e=+e,t=t>>>0,!s){let u=Math.pow(2,8*n-1);qt(this,e,t,n,u-1,-u)}let i=0,o=1,c=0;for(this[t]=e&255;++i<n&&(o*=256);)e<0&&c===0&&this[t+i-1]!==0&&(c=1),this[t+i]=(e/o>>0)-c&255;return t+n};N.prototype.writeIntBE=function(e,t,n,s){if(e=+e,t=t>>>0,!s){let u=Math.pow(2,8*n-1);qt(this,e,t,n,u-1,-u)}let i=n-1,o=1,c=0;for(this[t+i]=e&255;--i>=0&&(o*=256);)e<0&&c===0&&this[t+i+1]!==0&&(c=1),this[t+i]=(e/o>>0)-c&255;return t+n};N.prototype.writeInt8=function(e,t,n){return e=+e,t=t>>>0,n||qt(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1};N.prototype.writeInt16LE=function(e,t,n){return e=+e,t=t>>>0,n||qt(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2};N.prototype.writeInt16BE=function(e,t,n){return e=+e,t=t>>>0,n||qt(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2};N.prototype.writeInt32LE=function(e,t,n){return e=+e,t=t>>>0,n||qt(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4};N.prototype.writeInt32BE=function(e,t,n){return e=+e,t=t>>>0,n||qt(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};N.prototype.writeBigInt64LE=Kr(function(e,t=0){return zl(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});N.prototype.writeBigInt64BE=Kr(function(e,t=0){return Fl(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function $l(r,e,t,n,s,i){if(t+n>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function Vl(r,e,t,n,s){return e=+e,t=t>>>0,s||$l(r,e,t,4,34028234663852886e22,-34028234663852886e22),gs.write(r,e,t,n,23,4),t+4}N.prototype.writeFloatLE=function(e,t,n){return Vl(this,e,t,!0,n)};N.prototype.writeFloatBE=function(e,t,n){return Vl(this,e,t,!1,n)};function Wl(r,e,t,n,s){return e=+e,t=t>>>0,s||$l(r,e,t,8,17976931348623157e292,-17976931348623157e292),gs.write(r,e,t,n,52,8),t+8}N.prototype.writeDoubleLE=function(e,t,n){return Wl(this,e,t,!0,n)};N.prototype.writeDoubleBE=function(e,t,n){return Wl(this,e,t,!1,n)};N.prototype.copy=function(e,t,n,s){if(!N.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!s&&s!==0&&(s=this.length),t>=e.length&&(t=e.length),t||(t=0),s>0&&s<n&&(s=n),s===n||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(s<0)throw new RangeError("sourceEnd out of bounds");s>this.length&&(s=this.length),e.length-t<s-n&&(s=e.length-t+n);let i=s-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,n,s):Uint8Array.prototype.set.call(e,this.subarray(n,s),t),i};N.prototype.fill=function(e,t,n,s){if(typeof e=="string"){if(typeof t=="string"?(s=t,t=0,n=this.length):typeof n=="string"&&(s=n,n=this.length),s!==void 0&&typeof s!="string")throw new TypeError("encoding must be a string");if(typeof s=="string"&&!N.isEncoding(s))throw new TypeError("Unknown encoding: "+s);if(e.length===1){let o=e.charCodeAt(0);(s==="utf8"&&o<128||s==="latin1")&&(e=o)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);let i;if(typeof e=="number")for(i=t;i<n;++i)this[i]=e;else{let o=N.isBuffer(e)?e:N.from(e,s),c=o.length;if(c===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<n-t;++i)this[i+t]=o[i%c]}return this};var ms={};function uc(r,e,t){ms[r]=class extends t{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${r}]`,this.stack,delete this.name}get code(){return r}set code(s){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:s,writable:!0})}toString(){return`${this.name} [${r}]: ${this.message}`}}}uc("ERR_BUFFER_OUT_OF_BOUNDS",function(r){return r?`${r} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);uc("ERR_INVALID_ARG_TYPE",function(r,e){return`The "${r}" argument must be of type number. Received type ${typeof e}`},TypeError);uc("ERR_OUT_OF_RANGE",function(r,e,t){let n=`The value of "${r}" is out of range.`,s=t;return Number.isInteger(t)&&Math.abs(t)>2**32?s=Bl(String(t)):typeof t=="bigint"&&(s=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(s=Bl(s)),s+="n"),n+=` It must be ${e}. Received ${s}`,n},RangeError);function Bl(r){let e="",t=r.length,n=r[0]==="-"?1:0;for(;t>=n+4;t-=3)e=`_${r.slice(t-3,t)}${e}`;return`${r.slice(0,t)}${e}`}function Ym(r,e,t){ys(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&Vs(e,r.length-(t+1))}function ql(r,e,t,n,s,i){if(r>t||r<e){let o=typeof e=="bigint"?"n":"",c;throw i>3?e===0||e===BigInt(0)?c=`>= 0${o} and < 2${o} ** ${(i+1)*8}${o}`:c=`>= -(2${o} ** ${(i+1)*8-1}${o}) and < 2 ** ${(i+1)*8-1}${o}`:c=`>= ${e}${o} and <= ${t}${o}`,new ms.ERR_OUT_OF_RANGE("value",c,r)}Ym(n,s,i)}function ys(r,e){if(typeof r!="number")throw new ms.ERR_INVALID_ARG_TYPE(e,"number",r)}function Vs(r,e,t){throw Math.floor(r)!==r?(ys(r,t),new ms.ERR_OUT_OF_RANGE(t||"offset","an integer",r)):e<0?new ms.ERR_BUFFER_OUT_OF_BOUNDS:new ms.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}var Jm=/[^+/0-9A-Za-z-_]/g;function Xm(r){if(r=r.split("=")[0],r=r.trim().replace(Jm,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function oc(r,e){e=e||1/0;let t,n=r.length,s=null,i=[];for(let o=0;o<n;++o){if(t=r.charCodeAt(o),t>55295&&t<57344){if(!s){if(t>56319){(e-=3)>-1&&i.push(239,191,189);continue}else if(o+1===n){(e-=3)>-1&&i.push(239,191,189);continue}s=t;continue}if(t<56320){(e-=3)>-1&&i.push(239,191,189),s=t;continue}t=(s-55296<<10|t-56320)+65536}else s&&(e-=3)>-1&&i.push(239,191,189);if(s=null,t<128){if((e-=1)<0)break;i.push(t)}else if(t<2048){if((e-=2)<0)break;i.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;i.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;i.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return i}function Qm(r){let e=[];for(let t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function eg(r,e){let t,n,s,i=[];for(let o=0;o<r.length&&!((e-=2)<0);++o)t=r.charCodeAt(o),n=t>>8,s=t%256,i.push(s),i.push(n);return i}function jl(r){return nc.toByteArray(Xm(r))}function ji(r,e,t,n){let s;for(s=0;s<n&&!(s+t>=e.length||s>=r.length);++s)e[s+t]=r[s];return s}function _r(r,e){return r instanceof e||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name}function fc(r){return r!==r}var tg=function(){let r="0123456789abcdef",e=new Array(256);for(let t=0;t<16;++t){let n=t*16;for(let s=0;s<16;++s)e[n+s]=r[t]+r[s]}return e}();function Kr(r){return typeof BigInt>"u"?rg:r}function rg(){throw new Error("BigInt not supported")}});var hd=$t(()=>{});var Mc=$t((pd,Pc)=>{(function(r,e){"use strict";function t(E,a){if(!E)throw new Error(a||"Assertion failed")}function n(E,a){E.super_=a;var l=function(){};l.prototype=a.prototype,E.prototype=new l,E.prototype.constructor=E}function s(E,a,l){if(s.isBN(E))return E;this.negative=0,this.words=null,this.length=0,this.red=null,E!==null&&((a==="le"||a==="be")&&(l=a,a=10),this._init(E||0,a||10,l||"be"))}typeof r=="object"?r.exports=s:e.BN=s,s.BN=s,s.wordSize=26;var i;try{typeof window<"u"&&typeof window.Buffer<"u"?i=window.Buffer:i=hd().Buffer}catch{}s.isBN=function(a){return a instanceof s?!0:a!==null&&typeof a=="object"&&a.constructor.wordSize===s.wordSize&&Array.isArray(a.words)},s.max=function(a,l){return a.cmp(l)>0?a:l},s.min=function(a,l){return a.cmp(l)<0?a:l},s.prototype._init=function(a,l,d){if(typeof a=="number")return this._initNumber(a,l,d);if(typeof a=="object")return this._initArray(a,l,d);l==="hex"&&(l=16),t(l===(l|0)&&l>=2&&l<=36),a=a.toString().replace(/\s+/g,"");var h=0;a[0]==="-"&&(h++,this.negative=1),h<a.length&&(l===16?this._parseHex(a,h,d):(this._parseBase(a,l,h),d==="le"&&this._initArray(this.toArray(),l,d)))},s.prototype._initNumber=function(a,l,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):(t(a<9007199254740992),this.words=[a&67108863,a/67108864&67108863,1],this.length=3),d==="le"&&this._initArray(this.toArray(),l,d)},s.prototype._initArray=function(a,l,d){if(t(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 g,w,v=0;if(d==="be")for(h=a.length-1,g=0;h>=0;h-=3)w=a[h]|a[h-1]<<8|a[h-2]<<16,this.words[g]|=w<<v&67108863,this.words[g+1]=w>>>26-v&67108863,v+=24,v>=26&&(v-=26,g++);else if(d==="le")for(h=0,g=0;h<a.length;h+=3)w=a[h]|a[h+1]<<8|a[h+2]<<16,this.words[g]|=w<<v&67108863,this.words[g+1]=w>>>26-v&67108863,v+=24,v>=26&&(v-=26,g++);return this._strip()};function o(E,a){var l=E.charCodeAt(a);if(l>=48&&l<=57)return l-48;if(l>=65&&l<=70)return l-55;if(l>=97&&l<=102)return l-87;t(!1,"Invalid character in "+E)}function c(E,a,l){var d=o(E,l);return l-1>=a&&(d|=o(E,l-1)<<4),d}s.prototype._parseHex=function(a,l,d){this.length=Math.ceil((a.length-l)/6),this.words=new Array(this.length);for(var h=0;h<this.length;h++)this.words[h]=0;var g=0,w=0,v;if(d==="be")for(h=a.length-1;h>=l;h-=2)v=c(a,l,h)<<g,this.words[w]|=v&67108863,g>=18?(g-=18,w+=1,this.words[w]|=v>>>26):g+=8;else{var y=a.length-l;for(h=y%2===0?l+1:l;h<a.length;h+=2)v=c(a,l,h)<<g,this.words[w]|=v&67108863,g>=18?(g-=18,w+=1,this.words[w]|=v>>>26):g+=8}this._strip()};function u(E,a,l,d){for(var h=0,g=0,w=Math.min(E.length,l),v=a;v<w;v++){var y=E.charCodeAt(v)-48;h*=d,y>=49?g=y-49+10:y>=17?g=y-17+10:g=y,t(y>=0&&g<d,"Invalid character"),h+=g}return h}s.prototype._parseBase=function(a,l,d){this.words=[0],this.length=1;for(var h=0,g=1;g<=67108863;g*=l)h++;h--,g=g/l|0;for(var w=a.length-d,v=w%h,y=Math.min(w,w-v)+d,f=0,_=d;_<y;_+=h)f=u(a,_,_+h,l),this.imuln(g),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f);if(v!==0){var C=1;for(f=u(a,_,a.length,l),_=0;_<v;_++)C*=l;this.imuln(C),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f)}this._strip()},s.prototype.copy=function(a){a.words=new Array(this.length);for(var l=0;l<this.length;l++)a.words[l]=this.words[l];a.length=this.length,a.negative=this.negative,a.red=this.red};function p(E,a){E.words=a.words,E.length=a.length,E.negative=a.negative,E.red=a.red}if(s.prototype._move=function(a){p(a,this)},s.prototype.clone=function(){var a=new s(null);return this.copy(a),a},s.prototype._expand=function(a){for(;this.length<a;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=m}catch{s.prototype.inspect=m}else s.prototype.inspect=m;function m(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var b=["","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"],x=[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],S=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(a,l){a=a||10,l=l|0||1;var d;if(a===16||a==="hex"){d="";for(var h=0,g=0,w=0;w<this.length;w++){var v=this.words[w],y=((v<<h|g)&16777215).toString(16);g=v>>>24-h&16777215,h+=2,h>=26&&(h-=26,w--),g!==0||w!==this.length-1?d=b[6-y.length]+y+d:d=y+d}for(g!==0&&(d=g.toString(16)+d);d.length%l!==0;)d="0"+d;return this.negative!==0&&(d="-"+d),d}if(a===(a|0)&&a>=2&&a<=36){var f=x[a],_=S[a];d="";var C=this.clone();for(C.negative=0;!C.isZero();){var D=C.modrn(_).toString(a);C=C.idivn(_),C.isZero()?d=D+d:d=b[f-D.length]+D+d}for(this.isZero()&&(d="0"+d);d.length%l!==0;)d="0"+d;return this.negative!==0&&(d="-"+d),d}t(!1,"Base should be between 2 and 36")},s.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&&t(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-a:a},s.prototype.toJSON=function(){return this.toString(16,2)},i&&(s.prototype.toBuffer=function(a,l){return this.toArrayLike(i,a,l)}),s.prototype.toArray=function(a,l){return this.toArrayLike(Array,a,l)};var T=function(a,l){return a.allocUnsafe?a.allocUnsafe(l):new a(l)};s.prototype.toArrayLike=function(a,l,d){this._strip();var h=this.byteLength(),g=d||Math.max(1,h);t(h<=g,"byte array longer than desired length"),t(g>0,"Requested array length <= 0");var w=T(a,g),v=l==="le"?"LE":"BE";return this["_toArrayLike"+v](w,h),w},s.prototype._toArrayLikeLE=function(a,l){for(var d=0,h=0,g=0,w=0;g<this.length;g++){var v=this.words[g]<<w|h;a[d++]=v&255,d<a.length&&(a[d++]=v>>8&255),d<a.length&&(a[d++]=v>>16&255),w===6?(d<a.length&&(a[d++]=v>>24&255),h=0,w=0):(h=v>>>24,w+=2)}if(d<a.length)for(a[d++]=h;d<a.length;)a[d++]=0},s.prototype._toArrayLikeBE=function(a,l){for(var d=a.length-1,h=0,g=0,w=0;g<this.length;g++){var v=this.words[g]<<w|h;a[d--]=v&255,d>=0&&(a[d--]=v>>8&255),d>=0&&(a[d--]=v>>16&255),w===6?(d>=0&&(a[d--]=v>>24&255),h=0,w=0):(h=v>>>24,w+=2)}if(d>=0)for(a[d--]=h;d>=0;)a[d--]=0},Math.clz32?s.prototype._countBits=function(a){return 32-Math.clz32(a)}:s.prototype._countBits=function(a){var l=a,d=0;return l>=4096&&(d+=13,l>>>=13),l>=64&&(d+=7,l>>>=7),l>=8&&(d+=4,l>>>=4),l>=2&&(d+=2,l>>>=2),d+l},s.prototype._zeroBits=function(a){if(a===0)return 26;var l=a,d=0;return(l&8191)===0&&(d+=13,l>>>=13),(l&127)===0&&(d+=7,l>>>=7),(l&15)===0&&(d+=4,l>>>=4),(l&3)===0&&(d+=2,l>>>=2),(l&1)===0&&d++,d},s.prototype.bitLength=function(){var a=this.words[this.length-1],l=this._countBits(a);return(this.length-1)*26+l};function I(E){for(var a=new Array(E.bitLength()),l=0;l<a.length;l++){var d=l/26|0,h=l%26;a[l]=E.words[d]>>>h&1}return a}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var a=0,l=0;l<this.length;l++){var d=this._zeroBits(this.words[l]);if(a+=d,d!==26)break}return a},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(a){return this.negative!==0?this.abs().inotn(a).iaddn(1):this.clone()},s.prototype.fromTwos=function(a){return this.testn(a-1)?this.notn(a).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(a){for(;this.length<a.length;)this.words[this.length++]=0;for(var l=0;l<a.length;l++)this.words[l]=this.words[l]|a.words[l];return this._strip()},s.prototype.ior=function(a){return t((this.negative|a.negative)===0),this.iuor(a)},s.prototype.or=function(a){return this.length>a.length?this.clone().ior(a):a.clone().ior(this)},s.prototype.uor=function(a){return this.length>a.length?this.clone().iuor(a):a.clone().iuor(this)},s.prototype.iuand=function(a){var l;this.length>a.length?l=a:l=this;for(var d=0;d<l.length;d++)this.words[d]=this.words[d]&a.words[d];return this.length=l.length,this._strip()},s.prototype.iand=function(a){return t((this.negative|a.negative)===0),this.iuand(a)},s.prototype.and=function(a){return this.length>a.length?this.clone().iand(a):a.clone().iand(this)},s.prototype.uand=function(a){return this.length>a.length?this.clone().iuand(a):a.clone().iuand(this)},s.prototype.iuxor=function(a){var l,d;this.length>a.length?(l=this,d=a):(l=a,d=this);for(var h=0;h<d.length;h++)this.words[h]=l.words[h]^d.words[h];if(this!==l)for(;h<l.length;h++)this.words[h]=l.words[h];return this.length=l.length,this._strip()},s.prototype.ixor=function(a){return t((this.negative|a.negative)===0),this.iuxor(a)},s.prototype.xor=function(a){return this.length>a.length?this.clone().ixor(a):a.clone().ixor(this)},s.prototype.uxor=function(a){return this.length>a.length?this.clone().iuxor(a):a.clone().iuxor(this)},s.prototype.inotn=function(a){t(typeof a=="number"&&a>=0);var l=Math.ceil(a/26)|0,d=a%26;this._expand(l),d>0&&l--;for(var h=0;h<l;h++)this.words[h]=~this.words[h]&67108863;return d>0&&(this.words[h]=~this.words[h]&67108863>>26-d),this._strip()},s.prototype.notn=function(a){return this.clone().inotn(a)},s.prototype.setn=function(a,l){t(typeof a=="number"&&a>=0);var d=a/26|0,h=a%26;return this._expand(d+1),l?this.words[d]=this.words[d]|1<<h:this.words[d]=this.words[d]&~(1<<h),this._strip()},s.prototype.iadd=function(a){var l;if(this.negative!==0&&a.negative===0)return this.negative=0,l=this.isub(a),this.negative^=1,this._normSign();if(this.negative===0&&a.negative!==0)return a.negative=0,l=this.isub(a),a.negative=1,l._normSign();var d,h;this.length>a.length?(d=this,h=a):(d=a,h=this);for(var g=0,w=0;w<h.length;w++)l=(d.words[w]|0)+(h.words[w]|0)+g,this.words[w]=l&67108863,g=l>>>26;for(;g!==0&&w<d.length;w++)l=(d.words[w]|0)+g,this.words[w]=l&67108863,g=l>>>26;if(this.length=d.length,g!==0)this.words[this.length]=g,this.length++;else if(d!==this)for(;w<d.length;w++)this.words[w]=d.words[w];return this},s.prototype.add=function(a){var l;return a.negative!==0&&this.negative===0?(a.negative=0,l=this.sub(a),a.negative^=1,l):a.negative===0&&this.negative!==0?(this.negative=0,l=a.sub(this),this.negative=1,l):this.length>a.length?this.clone().iadd(a):a.clone().iadd(this)},s.prototype.isub=function(a){if(a.negative!==0){a.negative=0;var l=this.iadd(a);return a.negative=1,l._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,g;d>0?(h=this,g=a):(h=a,g=this);for(var w=0,v=0;v<g.length;v++)l=(h.words[v]|0)-(g.words[v]|0)+w,w=l>>26,this.words[v]=l&67108863;for(;w!==0&&v<h.length;v++)l=(h.words[v]|0)+w,w=l>>26,this.words[v]=l&67108863;if(w===0&&v<h.length&&h!==this)for(;v<h.length;v++)this.words[v]=h.words[v];return this.length=Math.max(this.length,v),h!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(a){return this.clone().isub(a)};function A(E,a,l){l.negative=a.negative^E.negative;var d=E.length+a.length|0;l.length=d,d=d-1|0;var h=E.words[0]|0,g=a.words[0]|0,w=h*g,v=w&67108863,y=w/67108864|0;l.words[0]=v;for(var f=1;f<d;f++){for(var _=y>>>26,C=y&67108863,D=Math.min(f,a.length-1),$=Math.max(0,f-E.length+1);$<=D;$++){var X=f-$|0;h=E.words[X]|0,g=a.words[$]|0,w=h*g+C,_+=w/67108864|0,C=w&67108863}l.words[f]=C|0,y=_|0}return y!==0?l.words[f]=y|0:l.length--,l._strip()}var L=function(a,l,d){var h=a.words,g=l.words,w=d.words,v=0,y,f,_,C=h[0]|0,D=C&8191,$=C>>>13,X=h[1]|0,oe=X&8191,fe=X>>>13,Be=h[2]|0,he=Be&8191,me=Be>>>13,Gt=h[3]|0,xe=Gt&8191,Ne=Gt>>>13,Li=h[4]|0,je=Li&8191,Ke=Li>>>13,Bi=h[5]|0,Ue=Bi&8191,De=Bi>>>13,rs=h[6]|0,ze=rs&8191,Fe=rs>>>13,Us=h[7]|0,$e=Us&8191,Ve=Us>>>13,Ci=h[8]|0,He=Ci&8191,Ge=Ci>>>13,Pi=h[9]|0,Ye=Pi&8191,Je=Pi>>>13,Ef=g[0]|0,Xe=Ef&8191,Qe=Ef>>>13,Rf=g[1]|0,et=Rf&8191,tt=Rf>>>13,vf=g[2]|0,rt=vf&8191,nt=vf>>>13,Sf=g[3]|0,st=Sf&8191,it=Sf>>>13,xf=g[4]|0,ot=xf&8191,at=xf>>>13,Af=g[5]|0,ct=Af&8191,ut=Af>>>13,If=g[6]|0,ft=If&8191,lt=If>>>13,kf=g[7]|0,dt=kf&8191,ht=kf>>>13,Of=g[8]|0,pt=Of&8191,mt=Of>>>13,Tf=g[9]|0,gt=Tf&8191,yt=Tf>>>13;d.negative=a.negative^l.negative,d.length=19,y=Math.imul(D,Xe),f=Math.imul(D,Qe),f=f+Math.imul($,Xe)|0,_=Math.imul($,Qe);var ga=(v+y|0)+((f&8191)<<13)|0;v=(_+(f>>>13)|0)+(ga>>>26)|0,ga&=67108863,y=Math.imul(oe,Xe),f=Math.imul(oe,Qe),f=f+Math.imul(fe,Xe)|0,_=Math.imul(fe,Qe),y=y+Math.imul(D,et)|0,f=f+Math.imul(D,tt)|0,f=f+Math.imul($,et)|0,_=_+Math.imul($,tt)|0;var ya=(v+y|0)+((f&8191)<<13)|0;v=(_+(f>>>13)|0)+(ya>>>26)|0,ya&=67108863,y=Math.imul(he,Xe),f=Math.imul(he,Qe),f=f+Math.imul(me,Xe)|0,_=Math.imul(me,Qe),y=y+Math.imul(oe,et)|0,f=f+Math.imul(oe,tt)|0,f=f+Math.imul(fe,et)|0,_=_+Math.imul(fe,tt)|0,y=y+Math.imul(D,rt)|0,f=f+Math.imul(D,nt)|0,f=f+Math.imul($,rt)|0,_=_+Math.imul($,nt)|0;var _a=(v+y|0)+((f&8191)<<13)|0;v=(_+(f>>>13)|0)+(_a>>>26)|0,_a&=67108863,y=Math.imul(xe,Xe),f=Math.imul(xe,Qe),f=f+Math.imul(Ne,Xe)|0,_=Math.imul(Ne,Qe),y=y+Math.imul(he,et)|0,f=f+Math.imul(he,tt)|0,f=f+Math.imul(me,et)|0,_=_+Math.imul(me,tt)|0,y=y+Math.imul(oe,rt)|0,f=f+Math.imul(oe,nt)|0,f=f+Math.imul(fe,rt)|0,_=_+Math.imul(fe,nt)|0,y=y+Math.imul(D,st)|0,f=f+Math.imul(D,it)|0,f=f+Math.imul($,st)|0,_=_+Math.imul($,it)|0;var ba=(v+y|0)+((f&8191)<<13)|0;v=(_+(f>>>13)|0)+(ba>>>26)|0,ba&=67108863,y=Math.imul(je,Xe),f=Math.imul(je,Qe),f=f+Math.imul(Ke,Xe)|0,_=Math.imul(Ke,Qe),y=y+Math.imul(xe,et)|0,f=f+Math.imul(xe,tt)|0,f=f+Math.imul(Ne,et)|0,_=_+Math.imul(Ne,tt)|0,y=y+Math.imul(he,rt)|0,f=f+Math.imul(he,nt)|0,f=f+Math.imul(me,rt)|0,_=_+Math.imul(me,nt)|0,y=y+Math.imul(oe,st)|0,f=f+Math.imul(oe,it)|0,f=f+Math.imul(fe,st)|0,_=_+Math.imul(fe,it)|0,y=y+Math.imul(D,ot)|0,f=f+Math.imul(D,at)|0,f=f+Math.imul($,ot)|0,_=_+Math.imul($,at)|0;var wa=(v+y|0)+((f&8191)<<13)|0;v=(_+(f>>>13)|0)+(wa>>>26)|0,wa&=67108863,y=Math.imul(Ue,Xe),f=Math.imul(Ue,Qe),f=f+Math.imul(De,Xe)|0,_=Math.imul(De,Qe),y=y+Math.imul(je,et)|0,f=f+Math.imul(je,tt)|0,f=f+Math.imul(Ke,et)|0,_=_+Math.imul(Ke,tt)|0,y=y+Math.imul(xe,rt)|0,f=f+Math.imul(xe,nt)|0,f=f+Math.imul(Ne,rt)|0,_=_+Math.imul(Ne,nt)|0,y=y+Math.imul(he,st)|0,f=f+Math.imul(he,it)|0,f=f+Math.imul(me,st)|0,_=_+Math.imul(me,it)|0,y=y+Math.imul(oe,ot)|0,f=f+Math.imul(oe,at)|0,f=f+Math.imul(fe,ot)|0,_=_+Math.imul(fe,at)|0,y=y+Math.imul(D,ct)|0,f=f+Math.imul(D,ut)|0,f=f+Math.imul($,ct)|0,_=_+Math.imul($,ut)|0;var Ea=(v+y|0)+((f&8191)<<13)|0;v=(_+(f>>>13)|0)+(Ea>>>26)|0,Ea&=67108863,y=Math.imul(ze,Xe),f=Math.imul(ze,Qe),f=f+Math.imul(Fe,Xe)|0,_=Math.imul(Fe,Qe),y=y+Math.imul(Ue,et)|0,f=f+Math.imul(Ue,tt)|0,f=f+Math.imul(De,et)|0,_=_+Math.imul(De,tt)|0,y=y+Math.imul(je,rt)|0,f=f+Math.imul(je,nt)|0,f=f+Math.imul(Ke,rt)|0,_=_+Math.imul(Ke,nt)|0,y=y+Math.imul(xe,st)|0,f=f+Math.imul(xe,it)|0,f=f+Math.imul(Ne,st)|0,_=_+Math.imul(Ne,it)|0,y=y+Math.imul(he,ot)|0,f=f+Math.imul(he,at)|0,f=f+Math.imul(me,ot)|0,_=_+Math.imul(me,at)|0,y=y+Math.imul(oe,ct)|0,f=f+Math.imul(oe,ut)|0,f=f+Math.imul(fe,ct)|0,_=_+Math.imul(fe,ut)|0,y=y+Math.imul(D,ft)|0,f=f+Math.imul(D,lt)|0,f=f+Math.imul($,ft)|0,_=_+Math.imul($,lt)|0;var Ra=(v+y|0)+((f&8191)<<13)|0;v=(_+(f>>>13)|0)+(Ra>>>26)|0,Ra&=67108863,y=Math.imul($e,Xe),f=Math.imul($e,Qe),f=f+Math.imul(Ve,Xe)|0,_=Math.imul(Ve,Qe),y=y+Math.imul(ze,et)|0,f=f+Math.imul(ze,tt)|0,f=f+Math.imul(Fe,et)|0,_=_+Math.imul(Fe,tt)|0,y=y+Math.imul(Ue,rt)|0,f=f+Math.imul(Ue,nt)|0,f=f+Math.imul(De,rt)|0,_=_+Math.imul(De,nt)|0,y=y+Math.imul(je,st)|0,f=f+Math.imul(je,it)|0,f=f+Math.imul(Ke,st)|0,_=_+Math.imul(Ke,it)|0,y=y+Math.imul(xe,ot)|0,f=f+Math.imul(xe,at)|0,f=f+Math.imul(Ne,ot)|0,_=_+Math.imul(Ne,at)|0,y=y+Math.imul(he,ct)|0,f=f+Math.imul(he,ut)|0,f=f+Math.imul(me,ct)|0,_=_+Math.imul(me,ut)|0,y=y+Math.imul(oe,ft)|0,f=f+Math.imul(oe,lt)|0,f=f+Math.imul(fe,ft)|0,_=_+Math.imul(fe,lt)|0,y=y+Math.imul(D,dt)|0,f=f+Math.imul(D,ht)|0,f=f+Math.imul($,dt)|0,_=_+Math.imul($,ht)|0;var va=(v+y|0)+((f&8191)<<13)|0;v=(_+(f>>>13)|0)+(va>>>26)|0,va&=67108863,y=Math.imul(He,Xe),f=Math.imul(He,Qe),f=f+Math.imul(Ge,Xe)|0,_=Math.imul(Ge,Qe),y=y+Math.imul($e,et)|0,f=f+Math.imul($e,tt)|0,f=f+Math.imul(Ve,et)|0,_=_+Math.imul(Ve,tt)|0,y=y+Math.imul(ze,rt)|0,f=f+Math.imul(ze,nt)|0,f=f+Math.imul(Fe,rt)|0,_=_+Math.imul(Fe,nt)|0,y=y+Math.imul(Ue,st)|0,f=f+Math.imul(Ue,it)|0,f=f+Math.imul(De,st)|0,_=_+Math.imul(De,it)|0,y=y+Math.imul(je,ot)|0,f=f+Math.imul(je,at)|0,f=f+Math.imul(Ke,ot)|0,_=_+Math.imul(Ke,at)|0,y=y+Math.imul(xe,ct)|0,f=f+Math.imul(xe,ut)|0,f=f+Math.imul(Ne,ct)|0,_=_+Math.imul(Ne,ut)|0,y=y+Math.imul(he,ft)|0,f=f+Math.imul(he,lt)|0,f=f+Math.imul(me,ft)|0,_=_+Math.imul(me,lt)|0,y=y+Math.imul(oe,dt)|0,f=f+Math.imul(oe,ht)|0,f=f+Math.imul(fe,dt)|0,_=_+Math.imul(fe,ht)|0,y=y+Math.imul(D,pt)|0,f=f+Math.imul(D,mt)|0,f=f+Math.imul($,pt)|0,_=_+Math.imul($,mt)|0;var Sa=(v+y|0)+((f&8191)<<13)|0;v=(_+(f>>>13)|0)+(Sa>>>26)|0,Sa&=67108863,y=Math.imul(Ye,Xe),f=Math.imul(Ye,Qe),f=f+Math.imul(Je,Xe)|0,_=Math.imul(Je,Qe),y=y+Math.imul(He,et)|0,f=f+Math.imul(He,tt)|0,f=f+Math.imul(Ge,et)|0,_=_+Math.imul(Ge,tt)|0,y=y+Math.imul($e,rt)|0,f=f+Math.imul($e,nt)|0,f=f+Math.imul(Ve,rt)|0,_=_+Math.imul(Ve,nt)|0,y=y+Math.imul(ze,st)|0,f=f+Math.imul(ze,it)|0,f=f+Math.imul(Fe,st)|0,_=_+Math.imul(Fe,it)|0,y=y+Math.imul(Ue,ot)|0,f=f+Math.imul(Ue,at)|0,f=f+Math.imul(De,ot)|0,_=_+Math.imul(De,at)|0,y=y+Math.imul(je,ct)|0,f=f+Math.imul(je,ut)|0,f=f+Math.imul(Ke,ct)|0,_=_+Math.imul(Ke,ut)|0,y=y+Math.imul(xe,ft)|0,f=f+Math.imul(xe,lt)|0,f=f+Math.imul(Ne,ft)|0,_=_+Math.imul(Ne,lt)|0,y=y+Math.imul(he,dt)|0,f=f+Math.imul(he,ht)|0,f=f+Math.imul(me,dt)|0,_=_+Math.imul(me,ht)|0,y=y+Math.imul(oe,pt)|0,f=f+Math.imul(oe,mt)|0,f=f+Math.imul(fe,pt)|0,_=_+Math.imul(fe,mt)|0,y=y+Math.imul(D,gt)|0,f=f+Math.imul(D,yt)|0,f=f+Math.imul($,gt)|0,_=_+Math.imul($,yt)|0;var xa=(v+y|0)+((f&8191)<<13)|0;v=(_+(f>>>13)|0)+(xa>>>26)|0,xa&=67108863,y=Math.imul(Ye,et),f=Math.imul(Ye,tt),f=f+Math.imul(Je,et)|0,_=Math.imul(Je,tt),y=y+Math.imul(He,rt)|0,f=f+Math.imul(He,nt)|0,f=f+Math.imul(Ge,rt)|0,_=_+Math.imul(Ge,nt)|0,y=y+Math.imul($e,st)|0,f=f+Math.imul($e,it)|0,f=f+Math.imul(Ve,st)|0,_=_+Math.imul(Ve,it)|0,y=y+Math.imul(ze,ot)|0,f=f+Math.imul(ze,at)|0,f=f+Math.imul(Fe,ot)|0,_=_+Math.imul(Fe,at)|0,y=y+Math.imul(Ue,ct)|0,f=f+Math.imul(Ue,ut)|0,f=f+Math.imul(De,ct)|0,_=_+Math.imul(De,ut)|0,y=y+Math.imul(je,ft)|0,f=f+Math.imul(je,lt)|0,f=f+Math.imul(Ke,ft)|0,_=_+Math.imul(Ke,lt)|0,y=y+Math.imul(xe,dt)|0,f=f+Math.imul(xe,ht)|0,f=f+Math.imul(Ne,dt)|0,_=_+Math.imul(Ne,ht)|0,y=y+Math.imul(he,pt)|0,f=f+Math.imul(he,mt)|0,f=f+Math.imul(me,pt)|0,_=_+Math.imul(me,mt)|0,y=y+Math.imul(oe,gt)|0,f=f+Math.imul(oe,yt)|0,f=f+Math.imul(fe,gt)|0,_=_+Math.imul(fe,yt)|0;var Aa=(v+y|0)+((f&8191)<<13)|0;v=(_+(f>>>13)|0)+(Aa>>>26)|0,Aa&=67108863,y=Math.imul(Ye,rt),f=Math.imul(Ye,nt),f=f+Math.imul(Je,rt)|0,_=Math.imul(Je,nt),y=y+Math.imul(He,st)|0,f=f+Math.imul(He,it)|0,f=f+Math.imul(Ge,st)|0,_=_+Math.imul(Ge,it)|0,y=y+Math.imul($e,ot)|0,f=f+Math.imul($e,at)|0,f=f+Math.imul(Ve,ot)|0,_=_+Math.imul(Ve,at)|0,y=y+Math.imul(ze,ct)|0,f=f+Math.imul(ze,ut)|0,f=f+Math.imul(Fe,ct)|0,_=_+Math.imul(Fe,ut)|0,y=y+Math.imul(Ue,ft)|0,f=f+Math.imul(Ue,lt)|0,f=f+Math.imul(De,ft)|0,_=_+Math.imul(De,lt)|0,y=y+Math.imul(je,dt)|0,f=f+Math.imul(je,ht)|0,f=f+Math.imul(Ke,dt)|0,_=_+Math.imul(Ke,ht)|0,y=y+Math.imul(xe,pt)|0,f=f+Math.imul(xe,mt)|0,f=f+Math.imul(Ne,pt)|0,_=_+Math.imul(Ne,mt)|0,y=y+Math.imul(he,gt)|0,f=f+Math.imul(he,yt)|0,f=f+Math.imul(me,gt)|0,_=_+Math.imul(me,yt)|0;var Ia=(v+y|0)+((f&8191)<<13)|0;v=(_+(f>>>13)|0)+(Ia>>>26)|0,Ia&=67108863,y=Math.imul(Ye,st),f=Math.imul(Ye,it),f=f+Math.imul(Je,st)|0,_=Math.imul(Je,it),y=y+Math.imul(He,ot)|0,f=f+Math.imul(He,at)|0,f=f+Math.imul(Ge,ot)|0,_=_+Math.imul(Ge,at)|0,y=y+Math.imul($e,ct)|0,f=f+Math.imul($e,ut)|0,f=f+Math.imul(Ve,ct)|0,_=_+Math.imul(Ve,ut)|0,y=y+Math.imul(ze,ft)|0,f=f+Math.imul(ze,lt)|0,f=f+Math.imul(Fe,ft)|0,_=_+Math.imul(Fe,lt)|0,y=y+Math.imul(Ue,dt)|0,f=f+Math.imul(Ue,ht)|0,f=f+Math.imul(De,dt)|0,_=_+Math.imul(De,ht)|0,y=y+Math.imul(je,pt)|0,f=f+Math.imul(je,mt)|0,f=f+Math.imul(Ke,pt)|0,_=_+Math.imul(Ke,mt)|0,y=y+Math.imul(xe,gt)|0,f=f+Math.imul(xe,yt)|0,f=f+Math.imul(Ne,gt)|0,_=_+Math.imul(Ne,yt)|0;var ka=(v+y|0)+((f&8191)<<13)|0;v=(_+(f>>>13)|0)+(ka>>>26)|0,ka&=67108863,y=Math.imul(Ye,ot),f=Math.imul(Ye,at),f=f+Math.imul(Je,ot)|0,_=Math.imul(Je,at),y=y+Math.imul(He,ct)|0,f=f+Math.imul(He,ut)|0,f=f+Math.imul(Ge,ct)|0,_=_+Math.imul(Ge,ut)|0,y=y+Math.imul($e,ft)|0,f=f+Math.imul($e,lt)|0,f=f+Math.imul(Ve,ft)|0,_=_+Math.imul(Ve,lt)|0,y=y+Math.imul(ze,dt)|0,f=f+Math.imul(ze,ht)|0,f=f+Math.imul(Fe,dt)|0,_=_+Math.imul(Fe,ht)|0,y=y+Math.imul(Ue,pt)|0,f=f+Math.imul(Ue,mt)|0,f=f+Math.imul(De,pt)|0,_=_+Math.imul(De,mt)|0,y=y+Math.imul(je,gt)|0,f=f+Math.imul(je,yt)|0,f=f+Math.imul(Ke,gt)|0,_=_+Math.imul(Ke,yt)|0;var Oa=(v+y|0)+((f&8191)<<13)|0;v=(_+(f>>>13)|0)+(Oa>>>26)|0,Oa&=67108863,y=Math.imul(Ye,ct),f=Math.imul(Ye,ut),f=f+Math.imul(Je,ct)|0,_=Math.imul(Je,ut),y=y+Math.imul(He,ft)|0,f=f+Math.imul(He,lt)|0,f=f+Math.imul(Ge,ft)|0,_=_+Math.imul(Ge,lt)|0,y=y+Math.imul($e,dt)|0,f=f+Math.imul($e,ht)|0,f=f+Math.imul(Ve,dt)|0,_=_+Math.imul(Ve,ht)|0,y=y+Math.imul(ze,pt)|0,f=f+Math.imul(ze,mt)|0,f=f+Math.imul(Fe,pt)|0,_=_+Math.imul(Fe,mt)|0,y=y+Math.imul(Ue,gt)|0,f=f+Math.imul(Ue,yt)|0,f=f+Math.imul(De,gt)|0,_=_+Math.imul(De,yt)|0;var Ta=(v+y|0)+((f&8191)<<13)|0;v=(_+(f>>>13)|0)+(Ta>>>26)|0,Ta&=67108863,y=Math.imul(Ye,ft),f=Math.imul(Ye,lt),f=f+Math.imul(Je,ft)|0,_=Math.imul(Je,lt),y=y+Math.imul(He,dt)|0,f=f+Math.imul(He,ht)|0,f=f+Math.imul(Ge,dt)|0,_=_+Math.imul(Ge,ht)|0,y=y+Math.imul($e,pt)|0,f=f+Math.imul($e,mt)|0,f=f+Math.imul(Ve,pt)|0,_=_+Math.imul(Ve,mt)|0,y=y+Math.imul(ze,gt)|0,f=f+Math.imul(ze,yt)|0,f=f+Math.imul(Fe,gt)|0,_=_+Math.imul(Fe,yt)|0;var Na=(v+y|0)+((f&8191)<<13)|0;v=(_+(f>>>13)|0)+(Na>>>26)|0,Na&=67108863,y=Math.imul(Ye,dt),f=Math.imul(Ye,ht),f=f+Math.imul(Je,dt)|0,_=Math.imul(Je,ht),y=y+Math.imul(He,pt)|0,f=f+Math.imul(He,mt)|0,f=f+Math.imul(Ge,pt)|0,_=_+Math.imul(Ge,mt)|0,y=y+Math.imul($e,gt)|0,f=f+Math.imul($e,yt)|0,f=f+Math.imul(Ve,gt)|0,_=_+Math.imul(Ve,yt)|0;var La=(v+y|0)+((f&8191)<<13)|0;v=(_+(f>>>13)|0)+(La>>>26)|0,La&=67108863,y=Math.imul(Ye,pt),f=Math.imul(Ye,mt),f=f+Math.imul(Je,pt)|0,_=Math.imul(Je,mt),y=y+Math.imul(He,gt)|0,f=f+Math.imul(He,yt)|0,f=f+Math.imul(Ge,gt)|0,_=_+Math.imul(Ge,yt)|0;var Ba=(v+y|0)+((f&8191)<<13)|0;v=(_+(f>>>13)|0)+(Ba>>>26)|0,Ba&=67108863,y=Math.imul(Ye,gt),f=Math.imul(Ye,yt),f=f+Math.imul(Je,gt)|0,_=Math.imul(Je,yt);var Ca=(v+y|0)+((f&8191)<<13)|0;return v=(_+(f>>>13)|0)+(Ca>>>26)|0,Ca&=67108863,w[0]=ga,w[1]=ya,w[2]=_a,w[3]=ba,w[4]=wa,w[5]=Ea,w[6]=Ra,w[7]=va,w[8]=Sa,w[9]=xa,w[10]=Aa,w[11]=Ia,w[12]=ka,w[13]=Oa,w[14]=Ta,w[15]=Na,w[16]=La,w[17]=Ba,w[18]=Ca,v!==0&&(w[19]=v,d.length++),d};Math.imul||(L=A);function U(E,a,l){l.negative=a.negative^E.negative,l.length=E.length+a.length;for(var d=0,h=0,g=0;g<l.length-1;g++){var w=h;h=0;for(var v=d&67108863,y=Math.min(g,a.length-1),f=Math.max(0,g-E.length+1);f<=y;f++){var _=g-f,C=E.words[_]|0,D=a.words[f]|0,$=C*D,X=$&67108863;w=w+($/67108864|0)|0,X=X+v|0,v=X&67108863,w=w+(X>>>26)|0,h+=w>>>26,w&=67108863}l.words[g]=v,d=w,w=h}return d!==0?l.words[g]=d:l.length--,l._strip()}function B(E,a,l){return U(E,a,l)}s.prototype.mulTo=function(a,l){var d,h=this.length+a.length;return this.length===10&&a.length===10?d=L(this,a,l):h<63?d=A(this,a,l):h<1024?d=U(this,a,l):d=B(this,a,l),d};function F(E,a){this.x=E,this.y=a}F.prototype.makeRBT=function(a){for(var l=new Array(a),d=s.prototype._countBits(a)-1,h=0;h<a;h++)l[h]=this.revBin(h,d,a);return l},F.prototype.revBin=function(a,l,d){if(a===0||a===d-1)return a;for(var h=0,g=0;g<l;g++)h|=(a&1)<<l-g-1,a>>=1;return h},F.prototype.permute=function(a,l,d,h,g,w){for(var v=0;v<w;v++)h[v]=l[a[v]],g[v]=d[a[v]]},F.prototype.transform=function(a,l,d,h,g,w){this.permute(w,a,l,d,h,g);for(var v=1;v<g;v<<=1)for(var y=v<<1,f=Math.cos(2*Math.PI/y),_=Math.sin(2*Math.PI/y),C=0;C<g;C+=y)for(var D=f,$=_,X=0;X<v;X++){var oe=d[C+X],fe=h[C+X],Be=d[C+X+v],he=h[C+X+v],me=D*Be-$*he;he=D*he+$*Be,Be=me,d[C+X]=oe+Be,h[C+X]=fe+he,d[C+X+v]=oe-Be,h[C+X+v]=fe-he,X!==y&&(me=f*D-_*$,$=f*$+_*D,D=me)}},F.prototype.guessLen13b=function(a,l){var d=Math.max(l,a)|1,h=d&1,g=0;for(d=d/2|0;d;d=d>>>1)g++;return 1<<g+1+h},F.prototype.conjugate=function(a,l,d){if(!(d<=1))for(var h=0;h<d/2;h++){var g=a[h];a[h]=a[d-h-1],a[d-h-1]=g,g=l[h],l[h]=-l[d-h-1],l[d-h-1]=-g}},F.prototype.normalize13b=function(a,l){for(var d=0,h=0;h<l/2;h++){var g=Math.round(a[2*h+1]/l)*8192+Math.round(a[2*h]/l)+d;a[h]=g&67108863,g<67108864?d=0:d=g/67108864|0}return a},F.prototype.convert13b=function(a,l,d,h){for(var g=0,w=0;w<l;w++)g=g+(a[w]|0),d[2*w]=g&8191,g=g>>>13,d[2*w+1]=g&8191,g=g>>>13;for(w=2*l;w<h;++w)d[w]=0;t(g===0),t((g&-8192)===0)},F.prototype.stub=function(a){for(var l=new Array(a),d=0;d<a;d++)l[d]=0;return l},F.prototype.mulp=function(a,l,d){var h=2*this.guessLen13b(a.length,l.length),g=this.makeRBT(h),w=this.stub(h),v=new Array(h),y=new Array(h),f=new Array(h),_=new Array(h),C=new Array(h),D=new Array(h),$=d.words;$.length=h,this.convert13b(a.words,a.length,v,h),this.convert13b(l.words,l.length,_,h),this.transform(v,w,y,f,h,g),this.transform(_,w,C,D,h,g);for(var X=0;X<h;X++){var oe=y[X]*C[X]-f[X]*D[X];f[X]=y[X]*D[X]+f[X]*C[X],y[X]=oe}return this.conjugate(y,f,h),this.transform(y,f,$,w,h,g),this.conjugate($,w,h),this.normalize13b($,h),d.negative=a.negative^l.negative,d.length=a.length+l.length,d._strip()},s.prototype.mul=function(a){var l=new s(null);return l.words=new Array(this.length+a.length),this.mulTo(a,l)},s.prototype.mulf=function(a){var l=new s(null);return l.words=new Array(this.length+a.length),B(this,a,l)},s.prototype.imul=function(a){return this.clone().mulTo(a,this)},s.prototype.imuln=function(a){var l=a<0;l&&(a=-a),t(typeof a=="number"),t(a<67108864);for(var d=0,h=0;h<this.length;h++){var g=(this.words[h]|0)*a,w=(g&67108863)+(d&67108863);d>>=26,d+=g/67108864|0,d+=w>>>26,this.words[h]=w&67108863}return d!==0&&(this.words[h]=d,this.length++),l?this.ineg():this},s.prototype.muln=function(a){return this.clone().imuln(a)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(a){var l=I(a);if(l.length===0)return new s(1);for(var d=this,h=0;h<l.length&&l[h]===0;h++,d=d.sqr());if(++h<l.length)for(var g=d.sqr();h<l.length;h++,g=g.sqr())l[h]!==0&&(d=d.mul(g));return d},s.prototype.iushln=function(a){t(typeof a=="number"&&a>=0);var l=a%26,d=(a-l)/26,h=67108863>>>26-l<<26-l,g;if(l!==0){var w=0;for(g=0;g<this.length;g++){var v=this.words[g]&h,y=(this.words[g]|0)-v<<l;this.words[g]=y|w,w=v>>>26-l}w&&(this.words[g]=w,this.length++)}if(d!==0){for(g=this.length-1;g>=0;g--)this.words[g+d]=this.words[g];for(g=0;g<d;g++)this.words[g]=0;this.length+=d}return this._strip()},s.prototype.ishln=function(a){return t(this.negative===0),this.iushln(a)},s.prototype.iushrn=function(a,l,d){t(typeof a=="number"&&a>=0);var h;l?h=(l-l%26)/26:h=0;var g=a%26,w=Math.min((a-g)/26,this.length),v=67108863^67108863>>>g<<g,y=d;if(h-=w,h=Math.max(0,h),y){for(var f=0;f<w;f++)y.words[f]=this.words[f];y.length=w}if(w!==0)if(this.length>w)for(this.length-=w,f=0;f<this.length;f++)this.words[f]=this.words[f+w];else this.words[0]=0,this.length=1;var _=0;for(f=this.length-1;f>=0&&(_!==0||f>=h);f--){var C=this.words[f]|0;this.words[f]=_<<26-g|C>>>g,_=C&v}return y&&_!==0&&(y.words[y.length++]=_),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(a,l,d){return t(this.negative===0),this.iushrn(a,l,d)},s.prototype.shln=function(a){return this.clone().ishln(a)},s.prototype.ushln=function(a){return this.clone().iushln(a)},s.prototype.shrn=function(a){return this.clone().ishrn(a)},s.prototype.ushrn=function(a){return this.clone().iushrn(a)},s.prototype.testn=function(a){t(typeof a=="number"&&a>=0);var l=a%26,d=(a-l)/26,h=1<<l;if(this.length<=d)return!1;var g=this.words[d];return!!(g&h)},s.prototype.imaskn=function(a){t(typeof a=="number"&&a>=0);var l=a%26,d=(a-l)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=d)return this;if(l!==0&&d++,this.length=Math.min(d,this.length),l!==0){var h=67108863^67108863>>>l<<l;this.words[this.length-1]&=h}return this._strip()},s.prototype.maskn=function(a){return this.clone().imaskn(a)},s.prototype.iaddn=function(a){return t(typeof a=="number"),t(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)},s.prototype._iaddn=function(a){this.words[0]+=a;for(var l=0;l<this.length&&this.words[l]>=67108864;l++)this.words[l]-=67108864,l===this.length-1?this.words[l+1]=1:this.words[l+1]++;return this.length=Math.max(this.length,l+1),this},s.prototype.isubn=function(a){if(t(typeof a=="number"),t(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 l=0;l<this.length&&this.words[l]<0;l++)this.words[l]+=67108864,this.words[l+1]-=1;return this._strip()},s.prototype.addn=function(a){return this.clone().iaddn(a)},s.prototype.subn=function(a){return this.clone().isubn(a)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(a,l,d){var h=a.length+d,g;this._expand(h);var w,v=0;for(g=0;g<a.length;g++){w=(this.words[g+d]|0)+v;var y=(a.words[g]|0)*l;w-=y&67108863,v=(w>>26)-(y/67108864|0),this.words[g+d]=w&67108863}for(;g<this.length-d;g++)w=(this.words[g+d]|0)+v,v=w>>26,this.words[g+d]=w&67108863;if(v===0)return this._strip();for(t(v===-1),v=0,g=0;g<this.length;g++)w=-(this.words[g]|0)+v,v=w>>26,this.words[g]=w&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(a,l){var d=this.length-a.length,h=this.clone(),g=a,w=g.words[g.length-1]|0,v=this._countBits(w);d=26-v,d!==0&&(g=g.ushln(d),h.iushln(d),w=g.words[g.length-1]|0);var y=h.length-g.length,f;if(l!=="mod"){f=new s(null),f.length=y+1,f.words=new Array(f.length);for(var _=0;_<f.length;_++)f.words[_]=0}var C=h.clone()._ishlnsubmul(g,1,y);C.negative===0&&(h=C,f&&(f.words[y]=1));for(var D=y-1;D>=0;D--){var $=(h.words[g.length+D]|0)*67108864+(h.words[g.length+D-1]|0);for($=Math.min($/w|0,67108863),h._ishlnsubmul(g,$,D);h.negative!==0;)$--,h.negative=0,h._ishlnsubmul(g,1,D),h.isZero()||(h.negative^=1);f&&(f.words[D]=$)}return f&&f._strip(),h._strip(),l!=="div"&&d!==0&&h.iushrn(d),{div:f||null,mod:h}},s.prototype.divmod=function(a,l,d){if(t(!a.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var h,g,w;return this.negative!==0&&a.negative===0?(w=this.neg().divmod(a,l),l!=="mod"&&(h=w.div.neg()),l!=="div"&&(g=w.mod.neg(),d&&g.negative!==0&&g.iadd(a)),{div:h,mod:g}):this.negative===0&&a.negative!==0?(w=this.divmod(a.neg(),l),l!=="mod"&&(h=w.div.neg()),{div:h,mod:w.mod}):(this.negative&a.negative)!==0?(w=this.neg().divmod(a.neg(),l),l!=="div"&&(g=w.mod.neg(),d&&g.negative!==0&&g.isub(a)),{div:w.div,mod:g}):a.length>this.length||this.cmp(a)<0?{div:new s(0),mod:this}:a.length===1?l==="div"?{div:this.divn(a.words[0]),mod:null}:l==="mod"?{div:null,mod:new s(this.modrn(a.words[0]))}:{div:this.divn(a.words[0]),mod:new s(this.modrn(a.words[0]))}:this._wordDiv(a,l)},s.prototype.div=function(a){return this.divmod(a,"div",!1).div},s.prototype.mod=function(a){return this.divmod(a,"mod",!1).mod},s.prototype.umod=function(a){return this.divmod(a,"mod",!0).mod},s.prototype.divRound=function(a){var l=this.divmod(a);if(l.mod.isZero())return l.div;var d=l.div.negative!==0?l.mod.isub(a):l.mod,h=a.ushrn(1),g=a.andln(1),w=d.cmp(h);return w<0||g===1&&w===0?l.div:l.div.negative!==0?l.div.isubn(1):l.div.iaddn(1)},s.prototype.modrn=function(a){var l=a<0;l&&(a=-a),t(a<=67108863);for(var d=(1<<26)%a,h=0,g=this.length-1;g>=0;g--)h=(d*h+(this.words[g]|0))%a;return l?-h:h},s.prototype.modn=function(a){return this.modrn(a)},s.prototype.idivn=function(a){var l=a<0;l&&(a=-a),t(a<=67108863);for(var d=0,h=this.length-1;h>=0;h--){var g=(this.words[h]|0)+d*67108864;this.words[h]=g/a|0,d=g%a}return this._strip(),l?this.ineg():this},s.prototype.divn=function(a){return this.clone().idivn(a)},s.prototype.egcd=function(a){t(a.negative===0),t(!a.isZero());var l=this,d=a.clone();l.negative!==0?l=l.umod(a):l=l.clone();for(var h=new s(1),g=new s(0),w=new s(0),v=new s(1),y=0;l.isEven()&&d.isEven();)l.iushrn(1),d.iushrn(1),++y;for(var f=d.clone(),_=l.clone();!l.isZero();){for(var C=0,D=1;(l.words[0]&D)===0&&C<26;++C,D<<=1);if(C>0)for(l.iushrn(C);C-- >0;)(h.isOdd()||g.isOdd())&&(h.iadd(f),g.isub(_)),h.iushrn(1),g.iushrn(1);for(var $=0,X=1;(d.words[0]&X)===0&&$<26;++$,X<<=1);if($>0)for(d.iushrn($);$-- >0;)(w.isOdd()||v.isOdd())&&(w.iadd(f),v.isub(_)),w.iushrn(1),v.iushrn(1);l.cmp(d)>=0?(l.isub(d),h.isub(w),g.isub(v)):(d.isub(l),w.isub(h),v.isub(g))}return{a:w,b:v,gcd:d.iushln(y)}},s.prototype._invmp=function(a){t(a.negative===0),t(!a.isZero());var l=this,d=a.clone();l.negative!==0?l=l.umod(a):l=l.clone();for(var h=new s(1),g=new s(0),w=d.clone();l.cmpn(1)>0&&d.cmpn(1)>0;){for(var v=0,y=1;(l.words[0]&y)===0&&v<26;++v,y<<=1);if(v>0)for(l.iushrn(v);v-- >0;)h.isOdd()&&h.iadd(w),h.iushrn(1);for(var f=0,_=1;(d.words[0]&_)===0&&f<26;++f,_<<=1);if(f>0)for(d.iushrn(f);f-- >0;)g.isOdd()&&g.iadd(w),g.iushrn(1);l.cmp(d)>=0?(l.isub(d),h.isub(g)):(d.isub(l),g.isub(h))}var C;return l.cmpn(1)===0?C=h:C=g,C.cmpn(0)<0&&C.iadd(a),C},s.prototype.gcd=function(a){if(this.isZero())return a.abs();if(a.isZero())return this.abs();var l=this.clone(),d=a.clone();l.negative=0,d.negative=0;for(var h=0;l.isEven()&&d.isEven();h++)l.iushrn(1),d.iushrn(1);do{for(;l.isEven();)l.iushrn(1);for(;d.isEven();)d.iushrn(1);var g=l.cmp(d);if(g<0){var w=l;l=d,d=w}else if(g===0||d.cmpn(1)===0)break;l.isub(d)}while(!0);return d.iushln(h)},s.prototype.invm=function(a){return this.egcd(a).a.umod(a)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(a){return this.words[0]&a},s.prototype.bincn=function(a){t(typeof a=="number");var l=a%26,d=(a-l)/26,h=1<<l;if(this.length<=d)return this._expand(d+1),this.words[d]|=h,this;for(var g=h,w=d;g!==0&&w<this.length;w++){var v=this.words[w]|0;v+=g,g=v>>>26,v&=67108863,this.words[w]=v}return g!==0&&(this.words[w]=g,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(a){var l=a<0;if(this.negative!==0&&!l)return-1;if(this.negative===0&&l)return 1;this._strip();var d;if(this.length>1)d=1;else{l&&(a=-a),t(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},s.prototype.cmp=function(a){if(this.negative!==0&&a.negative===0)return-1;if(this.negative===0&&a.negative!==0)return 1;var l=this.ucmp(a);return this.negative!==0?-l|0:l},s.prototype.ucmp=function(a){if(this.length>a.length)return 1;if(this.length<a.length)return-1;for(var l=0,d=this.length-1;d>=0;d--){var h=this.words[d]|0,g=a.words[d]|0;if(h!==g){h<g?l=-1:h>g&&(l=1);break}}return l},s.prototype.gtn=function(a){return this.cmpn(a)===1},s.prototype.gt=function(a){return this.cmp(a)===1},s.prototype.gten=function(a){return this.cmpn(a)>=0},s.prototype.gte=function(a){return this.cmp(a)>=0},s.prototype.ltn=function(a){return this.cmpn(a)===-1},s.prototype.lt=function(a){return this.cmp(a)===-1},s.prototype.lten=function(a){return this.cmpn(a)<=0},s.prototype.lte=function(a){return this.cmp(a)<=0},s.prototype.eqn=function(a){return this.cmpn(a)===0},s.prototype.eq=function(a){return this.cmp(a)===0},s.red=function(a){return new re(a)},s.prototype.toRed=function(a){return t(!this.red,"Already a number in reduction context"),t(this.negative===0,"red works only with positives"),a.convertTo(this)._forceRed(a)},s.prototype.fromRed=function(){return t(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(a){return this.red=a,this},s.prototype.forceRed=function(a){return t(!this.red,"Already a number in reduction context"),this._forceRed(a)},s.prototype.redAdd=function(a){return t(this.red,"redAdd works only with red numbers"),this.red.add(this,a)},s.prototype.redIAdd=function(a){return t(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,a)},s.prototype.redSub=function(a){return t(this.red,"redSub works only with red numbers"),this.red.sub(this,a)},s.prototype.redISub=function(a){return t(this.red,"redISub works only with red numbers"),this.red.isub(this,a)},s.prototype.redShl=function(a){return t(this.red,"redShl works only with red numbers"),this.red.shl(this,a)},s.prototype.redMul=function(a){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.mul(this,a)},s.prototype.redIMul=function(a){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.imul(this,a)},s.prototype.redSqr=function(){return t(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return t(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return t(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return t(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return t(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(a){return t(this.red&&!a.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,a)};var te={k256:null,p224:null,p192:null,p25519:null};function G(E,a){this.name=E,this.p=new s(a,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}G.prototype._tmp=function(){var a=new s(null);return a.words=new Array(Math.ceil(this.n/13)),a},G.prototype.ireduce=function(a){var l=a,d;do this.split(l,this.tmp),l=this.imulK(l),l=l.iadd(this.tmp),d=l.bitLength();while(d>this.n);var h=d<this.n?-1:l.ucmp(this.p);return h===0?(l.words[0]=0,l.length=1):h>0?l.isub(this.p):l.strip!==void 0?l.strip():l._strip(),l},G.prototype.split=function(a,l){a.iushrn(this.n,0,l)},G.prototype.imulK=function(a){return a.imul(this.k)};function Z(){G.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(Z,G),Z.prototype.split=function(a,l){for(var d=4194303,h=Math.min(a.length,9),g=0;g<h;g++)l.words[g]=a.words[g];if(l.length=h,a.length<=9){a.words[0]=0,a.length=1;return}var w=a.words[9];for(l.words[l.length++]=w&d,g=10;g<a.length;g++){var v=a.words[g]|0;a.words[g-10]=(v&d)<<4|w>>>22,w=v}w>>>=22,a.words[g-10]=w,w===0&&a.length>10?a.length-=10:a.length-=9},Z.prototype.imulK=function(a){a.words[a.length]=0,a.words[a.length+1]=0,a.length+=2;for(var l=0,d=0;d<a.length;d++){var h=a.words[d]|0;l+=h*977,a.words[d]=l&67108863,l=h*64+(l/67108864|0)}return a.words[a.length-1]===0&&(a.length--,a.words[a.length-1]===0&&a.length--),a};function ee(){G.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(ee,G);function Y(){G.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(Y,G);function Ie(){G.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(Ie,G),Ie.prototype.imulK=function(a){for(var l=0,d=0;d<a.length;d++){var h=(a.words[d]|0)*19+l,g=h&67108863;h>>>=26,a.words[d]=g,l=h}return l!==0&&(a.words[a.length++]=l),a},s._prime=function(a){if(te[a])return te[a];var l;if(a==="k256")l=new Z;else if(a==="p224")l=new ee;else if(a==="p192")l=new Y;else if(a==="p25519")l=new Ie;else throw new Error("Unknown prime "+a);return te[a]=l,l};function re(E){if(typeof E=="string"){var a=s._prime(E);this.m=a.p,this.prime=a}else t(E.gtn(1),"modulus must be greater than 1"),this.m=E,this.prime=null}re.prototype._verify1=function(a){t(a.negative===0,"red works only with positives"),t(a.red,"red works only with red numbers")},re.prototype._verify2=function(a,l){t((a.negative|l.negative)===0,"red works only with positives"),t(a.red&&a.red===l.red,"red works only with red numbers")},re.prototype.imod=function(a){return this.prime?this.prime.ireduce(a)._forceRed(this):(p(a,a.umod(this.m)._forceRed(this)),a)},re.prototype.neg=function(a){return a.isZero()?a.clone():this.m.sub(a)._forceRed(this)},re.prototype.add=function(a,l){this._verify2(a,l);var d=a.add(l);return d.cmp(this.m)>=0&&d.isub(this.m),d._forceRed(this)},re.prototype.iadd=function(a,l){this._verify2(a,l);var d=a.iadd(l);return d.cmp(this.m)>=0&&d.isub(this.m),d},re.prototype.sub=function(a,l){this._verify2(a,l);var d=a.sub(l);return d.cmpn(0)<0&&d.iadd(this.m),d._forceRed(this)},re.prototype.isub=function(a,l){this._verify2(a,l);var d=a.isub(l);return d.cmpn(0)<0&&d.iadd(this.m),d},re.prototype.shl=function(a,l){return this._verify1(a),this.imod(a.ushln(l))},re.prototype.imul=function(a,l){return this._verify2(a,l),this.imod(a.imul(l))},re.prototype.mul=function(a,l){return this._verify2(a,l),this.imod(a.mul(l))},re.prototype.isqr=function(a){return this.imul(a,a.clone())},re.prototype.sqr=function(a){return this.mul(a,a)},re.prototype.sqrt=function(a){if(a.isZero())return a.clone();var l=this.m.andln(3);if(t(l%2===1),l===3){var d=this.m.add(new s(1)).iushrn(2);return this.pow(a,d)}for(var h=this.m.subn(1),g=0;!h.isZero()&&h.andln(1)===0;)g++,h.iushrn(1);t(!h.isZero());var w=new s(1).toRed(this),v=w.redNeg(),y=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new s(2*f*f).toRed(this);this.pow(f,y).cmp(v)!==0;)f.redIAdd(v);for(var _=this.pow(f,h),C=this.pow(a,h.addn(1).iushrn(1)),D=this.pow(a,h),$=g;D.cmp(w)!==0;){for(var X=D,oe=0;X.cmp(w)!==0;oe++)X=X.redSqr();t(oe<$);var fe=this.pow(_,new s(1).iushln($-oe-1));C=C.redMul(fe),_=fe.redSqr(),D=D.redMul(_),$=oe}return C},re.prototype.invm=function(a){var l=a._invmp(this.m);return l.negative!==0?(l.negative=0,this.imod(l).redNeg()):this.imod(l)},re.prototype.pow=function(a,l){if(l.isZero())return new s(1).toRed(this);if(l.cmpn(1)===0)return a.clone();var d=4,h=new Array(1<<d);h[0]=new s(1).toRed(this),h[1]=a;for(var g=2;g<h.length;g++)h[g]=this.mul(h[g-1],a);var w=h[0],v=0,y=0,f=l.bitLength()%26;for(f===0&&(f=26),g=l.length-1;g>=0;g--){for(var _=l.words[g],C=f-1;C>=0;C--){var D=_>>C&1;if(w!==h[0]&&(w=this.sqr(w)),D===0&&v===0){y=0;continue}v<<=1,v|=D,y++,!(y!==d&&(g!==0||C!==0))&&(w=this.mul(w,h[v]),y=0,v=0)}f=26}return w},re.prototype.convertTo=function(a){var l=a.umod(this.m);return l===a?l.clone():l},re.prototype.convertFrom=function(a){var l=a.clone();return l.red=null,l},s.mont=function(a){return new le(a)};function le(E){re.call(this,E),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(le,re),le.prototype.convertTo=function(a){return this.imod(a.ushln(this.shift))},le.prototype.convertFrom=function(a){var l=this.imod(a.mul(this.rinv));return l.red=null,l},le.prototype.imul=function(a,l){if(a.isZero()||l.isZero())return a.words[0]=0,a.length=1,a;var d=a.imul(l),h=d.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),g=d.isub(h).iushrn(this.shift),w=g;return g.cmp(this.m)>=0?w=g.isub(this.m):g.cmpn(0)<0&&(w=g.iadd(this.m)),w._forceRed(this)},le.prototype.mul=function(a,l){if(a.isZero()||l.isZero())return new s(0)._forceRed(this);var d=a.mul(l),h=d.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),g=d.isub(h).iushrn(this.shift),w=g;return g.cmp(this.m)>=0?w=g.isub(this.m):g.cmpn(0)<0&&(w=g.iadd(this.m)),w._forceRed(this)},le.prototype.invm=function(a){var l=this.imod(a._invmp(this.m).mul(this.r2));return l._forceRed(this)}})(typeof Pc>"u"||Pc,pd)});var yd=$t((Uc,gd)=>{var so=Ws(),wr=so.Buffer;function md(r,e){for(var t in r)e[t]=r[t]}wr.from&&wr.alloc&&wr.allocUnsafe&&wr.allocUnsafeSlow?gd.exports=so:(md(so,Uc),Uc.Buffer=Wn);function Wn(r,e,t){return wr(r,e,t)}Wn.prototype=Object.create(wr.prototype);md(wr,Wn);Wn.from=function(r,e,t){if(typeof r=="number")throw new TypeError("Argument must not be a number");return wr(r,e,t)};Wn.alloc=function(r,e,t){if(typeof r!="number")throw new TypeError("Argument must be a number");var n=wr(r);return e!==void 0?typeof t=="string"?n.fill(e,t):n.fill(e):n.fill(0),n};Wn.allocUnsafe=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return wr(r)};Wn.allocUnsafeSlow=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return so.SlowBuffer(r)}});var bd=$t((Bx,_d)=>{"use strict";var io=yd().Buffer;function ry(r){if(r.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),t=0;t<e.length;t++)e[t]=255;for(var n=0;n<r.length;n++){var s=r.charAt(n),i=s.charCodeAt(0);if(e[i]!==255)throw new TypeError(s+" is ambiguous");e[i]=n}var o=r.length,c=r.charAt(0),u=Math.log(o)/Math.log(256),p=Math.log(256)/Math.log(o);function m(S){if((Array.isArray(S)||S instanceof Uint8Array)&&(S=io.from(S)),!io.isBuffer(S))throw new TypeError("Expected Buffer");if(S.length===0)return"";for(var T=0,I=0,A=0,L=S.length;A!==L&&S[A]===0;)A++,T++;for(var U=(L-A)*p+1>>>0,B=new Uint8Array(U);A!==L;){for(var F=S[A],te=0,G=U-1;(F!==0||te<I)&&G!==-1;G--,te++)F+=256*B[G]>>>0,B[G]=F%o>>>0,F=F/o>>>0;if(F!==0)throw new Error("Non-zero carry");I=te,A++}for(var Z=U-I;Z!==U&&B[Z]===0;)Z++;for(var ee=c.repeat(T);Z<U;++Z)ee+=r.charAt(B[Z]);return ee}function b(S){if(typeof S!="string")throw new TypeError("Expected String");if(S.length===0)return io.alloc(0);for(var T=0,I=0,A=0;S[T]===c;)I++,T++;for(var L=(S.length-T)*u+1>>>0,U=new Uint8Array(L);T<S.length;){var B=S.charCodeAt(T);if(B>255)return;var F=e[B];if(F===255)return;for(var te=0,G=L-1;(F!==0||te<A)&&G!==-1;G--,te++)F+=o*U[G]>>>0,U[G]=F%256>>>0,F=F/256>>>0;if(F!==0)throw new Error("Non-zero carry");A=te,T++}for(var Z=L-A;Z!==L&&U[Z]===0;)Z++;var ee=io.allocUnsafe(I+(L-Z));ee.fill(0,0,I);for(var Y=I;Z!==L;)ee[Y++]=U[Z++];return ee}function x(S){var T=b(S);if(T)return T;throw new Error("Non-base"+o+" character")}return{encode:m,decodeUnsafe:b,decode:x}}_d.exports=ry});var Dc=$t((Cx,wd)=>{var ny=bd(),sy="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";wd.exports=ny(sy)});var Ed=$t(Vc=>{"use strict";function Pr(r,e,t){return e<=r&&r<=t}function fo(r){if(r===void 0)return{};if(r===Object(r))return r;throw TypeError("Could not convert argument to dictionary")}function oy(r){for(var e=String(r),t=e.length,n=0,s=[];n<t;){var i=e.charCodeAt(n);if(i<55296||i>57343)s.push(i);else if(56320<=i&&i<=57343)s.push(65533);else if(55296<=i&&i<=56319)if(n===t-1)s.push(65533);else{var o=r.charCodeAt(n+1);if(56320<=o&&o<=57343){var c=i&1023,u=o&1023;s.push(65536+(c<<10)+u),n+=1}else s.push(65533)}n+=1}return s}function ay(r){for(var e="",t=0;t<r.length;++t){var n=r[t];n<=65535?e+=String.fromCharCode(n):(n-=65536,e+=String.fromCharCode((n>>10)+55296,(n&1023)+56320))}return e}var oo=-1;function $c(r){this.tokens=[].slice.call(r)}$c.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():oo},prepend:function(r){if(Array.isArray(r))for(var e=r;e.length;)this.tokens.unshift(e.pop());else this.tokens.unshift(r)},push:function(r){if(Array.isArray(r))for(var e=r;e.length;)this.tokens.push(e.shift());else this.tokens.push(r)}};var Rs=-1;function Fc(r,e){if(r)throw TypeError("Decoder error");return e||65533}var ao="utf-8";function co(r,e){if(!(this instanceof co))return new co(r,e);if(r=r!==void 0?String(r).toLowerCase():ao,r!==ao)throw new Error("Encoding not supported. Only utf-8 is supported");e=fo(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})}co.prototype={decode:function(e,t){var n;typeof e=="object"&&e instanceof ArrayBuffer?n=new Uint8Array(e):typeof e=="object"&&"buffer"in e&&e.buffer instanceof ArrayBuffer?n=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):n=new Uint8Array(0),t=fo(t),this._streaming||(this._decoder=new cy({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!t.stream;for(var s=new $c(n),i=[],o;!s.endOfStream()&&(o=this._decoder.handler(s,s.read()),o!==Rs);)o!==null&&(Array.isArray(o)?i.push.apply(i,o):i.push(o));if(!this._streaming){do{if(o=this._decoder.handler(s,s.read()),o===Rs)break;o!==null&&(Array.isArray(o)?i.push.apply(i,o):i.push(o))}while(!s.endOfStream());this._decoder=null}return i.length&&["utf-8"].indexOf(this.encoding)!==-1&&!this._ignoreBOM&&!this._BOMseen&&(i[0]===65279?(this._BOMseen=!0,i.shift()):this._BOMseen=!0),ay(i)}};function uo(r,e){if(!(this instanceof uo))return new uo(r,e);if(r=r!==void 0?String(r).toLowerCase():ao,r!==ao)throw new Error("Encoding not supported. Only utf-8 is supported");e=fo(e),this._streaming=!1,this._encoder=null,this._options={fatal:!!e.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}uo.prototype={encode:function(e,t){e=e?String(e):"",t=fo(t),this._streaming||(this._encoder=new uy(this._options)),this._streaming=!!t.stream;for(var n=[],s=new $c(oy(e)),i;!s.endOfStream()&&(i=this._encoder.handler(s,s.read()),i!==Rs);)Array.isArray(i)?n.push.apply(n,i):n.push(i);if(!this._streaming){for(;i=this._encoder.handler(s,s.read()),i!==Rs;)Array.isArray(i)?n.push.apply(n,i):n.push(i);this._encoder=null}return new Uint8Array(n)}};function cy(r){var e=r.fatal,t=0,n=0,s=0,i=128,o=191;this.handler=function(c,u){if(u===oo&&s!==0)return s=0,Fc(e);if(u===oo)return Rs;if(s===0){if(Pr(u,0,127))return u;if(Pr(u,194,223))s=1,t=u-192;else if(Pr(u,224,239))u===224&&(i=160),u===237&&(o=159),s=2,t=u-224;else if(Pr(u,240,244))u===240&&(i=144),u===244&&(o=143),s=3,t=u-240;else return Fc(e);return t=t<<6*s,null}if(!Pr(u,i,o))return t=s=n=0,i=128,o=191,c.prepend(u),Fc(e);if(i=128,o=191,n+=1,t+=u-128<<6*(s-n),n!==s)return null;var p=t;return t=s=n=0,p}}function uy(r){var e=r.fatal;this.handler=function(t,n){if(n===oo)return Rs;if(Pr(n,0,127))return n;var s,i;Pr(n,128,2047)?(s=1,i=192):Pr(n,2048,65535)?(s=2,i=224):Pr(n,65536,1114111)&&(s=3,i=240);for(var o=[(n>>6*s)+i];s>0;){var c=n>>6*(s-1);o.push(128|c&63),s-=1}return o}}Vc.TextEncoder=uo;Vc.TextDecoder=co});var Ad=$t(Oe=>{"use strict";var fy=Oe&&Oe.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),ly=Oe&&Oe.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Er=Oe&&Oe.__decorate||function(r,e,t,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var c=r.length-1;c>=0;c--)(o=r[c])&&(i=(s<3?o(i):s>3?o(e,t,i):o(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i},dy=Oe&&Oe.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.hasOwnProperty.call(r,t)&&fy(e,r,t);return ly(e,r),e},Rd=Oe&&Oe.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Oe,"__esModule",{value:!0});Oe.deserializeUnchecked=Oe.deserialize=Oe.serialize=Oe.BinaryReader=Oe.BinaryWriter=Oe.BorshError=Oe.baseDecode=Oe.baseEncode=void 0;var sn=Rd(Mc()),vd=Rd(Dc()),hy=dy(Ed()),py=typeof TextDecoder!="function"?hy.TextDecoder:TextDecoder,my=new py("utf-8",{fatal:!0});function gy(r){return typeof r=="string"&&(r=Buffer.from(r,"utf8")),vd.default.encode(Buffer.from(r))}Oe.baseEncode=gy;function yy(r){return Buffer.from(vd.default.decode(r))}Oe.baseDecode=yy;var Wc=1024,St=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(".")}};Oe.BorshError=St;var lo=class{constructor(){this.buf=Buffer.alloc(Wc),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=Buffer.concat([this.buf,Buffer.alloc(Wc)]))}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(Wc)]),this.length+=e.length}writeString(e){this.maybeResize();let t=Buffer.from(e,"utf8");this.writeU32(t.length),this.writeBuffer(t)}writeFixedArray(e){this.writeBuffer(Buffer.from(e))}writeArray(e,t){this.maybeResize(),this.writeU32(e.length);for(let n of e)this.maybeResize(),t(n)}toArray(){return this.buf.subarray(0,this.length)}};Oe.BinaryWriter=lo;function Rr(r,e,t){let n=t.value;t.value=function(...s){try{return n.apply(this,s)}catch(i){if(i instanceof RangeError){let o=i.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(o)>=0)throw new St("Reached the end of buffer when deserializing")}throw i}}}var Dt=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 St(`Expected buffer length ${e} isn't within bounds`);let t=this.buf.slice(this.offset,this.offset+e);return this.offset+=e,t}readString(){let e=this.readU32(),t=this.readBuffer(e);try{return my.decode(t)}catch(n){throw new St(`Error decoding UTF-8 string: ${n}`)}}readFixedArray(e){return new Uint8Array(this.readBuffer(e))}readArray(e){let t=this.readU32(),n=Array();for(let s=0;s<t;++s)n.push(e());return n}};Er([Rr],Dt.prototype,"readU8",null);Er([Rr],Dt.prototype,"readU16",null);Er([Rr],Dt.prototype,"readU32",null);Er([Rr],Dt.prototype,"readU64",null);Er([Rr],Dt.prototype,"readU128",null);Er([Rr],Dt.prototype,"readU256",null);Er([Rr],Dt.prototype,"readU512",null);Er([Rr],Dt.prototype,"readString",null);Er([Rr],Dt.prototype,"readFixedArray",null);Er([Rr],Dt.prototype,"readArray",null);Oe.BinaryReader=Dt;function Sd(r){return r.charAt(0).toUpperCase()+r.slice(1)}function qn(r,e,t,n,s){try{if(typeof n=="string")s[`write${Sd(n)}`](t);else if(n instanceof Array)if(typeof n[0]=="number"){if(t.length!==n[0])throw new St(`Expecting byte array of length ${n[0]}, but got ${t.length} bytes`);s.writeFixedArray(t)}else if(n.length===2&&typeof n[1]=="number"){if(t.length!==n[1])throw new St(`Expecting byte array of length ${n[1]}, but got ${t.length} bytes`);for(let i=0;i<n[1];i++)qn(r,null,t[i],n[0],s)}else s.writeArray(t,i=>{qn(r,e,i,n[0],s)});else if(n.kind!==void 0)switch(n.kind){case"option":{t==null?s.writeU8(0):(s.writeU8(1),qn(r,e,t,n.type,s));break}case"map":{s.writeU32(t.size),t.forEach((i,o)=>{qn(r,e,o,n.key,s),qn(r,e,i,n.value,s)});break}default:throw new St(`FieldType ${n} unrecognized`)}else xd(r,t,s)}catch(i){throw i instanceof St&&i.addToFieldPath(e),i}}function xd(r,e,t){if(typeof e.borshSerialize=="function"){e.borshSerialize(t);return}let n=r.get(e.constructor);if(!n)throw new St(`Class ${e.constructor.name} is missing in schema`);if(n.kind==="struct")n.fields.map(([s,i])=>{qn(r,s,e[s],i,t)});else if(n.kind==="enum"){let s=e[n.field];for(let i=0;i<n.values.length;++i){let[o,c]=n.values[i];if(o===s){t.writeU8(i),qn(r,o,e[o],c,t);break}}}else throw new St(`Unexpected schema kind: ${n.kind} for ${e.constructor.name}`)}function _y(r,e,t=lo){let n=new t;return xd(r,e,n),n.toArray()}Oe.serialize=_y;function jn(r,e,t,n){try{if(typeof t=="string")return n[`read${Sd(t)}`]();if(t instanceof Array){if(typeof t[0]=="number")return n.readFixedArray(t[0]);if(typeof t[1]=="number"){let s=[];for(let i=0;i<t[1];i++)s.push(jn(r,null,t[0],n));return s}else return n.readArray(()=>jn(r,e,t[0],n))}if(t.kind==="option")return n.readU8()?jn(r,e,t.type,n):void 0;if(t.kind==="map"){let s=new Map,i=n.readU32();for(let o=0;o<i;o++){let c=jn(r,e,t.key,n),u=jn(r,e,t.value,n);s.set(c,u)}return s}return qc(r,t,n)}catch(s){throw s instanceof St&&s.addToFieldPath(e),s}}function qc(r,e,t){if(typeof e.borshDeserialize=="function")return e.borshDeserialize(t);let n=r.get(e);if(!n)throw new St(`Class ${e.name} is missing in schema`);if(n.kind==="struct"){let s={};for(let[i,o]of r.get(e).fields)s[i]=jn(r,i,o,t);return new e(s)}if(n.kind==="enum"){let s=t.readU8();if(s>=n.values.length)throw new St(`Enum index: ${s} is out of range`);let[i,o]=n.values[s],c=jn(r,i,o,t);return new e({[i]:c})}throw new St(`Unexpected schema kind: ${n.kind} for ${e.constructor.name}`)}function by(r,e,t,n=Dt){let s=new n(t),i=qc(r,e,s);if(s.offset<t.length)throw new St(`Unexpected ${t.length-s.offset} bytes after deserialized data`);return i}Oe.deserialize=by;function wy(r,e,t,n=Dt){let s=new n(t);return qc(r,e,s)}Oe.deserializeUnchecked=wy});var Gc=$t(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.s16=O.s8=O.nu64be=O.u48be=O.u40be=O.u32be=O.u24be=O.u16be=O.nu64=O.u48=O.u40=O.u32=O.u24=O.u16=O.u8=O.offset=O.greedy=O.Constant=O.UTF8=O.CString=O.Blob=O.Boolean=O.BitField=O.BitStructure=O.VariantLayout=O.Union=O.UnionLayoutDiscriminator=O.UnionDiscriminator=O.Structure=O.Sequence=O.DoubleBE=O.Double=O.FloatBE=O.Float=O.NearInt64BE=O.NearInt64=O.NearUInt64BE=O.NearUInt64=O.IntBE=O.Int=O.UIntBE=O.UInt=O.OffsetLayout=O.GreedyCount=O.ExternalLayout=O.bindConstructorLayout=O.nameWithProperty=O.Layout=O.uint8ArrayToBuffer=O.checkUint8Array=void 0;O.constant=O.utf8=O.cstr=O.blob=O.unionLayoutDiscriminator=O.union=O.seq=O.bits=O.struct=O.f64be=O.f64=O.f32be=O.f32=O.ns64be=O.s48be=O.s40be=O.s32be=O.s24be=O.s16be=O.ns64=O.s48=O.s40=O.s32=O.s24=void 0;var Kc=Ws();function xs(r){if(!(r instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}O.checkUint8Array=xs;function Re(r){return xs(r),Kc.Buffer.from(r.buffer,r.byteOffset,r.length)}O.uint8ArrayToBuffer=Re;var ve=class{constructor(e,t){if(!Number.isInteger(e))throw new TypeError("span must be an integer");this.span=e,this.property=t}makeDestinationObject(){return{}}getSpan(e,t){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(e){let t=Object.create(this.constructor.prototype);return Object.assign(t,this),t.property=e,t}fromArray(e){}};O.Layout=ve;function Hc(r,e){return e.property?r+"["+e.property+"]":r}O.nameWithProperty=Hc;function Ey(r,e){if(typeof r!="function")throw new TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(r,"layout_"))throw new Error("Class is already bound to a layout");if(!(e&&e instanceof ve))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");r.layout_=e,e.boundConstructor_=r,e.makeDestinationObject=()=>new r,Object.defineProperty(r.prototype,"encode",{value(t,n){return e.encode(this,t,n)},writable:!0}),Object.defineProperty(r,"decode",{value(t,n){return e.decode(t,n)},writable:!0})}O.bindConstructorLayout=Ey;var Tt=class extends ve{isCount(){throw new Error("ExternalLayout is abstract")}};O.ExternalLayout=Tt;var ho=class extends Tt{constructor(e=1,t){if(!Number.isInteger(e)||0>=e)throw new TypeError("elementSpan must be a (positive) integer");super(-1,t),this.elementSpan=e}isCount(){return!0}decode(e,t=0){xs(e);let n=e.length-t;return Math.floor(n/this.elementSpan)}encode(e,t,n){return 0}};O.GreedyCount=ho;var Zs=class extends Tt{constructor(e,t=0,n){if(!(e instanceof ve))throw new TypeError("layout must be a Layout");if(!Number.isInteger(t))throw new TypeError("offset must be integer or undefined");super(e.span,n||e.property),this.layout=e,this.offset=t}isCount(){return this.layout instanceof Ht||this.layout instanceof Zt}decode(e,t=0){return this.layout.decode(e,t+this.offset)}encode(e,t,n=0){return this.layout.encode(e,t,n+this.offset)}};O.OffsetLayout=Zs;var Ht=class extends ve{constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return Re(e).readUIntLE(t,this.span)}encode(e,t,n=0){return Re(t).writeUIntLE(e,n,this.span),this.span}};O.UInt=Ht;var Zt=class extends ve{constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return Re(e).readUIntBE(t,this.span)}encode(e,t,n=0){return Re(t).writeUIntBE(e,n,this.span),this.span}};O.UIntBE=Zt;var Mr=class extends ve{constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return Re(e).readIntLE(t,this.span)}encode(e,t,n=0){return Re(t).writeIntLE(e,n,this.span),this.span}};O.Int=Mr;var on=class extends ve{constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return Re(e).readIntBE(t,this.span)}encode(e,t,n=0){return Re(t).writeIntBE(e,n,this.span),this.span}};O.IntBE=on;var jc=Math.pow(2,32);function To(r){let e=Math.floor(r/jc),t=r-e*jc;return{hi32:e,lo32:t}}function No(r,e){return r*jc+e}var po=class extends ve{constructor(e){super(8,e)}decode(e,t=0){let n=Re(e),s=n.readUInt32LE(t),i=n.readUInt32LE(t+4);return No(i,s)}encode(e,t,n=0){let s=To(e),i=Re(t);return i.writeUInt32LE(s.lo32,n),i.writeUInt32LE(s.hi32,n+4),8}};O.NearUInt64=po;var mo=class extends ve{constructor(e){super(8,e)}decode(e,t=0){let n=Re(e),s=n.readUInt32BE(t),i=n.readUInt32BE(t+4);return No(s,i)}encode(e,t,n=0){let s=To(e),i=Re(t);return i.writeUInt32BE(s.hi32,n),i.writeUInt32BE(s.lo32,n+4),8}};O.NearUInt64BE=mo;var go=class extends ve{constructor(e){super(8,e)}decode(e,t=0){let n=Re(e),s=n.readUInt32LE(t),i=n.readInt32LE(t+4);return No(i,s)}encode(e,t,n=0){let s=To(e),i=Re(t);return i.writeUInt32LE(s.lo32,n),i.writeInt32LE(s.hi32,n+4),8}};O.NearInt64=go;var yo=class extends ve{constructor(e){super(8,e)}decode(e,t=0){let n=Re(e),s=n.readInt32BE(t),i=n.readUInt32BE(t+4);return No(s,i)}encode(e,t,n=0){let s=To(e),i=Re(t);return i.writeInt32BE(s.hi32,n),i.writeUInt32BE(s.lo32,n+4),8}};O.NearInt64BE=yo;var _o=class extends ve{constructor(e){super(4,e)}decode(e,t=0){return Re(e).readFloatLE(t)}encode(e,t,n=0){return Re(t).writeFloatLE(e,n),4}};O.Float=_o;var bo=class extends ve{constructor(e){super(4,e)}decode(e,t=0){return Re(e).readFloatBE(t)}encode(e,t,n=0){return Re(t).writeFloatBE(e,n),4}};O.FloatBE=bo;var wo=class extends ve{constructor(e){super(8,e)}decode(e,t=0){return Re(e).readDoubleLE(t)}encode(e,t,n=0){return Re(t).writeDoubleLE(e,n),8}};O.Double=wo;var Eo=class extends ve{constructor(e){super(8,e)}decode(e,t=0){return Re(e).readDoubleBE(t)}encode(e,t,n=0){return Re(t).writeDoubleBE(e,n),8}};O.DoubleBE=Eo;var Ro=class extends ve{constructor(e,t,n){if(!(e instanceof ve))throw new TypeError("elementLayout must be a Layout");if(!(t instanceof Tt&&t.isCount()||Number.isInteger(t)&&0<=t))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let s=-1;!(t instanceof Tt)&&0<e.span&&(s=t*e.span),super(s,n),this.elementLayout=e,this.count=t}getSpan(e,t=0){if(0<=this.span)return this.span;let n=0,s=this.count;if(s instanceof Tt&&(s=s.decode(e,t)),0<this.elementLayout.span)n=s*this.elementLayout.span;else{let i=0;for(;i<s;)n+=this.elementLayout.getSpan(e,t+n),++i}return n}decode(e,t=0){let n=[],s=0,i=this.count;for(i instanceof Tt&&(i=i.decode(e,t));s<i;)n.push(this.elementLayout.decode(e,t)),t+=this.elementLayout.getSpan(e,t),s+=1;return n}encode(e,t,n=0){let s=this.elementLayout,i=e.reduce((o,c)=>o+s.encode(c,t,n+o),0);return this.count instanceof Tt&&this.count.encode(e.length,t,n),i}};O.Sequence=Ro;var vo=class extends ve{constructor(e,t,n){if(!(Array.isArray(e)&&e.reduce((i,o)=>i&&o instanceof ve,!0)))throw new TypeError("fields must be array of Layout instances");typeof t=="boolean"&&n===void 0&&(n=t,t=void 0);for(let i of e)if(0>i.span&&i.property===void 0)throw new Error("fields cannot contain unnamed variable-length layout");let s=-1;try{s=e.reduce((i,o)=>i+o.getSpan(),0)}catch{}super(s,t),this.fields=e,this.decodePrefixes=!!n}getSpan(e,t=0){if(0<=this.span)return this.span;let n=0;try{n=this.fields.reduce((s,i)=>{let o=i.getSpan(e,t);return t+=o,s+o},0)}catch{throw new RangeError("indeterminate span")}return n}decode(e,t=0){xs(e);let n=this.makeDestinationObject();for(let s of this.fields)if(s.property!==void 0&&(n[s.property]=s.decode(e,t)),t+=s.getSpan(e,t),this.decodePrefixes&&e.length===t)break;return n}encode(e,t,n=0){let s=n,i=0,o=0;for(let c of this.fields){let u=c.span;if(o=0<u?u:0,c.property!==void 0){let p=e[c.property];p!==void 0&&(o=c.encode(p,t,n),0>u&&(u=c.getSpan(t,n)))}i=n,n+=u}return i+o-s}fromArray(e){let t=this.makeDestinationObject();for(let n of this.fields)n.property!==void 0&&0<e.length&&(t[n.property]=e.shift());return t}layoutFor(e){if(typeof e!="string")throw new TypeError("property must be string");for(let t of this.fields)if(t.property===e)return t}offsetOf(e){if(typeof e!="string")throw new TypeError("property must be string");let t=0;for(let n of this.fields){if(n.property===e)return t;0>n.span?t=-1:0<=t&&(t+=n.span)}}};O.Structure=vo;var Ys=class{constructor(e){this.property=e}decode(e,t){throw new Error("UnionDiscriminator is abstract")}encode(e,t,n){throw new Error("UnionDiscriminator is abstract")}};O.UnionDiscriminator=Ys;var Ss=class extends Ys{constructor(e,t){if(!(e instanceof Tt&&e.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");super(t||e.property||"variant"),this.layout=e}decode(e,t){return this.layout.decode(e,t)}encode(e,t,n){return this.layout.encode(e,t,n)}};O.UnionLayoutDiscriminator=Ss;var Js=class extends ve{constructor(e,t,n){let s;if(e instanceof Ht||e instanceof Zt)s=new Ss(new Zs(e));else if(e instanceof Tt&&e.isCount())s=new Ss(e);else if(e instanceof Ys)s=e;else throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(t===void 0&&(t=null),!(t===null||t instanceof ve))throw new TypeError("defaultLayout must be null or a Layout");if(t!==null){if(0>t.span)throw new Error("defaultLayout must have constant span");t.property===void 0&&(t=t.replicate("content"))}let i=-1;t&&(i=t.span,0<=i&&(e instanceof Ht||e instanceof Zt)&&(i+=s.layout.span)),super(i,n),this.discriminator=s,this.usesPrefixDiscriminator=e instanceof Ht||e instanceof Zt,this.defaultLayout=t,this.registry={};let o=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(c){return o(c)},this.configGetSourceVariant=function(c){o=c.bind(this)}}getSpan(e,t=0){if(0<=this.span)return this.span;let n=this.getVariant(e,t);if(!n)throw new Error("unable to determine span for unrecognized variant");return n.getSpan(e,t)}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 t=this.registry[e[this.discriminator.property]];if(t&&(!t.layout||t.property&&Object.prototype.hasOwnProperty.call(e,t.property)))return t}else for(let t in this.registry){let n=this.registry[t];if(n.property&&Object.prototype.hasOwnProperty.call(e,n.property))return n}throw new Error("unable to infer src variant")}decode(e,t=0){let n,s=this.discriminator,i=s.decode(e,t),o=this.registry[i];if(o===void 0){let c=this.defaultLayout,u=0;this.usesPrefixDiscriminator&&(u=s.layout.span),n=this.makeDestinationObject(),n[s.property]=i,n[c.property]=c.decode(e,t+u)}else n=o.decode(e,t);return n}encode(e,t,n=0){let s=this.getSourceVariant(e);if(s===void 0){let i=this.discriminator,o=this.defaultLayout,c=0;return this.usesPrefixDiscriminator&&(c=i.layout.span),i.encode(e[i.property],t,n),c+o.encode(e[o.property],t,n+c)}return s.encode(e,t,n)}addVariant(e,t,n){let s=new So(this,e,t,n);return this.registry[e]=s,s}getVariant(e,t=0){let n;return e instanceof Uint8Array?n=this.discriminator.decode(e,t):n=e,this.registry[n]}};O.Union=Js;var So=class extends ve{constructor(e,t,n,s){if(!(e instanceof Js))throw new TypeError("union must be a Union");if(!Number.isInteger(t)||0>t)throw new TypeError("variant must be a (non-negative) integer");if(typeof n=="string"&&s===void 0&&(s=n,n=null),n){if(!(n instanceof ve))throw new TypeError("layout must be a Layout");if(e.defaultLayout!==null&&0<=n.span&&n.span>e.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if(typeof s!="string")throw new TypeError("variant must have a String property")}let i=e.span;0>e.span&&(i=n?n.span:0,0<=i&&e.usesPrefixDiscriminator&&(i+=e.discriminator.layout.span)),super(i,s),this.union=e,this.variant=t,this.layout=n||null}getSpan(e,t=0){if(0<=this.span)return this.span;let n=0;this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span);let s=0;return this.layout&&(s=this.layout.getSpan(e,t+n)),n+s}decode(e,t=0){let n=this.makeDestinationObject();if(this!==this.union.getVariant(e,t))throw new Error("variant mismatch");let s=0;return this.union.usesPrefixDiscriminator&&(s=this.union.discriminator.layout.span),this.layout?n[this.property]=this.layout.decode(e,t+s):this.property?n[this.property]=!0:this.union.usesPrefixDiscriminator&&(n[this.union.discriminator.property]=this.variant),n}encode(e,t,n=0){let s=0;if(this.union.usesPrefixDiscriminator&&(s=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,t,n);let i=s;if(this.layout&&(this.layout.encode(e[this.property],t,n+s),i+=this.layout.getSpan(t,n+s),0<=this.union.span&&i>this.union.span))throw new Error("encoded variant overruns containing union");return i}fromArray(e){if(this.layout)return this.layout.fromArray(e)}};O.VariantLayout=So;function vs(r){return 0>r&&(r+=4294967296),r}var Xs=class extends ve{constructor(e,t,n){if(!(e instanceof Ht||e instanceof Zt))throw new TypeError("word must be a UInt or UIntBE layout");if(typeof t=="string"&&n===void 0&&(n=t,t=!1),4<e.span)throw new RangeError("word cannot exceed 32 bits");super(e.span,n),this.word=e,this.msb=!!t,this.fields=[];let s=0;this._packedSetValue=function(i){return s=vs(i),this},this._packedGetValue=function(){return s}}decode(e,t=0){let n=this.makeDestinationObject(),s=this.word.decode(e,t);this._packedSetValue(s);for(let i of this.fields)i.property!==void 0&&(n[i.property]=i.decode(e));return n}encode(e,t,n=0){let s=this.word.decode(t,n);this._packedSetValue(s);for(let i of this.fields)if(i.property!==void 0){let o=e[i.property];o!==void 0&&i.encode(o)}return this.word.encode(this._packedGetValue(),t,n)}addField(e,t){let n=new Qs(this,e,t);return this.fields.push(n),n}addBoolean(e){let t=new xo(this,e);return this.fields.push(t),t}fieldFor(e){if(typeof e!="string")throw new TypeError("property must be string");for(let t of this.fields)if(t.property===e)return t}};O.BitStructure=Xs;var Qs=class{constructor(e,t,n){if(!(e instanceof Xs))throw new TypeError("container must be a BitStructure");if(!Number.isInteger(t)||0>=t)throw new TypeError("bits must be positive integer");let s=8*e.span,i=e.fields.reduce((o,c)=>o+c.bits,0);if(t+i>s)throw new Error("bits too long for span remainder ("+(s-i)+" of "+s+" remain)");this.container=e,this.bits=t,this.valueMask=(1<<t)-1,t===32&&(this.valueMask=4294967295),this.start=i,this.container.msb&&(this.start=s-i-t),this.wordMask=vs(this.valueMask<<this.start),this.property=n}decode(e,t){let n=this.container._packedGetValue();return vs(n&this.wordMask)>>>this.start}encode(e){if(typeof e!="number"||!Number.isInteger(e)||e!==vs(e&this.valueMask))throw new TypeError(Hc("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);let t=this.container._packedGetValue(),n=vs(e<<this.start);this.container._packedSetValue(vs(t&~this.wordMask)|n)}};O.BitField=Qs;var xo=class extends Qs{constructor(e,t){super(e,1,t)}decode(e,t){return!!super.decode(e,t)}encode(e){typeof e=="boolean"&&(e=+e),super.encode(e)}};O.Boolean=xo;var Ao=class extends ve{constructor(e,t){if(!(e instanceof Tt&&e.isCount()||Number.isInteger(e)&&0<=e))throw new TypeError("length must be positive integer or an unsigned integer ExternalLayout");let n=-1;e instanceof Tt||(n=e),super(n,t),this.length=e}getSpan(e,t){let n=this.span;return 0>n&&(n=this.length.decode(e,t)),n}decode(e,t=0){let n=this.span;return 0>n&&(n=this.length.decode(e,t)),Re(e).slice(t,t+n)}encode(e,t,n){let s=this.length;if(this.length instanceof Tt&&(s=e.length),!(e instanceof Uint8Array&&s===e.length))throw new TypeError(Hc("Blob.encode",this)+" requires (length "+s+") Uint8Array as src");if(n+s>t.length)throw new RangeError("encoding overruns Uint8Array");let i=Re(e);return Re(t).write(i.toString("hex"),n,s,"hex"),this.length instanceof Tt&&this.length.encode(s,t,n),s}};O.Blob=Ao;var Io=class extends ve{constructor(e){super(-1,e)}getSpan(e,t=0){xs(e);let n=t;for(;n<e.length&&e[n]!==0;)n+=1;return 1+n-t}decode(e,t=0){let n=this.getSpan(e,t);return Re(e).slice(t,t+n-1).toString("utf-8")}encode(e,t,n=0){typeof e!="string"&&(e=String(e));let s=Kc.Buffer.from(e,"utf8"),i=s.length;if(n+i>t.length)throw new RangeError("encoding overruns Buffer");let o=Re(t);return s.copy(o,n),o[n+i]=0,i+1}};O.CString=Io;var ko=class extends ve{constructor(e,t){if(typeof e=="string"&&t===void 0&&(t=e,e=void 0),e===void 0)e=-1;else if(!Number.isInteger(e))throw new TypeError("maxSpan must be an integer");super(-1,t),this.maxSpan=e}getSpan(e,t=0){return xs(e),e.length-t}decode(e,t=0){let n=this.getSpan(e,t);if(0<=this.maxSpan&&this.maxSpan<n)throw new RangeError("text length exceeds maxSpan");return Re(e).slice(t,t+n).toString("utf-8")}encode(e,t,n=0){typeof e!="string"&&(e=String(e));let s=Kc.Buffer.from(e,"utf8"),i=s.length;if(0<=this.maxSpan&&this.maxSpan<i)throw new RangeError("text length exceeds maxSpan");if(n+i>t.length)throw new RangeError("encoding overruns Buffer");return s.copy(Re(t),n),i}};O.UTF8=ko;var Oo=class extends ve{constructor(e,t){super(0,t),this.value=e}decode(e,t){return this.value}encode(e,t,n){return 0}};O.Constant=Oo;O.greedy=(r,e)=>new ho(r,e);O.offset=(r,e,t)=>new Zs(r,e,t);O.u8=r=>new Ht(1,r);O.u16=r=>new Ht(2,r);O.u24=r=>new Ht(3,r);O.u32=r=>new Ht(4,r);O.u40=r=>new Ht(5,r);O.u48=r=>new Ht(6,r);O.nu64=r=>new po(r);O.u16be=r=>new Zt(2,r);O.u24be=r=>new Zt(3,r);O.u32be=r=>new Zt(4,r);O.u40be=r=>new Zt(5,r);O.u48be=r=>new Zt(6,r);O.nu64be=r=>new mo(r);O.s8=r=>new Mr(1,r);O.s16=r=>new Mr(2,r);O.s24=r=>new Mr(3,r);O.s32=r=>new Mr(4,r);O.s40=r=>new Mr(5,r);O.s48=r=>new Mr(6,r);O.ns64=r=>new go(r);O.s16be=r=>new on(2,r);O.s24be=r=>new on(3,r);O.s32be=r=>new on(4,r);O.s40be=r=>new on(5,r);O.s48be=r=>new on(6,r);O.ns64be=r=>new yo(r);O.f32=r=>new _o(r);O.f32be=r=>new bo(r);O.f64=r=>new wo(r);O.f64be=r=>new Eo(r);O.struct=(r,e,t)=>new vo(r,e,t);O.bits=(r,e,t)=>new Xs(r,e,t);O.seq=(r,e,t)=>new Ro(r,e,t);O.union=(r,e,t)=>new Js(r,e,t);O.unionLayoutDiscriminator=(r,e)=>new Ss(r,e);O.blob=(r,e)=>new Ao(r,e);O.cstr=r=>new Io(r);O.utf8=(r,e)=>new ko(r,e);O.constant=(r,e)=>new Oo(r,e)});function ri(){if(!Po&&(Po=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Po))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Po(B1)}var Po,B1,iu=Ut(()=>{B1=new Uint8Array(16)});var jd,Kd=Ut(()=>{jd=/^(?:[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 C1(r){return typeof r=="string"&&jd.test(r)}var cn,ni=Ut(()=>{Kd();cn=C1});function P1(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=(xt[r[e+0]]+xt[r[e+1]]+xt[r[e+2]]+xt[r[e+3]]+"-"+xt[r[e+4]]+xt[r[e+5]]+"-"+xt[r[e+6]]+xt[r[e+7]]+"-"+xt[r[e+8]]+xt[r[e+9]]+"-"+xt[r[e+10]]+xt[r[e+11]]+xt[r[e+12]]+xt[r[e+13]]+xt[r[e+14]]+xt[r[e+15]]).toLowerCase();if(!cn(t))throw TypeError("Stringified UUID is invalid");return t}var xt,Mo,un,si=Ut(()=>{ni();xt=[];for(Mo=0;Mo<256;++Mo)xt.push((Mo+256).toString(16).substr(1));un=P1});function M1(r,e,t){var n=e&&t||0,s=e||new Array(16);r=r||{};var i=r.node||Hd,o=r.clockseq!==void 0?r.clockseq:ou;if(i==null||o==null){var c=r.random||(r.rng||ri)();i==null&&(i=Hd=[c[0]|1,c[1],c[2],c[3],c[4],c[5]]),o==null&&(o=ou=(c[6]<<8|c[7])&16383)}var u=r.msecs!==void 0?r.msecs:Date.now(),p=r.nsecs!==void 0?r.nsecs:cu+1,m=u-au+(p-cu)/1e4;if(m<0&&r.clockseq===void 0&&(o=o+1&16383),(m<0||u>au)&&r.nsecs===void 0&&(p=0),p>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");au=u,cu=p,ou=o,u+=122192928e5;var b=((u&268435455)*1e4+p)%4294967296;s[n++]=b>>>24&255,s[n++]=b>>>16&255,s[n++]=b>>>8&255,s[n++]=b&255;var x=u/4294967296*1e4&268435455;s[n++]=x>>>8&255,s[n++]=x&255,s[n++]=x>>>24&15|16,s[n++]=x>>>16&255,s[n++]=o>>>8|128,s[n++]=o&255;for(var S=0;S<6;++S)s[n+S]=i[S];return e||un(s)}var Hd,ou,au,cu,Gd,Zd=Ut(()=>{iu();si();au=0,cu=0;Gd=M1});function U1(r){if(!cn(r))throw TypeError("Invalid UUID");var e,t=new Uint8Array(16);return t[0]=(e=parseInt(r.slice(0,8),16))>>>24,t[1]=e>>>16&255,t[2]=e>>>8&255,t[3]=e&255,t[4]=(e=parseInt(r.slice(9,13),16))>>>8,t[5]=e&255,t[6]=(e=parseInt(r.slice(14,18),16))>>>8,t[7]=e&255,t[8]=(e=parseInt(r.slice(19,23),16))>>>8,t[9]=e&255,t[10]=(e=parseInt(r.slice(24,36),16))/1099511627776&255,t[11]=e/4294967296&255,t[12]=e>>>24&255,t[13]=e>>>16&255,t[14]=e>>>8&255,t[15]=e&255,t}var Uo,uu=Ut(()=>{ni();Uo=U1});function D1(r){r=unescape(encodeURIComponent(r));for(var e=[],t=0;t<r.length;++t)e.push(r.charCodeAt(t));return e}function Do(r,e,t){function n(s,i,o,c){if(typeof s=="string"&&(s=D1(s)),typeof i=="string"&&(i=Uo(i)),i.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var u=new Uint8Array(16+s.length);if(u.set(i),u.set(s,i.length),u=t(u),u[6]=u[6]&15|e,u[8]=u[8]&63|128,o){c=c||0;for(var p=0;p<16;++p)o[c+p]=u[p];return o}return un(u)}try{n.name=r}catch{}return n.DNS=z1,n.URL=F1,n}var z1,F1,fu=Ut(()=>{si();uu();z1="6ba7b810-9dad-11d1-80b4-00c04fd430c8",F1="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});function $1(r){if(typeof r=="string"){var e=unescape(encodeURIComponent(r));r=new Uint8Array(e.length);for(var t=0;t<e.length;++t)r[t]=e.charCodeAt(t)}return V1(W1(q1(r),r.length*8))}function V1(r){for(var e=[],t=r.length*32,n="0123456789abcdef",s=0;s<t;s+=8){var i=r[s>>5]>>>s%32&255,o=parseInt(n.charAt(i>>>4&15)+n.charAt(i&15),16);e.push(o)}return e}function Yd(r){return(r+64>>>9<<4)+14+1}function W1(r,e){r[e>>5]|=128<<e%32,r[Yd(e)-1]=e;for(var t=1732584193,n=-271733879,s=-1732584194,i=271733878,o=0;o<r.length;o+=16){var c=t,u=n,p=s,m=i;t=Lt(t,n,s,i,r[o],7,-680876936),i=Lt(i,t,n,s,r[o+1],12,-389564586),s=Lt(s,i,t,n,r[o+2],17,606105819),n=Lt(n,s,i,t,r[o+3],22,-1044525330),t=Lt(t,n,s,i,r[o+4],7,-176418897),i=Lt(i,t,n,s,r[o+5],12,1200080426),s=Lt(s,i,t,n,r[o+6],17,-1473231341),n=Lt(n,s,i,t,r[o+7],22,-45705983),t=Lt(t,n,s,i,r[o+8],7,1770035416),i=Lt(i,t,n,s,r[o+9],12,-1958414417),s=Lt(s,i,t,n,r[o+10],17,-42063),n=Lt(n,s,i,t,r[o+11],22,-1990404162),t=Lt(t,n,s,i,r[o+12],7,1804603682),i=Lt(i,t,n,s,r[o+13],12,-40341101),s=Lt(s,i,t,n,r[o+14],17,-1502002290),n=Lt(n,s,i,t,r[o+15],22,1236535329),t=Bt(t,n,s,i,r[o+1],5,-165796510),i=Bt(i,t,n,s,r[o+6],9,-1069501632),s=Bt(s,i,t,n,r[o+11],14,643717713),n=Bt(n,s,i,t,r[o],20,-373897302),t=Bt(t,n,s,i,r[o+5],5,-701558691),i=Bt(i,t,n,s,r[o+10],9,38016083),s=Bt(s,i,t,n,r[o+15],14,-660478335),n=Bt(n,s,i,t,r[o+4],20,-405537848),t=Bt(t,n,s,i,r[o+9],5,568446438),i=Bt(i,t,n,s,r[o+14],9,-1019803690),s=Bt(s,i,t,n,r[o+3],14,-187363961),n=Bt(n,s,i,t,r[o+8],20,1163531501),t=Bt(t,n,s,i,r[o+13],5,-1444681467),i=Bt(i,t,n,s,r[o+2],9,-51403784),s=Bt(s,i,t,n,r[o+7],14,1735328473),n=Bt(n,s,i,t,r[o+12],20,-1926607734),t=Ct(t,n,s,i,r[o+5],4,-378558),i=Ct(i,t,n,s,r[o+8],11,-2022574463),s=Ct(s,i,t,n,r[o+11],16,1839030562),n=Ct(n,s,i,t,r[o+14],23,-35309556),t=Ct(t,n,s,i,r[o+1],4,-1530992060),i=Ct(i,t,n,s,r[o+4],11,1272893353),s=Ct(s,i,t,n,r[o+7],16,-155497632),n=Ct(n,s,i,t,r[o+10],23,-1094730640),t=Ct(t,n,s,i,r[o+13],4,681279174),i=Ct(i,t,n,s,r[o],11,-358537222),s=Ct(s,i,t,n,r[o+3],16,-722521979),n=Ct(n,s,i,t,r[o+6],23,76029189),t=Ct(t,n,s,i,r[o+9],4,-640364487),i=Ct(i,t,n,s,r[o+12],11,-421815835),s=Ct(s,i,t,n,r[o+15],16,530742520),n=Ct(n,s,i,t,r[o+2],23,-995338651),t=Pt(t,n,s,i,r[o],6,-198630844),i=Pt(i,t,n,s,r[o+7],10,1126891415),s=Pt(s,i,t,n,r[o+14],15,-1416354905),n=Pt(n,s,i,t,r[o+5],21,-57434055),t=Pt(t,n,s,i,r[o+12],6,1700485571),i=Pt(i,t,n,s,r[o+3],10,-1894986606),s=Pt(s,i,t,n,r[o+10],15,-1051523),n=Pt(n,s,i,t,r[o+1],21,-2054922799),t=Pt(t,n,s,i,r[o+8],6,1873313359),i=Pt(i,t,n,s,r[o+15],10,-30611744),s=Pt(s,i,t,n,r[o+6],15,-1560198380),n=Pt(n,s,i,t,r[o+13],21,1309151649),t=Pt(t,n,s,i,r[o+4],6,-145523070),i=Pt(i,t,n,s,r[o+11],10,-1120210379),s=Pt(s,i,t,n,r[o+2],15,718787259),n=Pt(n,s,i,t,r[o+9],21,-343485551),t=fn(t,c),n=fn(n,u),s=fn(s,p),i=fn(i,m)}return[t,n,s,i]}function q1(r){if(r.length===0)return[];for(var e=r.length*8,t=new Uint32Array(Yd(e)),n=0;n<e;n+=8)t[n>>5]|=(r[n/8]&255)<<n%32;return t}function fn(r,e){var t=(r&65535)+(e&65535),n=(r>>16)+(e>>16)+(t>>16);return n<<16|t&65535}function j1(r,e){return r<<e|r>>>32-e}function zo(r,e,t,n,s,i){return fn(j1(fn(fn(e,r),fn(n,i)),s),t)}function Lt(r,e,t,n,s,i,o){return zo(e&t|~e&n,r,e,s,i,o)}function Bt(r,e,t,n,s,i,o){return zo(e&n|t&~n,r,e,s,i,o)}function Ct(r,e,t,n,s,i,o){return zo(e^t^n,r,e,s,i,o)}function Pt(r,e,t,n,s,i,o){return zo(t^(e|~n),r,e,s,i,o)}var Jd,Xd=Ut(()=>{Jd=$1});var K1,Qd,eh=Ut(()=>{fu();Xd();K1=Do("v3",48,Jd),Qd=K1});function H1(r,e,t){r=r||{};var n=r.random||(r.rng||ri)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){t=t||0;for(var s=0;s<16;++s)e[t+s]=n[s];return e}return un(n)}var th,rh=Ut(()=>{iu();si();th=H1});function G1(r,e,t,n){switch(r){case 0:return e&t^~e&n;case 1:return e^t^n;case 2:return e&t^e&n^t&n;case 3:return e^t^n}}function lu(r,e){return r<<e|r>>>32-e}function Z1(r){var e=[1518500249,1859775393,2400959708,3395469782],t=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof r=="string"){var n=unescape(encodeURIComponent(r));r=[];for(var s=0;s<n.length;++s)r.push(n.charCodeAt(s))}else Array.isArray(r)||(r=Array.prototype.slice.call(r));r.push(128);for(var i=r.length/4+2,o=Math.ceil(i/16),c=new Array(o),u=0;u<o;++u){for(var p=new Uint32Array(16),m=0;m<16;++m)p[m]=r[u*64+m*4]<<24|r[u*64+m*4+1]<<16|r[u*64+m*4+2]<<8|r[u*64+m*4+3];c[u]=p}c[o-1][14]=(r.length-1)*8/Math.pow(2,32),c[o-1][14]=Math.floor(c[o-1][14]),c[o-1][15]=(r.length-1)*8&4294967295;for(var b=0;b<o;++b){for(var x=new Uint32Array(80),S=0;S<16;++S)x[S]=c[b][S];for(var T=16;T<80;++T)x[T]=lu(x[T-3]^x[T-8]^x[T-14]^x[T-16],1);for(var I=t[0],A=t[1],L=t[2],U=t[3],B=t[4],F=0;F<80;++F){var te=Math.floor(F/20),G=lu(I,5)+G1(te,A,L,U)+B+e[te]+x[F]>>>0;B=U,U=L,L=lu(A,30)>>>0,A=I,I=G}t[0]=t[0]+I>>>0,t[1]=t[1]+A>>>0,t[2]=t[2]+L>>>0,t[3]=t[3]+U>>>0,t[4]=t[4]+B>>>0}return[t[0]>>24&255,t[0]>>16&255,t[0]>>8&255,t[0]&255,t[1]>>24&255,t[1]>>16&255,t[1]>>8&255,t[1]&255,t[2]>>24&255,t[2]>>16&255,t[2]>>8&255,t[2]&255,t[3]>>24&255,t[3]>>16&255,t[3]>>8&255,t[3]&255,t[4]>>24&255,t[4]>>16&255,t[4]>>8&255,t[4]&255]}var nh,sh=Ut(()=>{nh=Z1});var Y1,ih,oh=Ut(()=>{fu();sh();Y1=Do("v5",80,nh),ih=Y1});var ah,ch=Ut(()=>{ah="00000000-0000-0000-0000-000000000000"});function J1(r){if(!cn(r))throw TypeError("Invalid UUID");return parseInt(r.substr(14,1),16)}var uh,fh=Ut(()=>{ni();uh=J1});var du={};Qt(du,{NIL:()=>ah,parse:()=>Uo,stringify:()=>un,v1:()=>Gd,v3:()=>Qd,v4:()=>th,v5:()=>ih,validate:()=>cn,version:()=>uh});var hu=Ut(()=>{Zd();eh();rh();oh();ch();fh();ni();si();uu()});var dh=$t((BA,lh)=>{"use strict";var X1=(hu(),Pa(du)).v4,Q1=function(r,e,t,n){if(typeof r!="string")throw new TypeError(r+" must be a string");n=n||{};let s=typeof n.version=="number"?n.version:2;if(s!==1&&s!==2)throw new TypeError(s+" must be 1 or 2");let i={method:r};if(s===2&&(i.jsonrpc="2.0"),e){if(typeof e!="object"&&!Array.isArray(e))throw new TypeError(e+" must be an object, array or omitted");i.params=e}if(typeof t>"u"){let o=typeof n.generator=="function"?n.generator:function(){return X1()};i.id=o(i,n)}else s===2&&t===null?n.notificationIdNull&&(i.id=null):i.id=t;return i};lh.exports=Q1});var ph=$t((CA,hh)=>{"use strict";var eE=(hu(),Pa(du)).v4,tE=dh(),ii=function(r,e){if(!(this instanceof ii))return new ii(r,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 eE()},version:typeof e.version<"u"?e.version:2,notificationIdNull:typeof e.notificationIdNull=="boolean"?e.notificationIdNull:!1},this.callServer=r};hh.exports=ii;ii.prototype.request=function(r,e,t,n){let s=this,i=null,o=Array.isArray(r)&&typeof e=="function";if(this.options.version===1&&o)throw new TypeError("JSON-RPC 1.0 does not support batching");if(o||!o&&r&&typeof r=="object"&&typeof e=="function")n=e,i=r;else{typeof t=="function"&&(n=t,t=void 0);let p=typeof n=="function";try{i=tE(r,e,t,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(m){if(p)return n(m);throw m}if(!p)return i}let u;try{u=JSON.stringify(i,this.options.replacer)}catch(p){return n(p)}return this.callServer(u,function(p,m){s._parseResponse(p,m,n)}),i};ii.prototype._parseResponse=function(r,e,t){if(r){t(r);return}if(!e)return t();let n;try{n=JSON.parse(e,this.options.reviver)}catch(s){return t(s)}if(t.length===3)if(Array.isArray(n)){let s=function(o){return typeof o.error<"u"},i=function(o){return!s(o)};return t(null,n.filter(s),n.filter(i))}else return t(null,n.error,n.result);t(null,n)}});var gh=$t((PA,pu)=>{"use strict";var rE=Object.prototype.hasOwnProperty,zt="~";function oi(){}Object.create&&(oi.prototype=Object.create(null),new oi().__proto__||(zt=!1));function nE(r,e,t){this.fn=r,this.context=e,this.once=t||!1}function mh(r,e,t,n,s){if(typeof t!="function")throw new TypeError("The listener must be a function");var i=new nE(t,n||r,s),o=zt?zt+e:e;return r._events[o]?r._events[o].fn?r._events[o]=[r._events[o],i]:r._events[o].push(i):(r._events[o]=i,r._eventsCount++),r}function Fo(r,e){--r._eventsCount===0?r._events=new oi:delete r._events[e]}function Mt(){this._events=new oi,this._eventsCount=0}Mt.prototype.eventNames=function(){var e=[],t,n;if(this._eventsCount===0)return e;for(n in t=this._events)rE.call(t,n)&&e.push(zt?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};Mt.prototype.listeners=function(e){var t=zt?zt+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var s=0,i=n.length,o=new Array(i);s<i;s++)o[s]=n[s].fn;return o};Mt.prototype.listenerCount=function(e){var t=zt?zt+e:e,n=this._events[t];return n?n.fn?1:n.length:0};Mt.prototype.emit=function(e,t,n,s,i,o){var c=zt?zt+e:e;if(!this._events[c])return!1;var u=this._events[c],p=arguments.length,m,b;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,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,s),!0;case 5:return u.fn.call(u.context,t,n,s,i),!0;case 6:return u.fn.call(u.context,t,n,s,i,o),!0}for(b=1,m=new Array(p-1);b<p;b++)m[b-1]=arguments[b];u.fn.apply(u.context,m)}else{var x=u.length,S;for(b=0;b<x;b++)switch(u[b].once&&this.removeListener(e,u[b].fn,void 0,!0),p){case 1:u[b].fn.call(u[b].context);break;case 2:u[b].fn.call(u[b].context,t);break;case 3:u[b].fn.call(u[b].context,t,n);break;case 4:u[b].fn.call(u[b].context,t,n,s);break;default:if(!m)for(S=1,m=new Array(p-1);S<p;S++)m[S-1]=arguments[S];u[b].fn.apply(u[b].context,m)}}return!0};Mt.prototype.on=function(e,t,n){return mh(this,e,t,n,!1)};Mt.prototype.once=function(e,t,n){return mh(this,e,t,n,!0)};Mt.prototype.removeListener=function(e,t,n,s){var i=zt?zt+e:e;if(!this._events[i])return this;if(!t)return Fo(this,i),this;var o=this._events[i];if(o.fn)o.fn===t&&(!s||o.once)&&(!n||o.context===n)&&Fo(this,i);else{for(var c=0,u=[],p=o.length;c<p;c++)(o[c].fn!==t||s&&!o[c].once||n&&o[c].context!==n)&&u.push(o[c]);u.length?this._events[i]=u.length===1?u[0]:u:Fo(this,i)}return this};Mt.prototype.removeAllListeners=function(e){var t;return e?(t=zt?zt+e:e,this._events[t]&&Fo(this,t)):(this._events=new oi,this._eventsCount=0),this};Mt.prototype.off=Mt.prototype.removeListener;Mt.prototype.addListener=Mt.prototype.on;Mt.prefixed=zt;Mt.EventEmitter=Mt;typeof pu<"u"&&(pu.exports=Mt)});var Gv={};Qt(Gv,{AddMiniApp:()=>ss,Back:()=>qa,ComposeCast:()=>Lf,Context:()=>$f,DEFAULT_READY_OPTIONS:()=>Da,Errors:()=>ns,Ethereum:()=>fl,Haptics:()=>Bf,Manifest:()=>ja,OpenMiniApp:()=>Cf,QuickAuth:()=>_f,Ready:()=>za,RequestCameraAndMicrophoneAccess:()=>Pf,SendToken:()=>Mf,SignIn:()=>gn,SignManifest:()=>yn,SolanaConnection:()=>ea,SwapToken:()=>Uf,ViewCast:()=>Df,ViewProfile:()=>zf,ViewToken:()=>Ff,actionLaunchFrameSchema:()=>Qf,actionLaunchMiniAppSchema:()=>el,actionSchema:()=>rl,actionViewTokenSchema:()=>tl,aspectRatioSchema:()=>Ja,buttonSchema:()=>nl,buttonTitleSchema:()=>$s,caip19TokenSchema:()=>Za,chains:()=>Rl,createSimpleStringSchema:()=>jr,createSolanaWalletProvider:()=>Gu,default:()=>Hv,descriptionSchema:()=>ml,domainManifestSchema:()=>Sm,domainMiniAppConfigSchema:()=>ec,domainSchema:()=>Ya,encodedJsonFarcasterSignatureSchema:()=>Xa,eventMiniAppAddedSchema:()=>ol,eventMiniAppRemovedSchema:()=>al,eventNotificationsEnabledSchema:()=>cl,frameHost:()=>Kv,hexColorSchema:()=>ps,jsonFarcasterSignatureHeaderSchema:()=>bm,miniAppEmbedNextSchema:()=>sl,miniAppHost:()=>ie,miniAppHostCapabilityList:()=>Qa,miniAppNameSchema:()=>hs,noindexSchema:()=>El,notificationDetailsSchema:()=>Vi,notificationsDisabledSchema:()=>ul,ogDescriptionSchema:()=>wl,ogTitleSchema:()=>bl,primaryCategories:()=>ll,primaryCategorySchema:()=>dl,quickAuth:()=>Ms,requiredCapabilitiesSchema:()=>xl,requiredChainsSchema:()=>Sl,safeParseFrameEmbed:()=>wm,safeParseMiniAppEmbed:()=>il,screenshotUrlsSchema:()=>gl,sdk:()=>Yp,secureUrlSchema:()=>_t,sendNotificationRequestSchema:()=>Em,sendNotificationResponseSchema:()=>Rm,serverEventSchema:()=>vm,subtitleSchema:()=>pl,taglineSchema:()=>_l,tagsSchema:()=>yl,unwrapSolanaProviderRequest:()=>Ju,versionSchema:()=>hl,wrapSolanaProviderRequest:()=>dv});var ss={};Qt(ss,{InvalidDomainManifest:()=>Ma,RejectedByUser:()=>Ua});var ns={};Qt(ns,{BaseError:()=>er});var er=class extends Error{name="BaseError";cause;constructor(e,t={}){super(e,t.cause?{cause:t.cause}:void 0),this.cause=t.cause}};var Ma=class extends er{name="AddMiniApp.InvalidDomainManifest";constructor(){super("Invalid domain manifest")}},Ua=class extends er{name="AddMiniApp.RejectedByUser";constructor(){super("Add miniapp rejected by user")}};var Lf={};var Bf={};var Cf={};var za={};Qt(za,{DEFAULT_READY_OPTIONS:()=>Da});var Da={disableNativeGestures:!1};var Pf={};var Mf={};var gn={};Qt(gn,{RejectedByUser:()=>Fa});var Fa=class extends er{name="SignIn.RejectedByUser";constructor(){super("Sign in rejected by user")}};var yn={};Qt(yn,{GenericError:()=>Wa,InvalidDomain:()=>Va,RejectedByUser:()=>$a});var $a=class extends er{name="SignManifest.RejectedByUser";constructor(){super("Sign manifest rejected by user")}},Va=class extends er{name="SignManifest.InvalidDomain";constructor(){super("Invalid domain provided")}},Wa=class extends er{name="SignManifest.GenericError";constructor(e="Manifest signing failed"){super(e)}};var Uf={};var Df={};var zf={};var Ff={};var qa={};Qt(qa,{DEFAULT_BACK_STATE:()=>r0});var r0={visible:!1};var $f={};var ja={};Qt(ja,{getMiniAppConfig:()=>n0});function n0(r){return r.miniapp||r.frame}var V={};Qt(V,{BRAND:()=>O0,DIRTY:()=>_n,EMPTY_PATH:()=>a0,INVALID:()=>se,NEVER:()=>hm,OK:()=>Ot,ParseStatus:()=>vt,Schema:()=>ge,ZodAny:()=>Wr,ZodArray:()=>kr,ZodBigInt:()=>wn,ZodBoolean:()=>En,ZodBranded:()=>zs,ZodCatch:()=>Ln,ZodDate:()=>Rn,ZodDefault:()=>Nn,ZodDiscriminatedUnion:()=>zi,ZodEffects:()=>nr,ZodEnum:()=>On,ZodError:()=>Vt,ZodFirstPartyTypeKind:()=>ae,ZodFunction:()=>$i,ZodIntersection:()=>An,ZodIssueCode:()=>M,ZodLazy:()=>In,ZodLiteral:()=>kn,ZodMap:()=>fs,ZodNaN:()=>ds,ZodNativeEnum:()=>Tn,ZodNever:()=>ar,ZodNull:()=>Sn,ZodNullable:()=>gr,ZodNumber:()=>bn,ZodObject:()=>Wt,ZodOptional:()=>tr,ZodParsedType:()=>H,ZodPipeline:()=>Fs,ZodPromise:()=>qr,ZodReadonly:()=>Bn,ZodRecord:()=>Fi,ZodSchema:()=>ge,ZodSet:()=>ls,ZodString:()=>Vr,ZodSymbol:()=>cs,ZodTransformer:()=>nr,ZodTuple:()=>mr,ZodType:()=>ge,ZodUndefined:()=>vn,ZodUnion:()=>xn,ZodUnknown:()=>Ir,ZodVoid:()=>us,addIssueToContext:()=>q,any:()=>D0,array:()=>V0,bigint:()=>B0,boolean:()=>Xf,coerce:()=>dm,custom:()=>Zf,date:()=>C0,datetimeRegex:()=>Hf,defaultErrorMap:()=>xr,discriminatedUnion:()=>K0,effect:()=>sm,enum:()=>tm,function:()=>X0,getErrorMap:()=>is,getParsedType:()=>pr,instanceof:()=>N0,intersection:()=>H0,isAborted:()=>Ui,isAsync:()=>os,isDirty:()=>Di,isValid:()=>$r,late:()=>T0,lazy:()=>Q0,literal:()=>em,makeIssue:()=>Ds,map:()=>Y0,nan:()=>L0,nativeEnum:()=>rm,never:()=>F0,null:()=>U0,nullable:()=>om,number:()=>Jf,object:()=>W0,objectUtil:()=>Ka,oboolean:()=>lm,onumber:()=>fm,optional:()=>im,ostring:()=>um,pipeline:()=>cm,preprocess:()=>am,promise:()=>nm,quotelessJson:()=>s0,record:()=>Z0,set:()=>J0,setErrorMap:()=>o0,strictObject:()=>q0,string:()=>Yf,symbol:()=>P0,transformer:()=>sm,tuple:()=>G0,undefined:()=>M0,union:()=>j0,unknown:()=>z0,util:()=>_e,void:()=>$0});var _e;(function(r){r.assertEqual=s=>{};function e(s){}r.assertIs=e;function t(s){throw new Error}r.assertNever=t,r.arrayToEnum=s=>{let i={};for(let o of s)i[o]=o;return i},r.getValidEnumValues=s=>{let i=r.objectKeys(s).filter(c=>typeof s[s[c]]!="number"),o={};for(let c of i)o[c]=s[c];return r.objectValues(o)},r.objectValues=s=>r.objectKeys(s).map(function(i){return s[i]}),r.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let i=[];for(let o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.push(o);return i},r.find=(s,i)=>{for(let o of s)if(i(o))return o},r.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,i=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}r.joinValues=n,r.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(_e||(_e={}));var Ka;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(Ka||(Ka={}));var H=_e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),pr=r=>{switch(typeof r){case"undefined":return H.undefined;case"string":return H.string;case"number":return Number.isNaN(r)?H.nan:H.number;case"boolean":return H.boolean;case"function":return H.function;case"bigint":return H.bigint;case"symbol":return H.symbol;case"object":return Array.isArray(r)?H.array:r===null?H.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?H.promise:typeof Map<"u"&&r instanceof Map?H.map:typeof Set<"u"&&r instanceof Set?H.set:typeof Date<"u"&&r instanceof Date?H.date:H.object;default:return H.unknown}};var M=_e.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),s0=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),Vt=class r extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(i){return i.message},n={_errors:[]},s=i=>{for(let o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)n._errors.push(t(o));else{let c=n,u=0;for(;u<o.path.length;){let p=o.path[u];u===o.path.length-1?(c[p]=c[p]||{_errors:[]},c[p]._errors.push(t(o))):c[p]=c[p]||{_errors:[]},c=c[p],u++}}};return s(this),n}static assert(e){if(!(e instanceof r))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,_e.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},n=[];for(let s of this.issues)s.path.length>0?(t[s.path[0]]=t[s.path[0]]||[],t[s.path[0]].push(e(s))):n.push(e(s));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};Vt.create=r=>new Vt(r);var i0=(r,e)=>{let t;switch(r.code){case M.invalid_type:r.received===H.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case M.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,_e.jsonStringifyReplacer)}`;break;case M.unrecognized_keys:t=`Unrecognized key(s) in object: ${_e.joinValues(r.keys,", ")}`;break;case M.invalid_union:t="Invalid input";break;case M.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${_e.joinValues(r.options)}`;break;case M.invalid_enum_value:t=`Invalid enum value. Expected ${_e.joinValues(r.options)}, received '${r.received}'`;break;case M.invalid_arguments:t="Invalid function arguments";break;case M.invalid_return_type:t="Invalid function return type";break;case M.invalid_date:t="Invalid date";break;case M.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:_e.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case M.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case M.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case M.custom:t="Invalid input";break;case M.invalid_intersection_types:t="Intersection results could not be merged";break;case M.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case M.not_finite:t="Number must be finite";break;default:t=e.defaultError,_e.assertNever(r)}return{message:t}},xr=i0;var Vf=xr;function o0(r){Vf=r}function is(){return Vf}var Ds=r=>{let{data:e,path:t,errorMaps:n,issueData:s}=r,i=[...t,...s.path||[]],o={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let c="",u=n.filter(p=>!!p).slice().reverse();for(let p of u)c=p(o,{data:e,defaultError:c}).message;return{...s,path:i,message:c}},a0=[];function q(r,e){let t=is(),n=Ds({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===xr?void 0:xr].filter(s=>!!s)});r.common.issues.push(n)}var vt=class r{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let n=[];for(let s of t){if(s.status==="aborted")return se;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let s of t){let i=await s.key,o=await s.value;n.push({key:i,value:o})}return r.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let s of t){let{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return se;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(n[i.value]=o.value)}return{status:e.value,value:n}}},se=Object.freeze({status:"aborted"}),_n=r=>({status:"dirty",value:r}),Ot=r=>({status:"valid",value:r}),Ui=r=>r.status==="aborted",Di=r=>r.status==="dirty",$r=r=>r.status==="valid",os=r=>typeof Promise<"u"&&r instanceof Promise;var J;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e?.message})(J||(J={}));var rr=class{constructor(e,t,n,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Wf=(r,e)=>{if($r(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new Vt(r.common.issues);return this._error=t,this._error}}};function de(r){if(!r)return{};let{errorMap:e,invalid_type_error:t,required_error:n,description:s}=r;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(o,c)=>{let{message:u}=r;return o.code==="invalid_enum_value"?{message:u??c.defaultError}:typeof c.data>"u"?{message:u??n??c.defaultError}:o.code!=="invalid_type"?{message:c.defaultError}:{message:u??t??c.defaultError}},description:s}}var ge=class{get description(){return this._def.description}_getType(e){return pr(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:pr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new vt,ctx:{common:e.parent.common,data:e.data,parsedType:pr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(os(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pr(e)},s=this._parseSync({data:e,path:n.path,parent:n});return Wf(n,s)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pr(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:t});return $r(n)?{value:n.value}:{issues:t.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(n=>$r(n)?{value:n.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pr(e)},s=this._parse({data:e,path:n.path,parent:n}),i=await(os(s)?s:Promise.resolve(s));return Wf(n,i)}refine(e,t){let n=s=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(s):t;return this._refinement((s,i)=>{let o=e(s),c=()=>i.addIssue({code:M.custom,...n(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(c(),!1)):o?!0:(c(),!1)})}refinement(e,t){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof t=="function"?t(n,s):t),!1))}_refinement(e){return new nr({schema:this,typeName:ae.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return tr.create(this,this._def)}nullable(){return gr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return kr.create(this)}promise(){return qr.create(this,this._def)}or(e){return xn.create([this,e],this._def)}and(e){return An.create(this,e,this._def)}transform(e){return new nr({...de(this._def),schema:this,typeName:ae.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new Nn({...de(this._def),innerType:this,defaultValue:t,typeName:ae.ZodDefault})}brand(){return new zs({typeName:ae.ZodBranded,type:this,...de(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new Ln({...de(this._def),innerType:this,catchValue:t,typeName:ae.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Fs.create(this,e)}readonly(){return Bn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},c0=/^c[^\s-]{8,}$/i,u0=/^[0-9a-z]+$/,f0=/^[0-9A-HJKMNP-TV-Z]{26}$/i,l0=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,d0=/^[a-z0-9_-]{21}$/i,h0=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,p0=/^[-+]?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)?)??$/,m0=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,g0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ha,y0=/^(?:(?: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=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,b0=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,w0=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,E0=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,R0=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,jf="((\\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])))",v0=new RegExp(`^${jf}$`);function Kf(r){let e="[0-5]\\d";r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`);let t=r.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function S0(r){return new RegExp(`^${Kf(r)}$`)}function Hf(r){let e=`${jf}T${Kf(r)}`,t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function x0(r,e){return!!((e==="v4"||!e)&&y0.test(r)||(e==="v6"||!e)&&b0.test(r))}function A0(r,e){if(!h0.test(r))return!1;try{let[t]=r.split("."),n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function I0(r,e){return!!((e==="v4"||!e)&&_0.test(r)||(e==="v6"||!e)&&w0.test(r))}var Vr=class r extends ge{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==H.string){let i=this._getOrReturnCtx(e);return q(i,{code:M.invalid_type,expected:H.string,received:i.parsedType}),se}let n=new vt,s;for(let i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),q(s,{code:M.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(s=this._getOrReturnCtx(e,s),q(s,{code:M.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let o=e.data.length>i.value,c=e.data.length<i.value;(o||c)&&(s=this._getOrReturnCtx(e,s),o?q(s,{code:M.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):c&&q(s,{code:M.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")m0.test(e.data)||(s=this._getOrReturnCtx(e,s),q(s,{validation:"email",code:M.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Ha||(Ha=new RegExp(g0,"u")),Ha.test(e.data)||(s=this._getOrReturnCtx(e,s),q(s,{validation:"emoji",code:M.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")l0.test(e.data)||(s=this._getOrReturnCtx(e,s),q(s,{validation:"uuid",code:M.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")d0.test(e.data)||(s=this._getOrReturnCtx(e,s),q(s,{validation:"nanoid",code:M.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")c0.test(e.data)||(s=this._getOrReturnCtx(e,s),q(s,{validation:"cuid",code:M.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")u0.test(e.data)||(s=this._getOrReturnCtx(e,s),q(s,{validation:"cuid2",code:M.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")f0.test(e.data)||(s=this._getOrReturnCtx(e,s),q(s,{validation:"ulid",code:M.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),q(s,{validation:"url",code:M.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),q(s,{validation:"regex",code:M.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(e,s),q(s,{code:M.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(s=this._getOrReturnCtx(e,s),q(s,{code:M.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),q(s,{code:M.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?Hf(i).test(e.data)||(s=this._getOrReturnCtx(e,s),q(s,{code:M.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?v0.test(e.data)||(s=this._getOrReturnCtx(e,s),q(s,{code:M.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?S0(i).test(e.data)||(s=this._getOrReturnCtx(e,s),q(s,{code:M.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?p0.test(e.data)||(s=this._getOrReturnCtx(e,s),q(s,{validation:"duration",code:M.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?x0(e.data,i.version)||(s=this._getOrReturnCtx(e,s),q(s,{validation:"ip",code:M.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?A0(e.data,i.alg)||(s=this._getOrReturnCtx(e,s),q(s,{validation:"jwt",code:M.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?I0(e.data,i.version)||(s=this._getOrReturnCtx(e,s),q(s,{validation:"cidr",code:M.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?E0.test(e.data)||(s=this._getOrReturnCtx(e,s),q(s,{validation:"base64",code:M.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?R0.test(e.data)||(s=this._getOrReturnCtx(e,s),q(s,{validation:"base64url",code:M.invalid_string,message:i.message}),n.dirty()):_e.assertNever(i);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(s=>e.test(s),{validation:t,code:M.invalid_string,...J.errToObj(n)})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...J.errToObj(e)})}url(e){return this._addCheck({kind:"url",...J.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...J.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...J.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...J.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...J.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...J.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...J.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...J.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...J.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...J.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...J.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...J.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...J.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...J.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...J.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...J.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...J.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...J.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...J.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...J.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...J.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...J.errToObj(t)})}nonempty(e){return this.min(1,J.errToObj(e))}trim(){return new r({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};Vr.create=r=>new Vr({checks:[],typeName:ae.ZodString,coerce:r?.coerce??!1,...de(r)});function k0(r,e){let t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=t>n?t:n,i=Number.parseInt(r.toFixed(s).replace(".","")),o=Number.parseInt(e.toFixed(s).replace(".",""));return i%o/10**s}var bn=class r extends ge{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==H.number){let i=this._getOrReturnCtx(e);return q(i,{code:M.invalid_type,expected:H.number,received:i.parsedType}),se}let n,s=new vt;for(let i of this._def.checks)i.kind==="int"?_e.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{code:M.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),q(n,{code:M.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),q(n,{code:M.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?k0(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),q(n,{code:M.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{code:M.not_finite,message:i.message}),s.dirty()):_e.assertNever(i);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,J.toString(t))}gt(e,t){return this.setLimit("min",e,!1,J.toString(t))}lte(e,t){return this.setLimit("max",e,!0,J.toString(t))}lt(e,t){return this.setLimit("max",e,!1,J.toString(t))}setLimit(e,t,n,s){return new r({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:J.toString(s)}]})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:J.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:J.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:J.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:J.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:J.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:J.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:J.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:J.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:J.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&_e.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}};bn.create=r=>new bn({checks:[],typeName:ae.ZodNumber,coerce:r?.coerce||!1,...de(r)});var wn=class r extends ge{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==H.bigint)return this._getInvalidInput(e);let n,s=new vt;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),q(n,{code:M.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),q(n,{code:M.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),q(n,{code:M.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):_e.assertNever(i);return{status:s.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return q(t,{code:M.invalid_type,expected:H.bigint,received:t.parsedType}),se}gte(e,t){return this.setLimit("min",e,!0,J.toString(t))}gt(e,t){return this.setLimit("min",e,!1,J.toString(t))}lte(e,t){return this.setLimit("max",e,!0,J.toString(t))}lt(e,t){return this.setLimit("max",e,!1,J.toString(t))}setLimit(e,t,n,s){return new r({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:J.toString(s)}]})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:J.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:J.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:J.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:J.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:J.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};wn.create=r=>new wn({checks:[],typeName:ae.ZodBigInt,coerce:r?.coerce??!1,...de(r)});var En=class extends ge{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==H.boolean){let n=this._getOrReturnCtx(e);return q(n,{code:M.invalid_type,expected:H.boolean,received:n.parsedType}),se}return Ot(e.data)}};En.create=r=>new En({typeName:ae.ZodBoolean,coerce:r?.coerce||!1,...de(r)});var Rn=class r extends ge{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==H.date){let i=this._getOrReturnCtx(e);return q(i,{code:M.invalid_type,expected:H.date,received:i.parsedType}),se}if(Number.isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return q(i,{code:M.invalid_date}),se}let n=new vt,s;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),q(s,{code:M.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),q(s,{code:M.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):_e.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:J.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:J.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};Rn.create=r=>new Rn({checks:[],coerce:r?.coerce||!1,typeName:ae.ZodDate,...de(r)});var cs=class extends ge{_parse(e){if(this._getType(e)!==H.symbol){let n=this._getOrReturnCtx(e);return q(n,{code:M.invalid_type,expected:H.symbol,received:n.parsedType}),se}return Ot(e.data)}};cs.create=r=>new cs({typeName:ae.ZodSymbol,...de(r)});var vn=class extends ge{_parse(e){if(this._getType(e)!==H.undefined){let n=this._getOrReturnCtx(e);return q(n,{code:M.invalid_type,expected:H.undefined,received:n.parsedType}),se}return Ot(e.data)}};vn.create=r=>new vn({typeName:ae.ZodUndefined,...de(r)});var Sn=class extends ge{_parse(e){if(this._getType(e)!==H.null){let n=this._getOrReturnCtx(e);return q(n,{code:M.invalid_type,expected:H.null,received:n.parsedType}),se}return Ot(e.data)}};Sn.create=r=>new Sn({typeName:ae.ZodNull,...de(r)});var Wr=class extends ge{constructor(){super(...arguments),this._any=!0}_parse(e){return Ot(e.data)}};Wr.create=r=>new Wr({typeName:ae.ZodAny,...de(r)});var Ir=class extends ge{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ot(e.data)}};Ir.create=r=>new Ir({typeName:ae.ZodUnknown,...de(r)});var ar=class extends ge{_parse(e){let t=this._getOrReturnCtx(e);return q(t,{code:M.invalid_type,expected:H.never,received:t.parsedType}),se}};ar.create=r=>new ar({typeName:ae.ZodNever,...de(r)});var us=class extends ge{_parse(e){if(this._getType(e)!==H.undefined){let n=this._getOrReturnCtx(e);return q(n,{code:M.invalid_type,expected:H.void,received:n.parsedType}),se}return Ot(e.data)}};us.create=r=>new us({typeName:ae.ZodVoid,...de(r)});var kr=class r extends ge{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),s=this._def;if(t.parsedType!==H.array)return q(t,{code:M.invalid_type,expected:H.array,received:t.parsedType}),se;if(s.exactLength!==null){let o=t.data.length>s.exactLength.value,c=t.data.length<s.exactLength.value;(o||c)&&(q(t,{code:o?M.too_big:M.too_small,minimum:c?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&t.data.length<s.minLength.value&&(q(t,{code:M.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&t.data.length>s.maxLength.value&&(q(t,{code:M.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((o,c)=>s.type._parseAsync(new rr(t,o,t.path,c)))).then(o=>vt.mergeArray(n,o));let i=[...t.data].map((o,c)=>s.type._parseSync(new rr(t,o,t.path,c)));return vt.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new r({...this._def,minLength:{value:e,message:J.toString(t)}})}max(e,t){return new r({...this._def,maxLength:{value:e,message:J.toString(t)}})}length(e,t){return new r({...this._def,exactLength:{value:e,message:J.toString(t)}})}nonempty(e){return this.min(1,e)}};kr.create=(r,e)=>new kr({type:r,minLength:null,maxLength:null,exactLength:null,typeName:ae.ZodArray,...de(e)});function as(r){if(r instanceof Wt){let e={};for(let t in r.shape){let n=r.shape[t];e[t]=tr.create(as(n))}return new Wt({...r._def,shape:()=>e})}else return r instanceof kr?new kr({...r._def,type:as(r.element)}):r instanceof tr?tr.create(as(r.unwrap())):r instanceof gr?gr.create(as(r.unwrap())):r instanceof mr?mr.create(r.items.map(e=>as(e))):r}var Wt=class r extends ge{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=_e.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==H.object){let p=this._getOrReturnCtx(e);return q(p,{code:M.invalid_type,expected:H.object,received:p.parsedType}),se}let{status:n,ctx:s}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),c=[];if(!(this._def.catchall instanceof ar&&this._def.unknownKeys==="strip"))for(let p in s.data)o.includes(p)||c.push(p);let u=[];for(let p of o){let m=i[p],b=s.data[p];u.push({key:{status:"valid",value:p},value:m._parse(new rr(s,b,s.path,p)),alwaysSet:p in s.data})}if(this._def.catchall instanceof ar){let p=this._def.unknownKeys;if(p==="passthrough")for(let m of c)u.push({key:{status:"valid",value:m},value:{status:"valid",value:s.data[m]}});else if(p==="strict")c.length>0&&(q(s,{code:M.unrecognized_keys,keys:c}),n.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let p=this._def.catchall;for(let m of c){let b=s.data[m];u.push({key:{status:"valid",value:m},value:p._parse(new rr(s,b,s.path,m)),alwaysSet:m in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let p=[];for(let m of u){let b=await m.key,x=await m.value;p.push({key:b,value:x,alwaysSet:m.alwaysSet})}return p}).then(p=>vt.mergeObjectSync(n,p)):vt.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return J.errToObj,new r({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{let s=this._def.errorMap?.(t,n).message??n.defaultError;return t.code==="unrecognized_keys"?{message:J.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new r({...this._def,unknownKeys:"strip"})}passthrough(){return new r({...this._def,unknownKeys:"passthrough"})}extend(e){return new r({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new r({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ae.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new r({...this._def,catchall:e})}pick(e){let t={};for(let n of _e.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new r({...this._def,shape:()=>t})}omit(e){let t={};for(let n of _e.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new r({...this._def,shape:()=>t})}deepPartial(){return as(this)}partial(e){let t={};for(let n of _e.objectKeys(this.shape)){let s=this.shape[n];e&&!e[n]?t[n]=s:t[n]=s.optional()}return new r({...this._def,shape:()=>t})}required(e){let t={};for(let n of _e.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof tr;)i=i._def.innerType;t[n]=i}return new r({...this._def,shape:()=>t})}keyof(){return Gf(_e.objectKeys(this.shape))}};Wt.create=(r,e)=>new Wt({shape:()=>r,unknownKeys:"strip",catchall:ar.create(),typeName:ae.ZodObject,...de(e)});Wt.strictCreate=(r,e)=>new Wt({shape:()=>r,unknownKeys:"strict",catchall:ar.create(),typeName:ae.ZodObject,...de(e)});Wt.lazycreate=(r,e)=>new Wt({shape:r,unknownKeys:"strip",catchall:ar.create(),typeName:ae.ZodObject,...de(e)});var xn=class extends ge{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function s(i){for(let c of i)if(c.result.status==="valid")return c.result;for(let c of i)if(c.result.status==="dirty")return t.common.issues.push(...c.ctx.common.issues),c.result;let o=i.map(c=>new Vt(c.ctx.common.issues));return q(t,{code:M.invalid_union,unionErrors:o}),se}if(t.common.async)return Promise.all(n.map(async i=>{let o={...t,common:{...t.common,issues:[]},parent:null};return{result:await i._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(s);{let i,o=[];for(let u of n){let p={...t,common:{...t.common,issues:[]},parent:null},m=u._parseSync({data:t.data,path:t.path,parent:p});if(m.status==="valid")return m;m.status==="dirty"&&!i&&(i={result:m,ctx:p}),p.common.issues.length&&o.push(p.common.issues)}if(i)return t.common.issues.push(...i.ctx.common.issues),i.result;let c=o.map(u=>new Vt(u));return q(t,{code:M.invalid_union,unionErrors:c}),se}}get options(){return this._def.options}};xn.create=(r,e)=>new xn({options:r,typeName:ae.ZodUnion,...de(e)});var Ar=r=>r instanceof In?Ar(r.schema):r instanceof nr?Ar(r.innerType()):r instanceof kn?[r.value]:r instanceof On?r.options:r instanceof Tn?_e.objectValues(r.enum):r instanceof Nn?Ar(r._def.innerType):r instanceof vn?[void 0]:r instanceof Sn?[null]:r instanceof tr?[void 0,...Ar(r.unwrap())]:r instanceof gr?[null,...Ar(r.unwrap())]:r instanceof zs||r instanceof Bn?Ar(r.unwrap()):r instanceof Ln?Ar(r._def.innerType):[],zi=class r extends ge{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==H.object)return q(t,{code:M.invalid_type,expected:H.object,received:t.parsedType}),se;let n=this.discriminator,s=t.data[n],i=this.optionsMap.get(s);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(q(t,{code:M.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),se)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){let s=new Map;for(let i of t){let o=Ar(i.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let c of o){if(s.has(c))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(c)}`);s.set(c,i)}}return new r({typeName:ae.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:s,...de(n)})}};function Ga(r,e){let t=pr(r),n=pr(e);if(r===e)return{valid:!0,data:r};if(t===H.object&&n===H.object){let s=_e.objectKeys(e),i=_e.objectKeys(r).filter(c=>s.indexOf(c)!==-1),o={...r,...e};for(let c of i){let u=Ga(r[c],e[c]);if(!u.valid)return{valid:!1};o[c]=u.data}return{valid:!0,data:o}}else if(t===H.array&&n===H.array){if(r.length!==e.length)return{valid:!1};let s=[];for(let i=0;i<r.length;i++){let o=r[i],c=e[i],u=Ga(o,c);if(!u.valid)return{valid:!1};s.push(u.data)}return{valid:!0,data:s}}else return t===H.date&&n===H.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}var An=class extends ge{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),s=(i,o)=>{if(Ui(i)||Ui(o))return se;let c=Ga(i.value,o.value);return c.valid?((Di(i)||Di(o))&&t.dirty(),{status:t.value,value:c.data}):(q(n,{code:M.invalid_intersection_types}),se)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,o])=>s(i,o)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};An.create=(r,e,t)=>new An({left:r,right:e,typeName:ae.ZodIntersection,...de(t)});var mr=class r extends ge{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==H.array)return q(n,{code:M.invalid_type,expected:H.array,received:n.parsedType}),se;if(n.data.length<this._def.items.length)return q(n,{code:M.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),se;!this._def.rest&&n.data.length>this._def.items.length&&(q(n,{code:M.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let i=[...n.data].map((o,c)=>{let u=this._def.items[c]||this._def.rest;return u?u._parse(new rr(n,o,n.path,c)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>vt.mergeArray(t,o)):vt.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new r({...this._def,rest:e})}};mr.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new mr({items:r,typeName:ae.ZodTuple,rest:null,...de(e)})};var Fi=class r extends ge{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==H.object)return q(n,{code:M.invalid_type,expected:H.object,received:n.parsedType}),se;let s=[],i=this._def.keyType,o=this._def.valueType;for(let c in n.data)s.push({key:i._parse(new rr(n,c,n.path,c)),value:o._parse(new rr(n,n.data[c],n.path,c)),alwaysSet:c in n.data});return n.common.async?vt.mergeObjectAsync(t,s):vt.mergeObjectSync(t,s)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof ge?new r({keyType:e,valueType:t,typeName:ae.ZodRecord,...de(n)}):new r({keyType:Vr.create(),valueType:e,typeName:ae.ZodRecord,...de(t)})}},fs=class extends ge{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==H.map)return q(n,{code:M.invalid_type,expected:H.map,received:n.parsedType}),se;let s=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([c,u],p)=>({key:s._parse(new rr(n,c,n.path,[p,"key"])),value:i._parse(new rr(n,u,n.path,[p,"value"]))}));if(n.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let u of o){let p=await u.key,m=await u.value;if(p.status==="aborted"||m.status==="aborted")return se;(p.status==="dirty"||m.status==="dirty")&&t.dirty(),c.set(p.value,m.value)}return{status:t.value,value:c}})}else{let c=new Map;for(let u of o){let p=u.key,m=u.value;if(p.status==="aborted"||m.status==="aborted")return se;(p.status==="dirty"||m.status==="dirty")&&t.dirty(),c.set(p.value,m.value)}return{status:t.value,value:c}}}};fs.create=(r,e,t)=>new fs({valueType:e,keyType:r,typeName:ae.ZodMap,...de(t)});var ls=class r extends ge{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==H.set)return q(n,{code:M.invalid_type,expected:H.set,received:n.parsedType}),se;let s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(q(n,{code:M.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(q(n,{code:M.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());let i=this._def.valueType;function o(u){let p=new Set;for(let m of u){if(m.status==="aborted")return se;m.status==="dirty"&&t.dirty(),p.add(m.value)}return{status:t.value,value:p}}let c=[...n.data.values()].map((u,p)=>i._parse(new rr(n,u,n.path,p)));return n.common.async?Promise.all(c).then(u=>o(u)):o(c)}min(e,t){return new r({...this._def,minSize:{value:e,message:J.toString(t)}})}max(e,t){return new r({...this._def,maxSize:{value:e,message:J.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};ls.create=(r,e)=>new ls({valueType:r,minSize:null,maxSize:null,typeName:ae.ZodSet,...de(e)});var $i=class r extends ge{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==H.function)return q(t,{code:M.invalid_type,expected:H.function,received:t.parsedType}),se;function n(c,u){return Ds({data:c,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,is(),xr].filter(p=>!!p),issueData:{code:M.invalid_arguments,argumentsError:u}})}function s(c,u){return Ds({data:c,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,is(),xr].filter(p=>!!p),issueData:{code:M.invalid_return_type,returnTypeError:u}})}let i={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof qr){let c=this;return Ot(async function(...u){let p=new Vt([]),m=await c._def.args.parseAsync(u,i).catch(S=>{throw p.addIssue(n(u,S)),p}),b=await Reflect.apply(o,this,m);return await c._def.returns._def.type.parseAsync(b,i).catch(S=>{throw p.addIssue(s(b,S)),p})})}else{let c=this;return Ot(function(...u){let p=c._def.args.safeParse(u,i);if(!p.success)throw new Vt([n(u,p.error)]);let m=Reflect.apply(o,this,p.data),b=c._def.returns.safeParse(m,i);if(!b.success)throw new Vt([s(m,b.error)]);return b.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new r({...this._def,args:mr.create(e).rest(Ir.create())})}returns(e){return new r({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new r({args:e||mr.create([]).rest(Ir.create()),returns:t||Ir.create(),typeName:ae.ZodFunction,...de(n)})}},In=class extends ge{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};In.create=(r,e)=>new In({getter:r,typeName:ae.ZodLazy,...de(e)});var kn=class extends ge{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return q(t,{received:t.data,code:M.invalid_literal,expected:this._def.value}),se}return{status:"valid",value:e.data}}get value(){return this._def.value}};kn.create=(r,e)=>new kn({value:r,typeName:ae.ZodLiteral,...de(e)});function Gf(r,e){return new On({values:r,typeName:ae.ZodEnum,...de(e)})}var On=class r extends ge{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return q(t,{expected:_e.joinValues(n),received:t.parsedType,code:M.invalid_type}),se}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return q(t,{received:t.data,code:M.invalid_enum_value,options:n}),se}return Ot(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return r.create(e,{...this._def,...t})}exclude(e,t=this._def){return r.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}};On.create=Gf;var Tn=class extends ge{_parse(e){let t=_e.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==H.string&&n.parsedType!==H.number){let s=_e.objectValues(t);return q(n,{expected:_e.joinValues(s),received:n.parsedType,code:M.invalid_type}),se}if(this._cache||(this._cache=new Set(_e.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let s=_e.objectValues(t);return q(n,{received:n.data,code:M.invalid_enum_value,options:s}),se}return Ot(e.data)}get enum(){return this._def.values}};Tn.create=(r,e)=>new Tn({values:r,typeName:ae.ZodNativeEnum,...de(e)});var qr=class extends ge{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==H.promise&&t.common.async===!1)return q(t,{code:M.invalid_type,expected:H.promise,received:t.parsedType}),se;let n=t.parsedType===H.promise?t.data:Promise.resolve(t.data);return Ot(n.then(s=>this._def.type.parseAsync(s,{path:t.path,errorMap:t.common.contextualErrorMap})))}};qr.create=(r,e)=>new qr({type:r,typeName:ae.ZodPromise,...de(e)});var nr=class extends ge{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ae.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:o=>{q(n,o),o.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){let o=s.transform(n.data,i);if(n.common.async)return Promise.resolve(o).then(async c=>{if(t.value==="aborted")return se;let u=await this._def.schema._parseAsync({data:c,path:n.path,parent:n});return u.status==="aborted"?se:u.status==="dirty"?_n(u.value):t.value==="dirty"?_n(u.value):u});{if(t.value==="aborted")return se;let c=this._def.schema._parseSync({data:o,path:n.path,parent:n});return c.status==="aborted"?se:c.status==="dirty"?_n(c.value):t.value==="dirty"?_n(c.value):c}}if(s.type==="refinement"){let o=c=>{let u=s.refinement(c,i);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(n.common.async===!1){let c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return c.status==="aborted"?se:(c.status==="dirty"&&t.dirty(),o(c.value),{status:t.value,value:c.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>c.status==="aborted"?se:(c.status==="dirty"&&t.dirty(),o(c.value).then(()=>({status:t.value,value:c.value}))))}if(s.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!$r(o))return se;let c=s.transform(o.value,i);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:c}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>$r(o)?Promise.resolve(s.transform(o.value,i)).then(c=>({status:t.value,value:c})):se);_e.assertNever(s)}};nr.create=(r,e,t)=>new nr({schema:r,typeName:ae.ZodEffects,effect:e,...de(t)});nr.createWithPreprocess=(r,e,t)=>new nr({schema:e,effect:{type:"preprocess",transform:r},typeName:ae.ZodEffects,...de(t)});var tr=class extends ge{_parse(e){return this._getType(e)===H.undefined?Ot(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};tr.create=(r,e)=>new tr({innerType:r,typeName:ae.ZodOptional,...de(e)});var gr=class extends ge{_parse(e){return this._getType(e)===H.null?Ot(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};gr.create=(r,e)=>new gr({innerType:r,typeName:ae.ZodNullable,...de(e)});var Nn=class extends ge{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===H.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Nn.create=(r,e)=>new Nn({innerType:r,typeName:ae.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...de(e)});var Ln=class extends ge{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return os(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Vt(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Vt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Ln.create=(r,e)=>new Ln({innerType:r,typeName:ae.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...de(e)});var ds=class extends ge{_parse(e){if(this._getType(e)!==H.nan){let n=this._getOrReturnCtx(e);return q(n,{code:M.invalid_type,expected:H.nan,received:n.parsedType}),se}return{status:"valid",value:e.data}}};ds.create=r=>new ds({typeName:ae.ZodNaN,...de(r)});var O0=Symbol("zod_brand"),zs=class extends ge{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},Fs=class r extends ge{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?se:i.status==="dirty"?(t.dirty(),_n(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?se:s.status==="dirty"?(t.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,t){return new r({in:e,out:t,typeName:ae.ZodPipeline})}},Bn=class extends ge{_parse(e){let t=this._def.innerType._parse(e),n=s=>($r(s)&&(s.value=Object.freeze(s.value)),s);return os(t)?t.then(s=>n(s)):n(t)}unwrap(){return this._def.innerType}};Bn.create=(r,e)=>new Bn({innerType:r,typeName:ae.ZodReadonly,...de(e)});function qf(r,e){let t=typeof r=="function"?r(e):typeof r=="string"?{message:r}:r;return typeof t=="string"?{message:t}:t}function Zf(r,e={},t){return r?Wr.create().superRefine((n,s)=>{let i=r(n);if(i instanceof Promise)return i.then(o=>{if(!o){let c=qf(e,n),u=c.fatal??t??!0;s.addIssue({code:"custom",...c,fatal:u})}});if(!i){let o=qf(e,n),c=o.fatal??t??!0;s.addIssue({code:"custom",...o,fatal:c})}}):Wr.create()}var T0={object:Wt.lazycreate},ae;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(ae||(ae={}));var N0=(r,e={message:`Input not instance of ${r.name}`})=>Zf(t=>t instanceof r,e),Yf=Vr.create,Jf=bn.create,L0=ds.create,B0=wn.create,Xf=En.create,C0=Rn.create,P0=cs.create,M0=vn.create,U0=Sn.create,D0=Wr.create,z0=Ir.create,F0=ar.create,$0=us.create,V0=kr.create,W0=Wt.create,q0=Wt.strictCreate,j0=xn.create,K0=zi.create,H0=An.create,G0=mr.create,Z0=Fi.create,Y0=fs.create,J0=ls.create,X0=$i.create,Q0=In.create,em=kn.create,tm=On.create,rm=Tn.create,nm=qr.create,sm=nr.create,im=tr.create,om=gr.create,am=nr.createWithPreprocess,cm=Fs.create,um=()=>Yf().optional(),fm=()=>Jf().optional(),lm=()=>Xf().optional(),dm={string:r=>Vr.create({...r,coerce:!0}),number:r=>bn.create({...r,coerce:!0}),boolean:r=>En.create({...r,coerce:!0}),bigint:r=>wn.create({...r,coerce:!0}),date:r=>Rn.create({...r,coerce:!0})};var hm=se;var pm=/[@#$%^&*+=/\\|~«»]/,mm=/(!{2,}|\?{2,}|-{2,})/,gm=/[\u{1F300}-\u{1F9FF}]|[\u{2702}-\u{27B0}]|[\u{2600}-\u{26FF}]|[\u{2B00}-\u{2BFF}]/u,jr=({max:r,noSpaces:e}={})=>(e?V.string().max(r??Number.POSITIVE_INFINITY).regex(/^\S*$/,"Spaces are not allowed"):V.string().max(r??Number.POSITIVE_INFINITY)).refine(n=>!gm.test(n),{message:"Emojis and symbols are not allowed"}).refine(n=>!pm.test(n),{message:"Special characters (@, #, $, %, ^, &, *, +, =, /, \\, |, ~, \xAB, \xBB) are not allowed"}).refine(n=>!mm.test(n),{message:"Repeated punctuations (!!, ??, --) are not allowed"}),_t=V.string().url().startsWith("https://",{message:"Must be an https url"}).max(1024).refine(r=>!r.includes(" "),{message:"URL must not contain spaces"}).refine(r=>{try{let e=new URL(r).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"}),hs=V.string().max(32),$s=V.string().max(32),ym=/^[-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)$/,Za=V.string().regex(ym,{message:"Invalid CAIP-19 asset ID"}),ps=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."}),_m=/^(?!.*\.\.)([a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Ya=V.string().max(1024).regex(_m,{message:"Must be a valid domain name (e.g., example.com, sub.example.com)"}).refine(r=>!r.includes("://"),{message:"Domain must not include protocol (http://, https://, etc.)"}).refine(r=>!r.includes("/"),{message:"Domain must not include path separators"}).refine(r=>!r.includes("@"),{message:"Domain must not include @ symbol"}).refine(r=>!r.includes(":"),{message:"Domain must not include port numbers"}),Ja=V.union([V.literal("1:1"),V.literal("3:2")]),Xa=V.object({header:V.string(),payload:V.string(),signature:V.string()}),bm=V.object({fid:V.number(),type:V.literal("app_key"),key:V.string().startsWith("0x")});var Qf=V.object({type:V.literal("launch_frame"),name:hs,url:_t.optional(),splashImageUrl:_t.optional(),splashBackgroundColor:ps.optional()}),el=V.object({type:V.literal("launch_miniapp"),name:hs,url:_t.optional(),splashImageUrl:_t.optional(),splashBackgroundColor:ps.optional()}),tl=V.object({type:V.literal("view_token"),token:Za}),rl=V.discriminatedUnion("type",[el,tl,Qf]),nl=V.object({title:$s,action:rl}),sl=V.object({version:V.union([V.string(),V.number()]).transform(r=>String(r)).pipe(V.union([V.literal("next"),V.literal("1")])),imageUrl:_t,aspectRatio:Ja.optional(),button:nl}),il=r=>sl.safeParse(r),wm=il;var Vi=V.object({url:V.string(),token:V.string()}),Em=V.object({notificationId:V.string().max(128),title:V.string().max(32),body:V.string().max(128),targetUrl:_t,tokens:V.string().array().max(100)}),Rm=V.object({result:V.object({successfulTokens:V.array(V.string()),invalidTokens:V.array(V.string()),rateLimitedTokens:V.array(V.string())})});var ol=V.object({event:V.literal("miniapp_added"),notificationDetails:Vi.optional()}),al=V.object({event:V.literal("miniapp_removed")}),cl=V.object({event:V.literal("notifications_enabled"),notificationDetails:Vi.required()}),ul=V.object({event:V.literal("notifications_disabled")}),vm=V.discriminatedUnion("event",[ol,al,cl,ul]);var fl={};var Qa=["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","actions.openMiniApp","actions.requestCameraAndMicrophoneAccess","experimental.signManifest","haptics.impactOccurred","haptics.notificationOccurred","haptics.selectionChanged","back"];var ll=["games","social","finance","utility","productivity","health-fitness","news-media","music","shopping","education","developer-tools","entertainment","art-creativity"],dl=V.enum(ll),hl=V.union([V.literal("0.0.0"),V.literal("0.0.1"),V.literal("1"),V.literal("next")]),pl=jr({max:30}),ml=jr({max:170}),gl=V.array(_t).max(3),yl=V.array(jr({max:20,noSpaces:!0})).max(5),_l=jr({max:30}),bl=jr({max:30}),wl=jr({max:100}),El=V.boolean(),Rl=["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","eip155:999","solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"];function vl(r){let e=new Set(r);return Array.from(e)}var Sl=V.array(V.enum(Rl)).transform(vl),xl=V.array(V.enum(Qa)).transform(vl),ec=V.object({version:hl,name:hs,iconUrl:_t,homeUrl:_t,imageUrl:_t.optional(),buttonTitle:$s.optional(),splashImageUrl:_t.optional(),splashBackgroundColor:ps.optional(),webhookUrl:_t.optional(),subtitle:pl.optional(),description:ml.optional(),screenshotUrls:gl.optional(),primaryCategory:dl.optional(),tags:yl.optional(),heroImageUrl:_t.optional(),tagline:_l.optional(),ogTitle:bl.optional(),ogDescription:wl.optional(),ogImageUrl:_t.optional(),noindex:El.optional(),requiredChains:Sl.optional(),requiredCapabilities:xl.optional(),castShareUrl:_t.optional(),canonicalDomain:Ya.optional()}).refine(r=>{if(r.castShareUrl===void 0)return!0;try{let e=new URL(r.homeUrl).hostname,t=new URL(r.castShareUrl).hostname;return e===t}catch{return!1}},{message:"castShareUrl must have the same domain as homeUrl",path:["castShareUrl"]}),Sm=V.object({accountAssociation:Xa,miniapp:ec.optional(),frame:ec.optional()}).refine(r=>r.frame&&r.miniapp?JSON.stringify(r.frame)===JSON.stringify(r.miniapp):!0,{message:'If both "frame" and "miniapp" are provided, they must be identical',path:["frame","miniapp"]}).transform(r=>({...r,frame:r.frame??r.miniapp}));var ce=Sr(Ws());function qs(r){if(!Number.isSafeInteger(r)||r<0)throw new Error("positive integer expected, got "+r)}function ng(r){return r instanceof Uint8Array||ArrayBuffer.isView(r)&&r.constructor.name==="Uint8Array"}function Hr(r,...e){if(!ng(r))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(r.length))throw new Error("Uint8Array expected of length "+e+", got length="+r.length)}function Kl(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");qs(r.outputLen),qs(r.blockLen)}function Tr(r,e=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(e&&r.finished)throw new Error("Hash#digest() has already been called")}function Ki(r,e){Hr(r);let t=e.outputLen;if(r.length<t)throw new Error("digestInto() expects output buffer of length at least "+t)}var Mn=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function Hl(r){return new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4))}function Hi(r){return new DataView(r.buffer,r.byteOffset,r.byteLength)}function cr(r,e){return r<<32-e|r>>>e}var lc=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function sg(r){return r<<24&4278190080|r<<8&16711680|r>>>8&65280|r>>>24&255}function dc(r){for(let e=0;e<r.length;e++)r[e]=sg(r[e])}function Gl(r){if(typeof r!="string")throw new Error("utf8ToBytes expected string, got "+typeof r);return new Uint8Array(new TextEncoder().encode(r))}function Zr(r){return typeof r=="string"&&(r=Gl(r)),Hr(r),r}function hc(...r){let e=0;for(let n=0;n<r.length;n++){let s=r[n];Hr(s),e+=s.length}let t=new Uint8Array(e);for(let n=0,s=0;n<r.length;n++){let i=r[n];t.set(i,s),s+=i.length}return t}var Gr=class{clone(){return this._cloneInto()}};function bs(r){let e=n=>r().update(Zr(n)).digest(),t=r();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>r(),e}function Zl(r){let e=(n,s)=>r(s).update(Zr(n)).digest(),t=r({});return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=n=>r(n),e}function Gi(r=32){if(Mn&&typeof Mn.getRandomValues=="function")return Mn.getRandomValues(new Uint8Array(r));if(Mn&&typeof Mn.randomBytes=="function")return Mn.randomBytes(r);throw new Error("crypto.getRandomValues must be defined")}function ig(r,e,t,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(e,t,n);let s=BigInt(32),i=BigInt(4294967295),o=Number(t>>s&i),c=Number(t&i),u=n?4:0,p=n?0:4;r.setUint32(e+u,o,n),r.setUint32(e+p,c,n)}function Yl(r,e,t){return r&e^~r&t}function Jl(r,e,t){return r&e^r&t^e&t}var ws=class extends Gr{constructor(e,t,n,s){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Hi(this.buffer)}update(e){Tr(this);let{view:t,buffer:n,blockLen:s}=this;e=Zr(e);let i=e.length;for(let o=0;o<i;){let c=Math.min(s-this.pos,i-o);if(c===s){let u=Hi(e);for(;s<=i-o;o+=s)this.process(u,o);continue}n.set(e.subarray(o,o+c),this.pos),this.pos+=c,o+=c,this.pos===s&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Tr(this),Ki(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:s,isLE:i}=this,{pos:o}=this;t[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>s-o&&(this.process(n,0),o=0);for(let b=o;b<s;b++)t[b]=0;ig(n,s-8,BigInt(this.length*8),i),this.process(n,0);let c=Hi(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 b=0;b<p;b++)c.setUint32(4*b,m[b],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:n,length:s,finished:i,destroyed:o,pos:c}=this;return e.length=s,e.pos=c,e.finished=i,e.destroyed=o,s%t&&e.buffer.set(n),e}};var Zi=BigInt(4294967295),pc=BigInt(32);function Xl(r,e=!1){return e?{h:Number(r&Zi),l:Number(r>>pc&Zi)}:{h:Number(r>>pc&Zi)|0,l:Number(r&Zi)|0}}function mc(r,e=!1){let t=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let s=0;s<r.length;s++){let{h:i,l:o}=Xl(r[s],e);[t[s],n[s]]=[i,o]}return[t,n]}var og=(r,e)=>BigInt(r>>>0)<<pc|BigInt(e>>>0),ag=(r,e,t)=>r>>>t,cg=(r,e,t)=>r<<32-t|e>>>t,ug=(r,e,t)=>r>>>t|e<<32-t,fg=(r,e,t)=>r<<32-t|e>>>t,lg=(r,e,t)=>r<<64-t|e>>>t-32,dg=(r,e,t)=>r>>>t-32|e<<64-t,hg=(r,e)=>e,pg=(r,e)=>r,gc=(r,e,t)=>r<<t|e>>>32-t,yc=(r,e,t)=>e<<t|r>>>32-t,_c=(r,e,t)=>e<<t-32|r>>>64-t,bc=(r,e,t)=>r<<t-32|e>>>64-t;function mg(r,e,t,n){let s=(e>>>0)+(n>>>0);return{h:r+t+(s/2**32|0)|0,l:s|0}}var gg=(r,e,t)=>(r>>>0)+(e>>>0)+(t>>>0),yg=(r,e,t,n)=>e+t+n+(r/2**32|0)|0,_g=(r,e,t,n)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0),bg=(r,e,t,n,s)=>e+t+n+s+(r/2**32|0)|0,wg=(r,e,t,n,s)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0)+(s>>>0),Eg=(r,e,t,n,s,i)=>e+t+n+s+i+(r/2**32|0)|0;var Rg={fromBig:Xl,split:mc,toBig:og,shrSH:ag,shrSL:cg,rotrSH:ug,rotrSL:fg,rotrBH:lg,rotrBL:dg,rotr32H:hg,rotr32L:pg,rotlSH:gc,rotlSL:yc,rotlBH:_c,rotlBL:bc,add:mg,add3L:gg,add3H:yg,add4L:_g,add4H:bg,add5H:Eg,add5L:wg},pe=Rg;var[vg,Sg]=pe.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(r=>BigInt(r))),Yr=new Uint32Array(80),Jr=new Uint32Array(80),wc=class extends ws{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:t,Bh:n,Bl:s,Ch:i,Cl:o,Dh:c,Dl:u,Eh:p,El:m,Fh:b,Fl:x,Gh:S,Gl:T,Hh:I,Hl:A}=this;return[e,t,n,s,i,o,c,u,p,m,b,x,S,T,I,A]}set(e,t,n,s,i,o,c,u,p,m,b,x,S,T,I,A){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=s|0,this.Ch=i|0,this.Cl=o|0,this.Dh=c|0,this.Dl=u|0,this.Eh=p|0,this.El=m|0,this.Fh=b|0,this.Fl=x|0,this.Gh=S|0,this.Gl=T|0,this.Hh=I|0,this.Hl=A|0}process(e,t){for(let B=0;B<16;B++,t+=4)Yr[B]=e.getUint32(t),Jr[B]=e.getUint32(t+=4);for(let B=16;B<80;B++){let F=Yr[B-15]|0,te=Jr[B-15]|0,G=pe.rotrSH(F,te,1)^pe.rotrSH(F,te,8)^pe.shrSH(F,te,7),Z=pe.rotrSL(F,te,1)^pe.rotrSL(F,te,8)^pe.shrSL(F,te,7),ee=Yr[B-2]|0,Y=Jr[B-2]|0,Ie=pe.rotrSH(ee,Y,19)^pe.rotrBH(ee,Y,61)^pe.shrSH(ee,Y,6),re=pe.rotrSL(ee,Y,19)^pe.rotrBL(ee,Y,61)^pe.shrSL(ee,Y,6),le=pe.add4L(Z,re,Jr[B-7],Jr[B-16]),E=pe.add4H(le,G,Ie,Yr[B-7],Yr[B-16]);Yr[B]=E|0,Jr[B]=le|0}let{Ah:n,Al:s,Bh:i,Bl:o,Ch:c,Cl:u,Dh:p,Dl:m,Eh:b,El:x,Fh:S,Fl:T,Gh:I,Gl:A,Hh:L,Hl:U}=this;for(let B=0;B<80;B++){let F=pe.rotrSH(b,x,14)^pe.rotrSH(b,x,18)^pe.rotrBH(b,x,41),te=pe.rotrSL(b,x,14)^pe.rotrSL(b,x,18)^pe.rotrBL(b,x,41),G=b&S^~b&I,Z=x&T^~x&A,ee=pe.add5L(U,te,Z,Sg[B],Jr[B]),Y=pe.add5H(ee,L,F,G,vg[B],Yr[B]),Ie=ee|0,re=pe.rotrSH(n,s,28)^pe.rotrBH(n,s,34)^pe.rotrBH(n,s,39),le=pe.rotrSL(n,s,28)^pe.rotrBL(n,s,34)^pe.rotrBL(n,s,39),E=n&i^n&c^i&c,a=s&o^s&u^o&u;L=I|0,U=A|0,I=S|0,A=T|0,S=b|0,T=x|0,{h:b,l:x}=pe.add(p|0,m|0,Y|0,Ie|0),p=c|0,m=u|0,c=i|0,u=o|0,i=n|0,o=s|0;let l=pe.add3L(Ie,le,a);n=pe.add3H(l,Y,re,E),s=l|0}({h:n,l:s}=pe.add(this.Ah|0,this.Al|0,n|0,s|0)),{h:i,l:o}=pe.add(this.Bh|0,this.Bl|0,i|0,o|0),{h:c,l:u}=pe.add(this.Ch|0,this.Cl|0,c|0,u|0),{h:p,l:m}=pe.add(this.Dh|0,this.Dl|0,p|0,m|0),{h:b,l:x}=pe.add(this.Eh|0,this.El|0,b|0,x|0),{h:S,l:T}=pe.add(this.Fh|0,this.Fl|0,S|0,T|0),{h:I,l:A}=pe.add(this.Gh|0,this.Gl|0,I|0,A|0),{h:L,l:U}=pe.add(this.Hh|0,this.Hl|0,L|0,U|0),this.set(n,s,i,o,c,u,p,m,b,x,S,T,I,A,L,U)}roundClean(){Yr.fill(0),Jr.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 Ql=bs(()=>new wc);var Xi={};Qt(Xi,{aInRange:()=>jt,abool:()=>ur,abytes:()=>Es,bitGet:()=>Tg,bitLen:()=>Sc,bitMask:()=>Ks,bitSet:()=>Ng,bytesToHex:()=>Lr,bytesToNumberBE:()=>Br,bytesToNumberLE:()=>Qr,concatBytes:()=>Cr,createHmacDrbg:()=>xc,ensureBytes:()=>We,equalBytes:()=>kg,hexToBytes:()=>Dn,hexToNumber:()=>vc,inRange:()=>js,isBytes:()=>Xr,memoized:()=>Fn,notImplemented:()=>Bg,numberToBytesBE:()=>en,numberToBytesLE:()=>zn,numberToHexUnpadded:()=>Un,numberToVarBytesBE:()=>Ig,utf8ToBytes:()=>Og,validateObject:()=>br});var Yi=BigInt(0),Ji=BigInt(1),xg=BigInt(2);function Xr(r){return r instanceof Uint8Array||ArrayBuffer.isView(r)&&r.constructor.name==="Uint8Array"}function Es(r){if(!Xr(r))throw new Error("Uint8Array expected")}function ur(r,e){if(typeof e!="boolean")throw new Error(r+" boolean expected, got "+e)}var Ag=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function Lr(r){Es(r);let e="";for(let t=0;t<r.length;t++)e+=Ag[r[t]];return e}function Un(r){let e=r.toString(16);return e.length&1?"0"+e:e}function vc(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);return r===""?Yi:BigInt("0x"+r)}var Nr={_0:48,_9:57,A:65,F:70,a:97,f:102};function ed(r){if(r>=Nr._0&&r<=Nr._9)return r-Nr._0;if(r>=Nr.A&&r<=Nr.F)return r-(Nr.A-10);if(r>=Nr.a&&r<=Nr.f)return r-(Nr.a-10)}function Dn(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);let e=r.length,t=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);let n=new Uint8Array(t);for(let s=0,i=0;s<t;s++,i+=2){let o=ed(r.charCodeAt(i)),c=ed(r.charCodeAt(i+1));if(o===void 0||c===void 0){let u=r[i]+r[i+1];throw new Error('hex string expected, got non-hex character "'+u+'" at index '+i)}n[s]=o*16+c}return n}function Br(r){return vc(Lr(r))}function Qr(r){return Es(r),vc(Lr(Uint8Array.from(r).reverse()))}function en(r,e){return Dn(r.toString(16).padStart(e*2,"0"))}function zn(r,e){return en(r,e).reverse()}function Ig(r){return Dn(Un(r))}function We(r,e,t){let n;if(typeof e=="string")try{n=Dn(e)}catch(i){throw new Error(r+" must be hex string or Uint8Array, cause: "+i)}else if(Xr(e))n=Uint8Array.from(e);else throw new Error(r+" must be hex string or Uint8Array");let s=n.length;if(typeof t=="number"&&s!==t)throw new Error(r+" of length "+t+" expected, got "+s);return n}function Cr(...r){let e=0;for(let n=0;n<r.length;n++){let s=r[n];Es(s),e+=s.length}let t=new Uint8Array(e);for(let n=0,s=0;n<r.length;n++){let i=r[n];t.set(i,s),s+=i.length}return t}function kg(r,e){if(r.length!==e.length)return!1;let t=0;for(let n=0;n<r.length;n++)t|=r[n]^e[n];return t===0}function Og(r){if(typeof r!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(r))}var Ec=r=>typeof r=="bigint"&&Yi<=r;function js(r,e,t){return Ec(r)&&Ec(e)&&Ec(t)&&e<=r&&r<t}function jt(r,e,t,n){if(!js(e,t,n))throw new Error("expected valid "+r+": "+t+" <= n < "+n+", got "+e)}function Sc(r){let e;for(e=0;r>Yi;r>>=Ji,e+=1);return e}function Tg(r,e){return r>>BigInt(e)&Ji}function Ng(r,e,t){return r|(t?Ji:Yi)<<BigInt(e)}var Ks=r=>(xg<<BigInt(r-1))-Ji,Rc=r=>new Uint8Array(r),td=r=>Uint8Array.from(r);function xc(r,e,t){if(typeof r!="number"||r<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 t!="function")throw new Error("hmacFn must be a function");let n=Rc(r),s=Rc(r),i=0,o=()=>{n.fill(1),s.fill(0),i=0},c=(...b)=>t(s,n,...b),u=(b=Rc())=>{s=c(td([0]),b),n=c(),b.length!==0&&(s=c(td([1]),b),n=c())},p=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let b=0,x=[];for(;b<e;){n=c();let S=n.slice();x.push(S),b+=n.length}return Cr(...x)};return(b,x)=>{o(),u(b);let S;for(;!(S=x(p()));)u();return o(),S}}var Lg={bigint:r=>typeof r=="bigint",function:r=>typeof r=="function",boolean:r=>typeof r=="boolean",string:r=>typeof r=="string",stringOrUint8Array:r=>typeof r=="string"||Xr(r),isSafeInteger:r=>Number.isSafeInteger(r),array:r=>Array.isArray(r),field:(r,e)=>e.Fp.isValid(r),hash:r=>typeof r=="function"&&Number.isSafeInteger(r.outputLen)};function br(r,e,t={}){let n=(s,i,o)=>{let c=Lg[i];if(typeof c!="function")throw new Error("invalid validator function");let u=r[s];if(!(o&&u===void 0)&&!c(u,r))throw new Error("param "+String(s)+" is invalid. Expected "+i+", got "+u)};for(let[s,i]of Object.entries(e))n(s,i,!1);for(let[s,i]of Object.entries(t))n(s,i,!0);return r}var Bg=()=>{throw new Error("not implemented")};function Fn(r){let e=new WeakMap;return(t,...n)=>{let s=e.get(t);if(s!==void 0)return s;let i=r(t,...n);return e.set(t,i),i}}var bt=BigInt(0),Ce=BigInt(1),$n=BigInt(2),Cg=BigInt(3),Ac=BigInt(4),rd=BigInt(5),nd=BigInt(8),Pg=BigInt(9),Mg=BigInt(16);function ke(r,e){let t=r%e;return t>=bt?t:e+t}function Ug(r,e,t){if(e<bt)throw new Error("invalid exponent, negatives unsupported");if(t<=bt)throw new Error("invalid modulus");if(t===Ce)return bt;let n=Ce;for(;e>bt;)e&Ce&&(n=n*r%t),r=r*r%t,e>>=Ce;return n}function Pe(r,e,t){let n=r;for(;e-- >bt;)n*=n,n%=t;return n}function Qi(r,e){if(r===bt)throw new Error("invert: expected non-zero number");if(e<=bt)throw new Error("invert: expected positive modulus, got "+e);let t=ke(r,e),n=e,s=bt,i=Ce,o=Ce,c=bt;for(;t!==bt;){let p=n/t,m=n%t,b=s-o*p,x=i-c*p;n=t,t=m,s=o,i=c,o=b,c=x}if(n!==Ce)throw new Error("invert: does not exist");return ke(s,e)}function Dg(r){let e=(r-Ce)/$n,t,n,s;for(t=r-Ce,n=0;t%$n===bt;t/=$n,n++);for(s=$n;s<r&&Ug(s,e,r)!==r-Ce;s++)if(s>1e3)throw new Error("Cannot find square root: likely non-prime P");if(n===1){let o=(r+Ce)/Ac;return function(u,p){let m=u.pow(p,o);if(!u.eql(u.sqr(m),p))throw new Error("Cannot find square root");return m}}let i=(t+Ce)/$n;return function(c,u){if(c.pow(u,e)===c.neg(c.ONE))throw new Error("Cannot find square root");let p=n,m=c.pow(c.mul(c.ONE,s),t),b=c.pow(u,i),x=c.pow(u,t);for(;!c.eql(x,c.ONE);){if(c.eql(x,c.ZERO))return c.ZERO;let S=1;for(let I=c.sqr(x);S<p&&!c.eql(I,c.ONE);S++)I=c.sqr(I);let T=c.pow(m,Ce<<BigInt(p-S-1));m=c.sqr(T),b=c.mul(b,T),x=c.mul(x,m),p=S}return b}}function zg(r){if(r%Ac===Cg){let e=(r+Ce)/Ac;return function(n,s){let i=n.pow(s,e);if(!n.eql(n.sqr(i),s))throw new Error("Cannot find square root");return i}}if(r%nd===rd){let e=(r-rd)/nd;return function(n,s){let i=n.mul(s,$n),o=n.pow(i,e),c=n.mul(s,o),u=n.mul(n.mul(c,$n),o),p=n.mul(c,n.sub(u,n.ONE));if(!n.eql(n.sqr(p),s))throw new Error("Cannot find square root");return p}}return r%Mg,Dg(r)}var sd=(r,e)=>(ke(r,e)&Ce)===Ce,Fg=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Ic(r){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},t=Fg.reduce((n,s)=>(n[s]="function",n),e);return br(r,t)}function $g(r,e,t){if(t<bt)throw new Error("invalid exponent, negatives unsupported");if(t===bt)return r.ONE;if(t===Ce)return e;let n=r.ONE,s=e;for(;t>bt;)t&Ce&&(n=r.mul(n,s)),s=r.sqr(s),t>>=Ce;return n}function Vg(r,e){let t=new Array(e.length),n=e.reduce((i,o,c)=>r.is0(o)?i:(t[c]=i,r.mul(i,o)),r.ONE),s=r.inv(n);return e.reduceRight((i,o,c)=>r.is0(o)?i:(t[c]=r.mul(i,t[c]),r.mul(i,o)),s),t}function kc(r,e){let t=e!==void 0?e:r.toString(2).length,n=Math.ceil(t/8);return{nBitLength:t,nByteLength:n}}function tn(r,e,t=!1,n={}){if(r<=bt)throw new Error("invalid field: expected ORDER > 0, got "+r);let{nBitLength:s,nByteLength:i}=kc(r,e);if(i>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let o,c=Object.freeze({ORDER:r,isLE:t,BITS:s,BYTES:i,MASK:Ks(s),ZERO:bt,ONE:Ce,create:u=>ke(u,r),isValid:u=>{if(typeof u!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof u);return bt<=u&&u<r},is0:u=>u===bt,isOdd:u=>(u&Ce)===Ce,neg:u=>ke(-u,r),eql:(u,p)=>u===p,sqr:u=>ke(u*u,r),add:(u,p)=>ke(u+p,r),sub:(u,p)=>ke(u-p,r),mul:(u,p)=>ke(u*p,r),pow:(u,p)=>$g(c,u,p),div:(u,p)=>ke(u*Qi(p,r),r),sqrN:u=>u*u,addN:(u,p)=>u+p,subN:(u,p)=>u-p,mulN:(u,p)=>u*p,inv:u=>Qi(u,r),sqrt:n.sqrt||(u=>(o||(o=zg(r)),o(c,u))),invertBatch:u=>Vg(c,u),cmov:(u,p,m)=>m?p:u,toBytes:u=>t?zn(u,i):en(u,i),fromBytes:u=>{if(u.length!==i)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+u.length);return t?Qr(u):Br(u)}});return Object.freeze(c)}function id(r){if(typeof r!="bigint")throw new Error("field order must be bigint");let e=r.toString(2).length;return Math.ceil(e/8)}function Oc(r){let e=id(r);return e+Math.ceil(e/2)}function od(r,e,t=!1){let n=r.length,s=id(e),i=Oc(e);if(n<16||n<i||n>1024)throw new Error("expected "+i+"-1024 bytes of input, got "+n);let o=t?Qr(r):Br(r),c=ke(o,e-Ce)+Ce;return t?zn(c,s):en(c,s)}var ad=BigInt(0),eo=BigInt(1);function Tc(r,e){let t=e.negate();return r?t:e}function cd(r,e){if(!Number.isSafeInteger(r)||r<=0||r>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+r)}function Nc(r,e){cd(r,e);let t=Math.ceil(e/r)+1,n=2**(r-1);return{windows:t,windowSize:n}}function Wg(r,e){if(!Array.isArray(r))throw new Error("array expected");r.forEach((t,n)=>{if(!(t instanceof e))throw new Error("invalid point at index "+n)})}function qg(r,e){if(!Array.isArray(r))throw new Error("array of scalars expected");r.forEach((t,n)=>{if(!e.isValid(t))throw new Error("invalid scalar at index "+n)})}var Lc=new WeakMap,ud=new WeakMap;function Bc(r){return ud.get(r)||1}function to(r,e){return{constTimeNegate:Tc,hasPrecomputes(t){return Bc(t)!==1},unsafeLadder(t,n,s=r.ZERO){let i=t;for(;n>ad;)n&eo&&(s=s.add(i)),i=i.double(),n>>=eo;return s},precomputeWindow(t,n){let{windows:s,windowSize:i}=Nc(n,e),o=[],c=t,u=c;for(let p=0;p<s;p++){u=c,o.push(u);for(let m=1;m<i;m++)u=u.add(c),o.push(u);c=u.double()}return o},wNAF(t,n,s){let{windows:i,windowSize:o}=Nc(t,e),c=r.ZERO,u=r.BASE,p=BigInt(2**t-1),m=2**t,b=BigInt(t);for(let x=0;x<i;x++){let S=x*o,T=Number(s&p);s>>=b,T>o&&(T-=m,s+=eo);let I=S,A=S+Math.abs(T)-1,L=x%2!==0,U=T<0;T===0?u=u.add(Tc(L,n[I])):c=c.add(Tc(U,n[A]))}return{p:c,f:u}},wNAFUnsafe(t,n,s,i=r.ZERO){let{windows:o,windowSize:c}=Nc(t,e),u=BigInt(2**t-1),p=2**t,m=BigInt(t);for(let b=0;b<o;b++){let x=b*c;if(s===ad)break;let S=Number(s&u);if(s>>=m,S>c&&(S-=p,s+=eo),S===0)continue;let T=n[x+Math.abs(S)-1];S<0&&(T=T.negate()),i=i.add(T)}return i},getPrecomputes(t,n,s){let i=Lc.get(n);return i||(i=this.precomputeWindow(n,t),t!==1&&Lc.set(n,s(i))),i},wNAFCached(t,n,s){let i=Bc(t);return this.wNAF(i,this.getPrecomputes(i,t,s),n)},wNAFCachedUnsafe(t,n,s,i){let o=Bc(t);return o===1?this.unsafeLadder(t,n,i):this.wNAFUnsafe(o,this.getPrecomputes(o,t,s),n,i)},setWindowSize(t,n){cd(n,e),ud.set(t,n),Lc.delete(t)}}}function ro(r,e,t,n){if(Wg(t,r),qg(n,e),t.length!==n.length)throw new Error("arrays of points and scalars must have equal length");let s=r.ZERO,i=Sc(BigInt(t.length)),o=i>12?i-3:i>4?i-2:i?2:1,c=(1<<o)-1,u=new Array(c+1).fill(s),p=Math.floor((e.BITS-1)/o)*o,m=s;for(let b=p;b>=0;b-=o){u.fill(s);for(let S=0;S<n.length;S++){let T=n[S],I=Number(T>>BigInt(b)&BigInt(c));u[I]=u[I].add(t[S])}let x=s;for(let S=u.length-1,T=s;S>0;S--)T=T.add(u[S]),x=x.add(T);if(m=m.add(x),b!==0)for(let S=0;S<o;S++)m=m.double()}return m}function Hs(r){return Ic(r.Fp),br(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...kc(r.n,r.nBitLength),...r,p:r.Fp.ORDER})}var fr=BigInt(0),Kt=BigInt(1),no=BigInt(2),jg=BigInt(8),Kg={zip215:!0};function Hg(r){let e=Hs(r);return br(r,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function fd(r){let e=Hg(r),{Fp:t,n,prehash:s,hash:i,randomBytes:o,nByteLength:c,h:u}=e,p=no<<BigInt(c*8)-Kt,m=t.create,b=tn(e.n,e.nBitLength),x=e.uvRatio||((d,h)=>{try{return{isValid:!0,value:t.sqrt(d*t.inv(h))}}catch{return{isValid:!1,value:fr}}}),S=e.adjustScalarBytes||(d=>d),T=e.domain||((d,h,g)=>{if(ur("phflag",g),h.length||g)throw new Error("Contexts/pre-hash are not supported");return d});function I(d,h){jt("coordinate "+d,h,fr,p)}function A(d){if(!(d instanceof B))throw new Error("ExtendedPoint expected")}let L=Fn((d,h)=>{let{ex:g,ey:w,ez:v}=d,y=d.is0();h==null&&(h=y?jg:t.inv(v));let f=m(g*h),_=m(w*h),C=m(v*h);if(y)return{x:fr,y:Kt};if(C!==Kt)throw new Error("invZ was invalid");return{x:f,y:_}}),U=Fn(d=>{let{a:h,d:g}=e;if(d.is0())throw new Error("bad point: ZERO");let{ex:w,ey:v,ez:y,et:f}=d,_=m(w*w),C=m(v*v),D=m(y*y),$=m(D*D),X=m(_*h),oe=m(D*m(X+C)),fe=m($+m(g*m(_*C)));if(oe!==fe)throw new Error("bad point: equation left != right (1)");let Be=m(w*v),he=m(y*f);if(Be!==he)throw new Error("bad point: equation left != right (2)");return!0});class B{constructor(h,g,w,v){this.ex=h,this.ey=g,this.ez=w,this.et=v,I("x",h),I("y",g),I("z",w),I("t",v),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(h){if(h instanceof B)throw new Error("extended point not allowed");let{x:g,y:w}=h||{};return I("x",g),I("y",w),new B(g,w,Kt,m(g*w))}static normalizeZ(h){let g=t.invertBatch(h.map(w=>w.ez));return h.map((w,v)=>w.toAffine(g[v])).map(B.fromAffine)}static msm(h,g){return ro(B,b,h,g)}_setWindowSize(h){G.setWindowSize(this,h)}assertValidity(){U(this)}equals(h){A(h);let{ex:g,ey:w,ez:v}=this,{ex:y,ey:f,ez:_}=h,C=m(g*_),D=m(y*v),$=m(w*_),X=m(f*v);return C===D&&$===X}is0(){return this.equals(B.ZERO)}negate(){return new B(m(-this.ex),this.ey,this.ez,m(-this.et))}double(){let{a:h}=e,{ex:g,ey:w,ez:v}=this,y=m(g*g),f=m(w*w),_=m(no*m(v*v)),C=m(h*y),D=g+w,$=m(m(D*D)-y-f),X=C+f,oe=X-_,fe=C-f,Be=m($*oe),he=m(X*fe),me=m($*fe),Gt=m(oe*X);return new B(Be,he,Gt,me)}add(h){A(h);let{a:g,d:w}=e,{ex:v,ey:y,ez:f,et:_}=this,{ex:C,ey:D,ez:$,et:X}=h;if(g===BigInt(-1)){let Ue=m((y-v)*(D+C)),De=m((y+v)*(D-C)),rs=m(De-Ue);if(rs===fr)return this.double();let ze=m(f*no*X),Fe=m(_*no*$),Us=Fe+ze,$e=De+Ue,Ve=Fe-ze,Ci=m(Us*rs),He=m($e*Ve),Ge=m(Us*Ve),Pi=m(rs*$e);return new B(Ci,He,Pi,Ge)}let oe=m(v*C),fe=m(y*D),Be=m(_*w*X),he=m(f*$),me=m((v+y)*(C+D)-oe-fe),Gt=he-Be,xe=he+Be,Ne=m(fe-g*oe),Li=m(me*Gt),je=m(xe*Ne),Ke=m(me*Ne),Bi=m(Gt*xe);return new B(Li,je,Bi,Ke)}subtract(h){return this.add(h.negate())}wNAF(h){return G.wNAFCached(this,h,B.normalizeZ)}multiply(h){let g=h;jt("scalar",g,Kt,n);let{p:w,f:v}=this.wNAF(g);return B.normalizeZ([w,v])[0]}multiplyUnsafe(h,g=B.ZERO){let w=h;return jt("scalar",w,fr,n),w===fr?te:this.is0()||w===Kt?this:G.wNAFCachedUnsafe(this,w,B.normalizeZ,g)}isSmallOrder(){return this.multiplyUnsafe(u).is0()}isTorsionFree(){return G.unsafeLadder(this,n).is0()}toAffine(h){return L(this,h)}clearCofactor(){let{h}=e;return h===Kt?this:this.multiplyUnsafe(h)}static fromHex(h,g=!1){let{d:w,a:v}=e,y=t.BYTES;h=We("pointHex",h,y),ur("zip215",g);let f=h.slice(),_=h[y-1];f[y-1]=_&-129;let C=Qr(f),D=g?p:t.ORDER;jt("pointHex.y",C,fr,D);let $=m(C*C),X=m($-Kt),oe=m(w*$-v),{isValid:fe,value:Be}=x(X,oe);if(!fe)throw new Error("Point.fromHex: invalid y coordinate");let he=(Be&Kt)===Kt,me=(_&128)!==0;if(!g&&Be===fr&&me)throw new Error("Point.fromHex: x=0 and x_0=1");return me!==he&&(Be=m(-Be)),B.fromAffine({x:Be,y:C})}static fromPrivateKey(h){return Y(h).point}toRawBytes(){let{x:h,y:g}=this.toAffine(),w=zn(g,t.BYTES);return w[w.length-1]|=h&Kt?128:0,w}toHex(){return Lr(this.toRawBytes())}}B.BASE=new B(e.Gx,e.Gy,Kt,m(e.Gx*e.Gy)),B.ZERO=new B(fr,Kt,Kt,fr);let{BASE:F,ZERO:te}=B,G=to(B,c*8);function Z(d){return ke(d,n)}function ee(d){return Z(Qr(d))}function Y(d){let h=t.BYTES;d=We("private key",d,h);let g=We("hashed private key",i(d),2*h),w=S(g.slice(0,h)),v=g.slice(h,2*h),y=ee(w),f=F.multiply(y),_=f.toRawBytes();return{head:w,prefix:v,scalar:y,point:f,pointBytes:_}}function Ie(d){return Y(d).pointBytes}function re(d=new Uint8Array,...h){let g=Cr(...h);return ee(i(T(g,We("context",d),!!s)))}function le(d,h,g={}){d=We("message",d),s&&(d=s(d));let{prefix:w,scalar:v,pointBytes:y}=Y(h),f=re(g.context,w,d),_=F.multiply(f).toRawBytes(),C=re(g.context,_,y,d),D=Z(f+C*v);jt("signature.s",D,fr,n);let $=Cr(_,zn(D,t.BYTES));return We("result",$,t.BYTES*2)}let E=Kg;function a(d,h,g,w=E){let{context:v,zip215:y}=w,f=t.BYTES;d=We("signature",d,2*f),h=We("message",h),g=We("publicKey",g,f),y!==void 0&&ur("zip215",y),s&&(h=s(h));let _=Qr(d.slice(f,2*f)),C,D,$;try{C=B.fromHex(g,y),D=B.fromHex(d.slice(0,f),y),$=F.multiplyUnsafe(_)}catch{return!1}if(!y&&C.isSmallOrder())return!1;let X=re(v,D.toRawBytes(),C.toRawBytes(),h);return D.add(C.multiplyUnsafe(X)).subtract($).clearCofactor().equals(B.ZERO)}return F._setWindowSize(8),{CURVE:e,getPublicKey:Ie,sign:le,verify:a,ExtendedPoint:B,utils:{getExtendedPublicKey:Y,randomPrivateKey:()=>o(t.BYTES),precompute(d=8,h=B.BASE){return h._setWindowSize(d),h.multiply(BigInt(3)),h}}}}var Cc=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),ld=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),kx=BigInt(0),Gg=BigInt(1),dd=BigInt(2),Ox=BigInt(3),Zg=BigInt(5),Yg=BigInt(8);function Jg(r){let e=BigInt(10),t=BigInt(20),n=BigInt(40),s=BigInt(80),i=Cc,c=r*r%i*r%i,u=Pe(c,dd,i)*c%i,p=Pe(u,Gg,i)*r%i,m=Pe(p,Zg,i)*p%i,b=Pe(m,e,i)*m%i,x=Pe(b,t,i)*b%i,S=Pe(x,n,i)*x%i,T=Pe(S,s,i)*S%i,I=Pe(T,s,i)*S%i,A=Pe(I,e,i)*m%i;return{pow_p_5_8:Pe(A,dd,i)*r%i,b2:c}}function Xg(r){return r[0]&=248,r[31]&=127,r[31]|=64,r}function Qg(r,e){let t=Cc,n=ke(e*e*e,t),s=ke(n*n*e,t),i=Jg(r*s).pow_p_5_8,o=ke(r*n*i,t),c=ke(e*o*o,t),u=o,p=ke(o*ld,t),m=c===r,b=c===ke(-r,t),x=c===ke(-r*ld,t);return m&&(o=u),(b||x)&&(o=p),sd(o,t)&&(o=ke(-o,t)),{isValid:m||b,value:o}}var ey=tn(Cc,void 0,!0),ty={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:ey,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:Yg,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:Ql,randomBytes:Gi,adjustScalarBytes:Xg,uvRatio:Qg},Vn=fd(ty);var ku=Sr(Mc()),Rt=Sr(Dc());var iy=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]),rn=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),nn=new Uint32Array(64),zc=class extends ws{constructor(){super(64,32,8,!1),this.A=rn[0]|0,this.B=rn[1]|0,this.C=rn[2]|0,this.D=rn[3]|0,this.E=rn[4]|0,this.F=rn[5]|0,this.G=rn[6]|0,this.H=rn[7]|0}get(){let{A:e,B:t,C:n,D:s,E:i,F:o,G:c,H:u}=this;return[e,t,n,s,i,o,c,u]}set(e,t,n,s,i,o,c,u){this.A=e|0,this.B=t|0,this.C=n|0,this.D=s|0,this.E=i|0,this.F=o|0,this.G=c|0,this.H=u|0}process(e,t){for(let b=0;b<16;b++,t+=4)nn[b]=e.getUint32(t,!1);for(let b=16;b<64;b++){let x=nn[b-15],S=nn[b-2],T=cr(x,7)^cr(x,18)^x>>>3,I=cr(S,17)^cr(S,19)^S>>>10;nn[b]=I+nn[b-7]+T+nn[b-16]|0}let{A:n,B:s,C:i,D:o,E:c,F:u,G:p,H:m}=this;for(let b=0;b<64;b++){let x=cr(c,6)^cr(c,11)^cr(c,25),S=m+x+Yl(c,u,p)+iy[b]+nn[b]|0,I=(cr(n,2)^cr(n,13)^cr(n,22))+Jl(n,s,i)|0;m=p,p=u,u=c,c=o+S|0,o=i,i=s,s=n,n=S+I|0}n=n+this.A|0,s=s+this.B|0,i=i+this.C|0,o=o+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(n,s,i,o,c,u,p,m)}roundClean(){nn.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var Gs=bs(()=>new zc);var Ns=Sr(Ad()),R=Sr(Gc()),Xh=Sr(Gc());var Ry=1,vy=2,Sy=3,xy=4,Ay=5,Iy=6,ky=7,Oy=8,Ty=9,Ny=10,Ly=-32700,By=-32603,Cy=-32602,Py=-32601,My=-32600,Uy=-32016,Dy=-32015,zy=-32014,Fy=-32013,$y=-32012,Vy=-32011,Wy=-32010,qy=-32009,jy=-32008,Ky=-32007,Hy=-32006,Gy=-32005,Zy=-32004,Yy=-32003,Jy=-32002,Xy=-32001,Qy=28e5,e_=2800001,t_=2800002,r_=2800003,n_=2800004,s_=2800005,i_=2800006,o_=2800007,a_=2800008,c_=2800009,u_=2800010,f_=323e4,l_=32300001,d_=3230002,h_=3230003,p_=3230004,m_=361e4,g_=3610001,y_=3610002,__=3610003,b_=3610004,w_=3610005,E_=3610006,R_=3610007,v_=3611e3,S_=3704e3,x_=3704001,A_=3704002,I_=3704003,k_=3704004,O_=4128e3,T_=4128001,N_=4128002,L_=4615e3,B_=4615001,C_=4615002,P_=4615003,M_=4615004,U_=4615005,D_=4615006,z_=4615007,F_=4615008,$_=4615009,V_=4615010,W_=4615011,q_=4615012,j_=4615013,K_=4615014,H_=4615015,G_=4615016,Z_=4615017,Y_=4615018,J_=4615019,X_=4615020,Q_=4615021,eb=4615022,tb=4615023,rb=4615024,nb=4615025,sb=4615026,ib=4615027,ob=4615028,ab=4615029,cb=4615030,ub=4615031,fb=4615032,lb=4615033,db=4615034,hb=4615035,pb=4615036,mb=4615037,gb=4615038,yb=4615039,_b=4615040,bb=4615041,wb=4615042,Eb=4615043,Rb=4615044,vb=4615045,Sb=4615046,xb=4615047,Ab=4615048,Ib=4615049,kb=4615050,Ob=4615051,Tb=4615052,Nb=4615053,Lb=4615054,Bb=5508e3,Cb=5508001,Pb=5508002,Mb=5508003,Ub=5508004,Db=5508005,zb=5508006,Fb=5508007,$b=5508008,Vb=5508009,Wb=5508010,qb=5508011,jb=5663e3,Kb=5663001,Hb=5663002,Gb=5663003,Zb=5663004,Yb=5663005,Jb=5663006,Xb=5663007,Qb=5663008,ew=5663009,tw=5663010,rw=5663011,nw=5663012,sw=5663013,iw=5663014,ow=5663015,aw=5663016,cw=5663017,uw=5663018,fw=5663019,lw=705e4,dw=7050001,hw=7050002,pw=7050003,mw=7050004,gw=7050005,yw=7050006,_w=7050007,bw=7050008,ww=7050009,Ew=7050010,Rw=7050011,vw=7050012,Sw=7050013,xw=7050014,Aw=7050015,Iw=7050016,kw=7050017,Ow=7050018,Tw=7050019,Nw=7050020,Lw=7050021,Bw=7050022,Cw=7050023,Pw=7050024,Mw=7050025,Uw=7050026,Dw=7050027,zw=7050028,Fw=7050029,$w=7050030,Vw=7050031,Ww=7050032,qw=7050033,jw=7050034,Kw=7050035,Hw=7050036,Zc=8078e3,Yc=8078001,Id=8078002,kd=8078003,Jc=8078004,Xc=8078005,Qc=8078006,Gw=8078007,Zw=8078008,Yw=8078009,Jw=8078010,eu=8078011,Xw=8078012,Od=8078013,Td=8078014,Qw=8078015,e1=8078016,t1=8078017,r1=8078018,n1=8078019,Nd=8078020,Ld=8078021,s1=8078022,i1=81e5,o1=8100001,a1=8100002,c1=8100003,u1=819e4,f1=8190001,l1=8190002,d1=8190003,h1=8190004,p1=99e5,m1=9900001,g1=9900002,y1=9900003,_1=9900004;function Bd(r){return Array.isArray(r)?"%5B"+r.map(Bd).join("%2C%20")+"%5D":typeof r=="bigint"?`${r}n`:encodeURIComponent(String(r!=null&&Object.getPrototypeOf(r)===null?{...r}:r))}function b1([r,e]){return`${r}=${Bd(e)}`}function w1(r){let e=Object.entries(r).map(b1).join("&");return btoa(e)}var $x={[f_]:"Account not found at address: $address",[p_]:"Not all accounts were decoded. Encoded accounts found at addresses: $addresses.",[h_]:"Expected decoded account at address: $address",[d_]:"Failed to decode account data at address: $address",[l_]:"Accounts not found at addresses: $addresses",[c_]:"Unable to find a viable program address bump seed.",[t_]:"$putativeAddress is not a base58-encoded address.",[Qy]:"Expected base58 encoded address to decode to a byte array of length 32. Actual length: $actualLength.",[r_]:"The `CryptoKey` must be an `Ed25519` public key.",[a_]:"Invalid seeds; point must fall off the Ed25519 curve.",[n_]:"Expected given program derived address to have the following format: [Address, ProgramDerivedAddressBump].",[i_]:"A maximum of $maxSeeds seeds, including the bump seed, may be supplied when creating an address. Received: $actual.",[o_]:"The seed at index $index with length $actual exceeds the maximum length of $maxSeedLength bytes.",[s_]:"Expected program derived address bump to be in the range [0, 255], got: $bump.",[u_]:"Program address cannot end with PDA marker.",[e_]:"Expected base58-encoded address string of length in the range [32, 44]. Actual length: $actualLength.",[xy]:"Expected base58-encoded blockash string of length in the range [32, 44]. Actual length: $actualLength.",[Ry]:"The network has progressed past the last block for which this transaction could have been committed.",[Zc]:"Codec [$codecDescription] cannot decode empty byte arrays.",[s1]:"Enum codec cannot use lexical values [$stringValues] as discriminators. Either remove all lexical values or set `useValuesAsDiscriminators` to `false`.",[Nd]:"Sentinel [$hexSentinel] must not be present in encoded bytes [$hexEncodedBytes].",[Xc]:"Encoder and decoder must have the same fixed size, got [$encoderFixedSize] and [$decoderFixedSize].",[Qc]:"Encoder and decoder must have the same max size, got [$encoderMaxSize] and [$decoderMaxSize].",[Jc]:"Encoder and decoder must either both be fixed-size or variable-size.",[Zw]:"Enum discriminator out of range. Expected a number in [$formattedValidDiscriminators], got $discriminator.",[Id]:"Expected a fixed-size codec, got a variable-size one.",[Od]:"Codec [$codecDescription] expected a positive byte length, got $bytesLength.",[kd]:"Expected a variable-size codec, got a fixed-size one.",[n1]:"Codec [$codecDescription] expected zero-value [$hexZeroValue] to have the same size as the provided fixed-size item [$expectedSize bytes].",[Yc]:"Codec [$codecDescription] expected $expected bytes, got $bytesLength.",[r1]:"Expected byte array constant [$hexConstant] to be present in data [$hexData] at offset [$offset].",[Yw]:"Invalid discriminated union variant. Expected one of [$variants], got $value.",[Jw]:"Invalid enum variant. Expected one of [$stringValues] or a number in [$formattedNumericalValues], got $variant.",[Qw]:"Invalid literal union variant. Expected one of [$variants], got $value.",[Gw]:"Expected [$codecDescription] to have $expected items, got $actual.",[Xw]:"Invalid value $value for base $base with alphabet $alphabet.",[e1]:"Literal union discriminator out of range. Expected a number between $minRange and $maxRange, got $discriminator.",[eu]:"Codec [$codecDescription] expected number to be in the range [$min, $max], got $value.",[Td]:"Codec [$codecDescription] expected offset to be in the range [0, $bytesLength], got $offset.",[Ld]:"Expected sentinel [$hexSentinel] to be present in decoded bytes [$hexDecodedBytes].",[t1]:"Union variant out of range. Expected an index between $minRange and $maxRange, got $variant.",[v_]:"No random values implementation could be found.",[$_]:"instruction requires an uninitialized account",[tb]:"instruction tries to borrow reference for an account which is already borrowed",[rb]:"instruction left account with an outstanding borrowed reference",[Q_]:"program other than the account's owner changed the size of the account data",[U_]:"account data too small for instruction",[eb]:"instruction expected an executable account",[Sb]:"An account does not have enough lamports to be rent-exempt",[Ab]:"Program arithmetic overflowed",[vb]:"Failed to serialize or deserialize account data: $encodedData",[Lb]:"Builtin programs must consume compute units",[fb]:"Cross-program invocation call depth too deep",[gb]:"Computational budget exceeded",[sb]:"custom program error: #$code",[Z_]:"instruction contains duplicate accounts",[nb]:"instruction modifications of multiply-passed account differ",[cb]:"executable accounts must be rent exempt",[ob]:"instruction changed executable accounts data",[ab]:"instruction changed the balance of an executable account",[Y_]:"instruction changed executable bit of an account",[K_]:"instruction modified data of an account it does not own",[j_]:"instruction spent from the balance of an account it does not own",[B_]:"generic instruction error",[kb]:"Provided owner is not allowed",[Eb]:"Account is immutable",[Rb]:"Incorrect authority provided",[z_]:"incorrect program id for instruction",[D_]:"insufficient funds for instruction",[M_]:"invalid account data for instruction",[xb]:"Invalid account owner",[C_]:"invalid program argument",[ib]:"program returned invalid error code",[P_]:"invalid instruction data",[mb]:"Failed to reallocate account data",[pb]:"Provided seeds do not result in a valid address",[Ob]:"Accounts data allocations exceeded the maximum allowed per transaction",[Tb]:"Max accounts exceeded",[Nb]:"Max instruction trace length exceeded",[hb]:"Length of the seed is too long for address generation",[lb]:"An account required by the instruction is missing",[F_]:"missing required signature for instruction",[q_]:"instruction illegally modified the program id of an account",[X_]:"insufficient account keys for instruction",[yb]:"Cross-program invocation with unauthorized signer or writable account",[_b]:"Failed to create program execution environment",[wb]:"Program failed to compile",[bb]:"Program failed to complete",[G_]:"instruction modified data of a read-only account",[H_]:"instruction changed the balance of a read-only account",[db]:"Cross-program invocation reentrancy not allowed for this instruction",[J_]:"instruction modified rent epoch of an account",[W_]:"sum of account balances before and after instruction do not match",[V_]:"instruction requires an initialized account",[L_]:"",[ub]:"Unsupported program id",[Ib]:"Unsupported sysvar",[O_]:"The instruction does not have any accounts.",[T_]:"The instruction does not have any data.",[N_]:"Expected instruction to have progress address $expectedProgramAddress, got $actualProgramAddress.",[Ay]:"Expected base58 encoded blockhash to decode to a byte array of length 32. Actual length: $actualLength.",[vy]:"The nonce `$expectedNonceValue` is no longer valid. It has advanced to `$actualNonceValue`",[g1]:"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",[_1]:"Invariant violation: This data publisher does not publish to the channel named `$channelName`. Supported channels include $supportedChannelNames.",[m1]:"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",[p1]:"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",[y1]:"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",[By]:"JSON-RPC error: Internal JSON-RPC error ($__serverMessage)",[Cy]:"JSON-RPC error: Invalid method parameter(s) ($__serverMessage)",[My]:"JSON-RPC error: The JSON sent is not a valid `Request` object ($__serverMessage)",[Py]:"JSON-RPC error: The method does not exist / is not available ($__serverMessage)",[Ly]:"JSON-RPC error: An error occurred on the server while parsing the JSON text ($__serverMessage)",[$y]:"$__serverMessage",[Xy]:"$__serverMessage",[Zy]:"$__serverMessage",[zy]:"$__serverMessage",[Wy]:"$__serverMessage",[qy]:"$__serverMessage",[Uy]:"Minimum context slot has not been reached",[Gy]:"Node is unhealthy; behind by $numSlotsBehind slots",[jy]:"No snapshot",[Jy]:"Transaction simulation failed",[Ky]:"$__serverMessage",[Vy]:"Transaction history is not available from this node",[Hy]:"$__serverMessage",[Fy]:"Transaction signature length mismatch",[Yy]:"Transaction signature verification failure",[Dy]:"$__serverMessage",[S_]:"Key pair bytes must be of length 64, got $byteLength.",[x_]:"Expected private key bytes with length 32. Actual length: $actualLength.",[A_]:"Expected base58-encoded signature to decode to a byte array of length 64. Actual length: $actualLength.",[k_]:"The provided private key does not match the provided public key.",[I_]:"Expected base58-encoded signature string of length in the range [64, 88]. Actual length: $actualLength.",[Iy]:"Lamports value must be in the range [0, 2e64-1]",[ky]:"`$value` cannot be parsed as a `BigInt`",[Ny]:"$message",[Oy]:"`$value` cannot be parsed as a `Number`",[Sy]:"No nonce account could be found at address `$nonceAccountAddress`",[u1]:"The notification name must end in 'Notifications' and the API must supply a subscription plan creator function for the notification '$notificationName'.",[l1]:"WebSocket was closed before payload could be added to the send buffer",[d1]:"WebSocket connection closed",[h1]:"WebSocket failed to connect",[f1]:"Failed to obtain a subscription id from the server",[c1]:"Could not find an API plan for RPC method: `$method`",[i1]:"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`.",[a1]:"HTTP error ($statusCode): $message",[o1]:"HTTP header(s) forbidden: $headers. Learn more at https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_header_name.",[Bb]:"Multiple distinct signers were identified for address `$address`. Please ensure that you are using the same signer instance for each address.",[Cb]:"The provided value does not implement the `KeyPairSigner` interface",[Mb]:"The provided value does not implement the `MessageModifyingSigner` interface",[Ub]:"The provided value does not implement the `MessagePartialSigner` interface",[Pb]:"The provided value does not implement any of the `MessageSigner` interfaces",[zb]:"The provided value does not implement the `TransactionModifyingSigner` interface",[Fb]:"The provided value does not implement the `TransactionPartialSigner` interface",[$b]:"The provided value does not implement the `TransactionSendingSigner` interface",[Db]:"The provided value does not implement any of the `TransactionSigner` interfaces",[Vb]:"More than one `TransactionSendingSigner` was identified.",[Wb]:"No `TransactionSendingSigner` was identified. Please provide a valid `ITransactionWithSingleSendingSigner` transaction.",[qb]:"Wallet account signers do not support signing multiple messages/transactions in a single operation",[R_]:"Cannot export a non-extractable key.",[g_]:"No digest implementation could be found.",[m_]:"Cryptographic operations are only allowed in secure browser contexts. Read more here: https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts.",[y_]:`This runtime does not support the generation of Ed25519 key pairs.
|
|
1
|
+
"use strict";var frame=(()=>{var w1=Object.create;var Qa=Object.defineProperty;var x1=Object.getOwnPropertyDescriptor;var S1=Object.getOwnPropertyNames;var E1=Object.getPrototypeOf,I1=Object.prototype.hasOwnProperty;var Kt=(t,e)=>()=>(t&&(e=t(t=0)),e);var Xt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Et=(t,e)=>{for(var r in e)Qa(t,r,{get:e[r],enumerable:!0})},Sy=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of S1(e))!I1.call(t,n)&&n!==r&&Qa(t,n,{get:()=>e[n],enumerable:!(i=x1(e,n))||i.enumerable});return t};var Cr=(t,e,r)=>(r=t!=null?w1(E1(t)):{},Sy(e||!t||!t.__esModule?Qa(r,"default",{value:t,enumerable:!0}):r,t)),Tl=t=>Sy(Qa({},"__esModule",{value:!0}),t);var Xb=Xt(jc=>{"use strict";jc.byteLength=kk;jc.toByteArray=Ak;jc.fromByteArray=Tk;var Nr=[],gr=[],Ik=typeof Uint8Array<"u"?Uint8Array:Array,qm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Kn=0,Jb=qm.length;Kn<Jb;++Kn)Nr[Kn]=qm[Kn],gr[qm.charCodeAt(Kn)]=Kn;var Kn,Jb;gr[45]=62;gr[95]=63;function Yb(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 kk(t){var e=Yb(t),r=e[0],i=e[1];return(r+i)*3/4-i}function Rk(t,e,r){return(e+r)*3/4-r}function Ak(t){var e,r=Yb(t),i=r[0],n=r[1],o=new Ik(Rk(t,i,n)),a=0,s=n>0?i-4:i,c;for(c=0;c<s;c+=4)e=gr[t.charCodeAt(c)]<<18|gr[t.charCodeAt(c+1)]<<12|gr[t.charCodeAt(c+2)]<<6|gr[t.charCodeAt(c+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return n===2&&(e=gr[t.charCodeAt(c)]<<2|gr[t.charCodeAt(c+1)]>>4,o[a++]=e&255),n===1&&(e=gr[t.charCodeAt(c)]<<10|gr[t.charCodeAt(c+1)]<<4|gr[t.charCodeAt(c+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}function $k(t){return Nr[t>>18&63]+Nr[t>>12&63]+Nr[t>>6&63]+Nr[t&63]}function Ok(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($k(i));return n.join("")}function Tk(t){for(var e,r=t.length,i=r%3,n=[],o=16383,a=0,s=r-i;a<s;a+=o)n.push(Ok(t,a,a+o>s?s:a+o));return i===1?(e=t[r-1],n.push(Nr[e>>2]+Nr[e<<4&63]+"==")):i===2&&(e=(t[r-2]<<8)+t[r-1],n.push(Nr[e>>10]+Nr[e>>4&63]+Nr[e<<2&63]+"=")),n.join("")}});var Qb=Xt(Gm=>{Gm.read=function(t,e,r,i,n){var o,a,s=n*8-i-1,c=(1<<s)-1,l=c>>1,h=-7,g=r?n-1:0,w=r?-1:1,v=t[e+g];for(g+=w,o=v&(1<<-h)-1,v>>=-h,h+=s;h>0;o=o*256+t[e+g],g+=w,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=i;h>0;a=a*256+t[e+g],g+=w,h-=8);if(o===0)o=1-l;else{if(o===c)return a?NaN:(v?-1:1)*(1/0);a=a+Math.pow(2,i),o=o-l}return(v?-1:1)*a*Math.pow(2,o-i)};Gm.write=function(t,e,r,i,n,o){var a,s,c,l=o*8-n-1,h=(1<<l)-1,g=h>>1,w=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,v=i?0:o-1,$=i?1:-1,k=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=h):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+g>=1?e+=w/c:e+=w*Math.pow(2,1-g),e*c>=2&&(a++,c/=2),a+g>=h?(s=0,a=h):a+g>=1?(s=(e*c-1)*Math.pow(2,n),a=a+g):(s=e*Math.pow(2,g-1)*Math.pow(2,n),a=0));n>=8;t[r+v]=s&255,v+=$,s/=256,n-=8);for(a=a<<n|s,l+=n;l>0;t[r+v]=a&255,v+=$,a/=256,l-=8);t[r+v-$]|=k*128}});var na=Xt(ro=>{"use strict";var Hm=Xb(),eo=Qb(),ew=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ro.Buffer=L;ro.SlowBuffer=Uk;ro.INSPECT_MAX_BYTES=50;var Fc=2147483647;ro.kMaxLength=Fc;L.TYPED_ARRAY_SUPPORT=Nk();!L.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 Nk(){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(L.prototype,"parent",{enumerable:!0,get:function(){if(L.isBuffer(this))return this.buffer}});Object.defineProperty(L.prototype,"offset",{enumerable:!0,get:function(){if(L.isBuffer(this))return this.byteOffset}});function Fr(t){if(t>Fc)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,L.prototype),e}function L(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 Qm(t)}return iw(t,e,r)}L.poolSize=8192;function iw(t,e,r){if(typeof t=="string")return Lk(t,e);if(ArrayBuffer.isView(t))return zk(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(Pr(t,ArrayBuffer)||t&&Pr(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Pr(t,SharedArrayBuffer)||t&&Pr(t.buffer,SharedArrayBuffer)))return Ym(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 L.from(i,e,r);let n=Bk(t);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return L.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)}L.from=function(t,e,r){return iw(t,e,r)};Object.setPrototypeOf(L.prototype,Uint8Array.prototype);Object.setPrototypeOf(L,Uint8Array);function ow(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 Pk(t,e,r){return ow(t),t<=0?Fr(t):e!==void 0?typeof r=="string"?Fr(t).fill(e,r):Fr(t).fill(e):Fr(t)}L.alloc=function(t,e,r){return Pk(t,e,r)};function Qm(t){return ow(t),Fr(t<0?0:eg(t)|0)}L.allocUnsafe=function(t){return Qm(t)};L.allocUnsafeSlow=function(t){return Qm(t)};function Lk(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!L.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=aw(t,e)|0,i=Fr(r),n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}function Jm(t){let e=t.length<0?0:eg(t.length)|0,r=Fr(e);for(let i=0;i<e;i+=1)r[i]=t[i]&255;return r}function zk(t){if(Pr(t,Uint8Array)){let e=new Uint8Array(t);return Ym(e.buffer,e.byteOffset,e.byteLength)}return Jm(t)}function Ym(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,L.prototype),i}function Bk(t){if(L.isBuffer(t)){let e=eg(t.length)|0,r=Fr(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||rg(t.length)?Fr(0):Jm(t);if(t.type==="Buffer"&&Array.isArray(t.data))return Jm(t.data)}function eg(t){if(t>=Fc)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Fc.toString(16)+" bytes");return t|0}function Uk(t){return+t!=t&&(t=0),L.alloc(+t)}L.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==L.prototype};L.compare=function(e,r){if(Pr(e,Uint8Array)&&(e=L.from(e,e.offset,e.byteLength)),Pr(r,Uint8Array)&&(r=L.from(r,r.offset,r.byteLength)),!L.isBuffer(e)||!L.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,a=Math.min(i,n);o<a;++o)if(e[o]!==r[o]){i=e[o],n=r[o];break}return i<n?-1:n<i?1:0};L.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}};L.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return L.alloc(0);let i;if(r===void 0)for(r=0,i=0;i<e.length;++i)r+=e[i].length;let n=L.allocUnsafe(r),o=0;for(i=0;i<e.length;++i){let a=e[i];if(Pr(a,Uint8Array))o+a.length>n.length?(L.isBuffer(a)||(a=L.from(a)),a.copy(n,o)):Uint8Array.prototype.set.call(n,a,o);else if(L.isBuffer(a))a.copy(n,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return n};function aw(t,e){if(L.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Pr(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 Xm(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return mw(t).length;default:if(n)return i?-1:Xm(t).length;e=(""+e).toLowerCase(),n=!0}}L.byteLength=aw;function Ck(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 Gk(this,e,r);case"utf8":case"utf-8":return cw(this,e,r);case"ascii":return Wk(this,e,r);case"latin1":case"binary":return qk(this,e,r);case"base64":return Vk(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Hk(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}L.prototype._isBuffer=!0;function Wn(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}L.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)Wn(this,r,r+1);return this};L.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)Wn(this,r,r+3),Wn(this,r+1,r+2);return this};L.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)Wn(this,r,r+7),Wn(this,r+1,r+6),Wn(this,r+2,r+5),Wn(this,r+3,r+4);return this};L.prototype.toString=function(){let e=this.length;return e===0?"":arguments.length===0?cw(this,0,e):Ck.apply(this,arguments)};L.prototype.toLocaleString=L.prototype.toString;L.prototype.equals=function(e){if(!L.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:L.compare(this,e)===0};L.prototype.inspect=function(){let e="",r=ro.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"};ew&&(L.prototype[ew]=L.prototype.inspect);L.prototype.compare=function(e,r,i,n,o){if(Pr(e,Uint8Array)&&(e=L.from(e,e.offset,e.byteLength)),!L.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 a=o-n,s=i-r,c=Math.min(a,s),l=this.slice(n,o),h=e.slice(r,i);for(let g=0;g<c;++g)if(l[g]!==h[g]){a=l[g],s=h[g];break}return a<s?-1:s<a?1:0};function sw(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,rg(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=L.from(e,i)),L.isBuffer(e))return e.length===0?-1:tw(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):tw(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function tw(t,e,r,i,n){let o=1,a=t.length,s=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,a/=2,s/=2,r/=2}function c(h,g){return o===1?h[g]:h.readUInt16BE(g*o)}let l;if(n){let h=-1;for(l=r;l<a;l++)if(c(t,l)===c(e,h===-1?0:l-h)){if(h===-1&&(h=l),l-h+1===s)return h*o}else h!==-1&&(l-=l-h),h=-1}else for(r+s>a&&(r=a-s),l=r;l>=0;l--){let h=!0;for(let g=0;g<s;g++)if(c(t,l+g)!==c(e,g)){h=!1;break}if(h)return l}return-1}L.prototype.includes=function(e,r,i){return this.indexOf(e,r,i)!==-1};L.prototype.indexOf=function(e,r,i){return sw(this,e,r,i,!0)};L.prototype.lastIndexOf=function(e,r,i){return sw(this,e,r,i,!1)};function Dk(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 a;for(a=0;a<i;++a){let s=parseInt(e.substr(a*2,2),16);if(rg(s))return a;t[r+a]=s}return a}function Mk(t,e,r,i){return Zc(Xm(e,t.length-r),t,r,i)}function jk(t,e,r,i){return Zc(Qk(e),t,r,i)}function Fk(t,e,r,i){return Zc(mw(e),t,r,i)}function Zk(t,e,r,i){return Zc(eR(e,t.length-r),t,r,i)}L.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 a=!1;for(;;)switch(n){case"hex":return Dk(this,e,r,i);case"utf8":case"utf-8":return Mk(this,e,r,i);case"ascii":case"latin1":case"binary":return jk(this,e,r,i);case"base64":return Fk(this,e,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Zk(this,e,r,i);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}};L.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Vk(t,e,r){return e===0&&r===t.length?Hm.fromByteArray(t):Hm.fromByteArray(t.slice(e,r))}function cw(t,e,r){r=Math.min(t.length,r);let i=[],n=e;for(;n<r;){let o=t[n],a=null,s=o>239?4:o>223?3:o>191?2:1;if(n+s<=r){let c,l,h,g;switch(s){case 1:o<128&&(a=o);break;case 2:c=t[n+1],(c&192)===128&&(g=(o&31)<<6|c&63,g>127&&(a=g));break;case 3:c=t[n+1],l=t[n+2],(c&192)===128&&(l&192)===128&&(g=(o&15)<<12|(c&63)<<6|l&63,g>2047&&(g<55296||g>57343)&&(a=g));break;case 4:c=t[n+1],l=t[n+2],h=t[n+3],(c&192)===128&&(l&192)===128&&(h&192)===128&&(g=(o&15)<<18|(c&63)<<12|(l&63)<<6|h&63,g>65535&&g<1114112&&(a=g))}}a===null?(a=65533,s=1):a>65535&&(a-=65536,i.push(a>>>10&1023|55296),a=56320|a&1023),i.push(a),n+=s}return Kk(i)}var rw=4096;function Kk(t){let e=t.length;if(e<=rw)return String.fromCharCode.apply(String,t);let r="",i=0;for(;i<e;)r+=String.fromCharCode.apply(String,t.slice(i,i+=rw));return r}function Wk(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 qk(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 Gk(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+=tR[t[o]];return n}function Hk(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}L.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,L.prototype),n};function Rt(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")}L.prototype.readUintLE=L.prototype.readUIntLE=function(e,r,i){e=e>>>0,r=r>>>0,i||Rt(e,r,this.length);let n=this[e],o=1,a=0;for(;++a<r&&(o*=256);)n+=this[e+a]*o;return n};L.prototype.readUintBE=L.prototype.readUIntBE=function(e,r,i){e=e>>>0,r=r>>>0,i||Rt(e,r,this.length);let n=this[e+--r],o=1;for(;r>0&&(o*=256);)n+=this[e+--r]*o;return n};L.prototype.readUint8=L.prototype.readUInt8=function(e,r){return e=e>>>0,r||Rt(e,1,this.length),this[e]};L.prototype.readUint16LE=L.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||Rt(e,2,this.length),this[e]|this[e+1]<<8};L.prototype.readUint16BE=L.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||Rt(e,2,this.length),this[e]<<8|this[e+1]};L.prototype.readUint32LE=L.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||Rt(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};L.prototype.readUint32BE=L.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||Rt(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};L.prototype.readBigUInt64LE=fn(function(e){e=e>>>0,to(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&ra(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))});L.prototype.readBigUInt64BE=fn(function(e){e=e>>>0,to(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&ra(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)});L.prototype.readIntLE=function(e,r,i){e=e>>>0,r=r>>>0,i||Rt(e,r,this.length);let n=this[e],o=1,a=0;for(;++a<r&&(o*=256);)n+=this[e+a]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*r)),n};L.prototype.readIntBE=function(e,r,i){e=e>>>0,r=r>>>0,i||Rt(e,r,this.length);let n=r,o=1,a=this[e+--n];for(;n>0&&(o*=256);)a+=this[e+--n]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*r)),a};L.prototype.readInt8=function(e,r){return e=e>>>0,r||Rt(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};L.prototype.readInt16LE=function(e,r){e=e>>>0,r||Rt(e,2,this.length);let i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i};L.prototype.readInt16BE=function(e,r){e=e>>>0,r||Rt(e,2,this.length);let i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i};L.prototype.readInt32LE=function(e,r){return e=e>>>0,r||Rt(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};L.prototype.readInt32BE=function(e,r){return e=e>>>0,r||Rt(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};L.prototype.readBigInt64LE=fn(function(e){e=e>>>0,to(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&ra(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)});L.prototype.readBigInt64BE=fn(function(e){e=e>>>0,to(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&ra(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)});L.prototype.readFloatLE=function(e,r){return e=e>>>0,r||Rt(e,4,this.length),eo.read(this,e,!0,23,4)};L.prototype.readFloatBE=function(e,r){return e=e>>>0,r||Rt(e,4,this.length),eo.read(this,e,!1,23,4)};L.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||Rt(e,8,this.length),eo.read(this,e,!0,52,8)};L.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||Rt(e,8,this.length),eo.read(this,e,!1,52,8)};function rr(t,e,r,i,n,o){if(!L.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")}L.prototype.writeUintLE=L.prototype.writeUIntLE=function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){let s=Math.pow(2,8*i)-1;rr(this,e,r,i,s,0)}let o=1,a=0;for(this[r]=e&255;++a<i&&(o*=256);)this[r+a]=e/o&255;return r+i};L.prototype.writeUintBE=L.prototype.writeUIntBE=function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){let s=Math.pow(2,8*i)-1;rr(this,e,r,i,s,0)}let o=i-1,a=1;for(this[r+o]=e&255;--o>=0&&(a*=256);)this[r+o]=e/a&255;return r+i};L.prototype.writeUint8=L.prototype.writeUInt8=function(e,r,i){return e=+e,r=r>>>0,i||rr(this,e,r,1,255,0),this[r]=e&255,r+1};L.prototype.writeUint16LE=L.prototype.writeUInt16LE=function(e,r,i){return e=+e,r=r>>>0,i||rr(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};L.prototype.writeUint16BE=L.prototype.writeUInt16BE=function(e,r,i){return e=+e,r=r>>>0,i||rr(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};L.prototype.writeUint32LE=L.prototype.writeUInt32LE=function(e,r,i){return e=+e,r=r>>>0,i||rr(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};L.prototype.writeUint32BE=L.prototype.writeUInt32BE=function(e,r,i){return e=+e,r=r>>>0,i||rr(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 uw(t,e,r,i,n){pw(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 a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=a,a=a>>8,t[r++]=a,a=a>>8,t[r++]=a,a=a>>8,t[r++]=a,r}function lw(t,e,r,i,n){pw(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 a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=a,a=a>>8,t[r+2]=a,a=a>>8,t[r+1]=a,a=a>>8,t[r]=a,r+8}L.prototype.writeBigUInt64LE=fn(function(e,r=0){return uw(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});L.prototype.writeBigUInt64BE=fn(function(e,r=0){return lw(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});L.prototype.writeIntLE=function(e,r,i,n){if(e=+e,r=r>>>0,!n){let c=Math.pow(2,8*i-1);rr(this,e,r,i,c-1,-c)}let o=0,a=1,s=0;for(this[r]=e&255;++o<i&&(a*=256);)e<0&&s===0&&this[r+o-1]!==0&&(s=1),this[r+o]=(e/a>>0)-s&255;return r+i};L.prototype.writeIntBE=function(e,r,i,n){if(e=+e,r=r>>>0,!n){let c=Math.pow(2,8*i-1);rr(this,e,r,i,c-1,-c)}let o=i-1,a=1,s=0;for(this[r+o]=e&255;--o>=0&&(a*=256);)e<0&&s===0&&this[r+o+1]!==0&&(s=1),this[r+o]=(e/a>>0)-s&255;return r+i};L.prototype.writeInt8=function(e,r,i){return e=+e,r=r>>>0,i||rr(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};L.prototype.writeInt16LE=function(e,r,i){return e=+e,r=r>>>0,i||rr(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};L.prototype.writeInt16BE=function(e,r,i){return e=+e,r=r>>>0,i||rr(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};L.prototype.writeInt32LE=function(e,r,i){return e=+e,r=r>>>0,i||rr(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};L.prototype.writeInt32BE=function(e,r,i){return e=+e,r=r>>>0,i||rr(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};L.prototype.writeBigInt64LE=fn(function(e,r=0){return uw(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});L.prototype.writeBigInt64BE=fn(function(e,r=0){return lw(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function dw(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 fw(t,e,r,i,n){return e=+e,r=r>>>0,n||dw(t,e,r,4,34028234663852886e22,-34028234663852886e22),eo.write(t,e,r,i,23,4),r+4}L.prototype.writeFloatLE=function(e,r,i){return fw(this,e,r,!0,i)};L.prototype.writeFloatBE=function(e,r,i){return fw(this,e,r,!1,i)};function hw(t,e,r,i,n){return e=+e,r=r>>>0,n||dw(t,e,r,8,17976931348623157e292,-17976931348623157e292),eo.write(t,e,r,i,52,8),r+8}L.prototype.writeDoubleLE=function(e,r,i){return hw(this,e,r,!0,i)};L.prototype.writeDoubleBE=function(e,r,i){return hw(this,e,r,!1,i)};L.prototype.copy=function(e,r,i,n){if(!L.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};L.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"&&!L.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(e.length===1){let a=e.charCodeAt(0);(n==="utf8"&&a<128||n==="latin1")&&(e=a)}}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 a=L.isBuffer(e)?e:L.from(e,n),s=a.length;if(s===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<i-r;++o)this[o+r]=a[o%s]}return this};var Qi={};function tg(t,e,r){Qi[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}`}}}tg("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);tg("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);tg("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=nw(String(r)):typeof r=="bigint"&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=nw(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i},RangeError);function nw(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 Jk(t,e,r){to(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&ra(e,t.length-(r+1))}function pw(t,e,r,i,n,o){if(t>r||t<e){let a=typeof e=="bigint"?"n":"",s;throw o>3?e===0||e===BigInt(0)?s=`>= 0${a} and < 2${a} ** ${(o+1)*8}${a}`:s=`>= -(2${a} ** ${(o+1)*8-1}${a}) and < 2 ** ${(o+1)*8-1}${a}`:s=`>= ${e}${a} and <= ${r}${a}`,new Qi.ERR_OUT_OF_RANGE("value",s,t)}Jk(i,n,o)}function to(t,e){if(typeof t!="number")throw new Qi.ERR_INVALID_ARG_TYPE(e,"number",t)}function ra(t,e,r){throw Math.floor(t)!==t?(to(t,r),new Qi.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new Qi.ERR_BUFFER_OUT_OF_BOUNDS:new Qi.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}var Yk=/[^+/0-9A-Za-z-_]/g;function Xk(t){if(t=t.split("=")[0],t=t.trim().replace(Yk,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Xm(t,e){e=e||1/0;let r,i=t.length,n=null,o=[];for(let a=0;a<i;++a){if(r=t.charCodeAt(a),r>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(a+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 Qk(t){let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function eR(t,e){let r,i,n,o=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),i=r>>8,n=r%256,o.push(n),o.push(i);return o}function mw(t){return Hm.toByteArray(Xk(t))}function Zc(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 Pr(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function rg(t){return t!==t}var tR=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 fn(t){return typeof BigInt>"u"?rR:t}function rR(){throw new Error("BigInt not supported")}});var Uw=Xt(()=>{});var Ag=Xt((Cw,Rg)=>{(function(t,e){"use strict";function r(S,u){if(!S)throw new Error(u||"Assertion failed")}function i(S,u){S.super_=u;var f=function(){};f.prototype=u.prototype,S.prototype=new f,S.prototype.constructor=S}function n(S,u,f){if(n.isBN(S))return S;this.negative=0,this.words=null,this.length=0,this.red=null,S!==null&&((u==="le"||u==="be")&&(f=u,u=10),this._init(S||0,u||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=Uw().Buffer}catch{}n.isBN=function(u){return u instanceof n?!0:u!==null&&typeof u=="object"&&u.constructor.wordSize===n.wordSize&&Array.isArray(u.words)},n.max=function(u,f){return u.cmp(f)>0?u:f},n.min=function(u,f){return u.cmp(f)<0?u:f},n.prototype._init=function(u,f,p){if(typeof u=="number")return this._initNumber(u,f,p);if(typeof u=="object")return this._initArray(u,f,p);f==="hex"&&(f=16),r(f===(f|0)&&f>=2&&f<=36),u=u.toString().replace(/\s+/g,"");var m=0;u[0]==="-"&&(m++,this.negative=1),m<u.length&&(f===16?this._parseHex(u,m,p):(this._parseBase(u,f,m),p==="le"&&this._initArray(this.toArray(),f,p)))},n.prototype._initNumber=function(u,f,p){u<0&&(this.negative=1,u=-u),u<67108864?(this.words=[u&67108863],this.length=1):u<4503599627370496?(this.words=[u&67108863,u/67108864&67108863],this.length=2):(r(u<9007199254740992),this.words=[u&67108863,u/67108864&67108863,1],this.length=3),p==="le"&&this._initArray(this.toArray(),f,p)},n.prototype._initArray=function(u,f,p){if(r(typeof u.length=="number"),u.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(u.length/3),this.words=new Array(this.length);for(var m=0;m<this.length;m++)this.words[m]=0;var y,x,I=0;if(p==="be")for(m=u.length-1,y=0;m>=0;m-=3)x=u[m]|u[m-1]<<8|u[m-2]<<16,this.words[y]|=x<<I&67108863,this.words[y+1]=x>>>26-I&67108863,I+=24,I>=26&&(I-=26,y++);else if(p==="le")for(m=0,y=0;m<u.length;m+=3)x=u[m]|u[m+1]<<8|u[m+2]<<16,this.words[y]|=x<<I&67108863,this.words[y+1]=x>>>26-I&67108863,I+=24,I>=26&&(I-=26,y++);return this._strip()};function a(S,u){var f=S.charCodeAt(u);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 s(S,u,f){var p=a(S,f);return f-1>=u&&(p|=a(S,f-1)<<4),p}n.prototype._parseHex=function(u,f,p){this.length=Math.ceil((u.length-f)/6),this.words=new Array(this.length);for(var m=0;m<this.length;m++)this.words[m]=0;var y=0,x=0,I;if(p==="be")for(m=u.length-1;m>=f;m-=2)I=s(u,f,m)<<y,this.words[x]|=I&67108863,y>=18?(y-=18,x+=1,this.words[x]|=I>>>26):y+=8;else{var _=u.length-f;for(m=_%2===0?f+1:f;m<u.length;m+=2)I=s(u,f,m)<<y,this.words[x]|=I&67108863,y>=18?(y-=18,x+=1,this.words[x]|=I>>>26):y+=8}this._strip()};function c(S,u,f,p){for(var m=0,y=0,x=Math.min(S.length,f),I=u;I<x;I++){var _=S.charCodeAt(I)-48;m*=p,_>=49?y=_-49+10:_>=17?y=_-17+10:y=_,r(_>=0&&y<p,"Invalid character"),m+=y}return m}n.prototype._parseBase=function(u,f,p){this.words=[0],this.length=1;for(var m=0,y=1;y<=67108863;y*=f)m++;m--,y=y/f|0;for(var x=u.length-p,I=x%m,_=Math.min(x,x-I)+p,d=0,b=p;b<_;b+=m)d=c(u,b,b+m,f),this.imuln(y),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(I!==0){var B=1;for(d=c(u,b,u.length,f),b=0;b<I;b++)B*=f;this.imuln(B),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}this._strip()},n.prototype.copy=function(u){u.words=new Array(this.length);for(var f=0;f<this.length;f++)u.words[f]=this.words[f];u.length=this.length,u.negative=this.negative,u.red=this.red};function l(S,u){S.words=u.words,S.length=u.length,S.negative=u.negative,S.red=u.red}if(n.prototype._move=function(u){l(u,this)},n.prototype.clone=function(){var u=new n(null);return this.copy(u),u},n.prototype._expand=function(u){for(;this.length<u;)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")]=h}catch{n.prototype.inspect=h}else n.prototype.inspect=h;function h(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var g=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],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],v=[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(u,f){u=u||10,f=f|0||1;var p;if(u===16||u==="hex"){p="";for(var m=0,y=0,x=0;x<this.length;x++){var I=this.words[x],_=((I<<m|y)&16777215).toString(16);y=I>>>24-m&16777215,m+=2,m>=26&&(m-=26,x--),y!==0||x!==this.length-1?p=g[6-_.length]+_+p:p=_+p}for(y!==0&&(p=y.toString(16)+p);p.length%f!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}if(u===(u|0)&&u>=2&&u<=36){var d=w[u],b=v[u];p="";var B=this.clone();for(B.negative=0;!B.isZero();){var V=B.modrn(b).toString(u);B=B.idivn(b),B.isZero()?p=V+p:p=g[d-V.length]+V+p}for(this.isZero()&&(p="0"+p);p.length%f!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var u=this.words[0];return this.length===2?u+=this.words[1]*67108864:this.length===3&&this.words[2]===1?u+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-u:u},n.prototype.toJSON=function(){return this.toString(16,2)},o&&(n.prototype.toBuffer=function(u,f){return this.toArrayLike(o,u,f)}),n.prototype.toArray=function(u,f){return this.toArrayLike(Array,u,f)};var $=function(u,f){return u.allocUnsafe?u.allocUnsafe(f):new u(f)};n.prototype.toArrayLike=function(u,f,p){this._strip();var m=this.byteLength(),y=p||Math.max(1,m);r(m<=y,"byte array longer than desired length"),r(y>0,"Requested array length <= 0");var x=$(u,y),I=f==="le"?"LE":"BE";return this["_toArrayLike"+I](x,m),x},n.prototype._toArrayLikeLE=function(u,f){for(var p=0,m=0,y=0,x=0;y<this.length;y++){var I=this.words[y]<<x|m;u[p++]=I&255,p<u.length&&(u[p++]=I>>8&255),p<u.length&&(u[p++]=I>>16&255),x===6?(p<u.length&&(u[p++]=I>>24&255),m=0,x=0):(m=I>>>24,x+=2)}if(p<u.length)for(u[p++]=m;p<u.length;)u[p++]=0},n.prototype._toArrayLikeBE=function(u,f){for(var p=u.length-1,m=0,y=0,x=0;y<this.length;y++){var I=this.words[y]<<x|m;u[p--]=I&255,p>=0&&(u[p--]=I>>8&255),p>=0&&(u[p--]=I>>16&255),x===6?(p>=0&&(u[p--]=I>>24&255),m=0,x=0):(m=I>>>24,x+=2)}if(p>=0)for(u[p--]=m;p>=0;)u[p--]=0},Math.clz32?n.prototype._countBits=function(u){return 32-Math.clz32(u)}:n.prototype._countBits=function(u){var f=u,p=0;return f>=4096&&(p+=13,f>>>=13),f>=64&&(p+=7,f>>>=7),f>=8&&(p+=4,f>>>=4),f>=2&&(p+=2,f>>>=2),p+f},n.prototype._zeroBits=function(u){if(u===0)return 26;var f=u,p=0;return(f&8191)===0&&(p+=13,f>>>=13),(f&127)===0&&(p+=7,f>>>=7),(f&15)===0&&(p+=4,f>>>=4),(f&3)===0&&(p+=2,f>>>=2),(f&1)===0&&p++,p},n.prototype.bitLength=function(){var u=this.words[this.length-1],f=this._countBits(u);return(this.length-1)*26+f};function k(S){for(var u=new Array(S.bitLength()),f=0;f<u.length;f++){var p=f/26|0,m=f%26;u[f]=S.words[p]>>>m&1}return u}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var u=0,f=0;f<this.length;f++){var p=this._zeroBits(this.words[f]);if(u+=p,p!==26)break}return u},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(u){return this.negative!==0?this.abs().inotn(u).iaddn(1):this.clone()},n.prototype.fromTwos=function(u){return this.testn(u-1)?this.notn(u).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(u){for(;this.length<u.length;)this.words[this.length++]=0;for(var f=0;f<u.length;f++)this.words[f]=this.words[f]|u.words[f];return this._strip()},n.prototype.ior=function(u){return r((this.negative|u.negative)===0),this.iuor(u)},n.prototype.or=function(u){return this.length>u.length?this.clone().ior(u):u.clone().ior(this)},n.prototype.uor=function(u){return this.length>u.length?this.clone().iuor(u):u.clone().iuor(this)},n.prototype.iuand=function(u){var f;this.length>u.length?f=u:f=this;for(var p=0;p<f.length;p++)this.words[p]=this.words[p]&u.words[p];return this.length=f.length,this._strip()},n.prototype.iand=function(u){return r((this.negative|u.negative)===0),this.iuand(u)},n.prototype.and=function(u){return this.length>u.length?this.clone().iand(u):u.clone().iand(this)},n.prototype.uand=function(u){return this.length>u.length?this.clone().iuand(u):u.clone().iuand(this)},n.prototype.iuxor=function(u){var f,p;this.length>u.length?(f=this,p=u):(f=u,p=this);for(var m=0;m<p.length;m++)this.words[m]=f.words[m]^p.words[m];if(this!==f)for(;m<f.length;m++)this.words[m]=f.words[m];return this.length=f.length,this._strip()},n.prototype.ixor=function(u){return r((this.negative|u.negative)===0),this.iuxor(u)},n.prototype.xor=function(u){return this.length>u.length?this.clone().ixor(u):u.clone().ixor(this)},n.prototype.uxor=function(u){return this.length>u.length?this.clone().iuxor(u):u.clone().iuxor(this)},n.prototype.inotn=function(u){r(typeof u=="number"&&u>=0);var f=Math.ceil(u/26)|0,p=u%26;this._expand(f),p>0&&f--;for(var m=0;m<f;m++)this.words[m]=~this.words[m]&67108863;return p>0&&(this.words[m]=~this.words[m]&67108863>>26-p),this._strip()},n.prototype.notn=function(u){return this.clone().inotn(u)},n.prototype.setn=function(u,f){r(typeof u=="number"&&u>=0);var p=u/26|0,m=u%26;return this._expand(p+1),f?this.words[p]=this.words[p]|1<<m:this.words[p]=this.words[p]&~(1<<m),this._strip()},n.prototype.iadd=function(u){var f;if(this.negative!==0&&u.negative===0)return this.negative=0,f=this.isub(u),this.negative^=1,this._normSign();if(this.negative===0&&u.negative!==0)return u.negative=0,f=this.isub(u),u.negative=1,f._normSign();var p,m;this.length>u.length?(p=this,m=u):(p=u,m=this);for(var y=0,x=0;x<m.length;x++)f=(p.words[x]|0)+(m.words[x]|0)+y,this.words[x]=f&67108863,y=f>>>26;for(;y!==0&&x<p.length;x++)f=(p.words[x]|0)+y,this.words[x]=f&67108863,y=f>>>26;if(this.length=p.length,y!==0)this.words[this.length]=y,this.length++;else if(p!==this)for(;x<p.length;x++)this.words[x]=p.words[x];return this},n.prototype.add=function(u){var f;return u.negative!==0&&this.negative===0?(u.negative=0,f=this.sub(u),u.negative^=1,f):u.negative===0&&this.negative!==0?(this.negative=0,f=u.sub(this),this.negative=1,f):this.length>u.length?this.clone().iadd(u):u.clone().iadd(this)},n.prototype.isub=function(u){if(u.negative!==0){u.negative=0;var f=this.iadd(u);return u.negative=1,f._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(u),this.negative=1,this._normSign();var p=this.cmp(u);if(p===0)return this.negative=0,this.length=1,this.words[0]=0,this;var m,y;p>0?(m=this,y=u):(m=u,y=this);for(var x=0,I=0;I<y.length;I++)f=(m.words[I]|0)-(y.words[I]|0)+x,x=f>>26,this.words[I]=f&67108863;for(;x!==0&&I<m.length;I++)f=(m.words[I]|0)+x,x=f>>26,this.words[I]=f&67108863;if(x===0&&I<m.length&&m!==this)for(;I<m.length;I++)this.words[I]=m.words[I];return this.length=Math.max(this.length,I),m!==this&&(this.negative=1),this._strip()},n.prototype.sub=function(u){return this.clone().isub(u)};function R(S,u,f){f.negative=u.negative^S.negative;var p=S.length+u.length|0;f.length=p,p=p-1|0;var m=S.words[0]|0,y=u.words[0]|0,x=m*y,I=x&67108863,_=x/67108864|0;f.words[0]=I;for(var d=1;d<p;d++){for(var b=_>>>26,B=_&67108863,V=Math.min(d,u.length-1),W=Math.max(0,d-S.length+1);W<=V;W++){var re=d-W|0;m=S.words[re]|0,y=u.words[W]|0,x=m*y+B,b+=x/67108864|0,B=x&67108863}f.words[d]=B|0,_=b|0}return _!==0?f.words[d]=_|0:f.length--,f._strip()}var z=function(u,f,p){var m=u.words,y=f.words,x=p.words,I=0,_,d,b,B=m[0]|0,V=B&8191,W=B>>>13,re=m[1]|0,ce=re&8191,fe=re>>>13,Ce=m[2]|0,me=Ce&8191,ye=Ce>>>13,ar=m[3]|0,ke=ar&8191,Be=ar>>>13,Ha=m[4]|0,Je=Ha&8191,Ye=Ha>>>13,Ja=m[5]|0,Fe=Ja&8191,Ze=Ja>>>13,_i=m[6]|0,Ve=_i&8191,Ke=_i>>>13,xo=m[7]|0,We=xo&8191,qe=xo>>>13,Ya=m[8]|0,Xe=Ya&8191,Qe=Ya>>>13,Xa=m[9]|0,rt=Xa&8191,nt=Xa>>>13,hy=y[0]|0,it=hy&8191,ot=hy>>>13,py=y[1]|0,at=py&8191,st=py>>>13,my=y[2]|0,ct=my&8191,ut=my>>>13,gy=y[3]|0,lt=gy&8191,dt=gy>>>13,yy=y[4]|0,ft=yy&8191,ht=yy>>>13,_y=y[5]|0,pt=_y&8191,mt=_y>>>13,vy=y[6]|0,gt=vy&8191,yt=vy>>>13,by=y[7]|0,_t=by&8191,vt=by>>>13,wy=y[8]|0,bt=wy&8191,wt=wy>>>13,xy=y[9]|0,xt=xy&8191,St=xy>>>13;p.negative=u.negative^f.negative,p.length=19,_=Math.imul(V,it),d=Math.imul(V,ot),d=d+Math.imul(W,it)|0,b=Math.imul(W,ot);var fl=(I+_|0)+((d&8191)<<13)|0;I=(b+(d>>>13)|0)+(fl>>>26)|0,fl&=67108863,_=Math.imul(ce,it),d=Math.imul(ce,ot),d=d+Math.imul(fe,it)|0,b=Math.imul(fe,ot),_=_+Math.imul(V,at)|0,d=d+Math.imul(V,st)|0,d=d+Math.imul(W,at)|0,b=b+Math.imul(W,st)|0;var hl=(I+_|0)+((d&8191)<<13)|0;I=(b+(d>>>13)|0)+(hl>>>26)|0,hl&=67108863,_=Math.imul(me,it),d=Math.imul(me,ot),d=d+Math.imul(ye,it)|0,b=Math.imul(ye,ot),_=_+Math.imul(ce,at)|0,d=d+Math.imul(ce,st)|0,d=d+Math.imul(fe,at)|0,b=b+Math.imul(fe,st)|0,_=_+Math.imul(V,ct)|0,d=d+Math.imul(V,ut)|0,d=d+Math.imul(W,ct)|0,b=b+Math.imul(W,ut)|0;var pl=(I+_|0)+((d&8191)<<13)|0;I=(b+(d>>>13)|0)+(pl>>>26)|0,pl&=67108863,_=Math.imul(ke,it),d=Math.imul(ke,ot),d=d+Math.imul(Be,it)|0,b=Math.imul(Be,ot),_=_+Math.imul(me,at)|0,d=d+Math.imul(me,st)|0,d=d+Math.imul(ye,at)|0,b=b+Math.imul(ye,st)|0,_=_+Math.imul(ce,ct)|0,d=d+Math.imul(ce,ut)|0,d=d+Math.imul(fe,ct)|0,b=b+Math.imul(fe,ut)|0,_=_+Math.imul(V,lt)|0,d=d+Math.imul(V,dt)|0,d=d+Math.imul(W,lt)|0,b=b+Math.imul(W,dt)|0;var ml=(I+_|0)+((d&8191)<<13)|0;I=(b+(d>>>13)|0)+(ml>>>26)|0,ml&=67108863,_=Math.imul(Je,it),d=Math.imul(Je,ot),d=d+Math.imul(Ye,it)|0,b=Math.imul(Ye,ot),_=_+Math.imul(ke,at)|0,d=d+Math.imul(ke,st)|0,d=d+Math.imul(Be,at)|0,b=b+Math.imul(Be,st)|0,_=_+Math.imul(me,ct)|0,d=d+Math.imul(me,ut)|0,d=d+Math.imul(ye,ct)|0,b=b+Math.imul(ye,ut)|0,_=_+Math.imul(ce,lt)|0,d=d+Math.imul(ce,dt)|0,d=d+Math.imul(fe,lt)|0,b=b+Math.imul(fe,dt)|0,_=_+Math.imul(V,ft)|0,d=d+Math.imul(V,ht)|0,d=d+Math.imul(W,ft)|0,b=b+Math.imul(W,ht)|0;var gl=(I+_|0)+((d&8191)<<13)|0;I=(b+(d>>>13)|0)+(gl>>>26)|0,gl&=67108863,_=Math.imul(Fe,it),d=Math.imul(Fe,ot),d=d+Math.imul(Ze,it)|0,b=Math.imul(Ze,ot),_=_+Math.imul(Je,at)|0,d=d+Math.imul(Je,st)|0,d=d+Math.imul(Ye,at)|0,b=b+Math.imul(Ye,st)|0,_=_+Math.imul(ke,ct)|0,d=d+Math.imul(ke,ut)|0,d=d+Math.imul(Be,ct)|0,b=b+Math.imul(Be,ut)|0,_=_+Math.imul(me,lt)|0,d=d+Math.imul(me,dt)|0,d=d+Math.imul(ye,lt)|0,b=b+Math.imul(ye,dt)|0,_=_+Math.imul(ce,ft)|0,d=d+Math.imul(ce,ht)|0,d=d+Math.imul(fe,ft)|0,b=b+Math.imul(fe,ht)|0,_=_+Math.imul(V,pt)|0,d=d+Math.imul(V,mt)|0,d=d+Math.imul(W,pt)|0,b=b+Math.imul(W,mt)|0;var yl=(I+_|0)+((d&8191)<<13)|0;I=(b+(d>>>13)|0)+(yl>>>26)|0,yl&=67108863,_=Math.imul(Ve,it),d=Math.imul(Ve,ot),d=d+Math.imul(Ke,it)|0,b=Math.imul(Ke,ot),_=_+Math.imul(Fe,at)|0,d=d+Math.imul(Fe,st)|0,d=d+Math.imul(Ze,at)|0,b=b+Math.imul(Ze,st)|0,_=_+Math.imul(Je,ct)|0,d=d+Math.imul(Je,ut)|0,d=d+Math.imul(Ye,ct)|0,b=b+Math.imul(Ye,ut)|0,_=_+Math.imul(ke,lt)|0,d=d+Math.imul(ke,dt)|0,d=d+Math.imul(Be,lt)|0,b=b+Math.imul(Be,dt)|0,_=_+Math.imul(me,ft)|0,d=d+Math.imul(me,ht)|0,d=d+Math.imul(ye,ft)|0,b=b+Math.imul(ye,ht)|0,_=_+Math.imul(ce,pt)|0,d=d+Math.imul(ce,mt)|0,d=d+Math.imul(fe,pt)|0,b=b+Math.imul(fe,mt)|0,_=_+Math.imul(V,gt)|0,d=d+Math.imul(V,yt)|0,d=d+Math.imul(W,gt)|0,b=b+Math.imul(W,yt)|0;var _l=(I+_|0)+((d&8191)<<13)|0;I=(b+(d>>>13)|0)+(_l>>>26)|0,_l&=67108863,_=Math.imul(We,it),d=Math.imul(We,ot),d=d+Math.imul(qe,it)|0,b=Math.imul(qe,ot),_=_+Math.imul(Ve,at)|0,d=d+Math.imul(Ve,st)|0,d=d+Math.imul(Ke,at)|0,b=b+Math.imul(Ke,st)|0,_=_+Math.imul(Fe,ct)|0,d=d+Math.imul(Fe,ut)|0,d=d+Math.imul(Ze,ct)|0,b=b+Math.imul(Ze,ut)|0,_=_+Math.imul(Je,lt)|0,d=d+Math.imul(Je,dt)|0,d=d+Math.imul(Ye,lt)|0,b=b+Math.imul(Ye,dt)|0,_=_+Math.imul(ke,ft)|0,d=d+Math.imul(ke,ht)|0,d=d+Math.imul(Be,ft)|0,b=b+Math.imul(Be,ht)|0,_=_+Math.imul(me,pt)|0,d=d+Math.imul(me,mt)|0,d=d+Math.imul(ye,pt)|0,b=b+Math.imul(ye,mt)|0,_=_+Math.imul(ce,gt)|0,d=d+Math.imul(ce,yt)|0,d=d+Math.imul(fe,gt)|0,b=b+Math.imul(fe,yt)|0,_=_+Math.imul(V,_t)|0,d=d+Math.imul(V,vt)|0,d=d+Math.imul(W,_t)|0,b=b+Math.imul(W,vt)|0;var vl=(I+_|0)+((d&8191)<<13)|0;I=(b+(d>>>13)|0)+(vl>>>26)|0,vl&=67108863,_=Math.imul(Xe,it),d=Math.imul(Xe,ot),d=d+Math.imul(Qe,it)|0,b=Math.imul(Qe,ot),_=_+Math.imul(We,at)|0,d=d+Math.imul(We,st)|0,d=d+Math.imul(qe,at)|0,b=b+Math.imul(qe,st)|0,_=_+Math.imul(Ve,ct)|0,d=d+Math.imul(Ve,ut)|0,d=d+Math.imul(Ke,ct)|0,b=b+Math.imul(Ke,ut)|0,_=_+Math.imul(Fe,lt)|0,d=d+Math.imul(Fe,dt)|0,d=d+Math.imul(Ze,lt)|0,b=b+Math.imul(Ze,dt)|0,_=_+Math.imul(Je,ft)|0,d=d+Math.imul(Je,ht)|0,d=d+Math.imul(Ye,ft)|0,b=b+Math.imul(Ye,ht)|0,_=_+Math.imul(ke,pt)|0,d=d+Math.imul(ke,mt)|0,d=d+Math.imul(Be,pt)|0,b=b+Math.imul(Be,mt)|0,_=_+Math.imul(me,gt)|0,d=d+Math.imul(me,yt)|0,d=d+Math.imul(ye,gt)|0,b=b+Math.imul(ye,yt)|0,_=_+Math.imul(ce,_t)|0,d=d+Math.imul(ce,vt)|0,d=d+Math.imul(fe,_t)|0,b=b+Math.imul(fe,vt)|0,_=_+Math.imul(V,bt)|0,d=d+Math.imul(V,wt)|0,d=d+Math.imul(W,bt)|0,b=b+Math.imul(W,wt)|0;var bl=(I+_|0)+((d&8191)<<13)|0;I=(b+(d>>>13)|0)+(bl>>>26)|0,bl&=67108863,_=Math.imul(rt,it),d=Math.imul(rt,ot),d=d+Math.imul(nt,it)|0,b=Math.imul(nt,ot),_=_+Math.imul(Xe,at)|0,d=d+Math.imul(Xe,st)|0,d=d+Math.imul(Qe,at)|0,b=b+Math.imul(Qe,st)|0,_=_+Math.imul(We,ct)|0,d=d+Math.imul(We,ut)|0,d=d+Math.imul(qe,ct)|0,b=b+Math.imul(qe,ut)|0,_=_+Math.imul(Ve,lt)|0,d=d+Math.imul(Ve,dt)|0,d=d+Math.imul(Ke,lt)|0,b=b+Math.imul(Ke,dt)|0,_=_+Math.imul(Fe,ft)|0,d=d+Math.imul(Fe,ht)|0,d=d+Math.imul(Ze,ft)|0,b=b+Math.imul(Ze,ht)|0,_=_+Math.imul(Je,pt)|0,d=d+Math.imul(Je,mt)|0,d=d+Math.imul(Ye,pt)|0,b=b+Math.imul(Ye,mt)|0,_=_+Math.imul(ke,gt)|0,d=d+Math.imul(ke,yt)|0,d=d+Math.imul(Be,gt)|0,b=b+Math.imul(Be,yt)|0,_=_+Math.imul(me,_t)|0,d=d+Math.imul(me,vt)|0,d=d+Math.imul(ye,_t)|0,b=b+Math.imul(ye,vt)|0,_=_+Math.imul(ce,bt)|0,d=d+Math.imul(ce,wt)|0,d=d+Math.imul(fe,bt)|0,b=b+Math.imul(fe,wt)|0,_=_+Math.imul(V,xt)|0,d=d+Math.imul(V,St)|0,d=d+Math.imul(W,xt)|0,b=b+Math.imul(W,St)|0;var wl=(I+_|0)+((d&8191)<<13)|0;I=(b+(d>>>13)|0)+(wl>>>26)|0,wl&=67108863,_=Math.imul(rt,at),d=Math.imul(rt,st),d=d+Math.imul(nt,at)|0,b=Math.imul(nt,st),_=_+Math.imul(Xe,ct)|0,d=d+Math.imul(Xe,ut)|0,d=d+Math.imul(Qe,ct)|0,b=b+Math.imul(Qe,ut)|0,_=_+Math.imul(We,lt)|0,d=d+Math.imul(We,dt)|0,d=d+Math.imul(qe,lt)|0,b=b+Math.imul(qe,dt)|0,_=_+Math.imul(Ve,ft)|0,d=d+Math.imul(Ve,ht)|0,d=d+Math.imul(Ke,ft)|0,b=b+Math.imul(Ke,ht)|0,_=_+Math.imul(Fe,pt)|0,d=d+Math.imul(Fe,mt)|0,d=d+Math.imul(Ze,pt)|0,b=b+Math.imul(Ze,mt)|0,_=_+Math.imul(Je,gt)|0,d=d+Math.imul(Je,yt)|0,d=d+Math.imul(Ye,gt)|0,b=b+Math.imul(Ye,yt)|0,_=_+Math.imul(ke,_t)|0,d=d+Math.imul(ke,vt)|0,d=d+Math.imul(Be,_t)|0,b=b+Math.imul(Be,vt)|0,_=_+Math.imul(me,bt)|0,d=d+Math.imul(me,wt)|0,d=d+Math.imul(ye,bt)|0,b=b+Math.imul(ye,wt)|0,_=_+Math.imul(ce,xt)|0,d=d+Math.imul(ce,St)|0,d=d+Math.imul(fe,xt)|0,b=b+Math.imul(fe,St)|0;var xl=(I+_|0)+((d&8191)<<13)|0;I=(b+(d>>>13)|0)+(xl>>>26)|0,xl&=67108863,_=Math.imul(rt,ct),d=Math.imul(rt,ut),d=d+Math.imul(nt,ct)|0,b=Math.imul(nt,ut),_=_+Math.imul(Xe,lt)|0,d=d+Math.imul(Xe,dt)|0,d=d+Math.imul(Qe,lt)|0,b=b+Math.imul(Qe,dt)|0,_=_+Math.imul(We,ft)|0,d=d+Math.imul(We,ht)|0,d=d+Math.imul(qe,ft)|0,b=b+Math.imul(qe,ht)|0,_=_+Math.imul(Ve,pt)|0,d=d+Math.imul(Ve,mt)|0,d=d+Math.imul(Ke,pt)|0,b=b+Math.imul(Ke,mt)|0,_=_+Math.imul(Fe,gt)|0,d=d+Math.imul(Fe,yt)|0,d=d+Math.imul(Ze,gt)|0,b=b+Math.imul(Ze,yt)|0,_=_+Math.imul(Je,_t)|0,d=d+Math.imul(Je,vt)|0,d=d+Math.imul(Ye,_t)|0,b=b+Math.imul(Ye,vt)|0,_=_+Math.imul(ke,bt)|0,d=d+Math.imul(ke,wt)|0,d=d+Math.imul(Be,bt)|0,b=b+Math.imul(Be,wt)|0,_=_+Math.imul(me,xt)|0,d=d+Math.imul(me,St)|0,d=d+Math.imul(ye,xt)|0,b=b+Math.imul(ye,St)|0;var Sl=(I+_|0)+((d&8191)<<13)|0;I=(b+(d>>>13)|0)+(Sl>>>26)|0,Sl&=67108863,_=Math.imul(rt,lt),d=Math.imul(rt,dt),d=d+Math.imul(nt,lt)|0,b=Math.imul(nt,dt),_=_+Math.imul(Xe,ft)|0,d=d+Math.imul(Xe,ht)|0,d=d+Math.imul(Qe,ft)|0,b=b+Math.imul(Qe,ht)|0,_=_+Math.imul(We,pt)|0,d=d+Math.imul(We,mt)|0,d=d+Math.imul(qe,pt)|0,b=b+Math.imul(qe,mt)|0,_=_+Math.imul(Ve,gt)|0,d=d+Math.imul(Ve,yt)|0,d=d+Math.imul(Ke,gt)|0,b=b+Math.imul(Ke,yt)|0,_=_+Math.imul(Fe,_t)|0,d=d+Math.imul(Fe,vt)|0,d=d+Math.imul(Ze,_t)|0,b=b+Math.imul(Ze,vt)|0,_=_+Math.imul(Je,bt)|0,d=d+Math.imul(Je,wt)|0,d=d+Math.imul(Ye,bt)|0,b=b+Math.imul(Ye,wt)|0,_=_+Math.imul(ke,xt)|0,d=d+Math.imul(ke,St)|0,d=d+Math.imul(Be,xt)|0,b=b+Math.imul(Be,St)|0;var El=(I+_|0)+((d&8191)<<13)|0;I=(b+(d>>>13)|0)+(El>>>26)|0,El&=67108863,_=Math.imul(rt,ft),d=Math.imul(rt,ht),d=d+Math.imul(nt,ft)|0,b=Math.imul(nt,ht),_=_+Math.imul(Xe,pt)|0,d=d+Math.imul(Xe,mt)|0,d=d+Math.imul(Qe,pt)|0,b=b+Math.imul(Qe,mt)|0,_=_+Math.imul(We,gt)|0,d=d+Math.imul(We,yt)|0,d=d+Math.imul(qe,gt)|0,b=b+Math.imul(qe,yt)|0,_=_+Math.imul(Ve,_t)|0,d=d+Math.imul(Ve,vt)|0,d=d+Math.imul(Ke,_t)|0,b=b+Math.imul(Ke,vt)|0,_=_+Math.imul(Fe,bt)|0,d=d+Math.imul(Fe,wt)|0,d=d+Math.imul(Ze,bt)|0,b=b+Math.imul(Ze,wt)|0,_=_+Math.imul(Je,xt)|0,d=d+Math.imul(Je,St)|0,d=d+Math.imul(Ye,xt)|0,b=b+Math.imul(Ye,St)|0;var Il=(I+_|0)+((d&8191)<<13)|0;I=(b+(d>>>13)|0)+(Il>>>26)|0,Il&=67108863,_=Math.imul(rt,pt),d=Math.imul(rt,mt),d=d+Math.imul(nt,pt)|0,b=Math.imul(nt,mt),_=_+Math.imul(Xe,gt)|0,d=d+Math.imul(Xe,yt)|0,d=d+Math.imul(Qe,gt)|0,b=b+Math.imul(Qe,yt)|0,_=_+Math.imul(We,_t)|0,d=d+Math.imul(We,vt)|0,d=d+Math.imul(qe,_t)|0,b=b+Math.imul(qe,vt)|0,_=_+Math.imul(Ve,bt)|0,d=d+Math.imul(Ve,wt)|0,d=d+Math.imul(Ke,bt)|0,b=b+Math.imul(Ke,wt)|0,_=_+Math.imul(Fe,xt)|0,d=d+Math.imul(Fe,St)|0,d=d+Math.imul(Ze,xt)|0,b=b+Math.imul(Ze,St)|0;var kl=(I+_|0)+((d&8191)<<13)|0;I=(b+(d>>>13)|0)+(kl>>>26)|0,kl&=67108863,_=Math.imul(rt,gt),d=Math.imul(rt,yt),d=d+Math.imul(nt,gt)|0,b=Math.imul(nt,yt),_=_+Math.imul(Xe,_t)|0,d=d+Math.imul(Xe,vt)|0,d=d+Math.imul(Qe,_t)|0,b=b+Math.imul(Qe,vt)|0,_=_+Math.imul(We,bt)|0,d=d+Math.imul(We,wt)|0,d=d+Math.imul(qe,bt)|0,b=b+Math.imul(qe,wt)|0,_=_+Math.imul(Ve,xt)|0,d=d+Math.imul(Ve,St)|0,d=d+Math.imul(Ke,xt)|0,b=b+Math.imul(Ke,St)|0;var Rl=(I+_|0)+((d&8191)<<13)|0;I=(b+(d>>>13)|0)+(Rl>>>26)|0,Rl&=67108863,_=Math.imul(rt,_t),d=Math.imul(rt,vt),d=d+Math.imul(nt,_t)|0,b=Math.imul(nt,vt),_=_+Math.imul(Xe,bt)|0,d=d+Math.imul(Xe,wt)|0,d=d+Math.imul(Qe,bt)|0,b=b+Math.imul(Qe,wt)|0,_=_+Math.imul(We,xt)|0,d=d+Math.imul(We,St)|0,d=d+Math.imul(qe,xt)|0,b=b+Math.imul(qe,St)|0;var Al=(I+_|0)+((d&8191)<<13)|0;I=(b+(d>>>13)|0)+(Al>>>26)|0,Al&=67108863,_=Math.imul(rt,bt),d=Math.imul(rt,wt),d=d+Math.imul(nt,bt)|0,b=Math.imul(nt,wt),_=_+Math.imul(Xe,xt)|0,d=d+Math.imul(Xe,St)|0,d=d+Math.imul(Qe,xt)|0,b=b+Math.imul(Qe,St)|0;var $l=(I+_|0)+((d&8191)<<13)|0;I=(b+(d>>>13)|0)+($l>>>26)|0,$l&=67108863,_=Math.imul(rt,xt),d=Math.imul(rt,St),d=d+Math.imul(nt,xt)|0,b=Math.imul(nt,St);var Ol=(I+_|0)+((d&8191)<<13)|0;return I=(b+(d>>>13)|0)+(Ol>>>26)|0,Ol&=67108863,x[0]=fl,x[1]=hl,x[2]=pl,x[3]=ml,x[4]=gl,x[5]=yl,x[6]=_l,x[7]=vl,x[8]=bl,x[9]=wl,x[10]=xl,x[11]=Sl,x[12]=El,x[13]=Il,x[14]=kl,x[15]=Rl,x[16]=Al,x[17]=$l,x[18]=Ol,I!==0&&(x[19]=I,p.length++),p};Math.imul||(z=R);function F(S,u,f){f.negative=u.negative^S.negative,f.length=S.length+u.length;for(var p=0,m=0,y=0;y<f.length-1;y++){var x=m;m=0;for(var I=p&67108863,_=Math.min(y,u.length-1),d=Math.max(0,y-S.length+1);d<=_;d++){var b=y-d,B=S.words[b]|0,V=u.words[d]|0,W=B*V,re=W&67108863;x=x+(W/67108864|0)|0,re=re+I|0,I=re&67108863,x=x+(re>>>26)|0,m+=x>>>26,x&=67108863}f.words[y]=I,p=x,x=m}return p!==0?f.words[y]=p:f.length--,f._strip()}function P(S,u,f){return F(S,u,f)}n.prototype.mulTo=function(u,f){var p,m=this.length+u.length;return this.length===10&&u.length===10?p=z(this,u,f):m<63?p=R(this,u,f):m<1024?p=F(this,u,f):p=P(this,u,f),p};function C(S,u){this.x=S,this.y=u}C.prototype.makeRBT=function(u){for(var f=new Array(u),p=n.prototype._countBits(u)-1,m=0;m<u;m++)f[m]=this.revBin(m,p,u);return f},C.prototype.revBin=function(u,f,p){if(u===0||u===p-1)return u;for(var m=0,y=0;y<f;y++)m|=(u&1)<<f-y-1,u>>=1;return m},C.prototype.permute=function(u,f,p,m,y,x){for(var I=0;I<x;I++)m[I]=f[u[I]],y[I]=p[u[I]]},C.prototype.transform=function(u,f,p,m,y,x){this.permute(x,u,f,p,m,y);for(var I=1;I<y;I<<=1)for(var _=I<<1,d=Math.cos(2*Math.PI/_),b=Math.sin(2*Math.PI/_),B=0;B<y;B+=_)for(var V=d,W=b,re=0;re<I;re++){var ce=p[B+re],fe=m[B+re],Ce=p[B+re+I],me=m[B+re+I],ye=V*Ce-W*me;me=V*me+W*Ce,Ce=ye,p[B+re]=ce+Ce,m[B+re]=fe+me,p[B+re+I]=ce-Ce,m[B+re+I]=fe-me,re!==_&&(ye=d*V-b*W,W=d*W+b*V,V=ye)}},C.prototype.guessLen13b=function(u,f){var p=Math.max(f,u)|1,m=p&1,y=0;for(p=p/2|0;p;p=p>>>1)y++;return 1<<y+1+m},C.prototype.conjugate=function(u,f,p){if(!(p<=1))for(var m=0;m<p/2;m++){var y=u[m];u[m]=u[p-m-1],u[p-m-1]=y,y=f[m],f[m]=-f[p-m-1],f[p-m-1]=-y}},C.prototype.normalize13b=function(u,f){for(var p=0,m=0;m<f/2;m++){var y=Math.round(u[2*m+1]/f)*8192+Math.round(u[2*m]/f)+p;u[m]=y&67108863,y<67108864?p=0:p=y/67108864|0}return u},C.prototype.convert13b=function(u,f,p,m){for(var y=0,x=0;x<f;x++)y=y+(u[x]|0),p[2*x]=y&8191,y=y>>>13,p[2*x+1]=y&8191,y=y>>>13;for(x=2*f;x<m;++x)p[x]=0;r(y===0),r((y&-8192)===0)},C.prototype.stub=function(u){for(var f=new Array(u),p=0;p<u;p++)f[p]=0;return f},C.prototype.mulp=function(u,f,p){var m=2*this.guessLen13b(u.length,f.length),y=this.makeRBT(m),x=this.stub(m),I=new Array(m),_=new Array(m),d=new Array(m),b=new Array(m),B=new Array(m),V=new Array(m),W=p.words;W.length=m,this.convert13b(u.words,u.length,I,m),this.convert13b(f.words,f.length,b,m),this.transform(I,x,_,d,m,y),this.transform(b,x,B,V,m,y);for(var re=0;re<m;re++){var ce=_[re]*B[re]-d[re]*V[re];d[re]=_[re]*V[re]+d[re]*B[re],_[re]=ce}return this.conjugate(_,d,m),this.transform(_,d,W,x,m,y),this.conjugate(W,x,m),this.normalize13b(W,m),p.negative=u.negative^f.negative,p.length=u.length+f.length,p._strip()},n.prototype.mul=function(u){var f=new n(null);return f.words=new Array(this.length+u.length),this.mulTo(u,f)},n.prototype.mulf=function(u){var f=new n(null);return f.words=new Array(this.length+u.length),P(this,u,f)},n.prototype.imul=function(u){return this.clone().mulTo(u,this)},n.prototype.imuln=function(u){var f=u<0;f&&(u=-u),r(typeof u=="number"),r(u<67108864);for(var p=0,m=0;m<this.length;m++){var y=(this.words[m]|0)*u,x=(y&67108863)+(p&67108863);p>>=26,p+=y/67108864|0,p+=x>>>26,this.words[m]=x&67108863}return p!==0&&(this.words[m]=p,this.length++),f?this.ineg():this},n.prototype.muln=function(u){return this.clone().imuln(u)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(u){var f=k(u);if(f.length===0)return new n(1);for(var p=this,m=0;m<f.length&&f[m]===0;m++,p=p.sqr());if(++m<f.length)for(var y=p.sqr();m<f.length;m++,y=y.sqr())f[m]!==0&&(p=p.mul(y));return p},n.prototype.iushln=function(u){r(typeof u=="number"&&u>=0);var f=u%26,p=(u-f)/26,m=67108863>>>26-f<<26-f,y;if(f!==0){var x=0;for(y=0;y<this.length;y++){var I=this.words[y]&m,_=(this.words[y]|0)-I<<f;this.words[y]=_|x,x=I>>>26-f}x&&(this.words[y]=x,this.length++)}if(p!==0){for(y=this.length-1;y>=0;y--)this.words[y+p]=this.words[y];for(y=0;y<p;y++)this.words[y]=0;this.length+=p}return this._strip()},n.prototype.ishln=function(u){return r(this.negative===0),this.iushln(u)},n.prototype.iushrn=function(u,f,p){r(typeof u=="number"&&u>=0);var m;f?m=(f-f%26)/26:m=0;var y=u%26,x=Math.min((u-y)/26,this.length),I=67108863^67108863>>>y<<y,_=p;if(m-=x,m=Math.max(0,m),_){for(var d=0;d<x;d++)_.words[d]=this.words[d];_.length=x}if(x!==0)if(this.length>x)for(this.length-=x,d=0;d<this.length;d++)this.words[d]=this.words[d+x];else this.words[0]=0,this.length=1;var b=0;for(d=this.length-1;d>=0&&(b!==0||d>=m);d--){var B=this.words[d]|0;this.words[d]=b<<26-y|B>>>y,b=B&I}return _&&b!==0&&(_.words[_.length++]=b),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},n.prototype.ishrn=function(u,f,p){return r(this.negative===0),this.iushrn(u,f,p)},n.prototype.shln=function(u){return this.clone().ishln(u)},n.prototype.ushln=function(u){return this.clone().iushln(u)},n.prototype.shrn=function(u){return this.clone().ishrn(u)},n.prototype.ushrn=function(u){return this.clone().iushrn(u)},n.prototype.testn=function(u){r(typeof u=="number"&&u>=0);var f=u%26,p=(u-f)/26,m=1<<f;if(this.length<=p)return!1;var y=this.words[p];return!!(y&m)},n.prototype.imaskn=function(u){r(typeof u=="number"&&u>=0);var f=u%26,p=(u-f)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=p)return this;if(f!==0&&p++,this.length=Math.min(p,this.length),f!==0){var m=67108863^67108863>>>f<<f;this.words[this.length-1]&=m}return this._strip()},n.prototype.maskn=function(u){return this.clone().imaskn(u)},n.prototype.iaddn=function(u){return r(typeof u=="number"),r(u<67108864),u<0?this.isubn(-u):this.negative!==0?this.length===1&&(this.words[0]|0)<=u?(this.words[0]=u-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(u),this.negative=1,this):this._iaddn(u)},n.prototype._iaddn=function(u){this.words[0]+=u;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(u){if(r(typeof u=="number"),r(u<67108864),u<0)return this.iaddn(-u);if(this.negative!==0)return this.negative=0,this.iaddn(u),this.negative=1,this;if(this.words[0]-=u,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(u){return this.clone().iaddn(u)},n.prototype.subn=function(u){return this.clone().isubn(u)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(u,f,p){var m=u.length+p,y;this._expand(m);var x,I=0;for(y=0;y<u.length;y++){x=(this.words[y+p]|0)+I;var _=(u.words[y]|0)*f;x-=_&67108863,I=(x>>26)-(_/67108864|0),this.words[y+p]=x&67108863}for(;y<this.length-p;y++)x=(this.words[y+p]|0)+I,I=x>>26,this.words[y+p]=x&67108863;if(I===0)return this._strip();for(r(I===-1),I=0,y=0;y<this.length;y++)x=-(this.words[y]|0)+I,I=x>>26,this.words[y]=x&67108863;return this.negative=1,this._strip()},n.prototype._wordDiv=function(u,f){var p=this.length-u.length,m=this.clone(),y=u,x=y.words[y.length-1]|0,I=this._countBits(x);p=26-I,p!==0&&(y=y.ushln(p),m.iushln(p),x=y.words[y.length-1]|0);var _=m.length-y.length,d;if(f!=="mod"){d=new n(null),d.length=_+1,d.words=new Array(d.length);for(var b=0;b<d.length;b++)d.words[b]=0}var B=m.clone()._ishlnsubmul(y,1,_);B.negative===0&&(m=B,d&&(d.words[_]=1));for(var V=_-1;V>=0;V--){var W=(m.words[y.length+V]|0)*67108864+(m.words[y.length+V-1]|0);for(W=Math.min(W/x|0,67108863),m._ishlnsubmul(y,W,V);m.negative!==0;)W--,m.negative=0,m._ishlnsubmul(y,1,V),m.isZero()||(m.negative^=1);d&&(d.words[V]=W)}return d&&d._strip(),m._strip(),f!=="div"&&p!==0&&m.iushrn(p),{div:d||null,mod:m}},n.prototype.divmod=function(u,f,p){if(r(!u.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var m,y,x;return this.negative!==0&&u.negative===0?(x=this.neg().divmod(u,f),f!=="mod"&&(m=x.div.neg()),f!=="div"&&(y=x.mod.neg(),p&&y.negative!==0&&y.iadd(u)),{div:m,mod:y}):this.negative===0&&u.negative!==0?(x=this.divmod(u.neg(),f),f!=="mod"&&(m=x.div.neg()),{div:m,mod:x.mod}):(this.negative&u.negative)!==0?(x=this.neg().divmod(u.neg(),f),f!=="div"&&(y=x.mod.neg(),p&&y.negative!==0&&y.isub(u)),{div:x.div,mod:y}):u.length>this.length||this.cmp(u)<0?{div:new n(0),mod:this}:u.length===1?f==="div"?{div:this.divn(u.words[0]),mod:null}:f==="mod"?{div:null,mod:new n(this.modrn(u.words[0]))}:{div:this.divn(u.words[0]),mod:new n(this.modrn(u.words[0]))}:this._wordDiv(u,f)},n.prototype.div=function(u){return this.divmod(u,"div",!1).div},n.prototype.mod=function(u){return this.divmod(u,"mod",!1).mod},n.prototype.umod=function(u){return this.divmod(u,"mod",!0).mod},n.prototype.divRound=function(u){var f=this.divmod(u);if(f.mod.isZero())return f.div;var p=f.div.negative!==0?f.mod.isub(u):f.mod,m=u.ushrn(1),y=u.andln(1),x=p.cmp(m);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(u){var f=u<0;f&&(u=-u),r(u<=67108863);for(var p=(1<<26)%u,m=0,y=this.length-1;y>=0;y--)m=(p*m+(this.words[y]|0))%u;return f?-m:m},n.prototype.modn=function(u){return this.modrn(u)},n.prototype.idivn=function(u){var f=u<0;f&&(u=-u),r(u<=67108863);for(var p=0,m=this.length-1;m>=0;m--){var y=(this.words[m]|0)+p*67108864;this.words[m]=y/u|0,p=y%u}return this._strip(),f?this.ineg():this},n.prototype.divn=function(u){return this.clone().idivn(u)},n.prototype.egcd=function(u){r(u.negative===0),r(!u.isZero());var f=this,p=u.clone();f.negative!==0?f=f.umod(u):f=f.clone();for(var m=new n(1),y=new n(0),x=new n(0),I=new n(1),_=0;f.isEven()&&p.isEven();)f.iushrn(1),p.iushrn(1),++_;for(var d=p.clone(),b=f.clone();!f.isZero();){for(var B=0,V=1;(f.words[0]&V)===0&&B<26;++B,V<<=1);if(B>0)for(f.iushrn(B);B-- >0;)(m.isOdd()||y.isOdd())&&(m.iadd(d),y.isub(b)),m.iushrn(1),y.iushrn(1);for(var W=0,re=1;(p.words[0]&re)===0&&W<26;++W,re<<=1);if(W>0)for(p.iushrn(W);W-- >0;)(x.isOdd()||I.isOdd())&&(x.iadd(d),I.isub(b)),x.iushrn(1),I.iushrn(1);f.cmp(p)>=0?(f.isub(p),m.isub(x),y.isub(I)):(p.isub(f),x.isub(m),I.isub(y))}return{a:x,b:I,gcd:p.iushln(_)}},n.prototype._invmp=function(u){r(u.negative===0),r(!u.isZero());var f=this,p=u.clone();f.negative!==0?f=f.umod(u):f=f.clone();for(var m=new n(1),y=new n(0),x=p.clone();f.cmpn(1)>0&&p.cmpn(1)>0;){for(var I=0,_=1;(f.words[0]&_)===0&&I<26;++I,_<<=1);if(I>0)for(f.iushrn(I);I-- >0;)m.isOdd()&&m.iadd(x),m.iushrn(1);for(var d=0,b=1;(p.words[0]&b)===0&&d<26;++d,b<<=1);if(d>0)for(p.iushrn(d);d-- >0;)y.isOdd()&&y.iadd(x),y.iushrn(1);f.cmp(p)>=0?(f.isub(p),m.isub(y)):(p.isub(f),y.isub(m))}var B;return f.cmpn(1)===0?B=m:B=y,B.cmpn(0)<0&&B.iadd(u),B},n.prototype.gcd=function(u){if(this.isZero())return u.abs();if(u.isZero())return this.abs();var f=this.clone(),p=u.clone();f.negative=0,p.negative=0;for(var m=0;f.isEven()&&p.isEven();m++)f.iushrn(1),p.iushrn(1);do{for(;f.isEven();)f.iushrn(1);for(;p.isEven();)p.iushrn(1);var y=f.cmp(p);if(y<0){var x=f;f=p,p=x}else if(y===0||p.cmpn(1)===0)break;f.isub(p)}while(!0);return p.iushln(m)},n.prototype.invm=function(u){return this.egcd(u).a.umod(u)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(u){return this.words[0]&u},n.prototype.bincn=function(u){r(typeof u=="number");var f=u%26,p=(u-f)/26,m=1<<f;if(this.length<=p)return this._expand(p+1),this.words[p]|=m,this;for(var y=m,x=p;y!==0&&x<this.length;x++){var I=this.words[x]|0;I+=y,y=I>>>26,I&=67108863,this.words[x]=I}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(u){var f=u<0;if(this.negative!==0&&!f)return-1;if(this.negative===0&&f)return 1;this._strip();var p;if(this.length>1)p=1;else{f&&(u=-u),r(u<=67108863,"Number is too big");var m=this.words[0]|0;p=m===u?0:m<u?-1:1}return this.negative!==0?-p|0:p},n.prototype.cmp=function(u){if(this.negative!==0&&u.negative===0)return-1;if(this.negative===0&&u.negative!==0)return 1;var f=this.ucmp(u);return this.negative!==0?-f|0:f},n.prototype.ucmp=function(u){if(this.length>u.length)return 1;if(this.length<u.length)return-1;for(var f=0,p=this.length-1;p>=0;p--){var m=this.words[p]|0,y=u.words[p]|0;if(m!==y){m<y?f=-1:m>y&&(f=1);break}}return f},n.prototype.gtn=function(u){return this.cmpn(u)===1},n.prototype.gt=function(u){return this.cmp(u)===1},n.prototype.gten=function(u){return this.cmpn(u)>=0},n.prototype.gte=function(u){return this.cmp(u)>=0},n.prototype.ltn=function(u){return this.cmpn(u)===-1},n.prototype.lt=function(u){return this.cmp(u)===-1},n.prototype.lten=function(u){return this.cmpn(u)<=0},n.prototype.lte=function(u){return this.cmp(u)<=0},n.prototype.eqn=function(u){return this.cmpn(u)===0},n.prototype.eq=function(u){return this.cmp(u)===0},n.red=function(u){return new oe(u)},n.prototype.toRed=function(u){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),u.convertTo(this)._forceRed(u)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(u){return this.red=u,this},n.prototype.forceRed=function(u){return r(!this.red,"Already a number in reduction context"),this._forceRed(u)},n.prototype.redAdd=function(u){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,u)},n.prototype.redIAdd=function(u){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,u)},n.prototype.redSub=function(u){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,u)},n.prototype.redISub=function(u){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,u)},n.prototype.redShl=function(u){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,u)},n.prototype.redMul=function(u){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,u),this.red.mul(this,u)},n.prototype.redIMul=function(u){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,u),this.red.imul(this,u)},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(u){return r(this.red&&!u.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,u)};var ee={k256:null,p224:null,p192:null,p25519:null};function X(S,u){this.name=S,this.p=new n(u,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}X.prototype._tmp=function(){var u=new n(null);return u.words=new Array(Math.ceil(this.n/13)),u},X.prototype.ireduce=function(u){var f=u,p;do this.split(f,this.tmp),f=this.imulK(f),f=f.iadd(this.tmp),p=f.bitLength();while(p>this.n);var m=p<this.n?-1:f.ucmp(this.p);return m===0?(f.words[0]=0,f.length=1):m>0?f.isub(this.p):f.strip!==void 0?f.strip():f._strip(),f},X.prototype.split=function(u,f){u.iushrn(this.n,0,f)},X.prototype.imulK=function(u){return u.imul(this.k)};function Q(){X.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(Q,X),Q.prototype.split=function(u,f){for(var p=4194303,m=Math.min(u.length,9),y=0;y<m;y++)f.words[y]=u.words[y];if(f.length=m,u.length<=9){u.words[0]=0,u.length=1;return}var x=u.words[9];for(f.words[f.length++]=x&p,y=10;y<u.length;y++){var I=u.words[y]|0;u.words[y-10]=(I&p)<<4|x>>>22,x=I}x>>>=22,u.words[y-10]=x,x===0&&u.length>10?u.length-=10:u.length-=9},Q.prototype.imulK=function(u){u.words[u.length]=0,u.words[u.length+1]=0,u.length+=2;for(var f=0,p=0;p<u.length;p++){var m=u.words[p]|0;f+=m*977,u.words[p]=f&67108863,f=m*64+(f/67108864|0)}return u.words[u.length-1]===0&&(u.length--,u.words[u.length-1]===0&&u.length--),u};function ie(){X.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(ie,X);function te(){X.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(te,X);function $e(){X.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i($e,X),$e.prototype.imulK=function(u){for(var f=0,p=0;p<u.length;p++){var m=(u.words[p]|0)*19+f,y=m&67108863;m>>>=26,u.words[p]=y,f=m}return f!==0&&(u.words[u.length++]=f),u},n._prime=function(u){if(ee[u])return ee[u];var f;if(u==="k256")f=new Q;else if(u==="p224")f=new ie;else if(u==="p192")f=new te;else if(u==="p25519")f=new $e;else throw new Error("Unknown prime "+u);return ee[u]=f,f};function oe(S){if(typeof S=="string"){var u=n._prime(S);this.m=u.p,this.prime=u}else r(S.gtn(1),"modulus must be greater than 1"),this.m=S,this.prime=null}oe.prototype._verify1=function(u){r(u.negative===0,"red works only with positives"),r(u.red,"red works only with red numbers")},oe.prototype._verify2=function(u,f){r((u.negative|f.negative)===0,"red works only with positives"),r(u.red&&u.red===f.red,"red works only with red numbers")},oe.prototype.imod=function(u){return this.prime?this.prime.ireduce(u)._forceRed(this):(l(u,u.umod(this.m)._forceRed(this)),u)},oe.prototype.neg=function(u){return u.isZero()?u.clone():this.m.sub(u)._forceRed(this)},oe.prototype.add=function(u,f){this._verify2(u,f);var p=u.add(f);return p.cmp(this.m)>=0&&p.isub(this.m),p._forceRed(this)},oe.prototype.iadd=function(u,f){this._verify2(u,f);var p=u.iadd(f);return p.cmp(this.m)>=0&&p.isub(this.m),p},oe.prototype.sub=function(u,f){this._verify2(u,f);var p=u.sub(f);return p.cmpn(0)<0&&p.iadd(this.m),p._forceRed(this)},oe.prototype.isub=function(u,f){this._verify2(u,f);var p=u.isub(f);return p.cmpn(0)<0&&p.iadd(this.m),p},oe.prototype.shl=function(u,f){return this._verify1(u),this.imod(u.ushln(f))},oe.prototype.imul=function(u,f){return this._verify2(u,f),this.imod(u.imul(f))},oe.prototype.mul=function(u,f){return this._verify2(u,f),this.imod(u.mul(f))},oe.prototype.isqr=function(u){return this.imul(u,u.clone())},oe.prototype.sqr=function(u){return this.mul(u,u)},oe.prototype.sqrt=function(u){if(u.isZero())return u.clone();var f=this.m.andln(3);if(r(f%2===1),f===3){var p=this.m.add(new n(1)).iushrn(2);return this.pow(u,p)}for(var m=this.m.subn(1),y=0;!m.isZero()&&m.andln(1)===0;)y++,m.iushrn(1);r(!m.isZero());var x=new n(1).toRed(this),I=x.redNeg(),_=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new n(2*d*d).toRed(this);this.pow(d,_).cmp(I)!==0;)d.redIAdd(I);for(var b=this.pow(d,m),B=this.pow(u,m.addn(1).iushrn(1)),V=this.pow(u,m),W=y;V.cmp(x)!==0;){for(var re=V,ce=0;re.cmp(x)!==0;ce++)re=re.redSqr();r(ce<W);var fe=this.pow(b,new n(1).iushln(W-ce-1));B=B.redMul(fe),b=fe.redSqr(),V=V.redMul(b),W=ce}return B},oe.prototype.invm=function(u){var f=u._invmp(this.m);return f.negative!==0?(f.negative=0,this.imod(f).redNeg()):this.imod(f)},oe.prototype.pow=function(u,f){if(f.isZero())return new n(1).toRed(this);if(f.cmpn(1)===0)return u.clone();var p=4,m=new Array(1<<p);m[0]=new n(1).toRed(this),m[1]=u;for(var y=2;y<m.length;y++)m[y]=this.mul(m[y-1],u);var x=m[0],I=0,_=0,d=f.bitLength()%26;for(d===0&&(d=26),y=f.length-1;y>=0;y--){for(var b=f.words[y],B=d-1;B>=0;B--){var V=b>>B&1;if(x!==m[0]&&(x=this.sqr(x)),V===0&&I===0){_=0;continue}I<<=1,I|=V,_++,!(_!==p&&(y!==0||B!==0))&&(x=this.mul(x,m[I]),_=0,I=0)}d=26}return x},oe.prototype.convertTo=function(u){var f=u.umod(this.m);return f===u?f.clone():f},oe.prototype.convertFrom=function(u){var f=u.clone();return f.red=null,f},n.mont=function(u){return new he(u)};function he(S){oe.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(he,oe),he.prototype.convertTo=function(u){return this.imod(u.ushln(this.shift))},he.prototype.convertFrom=function(u){var f=this.imod(u.mul(this.rinv));return f.red=null,f},he.prototype.imul=function(u,f){if(u.isZero()||f.isZero())return u.words[0]=0,u.length=1,u;var p=u.imul(f),m=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=p.isub(m).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)},he.prototype.mul=function(u,f){if(u.isZero()||f.isZero())return new n(0)._forceRed(this);var p=u.mul(f),m=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=p.isub(m).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)},he.prototype.invm=function(u){var f=this.imod(u._invmp(this.m).mul(this.r2));return f._forceRed(this)}})(typeof Rg>"u"||Rg,Cw)});var jw=Xt(($g,Mw)=>{var ru=na(),zr=ru.Buffer;function Dw(t,e){for(var r in t)e[r]=t[r]}zr.from&&zr.alloc&&zr.allocUnsafe&&zr.allocUnsafeSlow?Mw.exports=ru:(Dw(ru,$g),$g.Buffer=ei);function ei(t,e,r){return zr(t,e,r)}ei.prototype=Object.create(zr.prototype);Dw(zr,ei);ei.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return zr(t,e,r)};ei.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=zr(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i};ei.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return zr(t)};ei.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return ru.SlowBuffer(t)}});var Zw=Xt((GB,Fw)=>{"use strict";var nu=jw().Buffer;function rA(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 a=t.length,s=t.charAt(0),c=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function h(v){if((Array.isArray(v)||v instanceof Uint8Array)&&(v=nu.from(v)),!nu.isBuffer(v))throw new TypeError("Expected Buffer");if(v.length===0)return"";for(var $=0,k=0,R=0,z=v.length;R!==z&&v[R]===0;)R++,$++;for(var F=(z-R)*l+1>>>0,P=new Uint8Array(F);R!==z;){for(var C=v[R],ee=0,X=F-1;(C!==0||ee<k)&&X!==-1;X--,ee++)C+=256*P[X]>>>0,P[X]=C%a>>>0,C=C/a>>>0;if(C!==0)throw new Error("Non-zero carry");k=ee,R++}for(var Q=F-k;Q!==F&&P[Q]===0;)Q++;for(var ie=s.repeat($);Q<F;++Q)ie+=t.charAt(P[Q]);return ie}function g(v){if(typeof v!="string")throw new TypeError("Expected String");if(v.length===0)return nu.alloc(0);for(var $=0,k=0,R=0;v[$]===s;)k++,$++;for(var z=(v.length-$)*c+1>>>0,F=new Uint8Array(z);$<v.length;){var P=v.charCodeAt($);if(P>255)return;var C=e[P];if(C===255)return;for(var ee=0,X=z-1;(C!==0||ee<R)&&X!==-1;X--,ee++)C+=a*F[X]>>>0,F[X]=C%256>>>0,C=C/256>>>0;if(C!==0)throw new Error("Non-zero carry");R=ee,$++}for(var Q=z-R;Q!==z&&F[Q]===0;)Q++;var ie=nu.allocUnsafe(k+(z-Q));ie.fill(0,0,k);for(var te=k;Q!==z;)ie[te++]=F[Q++];return ie}function w(v){var $=g(v);if($)return $;throw new Error("Non-base"+a+" character")}return{encode:h,decodeUnsafe:g,decode:w}}Fw.exports=rA});var Og=Xt((HB,Vw)=>{var nA=Zw(),iA="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";Vw.exports=nA(iA)});var Kw=Xt(Lg=>{"use strict";function Gr(t,e,r){return e<=t&&t<=r}function cu(t){if(t===void 0)return{};if(t===Object(t))return t;throw TypeError("Could not convert argument to dictionary")}function aA(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 a=t.charCodeAt(i+1);if(56320<=a&&a<=57343){var s=o&1023,c=a&1023;n.push(65536+(s<<10)+c),i+=1}else n.push(65533)}i+=1}return n}function sA(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 iu=-1;function Pg(t){this.tokens=[].slice.call(t)}Pg.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():iu},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 ao=-1;function Ng(t,e){if(t)throw TypeError("Decoder error");return e||65533}var ou="utf-8";function au(t,e){if(!(this instanceof au))return new au(t,e);if(t=t!==void 0?String(t).toLowerCase():ou,t!==ou)throw new Error("Encoding not supported. Only utf-8 is supported");e=cu(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})}au.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=cu(r),this._streaming||(this._decoder=new cA({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!r.stream;for(var n=new Pg(i),o=[],a;!n.endOfStream()&&(a=this._decoder.handler(n,n.read()),a!==ao);)a!==null&&(Array.isArray(a)?o.push.apply(o,a):o.push(a));if(!this._streaming){do{if(a=this._decoder.handler(n,n.read()),a===ao)break;a!==null&&(Array.isArray(a)?o.push.apply(o,a):o.push(a))}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),sA(o)}};function su(t,e){if(!(this instanceof su))return new su(t,e);if(t=t!==void 0?String(t).toLowerCase():ou,t!==ou)throw new Error("Encoding not supported. Only utf-8 is supported");e=cu(e),this._streaming=!1,this._encoder=null,this._options={fatal:!!e.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}su.prototype={encode:function(e,r){e=e?String(e):"",r=cu(r),this._streaming||(this._encoder=new uA(this._options)),this._streaming=!!r.stream;for(var i=[],n=new Pg(aA(e)),o;!n.endOfStream()&&(o=this._encoder.handler(n,n.read()),o!==ao);)Array.isArray(o)?i.push.apply(i,o):i.push(o);if(!this._streaming){for(;o=this._encoder.handler(n,n.read()),o!==ao;)Array.isArray(o)?i.push.apply(i,o):i.push(o);this._encoder=null}return new Uint8Array(i)}};function cA(t){var e=t.fatal,r=0,i=0,n=0,o=128,a=191;this.handler=function(s,c){if(c===iu&&n!==0)return n=0,Ng(e);if(c===iu)return ao;if(n===0){if(Gr(c,0,127))return c;if(Gr(c,194,223))n=1,r=c-192;else if(Gr(c,224,239))c===224&&(o=160),c===237&&(a=159),n=2,r=c-224;else if(Gr(c,240,244))c===240&&(o=144),c===244&&(a=143),n=3,r=c-240;else return Ng(e);return r=r<<6*n,null}if(!Gr(c,o,a))return r=n=i=0,o=128,a=191,s.prepend(c),Ng(e);if(o=128,a=191,i+=1,r+=c-128<<6*(n-i),i!==n)return null;var l=r;return r=n=i=0,l}}function uA(t){var e=t.fatal;this.handler=function(r,i){if(i===iu)return ao;if(Gr(i,0,127))return i;var n,o;Gr(i,128,2047)?(n=1,o=192):Gr(i,2048,65535)?(n=2,o=224):Gr(i,65536,1114111)&&(n=3,o=240);for(var a=[(i>>6*n)+o];n>0;){var s=i>>6*(n-1);a.push(128|s&63),n-=1}return a}}Lg.TextEncoder=su;Lg.TextDecoder=au});var Jw=Xt(Pe=>{"use strict";var lA=Pe&&Pe.__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]}),dA=Pe&&Pe.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Br=Pe&&Pe.__decorate||function(t,e,r,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(n<3?a(o):n>3?a(e,r,o):a(e,r))||o);return n>3&&o&&Object.defineProperty(e,r,o),o},fA=Pe&&Pe.__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)&&lA(e,t,r);return dA(e,t),e},Ww=Pe&&Pe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Pe,"__esModule",{value:!0});Pe.deserializeUnchecked=Pe.deserialize=Pe.serialize=Pe.BinaryReader=Pe.BinaryWriter=Pe.BorshError=Pe.baseDecode=Pe.baseEncode=void 0;var En=Ww(Ag()),qw=Ww(Og()),hA=fA(Kw()),pA=typeof TextDecoder!="function"?hA.TextDecoder:TextDecoder,mA=new pA("utf-8",{fatal:!0});function gA(t){return typeof t=="string"&&(t=Buffer.from(t,"utf8")),qw.default.encode(Buffer.from(t))}Pe.baseEncode=gA;function yA(t){return Buffer.from(qw.default.decode(t))}Pe.baseDecode=yA;var zg=1024,Nt=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(".")}};Pe.BorshError=Nt;var uu=class{constructor(){this.buf=Buffer.alloc(zg),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=Buffer.concat([this.buf,Buffer.alloc(zg)]))}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 En.default(e).toArray("le",8)))}writeU128(e){this.maybeResize(),this.writeBuffer(Buffer.from(new En.default(e).toArray("le",16)))}writeU256(e){this.maybeResize(),this.writeBuffer(Buffer.from(new En.default(e).toArray("le",32)))}writeU512(e){this.maybeResize(),this.writeBuffer(Buffer.from(new En.default(e).toArray("le",64)))}writeBuffer(e){this.buf=Buffer.concat([Buffer.from(this.buf.subarray(0,this.length)),e,Buffer.alloc(zg)]),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)}};Pe.BinaryWriter=uu;function Ur(t,e,r){let i=r.value;r.value=function(...n){try{return i.apply(this,n)}catch(o){if(o instanceof RangeError){let a=o.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(a)>=0)throw new Nt("Reached the end of buffer when deserializing")}throw o}}}var Ht=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 En.default(e,"le")}readU128(){let e=this.readBuffer(16);return new En.default(e,"le")}readU256(){let e=this.readBuffer(32);return new En.default(e,"le")}readU512(){let e=this.readBuffer(64);return new En.default(e,"le")}readBuffer(e){if(this.offset+e>this.buf.length)throw new Nt(`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 mA.decode(r)}catch(i){throw new Nt(`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}};Br([Ur],Ht.prototype,"readU8",null);Br([Ur],Ht.prototype,"readU16",null);Br([Ur],Ht.prototype,"readU32",null);Br([Ur],Ht.prototype,"readU64",null);Br([Ur],Ht.prototype,"readU128",null);Br([Ur],Ht.prototype,"readU256",null);Br([Ur],Ht.prototype,"readU512",null);Br([Ur],Ht.prototype,"readString",null);Br([Ur],Ht.prototype,"readFixedArray",null);Br([Ur],Ht.prototype,"readArray",null);Pe.BinaryReader=Ht;function Gw(t){return t.charAt(0).toUpperCase()+t.slice(1)}function ti(t,e,r,i,n){try{if(typeof i=="string")n[`write${Gw(i)}`](r);else if(i instanceof Array)if(typeof i[0]=="number"){if(r.length!==i[0])throw new Nt(`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 Nt(`Expecting byte array of length ${i[1]}, but got ${r.length} bytes`);for(let o=0;o<i[1];o++)ti(t,null,r[o],i[0],n)}else n.writeArray(r,o=>{ti(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),ti(t,e,r,i.type,n));break}case"map":{n.writeU32(r.size),r.forEach((o,a)=>{ti(t,e,a,i.key,n),ti(t,e,o,i.value,n)});break}default:throw new Nt(`FieldType ${i} unrecognized`)}else Hw(t,r,n)}catch(o){throw o instanceof Nt&&o.addToFieldPath(e),o}}function Hw(t,e,r){if(typeof e.borshSerialize=="function"){e.borshSerialize(r);return}let i=t.get(e.constructor);if(!i)throw new Nt(`Class ${e.constructor.name} is missing in schema`);if(i.kind==="struct")i.fields.map(([n,o])=>{ti(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[a,s]=i.values[o];if(a===n){r.writeU8(o),ti(t,a,e[a],s,r);break}}}else throw new Nt(`Unexpected schema kind: ${i.kind} for ${e.constructor.name}`)}function _A(t,e,r=uu){let i=new r;return Hw(t,e,i),i.toArray()}Pe.serialize=_A;function ri(t,e,r,i){try{if(typeof r=="string")return i[`read${Gw(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(ri(t,null,r[0],i));return n}else return i.readArray(()=>ri(t,e,r[0],i))}if(r.kind==="option")return i.readU8()?ri(t,e,r.type,i):void 0;if(r.kind==="map"){let n=new Map,o=i.readU32();for(let a=0;a<o;a++){let s=ri(t,e,r.key,i),c=ri(t,e,r.value,i);n.set(s,c)}return n}return Bg(t,r,i)}catch(n){throw n instanceof Nt&&n.addToFieldPath(e),n}}function Bg(t,e,r){if(typeof e.borshDeserialize=="function")return e.borshDeserialize(r);let i=t.get(e);if(!i)throw new Nt(`Class ${e.name} is missing in schema`);if(i.kind==="struct"){let n={};for(let[o,a]of t.get(e).fields)n[o]=ri(t,o,a,r);return new e(n)}if(i.kind==="enum"){let n=r.readU8();if(n>=i.values.length)throw new Nt(`Enum index: ${n} is out of range`);let[o,a]=i.values[n],s=ri(t,o,a,r);return new e({[o]:s})}throw new Nt(`Unexpected schema kind: ${i.kind} for ${e.constructor.name}`)}function vA(t,e,r,i=Ht){let n=new i(r),o=Bg(t,e,n);if(n.offset<r.length)throw new Nt(`Unexpected ${r.length-n.offset} bytes after deserialized data`);return o}Pe.deserialize=vA;function bA(t,e,r,i=Ht){let n=new i(r);return Bg(t,e,n)}Pe.deserializeUnchecked=bA});var Mg=Xt(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});T.s16=T.s8=T.nu64be=T.u48be=T.u40be=T.u32be=T.u24be=T.u16be=T.nu64=T.u48=T.u40=T.u32=T.u24=T.u16=T.u8=T.offset=T.greedy=T.Constant=T.UTF8=T.CString=T.Blob=T.Boolean=T.BitField=T.BitStructure=T.VariantLayout=T.Union=T.UnionLayoutDiscriminator=T.UnionDiscriminator=T.Structure=T.Sequence=T.DoubleBE=T.Double=T.FloatBE=T.Float=T.NearInt64BE=T.NearInt64=T.NearUInt64BE=T.NearUInt64=T.IntBE=T.Int=T.UIntBE=T.UInt=T.OffsetLayout=T.GreedyCount=T.ExternalLayout=T.bindConstructorLayout=T.nameWithProperty=T.Layout=T.uint8ArrayToBuffer=T.checkUint8Array=void 0;T.constant=T.utf8=T.cstr=T.blob=T.unionLayoutDiscriminator=T.union=T.seq=T.bits=T.struct=T.f64be=T.f64=T.f32be=T.f32=T.ns64be=T.s48be=T.s40be=T.s32be=T.s24be=T.s16be=T.ns64=T.s48=T.s40=T.s32=T.s24=void 0;var Cg=na();function uo(t){if(!(t instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}T.checkUint8Array=uo;function Se(t){return uo(t),Cg.Buffer.from(t.buffer,t.byteOffset,t.length)}T.uint8ArrayToBuffer=Se;var Ee=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){}};T.Layout=Ee;function Dg(t,e){return e.property?t+"["+e.property+"]":t}T.nameWithProperty=Dg;function wA(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 Ee))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})}T.bindConstructorLayout=wA;var Ut=class extends Ee{isCount(){throw new Error("ExternalLayout is abstract")}};T.ExternalLayout=Ut;var lu=class extends Ut{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){uo(e);let i=e.length-r;return Math.floor(i/this.elementSpan)}encode(e,r,i){return 0}};T.GreedyCount=lu;var ua=class extends Ut{constructor(e,r=0,i){if(!(e instanceof Ee))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 or||this.layout instanceof ur}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)}};T.OffsetLayout=ua;var or=class extends Ee{constructor(e,r){if(super(e,r),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,r=0){return Se(e).readUIntLE(r,this.span)}encode(e,r,i=0){return Se(r).writeUIntLE(e,i,this.span),this.span}};T.UInt=or;var ur=class extends Ee{constructor(e,r){if(super(e,r),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,r=0){return Se(e).readUIntBE(r,this.span)}encode(e,r,i=0){return Se(r).writeUIntBE(e,i,this.span),this.span}};T.UIntBE=ur;var Hr=class extends Ee{constructor(e,r){if(super(e,r),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,r=0){return Se(e).readIntLE(r,this.span)}encode(e,r,i=0){return Se(r).writeIntLE(e,i,this.span),this.span}};T.Int=Hr;var In=class extends Ee{constructor(e,r){if(super(e,r),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,r=0){return Se(e).readIntBE(r,this.span)}encode(e,r,i=0){return Se(r).writeIntBE(e,i,this.span),this.span}};T.IntBE=In;var Ug=Math.pow(2,32);function Ru(t){let e=Math.floor(t/Ug),r=t-e*Ug;return{hi32:e,lo32:r}}function Au(t,e){return t*Ug+e}var du=class extends Ee{constructor(e){super(8,e)}decode(e,r=0){let i=Se(e),n=i.readUInt32LE(r),o=i.readUInt32LE(r+4);return Au(o,n)}encode(e,r,i=0){let n=Ru(e),o=Se(r);return o.writeUInt32LE(n.lo32,i),o.writeUInt32LE(n.hi32,i+4),8}};T.NearUInt64=du;var fu=class extends Ee{constructor(e){super(8,e)}decode(e,r=0){let i=Se(e),n=i.readUInt32BE(r),o=i.readUInt32BE(r+4);return Au(n,o)}encode(e,r,i=0){let n=Ru(e),o=Se(r);return o.writeUInt32BE(n.hi32,i),o.writeUInt32BE(n.lo32,i+4),8}};T.NearUInt64BE=fu;var hu=class extends Ee{constructor(e){super(8,e)}decode(e,r=0){let i=Se(e),n=i.readUInt32LE(r),o=i.readInt32LE(r+4);return Au(o,n)}encode(e,r,i=0){let n=Ru(e),o=Se(r);return o.writeUInt32LE(n.lo32,i),o.writeInt32LE(n.hi32,i+4),8}};T.NearInt64=hu;var pu=class extends Ee{constructor(e){super(8,e)}decode(e,r=0){let i=Se(e),n=i.readInt32BE(r),o=i.readUInt32BE(r+4);return Au(n,o)}encode(e,r,i=0){let n=Ru(e),o=Se(r);return o.writeInt32BE(n.hi32,i),o.writeUInt32BE(n.lo32,i+4),8}};T.NearInt64BE=pu;var mu=class extends Ee{constructor(e){super(4,e)}decode(e,r=0){return Se(e).readFloatLE(r)}encode(e,r,i=0){return Se(r).writeFloatLE(e,i),4}};T.Float=mu;var gu=class extends Ee{constructor(e){super(4,e)}decode(e,r=0){return Se(e).readFloatBE(r)}encode(e,r,i=0){return Se(r).writeFloatBE(e,i),4}};T.FloatBE=gu;var yu=class extends Ee{constructor(e){super(8,e)}decode(e,r=0){return Se(e).readDoubleLE(r)}encode(e,r,i=0){return Se(r).writeDoubleLE(e,i),8}};T.Double=yu;var _u=class extends Ee{constructor(e){super(8,e)}decode(e,r=0){return Se(e).readDoubleBE(r)}encode(e,r,i=0){return Se(r).writeDoubleBE(e,i),8}};T.DoubleBE=_u;var vu=class extends Ee{constructor(e,r,i){if(!(e instanceof Ee))throw new TypeError("elementLayout must be a Layout");if(!(r instanceof Ut&&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 Ut)&&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 Ut&&(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 Ut&&(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((a,s)=>a+n.encode(s,r,i+a),0);return this.count instanceof Ut&&this.count.encode(e.length,r,i),o}};T.Sequence=vu;var bu=class extends Ee{constructor(e,r,i){if(!(Array.isArray(e)&&e.reduce((o,a)=>o&&a instanceof Ee,!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,a)=>o+a.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 a=o.getSpan(e,r);return r+=a,n+a},0)}catch{throw new RangeError("indeterminate span")}return i}decode(e,r=0){uo(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,a=0;for(let s of this.fields){let c=s.span;if(a=0<c?c:0,s.property!==void 0){let l=e[s.property];l!==void 0&&(a=s.encode(l,r,i),0>c&&(c=s.getSpan(r,i)))}o=i,i+=c}return o+a-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)}}};T.Structure=bu;var la=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")}};T.UnionDiscriminator=la;var co=class extends la{constructor(e,r){if(!(e instanceof Ut&&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)}};T.UnionLayoutDiscriminator=co;var da=class extends Ee{constructor(e,r,i){let n;if(e instanceof or||e instanceof ur)n=new co(new ua(e));else if(e instanceof Ut&&e.isCount())n=new co(e);else if(e instanceof la)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 Ee))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 or||e instanceof ur)&&(o+=n.layout.span)),super(o,i),this.discriminator=n,this.usesPrefixDiscriminator=e instanceof or||e instanceof ur,this.defaultLayout=r,this.registry={};let a=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(s){return a(s)},this.configGetSourceVariant=function(s){a=s.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),a=this.registry[o];if(a===void 0){let s=this.defaultLayout,c=0;this.usesPrefixDiscriminator&&(c=n.layout.span),i=this.makeDestinationObject(),i[n.property]=o,i[s.property]=s.decode(e,r+c)}else i=a.decode(e,r);return i}encode(e,r,i=0){let n=this.getSourceVariant(e);if(n===void 0){let o=this.discriminator,a=this.defaultLayout,s=0;return this.usesPrefixDiscriminator&&(s=o.layout.span),o.encode(e[o.property],r,i),s+a.encode(e[a.property],r,i+s)}return n.encode(e,r,i)}addVariant(e,r,i){let n=new wu(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]}};T.Union=da;var wu=class extends Ee{constructor(e,r,i,n){if(!(e instanceof da))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 Ee))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)}};T.VariantLayout=wu;function so(t){return 0>t&&(t+=4294967296),t}var fa=class extends Ee{constructor(e,r,i){if(!(e instanceof or||e instanceof ur))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=so(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 a=e[o.property];a!==void 0&&o.encode(a)}return this.word.encode(this._packedGetValue(),r,i)}addField(e,r){let i=new ha(this,e,r);return this.fields.push(i),i}addBoolean(e){let r=new xu(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}};T.BitStructure=fa;var ha=class{constructor(e,r,i){if(!(e instanceof fa))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((a,s)=>a+s.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=so(this.valueMask<<this.start),this.property=i}decode(e,r){let i=this.container._packedGetValue();return so(i&this.wordMask)>>>this.start}encode(e){if(typeof e!="number"||!Number.isInteger(e)||e!==so(e&this.valueMask))throw new TypeError(Dg("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);let r=this.container._packedGetValue(),i=so(e<<this.start);this.container._packedSetValue(so(r&~this.wordMask)|i)}};T.BitField=ha;var xu=class extends ha{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)}};T.Boolean=xu;var Su=class extends Ee{constructor(e,r){if(!(e instanceof Ut&&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 Ut||(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)),Se(e).slice(r,r+i)}encode(e,r,i){let n=this.length;if(this.length instanceof Ut&&(n=e.length),!(e instanceof Uint8Array&&n===e.length))throw new TypeError(Dg("Blob.encode",this)+" requires (length "+n+") Uint8Array as src");if(i+n>r.length)throw new RangeError("encoding overruns Uint8Array");let o=Se(e);return Se(r).write(o.toString("hex"),i,n,"hex"),this.length instanceof Ut&&this.length.encode(n,r,i),n}};T.Blob=Su;var Eu=class extends Ee{constructor(e){super(-1,e)}getSpan(e,r=0){uo(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 Se(e).slice(r,r+i-1).toString("utf-8")}encode(e,r,i=0){typeof e!="string"&&(e=String(e));let n=Cg.Buffer.from(e,"utf8"),o=n.length;if(i+o>r.length)throw new RangeError("encoding overruns Buffer");let a=Se(r);return n.copy(a,i),a[i+o]=0,o+1}};T.CString=Eu;var Iu=class extends Ee{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 uo(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 Se(e).slice(r,r+i).toString("utf-8")}encode(e,r,i=0){typeof e!="string"&&(e=String(e));let n=Cg.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(Se(r),i),o}};T.UTF8=Iu;var ku=class extends Ee{constructor(e,r){super(0,r),this.value=e}decode(e,r){return this.value}encode(e,r,i){return 0}};T.Constant=ku;T.greedy=(t,e)=>new lu(t,e);T.offset=(t,e,r)=>new ua(t,e,r);T.u8=t=>new or(1,t);T.u16=t=>new or(2,t);T.u24=t=>new or(3,t);T.u32=t=>new or(4,t);T.u40=t=>new or(5,t);T.u48=t=>new or(6,t);T.nu64=t=>new du(t);T.u16be=t=>new ur(2,t);T.u24be=t=>new ur(3,t);T.u32be=t=>new ur(4,t);T.u40be=t=>new ur(5,t);T.u48be=t=>new ur(6,t);T.nu64be=t=>new fu(t);T.s8=t=>new Hr(1,t);T.s16=t=>new Hr(2,t);T.s24=t=>new Hr(3,t);T.s32=t=>new Hr(4,t);T.s40=t=>new Hr(5,t);T.s48=t=>new Hr(6,t);T.ns64=t=>new hu(t);T.s16be=t=>new In(2,t);T.s24be=t=>new In(3,t);T.s32be=t=>new In(4,t);T.s40be=t=>new In(5,t);T.s48be=t=>new In(6,t);T.ns64be=t=>new pu(t);T.f32=t=>new mu(t);T.f32be=t=>new gu(t);T.f64=t=>new yu(t);T.f64be=t=>new _u(t);T.struct=(t,e,r)=>new bu(t,e,r);T.bits=(t,e,r)=>new fa(t,e,r);T.seq=(t,e,r)=>new vu(t,e,r);T.union=(t,e,r)=>new da(t,e,r);T.unionLayoutDiscriminator=(t,e)=>new co(t,e);T.blob=(t,e)=>new Su(t,e);T.cstr=t=>new Eu(t);T.utf8=(t,e)=>new Iu(t,e);T.constant=(t,e)=>new ku(t,e)});function ga(){if(!Nu&&(Nu=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Nu))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Nu(PN)}var Nu,PN,Yg=Kt(()=>{PN=new Uint8Array(16)});var mx,gx=Kt(()=>{mx=/^(?:[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 LN(t){return typeof t=="string"&&mx.test(t)}var Rn,ya=Kt(()=>{gx();Rn=LN});function zN(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=(Pt[t[e+0]]+Pt[t[e+1]]+Pt[t[e+2]]+Pt[t[e+3]]+"-"+Pt[t[e+4]]+Pt[t[e+5]]+"-"+Pt[t[e+6]]+Pt[t[e+7]]+"-"+Pt[t[e+8]]+Pt[t[e+9]]+"-"+Pt[t[e+10]]+Pt[t[e+11]]+Pt[t[e+12]]+Pt[t[e+13]]+Pt[t[e+14]]+Pt[t[e+15]]).toLowerCase();if(!Rn(r))throw TypeError("Stringified UUID is invalid");return r}var Pt,Pu,An,_a=Kt(()=>{ya();Pt=[];for(Pu=0;Pu<256;++Pu)Pt.push((Pu+256).toString(16).substr(1));An=zN});function BN(t,e,r){var i=e&&r||0,n=e||new Array(16);t=t||{};var o=t.node||yx,a=t.clockseq!==void 0?t.clockseq:Xg;if(o==null||a==null){var s=t.random||(t.rng||ga)();o==null&&(o=yx=[s[0]|1,s[1],s[2],s[3],s[4],s[5]]),a==null&&(a=Xg=(s[6]<<8|s[7])&16383)}var c=t.msecs!==void 0?t.msecs:Date.now(),l=t.nsecs!==void 0?t.nsecs:e0+1,h=c-Qg+(l-e0)/1e4;if(h<0&&t.clockseq===void 0&&(a=a+1&16383),(h<0||c>Qg)&&t.nsecs===void 0&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Qg=c,e0=l,Xg=a,c+=122192928e5;var g=((c&268435455)*1e4+l)%4294967296;n[i++]=g>>>24&255,n[i++]=g>>>16&255,n[i++]=g>>>8&255,n[i++]=g&255;var w=c/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++]=a>>>8|128,n[i++]=a&255;for(var v=0;v<6;++v)n[i+v]=o[v];return e||An(n)}var yx,Xg,Qg,e0,_x,vx=Kt(()=>{Yg();_a();Qg=0,e0=0;_x=BN});function UN(t){if(!Rn(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 Lu,t0=Kt(()=>{ya();Lu=UN});function CN(t){t=unescape(encodeURIComponent(t));for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r));return e}function zu(t,e,r){function i(n,o,a,s){if(typeof n=="string"&&(n=CN(n)),typeof o=="string"&&(o=Lu(o)),o.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var c=new Uint8Array(16+n.length);if(c.set(o),c.set(n,o.length),c=r(c),c[6]=c[6]&15|e,c[8]=c[8]&63|128,a){s=s||0;for(var l=0;l<16;++l)a[s+l]=c[l];return a}return An(c)}try{i.name=t}catch{}return i.DNS=DN,i.URL=MN,i}var DN,MN,r0=Kt(()=>{_a();t0();DN="6ba7b810-9dad-11d1-80b4-00c04fd430c8",MN="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});function jN(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 FN(ZN(VN(t),t.length*8))}function FN(t){for(var e=[],r=t.length*32,i="0123456789abcdef",n=0;n<r;n+=8){var o=t[n>>5]>>>n%32&255,a=parseInt(i.charAt(o>>>4&15)+i.charAt(o&15),16);e.push(a)}return e}function bx(t){return(t+64>>>9<<4)+14+1}function ZN(t,e){t[e>>5]|=128<<e%32,t[bx(e)-1]=e;for(var r=1732584193,i=-271733879,n=-1732584194,o=271733878,a=0;a<t.length;a+=16){var s=r,c=i,l=n,h=o;r=Dt(r,i,n,o,t[a],7,-680876936),o=Dt(o,r,i,n,t[a+1],12,-389564586),n=Dt(n,o,r,i,t[a+2],17,606105819),i=Dt(i,n,o,r,t[a+3],22,-1044525330),r=Dt(r,i,n,o,t[a+4],7,-176418897),o=Dt(o,r,i,n,t[a+5],12,1200080426),n=Dt(n,o,r,i,t[a+6],17,-1473231341),i=Dt(i,n,o,r,t[a+7],22,-45705983),r=Dt(r,i,n,o,t[a+8],7,1770035416),o=Dt(o,r,i,n,t[a+9],12,-1958414417),n=Dt(n,o,r,i,t[a+10],17,-42063),i=Dt(i,n,o,r,t[a+11],22,-1990404162),r=Dt(r,i,n,o,t[a+12],7,1804603682),o=Dt(o,r,i,n,t[a+13],12,-40341101),n=Dt(n,o,r,i,t[a+14],17,-1502002290),i=Dt(i,n,o,r,t[a+15],22,1236535329),r=Mt(r,i,n,o,t[a+1],5,-165796510),o=Mt(o,r,i,n,t[a+6],9,-1069501632),n=Mt(n,o,r,i,t[a+11],14,643717713),i=Mt(i,n,o,r,t[a],20,-373897302),r=Mt(r,i,n,o,t[a+5],5,-701558691),o=Mt(o,r,i,n,t[a+10],9,38016083),n=Mt(n,o,r,i,t[a+15],14,-660478335),i=Mt(i,n,o,r,t[a+4],20,-405537848),r=Mt(r,i,n,o,t[a+9],5,568446438),o=Mt(o,r,i,n,t[a+14],9,-1019803690),n=Mt(n,o,r,i,t[a+3],14,-187363961),i=Mt(i,n,o,r,t[a+8],20,1163531501),r=Mt(r,i,n,o,t[a+13],5,-1444681467),o=Mt(o,r,i,n,t[a+2],9,-51403784),n=Mt(n,o,r,i,t[a+7],14,1735328473),i=Mt(i,n,o,r,t[a+12],20,-1926607734),r=jt(r,i,n,o,t[a+5],4,-378558),o=jt(o,r,i,n,t[a+8],11,-2022574463),n=jt(n,o,r,i,t[a+11],16,1839030562),i=jt(i,n,o,r,t[a+14],23,-35309556),r=jt(r,i,n,o,t[a+1],4,-1530992060),o=jt(o,r,i,n,t[a+4],11,1272893353),n=jt(n,o,r,i,t[a+7],16,-155497632),i=jt(i,n,o,r,t[a+10],23,-1094730640),r=jt(r,i,n,o,t[a+13],4,681279174),o=jt(o,r,i,n,t[a],11,-358537222),n=jt(n,o,r,i,t[a+3],16,-722521979),i=jt(i,n,o,r,t[a+6],23,76029189),r=jt(r,i,n,o,t[a+9],4,-640364487),o=jt(o,r,i,n,t[a+12],11,-421815835),n=jt(n,o,r,i,t[a+15],16,530742520),i=jt(i,n,o,r,t[a+2],23,-995338651),r=Ft(r,i,n,o,t[a],6,-198630844),o=Ft(o,r,i,n,t[a+7],10,1126891415),n=Ft(n,o,r,i,t[a+14],15,-1416354905),i=Ft(i,n,o,r,t[a+5],21,-57434055),r=Ft(r,i,n,o,t[a+12],6,1700485571),o=Ft(o,r,i,n,t[a+3],10,-1894986606),n=Ft(n,o,r,i,t[a+10],15,-1051523),i=Ft(i,n,o,r,t[a+1],21,-2054922799),r=Ft(r,i,n,o,t[a+8],6,1873313359),o=Ft(o,r,i,n,t[a+15],10,-30611744),n=Ft(n,o,r,i,t[a+6],15,-1560198380),i=Ft(i,n,o,r,t[a+13],21,1309151649),r=Ft(r,i,n,o,t[a+4],6,-145523070),o=Ft(o,r,i,n,t[a+11],10,-1120210379),n=Ft(n,o,r,i,t[a+2],15,718787259),i=Ft(i,n,o,r,t[a+9],21,-343485551),r=$n(r,s),i=$n(i,c),n=$n(n,l),o=$n(o,h)}return[r,i,n,o]}function VN(t){if(t.length===0)return[];for(var e=t.length*8,r=new Uint32Array(bx(e)),i=0;i<e;i+=8)r[i>>5]|=(t[i/8]&255)<<i%32;return r}function $n(t,e){var r=(t&65535)+(e&65535),i=(t>>16)+(e>>16)+(r>>16);return i<<16|r&65535}function KN(t,e){return t<<e|t>>>32-e}function Bu(t,e,r,i,n,o){return $n(KN($n($n(e,t),$n(i,o)),n),r)}function Dt(t,e,r,i,n,o,a){return Bu(e&r|~e&i,t,e,n,o,a)}function Mt(t,e,r,i,n,o,a){return Bu(e&i|r&~i,t,e,n,o,a)}function jt(t,e,r,i,n,o,a){return Bu(e^r^i,t,e,n,o,a)}function Ft(t,e,r,i,n,o,a){return Bu(r^(e|~i),t,e,n,o,a)}var wx,xx=Kt(()=>{wx=jN});var WN,Sx,Ex=Kt(()=>{r0();xx();WN=zu("v3",48,wx),Sx=WN});function qN(t,e,r){t=t||{};var i=t.random||(t.rng||ga)();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 An(i)}var Ix,kx=Kt(()=>{Yg();_a();Ix=qN});function GN(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 n0(t,e){return t<<e|t>>>32-e}function HN(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,a=Math.ceil(o/16),s=new Array(a),c=0;c<a;++c){for(var l=new Uint32Array(16),h=0;h<16;++h)l[h]=t[c*64+h*4]<<24|t[c*64+h*4+1]<<16|t[c*64+h*4+2]<<8|t[c*64+h*4+3];s[c]=l}s[a-1][14]=(t.length-1)*8/Math.pow(2,32),s[a-1][14]=Math.floor(s[a-1][14]),s[a-1][15]=(t.length-1)*8&4294967295;for(var g=0;g<a;++g){for(var w=new Uint32Array(80),v=0;v<16;++v)w[v]=s[g][v];for(var $=16;$<80;++$)w[$]=n0(w[$-3]^w[$-8]^w[$-14]^w[$-16],1);for(var k=r[0],R=r[1],z=r[2],F=r[3],P=r[4],C=0;C<80;++C){var ee=Math.floor(C/20),X=n0(k,5)+GN(ee,R,z,F)+P+e[ee]+w[C]>>>0;P=F,F=z,z=n0(R,30)>>>0,R=k,k=X}r[0]=r[0]+k>>>0,r[1]=r[1]+R>>>0,r[2]=r[2]+z>>>0,r[3]=r[3]+F>>>0,r[4]=r[4]+P>>>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 Rx,Ax=Kt(()=>{Rx=HN});var JN,$x,Ox=Kt(()=>{r0();Ax();JN=zu("v5",80,Rx),$x=JN});var Tx,Nx=Kt(()=>{Tx="00000000-0000-0000-0000-000000000000"});function YN(t){if(!Rn(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}var Px,Lx=Kt(()=>{ya();Px=YN});var i0={};Et(i0,{NIL:()=>Tx,parse:()=>Lu,stringify:()=>An,v1:()=>_x,v3:()=>Sx,v4:()=>Ix,v5:()=>$x,validate:()=>Rn,version:()=>Px});var o0=Kt(()=>{vx();Ex();kx();Ox();Nx();Lx();ya();_a();t0()});var Bx=Xt((GU,zx)=>{"use strict";var XN=(o0(),Tl(i0)).v4,QN=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 a=typeof i.generator=="function"?i.generator:function(){return XN()};o.id=a(o,i)}else n===2&&r===null?i.notificationIdNull&&(o.id=null):o.id=r;return o};zx.exports=QN});var Cx=Xt((HU,Ux)=>{"use strict";var e2=(o0(),Tl(i0)).v4,t2=Bx(),va=function(t,e){if(!(this instanceof va))return new va(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 e2()},version:typeof e.version<"u"?e.version:2,notificationIdNull:typeof e.notificationIdNull=="boolean"?e.notificationIdNull:!1},this.callServer=t};Ux.exports=va;va.prototype.request=function(t,e,r,i){let n=this,o=null,a=Array.isArray(t)&&typeof e=="function";if(this.options.version===1&&a)throw new TypeError("JSON-RPC 1.0 does not support batching");if(a||!a&&t&&typeof t=="object"&&typeof e=="function")i=e,o=t;else{typeof r=="function"&&(i=r,r=void 0);let l=typeof i=="function";try{o=t2(t,e,r,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(h){if(l)return i(h);throw h}if(!l)return o}let c;try{c=JSON.stringify(o,this.options.replacer)}catch(l){return i(l)}return this.callServer(c,function(l,h){n._parseResponse(l,h,i)}),o};va.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(a){return typeof a.error<"u"},o=function(a){return!n(a)};return r(null,i.filter(n),i.filter(o))}else return r(null,i.error,i.result);r(null,i)}});var Mx=Xt((JU,a0)=>{"use strict";var r2=Object.prototype.hasOwnProperty,Jt="~";function ba(){}Object.create&&(ba.prototype=Object.create(null),new ba().__proto__||(Jt=!1));function n2(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function Dx(t,e,r,i,n){if(typeof r!="function")throw new TypeError("The listener must be a function");var o=new n2(r,i||t,n),a=Jt?Jt+e:e;return t._events[a]?t._events[a].fn?t._events[a]=[t._events[a],o]:t._events[a].push(o):(t._events[a]=o,t._eventsCount++),t}function Uu(t,e){--t._eventsCount===0?t._events=new ba:delete t._events[e]}function Zt(){this._events=new ba,this._eventsCount=0}Zt.prototype.eventNames=function(){var e=[],r,i;if(this._eventsCount===0)return e;for(i in r=this._events)r2.call(r,i)&&e.push(Jt?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(r)):e};Zt.prototype.listeners=function(e){var r=Jt?Jt+e:e,i=this._events[r];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,o=i.length,a=new Array(o);n<o;n++)a[n]=i[n].fn;return a};Zt.prototype.listenerCount=function(e){var r=Jt?Jt+e:e,i=this._events[r];return i?i.fn?1:i.length:0};Zt.prototype.emit=function(e,r,i,n,o,a){var s=Jt?Jt+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,h,g;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,r),!0;case 3:return c.fn.call(c.context,r,i),!0;case 4:return c.fn.call(c.context,r,i,n),!0;case 5:return c.fn.call(c.context,r,i,n,o),!0;case 6:return c.fn.call(c.context,r,i,n,o,a),!0}for(g=1,h=new Array(l-1);g<l;g++)h[g-1]=arguments[g];c.fn.apply(c.context,h)}else{var w=c.length,v;for(g=0;g<w;g++)switch(c[g].once&&this.removeListener(e,c[g].fn,void 0,!0),l){case 1:c[g].fn.call(c[g].context);break;case 2:c[g].fn.call(c[g].context,r);break;case 3:c[g].fn.call(c[g].context,r,i);break;case 4:c[g].fn.call(c[g].context,r,i,n);break;default:if(!h)for(v=1,h=new Array(l-1);v<l;v++)h[v-1]=arguments[v];c[g].fn.apply(c[g].context,h)}}return!0};Zt.prototype.on=function(e,r,i){return Dx(this,e,r,i,!1)};Zt.prototype.once=function(e,r,i){return Dx(this,e,r,i,!0)};Zt.prototype.removeListener=function(e,r,i,n){var o=Jt?Jt+e:e;if(!this._events[o])return this;if(!r)return Uu(this,o),this;var a=this._events[o];if(a.fn)a.fn===r&&(!n||a.once)&&(!i||a.context===i)&&Uu(this,o);else{for(var s=0,c=[],l=a.length;s<l;s++)(a[s].fn!==r||n&&!a[s].once||i&&a[s].context!==i)&&c.push(a[s]);c.length?this._events[o]=c.length===1?c[0]:c:Uu(this,o)}return this};Zt.prototype.removeAllListeners=function(e){var r;return e?(r=Jt?Jt+e:e,this._events[r]&&Uu(this,r)):(this._events=new ba,this._eventsCount=0),this};Zt.prototype.off=Zt.prototype.removeListener;Zt.prototype.addListener=Zt.prototype.on;Zt.prefixed=Jt;Zt.EventEmitter=Zt;typeof a0<"u"&&(a0.exports=Zt)});var J4={};Et(J4,{AddMiniApp:()=>bi,Back:()=>Ml,ComposeCast:()=>Ey,Context:()=>Py,DEFAULT_READY_OPTIONS:()=>Ll,Errors:()=>vi,Ethereum:()=>Lb,Haptics:()=>Iy,Manifest:()=>jl,OpenMiniApp:()=>ky,QuickAuth:()=>ly,Ready:()=>zl,RequestCameraAndMicrophoneAccess:()=>Ry,SendToken:()=>Ay,SignIn:()=>zn,SignManifest:()=>Bn,SolanaConnection:()=>Yu,SwapToken:()=>$y,ViewCast:()=>Oy,ViewProfile:()=>Ty,ViewToken:()=>Ny,actionLaunchFrameSchema:()=>Sb,actionLaunchMiniAppSchema:()=>Eb,actionSchema:()=>kb,actionViewTokenSchema:()=>Ib,aspectRatioSchema:()=>Zm,buttonSchema:()=>Rb,buttonTitleSchema:()=>ta,caip19TokenSchema:()=>jm,chains:()=>Wb,createSimpleStringSchema:()=>dn,createSolanaWalletProvider:()=>M0,default:()=>H4,descriptionSchema:()=>Db,domainManifestSchema:()=>Ek,domainMiniAppConfigSchema:()=>Wm,domainSchema:()=>Fm,encodedJsonFarcasterSignatureSchema:()=>Vm,eventMiniAppAddedSchema:()=>Ob,eventMiniAppRemovedSchema:()=>Tb,eventNotificationsEnabledSchema:()=>Nb,frameHost:()=>G4,hexColorSchema:()=>Xi,jsonFarcasterSignatureHeaderSchema:()=>vk,miniAppEmbedNextSchema:()=>Ab,miniAppHost:()=>se,miniAppHostCapabilityList:()=>Km,miniAppNameSchema:()=>Yi,noindexSchema:()=>Kb,notificationDetailsSchema:()=>Mc,notificationsDisabledSchema:()=>Pb,ogDescriptionSchema:()=>Vb,ogTitleSchema:()=>Zb,primaryCategories:()=>zb,primaryCategorySchema:()=>Bb,quickAuth:()=>wo,requiredCapabilitiesSchema:()=>Hb,requiredChainsSchema:()=>Gb,safeParseFrameEmbed:()=>bk,safeParseMiniAppEmbed:()=>$b,screenshotUrlsSchema:()=>Mb,sdk:()=>b1,secureUrlSchema:()=>It,sendNotificationRequestSchema:()=>wk,sendNotificationResponseSchema:()=>xk,serverEventSchema:()=>Sk,subtitleSchema:()=>Cb,taglineSchema:()=>Fb,tagsSchema:()=>jb,unwrapSolanaProviderRequest:()=>Z0,versionSchema:()=>Ub,wrapSolanaProviderRequest:()=>f4});var bi={};Et(bi,{InvalidDomainManifest:()=>Nl,RejectedByUser:()=>Pl});var vi={};Et(vi,{BaseError:()=>hr});var hr=class extends Error{name="BaseError";cause;constructor(e,r={}){super(e,r.cause?{cause:r.cause}:void 0),this.cause=r.cause}};var Nl=class extends hr{name="AddMiniApp.InvalidDomainManifest";constructor(){super("Invalid domain manifest")}},Pl=class extends hr{name="AddMiniApp.RejectedByUser";constructor(){super("Add miniapp rejected by user")}};var Ey={};var Iy={};var ky={};var zl={};Et(zl,{DEFAULT_READY_OPTIONS:()=>Ll});var Ll={disableNativeGestures:!1};var Ry={};var Ay={};var zn={};Et(zn,{RejectedByUser:()=>Bl});var Bl=class extends hr{name="SignIn.RejectedByUser";constructor(){super("Sign in rejected by user")}};var Bn={};Et(Bn,{GenericError:()=>Dl,InvalidDomain:()=>Cl,RejectedByUser:()=>Ul});var Ul=class extends hr{name="SignManifest.RejectedByUser";constructor(){super("Sign manifest rejected by user")}},Cl=class extends hr{name="SignManifest.InvalidDomain";constructor(){super("Invalid domain provided")}},Dl=class extends hr{name="SignManifest.GenericError";constructor(e="Manifest signing failed"){super(e)}};var $y={};var Oy={};var Ty={};var Ny={};var Ml={};Et(Ml,{DEFAULT_BACK_STATE:()=>k1});var k1={visible:!1};var Py={};var jl={};Et(jl,{getMiniAppConfig:()=>R1});function R1(t){return t.miniapp||t.frame}var q={};Et(q,{$brand:()=>es,$input:()=>ch,$output:()=>sh,NEVER:()=>Fl,TimePrecision:()=>fh,ZodAny:()=>tm,ZodArray:()=>om,ZodBase64:()=>Rc,ZodBase64URL:()=>Ac,ZodBigInt:()=>Ji,ZodBigIntFormat:()=>Tc,ZodBoolean:()=>Hi,ZodCIDRv4:()=>Ic,ZodCIDRv6:()=>kc,ZodCUID:()=>_c,ZodCUID2:()=>vc,ZodCatch:()=>Rm,ZodCodec:()=>Dc,ZodCustom:()=>ea,ZodCustomStringFormat:()=>qi,ZodDate:()=>Ho,ZodDefault:()=>wm,ZodDiscriminatedUnion:()=>sm,ZodE164:()=>$c,ZodEmail:()=>mc,ZodEmoji:()=>gc,ZodEnum:()=>Ki,ZodError:()=>tk,ZodExactOptional:()=>_m,ZodFile:()=>gm,ZodFirstPartyTypeKind:()=>Dm,ZodFunction:()=>Bm,ZodGUID:()=>Vo,ZodIPv4:()=>Sc,ZodIPv6:()=>Ec,ZodISODate:()=>uc,ZodISODateTime:()=>cc,ZodISODuration:()=>dc,ZodISOTime:()=>lc,ZodIntersection:()=>cm,ZodIssueCode:()=>nk,ZodJWT:()=>Oc,ZodKSUID:()=>xc,ZodLazy:()=>Pm,ZodLiteral:()=>mm,ZodMAC:()=>Gp,ZodMap:()=>hm,ZodNaN:()=>$m,ZodNanoID:()=>yc,ZodNever:()=>nm,ZodNonOptional:()=>Uc,ZodNull:()=>Qp,ZodNullable:()=>bm,ZodNumber:()=>Gi,ZodNumberFormat:()=>Vn,ZodObject:()=>Yo,ZodOptional:()=>Bc,ZodPipe:()=>Cc,ZodPrefault:()=>Sm,ZodPromise:()=>zm,ZodReadonly:()=>Om,ZodRealError:()=>tr,ZodRecord:()=>Qo,ZodSet:()=>pm,ZodString:()=>Wi,ZodStringFormat:()=>Te,ZodSuccess:()=>km,ZodSymbol:()=>Yp,ZodTemplateLiteral:()=>Nm,ZodTransform:()=>ym,ZodTuple:()=>lm,ZodType:()=>pe,ZodULID:()=>bc,ZodURL:()=>Go,ZodUUID:()=>Tr,ZodUndefined:()=>Xp,ZodUnion:()=>Xo,ZodUnknown:()=>rm,ZodVoid:()=>im,ZodXID:()=>wc,ZodXor:()=>am,_ZodString:()=>pc,_default:()=>xm,_function:()=>fb,any:()=>Vv,array:()=>Jo,base64:()=>Rv,base64url:()=>Av,bigint:()=>Dv,boolean:()=>Jp,catch:()=>Am,check:()=>hb,cidrv4:()=>Iv,cidrv6:()=>kv,clone:()=>Wt,codec:()=>ub,coerce:()=>Mm,config:()=>et,core:()=>jr,cuid:()=>yv,cuid2:()=>_v,custom:()=>pb,date:()=>Wv,decode:()=>jp,decodeAsync:()=>Zp,describe:()=>mb,discriminatedUnion:()=>Xv,e164:()=>$v,email:()=>sv,emoji:()=>mv,encode:()=>Mp,encodeAsync:()=>Fp,endsWith:()=>zi,enum:()=>Lc,exactOptional:()=>vm,file:()=>ob,flattenError:()=>To,float32:()=>zv,float64:()=>Bv,formatError:()=>No,fromJSONSchema:()=>xb,function:()=>fb,getErrorMap:()=>ok,globalRegistry:()=>Tt,gt:()=>$r,gte:()=>qt,guid:()=>cv,hash:()=>Lv,hex:()=>Pv,hostname:()=>Nv,httpUrl:()=>pv,includes:()=>Pi,instanceof:()=>yb,int:()=>hc,int32:()=>Uv,int64:()=>Mv,intersection:()=>um,ipv4:()=>xv,ipv6:()=>Ev,iso:()=>Vi,json:()=>vb,jwt:()=>Ov,keyof:()=>qv,ksuid:()=>wv,lazy:()=>Lm,length:()=>Fn,literal:()=>ib,locales:()=>Mo,looseObject:()=>Jv,looseRecord:()=>eb,lowercase:()=>Ti,lt:()=>Ar,lte:()=>cr,mac:()=>Sv,map:()=>tb,maxLength:()=>jn,maxSize:()=>sn,meta:()=>gb,mime:()=>Bi,minLength:()=>Mr,minSize:()=>Or,multipleOf:()=>an,nan:()=>cb,nanoid:()=>gv,nativeEnum:()=>nb,negative:()=>Xs,never:()=>Nc,nonnegative:()=>ec,nonoptional:()=>Im,nonpositive:()=>Qs,normalize:()=>Ui,null:()=>em,nullable:()=>Wo,nullish:()=>ab,number:()=>Hp,object:()=>Gv,optional:()=>Ko,overwrite:()=>br,parse:()=>Bp,parseAsync:()=>Up,partialRecord:()=>Qv,pipe:()=>qo,positive:()=>Ys,prefault:()=>Em,preprocess:()=>bb,prettifyError:()=>ed,promise:()=>db,property:()=>tc,readonly:()=>Tm,record:()=>fm,refine:()=>Um,regex:()=>Oi,regexes:()=>mr,registry:()=>Os,safeDecode:()=>Kp,safeDecodeAsync:()=>qp,safeEncode:()=>Vp,safeEncodeAsync:()=>Wp,safeParse:()=>Cp,safeParseAsync:()=>Dp,set:()=>rb,setErrorMap:()=>ik,size:()=>Mn,slugify:()=>ji,startsWith:()=>Li,strictObject:()=>Hv,string:()=>fc,stringFormat:()=>Tv,stringbool:()=>_b,success:()=>sb,superRefine:()=>Cm,symbol:()=>Fv,templateLiteral:()=>lb,toJSONSchema:()=>oc,toLowerCase:()=>Di,toUpperCase:()=>Mi,transform:()=>zc,treeifyError:()=>Ql,trim:()=>Ci,tuple:()=>dm,uint32:()=>Cv,uint64:()=>jv,ulid:()=>vv,undefined:()=>Zv,union:()=>Pc,unknown:()=>Zn,uppercase:()=>Ni,url:()=>hv,util:()=>j,uuid:()=>uv,uuidv4:()=>lv,uuidv6:()=>dv,uuidv7:()=>fv,void:()=>Kv,xid:()=>bv,xor:()=>Yv});var jr={};Et(jr,{$ZodAny:()=>$f,$ZodArray:()=>Lf,$ZodAsyncError:()=>vr,$ZodBase64:()=>vf,$ZodBase64URL:()=>bf,$ZodBigInt:()=>Ss,$ZodBigIntFormat:()=>If,$ZodBoolean:()=>Bo,$ZodCIDRv4:()=>gf,$ZodCIDRv6:()=>yf,$ZodCUID:()=>nf,$ZodCUID2:()=>of,$ZodCatch:()=>Xf,$ZodCheck:()=>Le,$ZodCheckBigIntFormat:()=>Pd,$ZodCheckEndsWith:()=>Kd,$ZodCheckGreaterThan:()=>gs,$ZodCheckIncludes:()=>Zd,$ZodCheckLengthEquals:()=>Dd,$ZodCheckLessThan:()=>ms,$ZodCheckLowerCase:()=>jd,$ZodCheckMaxLength:()=>Ud,$ZodCheckMaxSize:()=>Ld,$ZodCheckMimeType:()=>qd,$ZodCheckMinLength:()=>Cd,$ZodCheckMinSize:()=>zd,$ZodCheckMultipleOf:()=>Td,$ZodCheckNumberFormat:()=>Nd,$ZodCheckOverwrite:()=>Gd,$ZodCheckProperty:()=>Wd,$ZodCheckRegex:()=>Md,$ZodCheckSizeEquals:()=>Bd,$ZodCheckStartsWith:()=>Vd,$ZodCheckStringFormat:()=>Ai,$ZodCheckUpperCase:()=>Fd,$ZodCodec:()=>Co,$ZodCustom:()=>ah,$ZodCustomStringFormat:()=>Sf,$ZodDate:()=>Pf,$ZodDefault:()=>Gf,$ZodDiscriminatedUnion:()=>Uf,$ZodE164:()=>wf,$ZodEmail:()=>Qd,$ZodEmoji:()=>tf,$ZodEncodeError:()=>en,$ZodEnum:()=>Ff,$ZodError:()=>Oo,$ZodExactOptional:()=>Wf,$ZodFile:()=>Vf,$ZodFunction:()=>nh,$ZodGUID:()=>Yd,$ZodIPv4:()=>hf,$ZodIPv6:()=>pf,$ZodISODate:()=>lf,$ZodISODateTime:()=>uf,$ZodISODuration:()=>ff,$ZodISOTime:()=>df,$ZodIntersection:()=>Cf,$ZodJWT:()=>xf,$ZodKSUID:()=>cf,$ZodLazy:()=>oh,$ZodLiteral:()=>Zf,$ZodMAC:()=>mf,$ZodMap:()=>Mf,$ZodNaN:()=>Qf,$ZodNanoID:()=>rf,$ZodNever:()=>Tf,$ZodNonOptional:()=>Jf,$ZodNull:()=>Af,$ZodNullable:()=>qf,$ZodNumber:()=>xs,$ZodNumberFormat:()=>Ef,$ZodObject:()=>a_,$ZodObjectJIT:()=>zf,$ZodOptional:()=>Is,$ZodPipe:()=>eh,$ZodPrefault:()=>Hf,$ZodPromise:()=>ih,$ZodReadonly:()=>th,$ZodRealError:()=>er,$ZodRecord:()=>Df,$ZodRegistry:()=>$s,$ZodSet:()=>jf,$ZodString:()=>Dn,$ZodStringFormat:()=>Oe,$ZodSuccess:()=>Yf,$ZodSymbol:()=>kf,$ZodTemplateLiteral:()=>rh,$ZodTransform:()=>Kf,$ZodTuple:()=>Es,$ZodType:()=>le,$ZodULID:()=>af,$ZodURL:()=>ef,$ZodUUID:()=>Xd,$ZodUndefined:()=>Rf,$ZodUnion:()=>Uo,$ZodUnknown:()=>Of,$ZodVoid:()=>Nf,$ZodXID:()=>sf,$ZodXor:()=>Bf,$brand:()=>es,$constructor:()=>A,$input:()=>ch,$output:()=>sh,Doc:()=>zo,JSONSchema:()=>ov,JSONSchemaGenerator:()=>ac,NEVER:()=>Fl,TimePrecision:()=>fh,_any:()=>Ph,_array:()=>Mh,_base64:()=>qs,_base64url:()=>Gs,_bigint:()=>kh,_boolean:()=>Eh,_catch:()=>qI,_check:()=>iv,_cidrv4:()=>Ks,_cidrv6:()=>Ws,_coercedBigint:()=>Rh,_coercedBoolean:()=>Ih,_coercedDate:()=>Ch,_coercedNumber:()=>_h,_coercedString:()=>lh,_cuid:()=>Cs,_cuid2:()=>Ds,_custom:()=>Fh,_date:()=>Uh,_decode:()=>as,_decodeAsync:()=>cs,_default:()=>VI,_discriminatedUnion:()=>NI,_e164:()=>Hs,_email:()=>Ts,_emoji:()=>Bs,_encode:()=>os,_encodeAsync:()=>ss,_endsWith:()=>zi,_enum:()=>CI,_file:()=>jh,_float32:()=>bh,_float64:()=>wh,_gt:()=>$r,_gte:()=>qt,_guid:()=>jo,_includes:()=>Pi,_int:()=>vh,_int32:()=>xh,_int64:()=>Ah,_intersection:()=>PI,_ipv4:()=>Zs,_ipv6:()=>Vs,_isoDate:()=>ph,_isoDateTime:()=>hh,_isoDuration:()=>gh,_isoTime:()=>mh,_jwt:()=>Js,_ksuid:()=>Fs,_lazy:()=>YI,_length:()=>Fn,_literal:()=>MI,_lowercase:()=>Ti,_lt:()=>Ar,_lte:()=>cr,_mac:()=>dh,_map:()=>BI,_max:()=>cr,_maxLength:()=>jn,_maxSize:()=>sn,_mime:()=>Bi,_min:()=>qt,_minLength:()=>Mr,_minSize:()=>Or,_multipleOf:()=>an,_nan:()=>Dh,_nanoid:()=>Us,_nativeEnum:()=>DI,_negative:()=>Xs,_never:()=>zh,_nonnegative:()=>ec,_nonoptional:()=>KI,_nonpositive:()=>Qs,_normalize:()=>Ui,_null:()=>Nh,_nullable:()=>ZI,_number:()=>yh,_optional:()=>FI,_overwrite:()=>br,_parse:()=>Ei,_parseAsync:()=>Ii,_pipe:()=>GI,_positive:()=>Ys,_promise:()=>XI,_property:()=>tc,_readonly:()=>HI,_record:()=>zI,_refine:()=>Zh,_regex:()=>Oi,_safeDecode:()=>ls,_safeDecodeAsync:()=>fs,_safeEncode:()=>us,_safeEncodeAsync:()=>ds,_safeParse:()=>ki,_safeParseAsync:()=>Ri,_set:()=>UI,_size:()=>Mn,_slugify:()=>ji,_startsWith:()=>Li,_string:()=>uh,_stringFormat:()=>Fi,_stringbool:()=>qh,_success:()=>WI,_superRefine:()=>Vh,_symbol:()=>Oh,_templateLiteral:()=>JI,_toLowerCase:()=>Di,_toUpperCase:()=>Mi,_transform:()=>jI,_trim:()=>Ci,_tuple:()=>LI,_uint32:()=>Sh,_uint64:()=>$h,_ulid:()=>Ms,_undefined:()=>Th,_union:()=>OI,_unknown:()=>Lh,_uppercase:()=>Ni,_url:()=>Fo,_uuid:()=>Ns,_uuidv4:()=>Ps,_uuidv6:()=>Ls,_uuidv7:()=>zs,_void:()=>Bh,_xid:()=>js,_xor:()=>TI,clone:()=>Wt,config:()=>et,createStandardJSONSchemaMethod:()=>Zi,createToJSONSchemaMethod:()=>Gh,decode:()=>tE,decodeAsync:()=>nE,describe:()=>Kh,encode:()=>eE,encodeAsync:()=>rE,extractDefs:()=>un,finalize:()=>ln,flattenError:()=>To,formatError:()=>No,globalConfig:()=>So,globalRegistry:()=>Tt,initializeContext:()=>cn,isValidBase64:()=>_f,isValidBase64URL:()=>r_,isValidJWT:()=>n_,locales:()=>Mo,meta:()=>Wh,parse:()=>ns,parseAsync:()=>is,prettifyError:()=>ed,process:()=>Re,regexes:()=>mr,registry:()=>Os,safeDecode:()=>oE,safeDecodeAsync:()=>sE,safeEncode:()=>iE,safeEncodeAsync:()=>aE,safeParse:()=>td,safeParseAsync:()=>rd,toDotPath:()=>Cy,toJSONSchema:()=>oc,treeifyError:()=>Ql,util:()=>j,version:()=>Hd});var Fl=Object.freeze({status:"aborted"});function A(t,e,r){function i(s,c){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:c,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(t))return;s._zod.traits.add(t),e(s,c);let l=a.prototype,h=Object.keys(l);for(let g=0;g<h.length;g++){let w=h[g];w in s||(s[w]=l[w].bind(s))}}let n=r?.Parent??Object;class o extends n{}Object.defineProperty(o,"name",{value:t});function a(s){var c;let l=r?.Parent?new o:this;i(l,s),(c=l._zod).deferred??(c.deferred=[]);for(let h of l._zod.deferred)h();return l}return Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(t)}),Object.defineProperty(a,"name",{value:t}),a}var es=Symbol("zod_brand"),vr=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},en=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},So={};function et(t){return t&&Object.assign(So,t),So}var j={};Et(j,{BIGINT_FORMAT_RANGES:()=>Xl,Class:()=>Vl,NUMBER_FORMAT_RANGES:()=>Yl,aborted:()=>on,allowsEval:()=>ql,assert:()=>N1,assertEqual:()=>A1,assertIs:()=>O1,assertNever:()=>T1,assertNotEqual:()=>$1,assignProp:()=>rn,base64ToUint8Array:()=>zy,base64urlToUint8Array:()=>H1,cached:()=>xi,captureStackTrace:()=>rs,cleanEnum:()=>G1,cleanRegex:()=>ko,clone:()=>Wt,cloneDef:()=>L1,createTransparentProxy:()=>M1,defineLazy:()=>_e,esc:()=>ts,escapeRegex:()=>pr,extend:()=>Z1,finalizeIssue:()=>Qt,floatSafeRemainder:()=>Kl,getElementAtPath:()=>z1,getEnumValues:()=>Io,getLengthableOrigin:()=>$o,getParsedType:()=>D1,getSizableOrigin:()=>Ao,hexToUint8Array:()=>Y1,isObject:()=>Un,isPlainObject:()=>nn,issue:()=>Si,joinValues:()=>N,jsonStringifyReplacer:()=>wi,merge:()=>K1,mergeDefs:()=>Dr,normalizeParams:()=>Z,nullish:()=>tn,numKeys:()=>C1,objectClone:()=>P1,omit:()=>F1,optionalKeys:()=>Jl,parsedType:()=>M,partial:()=>W1,pick:()=>j1,prefixIssues:()=>sr,primitiveTypes:()=>Hl,promiseAllObject:()=>B1,propertyKeyTypes:()=>Ro,randomString:()=>U1,required:()=>q1,safeExtend:()=>V1,shallowClone:()=>Gl,slugify:()=>Wl,stringifyPrimitive:()=>D,uint8ArrayToBase64:()=>By,uint8ArrayToBase64url:()=>J1,uint8ArrayToHex:()=>X1,unwrapMessage:()=>Eo});function A1(t){return t}function $1(t){return t}function O1(t){}function T1(t){throw new Error("Unexpected value in exhaustive check")}function N1(t){}function Io(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 N(t,e="|"){return t.map(r=>D(r)).join(e)}function wi(t,e){return typeof e=="bigint"?e.toString():e}function xi(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function tn(t){return t==null}function ko(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function Kl(t,e){let r=(t.toString().split(".")[1]||"").length,i=e.toString(),n=(i.split(".")[1]||"").length;if(n===0&&/\d?e-\d?/.test(i)){let c=i.match(/\d?e-(\d?)/);c?.[1]&&(n=Number.parseInt(c[1]))}let o=r>n?r:n,a=Number.parseInt(t.toFixed(o).replace(".","")),s=Number.parseInt(e.toFixed(o).replace(".",""));return a%s/10**o}var Ly=Symbol("evaluating");function _e(t,e,r){let i;Object.defineProperty(t,e,{get(){if(i!==Ly)return i===void 0&&(i=Ly,i=r()),i},set(n){Object.defineProperty(t,e,{value:n})},configurable:!0})}function P1(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function rn(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Dr(...t){let e={};for(let r of t){let i=Object.getOwnPropertyDescriptors(r);Object.assign(e,i)}return Object.defineProperties({},e)}function L1(t){return Dr(t._zod.def)}function z1(t,e){return e?e.reduce((r,i)=>r?.[i],t):t}function B1(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 U1(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<t;i++)r+=e[Math.floor(Math.random()*e.length)];return r}function ts(t){return JSON.stringify(t)}function Wl(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var rs="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Un(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var ql=xi(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function nn(t){if(Un(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(Un(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Gl(t){return nn(t)?{...t}:Array.isArray(t)?[...t]:t}function C1(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}var D1=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}`)}},Ro=new Set(["string","number","symbol"]),Hl=new Set(["string","number","bigint","boolean","symbol","undefined"]);function pr(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Wt(t,e,r){let i=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(i._zod.parent=t),i}function Z(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 M1(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 D(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function Jl(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}var Yl={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]},Xl={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function j1(t,e){let r=t._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=Dr(t._zod.def,{get shape(){let a={};for(let s in e){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);e[s]&&(a[s]=r.shape[s])}return rn(this,"shape",a),a},checks:[]});return Wt(t,o)}function F1(t,e){let r=t._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=Dr(t._zod.def,{get shape(){let a={...t._zod.def.shape};for(let s in e){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);e[s]&&delete a[s]}return rn(this,"shape",a),a},checks:[]});return Wt(t,o)}function Z1(t,e){if(!nn(e))throw new Error("Invalid input to extend: expected a plain object");let r=t._zod.def.checks;if(r&&r.length>0){let o=t._zod.def.shape;for(let a in e)if(Object.getOwnPropertyDescriptor(o,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=Dr(t._zod.def,{get shape(){let o={...t._zod.def.shape,...e};return rn(this,"shape",o),o}});return Wt(t,n)}function V1(t,e){if(!nn(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=Dr(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e};return rn(this,"shape",i),i}});return Wt(t,r)}function K1(t,e){let r=Dr(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e._zod.def.shape};return rn(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:[]});return Wt(t,r)}function W1(t,e,r){let n=e._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=Dr(e._zod.def,{get shape(){let s=e._zod.def.shape,c={...s};if(r)for(let l in r){if(!(l in s))throw new Error(`Unrecognized key: "${l}"`);r[l]&&(c[l]=t?new t({type:"optional",innerType:s[l]}):s[l])}else for(let l in s)c[l]=t?new t({type:"optional",innerType:s[l]}):s[l];return rn(this,"shape",c),c},checks:[]});return Wt(e,a)}function q1(t,e,r){let i=Dr(e._zod.def,{get shape(){let n=e._zod.def.shape,o={...n};if(r)for(let a in r){if(!(a in o))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(o[a]=new t({type:"nonoptional",innerType:n[a]}))}else for(let a in n)o[a]=new t({type:"nonoptional",innerType:n[a]});return rn(this,"shape",o),o}});return Wt(e,i)}function on(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}function sr(t,e){return e.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(t),r})}function Eo(t){return typeof t=="string"?t:t?.message}function Qt(t,e,r){let i={...t,path:t.path??[]};if(!t.message){let n=Eo(t.inst?._zod.def?.error?.(t))??Eo(e?.error?.(t))??Eo(r.customError?.(t))??Eo(r.localeError?.(t))??"Invalid input";i.message=n}return delete i.inst,delete i.continue,e?.reportInput||delete i.input,i}function Ao(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function $o(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function M(t){let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";let r=t;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return e}function Si(...t){let[e,r,i]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:i}:{...e}}function G1(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function zy(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}function By(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function H1(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return zy(e+r)}function J1(t){return By(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Y1(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(e.length/2);for(let i=0;i<e.length;i+=2)r[i/2]=Number.parseInt(e.slice(i,i+2),16);return r}function X1(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var Vl=class{constructor(...e){}};var Uy=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,wi,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},Oo=A("$ZodError",Uy),er=A("$ZodError",Uy,{Parent:Error});function To(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 No(t,e=r=>r.message){let r={_errors:[]},i=n=>{for(let o of n.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>i({issues:a}));else if(o.code==="invalid_key")i({issues:o.issues});else if(o.code==="invalid_element")i({issues:o.issues});else if(o.path.length===0)r._errors.push(e(o));else{let a=r,s=0;for(;s<o.path.length;){let c=o.path[s];s===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(e(o))):a[c]=a[c]||{_errors:[]},a=a[c],s++}}};return i(t),r}function Ql(t,e=r=>r.message){let r={errors:[]},i=(n,o=[])=>{var a,s;for(let c of n.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(l=>i({issues:l},c.path));else if(c.code==="invalid_key")i({issues:c.issues},c.path);else if(c.code==="invalid_element")i({issues:c.issues},c.path);else{let l=[...o,...c.path];if(l.length===0){r.errors.push(e(c));continue}let h=r,g=0;for(;g<l.length;){let w=l[g],v=g===l.length-1;typeof w=="string"?(h.properties??(h.properties={}),(a=h.properties)[w]??(a[w]={errors:[]}),h=h.properties[w]):(h.items??(h.items=[]),(s=h.items)[w]??(s[w]={errors:[]}),h=h.items[w]),v&&h.errors.push(e(c)),g++}}};return i(t),r}function Cy(t){let e=[],r=t.map(i=>typeof i=="object"?i.key:i);for(let i of r)typeof i=="number"?e.push(`[${i}]`):typeof i=="symbol"?e.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?e.push(`[${JSON.stringify(i)}]`):(e.length&&e.push("."),e.push(i));return e.join("")}function ed(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 ${Cy(i.path)}`);return e.join(`
|
|
2
|
+
`)}var Ei=t=>(e,r,i,n)=>{let o=i?Object.assign(i,{async:!1}):{async:!1},a=e._zod.run({value:r,issues:[]},o);if(a instanceof Promise)throw new vr;if(a.issues.length){let s=new(n?.Err??t)(a.issues.map(c=>Qt(c,o,et())));throw rs(s,n?.callee),s}return a.value},ns=Ei(er),Ii=t=>async(e,r,i,n)=>{let o=i?Object.assign(i,{async:!0}):{async:!0},a=e._zod.run({value:r,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(n?.Err??t)(a.issues.map(c=>Qt(c,o,et())));throw rs(s,n?.callee),s}return a.value},is=Ii(er),ki=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 vr;return o.issues.length?{success:!1,error:new(t??Oo)(o.issues.map(a=>Qt(a,n,et())))}:{success:!0,data:o.value}},td=ki(er),Ri=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(a=>Qt(a,n,et())))}:{success:!0,data:o.value}},rd=Ri(er),os=t=>(e,r,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Ei(t)(e,r,n)},eE=os(er),as=t=>(e,r,i)=>Ei(t)(e,r,i),tE=as(er),ss=t=>async(e,r,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Ii(t)(e,r,n)},rE=ss(er),cs=t=>async(e,r,i)=>Ii(t)(e,r,i),nE=cs(er),us=t=>(e,r,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return ki(t)(e,r,n)},iE=us(er),ls=t=>(e,r,i)=>ki(t)(e,r,i),oE=ls(er),ds=t=>async(e,r,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Ri(t)(e,r,n)},aE=ds(er),fs=t=>async(e,r,i)=>Ri(t)(e,r,i),sE=fs(er);var mr={};Et(mr,{base64:()=>_d,base64url:()=>hs,bigint:()=>Ed,boolean:()=>kd,browserEmail:()=>mE,cidrv4:()=>gd,cidrv6:()=>yd,cuid:()=>nd,cuid2:()=>id,date:()=>bd,datetime:()=>xd,domain:()=>_E,duration:()=>ud,e164:()=>vd,email:()=>dd,emoji:()=>fd,extendedDuration:()=>cE,guid:()=>ld,hex:()=>vE,hostname:()=>yE,html5Email:()=>fE,idnEmail:()=>pE,integer:()=>Id,ipv4:()=>hd,ipv6:()=>pd,ksuid:()=>sd,lowercase:()=>$d,mac:()=>md,md5_base64:()=>wE,md5_base64url:()=>xE,md5_hex:()=>bE,nanoid:()=>cd,null:()=>Rd,number:()=>ps,rfc5322Email:()=>hE,sha1_base64:()=>EE,sha1_base64url:()=>IE,sha1_hex:()=>SE,sha256_base64:()=>RE,sha256_base64url:()=>AE,sha256_hex:()=>kE,sha384_base64:()=>OE,sha384_base64url:()=>TE,sha384_hex:()=>$E,sha512_base64:()=>PE,sha512_base64url:()=>LE,sha512_hex:()=>NE,string:()=>Sd,time:()=>wd,ulid:()=>od,undefined:()=>Ad,unicodeEmail:()=>Dy,uppercase:()=>Od,uuid:()=>Cn,uuid4:()=>uE,uuid6:()=>lE,uuid7:()=>dE,xid:()=>ad});var nd=/^[cC][^\s-]{8,}$/,id=/^[0-9a-z]+$/,od=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ad=/^[0-9a-vA-V]{20}$/,sd=/^[A-Za-z0-9]{27}$/,cd=/^[a-zA-Z0-9_-]{21}$/,ud=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,cE=/^[-+]?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)?)??$/,ld=/^([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})$/,Cn=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|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,uE=Cn(4),lE=Cn(6),dE=Cn(7),dd=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,fE=/^[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])?)*$/,hE=/^(([^<>()\[\]\\.,;:\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,}))$/,Dy=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,pE=Dy,mE=/^[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])?)*$/,gE="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function fd(){return new RegExp(gE,"u")}var hd=/^(?:(?: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])$/,pd=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,md=t=>{let e=pr(t??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},gd=/^((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])$/,yd=/^(([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])$/,_d=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,hs=/^[A-Za-z0-9_-]*$/,yE=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,_E=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,vd=/^\+[1-9]\d{6,14}$/,My="(?:(?:\\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])))",bd=new RegExp(`^${My}$`);function jy(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function wd(t){return new RegExp(`^${jy(t)}$`)}function xd(t){let e=jy({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${e}(?:${r.join("|")})`;return new RegExp(`^${My}T(?:${i})$`)}var Sd=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Ed=/^-?\d+n?$/,Id=/^-?\d+$/,ps=/^-?\d+(?:\.\d+)?$/,kd=/^(?:true|false)$/i,Rd=/^null$/i;var Ad=/^undefined$/i;var $d=/^[^A-Z]*$/,Od=/^[^a-z]*$/,vE=/^[0-9a-fA-F]*$/;function Po(t,e){return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`)}function Lo(t){return new RegExp(`^[A-Za-z0-9_-]{${t}}$`)}var bE=/^[0-9a-fA-F]{32}$/,wE=Po(22,"=="),xE=Lo(22),SE=/^[0-9a-fA-F]{40}$/,EE=Po(27,"="),IE=Lo(27),kE=/^[0-9a-fA-F]{64}$/,RE=Po(43,"="),AE=Lo(43),$E=/^[0-9a-fA-F]{96}$/,OE=Po(64,""),TE=Lo(64),NE=/^[0-9a-fA-F]{128}$/,PE=Po(86,"=="),LE=Lo(86);var Le=A("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),Zy={number:"number",bigint:"bigint",object:"date"},ms=A("$ZodCheckLessThan",(t,e)=>{Le.init(t,e);let r=Zy[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:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),gs=A("$ZodCheckGreaterThan",(t,e)=>{Le.init(t,e);let r=Zy[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:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Td=A("$ZodCheckMultipleOf",(t,e)=>{Le.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):Kl(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})}}),Nd=A("$ZodCheckNumberFormat",(t,e)=>{Le.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),i=r?"int":"number",[n,o]=Yl[e.format];t._zod.onattach.push(a=>{let s=a._zod.bag;s.format=e.format,s.minimum=n,s.maximum=o,r&&(s.pattern=Id)}),t._zod.check=a=>{let s=a.value;if(r){if(!Number.isInteger(s)){a.issues.push({expected:i,format:e.format,code:"invalid_type",continue:!1,input:s,inst:t});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:!0,continue:!e.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:!0,continue:!e.abort});return}}s<n&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:t,continue:!e.abort}),s>o&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:o,inclusive:!0,inst:t,continue:!e.abort})}}),Pd=A("$ZodCheckBigIntFormat",(t,e)=>{Le.init(t,e);let[r,i]=Xl[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,inclusive:!0,inst:t,continue:!e.abort})}}),Ld=A("$ZodCheckMaxSize",(t,e)=>{var r;Le.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!tn(n)&&n.size!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<n&&(i._zod.bag.maximum=e.maximum)}),t._zod.check=i=>{let n=i.value;n.size<=e.maximum||i.issues.push({origin:Ao(n),code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),zd=A("$ZodCheckMinSize",(t,e)=>{var r;Le.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!tn(n)&&n.size!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(i._zod.bag.minimum=e.minimum)}),t._zod.check=i=>{let n=i.value;n.size>=e.minimum||i.issues.push({origin:Ao(n),code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),Bd=A("$ZodCheckSizeEquals",(t,e)=>{var r;Le.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!tn(n)&&n.size!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=e.size,n.maximum=e.size,n.size=e.size}),t._zod.check=i=>{let n=i.value,o=n.size;if(o===e.size)return;let a=o>e.size;i.issues.push({origin:Ao(n),...a?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:i.value,inst:t,continue:!e.abort})}}),Ud=A("$ZodCheckMaxLength",(t,e)=>{var r;Le.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!tn(n)&&n.length!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<n&&(i._zod.bag.maximum=e.maximum)}),t._zod.check=i=>{let n=i.value;if(n.length<=e.maximum)return;let a=$o(n);i.issues.push({origin:a,code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),Cd=A("$ZodCheckMinLength",(t,e)=>{var r;Le.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!tn(n)&&n.length!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(i._zod.bag.minimum=e.minimum)}),t._zod.check=i=>{let n=i.value;if(n.length>=e.minimum)return;let a=$o(n);i.issues.push({origin:a,code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),Dd=A("$ZodCheckLengthEquals",(t,e)=>{var r;Le.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!tn(n)&&n.length!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=e.length,n.maximum=e.length,n.length=e.length}),t._zod.check=i=>{let n=i.value,o=n.length;if(o===e.length)return;let a=$o(n),s=o>e.length;i.issues.push({origin:a,...s?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:i.value,inst:t,continue:!e.abort})}}),Ai=A("$ZodCheckStringFormat",(t,e)=>{var r,i;Le.init(t,e),t._zod.onattach.push(n=>{let o=n._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:e.format,input:n.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(i=t._zod).check??(i.check=()=>{})}),Md=A("$ZodCheckRegex",(t,e)=>{Ai.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})}}),jd=A("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=$d),Ai.init(t,e)}),Fd=A("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=Od),Ai.init(t,e)}),Zd=A("$ZodCheckIncludes",(t,e)=>{Le.init(t,e);let r=pr(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})}}),Vd=A("$ZodCheckStartsWith",(t,e)=>{Le.init(t,e);let r=new RegExp(`^${pr(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})}}),Kd=A("$ZodCheckEndsWith",(t,e)=>{Le.init(t,e);let r=new RegExp(`.*${pr(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 Fy(t,e,r){t.issues.length&&e.issues.push(...sr(r,t.issues))}var Wd=A("$ZodCheckProperty",(t,e)=>{Le.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=>Fy(n,r,e.property));Fy(i,r,e.property)}}),qd=A("$ZodCheckMimeType",(t,e)=>{Le.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,inst:t,continue:!e.abort})}}),Gd=A("$ZodCheckOverwrite",(t,e)=>{Le.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});var zo=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(a=>a),n=Math.min(...i.map(a=>a.length-a.trimStart().length)),o=i.map(a=>a.slice(n)).map(a=>" ".repeat(this.indent*2)+a);for(let a of o)this.content.push(a)}compile(){let e=Function,r=this?.args,n=[...(this?.content??[""]).map(o=>` ${o}`)];return new e(...r,n.join(`
|
|
4
|
+
`))}};var Hd={major:4,minor:3,patch:6};var le=A("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Hd;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=(a,s,c)=>{let l=on(a),h;for(let g of s){if(g._zod.def.when){if(!g._zod.def.when(a))continue}else if(l)continue;let w=a.issues.length,v=g._zod.check(a);if(v instanceof Promise&&c?.async===!1)throw new vr;if(h||v instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await v,a.issues.length!==w&&(l||(l=on(a,w)))});else{if(a.issues.length===w)continue;l||(l=on(a,w))}}return h?h.then(()=>a):a},o=(a,s,c)=>{if(on(a))return a.aborted=!0,a;let l=n(s,i,c);if(l instanceof Promise){if(c.async===!1)throw new vr;return l.then(h=>t._zod.parse(h,c))}return t._zod.parse(l,c)};t._zod.run=(a,s)=>{if(s.skipChecks)return t._zod.parse(a,s);if(s.direction==="backward"){let l=t._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return l instanceof Promise?l.then(h=>o(h,a,s)):o(l,a,s)}let c=t._zod.parse(a,s);if(c instanceof Promise){if(s.async===!1)throw new vr;return c.then(l=>n(l,i,s))}return n(c,i,s)}}_e(t,"~standard",()=>({validate:n=>{try{let o=td(t,n);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return rd(t,n).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),Dn=A("$ZodString",(t,e)=>{le.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Sd(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}}),Oe=A("$ZodStringFormat",(t,e)=>{Ai.init(t,e),Dn.init(t,e)}),Yd=A("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=ld),Oe.init(t,e)}),Xd=A("$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=Cn(i))}else e.pattern??(e.pattern=Cn());Oe.init(t,e)}),Qd=A("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=dd),Oe.init(t,e)}),ef=A("$ZodURL",(t,e)=>{Oe.init(t,e),t._zod.check=r=>{try{let i=r.value.trim(),n=new URL(i);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=n.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),tf=A("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=fd()),Oe.init(t,e)}),rf=A("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=cd),Oe.init(t,e)}),nf=A("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=nd),Oe.init(t,e)}),of=A("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=id),Oe.init(t,e)}),af=A("$ZodULID",(t,e)=>{e.pattern??(e.pattern=od),Oe.init(t,e)}),sf=A("$ZodXID",(t,e)=>{e.pattern??(e.pattern=ad),Oe.init(t,e)}),cf=A("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=sd),Oe.init(t,e)}),uf=A("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=xd(e)),Oe.init(t,e)}),lf=A("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=bd),Oe.init(t,e)}),df=A("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=wd(e)),Oe.init(t,e)}),ff=A("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=ud),Oe.init(t,e)}),hf=A("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=hd),Oe.init(t,e),t._zod.bag.format="ipv4"}),pf=A("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=pd),Oe.init(t,e),t._zod.bag.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})}}}),mf=A("$ZodMAC",(t,e)=>{e.pattern??(e.pattern=md(e.delimiter)),Oe.init(t,e),t._zod.bag.format="mac"}),gf=A("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=gd),Oe.init(t,e)}),yf=A("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=yd),Oe.init(t,e),t._zod.check=r=>{let i=r.value.split("/");try{if(i.length!==2)throw new Error;let[n,o]=i;if(!o)throw new Error;let a=Number(o);if(`${a}`!==o)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function _f(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}var vf=A("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=_d),Oe.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{_f(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function r_(t){if(!hs.test(t))return!1;let e=t.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return _f(r)}var bf=A("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=hs),Oe.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{r_(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),wf=A("$ZodE164",(t,e)=>{e.pattern??(e.pattern=vd),Oe.init(t,e)});function n_(t,e=null){try{let r=t.split(".");if(r.length!==3)return!1;let[i]=r;if(!i)return!1;let 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 xf=A("$ZodJWT",(t,e)=>{Oe.init(t,e),t._zod.check=r=>{n_(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),Sf=A("$ZodCustomStringFormat",(t,e)=>{Oe.init(t,e),t._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:t,continue:!e.abort})}}),xs=A("$ZodNumber",(t,e)=>{le.init(t,e),t._zod.pattern=t._zod.bag.pattern??ps,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}}),Ef=A("$ZodNumberFormat",(t,e)=>{Nd.init(t,e),xs.init(t,e)}),Bo=A("$ZodBoolean",(t,e)=>{le.init(t,e),t._zod.pattern=kd,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}}),Ss=A("$ZodBigInt",(t,e)=>{le.init(t,e),t._zod.pattern=Ed,t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:t}),r}}),If=A("$ZodBigIntFormat",(t,e)=>{Pd.init(t,e),Ss.init(t,e)}),kf=A("$ZodSymbol",(t,e)=>{le.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:t}),r}}),Rf=A("$ZodUndefined",(t,e)=>{le.init(t,e),t._zod.pattern=Ad,t._zod.values=new Set([void 0]),t._zod.optin="optional",t._zod.optout="optional",t._zod.parse=(r,i)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:t}),r}}),Af=A("$ZodNull",(t,e)=>{le.init(t,e),t._zod.pattern=Rd,t._zod.values=new Set([null]),t._zod.parse=(r,i)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:t}),r}}),$f=A("$ZodAny",(t,e)=>{le.init(t,e),t._zod.parse=r=>r}),Of=A("$ZodUnknown",(t,e)=>{le.init(t,e),t._zod.parse=r=>r}),Tf=A("$ZodNever",(t,e)=>{le.init(t,e),t._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),Nf=A("$ZodVoid",(t,e)=>{le.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:t}),r}}),Pf=A("$ZodDate",(t,e)=>{le.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 Ky(t,e,r){t.issues.length&&e.issues.push(...sr(r,t.issues)),e.value[r]=t.value}var Lf=A("$ZodArray",(t,e)=>{le.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 a=0;a<n.length;a++){let s=n[a],c=e.element._zod.run({value:s,issues:[]},i);c instanceof Promise?o.push(c.then(l=>Ky(l,r,a))):Ky(c,r,a)}return o.length?Promise.all(o).then(()=>r):r}});function ws(t,e,r,i,n){if(t.issues.length){if(n&&!(r in i))return;e.issues.push(...sr(r,t.issues))}t.value===void 0?r in i&&(e.value[r]=void 0):e.value[r]=t.value}function i_(t){let e=Object.keys(t.shape);for(let i of e)if(!t.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let r=Jl(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function o_(t,e,r,i,n,o){let a=[],s=n.keySet,c=n.catchall._zod,l=c.def.type,h=c.optout==="optional";for(let g in e){if(s.has(g))continue;if(l==="never"){a.push(g);continue}let w=c.run({value:e[g],issues:[]},i);w instanceof Promise?t.push(w.then(v=>ws(v,r,g,e,h))):ws(w,r,g,e,h)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:e,inst:o}),t.length?Promise.all(t).then(()=>r):r}var a_=A("$ZodObject",(t,e)=>{if(le.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let s=e.shape;Object.defineProperty(e,"shape",{get:()=>{let c={...s};return Object.defineProperty(e,"shape",{value:c}),c}})}let i=xi(()=>i_(e));_e(t._zod,"propValues",()=>{let s=e.shape,c={};for(let l in s){let h=s[l]._zod;if(h.values){c[l]??(c[l]=new Set);for(let g of h.values)c[l].add(g)}}return c});let n=Un,o=e.catchall,a;t._zod.parse=(s,c)=>{a??(a=i.value);let l=s.value;if(!n(l))return s.issues.push({expected:"object",code:"invalid_type",input:l,inst:t}),s;s.value={};let h=[],g=a.shape;for(let w of a.keys){let v=g[w],$=v._zod.optout==="optional",k=v._zod.run({value:l[w],issues:[]},c);k instanceof Promise?h.push(k.then(R=>ws(R,s,w,l,$))):ws(k,s,w,l,$)}return o?o_(h,l,s,c,i.value,t):h.length?Promise.all(h).then(()=>s):s}}),zf=A("$ZodObjectJIT",(t,e)=>{a_.init(t,e);let r=t._zod.parse,i=xi(()=>i_(e)),n=w=>{let v=new zo(["shape","payload","ctx"]),$=i.value,k=P=>{let C=ts(P);return`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`};v.write("const input = payload.value;");let R=Object.create(null),z=0;for(let P of $.keys)R[P]=`key_${z++}`;v.write("const newResult = {};");for(let P of $.keys){let C=R[P],ee=ts(P),Q=w[P]?._zod?.optout==="optional";v.write(`const ${C} = ${k(P)};`),Q?v.write(`
|
|
5
|
+
if (${C}.issues.length) {
|
|
6
|
+
if (${ee} in input) {
|
|
7
|
+
payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
|
|
8
|
+
...iss,
|
|
9
|
+
path: iss.path ? [${ee}, ...iss.path] : [${ee}]
|
|
10
|
+
})));
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (${C}.value === undefined) {
|
|
15
|
+
if (${ee} in input) {
|
|
16
|
+
newResult[${ee}] = undefined;
|
|
17
|
+
}
|
|
18
|
+
} else {
|
|
19
|
+
newResult[${ee}] = ${C}.value;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
`):v.write(`
|
|
23
|
+
if (${C}.issues.length) {
|
|
24
|
+
payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
|
|
25
|
+
...iss,
|
|
26
|
+
path: iss.path ? [${ee}, ...iss.path] : [${ee}]
|
|
27
|
+
})));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (${C}.value === undefined) {
|
|
31
|
+
if (${ee} in input) {
|
|
32
|
+
newResult[${ee}] = undefined;
|
|
33
|
+
}
|
|
34
|
+
} else {
|
|
35
|
+
newResult[${ee}] = ${C}.value;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
`)}v.write("payload.value = newResult;"),v.write("return payload;");let F=v.compile();return(P,C)=>F(w,P,C)},o,a=Un,s=!So.jitless,l=s&&ql.value,h=e.catchall,g;t._zod.parse=(w,v)=>{g??(g=i.value);let $=w.value;return a($)?s&&l&&v?.async===!1&&v.jitless!==!0?(o||(o=n(e.shape)),w=o(w,v),h?o_([],$,w,v,g,t):w):r(w,v):(w.issues.push({expected:"object",code:"invalid_type",input:$,inst:t}),w)}});function Wy(t,e,r,i){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;let n=t.filter(o=>!on(o));return n.length===1?(e.value=n[0].value,n[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(o=>o.issues.map(a=>Qt(a,i,et())))}),e)}var Uo=A("$ZodUnion",(t,e)=>{le.init(t,e),_e(t._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),_e(t._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),_e(t._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),_e(t._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){let n=e.options.map(o=>o._zod.pattern);return new RegExp(`^(${n.map(o=>ko(o.source)).join("|")})$`)}});let r=e.options.length===1,i=e.options[0]._zod.run;t._zod.parse=(n,o)=>{if(r)return i(n,o);let a=!1,s=[];for(let c of e.options){let l=c._zod.run({value:n.value,issues:[]},o);if(l instanceof Promise)s.push(l),a=!0;else{if(l.issues.length===0)return l;s.push(l)}}return a?Promise.all(s).then(c=>Wy(c,n,t,o)):Wy(s,n,t,o)}});function qy(t,e,r,i){let n=t.filter(o=>o.issues.length===0);return n.length===1?(e.value=n[0].value,e):(n.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(o=>o.issues.map(a=>Qt(a,i,et())))}):e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:[],inclusive:!1}),e)}var Bf=A("$ZodXor",(t,e)=>{Uo.init(t,e),e.inclusive=!1;let r=e.options.length===1,i=e.options[0]._zod.run;t._zod.parse=(n,o)=>{if(r)return i(n,o);let a=!1,s=[];for(let c of e.options){let l=c._zod.run({value:n.value,issues:[]},o);l instanceof Promise?(s.push(l),a=!0):s.push(l)}return a?Promise.all(s).then(c=>qy(c,n,t,o)):qy(s,n,t,o)}}),Uf=A("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,Uo.init(t,e);let r=t._zod.parse;_e(t._zod,"propValues",()=>{let n={};for(let o of e.options){let a=o._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let[s,c]of Object.entries(a)){n[s]||(n[s]=new Set);for(let l of c)n[s].add(l)}}return n});let i=xi(()=>{let n=e.options,o=new Map;for(let a of n){let s=a._zod.propValues?.[e.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(a)}"`);for(let c of s){if(o.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);o.set(c,a)}}return o});t._zod.parse=(n,o)=>{let a=n.value;if(!Un(a))return n.issues.push({code:"invalid_type",expected:"object",input:a,inst:t}),n;let s=i.value.get(a?.[e.discriminator]);return s?s._zod.run(n,o):e.unionFallback?r(n,o):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:a,path:[e.discriminator],inst:t}),n)}}),Cf=A("$ZodIntersection",(t,e)=>{le.init(t,e),t._zod.parse=(r,i)=>{let n=r.value,o=e.left._zod.run({value:n,issues:[]},i),a=e.right._zod.run({value:n,issues:[]},i);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([c,l])=>Gy(r,c,l)):Gy(r,o,a)}});function Jd(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(nn(t)&&nn(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 a=Jd(t[o],e[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};n[o]=a.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],a=Jd(n,o);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Gy(t,e,r){let i=new Map,n;for(let s of e.issues)if(s.code==="unrecognized_keys"){n??(n=s);for(let c of s.keys)i.has(c)||i.set(c,{}),i.get(c).l=!0}else t.issues.push(s);for(let s of r.issues)if(s.code==="unrecognized_keys")for(let c of s.keys)i.has(c)||i.set(c,{}),i.get(c).r=!0;else t.issues.push(s);let o=[...i].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(o.length&&n&&t.issues.push({...n,keys:o}),on(t))return t;let a=Jd(e.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return t.value=a.data,t}var Es=A("$ZodTuple",(t,e)=>{le.init(t,e);let r=e.items;t._zod.parse=(i,n)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:t,expected:"tuple",code:"invalid_type"}),i;i.value=[];let a=[],s=[...r].reverse().findIndex(h=>h._zod.optin!=="optional"),c=s===-1?0:r.length-s;if(!e.rest){let h=o.length>r.length,g=o.length<c-1;if(h||g)return i.issues.push({...h?{code:"too_big",maximum:r.length,inclusive:!0}:{code:"too_small",minimum:r.length},input:o,inst:t,origin:"array"}),i}let l=-1;for(let h of r){if(l++,l>=o.length&&l>=c)continue;let g=h._zod.run({value:o[l],issues:[]},n);g instanceof Promise?a.push(g.then(w=>ys(w,i,l))):ys(g,i,l)}if(e.rest){let h=o.slice(r.length);for(let g of h){l++;let w=e.rest._zod.run({value:g,issues:[]},n);w instanceof Promise?a.push(w.then(v=>ys(v,i,l))):ys(w,i,l)}}return a.length?Promise.all(a).then(()=>i):i}});function ys(t,e,r){t.issues.length&&e.issues.push(...sr(r,t.issues)),e.value[r]=t.value}var Df=A("$ZodRecord",(t,e)=>{le.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!nn(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:t}),r;let o=[],a=e.keyType._zod.values;if(a){r.value={};let s=new Set;for(let l of a)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){s.add(typeof l=="number"?l.toString():l);let h=e.valueType._zod.run({value:n[l],issues:[]},i);h instanceof Promise?o.push(h.then(g=>{g.issues.length&&r.issues.push(...sr(l,g.issues)),r.value[l]=g.value})):(h.issues.length&&r.issues.push(...sr(l,h.issues)),r.value[l]=h.value)}let c;for(let l in n)s.has(l)||(c=c??[],c.push(l));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(typeof s=="string"&&ps.test(s)&&c.issues.length){let g=e.keyType._zod.run({value:Number(s),issues:[]},i);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");g.issues.length===0&&(c=g)}if(c.issues.length){e.mode==="loose"?r.value[s]=n[s]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(g=>Qt(g,i,et())),input:s,path:[s],inst:t});continue}let h=e.valueType._zod.run({value:n[s],issues:[]},i);h instanceof Promise?o.push(h.then(g=>{g.issues.length&&r.issues.push(...sr(s,g.issues)),r.value[c.value]=g.value})):(h.issues.length&&r.issues.push(...sr(s,h.issues)),r.value[c.value]=h.value)}}return o.length?Promise.all(o).then(()=>r):r}}),Mf=A("$ZodMap",(t,e)=>{le.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[a,s]of n){let c=e.keyType._zod.run({value:a,issues:[]},i),l=e.valueType._zod.run({value:s,issues:[]},i);c instanceof Promise||l instanceof Promise?o.push(Promise.all([c,l]).then(([h,g])=>{Hy(h,g,r,a,n,t,i)})):Hy(c,l,r,a,n,t,i)}return o.length?Promise.all(o).then(()=>r):r}});function Hy(t,e,r,i,n,o,a){t.issues.length&&(Ro.has(typeof i)?r.issues.push(...sr(i,t.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:o,issues:t.issues.map(s=>Qt(s,a,et()))})),e.issues.length&&(Ro.has(typeof i)?r.issues.push(...sr(i,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:o,key:i,issues:e.issues.map(s=>Qt(s,a,et()))})),r.value.set(t.value,e.value)}var jf=A("$ZodSet",(t,e)=>{le.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 a of n){let s=e.valueType._zod.run({value:a,issues:[]},i);s instanceof Promise?o.push(s.then(c=>Jy(c,r))):Jy(s,r)}return o.length?Promise.all(o).then(()=>r):r}});function Jy(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}var Ff=A("$ZodEnum",(t,e)=>{le.init(t,e);let r=Io(e.entries),i=new Set(r);t._zod.values=i,t._zod.pattern=new RegExp(`^(${r.filter(n=>Ro.has(typeof n)).map(n=>typeof n=="string"?pr(n):n.toString()).join("|")})$`),t._zod.parse=(n,o)=>{let a=n.value;return i.has(a)||n.issues.push({code:"invalid_value",values:r,input:a,inst:t}),n}}),Zf=A("$ZodLiteral",(t,e)=>{if(le.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(i=>typeof i=="string"?pr(i):i?pr(i.toString()):String(i)).join("|")})$`),t._zod.parse=(i,n)=>{let o=i.value;return r.has(o)||i.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),i}}),Vf=A("$ZodFile",(t,e)=>{le.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}}),Kf=A("$ZodTransform",(t,e)=>{le.init(t,e),t._zod.parse=(r,i)=>{if(i.direction==="backward")throw new en(t.constructor.name);let n=e.transform(r.value,r);if(i.async)return(n instanceof Promise?n:Promise.resolve(n)).then(a=>(r.value=a,r));if(n instanceof Promise)throw new vr;return r.value=n,r}});function Yy(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}var Is=A("$ZodOptional",(t,e)=>{le.init(t,e),t._zod.optin="optional",t._zod.optout="optional",_e(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),_e(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${ko(r.source)})?$`):void 0}),t._zod.parse=(r,i)=>{if(e.innerType._zod.optin==="optional"){let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>Yy(o,r.value)):Yy(n,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,i)}}),Wf=A("$ZodExactOptional",(t,e)=>{Is.init(t,e),_e(t._zod,"values",()=>e.innerType._zod.values),_e(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(r,i)=>e.innerType._zod.run(r,i)}),qf=A("$ZodNullable",(t,e)=>{le.init(t,e),_e(t._zod,"optin",()=>e.innerType._zod.optin),_e(t._zod,"optout",()=>e.innerType._zod.optout),_e(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${ko(r.source)}|null)$`):void 0}),_e(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=A("$ZodDefault",(t,e)=>{le.init(t,e),t._zod.optin="optional",_e(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(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=>Xy(o,e)):Xy(n,e)}});function Xy(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var Hf=A("$ZodPrefault",(t,e)=>{le.init(t,e),t._zod.optin="optional",_e(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,i)=>(i.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,i))}),Jf=A("$ZodNonOptional",(t,e)=>{le.init(t,e),_e(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=>Qy(o,t)):Qy(n,t)}});function Qy(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 Yf=A("$ZodSuccess",(t,e)=>{le.init(t,e),t._zod.parse=(r,i)=>{if(i.direction==="backward")throw new en("ZodSuccess");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)}}),Xf=A("$ZodCatch",(t,e)=>{le.init(t,e),_e(t._zod,"optin",()=>e.innerType._zod.optin),_e(t._zod,"optout",()=>e.innerType._zod.optout),_e(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(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(a=>Qt(a,i,et()))},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,et()))},input:r.value}),r.issues=[]),r)}}),Qf=A("$ZodNaN",(t,e)=>{le.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)}),eh=A("$ZodPipe",(t,e)=>{le.init(t,e),_e(t._zod,"values",()=>e.in._zod.values),_e(t._zod,"optin",()=>e.in._zod.optin),_e(t._zod,"optout",()=>e.out._zod.optout),_e(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,i)=>{if(i.direction==="backward"){let o=e.out._zod.run(r,i);return o instanceof Promise?o.then(a=>_s(a,e.in,i)):_s(o,e.in,i)}let n=e.in._zod.run(r,i);return n instanceof Promise?n.then(o=>_s(o,e.out,i)):_s(n,e.out,i)}});function _s(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},r)}var Co=A("$ZodCodec",(t,e)=>{le.init(t,e),_e(t._zod,"values",()=>e.in._zod.values),_e(t._zod,"optin",()=>e.in._zod.optin),_e(t._zod,"optout",()=>e.out._zod.optout),_e(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,i)=>{if((i.direction||"forward")==="forward"){let o=e.in._zod.run(r,i);return o instanceof Promise?o.then(a=>vs(a,e,i)):vs(o,e,i)}else{let o=e.out._zod.run(r,i);return o instanceof Promise?o.then(a=>vs(a,e,i)):vs(o,e,i)}}});function vs(t,e,r){if(t.issues.length)return t.aborted=!0,t;if((r.direction||"forward")==="forward"){let n=e.transform(t.value,t);return n instanceof Promise?n.then(o=>bs(t,o,e.out,r)):bs(t,n,e.out,r)}else{let n=e.reverseTransform(t.value,t);return n instanceof Promise?n.then(o=>bs(t,o,e.in,r)):bs(t,n,e.in,r)}}function bs(t,e,r,i){return t.issues.length?(t.aborted=!0,t):r._zod.run({value:e,issues:t.issues},i)}var th=A("$ZodReadonly",(t,e)=>{le.init(t,e),_e(t._zod,"propValues",()=>e.innerType._zod.propValues),_e(t._zod,"values",()=>e.innerType._zod.values),_e(t._zod,"optin",()=>e.innerType?._zod?.optin),_e(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(e_):e_(n)}});function e_(t){return t.value=Object.freeze(t.value),t}var rh=A("$ZodTemplateLiteral",(t,e)=>{le.init(t,e);let r=[];for(let i of e.parts)if(typeof i=="object"&&i!==null){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,a=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(o,a))}else if(i===null||Hl.has(typeof i))r.push(pr(`${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:"string",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:e.format??"template_literal",pattern:t._zod.pattern.source}),i)}),nh=A("$ZodFunction",(t,e)=>(le.init(t,e),t._def=e,t._zod.def=e,t.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...i){let n=t._def.input?ns(t._def.input,i):i,o=Reflect.apply(r,this,n);return t._def.output?ns(t._def.output,o):o}},t.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...i){let n=t._def.input?await is(t._def.input,i):i,o=await Reflect.apply(r,this,n);return t._def.output?await is(t._def.output,o):o}},t._zod.parse=(r,i)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:t}),r):(t._def.output&&t._def.output._zod.def.type==="promise"?r.value=t.implementAsync(r.value):r.value=t.implement(r.value),r),t.input=(...r)=>{let i=t.constructor;return Array.isArray(r[0])?new i({type:"function",input:new Es({type:"tuple",items:r[0],rest:r[1]}),output:t._def.output}):new i({type:"function",input:r[0],output:t._def.output})},t.output=r=>{let i=t.constructor;return new i({type:"function",input:t._def.input,output:r})},t)),ih=A("$ZodPromise",(t,e)=>{le.init(t,e),t._zod.parse=(r,i)=>Promise.resolve(r.value).then(n=>e.innerType._zod.run({value:n,issues:[]},i))}),oh=A("$ZodLazy",(t,e)=>{le.init(t,e),_e(t._zod,"innerType",()=>e.getter()),_e(t._zod,"pattern",()=>t._zod.innerType?._zod?.pattern),_e(t._zod,"propValues",()=>t._zod.innerType?._zod?.propValues),_e(t._zod,"optin",()=>t._zod.innerType?._zod?.optin??void 0),_e(t._zod,"optout",()=>t._zod.innerType?._zod?.optout??void 0),t._zod.parse=(r,i)=>t._zod.innerType._zod.run(r,i)}),ah=A("$ZodCustom",(t,e)=>{Le.init(t,e),le.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=>t_(o,r,i,t));t_(n,r,i,t)}});function t_(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(Si(n))}}var Mo={};Et(Mo,{ar:()=>s_,az:()=>c_,be:()=>l_,bg:()=>d_,ca:()=>f_,cs:()=>h_,da:()=>p_,de:()=>m_,en:()=>ks,eo:()=>g_,es:()=>y_,fa:()=>__,fi:()=>v_,fr:()=>b_,frCA:()=>w_,he:()=>x_,hu:()=>S_,hy:()=>I_,id:()=>k_,is:()=>R_,it:()=>A_,ja:()=>$_,ka:()=>O_,kh:()=>T_,km:()=>Rs,ko:()=>N_,lt:()=>L_,mk:()=>z_,ms:()=>B_,nl:()=>U_,no:()=>C_,ota:()=>D_,pl:()=>j_,ps:()=>M_,pt:()=>F_,ru:()=>V_,sl:()=>K_,sv:()=>W_,ta:()=>q_,th:()=>G_,tr:()=>H_,ua:()=>J_,uk:()=>As,ur:()=>Y_,uz:()=>X_,vi:()=>Q_,yo:()=>rv,zhCN:()=>ev,zhTW:()=>tv});var BE=()=>{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={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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\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 instanceof ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`:`\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 ${o}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`}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 ${D(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: ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?` \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()} ${a.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?">=":">",a=e(n.origin);return a?`\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()} ${a.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}`:`${r[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":""}: ${N(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 s_(){return{localeError:BE()}}var UE=()=>{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={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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${s}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o}, daxil olan ${s}`}case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${D(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${o}${n.maximum.toString()} ${a.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?">=":">",a=e(n.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${o}${n.minimum.toString()} ${a.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 ${r[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":""}: ${N(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 c_(){return{localeError:UE()}}function u_(t,e,r,i){let n=Math.abs(t),o=n%10,a=n%100;return a>=11&&a<=19?i:o===1?e:o>=2&&o<=4?r:i}var CE=()=>{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={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"},i={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`}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 ${D(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 ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);if(a){let s=Number(n.maximum),c=u_(s,a.unit.one,a.unit.few,a.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 ${a.verb} ${o}${n.maximum.toString()} ${c}`}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?">=":">",a=e(n.origin);if(a){let s=Number(n.minimum),c=u_(s,a.unit.one,a.unit.few,a.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 ${a.verb} ${o}${n.minimum.toString()} ${c}`}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 ${r[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"}: ${N(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 l_(){return{localeError:CE()}}var DE=()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function e(n){return t[n]??null}let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",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:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${D(n.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${n.minimum.toString()} ${a.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${o.prefix}"`;if(o.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${o.suffix}"`;if(o.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${o.includes}"`;if(o.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${o.pattern}`;let a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return o.format==="emoji"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="datetime"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="date"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),o.format==="time"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="duration"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${a} ${r[o.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${n.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u043E\u0432\u0435":""}: ${N(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function d_(){return{localeError:DE()}}var ME=()=>{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={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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${s}`:`Tipus inv\xE0lid: s'esperava ${o}, s'ha rebut ${s}`}case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${D(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${N(n.values," o ")}`;case"too_big":{let o=n.inclusive?"com a m\xE0xim":"menys de",a=e(n.origin);return a?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${o} ${n.maximum.toString()} ${a.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",a=e(n.origin);return a?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${o} ${n.minimum.toString()} ${a.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 ${r[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":""}: ${N(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 f_(){return{localeError:ME()}}var jE=()=>{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={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"},i={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${s}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o}, obdr\u017Eeno ${s}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${D(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.maximum.toString()} ${a.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?">=":">",a=e(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.minimum.toString()} ${a.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 ${r[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: ${N(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 h_(){return{localeError:jE()}}var FE=()=>{let t={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function e(n){return t[n]??null}let r={regex:"input",email:"e-mailadresse",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 klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${s}`:`Ugyldigt input: forventede ${o}, fik ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${D(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin),s=i[n.origin]??n.origin;return a?`For stor: forventede ${s??"value"} ${a.verb} ${o} ${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor: forventede ${s??"value"} havde ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin),s=i[n.origin]??n.origin;return a?`For lille: forventede ${s} ${a.verb} ${o} ${n.minimum.toString()} ${a.unit}`:`For lille: forventede ${s} havde ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ugyldig streng: skal starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: skal ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: skal indeholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${r[o.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${N(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${n.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${n.origin}`;default:return"Ugyldigt input"}}};function p_(){return{localeError:FE()}}var ZE=()=>{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={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"},i={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${s}`:`Ung\xFCltige Eingabe: erwartet ${o}, erhalten ${s}`}case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${D(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ist`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ${a.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: ${r[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"}: ${N(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 m_(){return{localeError:ZE()}}var VE=()=>{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"},map:{unit:"entries",verb:"to have"}};function e(n){return t[n]??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",mac:"MAC 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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return`Invalid input: expected ${o}, received ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${D(n.values[0])}`:`Invalid option: expected one of ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${a.unit}`:`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${N(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function ks(){return{localeError:VE()}}var KE=()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(n){return t[n]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},i={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${s}`:`Nevalida enigo: atendi\u011Dis ${o}, ricevi\u011Dis ${s}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${D(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()} ${a.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${o}${n.minimum.toString()} ${a.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${r[o.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${N(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}};function g_(){return{localeError:KE()}}var WE=()=>{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={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"},i={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${s}`:`Entrada inv\xE1lida: se esperaba ${o}, recibido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${D(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin),s=i[n.origin]??n.origin;return a?`Demasiado grande: se esperaba que ${s??"valor"} tuviera ${o}${n.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${s??"valor"} fuera ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin),s=i[n.origin]??n.origin;return a?`Demasiado peque\xF1o: se esperaba que ${s} tuviera ${o}${n.minimum.toString()} ${a.unit}`:`Demasiado peque\xF1o: se esperaba que ${s} 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 ${r[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":""}: ${N(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${i[n.origin]??n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${i[n.origin]??n.origin}`;default:return"Entrada inv\xE1lida"}}};function y_(){return{localeError:WE()}}var qE=()=>{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={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"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \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 ${D(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 ${N(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} ${a.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?">=":">",a=e(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${a.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`:`${r[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: ${N(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 __(){return{localeError:qE()}}var GE=()=>{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={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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${s}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${s}`}case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${D(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${o}${n.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${o}${n.minimum.toString()} ${a.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 ${r[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"}: ${N(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 v_(){return{localeError:GE()}}var HE=()=>{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={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"},i={nan:"NaN",number:"nombre",array:"tableau"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${s} re\xE7u`:`Entr\xE9e invalide : ${o} attendu, ${s} re\xE7u`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${D(n.values[0])} attendu`:`Option invalide : une valeur parmi ${N(n.values,"|")} attendue`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Trop grand : ${n.origin??"valeur"} doit ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${n.origin??"valeur"} doit \xEAtre ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Trop petit : ${n.origin} doit ${a.verb} ${o}${n.minimum.toString()} ${a.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}`:`${r[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":""} : ${N(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 b_(){return{localeError:HE()}}var JE=()=>{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={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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${s}`:`Entr\xE9e invalide : attendu ${o}, re\xE7u ${s}`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${D(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u2264":"<",a=e(n.origin);return a?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${o}${n.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"\u2265":">",a=e(n.origin);return a?`Trop petit : attendu que ${n.origin} ait ${o}${n.minimum.toString()} ${a.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}`:`${r[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":""} : ${N(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 w_(){return{localeError:JE()}}var YE=()=>{let t={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},e={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=l=>l?t[l]:void 0,i=l=>{let h=r(l);return h?h.label:l??t.unknown.label},n=l=>`\u05D4${i(l)}`,o=l=>(r(l)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",a=l=>l?e[l]??null:null,s={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},c={nan:"NaN"};return l=>{switch(l.code){case"invalid_type":{let h=l.expected,g=c[h??""]??i(h),w=M(l.input),v=c[w]??t[w]?.label??w;return/^[A-Z]/.test(l.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${l.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${v}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}, \u05D4\u05EA\u05E7\u05D1\u05DC ${v}`}case"invalid_value":{if(l.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${D(l.values[0])}`;let h=l.values.map(v=>D(v));if(l.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${h[0]} \u05D0\u05D5 ${h[1]}`;let g=h[h.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${h.slice(0,-1).join(", ")} \u05D0\u05D5 ${g}`}case"too_big":{let h=a(l.origin),g=n(l.origin??"value");if(l.origin==="string")return`${h?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${g} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.maximum.toString()} ${h?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(l.origin==="number"){let $=l.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${l.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${g} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${$}`}if(l.origin==="array"||l.origin==="set"){let $=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",k=l.inclusive?`${l.maximum} ${h?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${l.maximum} ${h?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${g} ${$} \u05DC\u05D4\u05DB\u05D9\u05DC ${k}`.trim()}let w=l.inclusive?"<=":"<",v=o(l.origin??"value");return h?.unit?`${h.longLabel} \u05DE\u05D3\u05D9: ${g} ${v} ${w}${l.maximum.toString()} ${h.unit}`:`${h?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${g} ${v} ${w}${l.maximum.toString()}`}case"too_small":{let h=a(l.origin),g=n(l.origin??"value");if(l.origin==="string")return`${h?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${g} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${h?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let $=l.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${l.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${g} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${$}`}if(l.origin==="array"||l.origin==="set"){let $=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let R=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${g} ${$} \u05DC\u05D4\u05DB\u05D9\u05DC ${R}`}let k=l.inclusive?`${l.minimum} ${h?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${l.minimum} ${h?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${g} ${$} \u05DC\u05D4\u05DB\u05D9\u05DC ${k}`.trim()}let w=l.inclusive?">=":">",v=o(l.origin??"value");return h?.unit?`${h.shortLabel} \u05DE\u05D3\u05D9: ${g} ${v} ${w}${l.minimum.toString()} ${h.unit}`:`${h?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${g} ${v} ${w}${l.minimum.toString()}`}case"invalid_format":{let h=l;if(h.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${h.prefix}"`;if(h.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${h.suffix}"`;if(h.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${h.includes}"`;if(h.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${h.pattern}`;let g=s[h.format],w=g?.label??h.format,$=(g?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${w} \u05DC\u05D0 ${$}`}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 ${l.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${l.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${l.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${N(l.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";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(l.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function x_(){return{localeError:YE()}}var XE=()=>{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={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"},i={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${s}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o}, a kapott \xE9rt\xE9k ${s}`}case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${D(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${n.maximum.toString()} ${a.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?">=":">",a=e(n.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${o}${n.minimum.toString()} ${a.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 ${r[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":""}: ${N(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 S_(){return{localeError:XE()}}function E_(t,e,r){return Math.abs(t)===1?e:r}function $i(t){if(!t)return"";let e=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=t[t.length-1];return t+(e.includes(r)?"\u0576":"\u0568")}var QE=()=>{let t={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function e(n){return t[n]??null}let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},i={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${n.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${o}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`}case"invalid_value":return n.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${D(n.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);if(a){let s=Number(n.maximum),c=E_(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${$i(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${n.maximum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${$i(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);if(a){let s=Number(n.minimum),c=E_(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${$i(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${n.minimum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${$i(n.origin)} \u056C\u056B\u0576\u056B ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${o.prefix}"-\u0578\u057E`:o.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${o.suffix}"-\u0578\u057E`:o.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${o.includes}"`:o.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${o.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[o.format]??n.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${n.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${n.keys.length>1?"\u0576\u0565\u0580":""}. ${N(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${$i(n.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${$i(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function I_(){return{localeError:QE()}}var eI=()=>{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={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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${s}`:`Input tidak valid: diharapkan ${o}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${D(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${o}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Terlalu kecil: diharapkan ${n.origin} memiliki ${o}${n.minimum.toString()} ${a.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}`:`${r[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":""}: ${N(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 k_(){return{localeError:eI()}}var tI=()=>{let t={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function e(n){return t[n]??null}let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},i={nan:"NaN",number:"n\xFAmer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera ${o}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${D(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${o}${n.maximum.toString()} ${a.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${o}${n.minimum.toString()} ${a.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${o.prefix}"`:o.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${o.suffix}"`:o.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${o.includes}"`:o.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${o.pattern}`:`Rangt ${r[o.format]??n.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${N(n.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${n.origin}`;default:return"Rangt gildi"}}};function R_(){return{localeError:tI()}}var rI=()=>{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={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"},i={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${s}`:`Input non valido: atteso ${o}, ricevuto ${s}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${D(n.values[0])}`:`Opzione non valida: atteso uno tra ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Troppo grande: ${n.origin??"valore"} deve avere ${o}${n.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Troppo piccolo: ${n.origin} deve avere ${o}${n.minimum.toString()} ${a.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 ${r[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"}: ${N(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 A_(){return{localeError:rI()}}var nI=()=>{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={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"},i={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${o}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${D(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${N(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?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=e(n.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${a.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=e(n.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${a.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${o}\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${r[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":""}: ${N(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 $_(){return{localeError:nI()}}var iI=()=>{let t={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function e(n){return t[n]??null}let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",json_string:"JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},i={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`}case"invalid_value":return n.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${D(n.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${N(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.prefix}"-\u10D8\u10D7`:o.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.suffix}"-\u10D8\u10D7`:o.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${o.includes}"-\u10E1`:o.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${o.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${n.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${n.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${N(n.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${n.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${n.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function O_(){return{localeError:iI()}}var oI=()=>{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={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"},i={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\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 instanceof ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`:`\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 ${o} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`}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 ${D(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 ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\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()} ${a.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?">=":">",a=e(n.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${o} ${n.minimum.toString()} ${a.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 ${r[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 ${N(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 Rs(){return{localeError:oI()}}function T_(){return Rs()}var aI=()=>{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={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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`}case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${D(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${N(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=e(n.origin),c=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${c} ${o}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${o}${a}`}case"too_small":{let o=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=e(n.origin),c=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${c} ${o}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${o}${a}`}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 ${r[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: ${N(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 N_(){return{localeError:aI()}}var Do=t=>t.charAt(0).toUpperCase()+t.slice(1);function P_(t){let e=Math.abs(t),r=e%10,i=e%100;return i>=11&&i<=19||r===0?"many":r===1?"one":"few"}var sI=()=>{let t={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function e(n,o,a,s){let c=t[n]??null;return c===null?c:{unit:c.unit[o],verb:c.verb[s][a?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},i={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${s}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${s}, o tik\u0117tasi - ${o}`}case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${D(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${N(n.values,"|")} pasirinkim\u0173`;case"too_big":{let o=i[n.origin]??n.origin,a=e(n.origin,P_(Number(n.maximum)),n.inclusive??!1,"smaller");if(a?.verb)return`${Do(o??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.maximum.toString()} ${a.unit??"element\u0173"}`;let s=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Do(o??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.maximum.toString()} ${a?.unit}`}case"too_small":{let o=i[n.origin]??n.origin,a=e(n.origin,P_(Number(n.minimum)),n.inclusive??!1,"bigger");if(a?.verb)return`${Do(o??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.minimum.toString()} ${a.unit??"element\u0173"}`;let s=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Do(o??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.minimum.toString()} ${a?.unit}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${o.prefix}"`:o.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${o.suffix}"`:o.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${o.includes}"`:o.format==="regex"?`Eilut\u0117 privalo atitikti ${o.pattern}`:`Neteisingas ${r[o.format]??n.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${N(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let o=i[n.origin]??n.origin;return`${Do(o??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function L_(){return{localeError:sI()}}var cI=()=>{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={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"},i={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${D(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 ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\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()} ${a.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?">=":">",a=e(n.origin);return a?`\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()} ${a.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 ${r[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"}: ${N(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 z_(){return{localeError:cI()}}var uI=()=>{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={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"},i={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${s}`:`Input tidak sah: dijangka ${o}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${D(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Terlalu besar: dijangka ${n.origin??"nilai"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Terlalu kecil: dijangka ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.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}`:`${r[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: ${N(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 B_(){return{localeError:uI()}}var lI=()=>{let t={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function e(n){return t[n]??null}let r={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"},i={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${s}`:`Ongeldige invoer: verwacht ${o}, ontving ${s}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${D(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin),s=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return a?`Te ${s}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} is`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin),s=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return a?`Te ${s}: verwacht dat ${n.origin} ${o}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Te ${s}: 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: ${r[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":""}: ${N(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 U_(){return{localeError:lI()}}var dI=()=>{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={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"},i={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${s}`:`Ugyldig input: forventet ${o}, fikk ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${D(n.values[0])}`:`Ugyldig valg: forventet en av ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`For lite(n): forventet ${n.origin} til \xE5 ha ${o}${n.minimum.toString()} ${a.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 ${r[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"}: ${N(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 C_(){return{localeError:dI()}}var fI=()=>{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={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"},i={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${s}`:`F\xE2sit giren: umulan ${o}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${D(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${o}${n.maximum.toString()} ${a.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?">=":">",a=e(n.origin);return a?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${o}${n.minimum.toString()} ${a.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 ${r[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":""}: ${N(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 D_(){return{localeError:fI()}}var hI=()=>{let t={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(n){return t[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\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:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${D(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${N(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:o.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:o.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${o.includes}" \u0648\u0644\u0631\u064A`:o.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${o.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[o.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${N(n.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${n.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${n.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function M_(){return{localeError:hI()}}var pI=()=>{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={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"},i={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${s}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o}, otrzymano ${s}`}case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${D(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.maximum.toString()} ${a.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?">=":">",a=e(n.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.minimum.toString()} ${a.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) ${r[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":""}: ${N(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 j_(){return{localeError:pI()}}var mI=()=>{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={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"},i={nan:"NaN",number:"n\xFAmero",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${s}`:`Tipo inv\xE1lido: esperado ${o}, recebido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${D(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${o}${n.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Muito pequeno: esperado que ${n.origin} tivesse ${o}${n.minimum.toString()} ${a.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}`:`${r[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":""}: ${N(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 F_(){return{localeError:mI()}}function Z_(t,e,r,i){let n=Math.abs(t),o=n%10,a=n%100;return a>=11&&a<=19?i:o===1?e:o>=2&&o<=4?r:i}var gI=()=>{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={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"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`}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 ${D(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 ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);if(a){let s=Number(n.maximum),c=Z_(s,a.unit.one,a.unit.few,a.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()} ${c}`}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?">=":">",a=e(n.origin);if(a){let s=Number(n.minimum),c=Z_(s,a.unit.one,a.unit.few,a.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()} ${c}`}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 ${r[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":""}: ${N(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 V_(){return{localeError:gI()}}var yI=()=>{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={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"},i={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${s}`:`Neveljaven vnos: pri\u010Dakovano ${o}, prejeto ${s}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${D(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${o}${n.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${o}${n.minimum.toString()} ${a.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 ${r[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"}: ${N(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 K_(){return{localeError:yI()}}var _I=()=>{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={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"},i={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${s}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${o}, fick ${s}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${D(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.maximum.toString()} ${a.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?">=":">",a=e(n.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.minimum.toString()} ${a.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) ${r[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"}: ${N(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 W_(){return{localeError:_I()}}var vI=()=>{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={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"},i={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\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 instanceof ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`:`\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 ${o}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`}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 ${D(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 ${N(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\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()} ${a.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?">=":">",a=e(n.origin);return a?`\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()} ${a.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 ${r[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":""}: ${N(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 q_(){return{localeError:vI()}}var bI=()=>{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={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"},i={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\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 instanceof ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`:`\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 ${o} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`}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 ${D(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 ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=e(n.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.maximum.toString()} ${a.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",a=e(n.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.minimum.toString()} ${a.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: ${r[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: ${N(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 G_(){return{localeError:bI()}}var wI=()=>{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(n){return t[n]??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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${s}`:`Ge\xE7ersiz de\u011Fer: beklenen ${o}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${D(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()} ${a.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()} ${a.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[o.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${N(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function H_(){return{localeError:wI()}}var xI=()=>{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={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"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\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 instanceof ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`:`\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 ${o}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`}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 ${D(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 ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\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"} ${a.verb} ${o}${n.maximum.toString()} ${a.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?">=":">",a=e(n.origin);return a?`\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} ${a.verb} ${o}${n.minimum.toString()} ${a.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 ${r[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":""}: ${N(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 As(){return{localeError:xI()}}function J_(){return As()}var SI=()=>{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={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"},i={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${D(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${N(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?"<=":"<",a=e(n.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${n.maximum.toString()} ${a.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?">=":">",a=e(n.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${o}${n.minimum.toString()} ${a.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 ${r[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":""}: ${N(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 Y_(){return{localeError:SI()}}var EI=()=>{let t={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"}};function e(n){return t[n]??null}let r={regex:"kirish",email:"elektron pochta manzili",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 sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},i={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${s}`:`Noto\u2018g\u2018ri kirish: kutilgan ${o}, qabul qilingan ${s}`}case"invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${D(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()} ${a.unit} ${a.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Juda kichik: kutilgan ${n.origin} ${o}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Juda kichik: kutilgan ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${o.prefix}" bilan boshlanishi kerak`:o.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${o.suffix}" bilan tugashi kerak`:o.format==="includes"?`Noto\u2018g\u2018ri satr: "${o.includes}" ni o\u2018z ichiga olishi kerak`:o.format==="regex"?`Noto\u2018g\u2018ri satr: ${o.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[o.format]??n.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${n.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${n.keys.length>1?"lar":""}: ${N(n.keys,", ")}`;case"invalid_key":return`${n.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${n.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};function X_(){return{localeError:EI()}}var II=()=>{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={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"},i={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`}case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${D(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 ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${o}${n.maximum.toString()} ${a.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?">=":">",a=e(n.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.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}`:`${r[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: ${N(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 Q_(){return{localeError:II()}}var kI=()=>{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={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"},i={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`}case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${D(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${o}${n.maximum.toString()} ${a.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?">=":">",a=e(n.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${o}${n.minimum.toString()} ${a.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${r[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): ${N(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 ev(){return{localeError:kI()}}var RI=()=>{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={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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${s}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o}\uFF0C\u4F46\u6536\u5230 ${s}`}case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${D(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${o}${n.maximum.toString()} ${a.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?">=":">",a=e(n.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${o}${n.minimum.toString()} ${a.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 ${r[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${N(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 tv(){return{localeError:RI()}}var AI=()=>{let t={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function e(n){return t[n]??null}let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",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:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},i={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=M(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${s}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${o}, \xE0m\u1ECD\u0300 a r\xED ${s}`}case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${D(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${N(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${a.verb} ${o}${n.maximum} ${a.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${n.maximum}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${a.verb} ${o}${n.minimum} ${a.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${n.minimum}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${o.prefix}"`:o.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${o.suffix}"`:o.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${o.includes}"`:o.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${o.pattern}`:`A\u1E63\xEC\u1E63e: ${r[o.format]??n.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${n.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${N(n.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function rv(){return{localeError:AI()}}var nv,sh=Symbol("ZodOutput"),ch=Symbol("ZodInput"),$s=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let i=r[0];return this._map.set(e,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let i={...this.get(r)??{}};delete i.id;let n={...i,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Os(){return new $s}(nv=globalThis).__zod_globalRegistry??(nv.__zod_globalRegistry=Os());var Tt=globalThis.__zod_globalRegistry;function uh(t,e){return new t({type:"string",...Z(e)})}function lh(t,e){return new t({type:"string",coerce:!0,...Z(e)})}function Ts(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...Z(e)})}function jo(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...Z(e)})}function Ns(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...Z(e)})}function Ps(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Z(e)})}function Ls(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Z(e)})}function zs(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Z(e)})}function Fo(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Z(e)})}function Bs(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...Z(e)})}function Us(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...Z(e)})}function Cs(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...Z(e)})}function Ds(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...Z(e)})}function Ms(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...Z(e)})}function js(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...Z(e)})}function Fs(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...Z(e)})}function Zs(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...Z(e)})}function Vs(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...Z(e)})}function dh(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...Z(e)})}function Ks(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Z(e)})}function Ws(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Z(e)})}function qs(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...Z(e)})}function Gs(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...Z(e)})}function Hs(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...Z(e)})}function Js(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...Z(e)})}var fh={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function hh(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Z(e)})}function ph(t,e){return new t({type:"string",format:"date",check:"string_format",...Z(e)})}function mh(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...Z(e)})}function gh(t,e){return new t({type:"string",format:"duration",check:"string_format",...Z(e)})}function yh(t,e){return new t({type:"number",checks:[],...Z(e)})}function _h(t,e){return new t({type:"number",coerce:!0,checks:[],...Z(e)})}function vh(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Z(e)})}function bh(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...Z(e)})}function wh(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...Z(e)})}function xh(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...Z(e)})}function Sh(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...Z(e)})}function Eh(t,e){return new t({type:"boolean",...Z(e)})}function Ih(t,e){return new t({type:"boolean",coerce:!0,...Z(e)})}function kh(t,e){return new t({type:"bigint",...Z(e)})}function Rh(t,e){return new t({type:"bigint",coerce:!0,...Z(e)})}function Ah(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Z(e)})}function $h(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Z(e)})}function Oh(t,e){return new t({type:"symbol",...Z(e)})}function Th(t,e){return new t({type:"undefined",...Z(e)})}function Nh(t,e){return new t({type:"null",...Z(e)})}function Ph(t){return new t({type:"any"})}function Lh(t){return new t({type:"unknown"})}function zh(t,e){return new t({type:"never",...Z(e)})}function Bh(t,e){return new t({type:"void",...Z(e)})}function Uh(t,e){return new t({type:"date",...Z(e)})}function Ch(t,e){return new t({type:"date",coerce:!0,...Z(e)})}function Dh(t,e){return new t({type:"nan",...Z(e)})}function Ar(t,e){return new ms({check:"less_than",...Z(e),value:t,inclusive:!1})}function cr(t,e){return new ms({check:"less_than",...Z(e),value:t,inclusive:!0})}function $r(t,e){return new gs({check:"greater_than",...Z(e),value:t,inclusive:!1})}function qt(t,e){return new gs({check:"greater_than",...Z(e),value:t,inclusive:!0})}function Ys(t){return $r(0,t)}function Xs(t){return Ar(0,t)}function Qs(t){return cr(0,t)}function ec(t){return qt(0,t)}function an(t,e){return new Td({check:"multiple_of",...Z(e),value:t})}function sn(t,e){return new Ld({check:"max_size",...Z(e),maximum:t})}function Or(t,e){return new zd({check:"min_size",...Z(e),minimum:t})}function Mn(t,e){return new Bd({check:"size_equals",...Z(e),size:t})}function jn(t,e){return new Ud({check:"max_length",...Z(e),maximum:t})}function Mr(t,e){return new Cd({check:"min_length",...Z(e),minimum:t})}function Fn(t,e){return new Dd({check:"length_equals",...Z(e),length:t})}function Oi(t,e){return new Md({check:"string_format",format:"regex",...Z(e),pattern:t})}function Ti(t){return new jd({check:"string_format",format:"lowercase",...Z(t)})}function Ni(t){return new Fd({check:"string_format",format:"uppercase",...Z(t)})}function Pi(t,e){return new Zd({check:"string_format",format:"includes",...Z(e),includes:t})}function Li(t,e){return new Vd({check:"string_format",format:"starts_with",...Z(e),prefix:t})}function zi(t,e){return new Kd({check:"string_format",format:"ends_with",...Z(e),suffix:t})}function tc(t,e,r){return new Wd({check:"property",property:t,schema:e,...Z(r)})}function Bi(t,e){return new qd({check:"mime_type",mime:t,...Z(e)})}function br(t){return new Gd({check:"overwrite",tx:t})}function Ui(t){return br(e=>e.normalize(t))}function Ci(){return br(t=>t.trim())}function Di(){return br(t=>t.toLowerCase())}function Mi(){return br(t=>t.toUpperCase())}function ji(){return br(t=>Wl(t))}function Mh(t,e,r){return new t({type:"array",element:e,...Z(r)})}function OI(t,e,r){return new t({type:"union",options:e,...Z(r)})}function TI(t,e,r){return new t({type:"union",options:e,inclusive:!1,...Z(r)})}function NI(t,e,r,i){return new t({type:"union",options:r,discriminator:e,...Z(i)})}function PI(t,e,r){return new t({type:"intersection",left:e,right:r})}function LI(t,e,r,i){let n=r instanceof le,o=n?i:r,a=n?r:null;return new t({type:"tuple",items:e,rest:a,...Z(o)})}function zI(t,e,r,i){return new t({type:"record",keyType:e,valueType:r,...Z(i)})}function BI(t,e,r,i){return new t({type:"map",keyType:e,valueType:r,...Z(i)})}function UI(t,e,r){return new t({type:"set",valueType:e,...Z(r)})}function CI(t,e,r){let i=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new t({type:"enum",entries:i,...Z(r)})}function DI(t,e,r){return new t({type:"enum",entries:e,...Z(r)})}function MI(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...Z(r)})}function jh(t,e){return new t({type:"file",...Z(e)})}function jI(t,e){return new t({type:"transform",transform:e})}function FI(t,e){return new t({type:"optional",innerType:e})}function ZI(t,e){return new t({type:"nullable",innerType:e})}function VI(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():Gl(r)}})}function KI(t,e,r){return new t({type:"nonoptional",innerType:e,...Z(r)})}function WI(t,e){return new t({type:"success",innerType:e})}function qI(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function GI(t,e,r){return new t({type:"pipe",in:e,out:r})}function HI(t,e){return new t({type:"readonly",innerType:e})}function JI(t,e,r){return new t({type:"template_literal",parts:e,...Z(r)})}function YI(t,e){return new t({type:"lazy",getter:e})}function XI(t,e){return new t({type:"promise",innerType:e})}function Fh(t,e,r){let i=Z(r);return i.abort??(i.abort=!0),new t({type:"custom",check:"custom",fn:e,...i})}function Zh(t,e,r){return new t({type:"custom",check:"custom",fn:e,...Z(r)})}function Vh(t){let e=iv(r=>(r.addIssue=i=>{if(typeof i=="string")r.issues.push(Si(i,r.value,e._zod.def));else{let n=i;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=e),n.continue??(n.continue=!e._zod.def.abort),r.issues.push(Si(n))}},t(r.value,r)));return e}function iv(t,e){let r=new Le({check:"custom",...Z(e)});return r._zod.check=t,r}function Kh(t){let e=new Le({check:"describe"});return e._zod.onattach=[r=>{let i=Tt.get(r)??{};Tt.add(r,{...i,description:t})}],e._zod.check=()=>{},e}function Wh(t){let e=new Le({check:"meta"});return e._zod.onattach=[r=>{let i=Tt.get(r)??{};Tt.add(r,{...i,...t})}],e._zod.check=()=>{},e}function qh(t,e){let r=Z(e),i=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(i=i.map(v=>typeof v=="string"?v.toLowerCase():v),n=n.map(v=>typeof v=="string"?v.toLowerCase():v));let o=new Set(i),a=new Set(n),s=t.Codec??Co,c=t.Boolean??Bo,l=t.String??Dn,h=new l({type:"string",error:r.error}),g=new c({type:"boolean",error:r.error}),w=new s({type:"pipe",in:h,out:g,transform:(v,$)=>{let k=v;return r.case!=="sensitive"&&(k=k.toLowerCase()),o.has(k)?!0:a.has(k)?!1:($.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...a],input:$.value,inst:w,continue:!1}),{})},reverseTransform:(v,$)=>v===!0?i[0]||"true":n[0]||"false",error:r.error});return w}function Fi(t,e,r,i={}){let n=Z(i),o={...Z(i),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:s=>r.test(s),...n};return r instanceof RegExp&&(o.pattern=r),new t(o)}function cn(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??Tt,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}function Re(t,e,r={path:[],schemaPath:[]}){var i;let n=t._zod.def,o=e.seen.get(t);if(o)return o.count++,r.schemaPath.includes(t)&&(o.cycle=r.path),o.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,a);let s=t._zod.toJSONSchema?.();if(s)a.schema=s;else{let h={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,a.schema,h);else{let w=a.schema,v=e.processors[n.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);v(t,e,w,h)}let g=t._zod.parent;g&&(a.ref||(a.ref=g),Re(g,e,h),e.seen.get(g).isParent=!0)}let c=e.metadataRegistry.get(t);return c&&Object.assign(a.schema,c),e.io==="input"&&Gt(t)&&(delete a.schema.examples,delete a.schema.default),e.io==="input"&&a.schema._prefault&&((i=a.schema).default??(i.default=a.schema._prefault)),delete a.schema._prefault,e.seen.get(t).schema}function un(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=new Map;for(let a of t.seen.entries()){let s=t.metadataRegistry.get(a[0])?.id;if(s){let c=i.get(s);if(c&&c!==a[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(s,a[0])}}let n=a=>{let s=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let g=t.external.registry.get(a[0])?.id,w=t.external.uri??($=>$);if(g)return{ref:w(g)};let v=a[1].defId??a[1].schema.id??`schema${t.counter++}`;return a[1].defId=v,{defId:v,ref:`${w("__shared")}#/${s}/${v}`}}if(a[1]===r)return{ref:"#"};let l=`#/${s}/`,h=a[1].schema.id??`__schema${t.counter++}`;return{defId:h,ref:l+h}},o=a=>{if(a[1].schema.$ref)return;let s=a[1],{ref:c,defId:l}=n(a);s.def={...s.schema},l&&(s.defId=l);let h=s.schema;for(let g in h)delete h[g];h.$ref=c};if(t.cycles==="throw")for(let a of t.seen.entries()){let s=a[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
|
|
39
|
+
|
|
40
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of t.seen.entries()){let s=a[1];if(e===a[0]){o(a);continue}if(t.external){let l=t.external.registry.get(a[0])?.id;if(e!==a[0]&&l){o(a);continue}}if(t.metadataRegistry.get(a[0])?.id){o(a);continue}if(s.cycle){o(a);continue}if(s.count>1&&t.reused==="ref"){o(a);continue}}}function ln(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=a=>{let s=t.seen.get(a);if(s.ref===null)return;let c=s.def??s.schema,l={...c},h=s.ref;if(s.ref=null,h){i(h);let w=t.seen.get(h),v=w.schema;if(v.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(v)):Object.assign(c,v),Object.assign(c,l),a._zod.parent===h)for(let k in c)k==="$ref"||k==="allOf"||k in l||delete c[k];if(v.$ref&&w.def)for(let k in c)k==="$ref"||k==="allOf"||k in w.def&&JSON.stringify(c[k])===JSON.stringify(w.def[k])&&delete c[k]}let g=a._zod.parent;if(g&&g!==h){i(g);let w=t.seen.get(g);if(w?.schema.$ref&&(c.$ref=w.schema.$ref,w.def))for(let v in c)v==="$ref"||v==="allOf"||v in w.def&&JSON.stringify(c[v])===JSON.stringify(w.def[v])&&delete c[v]}t.override({zodSchema:a,jsonSchema:c,path:s.path??[]})};for(let a of[...t.seen.entries()].reverse())i(a[0]);let n={};if(t.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let a=t.external.registry.get(e)?.id;if(!a)throw new Error("Schema is missing an `id` property");n.$id=t.external.uri(a)}Object.assign(n,r.def??r.schema);let o=t.external?.defs??{};for(let a of t.seen.entries()){let s=a[1];s.def&&s.defId&&(o[s.defId]=s.def)}t.external||Object.keys(o).length>0&&(t.target==="draft-2020-12"?n.$defs=o:n.definitions=o);try{let a=JSON.parse(JSON.stringify(n));return Object.defineProperty(a,"~standard",{value:{...e["~standard"],jsonSchema:{input:Zi(e,"input",t.processors),output:Zi(e,"output",t.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Gt(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let i=t._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return Gt(i.element,r);if(i.type==="set")return Gt(i.valueType,r);if(i.type==="lazy")return Gt(i.getter(),r);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return Gt(i.innerType,r);if(i.type==="intersection")return Gt(i.left,r)||Gt(i.right,r);if(i.type==="record"||i.type==="map")return Gt(i.keyType,r)||Gt(i.valueType,r);if(i.type==="pipe")return Gt(i.in,r)||Gt(i.out,r);if(i.type==="object"){for(let n in i.shape)if(Gt(i.shape[n],r))return!0;return!1}if(i.type==="union"){for(let n of i.options)if(Gt(n,r))return!0;return!1}if(i.type==="tuple"){for(let n of i.items)if(Gt(n,r))return!0;return!!(i.rest&&Gt(i.rest,r))}return!1}var Gh=(t,e={})=>r=>{let i=cn({...r,processors:e});return Re(t,i),un(i,t),ln(i,t)},Zi=(t,e,r={})=>i=>{let{libraryOptions:n,target:o}=i??{},a=cn({...n??{},target:o,io:e,processors:r});return Re(t,a),un(a,t),ln(a,t)};var QI={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Hh=(t,e,r,i)=>{let n=r;n.type="string";let{minimum:o,maximum:a,format:s,patterns:c,contentEncoding:l}=t._zod.bag;if(typeof o=="number"&&(n.minLength=o),typeof a=="number"&&(n.maxLength=a),s&&(n.format=QI[s]??s,n.format===""&&delete n.format,s==="time"&&delete n.format),l&&(n.contentEncoding=l),c&&c.size>0){let h=[...c];h.length===1?n.pattern=h[0].source:h.length>1&&(n.allOf=[...h.map(g=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},Jh=(t,e,r,i)=>{let n=r,{minimum:o,maximum:a,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:h}=t._zod.bag;typeof s=="string"&&s.includes("int")?n.type="integer":n.type="number",typeof h=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(n.minimum=h,n.exclusiveMinimum=!0):n.exclusiveMinimum=h),typeof o=="number"&&(n.minimum=o,typeof h=="number"&&e.target!=="draft-04"&&(h>=o?delete n.minimum:delete n.exclusiveMinimum)),typeof l=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(n.maximum=l,n.exclusiveMaximum=!0):n.exclusiveMaximum=l),typeof a=="number"&&(n.maximum=a,typeof l=="number"&&e.target!=="draft-04"&&(l<=a?delete n.maximum:delete n.exclusiveMaximum)),typeof c=="number"&&(n.multipleOf=c)},Yh=(t,e,r,i)=>{r.type="boolean"},Xh=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Qh=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},ep=(t,e,r,i)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},tp=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},rp=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},np=(t,e,r,i)=>{r.not={}},ip=(t,e,r,i)=>{},op=(t,e,r,i)=>{},ap=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},sp=(t,e,r,i)=>{let n=t._zod.def,o=Io(n.entries);o.every(a=>typeof a=="number")&&(r.type="number"),o.every(a=>typeof a=="string")&&(r.type="string"),r.enum=o},cp=(t,e,r,i)=>{let n=t._zod.def,o=[];for(let a of n.values)if(a===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(a))}else o.push(a);if(o.length!==0)if(o.length===1){let a=o[0];r.type=a===null?"null":typeof a,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[a]:r.const=a}else o.every(a=>typeof a=="number")&&(r.type="number"),o.every(a=>typeof a=="string")&&(r.type="string"),o.every(a=>typeof a=="boolean")&&(r.type="boolean"),o.every(a=>a===null)&&(r.type="null"),r.enum=o},up=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},lp=(t,e,r,i)=>{let n=r,o=t._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=o.source},dp=(t,e,r,i)=>{let n=r,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:s,mime:c}=t._zod.bag;a!==void 0&&(o.minLength=a),s!==void 0&&(o.maxLength=s),c?c.length===1?(o.contentMediaType=c[0],Object.assign(n,o)):(Object.assign(n,o),n.anyOf=c.map(l=>({contentMediaType:l}))):Object.assign(n,o)},fp=(t,e,r,i)=>{r.type="boolean"},hp=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},pp=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},mp=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},gp=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},yp=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},_p=(t,e,r,i)=>{let n=r,o=t._zod.def,{minimum:a,maximum:s}=t._zod.bag;typeof a=="number"&&(n.minItems=a),typeof s=="number"&&(n.maxItems=s),n.type="array",n.items=Re(o.element,e,{...i,path:[...i.path,"items"]})},vp=(t,e,r,i)=>{let n=r,o=t._zod.def;n.type="object",n.properties={};let a=o.shape;for(let l in a)n.properties[l]=Re(a[l],e,{...i,path:[...i.path,"properties",l]});let s=new Set(Object.keys(a)),c=new Set([...s].filter(l=>{let h=o.shape[l]._zod;return e.io==="input"?h.optin===void 0:h.optout===void 0}));c.size>0&&(n.required=Array.from(c)),o.catchall?._zod.def.type==="never"?n.additionalProperties=!1:o.catchall?o.catchall&&(n.additionalProperties=Re(o.catchall,e,{...i,path:[...i.path,"additionalProperties"]})):e.io==="output"&&(n.additionalProperties=!1)},nc=(t,e,r,i)=>{let n=t._zod.def,o=n.inclusive===!1,a=n.options.map((s,c)=>Re(s,e,{...i,path:[...i.path,o?"oneOf":"anyOf",c]}));o?r.oneOf=a:r.anyOf=a},bp=(t,e,r,i)=>{let n=t._zod.def,o=Re(n.left,e,{...i,path:[...i.path,"allOf",0]}),a=Re(n.right,e,{...i,path:[...i.path,"allOf",1]}),s=l=>"allOf"in l&&Object.keys(l).length===1,c=[...s(o)?o.allOf:[o],...s(a)?a.allOf:[a]];r.allOf=c},wp=(t,e,r,i)=>{let n=r,o=t._zod.def;n.type="array";let a=e.target==="draft-2020-12"?"prefixItems":"items",s=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((w,v)=>Re(w,e,{...i,path:[...i.path,a,v]})),l=o.rest?Re(o.rest,e,{...i,path:[...i.path,s,...e.target==="openapi-3.0"?[o.items.length]:[]]}):null;e.target==="draft-2020-12"?(n.prefixItems=c,l&&(n.items=l)):e.target==="openapi-3.0"?(n.items={anyOf:c},l&&n.items.anyOf.push(l),n.minItems=c.length,l||(n.maxItems=c.length)):(n.items=c,l&&(n.additionalItems=l));let{minimum:h,maximum:g}=t._zod.bag;typeof h=="number"&&(n.minItems=h),typeof g=="number"&&(n.maxItems=g)},xp=(t,e,r,i)=>{let n=r,o=t._zod.def;n.type="object";let a=o.keyType,c=a._zod.bag?.patterns;if(o.mode==="loose"&&c&&c.size>0){let h=Re(o.valueType,e,{...i,path:[...i.path,"patternProperties","*"]});n.patternProperties={};for(let g of c)n.patternProperties[g.source]=h}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(n.propertyNames=Re(o.keyType,e,{...i,path:[...i.path,"propertyNames"]})),n.additionalProperties=Re(o.valueType,e,{...i,path:[...i.path,"additionalProperties"]});let l=a._zod.values;if(l){let h=[...l].filter(g=>typeof g=="string"||typeof g=="number");h.length>0&&(n.required=h)}},Sp=(t,e,r,i)=>{let n=t._zod.def,o=Re(n.innerType,e,i),a=e.seen.get(t);e.target==="openapi-3.0"?(a.ref=n.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},Ep=(t,e,r,i)=>{let n=t._zod.def;Re(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType},Ip=(t,e,r,i)=>{let n=t._zod.def;Re(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},kp=(t,e,r,i)=>{let n=t._zod.def;Re(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},Rp=(t,e,r,i)=>{let n=t._zod.def;Re(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType;let a;try{a=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},Ap=(t,e,r,i)=>{let n=t._zod.def,o=e.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;Re(o,e,i);let a=e.seen.get(t);a.ref=o},$p=(t,e,r,i)=>{let n=t._zod.def;Re(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType,r.readOnly=!0},Op=(t,e,r,i)=>{let n=t._zod.def;Re(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType},ic=(t,e,r,i)=>{let n=t._zod.def;Re(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType},Tp=(t,e,r,i)=>{let n=t._zod.innerType;Re(n,e,i);let o=e.seen.get(t);o.ref=n},rc={string:Hh,number:Jh,boolean:Yh,bigint:Xh,symbol:Qh,null:ep,undefined:tp,void:rp,never:np,any:ip,unknown:op,date:ap,enum:sp,literal:cp,nan:up,template_literal:lp,file:dp,success:fp,custom:hp,function:pp,transform:mp,map:gp,set:yp,array:_p,object:vp,union:nc,intersection:bp,tuple:wp,record:xp,nullable:Sp,nonoptional:Ep,default:Ip,prefault:kp,catch:Rp,pipe:Ap,readonly:$p,promise:Op,optional:ic,lazy:Tp};function oc(t,e){if("_idmap"in t){let i=t,n=cn({...e,processors:rc}),o={};for(let c of i._idmap.entries()){let[l,h]=c;Re(h,n)}let a={},s={registry:i,uri:e?.uri,defs:o};n.external=s;for(let c of i._idmap.entries()){let[l,h]=c;un(n,h),a[l]=ln(n,h)}if(Object.keys(o).length>0){let c=n.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[c]:o}}return{schemas:a}}let r=cn({...e,processors:rc});return Re(t,r),un(r,t),ln(r,t)}var ac=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let r=e?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=cn({processors:rc,target:r,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,r={path:[],schemaPath:[]}){return Re(e,this.ctx,r)}emit(e,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),un(this.ctx,e);let i=ln(this.ctx,e),{"~standard":n,...o}=i;return o}};var ov={};var Zo={};Et(Zo,{ZodAny:()=>tm,ZodArray:()=>om,ZodBase64:()=>Rc,ZodBase64URL:()=>Ac,ZodBigInt:()=>Ji,ZodBigIntFormat:()=>Tc,ZodBoolean:()=>Hi,ZodCIDRv4:()=>Ic,ZodCIDRv6:()=>kc,ZodCUID:()=>_c,ZodCUID2:()=>vc,ZodCatch:()=>Rm,ZodCodec:()=>Dc,ZodCustom:()=>ea,ZodCustomStringFormat:()=>qi,ZodDate:()=>Ho,ZodDefault:()=>wm,ZodDiscriminatedUnion:()=>sm,ZodE164:()=>$c,ZodEmail:()=>mc,ZodEmoji:()=>gc,ZodEnum:()=>Ki,ZodExactOptional:()=>_m,ZodFile:()=>gm,ZodFunction:()=>Bm,ZodGUID:()=>Vo,ZodIPv4:()=>Sc,ZodIPv6:()=>Ec,ZodIntersection:()=>cm,ZodJWT:()=>Oc,ZodKSUID:()=>xc,ZodLazy:()=>Pm,ZodLiteral:()=>mm,ZodMAC:()=>Gp,ZodMap:()=>hm,ZodNaN:()=>$m,ZodNanoID:()=>yc,ZodNever:()=>nm,ZodNonOptional:()=>Uc,ZodNull:()=>Qp,ZodNullable:()=>bm,ZodNumber:()=>Gi,ZodNumberFormat:()=>Vn,ZodObject:()=>Yo,ZodOptional:()=>Bc,ZodPipe:()=>Cc,ZodPrefault:()=>Sm,ZodPromise:()=>zm,ZodReadonly:()=>Om,ZodRecord:()=>Qo,ZodSet:()=>pm,ZodString:()=>Wi,ZodStringFormat:()=>Te,ZodSuccess:()=>km,ZodSymbol:()=>Yp,ZodTemplateLiteral:()=>Nm,ZodTransform:()=>ym,ZodTuple:()=>lm,ZodType:()=>pe,ZodULID:()=>bc,ZodURL:()=>Go,ZodUUID:()=>Tr,ZodUndefined:()=>Xp,ZodUnion:()=>Xo,ZodUnknown:()=>rm,ZodVoid:()=>im,ZodXID:()=>wc,ZodXor:()=>am,_ZodString:()=>pc,_default:()=>xm,_function:()=>fb,any:()=>Vv,array:()=>Jo,base64:()=>Rv,base64url:()=>Av,bigint:()=>Dv,boolean:()=>Jp,catch:()=>Am,check:()=>hb,cidrv4:()=>Iv,cidrv6:()=>kv,codec:()=>ub,cuid:()=>yv,cuid2:()=>_v,custom:()=>pb,date:()=>Wv,describe:()=>mb,discriminatedUnion:()=>Xv,e164:()=>$v,email:()=>sv,emoji:()=>mv,enum:()=>Lc,exactOptional:()=>vm,file:()=>ob,float32:()=>zv,float64:()=>Bv,function:()=>fb,guid:()=>cv,hash:()=>Lv,hex:()=>Pv,hostname:()=>Nv,httpUrl:()=>pv,instanceof:()=>yb,int:()=>hc,int32:()=>Uv,int64:()=>Mv,intersection:()=>um,ipv4:()=>xv,ipv6:()=>Ev,json:()=>vb,jwt:()=>Ov,keyof:()=>qv,ksuid:()=>wv,lazy:()=>Lm,literal:()=>ib,looseObject:()=>Jv,looseRecord:()=>eb,mac:()=>Sv,map:()=>tb,meta:()=>gb,nan:()=>cb,nanoid:()=>gv,nativeEnum:()=>nb,never:()=>Nc,nonoptional:()=>Im,null:()=>em,nullable:()=>Wo,nullish:()=>ab,number:()=>Hp,object:()=>Gv,optional:()=>Ko,partialRecord:()=>Qv,pipe:()=>qo,prefault:()=>Em,preprocess:()=>bb,promise:()=>db,readonly:()=>Tm,record:()=>fm,refine:()=>Um,set:()=>rb,strictObject:()=>Hv,string:()=>fc,stringFormat:()=>Tv,stringbool:()=>_b,success:()=>sb,superRefine:()=>Cm,symbol:()=>Fv,templateLiteral:()=>lb,transform:()=>zc,tuple:()=>dm,uint32:()=>Cv,uint64:()=>jv,ulid:()=>vv,undefined:()=>Zv,union:()=>Pc,unknown:()=>Zn,url:()=>hv,uuid:()=>uv,uuidv4:()=>lv,uuidv6:()=>dv,uuidv7:()=>fv,void:()=>Kv,xid:()=>bv,xor:()=>Yv});var sc={};Et(sc,{endsWith:()=>zi,gt:()=>$r,gte:()=>qt,includes:()=>Pi,length:()=>Fn,lowercase:()=>Ti,lt:()=>Ar,lte:()=>cr,maxLength:()=>jn,maxSize:()=>sn,mime:()=>Bi,minLength:()=>Mr,minSize:()=>Or,multipleOf:()=>an,negative:()=>Xs,nonnegative:()=>ec,nonpositive:()=>Qs,normalize:()=>Ui,overwrite:()=>br,positive:()=>Ys,property:()=>tc,regex:()=>Oi,size:()=>Mn,slugify:()=>ji,startsWith:()=>Li,toLowerCase:()=>Di,toUpperCase:()=>Mi,trim:()=>Ci,uppercase:()=>Ni});var Vi={};Et(Vi,{ZodISODate:()=>uc,ZodISODateTime:()=>cc,ZodISODuration:()=>dc,ZodISOTime:()=>lc,date:()=>Pp,datetime:()=>Np,duration:()=>zp,time:()=>Lp});var cc=A("ZodISODateTime",(t,e)=>{uf.init(t,e),Te.init(t,e)});function Np(t){return hh(cc,t)}var uc=A("ZodISODate",(t,e)=>{lf.init(t,e),Te.init(t,e)});function Pp(t){return ph(uc,t)}var lc=A("ZodISOTime",(t,e)=>{df.init(t,e),Te.init(t,e)});function Lp(t){return mh(lc,t)}var dc=A("ZodISODuration",(t,e)=>{ff.init(t,e),Te.init(t,e)});function zp(t){return gh(dc,t)}var av=(t,e)=>{Oo.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>No(t,r)},flatten:{value:r=>To(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,wi,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,wi,2)}},isEmpty:{get(){return t.issues.length===0}}})},tk=A("ZodError",av),tr=A("ZodError",av,{Parent:Error});var Bp=Ei(tr),Up=Ii(tr),Cp=ki(tr),Dp=Ri(tr),Mp=os(tr),jp=as(tr),Fp=ss(tr),Zp=cs(tr),Vp=us(tr),Kp=ls(tr),Wp=ds(tr),qp=fs(tr);var pe=A("ZodType",(t,e)=>(le.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:Zi(t,"input"),output:Zi(t,"output")}}),t.toJSONSchema=Gh(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.check=(...r)=>t.clone(j.mergeDefs(e,{checks:[...e.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0}),t.with=t.check,t.clone=(r,i)=>Wt(t,r,i),t.brand=()=>t,t.register=(r,i)=>(r.add(t,i),t),t.parse=(r,i)=>Bp(t,r,i,{callee:t.parse}),t.safeParse=(r,i)=>Cp(t,r,i),t.parseAsync=async(r,i)=>Up(t,r,i,{callee:t.parseAsync}),t.safeParseAsync=async(r,i)=>Dp(t,r,i),t.spa=t.safeParseAsync,t.encode=(r,i)=>Mp(t,r,i),t.decode=(r,i)=>jp(t,r,i),t.encodeAsync=async(r,i)=>Fp(t,r,i),t.decodeAsync=async(r,i)=>Zp(t,r,i),t.safeEncode=(r,i)=>Vp(t,r,i),t.safeDecode=(r,i)=>Kp(t,r,i),t.safeEncodeAsync=async(r,i)=>Wp(t,r,i),t.safeDecodeAsync=async(r,i)=>qp(t,r,i),t.refine=(r,i)=>t.check(Um(r,i)),t.superRefine=r=>t.check(Cm(r)),t.overwrite=r=>t.check(br(r)),t.optional=()=>Ko(t),t.exactOptional=()=>vm(t),t.nullable=()=>Wo(t),t.nullish=()=>Ko(Wo(t)),t.nonoptional=r=>Im(t,r),t.array=()=>Jo(t),t.or=r=>Pc([t,r]),t.and=r=>um(t,r),t.transform=r=>qo(t,zc(r)),t.default=r=>xm(t,r),t.prefault=r=>Em(t,r),t.catch=r=>Am(t,r),t.pipe=r=>qo(t,r),t.readonly=()=>Tm(t),t.describe=r=>{let i=t.clone();return Tt.add(i,{description:r}),i},Object.defineProperty(t,"description",{get(){return Tt.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return Tt.get(t);let i=t.clone();return Tt.add(i,r[0]),i},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t.apply=r=>r(t),t)),pc=A("_ZodString",(t,e)=>{Dn.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(i,n,o)=>Hh(t,i,n,o);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(Oi(...i)),t.includes=(...i)=>t.check(Pi(...i)),t.startsWith=(...i)=>t.check(Li(...i)),t.endsWith=(...i)=>t.check(zi(...i)),t.min=(...i)=>t.check(Mr(...i)),t.max=(...i)=>t.check(jn(...i)),t.length=(...i)=>t.check(Fn(...i)),t.nonempty=(...i)=>t.check(Mr(1,...i)),t.lowercase=i=>t.check(Ti(i)),t.uppercase=i=>t.check(Ni(i)),t.trim=()=>t.check(Ci()),t.normalize=(...i)=>t.check(Ui(...i)),t.toLowerCase=()=>t.check(Di()),t.toUpperCase=()=>t.check(Mi()),t.slugify=()=>t.check(ji())}),Wi=A("ZodString",(t,e)=>{Dn.init(t,e),pc.init(t,e),t.email=r=>t.check(Ts(mc,r)),t.url=r=>t.check(Fo(Go,r)),t.jwt=r=>t.check(Js(Oc,r)),t.emoji=r=>t.check(Bs(gc,r)),t.guid=r=>t.check(jo(Vo,r)),t.uuid=r=>t.check(Ns(Tr,r)),t.uuidv4=r=>t.check(Ps(Tr,r)),t.uuidv6=r=>t.check(Ls(Tr,r)),t.uuidv7=r=>t.check(zs(Tr,r)),t.nanoid=r=>t.check(Us(yc,r)),t.guid=r=>t.check(jo(Vo,r)),t.cuid=r=>t.check(Cs(_c,r)),t.cuid2=r=>t.check(Ds(vc,r)),t.ulid=r=>t.check(Ms(bc,r)),t.base64=r=>t.check(qs(Rc,r)),t.base64url=r=>t.check(Gs(Ac,r)),t.xid=r=>t.check(js(wc,r)),t.ksuid=r=>t.check(Fs(xc,r)),t.ipv4=r=>t.check(Zs(Sc,r)),t.ipv6=r=>t.check(Vs(Ec,r)),t.cidrv4=r=>t.check(Ks(Ic,r)),t.cidrv6=r=>t.check(Ws(kc,r)),t.e164=r=>t.check(Hs($c,r)),t.datetime=r=>t.check(Np(r)),t.date=r=>t.check(Pp(r)),t.time=r=>t.check(Lp(r)),t.duration=r=>t.check(zp(r))});function fc(t){return uh(Wi,t)}var Te=A("ZodStringFormat",(t,e)=>{Oe.init(t,e),pc.init(t,e)}),mc=A("ZodEmail",(t,e)=>{Qd.init(t,e),Te.init(t,e)});function sv(t){return Ts(mc,t)}var Vo=A("ZodGUID",(t,e)=>{Yd.init(t,e),Te.init(t,e)});function cv(t){return jo(Vo,t)}var Tr=A("ZodUUID",(t,e)=>{Xd.init(t,e),Te.init(t,e)});function uv(t){return Ns(Tr,t)}function lv(t){return Ps(Tr,t)}function dv(t){return Ls(Tr,t)}function fv(t){return zs(Tr,t)}var Go=A("ZodURL",(t,e)=>{ef.init(t,e),Te.init(t,e)});function hv(t){return Fo(Go,t)}function pv(t){return Fo(Go,{protocol:/^https?$/,hostname:mr.domain,...j.normalizeParams(t)})}var gc=A("ZodEmoji",(t,e)=>{tf.init(t,e),Te.init(t,e)});function mv(t){return Bs(gc,t)}var yc=A("ZodNanoID",(t,e)=>{rf.init(t,e),Te.init(t,e)});function gv(t){return Us(yc,t)}var _c=A("ZodCUID",(t,e)=>{nf.init(t,e),Te.init(t,e)});function yv(t){return Cs(_c,t)}var vc=A("ZodCUID2",(t,e)=>{of.init(t,e),Te.init(t,e)});function _v(t){return Ds(vc,t)}var bc=A("ZodULID",(t,e)=>{af.init(t,e),Te.init(t,e)});function vv(t){return Ms(bc,t)}var wc=A("ZodXID",(t,e)=>{sf.init(t,e),Te.init(t,e)});function bv(t){return js(wc,t)}var xc=A("ZodKSUID",(t,e)=>{cf.init(t,e),Te.init(t,e)});function wv(t){return Fs(xc,t)}var Sc=A("ZodIPv4",(t,e)=>{hf.init(t,e),Te.init(t,e)});function xv(t){return Zs(Sc,t)}var Gp=A("ZodMAC",(t,e)=>{mf.init(t,e),Te.init(t,e)});function Sv(t){return dh(Gp,t)}var Ec=A("ZodIPv6",(t,e)=>{pf.init(t,e),Te.init(t,e)});function Ev(t){return Vs(Ec,t)}var Ic=A("ZodCIDRv4",(t,e)=>{gf.init(t,e),Te.init(t,e)});function Iv(t){return Ks(Ic,t)}var kc=A("ZodCIDRv6",(t,e)=>{yf.init(t,e),Te.init(t,e)});function kv(t){return Ws(kc,t)}var Rc=A("ZodBase64",(t,e)=>{vf.init(t,e),Te.init(t,e)});function Rv(t){return qs(Rc,t)}var Ac=A("ZodBase64URL",(t,e)=>{bf.init(t,e),Te.init(t,e)});function Av(t){return Gs(Ac,t)}var $c=A("ZodE164",(t,e)=>{wf.init(t,e),Te.init(t,e)});function $v(t){return Hs($c,t)}var Oc=A("ZodJWT",(t,e)=>{xf.init(t,e),Te.init(t,e)});function Ov(t){return Js(Oc,t)}var qi=A("ZodCustomStringFormat",(t,e)=>{Sf.init(t,e),Te.init(t,e)});function Tv(t,e,r={}){return Fi(qi,t,e,r)}function Nv(t){return Fi(qi,"hostname",mr.hostname,t)}function Pv(t){return Fi(qi,"hex",mr.hex,t)}function Lv(t,e){let r=e?.enc??"hex",i=`${t}_${r}`,n=mr[i];if(!n)throw new Error(`Unrecognized hash format: ${i}`);return Fi(qi,i,n,e)}var Gi=A("ZodNumber",(t,e)=>{xs.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(i,n,o)=>Jh(t,i,n,o),t.gt=(i,n)=>t.check($r(i,n)),t.gte=(i,n)=>t.check(qt(i,n)),t.min=(i,n)=>t.check(qt(i,n)),t.lt=(i,n)=>t.check(Ar(i,n)),t.lte=(i,n)=>t.check(cr(i,n)),t.max=(i,n)=>t.check(cr(i,n)),t.int=i=>t.check(hc(i)),t.safe=i=>t.check(hc(i)),t.positive=i=>t.check($r(0,i)),t.nonnegative=i=>t.check(qt(0,i)),t.negative=i=>t.check(Ar(0,i)),t.nonpositive=i=>t.check(cr(0,i)),t.multipleOf=(i,n)=>t.check(an(i,n)),t.step=(i,n)=>t.check(an(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 Hp(t){return yh(Gi,t)}var Vn=A("ZodNumberFormat",(t,e)=>{Ef.init(t,e),Gi.init(t,e)});function hc(t){return vh(Vn,t)}function zv(t){return bh(Vn,t)}function Bv(t){return wh(Vn,t)}function Uv(t){return xh(Vn,t)}function Cv(t){return Sh(Vn,t)}var Hi=A("ZodBoolean",(t,e)=>{Bo.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Yh(t,r,i,n)});function Jp(t){return Eh(Hi,t)}var Ji=A("ZodBigInt",(t,e)=>{Ss.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(i,n,o)=>Xh(t,i,n,o),t.gte=(i,n)=>t.check(qt(i,n)),t.min=(i,n)=>t.check(qt(i,n)),t.gt=(i,n)=>t.check($r(i,n)),t.gte=(i,n)=>t.check(qt(i,n)),t.min=(i,n)=>t.check(qt(i,n)),t.lt=(i,n)=>t.check(Ar(i,n)),t.lte=(i,n)=>t.check(cr(i,n)),t.max=(i,n)=>t.check(cr(i,n)),t.positive=i=>t.check($r(BigInt(0),i)),t.negative=i=>t.check(Ar(BigInt(0),i)),t.nonpositive=i=>t.check(cr(BigInt(0),i)),t.nonnegative=i=>t.check(qt(BigInt(0),i)),t.multipleOf=(i,n)=>t.check(an(i,n));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});function Dv(t){return kh(Ji,t)}var Tc=A("ZodBigIntFormat",(t,e)=>{If.init(t,e),Ji.init(t,e)});function Mv(t){return Ah(Tc,t)}function jv(t){return $h(Tc,t)}var Yp=A("ZodSymbol",(t,e)=>{kf.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Qh(t,r,i,n)});function Fv(t){return Oh(Yp,t)}var Xp=A("ZodUndefined",(t,e)=>{Rf.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>tp(t,r,i,n)});function Zv(t){return Th(Xp,t)}var Qp=A("ZodNull",(t,e)=>{Af.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>ep(t,r,i,n)});function em(t){return Nh(Qp,t)}var tm=A("ZodAny",(t,e)=>{$f.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>ip(t,r,i,n)});function Vv(){return Ph(tm)}var rm=A("ZodUnknown",(t,e)=>{Of.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>op(t,r,i,n)});function Zn(){return Lh(rm)}var nm=A("ZodNever",(t,e)=>{Tf.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>np(t,r,i,n)});function Nc(t){return zh(nm,t)}var im=A("ZodVoid",(t,e)=>{Nf.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>rp(t,r,i,n)});function Kv(t){return Bh(im,t)}var Ho=A("ZodDate",(t,e)=>{Pf.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(i,n,o)=>ap(t,i,n,o),t.min=(i,n)=>t.check(qt(i,n)),t.max=(i,n)=>t.check(cr(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 Wv(t){return Uh(Ho,t)}var om=A("ZodArray",(t,e)=>{Lf.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>_p(t,r,i,n),t.element=e.element,t.min=(r,i)=>t.check(Mr(r,i)),t.nonempty=r=>t.check(Mr(1,r)),t.max=(r,i)=>t.check(jn(r,i)),t.length=(r,i)=>t.check(Fn(r,i)),t.unwrap=()=>t.element});function Jo(t,e){return Mh(om,t,e)}function qv(t){let e=t._zod.def.shape;return Lc(Object.keys(e))}var Yo=A("ZodObject",(t,e)=>{zf.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>vp(t,r,i,n),j.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>Lc(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:Zn()}),t.loose=()=>t.clone({...t._zod.def,catchall:Zn()}),t.strict=()=>t.clone({...t._zod.def,catchall:Nc()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=r=>j.extend(t,r),t.safeExtend=r=>j.safeExtend(t,r),t.merge=r=>j.merge(t,r),t.pick=r=>j.pick(t,r),t.omit=r=>j.omit(t,r),t.partial=(...r)=>j.partial(Bc,t,r[0]),t.required=(...r)=>j.required(Uc,t,r[0])});function Gv(t,e){let r={type:"object",shape:t??{},...j.normalizeParams(e)};return new Yo(r)}function Hv(t,e){return new Yo({type:"object",shape:t,catchall:Nc(),...j.normalizeParams(e)})}function Jv(t,e){return new Yo({type:"object",shape:t,catchall:Zn(),...j.normalizeParams(e)})}var Xo=A("ZodUnion",(t,e)=>{Uo.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>nc(t,r,i,n),t.options=e.options});function Pc(t,e){return new Xo({type:"union",options:t,...j.normalizeParams(e)})}var am=A("ZodXor",(t,e)=>{Xo.init(t,e),Bf.init(t,e),t._zod.processJSONSchema=(r,i,n)=>nc(t,r,i,n),t.options=e.options});function Yv(t,e){return new am({type:"union",options:t,inclusive:!1,...j.normalizeParams(e)})}var sm=A("ZodDiscriminatedUnion",(t,e)=>{Xo.init(t,e),Uf.init(t,e)});function Xv(t,e,r){return new sm({type:"union",options:e,discriminator:t,...j.normalizeParams(r)})}var cm=A("ZodIntersection",(t,e)=>{Cf.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>bp(t,r,i,n)});function um(t,e){return new cm({type:"intersection",left:t,right:e})}var lm=A("ZodTuple",(t,e)=>{Es.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>wp(t,r,i,n),t.rest=r=>t.clone({...t._zod.def,rest:r})});function dm(t,e,r){let i=e instanceof le,n=i?r:e,o=i?e:null;return new lm({type:"tuple",items:t,rest:o,...j.normalizeParams(n)})}var Qo=A("ZodRecord",(t,e)=>{Df.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>xp(t,r,i,n),t.keyType=e.keyType,t.valueType=e.valueType});function fm(t,e,r){return new Qo({type:"record",keyType:t,valueType:e,...j.normalizeParams(r)})}function Qv(t,e,r){let i=Wt(t);return i._zod.values=void 0,new Qo({type:"record",keyType:i,valueType:e,...j.normalizeParams(r)})}function eb(t,e,r){return new Qo({type:"record",keyType:t,valueType:e,mode:"loose",...j.normalizeParams(r)})}var hm=A("ZodMap",(t,e)=>{Mf.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>gp(t,r,i,n),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...r)=>t.check(Or(...r)),t.nonempty=r=>t.check(Or(1,r)),t.max=(...r)=>t.check(sn(...r)),t.size=(...r)=>t.check(Mn(...r))});function tb(t,e,r){return new hm({type:"map",keyType:t,valueType:e,...j.normalizeParams(r)})}var pm=A("ZodSet",(t,e)=>{jf.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>yp(t,r,i,n),t.min=(...r)=>t.check(Or(...r)),t.nonempty=r=>t.check(Or(1,r)),t.max=(...r)=>t.check(sn(...r)),t.size=(...r)=>t.check(Mn(...r))});function rb(t,e){return new pm({type:"set",valueType:t,...j.normalizeParams(e)})}var Ki=A("ZodEnum",(t,e)=>{Ff.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(i,n,o)=>sp(t,i,n,o),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 a of i)if(r.has(a))o[a]=e.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Ki({...e,checks:[],...j.normalizeParams(n),entries:o})},t.exclude=(i,n)=>{let o={...e.entries};for(let a of i)if(r.has(a))delete o[a];else throw new Error(`Key ${a} not found in enum`);return new Ki({...e,checks:[],...j.normalizeParams(n),entries:o})}});function Lc(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new Ki({type:"enum",entries:r,...j.normalizeParams(e)})}function nb(t,e){return new Ki({type:"enum",entries:t,...j.normalizeParams(e)})}var mm=A("ZodLiteral",(t,e)=>{Zf.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>cp(t,r,i,n),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 ib(t,e){return new mm({type:"literal",values:Array.isArray(t)?t:[t],...j.normalizeParams(e)})}var gm=A("ZodFile",(t,e)=>{Vf.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>dp(t,r,i,n),t.min=(r,i)=>t.check(Or(r,i)),t.max=(r,i)=>t.check(sn(r,i)),t.mime=(r,i)=>t.check(Bi(Array.isArray(r)?r:[r],i))});function ob(t){return jh(gm,t)}var ym=A("ZodTransform",(t,e)=>{Kf.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>mp(t,r,i,n),t._zod.parse=(r,i)=>{if(i.direction==="backward")throw new en(t.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(j.issue(o,r.value,e));else{let a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=t),r.issues.push(j.issue(a))}};let n=e.transform(r.value,r);return n instanceof Promise?n.then(o=>(r.value=o,r)):(r.value=n,r)}});function zc(t){return new ym({type:"transform",transform:t})}var Bc=A("ZodOptional",(t,e)=>{Is.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>ic(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function Ko(t){return new Bc({type:"optional",innerType:t})}var _m=A("ZodExactOptional",(t,e)=>{Wf.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>ic(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function vm(t){return new _m({type:"optional",innerType:t})}var bm=A("ZodNullable",(t,e)=>{qf.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Sp(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function Wo(t){return new bm({type:"nullable",innerType:t})}function ab(t){return Ko(Wo(t))}var wm=A("ZodDefault",(t,e)=>{Gf.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ip(t,r,i,n),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function xm(t,e){return new wm({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():j.shallowClone(e)}})}var Sm=A("ZodPrefault",(t,e)=>{Hf.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>kp(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function Em(t,e){return new Sm({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():j.shallowClone(e)}})}var Uc=A("ZodNonOptional",(t,e)=>{Jf.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ep(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function Im(t,e){return new Uc({type:"nonoptional",innerType:t,...j.normalizeParams(e)})}var km=A("ZodSuccess",(t,e)=>{Yf.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>fp(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function sb(t){return new km({type:"success",innerType:t})}var Rm=A("ZodCatch",(t,e)=>{Xf.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Rp(t,r,i,n),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function Am(t,e){return new Rm({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var $m=A("ZodNaN",(t,e)=>{Qf.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>up(t,r,i,n)});function cb(t){return Dh($m,t)}var Cc=A("ZodPipe",(t,e)=>{eh.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ap(t,r,i,n),t.in=e.in,t.out=e.out});function qo(t,e){return new Cc({type:"pipe",in:t,out:e})}var Dc=A("ZodCodec",(t,e)=>{Cc.init(t,e),Co.init(t,e)});function ub(t,e,r){return new Dc({type:"pipe",in:t,out:e,transform:r.decode,reverseTransform:r.encode})}var Om=A("ZodReadonly",(t,e)=>{th.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>$p(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function Tm(t){return new Om({type:"readonly",innerType:t})}var Nm=A("ZodTemplateLiteral",(t,e)=>{rh.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>lp(t,r,i,n)});function lb(t,e){return new Nm({type:"template_literal",parts:t,...j.normalizeParams(e)})}var Pm=A("ZodLazy",(t,e)=>{oh.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Tp(t,r,i,n),t.unwrap=()=>t._zod.def.getter()});function Lm(t){return new Pm({type:"lazy",getter:t})}var zm=A("ZodPromise",(t,e)=>{ih.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Op(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function db(t){return new zm({type:"promise",innerType:t})}var Bm=A("ZodFunction",(t,e)=>{nh.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>pp(t,r,i,n)});function fb(t){return new Bm({type:"function",input:Array.isArray(t?.input)?dm(t?.input):t?.input??Jo(Zn()),output:t?.output??Zn()})}var ea=A("ZodCustom",(t,e)=>{ah.init(t,e),pe.init(t,e),t._zod.processJSONSchema=(r,i,n)=>hp(t,r,i,n)});function hb(t){let e=new Le({check:"custom"});return e._zod.check=t,e}function pb(t,e){return Fh(ea,t??(()=>!0),e)}function Um(t,e={}){return Zh(ea,t,e)}function Cm(t){return Vh(t)}var mb=Kh,gb=Wh;function yb(t,e={}){let r=new ea({type:"custom",check:"custom",fn:i=>i instanceof t,abort:!0,...j.normalizeParams(e)});return r._zod.bag.Class=t,r._zod.check=i=>{i.value instanceof t||i.issues.push({code:"invalid_type",expected:t.name,input:i.value,inst:r,path:[...r._zod.def.path??[]]})},r}var _b=(...t)=>qh({Codec:Dc,Boolean:Hi,String:Wi},...t);function vb(t){let e=Lm(()=>Pc([fc(t),Hp(),Jp(),em(),Jo(e),fm(fc(),e)]));return e}function bb(t,e){return qo(zc(t),e)}var nk={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"};function ik(t){et({customError:t})}function ok(){return et().customError}var Dm;Dm||(Dm={});var J={...Zo,...sc,iso:Vi},ak=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function sk(t,e){let r=t.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}function ck(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=t.slice(1).split("/").filter(Boolean);if(r.length===0)return e.rootSchema;let i=e.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===i){let n=r[1];if(!n||!e.defs[n])throw new Error(`Reference not found: ${t}`);return e.defs[n]}throw new Error(`Reference not found: ${t}`)}function wb(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return J.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){let n=t.$ref;if(e.refs.has(n))return e.refs.get(n);if(e.processing.has(n))return J.lazy(()=>{if(!e.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return e.refs.get(n)});e.processing.add(n);let o=ck(n,e),a=Bt(o,e);return e.refs.set(n,a),e.processing.delete(n),a}if(t.enum!==void 0){let n=t.enum;if(e.version==="openapi-3.0"&&t.nullable===!0&&n.length===1&&n[0]===null)return J.null();if(n.length===0)return J.never();if(n.length===1)return J.literal(n[0]);if(n.every(a=>typeof a=="string"))return J.enum(n);let o=n.map(a=>J.literal(a));return o.length<2?o[0]:J.union([o[0],o[1],...o.slice(2)])}if(t.const!==void 0)return J.literal(t.const);let r=t.type;if(Array.isArray(r)){let n=r.map(o=>{let a={...t,type:o};return wb(a,e)});return n.length===0?J.never():n.length===1?n[0]:J.union(n)}if(!r)return J.any();let i;switch(r){case"string":{let n=J.string();if(t.format){let o=t.format;o==="email"?n=n.check(J.email()):o==="uri"||o==="uri-reference"?n=n.check(J.url()):o==="uuid"||o==="guid"?n=n.check(J.uuid()):o==="date-time"?n=n.check(J.iso.datetime()):o==="date"?n=n.check(J.iso.date()):o==="time"?n=n.check(J.iso.time()):o==="duration"?n=n.check(J.iso.duration()):o==="ipv4"?n=n.check(J.ipv4()):o==="ipv6"?n=n.check(J.ipv6()):o==="mac"?n=n.check(J.mac()):o==="cidr"?n=n.check(J.cidrv4()):o==="cidr-v6"?n=n.check(J.cidrv6()):o==="base64"?n=n.check(J.base64()):o==="base64url"?n=n.check(J.base64url()):o==="e164"?n=n.check(J.e164()):o==="jwt"?n=n.check(J.jwt()):o==="emoji"?n=n.check(J.emoji()):o==="nanoid"?n=n.check(J.nanoid()):o==="cuid"?n=n.check(J.cuid()):o==="cuid2"?n=n.check(J.cuid2()):o==="ulid"?n=n.check(J.ulid()):o==="xid"?n=n.check(J.xid()):o==="ksuid"&&(n=n.check(J.ksuid()))}typeof t.minLength=="number"&&(n=n.min(t.minLength)),typeof t.maxLength=="number"&&(n=n.max(t.maxLength)),t.pattern&&(n=n.regex(new RegExp(t.pattern))),i=n;break}case"number":case"integer":{let n=r==="integer"?J.number().int():J.number();typeof t.minimum=="number"&&(n=n.min(t.minimum)),typeof t.maximum=="number"&&(n=n.max(t.maximum)),typeof t.exclusiveMinimum=="number"?n=n.gt(t.exclusiveMinimum):t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(n=n.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?n=n.lt(t.exclusiveMaximum):t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(n=n.lt(t.maximum)),typeof t.multipleOf=="number"&&(n=n.multipleOf(t.multipleOf)),i=n;break}case"boolean":{i=J.boolean();break}case"null":{i=J.null();break}case"object":{let n={},o=t.properties||{},a=new Set(t.required||[]);for(let[c,l]of Object.entries(o)){let h=Bt(l,e);n[c]=a.has(c)?h:h.optional()}if(t.propertyNames){let c=Bt(t.propertyNames,e),l=t.additionalProperties&&typeof t.additionalProperties=="object"?Bt(t.additionalProperties,e):J.any();if(Object.keys(n).length===0){i=J.record(c,l);break}let h=J.object(n).passthrough(),g=J.looseRecord(c,l);i=J.intersection(h,g);break}if(t.patternProperties){let c=t.patternProperties,l=Object.keys(c),h=[];for(let w of l){let v=Bt(c[w],e),$=J.string().regex(new RegExp(w));h.push(J.looseRecord($,v))}let g=[];if(Object.keys(n).length>0&&g.push(J.object(n).passthrough()),g.push(...h),g.length===0)i=J.object({}).passthrough();else if(g.length===1)i=g[0];else{let w=J.intersection(g[0],g[1]);for(let v=2;v<g.length;v++)w=J.intersection(w,g[v]);i=w}break}let s=J.object(n);t.additionalProperties===!1?i=s.strict():typeof t.additionalProperties=="object"?i=s.catchall(Bt(t.additionalProperties,e)):i=s.passthrough();break}case"array":{let n=t.prefixItems,o=t.items;if(n&&Array.isArray(n)){let a=n.map(c=>Bt(c,e)),s=o&&typeof o=="object"&&!Array.isArray(o)?Bt(o,e):void 0;s?i=J.tuple(a).rest(s):i=J.tuple(a),typeof t.minItems=="number"&&(i=i.check(J.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(J.maxLength(t.maxItems)))}else if(Array.isArray(o)){let a=o.map(c=>Bt(c,e)),s=t.additionalItems&&typeof t.additionalItems=="object"?Bt(t.additionalItems,e):void 0;s?i=J.tuple(a).rest(s):i=J.tuple(a),typeof t.minItems=="number"&&(i=i.check(J.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(J.maxLength(t.maxItems)))}else if(o!==void 0){let a=Bt(o,e),s=J.array(a);typeof t.minItems=="number"&&(s=s.min(t.minItems)),typeof t.maxItems=="number"&&(s=s.max(t.maxItems)),i=s}else i=J.array(J.any());break}default:throw new Error(`Unsupported type: ${r}`)}return t.description&&(i=i.describe(t.description)),t.default!==void 0&&(i=i.default(t.default)),i}function Bt(t,e){if(typeof t=="boolean")return t?J.any():J.never();let r=wb(t,e),i=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){let s=t.anyOf.map(l=>Bt(l,e)),c=J.union(s);r=i?J.intersection(r,c):c}if(t.oneOf&&Array.isArray(t.oneOf)){let s=t.oneOf.map(l=>Bt(l,e)),c=J.xor(s);r=i?J.intersection(r,c):c}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)r=i?r:J.any();else{let s=i?r:Bt(t.allOf[0],e),c=i?0:1;for(let l=c;l<t.allOf.length;l++)s=J.intersection(s,Bt(t.allOf[l],e));r=s}t.nullable===!0&&e.version==="openapi-3.0"&&(r=J.nullable(r)),t.readOnly===!0&&(r=J.readonly(r));let n={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let s of o)s in t&&(n[s]=t[s]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let s of a)s in t&&(n[s]=t[s]);for(let s of Object.keys(t))ak.has(s)||(n[s]=t[s]);return Object.keys(n).length>0&&e.registry.add(r,n),r}function xb(t,e){if(typeof t=="boolean")return t?J.any():J.never();let r=sk(t,e?.defaultTarget),i=t.$defs||t.definitions||{},n={version:r,defs:i,refs:new Map,processing:new Set,rootSchema:t,registry:e?.registry??Tt};return Bt(t,n)}var Mm={};Et(Mm,{bigint:()=>fk,boolean:()=>dk,date:()=>hk,number:()=>lk,string:()=>uk});function uk(t){return lh(Wi,t)}function lk(t){return _h(Gi,t)}function dk(t){return Ih(Hi,t)}function fk(t){return Rh(Ji,t)}function hk(t){return Ch(Ho,t)}et(ks());var pk=/[@#$%^&*+=/\\|~«»]/,mk=/(!{2,}|\?{2,}|-{2,})/,gk=/[\u{1F300}-\u{1F9FF}]|[\u{2702}-\u{27B0}]|[\u{2600}-\u{26FF}]|[\u{2B00}-\u{2BFF}]/u,dn=({max:t,noSpaces:e}={})=>(e?q.string().max(t??Number.POSITIVE_INFINITY).regex(/^\S*$/,{message:"Spaces are not allowed"}):q.string().max(t??Number.POSITIVE_INFINITY)).refine(i=>!gk.test(i),{message:"Emojis and symbols are not allowed"}).refine(i=>!pk.test(i),{message:"Special characters (@, #, $, %, ^, &, *, +, =, /, \\, |, ~, \xAB, \xBB) are not allowed"}).refine(i=>!mk.test(i),{message:"Repeated punctuations (!!, ??, --) are not allowed"}),It=q.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"}),Yi=q.string().max(32),ta=q.string().max(32),yk=/^[-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)$/,jm=q.string().regex(yk,{message:"Invalid CAIP-19 asset ID"}),Xi=q.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."}),_k=/^(?!.*\.\.)([a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Fm=q.string().max(1024).regex(_k,{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"}),Zm=q.union([q.literal("1:1"),q.literal("3:2")]),Vm=q.object({header:q.string(),payload:q.string(),signature:q.string()}),vk=q.object({fid:q.number(),type:q.literal("app_key"),key:q.string().startsWith("0x")});var Sb=q.object({type:q.literal("launch_frame"),name:Yi,url:It.optional(),splashImageUrl:It.optional(),splashBackgroundColor:Xi.optional()}),Eb=q.object({type:q.literal("launch_miniapp"),name:Yi,url:It.optional(),splashImageUrl:It.optional(),splashBackgroundColor:Xi.optional()}),Ib=q.object({type:q.literal("view_token"),token:jm}),kb=q.discriminatedUnion("type",[Eb,Ib,Sb]),Rb=q.object({title:ta,action:kb}),Ab=q.object({version:q.union([q.string(),q.number()]).transform(t=>String(t)).pipe(q.union([q.literal("next"),q.literal("1")])),imageUrl:It,aspectRatio:Zm.optional(),button:Rb}),$b=t=>Ab.safeParse(t),bk=$b;var Mc=q.object({url:q.string(),token:q.string()}),wk=q.object({notificationId:q.string().max(128),title:q.string().max(32),body:q.string().max(128),targetUrl:It,tokens:q.string().array().max(100)}),xk=q.object({result:q.object({successfulTokens:q.array(q.string()),invalidTokens:q.array(q.string()),rateLimitedTokens:q.array(q.string())})});var Ob=q.object({event:q.literal("miniapp_added"),notificationDetails:Mc.optional()}),Tb=q.object({event:q.literal("miniapp_removed")}),Nb=q.object({event:q.literal("notifications_enabled"),notificationDetails:Mc.required()}),Pb=q.object({event:q.literal("notifications_disabled")}),Sk=q.discriminatedUnion("event",[Ob,Tb,Nb,Pb]);var Lb={};var Km=["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","actions.openMiniApp","actions.requestCameraAndMicrophoneAccess","experimental.signManifest","haptics.impactOccurred","haptics.notificationOccurred","haptics.selectionChanged","back"];var zb=["games","social","finance","utility","productivity","health-fitness","news-media","music","shopping","education","developer-tools","entertainment","art-creativity"],Bb=q.enum(zb),Ub=q.union([q.literal("0.0.0"),q.literal("0.0.1"),q.literal("1"),q.literal("next")]),Cb=dn({max:30}),Db=dn({max:170}),Mb=q.array(It).max(3),jb=q.array(dn({max:20,noSpaces:!0})).max(5),Fb=dn({max:30}),Zb=dn({max:30}),Vb=dn({max:100}),Kb=q.boolean(),Wb=["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","eip155:999","solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"];function qb(t){let e=new Set(t);return Array.from(e)}var Gb=q.array(q.enum(Wb)).transform(qb),Hb=q.array(q.enum(Km)).transform(qb),Wm=q.object({version:Ub,name:Yi,iconUrl:It,homeUrl:It,imageUrl:It.optional(),buttonTitle:ta.optional(),splashImageUrl:It.optional(),splashBackgroundColor:Xi.optional(),webhookUrl:It.optional(),subtitle:Cb.optional(),description:Db.optional(),screenshotUrls:Mb.optional(),primaryCategory:Bb.optional(),tags:jb.optional(),heroImageUrl:It.optional(),tagline:Fb.optional(),ogTitle:Zb.optional(),ogDescription:Vb.optional(),ogImageUrl:It.optional(),noindex:Kb.optional(),requiredChains:Gb.optional(),requiredCapabilities:Hb.optional(),castShareUrl:It.optional(),canonicalDomain:Fm.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"]}),Ek=q.object({accountAssociation:Vm,miniapp:Wm.optional(),frame:Wm.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"]}).transform(t=>({...t,frame:t.frame??t.miniapp}));var ue=Cr(na());function ia(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function nR(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function hn(t,...e){if(!nR(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 gw(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");ia(t.outputLen),ia(t.blockLen)}function Zr(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 Vc(t,e){hn(t);let r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}var qn=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function yw(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function Kc(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function wr(t,e){return t<<32-e|t>>>e}var ng=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function iR(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function ig(t){for(let e=0;e<t.length;e++)t[e]=iR(t[e])}function _w(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function mn(t){return typeof t=="string"&&(t=_w(t)),hn(t),t}function og(...t){let e=0;for(let i=0;i<t.length;i++){let n=t[i];hn(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 pn=class{clone(){return this._cloneInto()}};function no(t){let e=i=>t().update(mn(i)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function vw(t){let e=(i,n)=>t(n).update(mn(i)).digest(),r=t({});return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=i=>t(i),e}function Wc(t=32){if(qn&&typeof qn.getRandomValues=="function")return qn.getRandomValues(new Uint8Array(t));if(qn&&typeof qn.randomBytes=="function")return qn.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}function oR(t,e,r,i){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,i);let n=BigInt(32),o=BigInt(4294967295),a=Number(r>>n&o),s=Number(r&o),c=i?4:0,l=i?0:4;t.setUint32(e+c,a,i),t.setUint32(e+l,s,i)}function bw(t,e,r){return t&e^~t&r}function ww(t,e,r){return t&e^t&r^e&r}var io=class extends pn{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=Kc(this.buffer)}update(e){Zr(this);let{view:r,buffer:i,blockLen:n}=this;e=mn(e);let o=e.length;for(let a=0;a<o;){let s=Math.min(n-this.pos,o-a);if(s===n){let c=Kc(e);for(;n<=o-a;a+=n)this.process(c,a);continue}i.set(e.subarray(a,a+s),this.pos),this.pos+=s,a+=s,this.pos===n&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Zr(this),Vc(e,this),this.finished=!0;let{buffer:r,view:i,blockLen:n,isLE:o}=this,{pos:a}=this;r[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>n-a&&(this.process(i,0),a=0);for(let g=a;g<n;g++)r[g]=0;oR(i,n-8,BigInt(this.length*8),o),this.process(i,0);let s=Kc(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let l=c/4,h=this.get();if(l>h.length)throw new Error("_sha2: outputLen bigger than state");for(let g=0;g<l;g++)s.setUint32(4*g,h[g],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:a,pos:s}=this;return e.length=n,e.pos=s,e.finished=o,e.destroyed=a,n%r&&e.buffer.set(i),e}};var qc=BigInt(4294967295),ag=BigInt(32);function xw(t,e=!1){return e?{h:Number(t&qc),l:Number(t>>ag&qc)}:{h:Number(t>>ag&qc)|0,l:Number(t&qc)|0}}function sg(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:a}=xw(t[n],e);[r[n],i[n]]=[o,a]}return[r,i]}var aR=(t,e)=>BigInt(t>>>0)<<ag|BigInt(e>>>0),sR=(t,e,r)=>t>>>r,cR=(t,e,r)=>t<<32-r|e>>>r,uR=(t,e,r)=>t>>>r|e<<32-r,lR=(t,e,r)=>t<<32-r|e>>>r,dR=(t,e,r)=>t<<64-r|e>>>r-32,fR=(t,e,r)=>t>>>r-32|e<<64-r,hR=(t,e)=>e,pR=(t,e)=>t,cg=(t,e,r)=>t<<r|e>>>32-r,ug=(t,e,r)=>e<<r|t>>>32-r,lg=(t,e,r)=>e<<r-32|t>>>64-r,dg=(t,e,r)=>t<<r-32|e>>>64-r;function mR(t,e,r,i){let n=(e>>>0)+(i>>>0);return{h:t+r+(n/2**32|0)|0,l:n|0}}var gR=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),yR=(t,e,r,i)=>e+r+i+(t/2**32|0)|0,_R=(t,e,r,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(i>>>0),vR=(t,e,r,i,n)=>e+r+i+n+(t/2**32|0)|0,bR=(t,e,r,i,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(i>>>0)+(n>>>0),wR=(t,e,r,i,n,o)=>e+r+i+n+o+(t/2**32|0)|0;var xR={fromBig:xw,split:sg,toBig:aR,shrSH:sR,shrSL:cR,rotrSH:uR,rotrSL:lR,rotrBH:dR,rotrBL:fR,rotr32H:hR,rotr32L:pR,rotlSH:cg,rotlSL:ug,rotlBH:lg,rotlBL:dg,add:mR,add3L:gR,add3H:yR,add4L:_R,add4H:vR,add5H:wR,add5L:bR},ge=xR;var[SR,ER]=ge.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))),gn=new Uint32Array(80),yn=new Uint32Array(80),fg=class extends io{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:a,Dh:s,Dl:c,Eh:l,El:h,Fh:g,Fl:w,Gh:v,Gl:$,Hh:k,Hl:R}=this;return[e,r,i,n,o,a,s,c,l,h,g,w,v,$,k,R]}set(e,r,i,n,o,a,s,c,l,h,g,w,v,$,k,R){this.Ah=e|0,this.Al=r|0,this.Bh=i|0,this.Bl=n|0,this.Ch=o|0,this.Cl=a|0,this.Dh=s|0,this.Dl=c|0,this.Eh=l|0,this.El=h|0,this.Fh=g|0,this.Fl=w|0,this.Gh=v|0,this.Gl=$|0,this.Hh=k|0,this.Hl=R|0}process(e,r){for(let P=0;P<16;P++,r+=4)gn[P]=e.getUint32(r),yn[P]=e.getUint32(r+=4);for(let P=16;P<80;P++){let C=gn[P-15]|0,ee=yn[P-15]|0,X=ge.rotrSH(C,ee,1)^ge.rotrSH(C,ee,8)^ge.shrSH(C,ee,7),Q=ge.rotrSL(C,ee,1)^ge.rotrSL(C,ee,8)^ge.shrSL(C,ee,7),ie=gn[P-2]|0,te=yn[P-2]|0,$e=ge.rotrSH(ie,te,19)^ge.rotrBH(ie,te,61)^ge.shrSH(ie,te,6),oe=ge.rotrSL(ie,te,19)^ge.rotrBL(ie,te,61)^ge.shrSL(ie,te,6),he=ge.add4L(Q,oe,yn[P-7],yn[P-16]),S=ge.add4H(he,X,$e,gn[P-7],gn[P-16]);gn[P]=S|0,yn[P]=he|0}let{Ah:i,Al:n,Bh:o,Bl:a,Ch:s,Cl:c,Dh:l,Dl:h,Eh:g,El:w,Fh:v,Fl:$,Gh:k,Gl:R,Hh:z,Hl:F}=this;for(let P=0;P<80;P++){let C=ge.rotrSH(g,w,14)^ge.rotrSH(g,w,18)^ge.rotrBH(g,w,41),ee=ge.rotrSL(g,w,14)^ge.rotrSL(g,w,18)^ge.rotrBL(g,w,41),X=g&v^~g&k,Q=w&$^~w&R,ie=ge.add5L(F,ee,Q,ER[P],yn[P]),te=ge.add5H(ie,z,C,X,SR[P],gn[P]),$e=ie|0,oe=ge.rotrSH(i,n,28)^ge.rotrBH(i,n,34)^ge.rotrBH(i,n,39),he=ge.rotrSL(i,n,28)^ge.rotrBL(i,n,34)^ge.rotrBL(i,n,39),S=i&o^i&s^o&s,u=n&a^n&c^a&c;z=k|0,F=R|0,k=v|0,R=$|0,v=g|0,$=w|0,{h:g,l:w}=ge.add(l|0,h|0,te|0,$e|0),l=s|0,h=c|0,s=o|0,c=a|0,o=i|0,a=n|0;let f=ge.add3L($e,he,u);i=ge.add3H(f,te,oe,S),n=f|0}({h:i,l:n}=ge.add(this.Ah|0,this.Al|0,i|0,n|0)),{h:o,l:a}=ge.add(this.Bh|0,this.Bl|0,o|0,a|0),{h:s,l:c}=ge.add(this.Ch|0,this.Cl|0,s|0,c|0),{h:l,l:h}=ge.add(this.Dh|0,this.Dl|0,l|0,h|0),{h:g,l:w}=ge.add(this.Eh|0,this.El|0,g|0,w|0),{h:v,l:$}=ge.add(this.Fh|0,this.Fl|0,v|0,$|0),{h:k,l:R}=ge.add(this.Gh|0,this.Gl|0,k|0,R|0),{h:z,l:F}=ge.add(this.Hh|0,this.Hl|0,z|0,F|0),this.set(i,n,o,a,s,c,l,h,g,w,v,$,k,R,z,F)}roundClean(){gn.fill(0),yn.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 Sw=no(()=>new fg);var Jc={};Et(Jc,{aInRange:()=>nr,abool:()=>xr,abytes:()=>oo,bitGet:()=>OR,bitLen:()=>gg,bitMask:()=>aa,bitSet:()=>TR,bytesToHex:()=>Kr,bytesToNumberBE:()=>Wr,bytesToNumberLE:()=>vn,concatBytes:()=>qr,createHmacDrbg:()=>yg,ensureBytes:()=>Ge,equalBytes:()=>AR,hexToBytes:()=>Hn,hexToNumber:()=>mg,inRange:()=>oa,isBytes:()=>_n,memoized:()=>Yn,notImplemented:()=>PR,numberToBytesBE:()=>bn,numberToBytesLE:()=>Jn,numberToHexUnpadded:()=>Gn,numberToVarBytesBE:()=>RR,utf8ToBytes:()=>$R,validateObject:()=>Lr});var Gc=BigInt(0),Hc=BigInt(1),IR=BigInt(2);function _n(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function oo(t){if(!_n(t))throw new Error("Uint8Array expected")}function xr(t,e){if(typeof e!="boolean")throw new Error(t+" boolean expected, got "+e)}var kR=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Kr(t){oo(t);let e="";for(let r=0;r<t.length;r++)e+=kR[t[r]];return e}function Gn(t){let e=t.toString(16);return e.length&1?"0"+e:e}function mg(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?Gc:BigInt("0x"+t)}var Vr={_0:48,_9:57,A:65,F:70,a:97,f:102};function Ew(t){if(t>=Vr._0&&t<=Vr._9)return t-Vr._0;if(t>=Vr.A&&t<=Vr.F)return t-(Vr.A-10);if(t>=Vr.a&&t<=Vr.f)return t-(Vr.a-10)}function Hn(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 a=Ew(t.charCodeAt(o)),s=Ew(t.charCodeAt(o+1));if(a===void 0||s===void 0){let c=t[o]+t[o+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+o)}i[n]=a*16+s}return i}function Wr(t){return mg(Kr(t))}function vn(t){return oo(t),mg(Kr(Uint8Array.from(t).reverse()))}function bn(t,e){return Hn(t.toString(16).padStart(e*2,"0"))}function Jn(t,e){return bn(t,e).reverse()}function RR(t){return Hn(Gn(t))}function Ge(t,e,r){let i;if(typeof e=="string")try{i=Hn(e)}catch(o){throw new Error(t+" must be hex string or Uint8Array, cause: "+o)}else if(_n(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 qr(...t){let e=0;for(let i=0;i<t.length;i++){let n=t[i];oo(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 AR(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 $R(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}var hg=t=>typeof t=="bigint"&&Gc<=t;function oa(t,e,r){return hg(t)&&hg(e)&&hg(r)&&e<=t&&t<r}function nr(t,e,r,i){if(!oa(e,r,i))throw new Error("expected valid "+t+": "+r+" <= n < "+i+", got "+e)}function gg(t){let e;for(e=0;t>Gc;t>>=Hc,e+=1);return e}function OR(t,e){return t>>BigInt(e)&Hc}function TR(t,e,r){return t|(r?Hc:Gc)<<BigInt(e)}var aa=t=>(IR<<BigInt(t-1))-Hc,pg=t=>new Uint8Array(t),Iw=t=>Uint8Array.from(t);function yg(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=pg(t),n=pg(t),o=0,a=()=>{i.fill(1),n.fill(0),o=0},s=(...g)=>r(n,i,...g),c=(g=pg())=>{n=s(Iw([0]),g),i=s(),g.length!==0&&(n=s(Iw([1]),g),i=s())},l=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let g=0,w=[];for(;g<e;){i=s();let v=i.slice();w.push(v),g+=i.length}return qr(...w)};return(g,w)=>{a(),c(g);let v;for(;!(v=w(l()));)c();return a(),v}}var NR={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"||_n(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 Lr(t,e,r={}){let i=(n,o,a)=>{let s=NR[o];if(typeof s!="function")throw new Error("invalid validator function");let c=t[n];if(!(a&&c===void 0)&&!s(c,t))throw new Error("param "+String(n)+" is invalid. Expected "+o+", got "+c)};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 PR=()=>{throw new Error("not implemented")};function Yn(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 kt=BigInt(0),De=BigInt(1),Xn=BigInt(2),LR=BigInt(3),_g=BigInt(4),kw=BigInt(5),Rw=BigInt(8),zR=BigInt(9),BR=BigInt(16);function Ne(t,e){let r=t%e;return r>=kt?r:e+r}function UR(t,e,r){if(e<kt)throw new Error("invalid exponent, negatives unsupported");if(r<=kt)throw new Error("invalid modulus");if(r===De)return kt;let i=De;for(;e>kt;)e&De&&(i=i*t%r),t=t*t%r,e>>=De;return i}function Me(t,e,r){let i=t;for(;e-- >kt;)i*=i,i%=r;return i}function Yc(t,e){if(t===kt)throw new Error("invert: expected non-zero number");if(e<=kt)throw new Error("invert: expected positive modulus, got "+e);let r=Ne(t,e),i=e,n=kt,o=De,a=De,s=kt;for(;r!==kt;){let l=i/r,h=i%r,g=n-a*l,w=o-s*l;i=r,r=h,n=a,o=s,a=g,s=w}if(i!==De)throw new Error("invert: does not exist");return Ne(n,e)}function CR(t){let e=(t-De)/Xn,r,i,n;for(r=t-De,i=0;r%Xn===kt;r/=Xn,i++);for(n=Xn;n<t&&UR(n,e,t)!==t-De;n++)if(n>1e3)throw new Error("Cannot find square root: likely non-prime P");if(i===1){let a=(t+De)/_g;return function(c,l){let h=c.pow(l,a);if(!c.eql(c.sqr(h),l))throw new Error("Cannot find square root");return h}}let o=(r+De)/Xn;return function(s,c){if(s.pow(c,e)===s.neg(s.ONE))throw new Error("Cannot find square root");let l=i,h=s.pow(s.mul(s.ONE,n),r),g=s.pow(c,o),w=s.pow(c,r);for(;!s.eql(w,s.ONE);){if(s.eql(w,s.ZERO))return s.ZERO;let v=1;for(let k=s.sqr(w);v<l&&!s.eql(k,s.ONE);v++)k=s.sqr(k);let $=s.pow(h,De<<BigInt(l-v-1));h=s.sqr($),g=s.mul(g,$),w=s.mul(w,h),l=v}return g}}function DR(t){if(t%_g===LR){let e=(t+De)/_g;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%Rw===kw){let e=(t-kw)/Rw;return function(i,n){let o=i.mul(n,Xn),a=i.pow(o,e),s=i.mul(n,a),c=i.mul(i.mul(s,Xn),a),l=i.mul(s,i.sub(c,i.ONE));if(!i.eql(i.sqr(l),n))throw new Error("Cannot find square root");return l}}return t%BR,CR(t)}var Aw=(t,e)=>(Ne(t,e)&De)===De,MR=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function vg(t){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=MR.reduce((i,n)=>(i[n]="function",i),e);return Lr(t,r)}function jR(t,e,r){if(r<kt)throw new Error("invalid exponent, negatives unsupported");if(r===kt)return t.ONE;if(r===De)return e;let i=t.ONE,n=e;for(;r>kt;)r&De&&(i=t.mul(i,n)),n=t.sqr(n),r>>=De;return i}function FR(t,e){let r=new Array(e.length),i=e.reduce((o,a,s)=>t.is0(a)?o:(r[s]=o,t.mul(o,a)),t.ONE),n=t.inv(i);return e.reduceRight((o,a,s)=>t.is0(a)?o:(r[s]=t.mul(o,r[s]),t.mul(o,a)),n),r}function bg(t,e){let r=e!==void 0?e:t.toString(2).length,i=Math.ceil(r/8);return{nBitLength:r,nByteLength:i}}function wn(t,e,r=!1,i={}){if(t<=kt)throw new Error("invalid field: expected ORDER > 0, got "+t);let{nBitLength:n,nByteLength:o}=bg(t,e);if(o>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let a,s=Object.freeze({ORDER:t,isLE:r,BITS:n,BYTES:o,MASK:aa(n),ZERO:kt,ONE:De,create:c=>Ne(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return kt<=c&&c<t},is0:c=>c===kt,isOdd:c=>(c&De)===De,neg:c=>Ne(-c,t),eql:(c,l)=>c===l,sqr:c=>Ne(c*c,t),add:(c,l)=>Ne(c+l,t),sub:(c,l)=>Ne(c-l,t),mul:(c,l)=>Ne(c*l,t),pow:(c,l)=>jR(s,c,l),div:(c,l)=>Ne(c*Yc(l,t),t),sqrN:c=>c*c,addN:(c,l)=>c+l,subN:(c,l)=>c-l,mulN:(c,l)=>c*l,inv:c=>Yc(c,t),sqrt:i.sqrt||(c=>(a||(a=DR(t)),a(s,c))),invertBatch:c=>FR(s,c),cmov:(c,l,h)=>h?l:c,toBytes:c=>r?Jn(c,o):bn(c,o),fromBytes:c=>{if(c.length!==o)throw new Error("Field.fromBytes: expected "+o+" bytes, got "+c.length);return r?vn(c):Wr(c)}});return Object.freeze(s)}function $w(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 wg(t){let e=$w(t);return e+Math.ceil(e/2)}function Ow(t,e,r=!1){let i=t.length,n=$w(e),o=wg(e);if(i<16||i<o||i>1024)throw new Error("expected "+o+"-1024 bytes of input, got "+i);let a=r?vn(t):Wr(t),s=Ne(a,e-De)+De;return r?Jn(s,n):bn(s,n)}var Tw=BigInt(0),Xc=BigInt(1);function xg(t,e){let r=e.negate();return t?r:e}function Nw(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function Sg(t,e){Nw(t,e);let r=Math.ceil(e/t)+1,i=2**(t-1);return{windows:r,windowSize:i}}function ZR(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 VR(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 Eg=new WeakMap,Pw=new WeakMap;function Ig(t){return Pw.get(t)||1}function Qc(t,e){return{constTimeNegate:xg,hasPrecomputes(r){return Ig(r)!==1},unsafeLadder(r,i,n=t.ZERO){let o=r;for(;i>Tw;)i&Xc&&(n=n.add(o)),o=o.double(),i>>=Xc;return n},precomputeWindow(r,i){let{windows:n,windowSize:o}=Sg(i,e),a=[],s=r,c=s;for(let l=0;l<n;l++){c=s,a.push(c);for(let h=1;h<o;h++)c=c.add(s),a.push(c);s=c.double()}return a},wNAF(r,i,n){let{windows:o,windowSize:a}=Sg(r,e),s=t.ZERO,c=t.BASE,l=BigInt(2**r-1),h=2**r,g=BigInt(r);for(let w=0;w<o;w++){let v=w*a,$=Number(n&l);n>>=g,$>a&&($-=h,n+=Xc);let k=v,R=v+Math.abs($)-1,z=w%2!==0,F=$<0;$===0?c=c.add(xg(z,i[k])):s=s.add(xg(F,i[R]))}return{p:s,f:c}},wNAFUnsafe(r,i,n,o=t.ZERO){let{windows:a,windowSize:s}=Sg(r,e),c=BigInt(2**r-1),l=2**r,h=BigInt(r);for(let g=0;g<a;g++){let w=g*s;if(n===Tw)break;let v=Number(n&c);if(n>>=h,v>s&&(v-=l,n+=Xc),v===0)continue;let $=i[w+Math.abs(v)-1];v<0&&($=$.negate()),o=o.add($)}return o},getPrecomputes(r,i,n){let o=Eg.get(i);return o||(o=this.precomputeWindow(i,r),r!==1&&Eg.set(i,n(o))),o},wNAFCached(r,i,n){let o=Ig(r);return this.wNAF(o,this.getPrecomputes(o,r,n),i)},wNAFCachedUnsafe(r,i,n,o){let a=Ig(r);return a===1?this.unsafeLadder(r,i,o):this.wNAFUnsafe(a,this.getPrecomputes(a,r,n),i,o)},setWindowSize(r,i){Nw(i,e),Pw.set(r,i),Eg.delete(r)}}}function eu(t,e,r,i){if(ZR(r,t),VR(i,e),r.length!==i.length)throw new Error("arrays of points and scalars must have equal length");let n=t.ZERO,o=gg(BigInt(r.length)),a=o>12?o-3:o>4?o-2:o?2:1,s=(1<<a)-1,c=new Array(s+1).fill(n),l=Math.floor((e.BITS-1)/a)*a,h=n;for(let g=l;g>=0;g-=a){c.fill(n);for(let v=0;v<i.length;v++){let $=i[v],k=Number($>>BigInt(g)&BigInt(s));c[k]=c[k].add(r[v])}let w=n;for(let v=c.length-1,$=n;v>0;v--)$=$.add(c[v]),w=w.add($);if(h=h.add(w),g!==0)for(let v=0;v<a;v++)h=h.double()}return h}function sa(t){return vg(t.Fp),Lr(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...bg(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}var Sr=BigInt(0),ir=BigInt(1),tu=BigInt(2),KR=BigInt(8),WR={zip215:!0};function qR(t){let e=sa(t);return Lr(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function Lw(t){let e=qR(t),{Fp:r,n:i,prehash:n,hash:o,randomBytes:a,nByteLength:s,h:c}=e,l=tu<<BigInt(s*8)-ir,h=r.create,g=wn(e.n,e.nBitLength),w=e.uvRatio||((p,m)=>{try{return{isValid:!0,value:r.sqrt(p*r.inv(m))}}catch{return{isValid:!1,value:Sr}}}),v=e.adjustScalarBytes||(p=>p),$=e.domain||((p,m,y)=>{if(xr("phflag",y),m.length||y)throw new Error("Contexts/pre-hash are not supported");return p});function k(p,m){nr("coordinate "+p,m,Sr,l)}function R(p){if(!(p instanceof P))throw new Error("ExtendedPoint expected")}let z=Yn((p,m)=>{let{ex:y,ey:x,ez:I}=p,_=p.is0();m==null&&(m=_?KR:r.inv(I));let d=h(y*m),b=h(x*m),B=h(I*m);if(_)return{x:Sr,y:ir};if(B!==ir)throw new Error("invZ was invalid");return{x:d,y:b}}),F=Yn(p=>{let{a:m,d:y}=e;if(p.is0())throw new Error("bad point: ZERO");let{ex:x,ey:I,ez:_,et:d}=p,b=h(x*x),B=h(I*I),V=h(_*_),W=h(V*V),re=h(b*m),ce=h(V*h(re+B)),fe=h(W+h(y*h(b*B)));if(ce!==fe)throw new Error("bad point: equation left != right (1)");let Ce=h(x*I),me=h(_*d);if(Ce!==me)throw new Error("bad point: equation left != right (2)");return!0});class P{constructor(m,y,x,I){this.ex=m,this.ey=y,this.ez=x,this.et=I,k("x",m),k("y",y),k("z",x),k("t",I),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(m){if(m instanceof P)throw new Error("extended point not allowed");let{x:y,y:x}=m||{};return k("x",y),k("y",x),new P(y,x,ir,h(y*x))}static normalizeZ(m){let y=r.invertBatch(m.map(x=>x.ez));return m.map((x,I)=>x.toAffine(y[I])).map(P.fromAffine)}static msm(m,y){return eu(P,g,m,y)}_setWindowSize(m){X.setWindowSize(this,m)}assertValidity(){F(this)}equals(m){R(m);let{ex:y,ey:x,ez:I}=this,{ex:_,ey:d,ez:b}=m,B=h(y*b),V=h(_*I),W=h(x*b),re=h(d*I);return B===V&&W===re}is0(){return this.equals(P.ZERO)}negate(){return new P(h(-this.ex),this.ey,this.ez,h(-this.et))}double(){let{a:m}=e,{ex:y,ey:x,ez:I}=this,_=h(y*y),d=h(x*x),b=h(tu*h(I*I)),B=h(m*_),V=y+x,W=h(h(V*V)-_-d),re=B+d,ce=re-b,fe=B-d,Ce=h(W*ce),me=h(re*fe),ye=h(W*fe),ar=h(ce*re);return new P(Ce,me,ar,ye)}add(m){R(m);let{a:y,d:x}=e,{ex:I,ey:_,ez:d,et:b}=this,{ex:B,ey:V,ez:W,et:re}=m;if(y===BigInt(-1)){let Fe=h((_-I)*(V+B)),Ze=h((_+I)*(V-B)),_i=h(Ze-Fe);if(_i===Sr)return this.double();let Ve=h(d*tu*re),Ke=h(b*tu*W),xo=Ke+Ve,We=Ze+Fe,qe=Ke-Ve,Ya=h(xo*_i),Xe=h(We*qe),Qe=h(xo*qe),Xa=h(_i*We);return new P(Ya,Xe,Xa,Qe)}let ce=h(I*B),fe=h(_*V),Ce=h(b*x*re),me=h(d*W),ye=h((I+_)*(B+V)-ce-fe),ar=me-Ce,ke=me+Ce,Be=h(fe-y*ce),Ha=h(ye*ar),Je=h(ke*Be),Ye=h(ye*Be),Ja=h(ar*ke);return new P(Ha,Je,Ja,Ye)}subtract(m){return this.add(m.negate())}wNAF(m){return X.wNAFCached(this,m,P.normalizeZ)}multiply(m){let y=m;nr("scalar",y,ir,i);let{p:x,f:I}=this.wNAF(y);return P.normalizeZ([x,I])[0]}multiplyUnsafe(m,y=P.ZERO){let x=m;return nr("scalar",x,Sr,i),x===Sr?ee:this.is0()||x===ir?this:X.wNAFCachedUnsafe(this,x,P.normalizeZ,y)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return X.unsafeLadder(this,i).is0()}toAffine(m){return z(this,m)}clearCofactor(){let{h:m}=e;return m===ir?this:this.multiplyUnsafe(m)}static fromHex(m,y=!1){let{d:x,a:I}=e,_=r.BYTES;m=Ge("pointHex",m,_),xr("zip215",y);let d=m.slice(),b=m[_-1];d[_-1]=b&-129;let B=vn(d),V=y?l:r.ORDER;nr("pointHex.y",B,Sr,V);let W=h(B*B),re=h(W-ir),ce=h(x*W-I),{isValid:fe,value:Ce}=w(re,ce);if(!fe)throw new Error("Point.fromHex: invalid y coordinate");let me=(Ce&ir)===ir,ye=(b&128)!==0;if(!y&&Ce===Sr&&ye)throw new Error("Point.fromHex: x=0 and x_0=1");return ye!==me&&(Ce=h(-Ce)),P.fromAffine({x:Ce,y:B})}static fromPrivateKey(m){return te(m).point}toRawBytes(){let{x:m,y}=this.toAffine(),x=Jn(y,r.BYTES);return x[x.length-1]|=m&ir?128:0,x}toHex(){return Kr(this.toRawBytes())}}P.BASE=new P(e.Gx,e.Gy,ir,h(e.Gx*e.Gy)),P.ZERO=new P(Sr,ir,ir,Sr);let{BASE:C,ZERO:ee}=P,X=Qc(P,s*8);function Q(p){return Ne(p,i)}function ie(p){return Q(vn(p))}function te(p){let m=r.BYTES;p=Ge("private key",p,m);let y=Ge("hashed private key",o(p),2*m),x=v(y.slice(0,m)),I=y.slice(m,2*m),_=ie(x),d=C.multiply(_),b=d.toRawBytes();return{head:x,prefix:I,scalar:_,point:d,pointBytes:b}}function $e(p){return te(p).pointBytes}function oe(p=new Uint8Array,...m){let y=qr(...m);return ie(o($(y,Ge("context",p),!!n)))}function he(p,m,y={}){p=Ge("message",p),n&&(p=n(p));let{prefix:x,scalar:I,pointBytes:_}=te(m),d=oe(y.context,x,p),b=C.multiply(d).toRawBytes(),B=oe(y.context,b,_,p),V=Q(d+B*I);nr("signature.s",V,Sr,i);let W=qr(b,Jn(V,r.BYTES));return Ge("result",W,r.BYTES*2)}let S=WR;function u(p,m,y,x=S){let{context:I,zip215:_}=x,d=r.BYTES;p=Ge("signature",p,2*d),m=Ge("message",m),y=Ge("publicKey",y,d),_!==void 0&&xr("zip215",_),n&&(m=n(m));let b=vn(p.slice(d,2*d)),B,V,W;try{B=P.fromHex(y,_),V=P.fromHex(p.slice(0,d),_),W=C.multiplyUnsafe(b)}catch{return!1}if(!_&&B.isSmallOrder())return!1;let re=oe(I,V.toRawBytes(),B.toRawBytes(),m);return V.add(B.multiplyUnsafe(re)).subtract(W).clearCofactor().equals(P.ZERO)}return C._setWindowSize(8),{CURVE:e,getPublicKey:$e,sign:he,verify:u,ExtendedPoint:P,utils:{getExtendedPublicKey:te,randomPrivateKey:()=>a(r.BYTES),precompute(p=8,m=P.BASE){return m._setWindowSize(p),m.multiply(BigInt(3)),m}}}}var kg=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),zw=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),ZB=BigInt(0),GR=BigInt(1),Bw=BigInt(2),VB=BigInt(3),HR=BigInt(5),JR=BigInt(8);function YR(t){let e=BigInt(10),r=BigInt(20),i=BigInt(40),n=BigInt(80),o=kg,s=t*t%o*t%o,c=Me(s,Bw,o)*s%o,l=Me(c,GR,o)*t%o,h=Me(l,HR,o)*l%o,g=Me(h,e,o)*h%o,w=Me(g,r,o)*g%o,v=Me(w,i,o)*w%o,$=Me(v,n,o)*v%o,k=Me($,n,o)*v%o,R=Me(k,e,o)*h%o;return{pow_p_5_8:Me(R,Bw,o)*t%o,b2:s}}function XR(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function QR(t,e){let r=kg,i=Ne(e*e*e,r),n=Ne(i*i*e,r),o=YR(t*n).pow_p_5_8,a=Ne(t*i*o,r),s=Ne(e*a*a,r),c=a,l=Ne(a*zw,r),h=s===t,g=s===Ne(-t,r),w=s===Ne(-t*zw,r);return h&&(a=c),(g||w)&&(a=l),Aw(a,r)&&(a=Ne(-a,r)),{isValid:h||g,value:a}}var eA=wn(kg,void 0,!0),tA={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:eA,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:JR,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:Sw,randomBytes:Wc,adjustScalarBytes:XR,uvRatio:QR},Qn=Lw(tA);var b0=Cr(Ag()),$t=Cr(Og());var oA=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]),xn=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Sn=new Uint32Array(64),Tg=class extends io{constructor(){super(64,32,8,!1),this.A=xn[0]|0,this.B=xn[1]|0,this.C=xn[2]|0,this.D=xn[3]|0,this.E=xn[4]|0,this.F=xn[5]|0,this.G=xn[6]|0,this.H=xn[7]|0}get(){let{A:e,B:r,C:i,D:n,E:o,F:a,G:s,H:c}=this;return[e,r,i,n,o,a,s,c]}set(e,r,i,n,o,a,s,c){this.A=e|0,this.B=r|0,this.C=i|0,this.D=n|0,this.E=o|0,this.F=a|0,this.G=s|0,this.H=c|0}process(e,r){for(let g=0;g<16;g++,r+=4)Sn[g]=e.getUint32(r,!1);for(let g=16;g<64;g++){let w=Sn[g-15],v=Sn[g-2],$=wr(w,7)^wr(w,18)^w>>>3,k=wr(v,17)^wr(v,19)^v>>>10;Sn[g]=k+Sn[g-7]+$+Sn[g-16]|0}let{A:i,B:n,C:o,D:a,E:s,F:c,G:l,H:h}=this;for(let g=0;g<64;g++){let w=wr(s,6)^wr(s,11)^wr(s,25),v=h+w+bw(s,c,l)+oA[g]+Sn[g]|0,k=(wr(i,2)^wr(i,13)^wr(i,22))+ww(i,n,o)|0;h=l,l=c,c=s,s=a+v|0,a=o,o=n,n=i,i=v+k|0}i=i+this.A|0,n=n+this.B|0,o=o+this.C|0,a=a+this.D|0,s=s+this.E|0,c=c+this.F|0,l=l+this.G|0,h=h+this.H|0,this.set(i,n,o,a,s,c,l,h)}roundClean(){Sn.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var ca=no(()=>new Tg);var go=Cr(Jw()),E=Cr(Mg()),xS=Cr(Mg());var xA=1,SA=2,EA=3,IA=4,kA=5,RA=6,AA=7,$A=8,OA=9,TA=10,NA=-32700,PA=-32603,LA=-32602,zA=-32601,BA=-32600,UA=-32016,CA=-32015,DA=-32014,MA=-32013,jA=-32012,FA=-32011,ZA=-32010,VA=-32009,KA=-32008,WA=-32007,qA=-32006,GA=-32005,HA=-32004,JA=-32003,YA=-32002,XA=-32001,QA=28e5,e$=2800001,t$=2800002,r$=2800003,n$=2800004,i$=2800005,o$=2800006,a$=2800007,s$=2800008,c$=2800009,u$=2800010,l$=323e4,d$=32300001,f$=3230002,h$=3230003,p$=3230004,m$=361e4,g$=3610001,y$=3610002,_$=3610003,v$=3610004,b$=3610005,w$=3610006,x$=3610007,S$=3611e3,E$=3704e3,I$=3704001,k$=3704002,R$=3704003,A$=3704004,$$=4128e3,O$=4128001,T$=4128002,N$=4615e3,P$=4615001,L$=4615002,z$=4615003,B$=4615004,U$=4615005,C$=4615006,D$=4615007,M$=4615008,j$=4615009,F$=4615010,Z$=4615011,V$=4615012,K$=4615013,W$=4615014,q$=4615015,G$=4615016,H$=4615017,J$=4615018,Y$=4615019,X$=4615020,Q$=4615021,eO=4615022,tO=4615023,rO=4615024,nO=4615025,iO=4615026,oO=4615027,aO=4615028,sO=4615029,cO=4615030,uO=4615031,lO=4615032,dO=4615033,fO=4615034,hO=4615035,pO=4615036,mO=4615037,gO=4615038,yO=4615039,_O=4615040,vO=4615041,bO=4615042,wO=4615043,xO=4615044,SO=4615045,EO=4615046,IO=4615047,kO=4615048,RO=4615049,AO=4615050,$O=4615051,OO=4615052,TO=4615053,NO=4615054,PO=5508e3,LO=5508001,zO=5508002,BO=5508003,UO=5508004,CO=5508005,DO=5508006,MO=5508007,jO=5508008,FO=5508009,ZO=5508010,VO=5508011,KO=5663e3,WO=5663001,qO=5663002,GO=5663003,HO=5663004,JO=5663005,YO=5663006,XO=5663007,QO=5663008,eT=5663009,tT=5663010,rT=5663011,nT=5663012,iT=5663013,oT=5663014,aT=5663015,sT=5663016,cT=5663017,uT=5663018,lT=5663019,dT=705e4,fT=7050001,hT=7050002,pT=7050003,mT=7050004,gT=7050005,yT=7050006,_T=7050007,vT=7050008,bT=7050009,wT=7050010,xT=7050011,ST=7050012,ET=7050013,IT=7050014,kT=7050015,RT=7050016,AT=7050017,$T=7050018,OT=7050019,TT=7050020,NT=7050021,PT=7050022,LT=7050023,zT=7050024,BT=7050025,UT=7050026,CT=7050027,DT=7050028,MT=7050029,jT=7050030,FT=7050031,ZT=7050032,VT=7050033,KT=7050034,WT=7050035,qT=7050036,jg=8078e3,Fg=8078001,Yw=8078002,Xw=8078003,Zg=8078004,Vg=8078005,Kg=8078006,GT=8078007,HT=8078008,JT=8078009,YT=8078010,Wg=8078011,XT=8078012,Qw=8078013,ex=8078014,QT=8078015,eN=8078016,tN=8078017,rN=8078018,nN=8078019,tx=8078020,rx=8078021,iN=8078022,oN=81e5,aN=8100001,sN=8100002,cN=8100003,uN=819e4,lN=8190001,dN=8190002,fN=8190003,hN=8190004,pN=99e5,mN=9900001,gN=9900002,yN=9900003,_N=9900004;function nx(t){return Array.isArray(t)?"%5B"+t.map(nx).join("%2C%20")+"%5D":typeof t=="bigint"?`${t}n`:encodeURIComponent(String(t!=null&&Object.getPrototypeOf(t)===null?{...t}:t))}function vN([t,e]){return`${t}=${nx(e)}`}function bN(t){let e=Object.entries(t).map(vN).join("&");return btoa(e)}var rU={[l$]:"Account not found at address: $address",[p$]:"Not all accounts were decoded. Encoded accounts found at addresses: $addresses.",[h$]:"Expected decoded account at address: $address",[f$]:"Failed to decode account data at address: $address",[d$]:"Accounts not found at addresses: $addresses",[c$]:"Unable to find a viable program address bump seed.",[t$]:"$putativeAddress is not a base58-encoded address.",[QA]:"Expected base58 encoded address to decode to a byte array of length 32. Actual length: $actualLength.",[r$]:"The `CryptoKey` must be an `Ed25519` public key.",[s$]:"Invalid seeds; point must fall off the Ed25519 curve.",[n$]:"Expected given program derived address to have the following format: [Address, ProgramDerivedAddressBump].",[o$]:"A maximum of $maxSeeds seeds, including the bump seed, may be supplied when creating an address. Received: $actual.",[a$]:"The seed at index $index with length $actual exceeds the maximum length of $maxSeedLength bytes.",[i$]:"Expected program derived address bump to be in the range [0, 255], got: $bump.",[u$]:"Program address cannot end with PDA marker.",[e$]:"Expected base58-encoded address string of length in the range [32, 44]. Actual length: $actualLength.",[IA]:"Expected base58-encoded blockash string of length in the range [32, 44]. Actual length: $actualLength.",[xA]:"The network has progressed past the last block for which this transaction could have been committed.",[jg]:"Codec [$codecDescription] cannot decode empty byte arrays.",[iN]:"Enum codec cannot use lexical values [$stringValues] as discriminators. Either remove all lexical values or set `useValuesAsDiscriminators` to `false`.",[tx]:"Sentinel [$hexSentinel] must not be present in encoded bytes [$hexEncodedBytes].",[Vg]:"Encoder and decoder must have the same fixed size, got [$encoderFixedSize] and [$decoderFixedSize].",[Kg]:"Encoder and decoder must have the same max size, got [$encoderMaxSize] and [$decoderMaxSize].",[Zg]:"Encoder and decoder must either both be fixed-size or variable-size.",[HT]:"Enum discriminator out of range. Expected a number in [$formattedValidDiscriminators], got $discriminator.",[Yw]:"Expected a fixed-size codec, got a variable-size one.",[Qw]:"Codec [$codecDescription] expected a positive byte length, got $bytesLength.",[Xw]:"Expected a variable-size codec, got a fixed-size one.",[nN]:"Codec [$codecDescription] expected zero-value [$hexZeroValue] to have the same size as the provided fixed-size item [$expectedSize bytes].",[Fg]:"Codec [$codecDescription] expected $expected bytes, got $bytesLength.",[rN]:"Expected byte array constant [$hexConstant] to be present in data [$hexData] at offset [$offset].",[JT]:"Invalid discriminated union variant. Expected one of [$variants], got $value.",[YT]:"Invalid enum variant. Expected one of [$stringValues] or a number in [$formattedNumericalValues], got $variant.",[QT]:"Invalid literal union variant. Expected one of [$variants], got $value.",[GT]:"Expected [$codecDescription] to have $expected items, got $actual.",[XT]:"Invalid value $value for base $base with alphabet $alphabet.",[eN]:"Literal union discriminator out of range. Expected a number between $minRange and $maxRange, got $discriminator.",[Wg]:"Codec [$codecDescription] expected number to be in the range [$min, $max], got $value.",[ex]:"Codec [$codecDescription] expected offset to be in the range [0, $bytesLength], got $offset.",[rx]:"Expected sentinel [$hexSentinel] to be present in decoded bytes [$hexDecodedBytes].",[tN]:"Union variant out of range. Expected an index between $minRange and $maxRange, got $variant.",[S$]:"No random values implementation could be found.",[j$]:"instruction requires an uninitialized account",[tO]:"instruction tries to borrow reference for an account which is already borrowed",[rO]:"instruction left account with an outstanding borrowed reference",[Q$]:"program other than the account's owner changed the size of the account data",[U$]:"account data too small for instruction",[eO]:"instruction expected an executable account",[EO]:"An account does not have enough lamports to be rent-exempt",[kO]:"Program arithmetic overflowed",[SO]:"Failed to serialize or deserialize account data: $encodedData",[NO]:"Builtin programs must consume compute units",[lO]:"Cross-program invocation call depth too deep",[gO]:"Computational budget exceeded",[iO]:"custom program error: #$code",[H$]:"instruction contains duplicate accounts",[nO]:"instruction modifications of multiply-passed account differ",[cO]:"executable accounts must be rent exempt",[aO]:"instruction changed executable accounts data",[sO]:"instruction changed the balance of an executable account",[J$]:"instruction changed executable bit of an account",[W$]:"instruction modified data of an account it does not own",[K$]:"instruction spent from the balance of an account it does not own",[P$]:"generic instruction error",[AO]:"Provided owner is not allowed",[wO]:"Account is immutable",[xO]:"Incorrect authority provided",[D$]:"incorrect program id for instruction",[C$]:"insufficient funds for instruction",[B$]:"invalid account data for instruction",[IO]:"Invalid account owner",[L$]:"invalid program argument",[oO]:"program returned invalid error code",[z$]:"invalid instruction data",[mO]:"Failed to reallocate account data",[pO]:"Provided seeds do not result in a valid address",[$O]:"Accounts data allocations exceeded the maximum allowed per transaction",[OO]:"Max accounts exceeded",[TO]:"Max instruction trace length exceeded",[hO]:"Length of the seed is too long for address generation",[dO]:"An account required by the instruction is missing",[M$]:"missing required signature for instruction",[V$]:"instruction illegally modified the program id of an account",[X$]:"insufficient account keys for instruction",[yO]:"Cross-program invocation with unauthorized signer or writable account",[_O]:"Failed to create program execution environment",[bO]:"Program failed to compile",[vO]:"Program failed to complete",[G$]:"instruction modified data of a read-only account",[q$]:"instruction changed the balance of a read-only account",[fO]:"Cross-program invocation reentrancy not allowed for this instruction",[Y$]:"instruction modified rent epoch of an account",[Z$]:"sum of account balances before and after instruction do not match",[F$]:"instruction requires an initialized account",[N$]:"",[uO]:"Unsupported program id",[RO]:"Unsupported sysvar",[$$]:"The instruction does not have any accounts.",[O$]:"The instruction does not have any data.",[T$]:"Expected instruction to have progress address $expectedProgramAddress, got $actualProgramAddress.",[kA]:"Expected base58 encoded blockhash to decode to a byte array of length 32. Actual length: $actualLength.",[SA]:"The nonce `$expectedNonceValue` is no longer valid. It has advanced to `$actualNonceValue`",[gN]:"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",[_N]:"Invariant violation: This data publisher does not publish to the channel named `$channelName`. Supported channels include $supportedChannelNames.",[mN]:"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",[pN]:"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",[yN]:"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",[PA]:"JSON-RPC error: Internal JSON-RPC error ($__serverMessage)",[LA]:"JSON-RPC error: Invalid method parameter(s) ($__serverMessage)",[BA]:"JSON-RPC error: The JSON sent is not a valid `Request` object ($__serverMessage)",[zA]:"JSON-RPC error: The method does not exist / is not available ($__serverMessage)",[NA]:"JSON-RPC error: An error occurred on the server while parsing the JSON text ($__serverMessage)",[jA]:"$__serverMessage",[XA]:"$__serverMessage",[HA]:"$__serverMessage",[DA]:"$__serverMessage",[ZA]:"$__serverMessage",[VA]:"$__serverMessage",[UA]:"Minimum context slot has not been reached",[GA]:"Node is unhealthy; behind by $numSlotsBehind slots",[KA]:"No snapshot",[YA]:"Transaction simulation failed",[WA]:"$__serverMessage",[FA]:"Transaction history is not available from this node",[qA]:"$__serverMessage",[MA]:"Transaction signature length mismatch",[JA]:"Transaction signature verification failure",[CA]:"$__serverMessage",[E$]:"Key pair bytes must be of length 64, got $byteLength.",[I$]:"Expected private key bytes with length 32. Actual length: $actualLength.",[k$]:"Expected base58-encoded signature to decode to a byte array of length 64. Actual length: $actualLength.",[A$]:"The provided private key does not match the provided public key.",[R$]:"Expected base58-encoded signature string of length in the range [64, 88]. Actual length: $actualLength.",[RA]:"Lamports value must be in the range [0, 2e64-1]",[AA]:"`$value` cannot be parsed as a `BigInt`",[TA]:"$message",[$A]:"`$value` cannot be parsed as a `Number`",[EA]:"No nonce account could be found at address `$nonceAccountAddress`",[uN]:"The notification name must end in 'Notifications' and the API must supply a subscription plan creator function for the notification '$notificationName'.",[dN]:"WebSocket was closed before payload could be added to the send buffer",[fN]:"WebSocket connection closed",[hN]:"WebSocket failed to connect",[lN]:"Failed to obtain a subscription id from the server",[cN]:"Could not find an API plan for RPC method: `$method`",[oN]:"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`.",[sN]:"HTTP error ($statusCode): $message",[aN]:"HTTP header(s) forbidden: $headers. Learn more at https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_header_name.",[PO]:"Multiple distinct signers were identified for address `$address`. Please ensure that you are using the same signer instance for each address.",[LO]:"The provided value does not implement the `KeyPairSigner` interface",[BO]:"The provided value does not implement the `MessageModifyingSigner` interface",[UO]:"The provided value does not implement the `MessagePartialSigner` interface",[zO]:"The provided value does not implement any of the `MessageSigner` interfaces",[DO]:"The provided value does not implement the `TransactionModifyingSigner` interface",[MO]:"The provided value does not implement the `TransactionPartialSigner` interface",[jO]:"The provided value does not implement the `TransactionSendingSigner` interface",[CO]:"The provided value does not implement any of the `TransactionSigner` interfaces",[FO]:"More than one `TransactionSendingSigner` was identified.",[ZO]:"No `TransactionSendingSigner` was identified. Please provide a valid `ITransactionWithSingleSendingSigner` transaction.",[VO]:"Wallet account signers do not support signing multiple messages/transactions in a single operation",[x$]:"Cannot export a non-extractable key.",[g$]:"No digest implementation could be found.",[m$]:"Cryptographic operations are only allowed in secure browser contexts. Read more here: https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts.",[y$]:`This runtime does not support the generation of Ed25519 key pairs.
|
|
2
41
|
|
|
3
42
|
Install @solana/webcrypto-ed25519-polyfill and call its \`install\` function before generating keys in environments that do not support Ed25519.
|
|
4
43
|
|
|
5
|
-
For a list of runtimes that currently support Ed25519 operations, visit https://github.com/WICG/webcrypto-secure-curves/issues/20.`,[__]:"No signature verification implementation could be found.",[b_]:"No key generation implementation could be found.",[w_]:"No signing implementation could be found.",[E_]:"No key export implementation could be found.",[Ty]:"Timestamp value must be in the range [-(2n ** 63n), (2n ** 63n) - 1]. `$value` given",[Iw]:"Transaction processing left an account with an outstanding borrowed reference",[dw]:"Account in use",[hw]:"Account loaded twice",[pw]:"Attempt to debit an account but found no record of a prior credit.",[Cw]:"Transaction loads an address table account that doesn't exist",[_w]:"This transaction has already been processed",[bw]:"Blockhash not found",[ww]:"Loader call chain is too deep",[Aw]:"Transactions are currently disabled due to cluster maintenance",[$w]:"Transaction contains a duplicate instruction ($index) that is not allowed",[gw]:"Insufficient funds for fee",[Vw]:"Transaction results in an account ($accountIndex) with insufficient funds for rent",[yw]:"This account may not be used to pay transaction fees",[Rw]:"Transaction contains an invalid account reference",[Mw]:"Transaction loads an address table account with invalid data",[Uw]:"Transaction address table lookup uses an invalid index",[Pw]:"Transaction loads an address table account with an invalid owner",[qw]:"LoadedAccountsDataSizeLimit set for transaction must be greater than 0.",[Sw]:"This program may not be used for executing instructions",[Dw]:"Transaction leaves an account with a lower balance than rent-exempt minimum",[Tw]:"Transaction loads a writable account that cannot be written",[Ww]:"Transaction exceeded max loaded accounts data size cap",[Ew]:"Transaction requires a fee but has no signature present",[mw]:"Attempt to load a program that does not exist",[Kw]:"Execution of the program referenced by account at index $accountIndex is temporarily restricted.",[jw]:"ResanitizationNeeded",[xw]:"Transaction failed to sanitize accounts offsets correctly",[vw]:"Transaction did not pass signature verification",[Bw]:"Transaction locked too many accounts",[Hw]:"Sum of account balances before and after transaction do not match",[lw]:"The transaction failed with the error `$errorName`",[Ow]:"Transaction version is unsupported",[Lw]:"Transaction would exceed account data limit within the block",[Fw]:"Transaction would exceed total account data limit",[Nw]:"Transaction would exceed max account limit within the block",[kw]:"Transaction would exceed max Block Cost Limit",[zw]:"Transaction would exceed max Vote Cost Limit",[ow]:"Attempted to sign a transaction with an address that is not a signer for it",[tw]:"Transaction is missing an address at index: $index.",[aw]:"Transaction has no expected signers therefore it cannot be encoded",[Hb]:"Transaction does not have a blockhash lifetime",[Gb]:"Transaction is not a durable nonce transaction",[Yb]:"Contents of these address lookup tables unknown: $lookupTableAddresses",[Jb]:"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",[Qb]:"No fee payer set in CompiledTransaction",[Xb]:"Could not find program address at index $index",[uw]:"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",[fw]:"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",[rw]:"Transaction is missing a fee payer.",[nw]:"Could not determine this transaction's signature. Make sure that the transaction has been signed by its fee payer.",[iw]:"Transaction first instruction is not advance nonce account instruction.",[sw]:"Transaction with no instructions cannot be durable nonce transaction.",[jb]:"This transaction includes an address (`$programAddress`) which is both invoked and set as the fee payer. Program addresses may not pay fees",[Kb]:"This transaction includes an address (`$programAddress`) which is both invoked and marked writable. Program addresses may not be writable",[cw]:"The transaction message expected the transaction to have $signerAddressesLength signatures, got $signaturesLength.",[ew]:"Transaction is missing signatures for addresses: $addresses.",[Zb]:"Transaction version must be in the range [0, 127]. `$actualVersion` given"};function E1(r,e={}){{let t=`Solana error #${r}; Decode this error by running \`npx @solana/errors decode -- ${r}`;return Object.keys(e).length&&(t+=` '${w1(e)}'`),`${t}\``}}var an=class extends Error{cause=this.cause;context;constructor(...[r,e]){let t,n;if(e){let{cause:i,...o}=e;i&&(n={cause:i}),Object.keys(o).length>0&&(t=o)}let s=E1(r,t);super(s,n),this.context={__code:r,...t},this.name="SolanaError"}};function R1(r,e){return"fixedSize"in e?e.fixedSize:e.getSizeFromValue(r)}function Cd(r){return Object.freeze({...r,encode:e=>{let t=new Uint8Array(R1(e,r));return r.write(e,t,0),t}})}function Pd(r){return Object.freeze({...r,decode:(e,t=0)=>r.read(e,t)[0]})}function As(r){return"fixedSize"in r&&typeof r.fixedSize=="number"}function Md(r,e){if(As(r)!==As(e))throw new an(Jc);if(As(r)&&As(e)&&r.fixedSize!==e.fixedSize)throw new an(Xc,{decoderFixedSize:e.fixedSize,encoderFixedSize:r.fixedSize});if(!As(r)&&!As(e)&&r.maxSize!==e.maxSize)throw new an(Qc,{decoderMaxSize:e.maxSize,encoderMaxSize:r.maxSize});return{...e,...r,decode:e.decode,encode:r.encode,read:e.read,write:r.write}}function Ud(r,e,t=0){if(e.length-t<=0)throw new an(Zc,{codecDescription:r})}function Dd(r,e,t,n=0){let s=t.length-n;if(s<e)throw new an(Yc,{bytesLength:s,codecDescription:r,expected:e})}function v1(r,e,t,n){if(n<e||n>t)throw new an(eu,{codecDescription:r,max:t,min:e,value:n})}function zd(r){return r?.endian!==1}function S1(r){return Cd({fixedSize:r.size,write(e,t,n){r.range&&v1(r.name,r.range[0],r.range[1],e);let s=new ArrayBuffer(r.size);return r.set(new DataView(s),e,zd(r.config)),t.set(new Uint8Array(s),n),n+r.size}})}function x1(r){return Pd({fixedSize:r.size,read(e,t=0){Ud(r.name,e,t),Dd(r.name,r.size,e,t);let n=new DataView(A1(e,t,r.size));return[r.get(n,zd(r.config)),t+r.size]}})}function A1(r,e,t){let n=r.byteOffset+(e??0),s=t??r.byteLength;return r.buffer.slice(n,n+s)}var tu=(r={})=>S1({config:r,name:"u64",range:[0n,BigInt("0xffffffffffffffff")],set:(e,t,n)=>e.setBigUint64(0,BigInt(t),n),size:8}),I1=(r={})=>x1({config:r,get:(e,t)=>e.getBigUint64(0,t),name:"u64",size:8}),Fd=(r={})=>Md(tu(r),I1(r));var ru=class extends TypeError{constructor(e,t){let n,{message:s,explanation:i,...o}=e,{path:c}=e,u=c.length===0?s:`At path: ${c.join(".")} -- ${s}`;super(i??u),i!=null&&(this.cause=u),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>n??(n=[e,...t()])}};function k1(r){return ei(r)&&typeof r[Symbol.iterator]=="function"}function ei(r){return typeof r=="object"&&r!=null}function Lo(r){return ei(r)&&!Array.isArray(r)}function lr(r){return typeof r=="symbol"?r.toString():typeof r=="string"?JSON.stringify(r):`${r}`}function O1(r){let{done:e,value:t}=r.next();return e?void 0:t}function T1(r,e,t,n){if(r===!0)return;r===!1?r={}:typeof r=="string"&&(r={message:r});let{path:s,branch:i}=e,{type:o}=t,{refinement:c,message:u=`Expected a value of type \`${o}\`${c?` with refinement \`${c}\``:""}, but received: \`${lr(n)}\``}=r;return{value:n,type:o,refinement:c,key:s[s.length-1],path:s,branch:i,...r,message:u}}function*$d(r,e,t,n){k1(r)||(r=[r]);for(let s of r){let i=T1(s,e,t,n);i&&(yield i)}}function*nu(r,e,t={}){let{path:n=[],branch:s=[r],coerce:i=!1,mask:o=!1}=t,c={path:n,branch:s,mask:o};i&&(r=e.coercer(r,c));let u="valid";for(let p of e.validator(r,c))p.explanation=t.message,u="not_valid",yield[p,void 0];for(let[p,m,b]of e.entries(r,c)){let x=nu(m,b,{path:p===void 0?n:[...n,p],branch:p===void 0?s:[...s,m],coerce:i,mask:o,message:t.message});for(let S of x)S[0]?(u=S[0].refinement!=null?"not_refined":"not_valid",yield[S[0],void 0]):i&&(m=S[1],p===void 0?r=m:r instanceof Map?r.set(p,m):r instanceof Set?r.add(m):ei(r)&&(m!==void 0||p in r)&&(r[p]=m))}if(u!=="not_valid")for(let p of e.refiner(r,c))p.explanation=t.message,u="not_refined",yield[p,void 0];u==="valid"&&(yield[void 0,r])}var ir=class{constructor(e){let{type:t,schema:n,validator:s,refiner:i,coercer:o=u=>u,entries:c=function*(){}}=e;this.type=t,this.schema=n,this.entries=c,this.coercer=o,s?this.validator=(u,p)=>{let m=s(u,p);return $d(m,p,this,u)}:this.validator=()=>[],i?this.refiner=(u,p)=>{let m=i(u,p);return $d(m,p,this,u)}:this.refiner=()=>[]}assert(e,t){return Vd(e,this,t)}create(e,t){return W(e,this,t)}is(e){return Wd(e,this)}mask(e,t){return N1(e,this,t)}validate(e,t={}){return ti(e,this,t)}};function Vd(r,e,t){let n=ti(r,e,{message:t});if(n[0])throw n[0]}function W(r,e,t){let n=ti(r,e,{coerce:!0,message:t});if(n[0])throw n[0];return n[1]}function N1(r,e,t){let n=ti(r,e,{coerce:!0,mask:!0,message:t});if(n[0])throw n[0];return n[1]}function Wd(r,e){return!ti(r,e)[0]}function ti(r,e,t={}){let n=nu(r,e,t),s=O1(n);return s[0]?[new ru(s[0],function*(){for(let o of n)o[0]&&(yield o[0])}),void 0]:[void 0,s[1]]}function Kn(r,e){return new ir({type:r,schema:null,validator:e})}function qd(){return Kn("any",()=>!0)}function j(r){return new ir({type:"array",schema:r,*entries(e){if(r&&Array.isArray(e))for(let[t,n]of e.entries())yield[t,n,r]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${lr(e)}`}})}function dr(){return Kn("boolean",r=>typeof r=="boolean")}function Bo(r){return Kn("instance",e=>e instanceof r||`Expected a \`${r.name}\` instance, but received: ${lr(e)}`)}function Me(r){let e=lr(r),t=typeof r;return new ir({type:"literal",schema:t==="string"||t==="number"||t==="boolean"?r:null,validator(n){return n===r||`Expected the literal \`${e}\`, but received: ${lr(n)}`}})}function L1(){return Kn("never",()=>!1)}function K(r){return new ir({...r,validator:(e,t)=>e===null||r.validator(e,t),refiner:(e,t)=>e===null||r.refiner(e,t)})}function k(){return Kn("number",r=>typeof r=="number"&&!isNaN(r)||`Expected a number, but received: ${lr(r)}`)}function ne(r){return new ir({...r,validator:(e,t)=>e===void 0||r.validator(e,t),refiner:(e,t)=>e===void 0||r.refiner(e,t)})}function su(r,e){return new ir({type:"record",schema:null,*entries(t){if(ei(t))for(let n in t){let s=t[n];yield[n,n,r],yield[n,s,e]}},validator(t){return Lo(t)||`Expected an object, but received: ${lr(t)}`},coercer(t){return Lo(t)?{...t}:t}})}function z(){return Kn("string",r=>typeof r=="string"||`Expected a string, but received: ${lr(r)}`)}function Co(r){let e=L1();return new ir({type:"tuple",schema:null,*entries(t){if(Array.isArray(t)){let n=Math.max(r.length,t.length);for(let s=0;s<n;s++)yield[s,t[s],r[s]||e]}},validator(t){return Array.isArray(t)||`Expected an array, but received: ${lr(t)}`},coercer(t){return Array.isArray(t)?t.slice():t}})}function P(r){let e=Object.keys(r);return new ir({type:"type",schema:r,*entries(t){if(ei(t))for(let n of e)yield[n,t[n],r[n]]},validator(t){return Lo(t)||`Expected an object, but received: ${lr(t)}`},coercer(t){return Lo(t)?{...t}:t}})}function Nt(r){let e=r.map(t=>t.type).join(" | ");return new ir({type:"union",schema:null,coercer(t,n){for(let s of r){let[i,o]=s.validate(t,{coerce:!0,mask:n.mask});if(!i)return o}return t},validator(t,n){let s=[];for(let i of r){let[...o]=nu(t,i,n),[c]=o;if(c[0])for(let[u]of o)u&&s.push(u);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${lr(t)}`,...s]}})}function Hn(){return Kn("unknown",()=>!0)}function Is(r,e,t){return new ir({...r,coercer:(n,s)=>Wd(n,e)?r.coercer(t(n,s),s):r.coercer(n,s)})}var Qh=Sr(ph());var _h=Sr(Ws(),1);var Gn=Sr(gh(),1);var yh=Gn.default;var sE=class extends Gn.default{socket;constructor(r,e,t){super(),this.socket=new window.WebSocket(r,t),this.socket.onopen=()=>this.emit("open"),this.socket.onmessage=n=>this.emit("message",n.data),this.socket.onerror=n=>this.emit("error",n),this.socket.onclose=n=>{this.emit("close",n.code,n.reason)}}send(r,e,t){let n=t||e;try{this.socket.send(r),n()}catch(s){n(s)}}close(r,e){this.socket.close(r,e)}addEventListener(r,e,t){this.socket.addEventListener(r,e,t)}};function bh(r,e){return new sE(r,e)}var iE=class{encode(r){return JSON.stringify(r)}decode(r){return JSON.parse(r)}},wh=class extends Gn.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(r,e="ws://localhost:8080",{autoconnect:t=!0,reconnect:n=!0,reconnect_interval:s=1e3,max_reconnects:i=5,...o}={},c,u){super(),this.webSocketFactory=r,this.queue={},this.rpc_id=0,this.address=e,this.autoconnect=t,this.ready=!1,this.reconnect=n,this.reconnect_timer_id=void 0,this.reconnect_interval=s,this.max_reconnects=i,this.rest_options=o,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 iE,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(r,e,t,n){return!n&&typeof t=="object"&&(n=t,t=null),new Promise((s,i)=>{if(!this.ready)return i(new Error("socket not ready"));let o=this.generate_request_id(r,e),c={jsonrpc:"2.0",method:r,params:e||void 0,id:o};this.socket.send(this.dataPack.encode(c),n,u=>{if(u)return i(u);this.queue[o]={promise:[s,i]},t&&(this.queue[o].timeout=setTimeout(()=>{delete this.queue[o],i(new Error("reply timeout"))},t))})})}async login(r){let e=await this.call("rpc.login",r);if(!e)throw new Error("authentication failed");return e}async listMethods(){return await this.call("__listMethods")}notify(r,e){return new Promise((t,n)=>{if(!this.ready)return n(new Error("socket not ready"));let s={jsonrpc:"2.0",method:r,params:e};this.socket.send(this.dataPack.encode(s),i=>{if(i)return n(i);t()})})}async subscribe(r){typeof r=="string"&&(r=[r]);let e=await this.call("rpc.on",r);if(typeof r=="string"&&e[r]!=="ok")throw new Error("Failed subscribing to an event '"+r+"' with: "+e[r]);return e}async unsubscribe(r){typeof r=="string"&&(r=[r]);let e=await this.call("rpc.off",r);if(typeof r=="string"&&e[r]!=="ok")throw new Error("Failed unsubscribing from an event with: "+e);return e}close(r,e){this.socket.close(r||1e3,e)}setAutoReconnect(r){this.reconnect=r}setReconnectInterval(r){this.reconnect_interval=r}setMaxReconnects(r){this.max_reconnects=r}_connect(r,e){clearTimeout(this.reconnect_timer_id),this.socket=this.webSocketFactory(r,e),this.socket.addEventListener("open",()=>{this.ready=!0,this.emit("open"),this.current_reconnects=0}),this.socket.addEventListener("message",({data:t})=>{t instanceof ArrayBuffer&&(t=_h.Buffer.from(t).toString());try{t=this.dataPack.decode(t)}catch{return}if(t.notification&&this.listeners(t.notification).length){if(!Object.keys(t.params).length)return this.emit(t.notification);let n=[t.notification];if(t.params.constructor===Object)n.push(t.params);else for(let s=0;s<t.params.length;s++)n.push(t.params[s]);return Promise.resolve().then(()=>{this.emit.apply(this,n)})}if(!this.queue[t.id])return t.method?Promise.resolve().then(()=>{this.emit(t.method,t?.params)}):void 0;"error"in t=="result"in t&&this.queue[t.id].promise[1](new Error('Server response malformed. Response must include either "result" or "error", but not both.')),this.queue[t.id].timeout&&clearTimeout(this.queue[t.id].timeout),t.error?this.queue[t.id].promise[1](t.error):this.queue[t.id].promise[0](t.result),delete this.queue[t.id]}),this.socket.addEventListener("error",t=>this.emit("error",t)),this.socket.addEventListener("close",({code:t,reason:n})=>{this.ready&&setTimeout(()=>this.emit("close",t,n),0),this.ready=!1,this.socket=void 0,t!==1e3&&(this.current_reconnects++,this.reconnect&&(this.max_reconnects>this.current_reconnects||this.max_reconnects===0)&&(this.reconnect_timer_id=setTimeout(()=>this._connect(r,e),this.reconnect_interval)))})}};var vh=[],Sh=[],xh=[],oE=BigInt(0),ai=BigInt(1),aE=BigInt(2),cE=BigInt(7),uE=BigInt(256),fE=BigInt(113);for(let r=0,e=ai,t=1,n=0;r<24;r++){[t,n]=[n,(2*t+3*n)%5],vh.push(2*(5*n+t)),Sh.push((r+1)*(r+2)/2%64);let s=oE;for(let i=0;i<7;i++)e=(e<<ai^(e>>cE)*fE)%uE,e&aE&&(s^=ai<<(ai<<BigInt(i))-ai);xh.push(s)}var[lE,dE]=mc(xh,!0),Eh=(r,e,t)=>t>32?_c(r,e,t):gc(r,e,t),Rh=(r,e,t)=>t>32?bc(r,e,t):yc(r,e,t);function hE(r,e=24){let t=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)t[o]=r[o]^r[o+10]^r[o+20]^r[o+30]^r[o+40];for(let o=0;o<10;o+=2){let c=(o+8)%10,u=(o+2)%10,p=t[u],m=t[u+1],b=Eh(p,m,1)^t[c],x=Rh(p,m,1)^t[c+1];for(let S=0;S<50;S+=10)r[o+S]^=b,r[o+S+1]^=x}let s=r[2],i=r[3];for(let o=0;o<24;o++){let c=Sh[o],u=Eh(s,i,c),p=Rh(s,i,c),m=vh[o];s=r[m],i=r[m+1],r[m]=u,r[m+1]=p}for(let o=0;o<50;o+=10){for(let c=0;c<10;c++)t[c]=r[o+c];for(let c=0;c<10;c++)r[o+c]^=~t[(c+2)%10]&t[(c+4)%10]}r[0]^=lE[n],r[1]^=dE[n]}t.fill(0)}var $o=class r extends Gr{constructor(e,t,n,s=!1,i=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=s,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,qs(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Hl(this.state)}keccak(){lc||dc(this.state32),hE(this.state32,this.rounds),lc||dc(this.state32),this.posOut=0,this.pos=0}update(e){Tr(this);let{blockLen:t,state:n}=this;e=Zr(e);let s=e.length;for(let i=0;i<s;){let o=Math.min(t-this.pos,s-i);for(let c=0;c<o;c++)n[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:n,blockLen:s}=this;e[n]^=t,(t&128)!==0&&n===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){Tr(this,!1),Hr(e),this.finish();let t=this.state,{blockLen:n}=this;for(let s=0,i=e.length;s<i;){this.posOut>=n&&this.keccak();let o=Math.min(n-this.posOut,i-s);e.set(t.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return qs(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(Ki(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:t,suffix:n,outputLen:s,rounds:i,enableXOF:o}=this;return e||(e=new r(t,n,s,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=s,e.enableXOF=o,e.destroyed=this.destroyed,e}},ln=(r,e,t)=>bs(()=>new $o(e,r,t)),jA=ln(6,144,224/8),KA=ln(6,136,256/8),HA=ln(6,104,384/8),GA=ln(6,72,512/8),ZA=ln(1,144,224/8),mu=ln(1,136,256/8),YA=ln(1,104,384/8),JA=ln(1,72,512/8),Ah=(r,e,t)=>Zl((n={})=>new $o(e,r,n.dkLen===void 0?t:n.dkLen,!0)),XA=Ah(31,168,128/8),QA=Ah(31,136,256/8);var Vo=class extends Gr{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,Kl(e);let n=Zr(t);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 s=this.blockLen,i=new Uint8Array(s);i.set(n.length>s?e.create().update(n).digest():n);for(let o=0;o<i.length;o++)i[o]^=54;this.iHash.update(i),this.oHash=e.create();for(let o=0;o<i.length;o++)i[o]^=106;this.oHash.update(i),i.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:t,iHash:n,finished:s,destroyed:i,blockLen:o,outputLen:c}=this;return e=e,e.finished=s,e.destroyed=i,e.blockLen=o,e.outputLen=c,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},gu=(r,e,t)=>new Vo(r,e).update(t).digest();gu.create=(r,e)=>new Vo(r,e);function Ih(r){r.lowS!==void 0&&ur("lowS",r.lowS),r.prehash!==void 0&&ur("prehash",r.prehash)}function pE(r){let e=Hs(r);br(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:t,Fp:n,a:s}=e;if(t){if(!n.eql(s,n.ZERO))throw new Error("invalid endomorphism, can only be defined for Koblitz curves that have a=0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error("invalid endomorphism, expected beta: bigint and splitScalar: function")}return Object.freeze({...e})}var{bytesToNumberBE:mE,hexToBytes:gE}=Xi,yu=class extends Error{constructor(e=""){super(e)}},Ur={Err:yu,_tlv:{encode:(r,e)=>{let{Err:t}=Ur;if(r<0||r>256)throw new t("tlv.encode: wrong tag");if(e.length&1)throw new t("tlv.encode: unpadded data");let n=e.length/2,s=Un(n);if(s.length/2&128)throw new t("tlv.encode: long form length too big");let i=n>127?Un(s.length/2|128):"";return Un(r)+i+s+e},decode(r,e){let{Err:t}=Ur,n=0;if(r<0||r>256)throw new t("tlv.encode: wrong tag");if(e.length<2||e[n++]!==r)throw new t("tlv.decode: wrong tlv");let s=e[n++],i=!!(s&128),o=0;if(!i)o=s;else{let u=s&127;if(!u)throw new t("tlv.decode(long): indefinite length not supported");if(u>4)throw new t("tlv.decode(long): byte length is too big");let p=e.subarray(n,n+u);if(p.length!==u)throw new t("tlv.decode: length bytes not complete");if(p[0]===0)throw new t("tlv.decode(long): zero leftmost byte");for(let m of p)o=o<<8|m;if(n+=u,o<128)throw new t("tlv.decode(long): not minimal encoding")}let c=e.subarray(n,n+o);if(c.length!==o)throw new t("tlv.decode: wrong value length");return{v:c,l:e.subarray(n+o)}}},_int:{encode(r){let{Err:e}=Ur;if(r<Dr)throw new e("integer: negative integers are not allowed");let t=Un(r);if(Number.parseInt(t[0],16)&8&&(t="00"+t),t.length&1)throw new e("unexpected DER parsing assertion: unpadded hex");return t},decode(r){let{Err:e}=Ur;if(r[0]&128)throw new e("invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new e("invalid signature integer: unnecessary leading zero");return mE(r)}},toSig(r){let{Err:e,_int:t,_tlv:n}=Ur,s=typeof r=="string"?gE(r):r;Es(s);let{v:i,l:o}=n.decode(48,s);if(o.length)throw new e("invalid signature: left bytes after parsing");let{v:c,l:u}=n.decode(2,i),{v:p,l:m}=n.decode(2,u);if(m.length)throw new e("invalid signature: left bytes after parsing");return{r:t.decode(c),s:t.decode(p)}},hexFromSig(r){let{_tlv:e,_int:t}=Ur,n=e.encode(2,t.encode(r.r)),s=e.encode(2,t.encode(r.s)),i=n+s;return e.encode(48,i)}},Dr=BigInt(0),Et=BigInt(1),aI=BigInt(2),kh=BigInt(3),cI=BigInt(4);function yE(r){let e=pE(r),{Fp:t}=e,n=tn(e.n,e.nBitLength),s=e.toBytes||((I,A,L)=>{let U=A.toAffine();return Cr(Uint8Array.from([4]),t.toBytes(U.x),t.toBytes(U.y))}),i=e.fromBytes||(I=>{let A=I.subarray(1),L=t.fromBytes(A.subarray(0,t.BYTES)),U=t.fromBytes(A.subarray(t.BYTES,2*t.BYTES));return{x:L,y:U}});function o(I){let{a:A,b:L}=e,U=t.sqr(I),B=t.mul(U,I);return t.add(t.add(B,t.mul(I,A)),L)}if(!t.eql(t.sqr(e.Gy),o(e.Gx)))throw new Error("bad generator point: equation left != right");function c(I){return js(I,Et,e.n)}function u(I){let{allowedPrivateKeyLengths:A,nByteLength:L,wrapPrivateKey:U,n:B}=e;if(A&&typeof I!="bigint"){if(Xr(I)&&(I=Lr(I)),typeof I!="string"||!A.includes(I.length))throw new Error("invalid private key");I=I.padStart(L*2,"0")}let F;try{F=typeof I=="bigint"?I:Br(We("private key",I,L))}catch{throw new Error("invalid private key, expected hex or "+L+" bytes, got "+typeof I)}return U&&(F=ke(F,B)),jt("private key",F,Et,B),F}function p(I){if(!(I instanceof x))throw new Error("ProjectivePoint expected")}let m=Fn((I,A)=>{let{px:L,py:U,pz:B}=I;if(t.eql(B,t.ONE))return{x:L,y:U};let F=I.is0();A==null&&(A=F?t.ONE:t.inv(B));let te=t.mul(L,A),G=t.mul(U,A),Z=t.mul(B,A);if(F)return{x:t.ZERO,y:t.ZERO};if(!t.eql(Z,t.ONE))throw new Error("invZ was invalid");return{x:te,y:G}}),b=Fn(I=>{if(I.is0()){if(e.allowInfinityPoint&&!t.is0(I.py))return;throw new Error("bad point: ZERO")}let{x:A,y:L}=I.toAffine();if(!t.isValid(A)||!t.isValid(L))throw new Error("bad point: x or y not FE");let U=t.sqr(L),B=o(A);if(!t.eql(U,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 x{constructor(A,L,U){if(this.px=A,this.py=L,this.pz=U,A==null||!t.isValid(A))throw new Error("x required");if(L==null||!t.isValid(L))throw new Error("y required");if(U==null||!t.isValid(U))throw new Error("z required");Object.freeze(this)}static fromAffine(A){let{x:L,y:U}=A||{};if(!A||!t.isValid(L)||!t.isValid(U))throw new Error("invalid affine point");if(A instanceof x)throw new Error("projective point not allowed");let B=F=>t.eql(F,t.ZERO);return B(L)&&B(U)?x.ZERO:new x(L,U,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(A){let L=t.invertBatch(A.map(U=>U.pz));return A.map((U,B)=>U.toAffine(L[B])).map(x.fromAffine)}static fromHex(A){let L=x.fromAffine(i(We("pointHex",A)));return L.assertValidity(),L}static fromPrivateKey(A){return x.BASE.multiply(u(A))}static msm(A,L){return ro(x,n,A,L)}_setWindowSize(A){T.setWindowSize(this,A)}assertValidity(){b(this)}hasEvenY(){let{y:A}=this.toAffine();if(t.isOdd)return!t.isOdd(A);throw new Error("Field doesn't support isOdd")}equals(A){p(A);let{px:L,py:U,pz:B}=this,{px:F,py:te,pz:G}=A,Z=t.eql(t.mul(L,G),t.mul(F,B)),ee=t.eql(t.mul(U,G),t.mul(te,B));return Z&&ee}negate(){return new x(this.px,t.neg(this.py),this.pz)}double(){let{a:A,b:L}=e,U=t.mul(L,kh),{px:B,py:F,pz:te}=this,G=t.ZERO,Z=t.ZERO,ee=t.ZERO,Y=t.mul(B,B),Ie=t.mul(F,F),re=t.mul(te,te),le=t.mul(B,F);return le=t.add(le,le),ee=t.mul(B,te),ee=t.add(ee,ee),G=t.mul(A,ee),Z=t.mul(U,re),Z=t.add(G,Z),G=t.sub(Ie,Z),Z=t.add(Ie,Z),Z=t.mul(G,Z),G=t.mul(le,G),ee=t.mul(U,ee),re=t.mul(A,re),le=t.sub(Y,re),le=t.mul(A,le),le=t.add(le,ee),ee=t.add(Y,Y),Y=t.add(ee,Y),Y=t.add(Y,re),Y=t.mul(Y,le),Z=t.add(Z,Y),re=t.mul(F,te),re=t.add(re,re),Y=t.mul(re,le),G=t.sub(G,Y),ee=t.mul(re,Ie),ee=t.add(ee,ee),ee=t.add(ee,ee),new x(G,Z,ee)}add(A){p(A);let{px:L,py:U,pz:B}=this,{px:F,py:te,pz:G}=A,Z=t.ZERO,ee=t.ZERO,Y=t.ZERO,Ie=e.a,re=t.mul(e.b,kh),le=t.mul(L,F),E=t.mul(U,te),a=t.mul(B,G),l=t.add(L,U),d=t.add(F,te);l=t.mul(l,d),d=t.add(le,E),l=t.sub(l,d),d=t.add(L,B);let h=t.add(F,G);return d=t.mul(d,h),h=t.add(le,a),d=t.sub(d,h),h=t.add(U,B),Z=t.add(te,G),h=t.mul(h,Z),Z=t.add(E,a),h=t.sub(h,Z),Y=t.mul(Ie,d),Z=t.mul(re,a),Y=t.add(Z,Y),Z=t.sub(E,Y),Y=t.add(E,Y),ee=t.mul(Z,Y),E=t.add(le,le),E=t.add(E,le),a=t.mul(Ie,a),d=t.mul(re,d),E=t.add(E,a),a=t.sub(le,a),a=t.mul(Ie,a),d=t.add(d,a),le=t.mul(E,d),ee=t.add(ee,le),le=t.mul(h,d),Z=t.mul(l,Z),Z=t.sub(Z,le),le=t.mul(l,E),Y=t.mul(h,Y),Y=t.add(Y,le),new x(Z,ee,Y)}subtract(A){return this.add(A.negate())}is0(){return this.equals(x.ZERO)}wNAF(A){return T.wNAFCached(this,A,x.normalizeZ)}multiplyUnsafe(A){let{endo:L,n:U}=e;jt("scalar",A,Dr,U);let B=x.ZERO;if(A===Dr)return B;if(this.is0()||A===Et)return this;if(!L||T.hasPrecomputes(this))return T.wNAFCachedUnsafe(this,A,x.normalizeZ);let{k1neg:F,k1:te,k2neg:G,k2:Z}=L.splitScalar(A),ee=B,Y=B,Ie=this;for(;te>Dr||Z>Dr;)te&Et&&(ee=ee.add(Ie)),Z&Et&&(Y=Y.add(Ie)),Ie=Ie.double(),te>>=Et,Z>>=Et;return F&&(ee=ee.negate()),G&&(Y=Y.negate()),Y=new x(t.mul(Y.px,L.beta),Y.py,Y.pz),ee.add(Y)}multiply(A){let{endo:L,n:U}=e;jt("scalar",A,Et,U);let B,F;if(L){let{k1neg:te,k1:G,k2neg:Z,k2:ee}=L.splitScalar(A),{p:Y,f:Ie}=this.wNAF(G),{p:re,f:le}=this.wNAF(ee);Y=T.constTimeNegate(te,Y),re=T.constTimeNegate(Z,re),re=new x(t.mul(re.px,L.beta),re.py,re.pz),B=Y.add(re),F=Ie.add(le)}else{let{p:te,f:G}=this.wNAF(A);B=te,F=G}return x.normalizeZ([B,F])[0]}multiplyAndAddUnsafe(A,L,U){let B=x.BASE,F=(G,Z)=>Z===Dr||Z===Et||!G.equals(B)?G.multiplyUnsafe(Z):G.multiply(Z),te=F(this,L).add(F(A,U));return te.is0()?void 0:te}toAffine(A){return m(this,A)}isTorsionFree(){let{h:A,isTorsionFree:L}=e;if(A===Et)return!0;if(L)return L(x,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:A,clearCofactor:L}=e;return A===Et?this:L?L(x,this):this.multiplyUnsafe(e.h)}toRawBytes(A=!0){return ur("isCompressed",A),this.assertValidity(),s(x,this,A)}toHex(A=!0){return ur("isCompressed",A),Lr(this.toRawBytes(A))}}x.BASE=new x(e.Gx,e.Gy,t.ONE),x.ZERO=new x(t.ZERO,t.ONE,t.ZERO);let S=e.nBitLength,T=to(x,e.endo?Math.ceil(S/2):S);return{CURVE:e,ProjectivePoint:x,normPrivateKeyToScalar:u,weierstrassEquation:o,isWithinCurveOrder:c}}function _E(r){let e=Hs(r);return br(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function Oh(r){let e=_E(r),{Fp:t,n}=e,s=t.BYTES+1,i=2*t.BYTES+1;function o(a){return ke(a,n)}function c(a){return Qi(a,n)}let{ProjectivePoint:u,normPrivateKeyToScalar:p,weierstrassEquation:m,isWithinCurveOrder:b}=yE({...e,toBytes(a,l,d){let h=l.toAffine(),g=t.toBytes(h.x),w=Cr;return ur("isCompressed",d),d?w(Uint8Array.from([l.hasEvenY()?2:3]),g):w(Uint8Array.from([4]),g,t.toBytes(h.y))},fromBytes(a){let l=a.length,d=a[0],h=a.subarray(1);if(l===s&&(d===2||d===3)){let g=Br(h);if(!js(g,Et,t.ORDER))throw new Error("Point is not on curve");let w=m(g),v;try{v=t.sqrt(w)}catch(_){let C=_ instanceof Error?": "+_.message:"";throw new Error("Point is not on curve"+C)}let y=(v&Et)===Et;return(d&1)===1!==y&&(v=t.neg(v)),{x:g,y:v}}else if(l===i&&d===4){let g=t.fromBytes(h.subarray(0,t.BYTES)),w=t.fromBytes(h.subarray(t.BYTES,2*t.BYTES));return{x:g,y:w}}else{let g=s,w=i;throw new Error("invalid Point, expected length of "+g+", or uncompressed "+w+", got "+l)}}}),x=a=>Lr(en(a,e.nByteLength));function S(a){let l=n>>Et;return a>l}function T(a){return S(a)?o(-a):a}let I=(a,l,d)=>Br(a.slice(l,d));class A{constructor(l,d,h){this.r=l,this.s=d,this.recovery=h,this.assertValidity()}static fromCompact(l){let d=e.nByteLength;return l=We("compactSignature",l,d*2),new A(I(l,0,d),I(l,d,2*d))}static fromDER(l){let{r:d,s:h}=Ur.toSig(We("DER",l));return new A(d,h)}assertValidity(){jt("r",this.r,Et,n),jt("s",this.s,Et,n)}addRecoveryBit(l){return new A(this.r,this.s,l)}recoverPublicKey(l){let{r:d,s:h,recovery:g}=this,w=G(We("msgHash",l));if(g==null||![0,1,2,3].includes(g))throw new Error("recovery id invalid");let v=g===2||g===3?d+e.n:d;if(v>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");let y=(g&1)===0?"02":"03",f=u.fromHex(y+x(v)),_=c(v),C=o(-w*_),D=o(h*_),$=u.BASE.multiplyAndAddUnsafe(f,C,D);if(!$)throw new Error("point at infinify");return $.assertValidity(),$}hasHighS(){return S(this.s)}normalizeS(){return this.hasHighS()?new A(this.r,o(-this.s),this.recovery):this}toDERRawBytes(){return Dn(this.toDERHex())}toDERHex(){return Ur.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Dn(this.toCompactHex())}toCompactHex(){return x(this.r)+x(this.s)}}let L={isValidPrivateKey(a){try{return p(a),!0}catch{return!1}},normPrivateKeyToScalar:p,randomPrivateKey:()=>{let a=Oc(e.n);return od(e.randomBytes(a),e.n)},precompute(a=8,l=u.BASE){return l._setWindowSize(a),l.multiply(BigInt(3)),l}};function U(a,l=!0){return u.fromPrivateKey(a).toRawBytes(l)}function B(a){let l=Xr(a),d=typeof a=="string",h=(l||d)&&a.length;return l?h===s||h===i:d?h===2*s||h===2*i:a instanceof u}function F(a,l,d=!0){if(B(a))throw new Error("first arg must be private key");if(!B(l))throw new Error("second arg must be public key");return u.fromHex(l).multiply(p(a)).toRawBytes(d)}let te=e.bits2int||function(a){if(a.length>8192)throw new Error("input is too large");let l=Br(a),d=a.length*8-e.nBitLength;return d>0?l>>BigInt(d):l},G=e.bits2int_modN||function(a){return o(te(a))},Z=Ks(e.nBitLength);function ee(a){return jt("num < 2^"+e.nBitLength,a,Dr,Z),en(a,e.nByteLength)}function Y(a,l,d=Ie){if(["recovered","canonical"].some(oe=>oe in d))throw new Error("sign() legacy options not supported");let{hash:h,randomBytes:g}=e,{lowS:w,prehash:v,extraEntropy:y}=d;w==null&&(w=!0),a=We("msgHash",a),Ih(d),v&&(a=We("prehashed msgHash",h(a)));let f=G(a),_=p(l),C=[ee(_),ee(f)];if(y!=null&&y!==!1){let oe=y===!0?g(t.BYTES):y;C.push(We("extraEntropy",oe))}let D=Cr(...C),$=f;function X(oe){let fe=te(oe);if(!b(fe))return;let Be=c(fe),he=u.BASE.multiply(fe).toAffine(),me=o(he.x);if(me===Dr)return;let Gt=o(Be*o($+me*_));if(Gt===Dr)return;let xe=(he.x===me?0:2)|Number(he.y&Et),Ne=Gt;return w&&S(Gt)&&(Ne=T(Gt),xe^=1),new A(me,Ne,xe)}return{seed:D,k2sig:X}}let Ie={lowS:e.lowS,prehash:!1},re={lowS:e.lowS,prehash:!1};function le(a,l,d=Ie){let{seed:h,k2sig:g}=Y(a,l,d),w=e;return xc(w.hash.outputLen,w.nByteLength,w.hmac)(h,g)}u.BASE._setWindowSize(8);function E(a,l,d,h=re){let g=a;l=We("msgHash",l),d=We("publicKey",d);let{lowS:w,prehash:v,format:y}=h;if(Ih(h),"strict"in h)throw new Error("options.strict was renamed to lowS");if(y!==void 0&&y!=="compact"&&y!=="der")throw new Error("format must be compact or der");let f=typeof g=="string"||Xr(g),_=!f&&!y&&typeof g=="object"&&g!==null&&typeof g.r=="bigint"&&typeof g.s=="bigint";if(!f&&!_)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let C,D;try{if(_&&(C=new A(g.r,g.s)),f){try{y!=="compact"&&(C=A.fromDER(g))}catch(xe){if(!(xe instanceof Ur.Err))throw xe}!C&&y!=="der"&&(C=A.fromCompact(g))}D=u.fromHex(d)}catch{return!1}if(!C||w&&C.hasHighS())return!1;v&&(l=e.hash(l));let{r:$,s:X}=C,oe=G(l),fe=c(X),Be=o(oe*fe),he=o($*fe),me=u.BASE.multiplyAndAddUnsafe(D,Be,he)?.toAffine();return me?o(me.x)===$:!1}return{CURVE:e,getPublicKey:U,getSharedSecret:F,sign:le,verify:E,ProjectivePoint:u,Signature:A,utils:L}}function bE(r){return{hash:r,hmac:(e,...t)=>gu(r,e,hc(...t)),randomBytes:Gi}}function Th(r,e){let t=n=>Oh({...r,...bE(n)});return{...t(e),create:t}}var Bh=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Nh=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),wE=BigInt(1),_u=BigInt(2),Lh=(r,e)=>(r+e/_u)/e;function EE(r){let e=Bh,t=BigInt(3),n=BigInt(6),s=BigInt(11),i=BigInt(22),o=BigInt(23),c=BigInt(44),u=BigInt(88),p=r*r*r%e,m=p*p*r%e,b=Pe(m,t,e)*m%e,x=Pe(b,t,e)*m%e,S=Pe(x,_u,e)*p%e,T=Pe(S,s,e)*S%e,I=Pe(T,i,e)*T%e,A=Pe(I,c,e)*I%e,L=Pe(A,u,e)*A%e,U=Pe(L,c,e)*I%e,B=Pe(U,t,e)*m%e,F=Pe(B,o,e)*T%e,te=Pe(F,n,e)*p%e,G=Pe(te,_u,e);if(!bu.eql(bu.sqr(G),r))throw new Error("Cannot find square root");return G}var bu=tn(Bh,void 0,void 0,{sqrt:EE}),ci=Th({a:BigInt(0),b:BigInt(7),Fp:bu,n:Nh,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:r=>{let e=Nh,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-wE*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=t,o=BigInt("0x100000000000000000000000000000000"),c=Lh(i*r,e),u=Lh(-n*r,e),p=ke(r-c*t-u*s,e),m=ke(-c*n-u*i,e),b=p>o,x=m>o;if(b&&(p=e-p),x&&(m=e-m),p>o||m>o)throw new Error("splitScalar: Endomorphism failed, k="+r);return{k1neg:b,k1:p,k2neg:x,k2:m}}}},Gs),yI=BigInt(0);var _I=ci.ProjectivePoint;var II=Vn.utils.randomPrivateKey,Ch=()=>{let r=Vn.utils.randomPrivateKey(),e=Ou(r),t=new Uint8Array(64);return t.set(r),t.set(e,32),{publicKey:e,secretKey:t}},Ou=Vn.getPublicKey;function Ph(r){try{return Vn.ExtendedPoint.fromHex(r),!0}catch{return!1}}var Wu=(r,e)=>Vn.sign(r,e.slice(0,32)),RE=Vn.verify,we=r=>ce.Buffer.isBuffer(r)?r:r instanceof Uint8Array?ce.Buffer.from(r.buffer,r.byteOffset,r.byteLength):ce.Buffer.from(r),Tu=class{constructor(e){Object.assign(this,e)}encode(){return ce.Buffer.from((0,Ns.serialize)(jo,this))}static decode(e){return(0,Ns.deserialize)(jo,this,e)}static decodeUnchecked(e){return(0,Ns.deserializeUnchecked)(jo,this,e)}};var jo=new Map,ep,vE=32,pn=32;function SE(r){return r._bn!==void 0}var Mh=1,ue=class r extends Tu{constructor(e){if(super({}),this._bn=void 0,SE(e))this._bn=e._bn;else{if(typeof e=="string"){let t=Rt.default.decode(e);if(t.length!=pn)throw new Error("Invalid public key input");this._bn=new ku.default(t)}else this._bn=new ku.default(e);if(this._bn.byteLength()>pn)throw new Error("Invalid public key input")}}static unique(){let e=new r(Mh);return Mh+=1,new r(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(ce.Buffer);if(e.length===pn)return e;let t=ce.Buffer.alloc(32);return e.copy(t,32-e.length),t}get[Symbol.toStringTag](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(e,t,n){let s=ce.Buffer.concat([e.toBuffer(),ce.Buffer.from(t),n.toBuffer()]),i=Gs(s);return new r(i)}static createProgramAddressSync(e,t){let n=ce.Buffer.alloc(0);e.forEach(function(i){if(i.length>vE)throw new TypeError("Max seed length exceeded");n=ce.Buffer.concat([n,we(i)])}),n=ce.Buffer.concat([n,t.toBuffer(),ce.Buffer.from("ProgramDerivedAddress")]);let s=Gs(n);if(Ph(s))throw new Error("Invalid seeds, address must fall off the curve");return new r(s)}static async createProgramAddress(e,t){return this.createProgramAddressSync(e,t)}static findProgramAddressSync(e,t){let n=255,s;for(;n!=0;){try{let i=e.concat(ce.Buffer.from([n]));s=this.createProgramAddressSync(i,t)}catch(i){if(i instanceof TypeError)throw i;n--;continue}return[s,n]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(e,t){return this.findProgramAddressSync(e,t)}static isOnCurve(e){let t=new r(e);return Ph(t.toBytes())}};ep=ue;ue.default=new ep("11111111111111111111111111111111");jo.set(ue,{kind:"struct",fields:[["_bn","u256"]]});var kI=new ue("BPFLoader1111111111111111111111111111111111"),Jn=1232,qu=127,Ko=64,Ho=class extends Error{constructor(e){super(`Signature ${e} has expired: block height exceeded.`),this.signature=void 0,this.signature=e}};Object.defineProperty(Ho.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});var Go=class extends Error{constructor(e,t){super(`Transaction was not confirmed in ${t.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(Go.prototype,"name",{value:"TransactionExpiredTimeoutError"});var Yn=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(Yn.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});var Os=class{constructor(e,t){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=e,this.accountKeysFromLookups=t}keySegments(){let e=[this.staticAccountKeys];return this.accountKeysFromLookups&&(e.push(this.accountKeysFromLookups.writable),e.push(this.accountKeysFromLookups.readonly)),e}get(e){for(let t of this.keySegments()){if(e<t.length)return t[e];e-=t.length}}get length(){return this.keySegments().flat().length}compileInstructions(e){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let n=new Map;this.keySegments().flat().forEach((i,o)=>{n.set(i.toBase58(),o)});let s=i=>{let o=n.get(i.toBase58());if(o===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return o};return e.map(i=>({programIdIndex:s(i.programId),accountKeyIndexes:i.keys.map(o=>s(o.pubkey)),data:i.data}))}},be=(r="publicKey")=>R.blob(32,r),xE=(r="signature")=>R.blob(64,r),ks=(r="string")=>{let e=R.struct([R.u32("length"),R.u32("lengthPadding"),R.blob(R.offset(R.u32(),-8),"chars")],r),t=e.decode.bind(e),n=e.encode.bind(e),s=e;return s.decode=(i,o)=>t(i,o).chars.toString(),s.encode=(i,o,c)=>{let u={chars:ce.Buffer.from(i,"utf8")};return n(u,o,c)},s.alloc=i=>R.u32().span+R.u32().span+ce.Buffer.from(i,"utf8").length,s},AE=(r="authorized")=>R.struct([be("staker"),be("withdrawer")],r),IE=(r="lockup")=>R.struct([R.ns64("unixTimestamp"),R.ns64("epoch"),be("custodian")],r),kE=(r="voteInit")=>R.struct([be("nodePubkey"),be("authorizedVoter"),be("authorizedWithdrawer"),R.u8("commission")],r),OE=(r="voteAuthorizeWithSeedArgs")=>R.struct([R.u32("voteAuthorizationType"),be("currentAuthorityDerivedKeyOwnerPubkey"),ks("currentAuthorityDerivedKeySeed"),be("newAuthorized")],r);function tp(r,e){let t=s=>{if(s.span>=0)return s.span;if(typeof s.alloc=="function")return s.alloc(e[s.property]);if("count"in s&&"elementLayout"in s){let i=e[s.property];if(Array.isArray(i))return i.length*t(s.elementLayout)}else if("fields"in s)return tp({layout:s},e[s.property]);return 0},n=0;return r.layout.fields.forEach(s=>{n+=t(s)}),n}function Yt(r){let e=0,t=0;for(;;){let n=r.shift();if(e|=(n&127)<<t*7,t+=1,(n&128)===0)break}return e}function Jt(r,e){let t=e;for(;;){let n=t&127;if(t>>=7,t==0){r.push(n);break}else n|=128,r.push(n)}}function Ae(r,e){if(!r)throw new Error(e||"Assertion failed")}var Zo=class r{constructor(e,t){this.payer=void 0,this.keyMetaMap=void 0,this.payer=e,this.keyMetaMap=t}static compile(e,t){let n=new Map,s=o=>{let c=o.toBase58(),u=n.get(c);return u===void 0&&(u={isSigner:!1,isWritable:!1,isInvoked:!1},n.set(c,u)),u},i=s(t);i.isSigner=!0,i.isWritable=!0;for(let o of e){s(o.programId).isInvoked=!0;for(let c of o.keys){let u=s(c.pubkey);u.isSigner||=c.isSigner,u.isWritable||=c.isWritable}}return new r(t,n)}getMessageComponents(){let e=[...this.keyMetaMap.entries()];Ae(e.length<=256,"Max static account keys length exceeded");let t=e.filter(([,u])=>u.isSigner&&u.isWritable),n=e.filter(([,u])=>u.isSigner&&!u.isWritable),s=e.filter(([,u])=>!u.isSigner&&u.isWritable),i=e.filter(([,u])=>!u.isSigner&&!u.isWritable),o={numRequiredSignatures:t.length+n.length,numReadonlySignedAccounts:n.length,numReadonlyUnsignedAccounts:i.length};{Ae(t.length>0,"Expected at least one writable signer key");let[u]=t[0];Ae(u===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}let c=[...t.map(([u])=>new ue(u)),...n.map(([u])=>new ue(u)),...s.map(([u])=>new ue(u)),...i.map(([u])=>new ue(u))];return[o,c]}extractTableLookup(e){let[t,n]=this.drainKeysFoundInLookupTable(e.state.addresses,o=>!o.isSigner&&!o.isInvoked&&o.isWritable),[s,i]=this.drainKeysFoundInLookupTable(e.state.addresses,o=>!o.isSigner&&!o.isInvoked&&!o.isWritable);if(!(t.length===0&&s.length===0))return[{accountKey:e.key,writableIndexes:t,readonlyIndexes:s},{writable:n,readonly:i}]}drainKeysFoundInLookupTable(e,t){let n=new Array,s=new Array;for(let[i,o]of this.keyMetaMap.entries())if(t(o)){let c=new ue(i),u=e.findIndex(p=>p.equals(c));u>=0&&(Ae(u<256,"Max lookup table index exceeded"),n.push(u),s.push(c),this.keyMetaMap.delete(i))}return[n,s]}},rp="Reached end of buffer unexpectedly";function Fr(r){if(r.length===0)throw new Error(rp);return r.shift()}function Xt(r,...e){let[t]=e;if(e.length===2?t+(e[1]??0)>r.length:t>=r.length)throw new Error(rp);return r.splice(...e)}var mn=class r{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(t=>new ue(t)),this.recentBlockhash=e.recentBlockhash,this.instructions=e.instructions,this.instructions.forEach(t=>this.indexToProgramIds.set(t.programIdIndex,this.accountKeys[t.programIdIndex]))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map(e=>({programIdIndex:e.programIdIndex,accountKeyIndexes:e.accounts,data:Rt.default.decode(e.data)}))}get addressTableLookups(){return[]}getAccountKeys(){return new Os(this.staticAccountKeys)}static compile(e){let t=Zo.compile(e.instructions,e.payerKey),[n,s]=t.getMessageComponents(),o=new Os(s).compileInstructions(e.instructions).map(c=>({programIdIndex:c.programIdIndex,accounts:c.accountKeyIndexes,data:Rt.default.encode(c.data)}));return new r({header:n,accountKeys:s,recentBlockhash:e.recentBlockhash,instructions:o})}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){let t=this.header.numRequiredSignatures;if(e>=this.header.numRequiredSignatures){let n=e-t,i=this.accountKeys.length-t-this.header.numReadonlyUnsignedAccounts;return n<i}else{let n=t-this.header.numReadonlySignedAccounts;return e<n}}isProgramId(e){return this.indexToProgramIds.has(e)}programIds(){return[...this.indexToProgramIds.values()]}nonProgramIds(){return this.accountKeys.filter((e,t)=>!this.isProgramId(t))}serialize(){let e=this.accountKeys.length,t=[];Jt(t,e);let n=this.instructions.map(b=>{let{accounts:x,programIdIndex:S}=b,T=Array.from(Rt.default.decode(b.data)),I=[];Jt(I,x.length);let A=[];return Jt(A,T.length),{programIdIndex:S,keyIndicesCount:ce.Buffer.from(I),keyIndices:x,dataLength:ce.Buffer.from(A),data:T}}),s=[];Jt(s,n.length);let i=ce.Buffer.alloc(Jn);ce.Buffer.from(s).copy(i);let o=s.length;n.forEach(b=>{let S=R.struct([R.u8("programIdIndex"),R.blob(b.keyIndicesCount.length,"keyIndicesCount"),R.seq(R.u8("keyIndex"),b.keyIndices.length,"keyIndices"),R.blob(b.dataLength.length,"dataLength"),R.seq(R.u8("userdatum"),b.data.length,"data")]).encode(b,i,o);o+=S}),i=i.slice(0,o);let c=R.struct([R.blob(1,"numRequiredSignatures"),R.blob(1,"numReadonlySignedAccounts"),R.blob(1,"numReadonlyUnsignedAccounts"),R.blob(t.length,"keyCount"),R.seq(be("key"),e,"keys"),be("recentBlockhash")]),u={numRequiredSignatures:ce.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:ce.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:ce.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:ce.Buffer.from(t),keys:this.accountKeys.map(b=>we(b.toBytes())),recentBlockhash:Rt.default.decode(this.recentBlockhash)},p=ce.Buffer.alloc(2048),m=c.encode(u,p);return i.copy(p,m),p.slice(0,m+i.length)}static from(e){let t=[...e],n=Fr(t);if(n!==(n&qu))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");let s=Fr(t),i=Fr(t),o=Yt(t),c=[];for(let x=0;x<o;x++){let S=Xt(t,0,pn);c.push(new ue(ce.Buffer.from(S)))}let u=Xt(t,0,pn),p=Yt(t),m=[];for(let x=0;x<p;x++){let S=Fr(t),T=Yt(t),I=Xt(t,0,T),A=Yt(t),L=Xt(t,0,A),U=Rt.default.encode(ce.Buffer.from(L));m.push({programIdIndex:S,accounts:I,data:U})}let b={header:{numRequiredSignatures:n,numReadonlySignedAccounts:s,numReadonlyUnsignedAccounts:i},recentBlockhash:Rt.default.encode(ce.Buffer.from(u)),accountKeys:c,instructions:m};return new r(b)}},Yo=class r{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 t of this.addressTableLookups)e+=t.readonlyIndexes.length+t.writableIndexes.length;return e}getAccountKeys(e){let t;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");t=e.accountKeysFromLookups}else if(e&&"addressLookupTableAccounts"in e&&e.addressLookupTableAccounts)t=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 Os(this.staticAccountKeys,t)}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){let t=this.header.numRequiredSignatures,n=this.staticAccountKeys.length;if(e>=n){let s=e-n,i=this.addressTableLookups.reduce((o,c)=>o+c.writableIndexes.length,0);return s<i}else if(e>=this.header.numRequiredSignatures){let s=e-t,o=n-t-this.header.numReadonlyUnsignedAccounts;return s<o}else{let s=t-this.header.numReadonlySignedAccounts;return e<s}}resolveAddressTableLookups(e){let t={writable:[],readonly:[]};for(let n of this.addressTableLookups){let s=e.find(i=>i.key.equals(n.accountKey));if(!s)throw new Error(`Failed to find address lookup table account for table key ${n.accountKey.toBase58()}`);for(let i of n.writableIndexes)if(i<s.state.addresses.length)t.writable.push(s.state.addresses[i]);else throw new Error(`Failed to find address for index ${i} in address lookup table ${n.accountKey.toBase58()}`);for(let i of n.readonlyIndexes)if(i<s.state.addresses.length)t.readonly.push(s.state.addresses[i]);else throw new Error(`Failed to find address for index ${i} in address lookup table ${n.accountKey.toBase58()}`)}return t}static compile(e){let t=Zo.compile(e.instructions,e.payerKey),n=new Array,s={writable:new Array,readonly:new Array},i=e.addressLookupTableAccounts||[];for(let m of i){let b=t.extractTableLookup(m);if(b!==void 0){let[x,{writable:S,readonly:T}]=b;n.push(x),s.writable.push(...S),s.readonly.push(...T)}}let[o,c]=t.getMessageComponents(),p=new Os(c,s).compileInstructions(e.instructions);return new r({header:o,staticAccountKeys:c,recentBlockhash:e.recentBlockhash,compiledInstructions:p,addressTableLookups:n})}serialize(){let e=Array();Jt(e,this.staticAccountKeys.length);let t=this.serializeInstructions(),n=Array();Jt(n,this.compiledInstructions.length);let s=this.serializeAddressTableLookups(),i=Array();Jt(i,this.addressTableLookups.length);let o=R.struct([R.u8("prefix"),R.struct([R.u8("numRequiredSignatures"),R.u8("numReadonlySignedAccounts"),R.u8("numReadonlyUnsignedAccounts")],"header"),R.blob(e.length,"staticAccountKeysLength"),R.seq(be(),this.staticAccountKeys.length,"staticAccountKeys"),be("recentBlockhash"),R.blob(n.length,"instructionsLength"),R.blob(t.length,"serializedInstructions"),R.blob(i.length,"addressTableLookupsLength"),R.blob(s.length,"serializedAddressTableLookups")]),c=new Uint8Array(Jn),p=o.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(n),serializedInstructions:t,addressTableLookupsLength:new Uint8Array(i),serializedAddressTableLookups:s},c);return c.slice(0,p)}serializeInstructions(){let e=0,t=new Uint8Array(Jn);for(let n of this.compiledInstructions){let s=Array();Jt(s,n.accountKeyIndexes.length);let i=Array();Jt(i,n.data.length);let o=R.struct([R.u8("programIdIndex"),R.blob(s.length,"encodedAccountKeyIndexesLength"),R.seq(R.u8(),n.accountKeyIndexes.length,"accountKeyIndexes"),R.blob(i.length,"encodedDataLength"),R.blob(n.data.length,"data")]);e+=o.encode({programIdIndex:n.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(s),accountKeyIndexes:n.accountKeyIndexes,encodedDataLength:new Uint8Array(i),data:n.data},t,e)}return t.slice(0,e)}serializeAddressTableLookups(){let e=0,t=new Uint8Array(Jn);for(let n of this.addressTableLookups){let s=Array();Jt(s,n.writableIndexes.length);let i=Array();Jt(i,n.readonlyIndexes.length);let o=R.struct([be("accountKey"),R.blob(s.length,"encodedWritableIndexesLength"),R.seq(R.u8(),n.writableIndexes.length,"writableIndexes"),R.blob(i.length,"encodedReadonlyIndexesLength"),R.seq(R.u8(),n.readonlyIndexes.length,"readonlyIndexes")]);e+=o.encode({accountKey:n.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(s),writableIndexes:n.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(i),readonlyIndexes:n.readonlyIndexes},t,e)}return t.slice(0,e)}static deserialize(e){let t=[...e],n=Fr(t),s=n&qu;Ae(n!==s,"Expected versioned message but received legacy message");let i=s;Ae(i===0,`Expected versioned message with version 0 but found version ${i}`);let o={numRequiredSignatures:Fr(t),numReadonlySignedAccounts:Fr(t),numReadonlyUnsignedAccounts:Fr(t)},c=[],u=Yt(t);for(let T=0;T<u;T++)c.push(new ue(Xt(t,0,pn)));let p=Rt.default.encode(Xt(t,0,pn)),m=Yt(t),b=[];for(let T=0;T<m;T++){let I=Fr(t),A=Yt(t),L=Xt(t,0,A),U=Yt(t),B=new Uint8Array(Xt(t,0,U));b.push({programIdIndex:I,accountKeyIndexes:L,data:B})}let x=Yt(t),S=[];for(let T=0;T<x;T++){let I=new ue(Xt(t,0,pn)),A=Yt(t),L=Xt(t,0,A),U=Yt(t),B=Xt(t,0,U);S.push({accountKey:I,writableIndexes:L,readonlyIndexes:B})}return new r({header:o,staticAccountKeys:c,recentBlockhash:p,compiledInstructions:b,addressTableLookups:S})}},na={deserializeMessageVersion(r){let e=r[0],t=e&qu;return t===e?"legacy":t},deserialize:r=>{let e=na.deserializeMessageVersion(r);if(e==="legacy")return mn.from(r);if(e===0)return Yo.deserialize(r);throw new Error(`Transaction message version ${e} deserialization is not supported`)}},dn=function(r){return r[r.BLOCKHEIGHT_EXCEEDED=0]="BLOCKHEIGHT_EXCEEDED",r[r.PROCESSED=1]="PROCESSED",r[r.TIMED_OUT=2]="TIMED_OUT",r[r.NONCE_INVALID=3]="NONCE_INVALID",r}({}),TE=ce.Buffer.alloc(Ko).fill(0),Te=class{constructor(e){this.keys=void 0,this.programId=void 0,this.data=ce.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:t,isWritable:n})=>({pubkey:e.toJSON(),isSigner:t,isWritable:n})),programId:this.programId.toJSON(),data:[...this.data]}}},Se=class r{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:t,nonceInfo:n}=e;this.minNonceContextSlot=t,this.nonceInfo=n}else if(Object.prototype.hasOwnProperty.call(e,"lastValidBlockHeight")){let{blockhash:t,lastValidBlockHeight:n}=e;this.recentBlockhash=t,this.lastValidBlockHeight=n}else{let{recentBlockhash:t,nonceInfo:n}=e;n&&(this.nonceInfo=n),this.recentBlockhash=t}}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(t=>{"instructions"in t?this.instructions=this.instructions.concat(t.instructions):"data"in t&&"programId"in t&&"keys"in t?this.instructions.push(t):this.instructions.push(new Te(t))}),this}compileMessage(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;let e,t;if(this.nonceInfo?(e=this.nonceInfo.nonce,this.instructions[0]!=this.nonceInfo.nonceInstruction?t=[this.nonceInfo.nonceInstruction,...this.instructions]:t=this.instructions):(e=this.recentBlockhash,t=this.instructions),!e)throw new Error("Transaction recentBlockhash required");t.length<1&&console.warn("No instructions provided");let n;if(this.feePayer)n=this.feePayer;else if(this.signatures.length>0&&this.signatures[0].publicKey)n=this.signatures[0].publicKey;else throw new Error("Transaction fee payer required");for(let I=0;I<t.length;I++)if(t[I].programId===void 0)throw new Error(`Transaction instruction index ${I} has undefined program id`);let s=[],i=[];t.forEach(I=>{I.keys.forEach(L=>{i.push({...L})});let A=I.programId.toString();s.includes(A)||s.push(A)}),s.forEach(I=>{i.push({pubkey:new ue(I),isSigner:!1,isWritable:!1})});let o=[];i.forEach(I=>{let A=I.pubkey.toString(),L=o.findIndex(U=>U.pubkey.toString()===A);L>-1?(o[L].isWritable=o[L].isWritable||I.isWritable,o[L].isSigner=o[L].isSigner||I.isSigner):o.push(I)}),o.sort(function(I,A){if(I.isSigner!==A.isSigner)return I.isSigner?-1:1;if(I.isWritable!==A.isWritable)return I.isWritable?-1:1;let L={localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"};return I.pubkey.toBase58().localeCompare(A.pubkey.toBase58(),"en",L)});let c=o.findIndex(I=>I.pubkey.equals(n));if(c>-1){let[I]=o.splice(c,1);I.isSigner=!0,I.isWritable=!0,o.unshift(I)}else o.unshift({pubkey:n,isSigner:!0,isWritable:!0});for(let I of this.signatures){let A=o.findIndex(L=>L.pubkey.equals(I.publicKey));if(A>-1)o[A].isSigner||(o[A].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,b=[],x=[];o.forEach(({pubkey:I,isSigner:A,isWritable:L})=>{A?(b.push(I.toString()),u+=1,L||(p+=1)):(x.push(I.toString()),L||(m+=1))});let S=b.concat(x),T=t.map(I=>{let{data:A,programId:L}=I;return{programIdIndex:S.indexOf(L.toString()),accounts:I.keys.map(U=>S.indexOf(U.pubkey.toString())),data:Rt.default.encode(A)}});return T.forEach(I=>{Ae(I.programIdIndex>=0),I.accounts.forEach(A=>Ae(A>=0))}),new mn({header:{numRequiredSignatures:u,numReadonlySignedAccounts:p,numReadonlyUnsignedAccounts:m},accountKeys:S,recentBlockhash:e,instructions:T})}_compile(){let e=this.compileMessage(),t=e.accountKeys.slice(0,e.header.numRequiredSignatures);return this.signatures.length===t.length&&this.signatures.every((s,i)=>t[i].equals(s.publicKey))||(this.signatures=t.map(n=>({signature:null,publicKey:n}))),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 t=new Set;this.signatures=e.filter(n=>{let s=n.toString();return t.has(s)?!1:(t.add(s),!0)}).map(n=>({signature:null,publicKey:n}))}sign(...e){if(e.length===0)throw new Error("No signers");let t=new Set,n=[];for(let i of e){let o=i.publicKey.toString();t.has(o)||(t.add(o),n.push(i))}this.signatures=n.map(i=>({signature:null,publicKey:i.publicKey}));let s=this._compile();this._partialSign(s,...n)}partialSign(...e){if(e.length===0)throw new Error("No signers");let t=new Set,n=[];for(let i of e){let o=i.publicKey.toString();t.has(o)||(t.add(o),n.push(i))}let s=this._compile();this._partialSign(s,...n)}_partialSign(e,...t){let n=e.serialize();t.forEach(s=>{let i=Wu(n,s.secretKey);this._addSignature(s.publicKey,we(i))})}addSignature(e,t){this._compile(),this._addSignature(e,t)}_addSignature(e,t){Ae(t.length===64);let n=this.signatures.findIndex(s=>e.equals(s.publicKey));if(n<0)throw new Error(`unknown signer: ${e.toString()}`);this.signatures[n].signature=ce.Buffer.from(t)}verifySignatures(e=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),e)}_getMessageSignednessErrors(e,t){let n={};for(let{signature:s,publicKey:i}of this.signatures)s===null?t&&(n.missing||=[]).push(i):RE(s,e,i.toBytes())||(n.invalid||=[]).push(i);return n.invalid||n.missing?n:void 0}serialize(e){let{requireAllSignatures:t,verifySignatures:n}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},e),s=this.serializeMessage();if(n){let i=this._getMessageSignednessErrors(s,t);if(i){let o="Signature verification failed.";throw i.invalid&&(o+=`
|
|
6
|
-
Invalid signature for public key${
|
|
7
|
-
Missing signature for public key${
|
|
8
|
-
${JSON.stringify(
|
|
9
|
-
${
|
|
10
|
-
Message: ${
|
|
11
|
-
`+i+o;break;default:c=`Unknown action '${(u=>u)(e)}'`}super(c),this.signature=void 0,this.transactionMessage=void 0,this.transactionLogs=void 0,this.signature=t,this.transactionMessage=n,this.transactionLogs=s||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((t,n)=>{e.getTransaction(this.signature).then(s=>{if(s&&s.meta&&s.meta.logMessages){let i=s.meta.logMessages;this.transactionLogs=i,t(i)}else n(new Error("Log messages not found"))}).catch(n)})),await this.transactionLogs}};var Q=class extends Error{constructor({code:e,message:t,data:n},s){super(s!=null?`${s}: ${t}`:t),this.code=void 0,this.data=void 0,this.code=e,this.data=n,this.name="SolanaJSONRPCError"}};async function Uh(r,e,t,n){let s=n&&{skipPreflight:n.skipPreflight,preflightCommitment:n.preflightCommitment||n.commitment,maxRetries:n.maxRetries,minContextSlot:n.minContextSlot},i=await r.sendTransaction(e,t,s),o;if(e.recentBlockhash!=null&&e.lastValidBlockHeight!=null)o=(await r.confirmTransaction({abortSignal:n?.abortSignal,signature:i,blockhash:e.recentBlockhash,lastValidBlockHeight:e.lastValidBlockHeight},n&&n.commitment)).value;else if(e.minNonceContextSlot!=null&&e.nonceInfo!=null){let{nonceInstruction:c}=e.nonceInfo,u=c.keys[0].pubkey;o=(await r.confirmTransaction({abortSignal:n?.abortSignal,minContextSlot:e.minNonceContextSlot,nonceAccountPubkey:u,nonceValue:e.nonceInfo.nonce,signature:i},n&&n.commitment)).value}else n?.abortSignal!=null&&console.warn("sendAndConfirmTransaction(): A transaction with a deprecated confirmation strategy was supplied along with an `abortSignal`. Only transactions having `lastValidBlockHeight` or a combination of `nonceInfo` and `minNonceContextSlot` are abortable."),o=(await r.confirmTransaction(i,n&&n.commitment)).value;if(o.err)throw i!=null?new hi({action:"send",signature:i,transactionMessage:`Status: (${JSON.stringify(o)})`}):new Error(`Transaction ${i} failed (${JSON.stringify(o)})`);return i}function Zn(r){return new Promise(e=>setTimeout(e,r))}function Ee(r,e){let t=r.layout.span>=0?r.layout.span:tp(r,e),n=ce.Buffer.alloc(t),s=Object.assign({instruction:r.index},e);return r.layout.encode(s,n),n}var CE=R.nu64("lamportsPerSignature"),sp=R.struct([R.u32("version"),R.u32("state"),be("authorizedPubkey"),be("nonce"),R.struct([CE],"feeCalculator")]),Dh=sp.span,Nu=class r{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 t=sp.decode(we(e),0);return new r({authorizedPubkey:new ue(t.authorizedPubkey),nonce:new ue(t.nonce).toString(),feeCalculator:t.feeCalculator})}};function Ts(r){let e=(0,Xh.blob)(8,r),t=e.decode.bind(e),n=e.encode.bind(e),s=e,i=Fd();return s.decode=(o,c)=>{let u=t(o,c);return i.decode(u)},s.encode=(o,c,u)=>{let p=i.encode(o);return n(p,c,u)},s}var or=Object.freeze({Create:{index:0,layout:R.struct([R.u32("instruction"),R.ns64("lamports"),R.ns64("space"),be("programId")])},Assign:{index:1,layout:R.struct([R.u32("instruction"),be("programId")])},Transfer:{index:2,layout:R.struct([R.u32("instruction"),Ts("lamports")])},CreateWithSeed:{index:3,layout:R.struct([R.u32("instruction"),be("base"),ks("seed"),R.ns64("lamports"),R.ns64("space"),be("programId")])},AdvanceNonceAccount:{index:4,layout:R.struct([R.u32("instruction")])},WithdrawNonceAccount:{index:5,layout:R.struct([R.u32("instruction"),R.ns64("lamports")])},InitializeNonceAccount:{index:6,layout:R.struct([R.u32("instruction"),be("authorized")])},AuthorizeNonceAccount:{index:7,layout:R.struct([R.u32("instruction"),be("authorized")])},Allocate:{index:8,layout:R.struct([R.u32("instruction"),R.ns64("space")])},AllocateWithSeed:{index:9,layout:R.struct([R.u32("instruction"),be("base"),ks("seed"),R.ns64("space"),be("programId")])},AssignWithSeed:{index:10,layout:R.struct([R.u32("instruction"),be("base"),ks("seed"),be("programId")])},TransferWithSeed:{index:11,layout:R.struct([R.u32("instruction"),Ts("lamports"),ks("seed"),be("programId")])},UpgradeNonceAccount:{index:12,layout:R.struct([R.u32("instruction")])}}),Ft=class r{constructor(){}static createAccount(e){let t=or.Create,n=Ee(t,{lamports:e.lamports,space:e.space,programId:we(e.programId.toBuffer())});return new Te({keys:[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:n})}static transfer(e){let t,n;if("basePubkey"in e){let s=or.TransferWithSeed;t=Ee(s,{lamports:BigInt(e.lamports),seed:e.seed,programId:we(e.programId.toBuffer())}),n=[{pubkey:e.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]}else{let s=or.Transfer;t=Ee(s,{lamports:BigInt(e.lamports)}),n=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]}return new Te({keys:n,programId:this.programId,data:t})}static assign(e){let t,n;if("basePubkey"in e){let s=or.AssignWithSeed;t=Ee(s,{base:we(e.basePubkey.toBuffer()),seed:e.seed,programId:we(e.programId.toBuffer())}),n=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]}else{let s=or.Assign;t=Ee(s,{programId:we(e.programId.toBuffer())}),n=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]}return new Te({keys:n,programId:this.programId,data:t})}static createAccountWithSeed(e){let t=or.CreateWithSeed,n=Ee(t,{base:we(e.basePubkey.toBuffer()),seed:e.seed,lamports:e.lamports,space:e.space,programId:we(e.programId.toBuffer())}),s=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!1,isWritable:!0}];return e.basePubkey.equals(e.fromPubkey)||s.push({pubkey:e.basePubkey,isSigner:!0,isWritable:!1}),new Te({keys:s,programId:this.programId,data:n})}static createNonceAccount(e){let t=new Se;"basePubkey"in e&&"seed"in e?t.add(r.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:Dh,programId:this.programId})):t.add(r.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,lamports:e.lamports,space:Dh,programId:this.programId}));let n={noncePubkey:e.noncePubkey,authorizedPubkey:e.authorizedPubkey};return t.add(this.nonceInitialize(n)),t}static nonceInitialize(e){let t=or.InitializeNonceAccount,n=Ee(t,{authorized:we(e.authorizedPubkey.toBuffer())}),s={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:wu,isSigner:!1,isWritable:!1},{pubkey:di,isSigner:!1,isWritable:!1}],programId:this.programId,data:n};return new Te(s)}static nonceAdvance(e){let t=or.AdvanceNonceAccount,n=Ee(t),s={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:wu,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:n};return new Te(s)}static nonceWithdraw(e){let t=or.WithdrawNonceAccount,n=Ee(t,{lamports:e.lamports});return new Te({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0},{pubkey:wu,isSigner:!1,isWritable:!1},{pubkey:di,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:n})}static nonceAuthorize(e){let t=or.AuthorizeNonceAccount,n=Ee(t,{authorized:we(e.newAuthorizedPubkey.toBuffer())});return new Te({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:n})}static allocate(e){let t,n;if("basePubkey"in e){let s=or.AllocateWithSeed;t=Ee(s,{base:we(e.basePubkey.toBuffer()),seed:e.seed,space:e.space,programId:we(e.programId.toBuffer())}),n=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]}else{let s=or.Allocate;t=Ee(s,{space:e.space}),n=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]}return new Te({keys:n,programId:this.programId,data:t})}};Ft.programId=new ue("11111111111111111111111111111111");var PE=Jn-300,Lu=class r{constructor(){}static getMinNumSignatures(e){return 2*(Math.ceil(e/r.chunkSize)+1+1)}static async load(e,t,n,s,i){{let b=await e.getMinimumBalanceForRentExemption(i.length),x=await e.getAccountInfo(n.publicKey,"confirmed"),S=null;if(x!==null){if(x.executable)return console.error("Program load failed, account is already executable"),!1;x.data.length!==i.length&&(S=S||new Se,S.add(Ft.allocate({accountPubkey:n.publicKey,space:i.length}))),x.owner.equals(s)||(S=S||new Se,S.add(Ft.assign({accountPubkey:n.publicKey,programId:s}))),x.lamports<b&&(S=S||new Se,S.add(Ft.transfer({fromPubkey:t.publicKey,toPubkey:n.publicKey,lamports:b-x.lamports})))}else S=new Se().add(Ft.createAccount({fromPubkey:t.publicKey,newAccountPubkey:n.publicKey,lamports:b>0?b:1,space:i.length,programId:s}));S!==null&&await Uh(e,S,[t,n],{commitment:"confirmed"})}let o=R.struct([R.u32("instruction"),R.u32("offset"),R.u32("bytesLength"),R.u32("bytesLengthPadding"),R.seq(R.u8("byte"),R.offset(R.u32(),-8),"bytes")]),c=r.chunkSize,u=0,p=i,m=[];for(;p.length>0;){let b=p.slice(0,c),x=ce.Buffer.alloc(c+16);o.encode({instruction:0,offset:u,bytes:b,bytesLength:0,bytesLengthPadding:0},x);let S=new Se().add({keys:[{pubkey:n.publicKey,isSigner:!0,isWritable:!0}],programId:s,data:x});m.push(Uh(e,S,[t,n],{commitment:"confirmed"})),e._rpcEndpoint.includes("solana.com")&&await Zn(1e3/4),u+=c,p=p.slice(c)}await Promise.all(m);{let b=R.struct([R.u32("instruction")]),x=ce.Buffer.alloc(b.span);b.encode({instruction:1},x);let S=new Se().add({keys:[{pubkey:n.publicKey,isSigner:!0,isWritable:!0},{pubkey:di,isSigner:!1,isWritable:!1}],programId:s,data:x}),T="processed",I=await e.sendTransaction(S,[t,n],{preflightCommitment:T}),{context:A,value:L}=await e.confirmTransaction({signature:I,lastValidBlockHeight:S.lastValidBlockHeight,blockhash:S.recentBlockhash},T);if(L.err)throw new Error(`Transaction ${I} failed (${JSON.stringify(L)})`);for(;;){try{if(await e.getSlot({commitment:T})>A.slot)break}catch{}await new Promise(U=>setTimeout(U,Math.round(np/2)))}}return!0}};Lu.chunkSize=PE;var CI=new ue("BPFLoader2111111111111111111111111111111111");function ME(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Ru,zh;function UE(){if(zh)return Ru;zh=1;var r=Object.prototype.toString,e=Object.keys||function(n){var s=[];for(var i in n)s.push(i);return s};function t(n,s){var i,o,c,u,p,m,b;if(n===!0)return"true";if(n===!1)return"false";switch(typeof n){case"object":if(n===null)return null;if(n.toJSON&&typeof n.toJSON=="function")return t(n.toJSON(),s);if(b=r.call(n),b==="[object Array]"){for(c="[",o=n.length-1,i=0;i<o;i++)c+=t(n[i],!0)+",";return o>-1&&(c+=t(n[i],!0)),c+"]"}else if(b==="[object Object]"){for(u=e(n).sort(),o=u.length,c="",i=0;i<o;)p=u[i],m=t(n[p],!1),m!==void 0&&(c&&(c+=","),c+=JSON.stringify(p)+":"+m),i++;return"{"+c+"}"}else return JSON.stringify(n);case"function":case"undefined":return s?null:void 0;case"string":return JSON.stringify(n);default:return isFinite(n)?n:null}}return Ru=function(n){var s=t(n,!1);if(s!==void 0)return""+s},Ru}var DE=UE(),Fh=ME(DE),ui=32;function vu(r){let e=0;for(;r>1;)r/=2,e++;return e}function zE(r){return r===0?1:(r--,r|=r>>1,r|=r>>2,r|=r>>4,r|=r>>8,r|=r>>16,r|=r>>32,r+1)}var Bu=class{constructor(e,t,n,s,i){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=t,this.warmup=n,this.firstNormalEpoch=s,this.firstNormalSlot=i}getEpoch(e){return this.getEpochAndSlotIndex(e)[0]}getEpochAndSlotIndex(e){if(e<this.firstNormalSlot){let t=vu(zE(e+ui+1))-vu(ui)-1,n=this.getSlotsInEpoch(t),s=e-(n-ui);return[t,s]}else{let t=e-this.firstNormalSlot,n=Math.floor(t/this.slotsPerEpoch),s=this.firstNormalEpoch+n,i=t%this.slotsPerEpoch;return[s,i]}}getFirstSlotInEpoch(e){return e<=this.firstNormalEpoch?(Math.pow(2,e)-1)*ui:(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+vu(ui)):this.slotsPerEpoch}},FE=globalThis.fetch,Cu=class extends wh{constructor(e,t,n){let s=i=>{let o=bh(i,{autoconnect:!0,max_reconnects:5,reconnect:!0,reconnect_interval:1e3,...t});return"socket"in o?this.underlyingSocket=o.socket:this.underlyingSocket=o,o};super(s,e,t,n),this.underlyingSocket=void 0}call(...e){let t=this.underlyingSocket?.readyState;return t===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 "+t+")"))}notify(...e){let t=this.underlyingSocket?.readyState;return t===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 "+t+")"))}};function $E(r,e){let t;try{t=r.layout.decode(e)}catch(n){throw new Error("invalid instruction; "+n)}if(t.typeIndex!==r.index)throw new Error(`invalid account data; account type mismatch ${t.typeIndex} != ${r.index}`);return t}var $h=56,Xo=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 t=$E(VE,e),n=e.length-$h;Ae(n>=0,"lookup table is invalid"),Ae(n%32===0,"lookup table is invalid");let s=n/32,{addresses:i}=R.struct([R.seq(be(),s,"addresses")]).decode(e.slice($h));return{deactivationSlot:t.deactivationSlot,lastExtendedSlot:t.lastExtendedSlot,lastExtendedSlotStartIndex:t.lastExtendedStartIndex,authority:t.authority.length!==0?new ue(t.authority[0]):void 0,addresses:i.map(o=>new ue(o))}}},VE={index:1,layout:R.struct([R.u32("typeIndex"),Ts("deactivationSlot"),R.nu64("lastExtendedSlot"),R.u8("lastExtendedStartIndex"),R.u8(),R.seq(be(),R.offset(R.u8(),-1),"authority")])},WE=/^[^:]+:\/\/([^:[]+|\[[^\]]+\])(:\d+)?(.*)/i;function qE(r){let e=r.match(WE);if(e==null)throw TypeError(`Failed to validate endpoint URL \`${r}\``);let[t,n,s,i]=e,o=r.startsWith("https:")?"wss:":"ws:",c=s==null?null:parseInt(s.slice(1),10),u=c==null?"":`:${c+1}`;return`${o}//${n}${u}${i}`}var qe=Is(Bo(ue),z(),r=>new ue(r)),ip=Co([z(),Me("base64")]),ju=Is(Bo(ce.Buffer),ip,r=>ce.Buffer.from(r[0],"base64")),jE=30*1e3;function KE(r){if(/^https?:/.test(r)===!1)throw new TypeError("Endpoint URL must start with `http:` or `https:`.");return r}function Le(r){let e,t;if(typeof r=="string")e=r;else if(r){let{commitment:n,...s}=r;e=n,t=s}return{commitment:e,config:t}}function Vh(r){return r.map(e=>"memcmp"in e?{...e,memcmp:{...e.memcmp,encoding:e.memcmp.encoding??"base58"}}:e)}function op(r){return Nt([P({jsonrpc:Me("2.0"),id:z(),result:r}),P({jsonrpc:Me("2.0"),id:z(),error:P({code:Hn(),message:z(),data:ne(qd())})})])}var HE=op(Hn());function ye(r){return Is(op(r),HE,e=>"error"in e?e:{...e,result:W(e.result,r)})}function Ze(r){return ye(P({context:P({slot:k()}),value:r}))}function sa(r){return P({context:P({slot:k()}),value:r})}function Su(r,e){return r===0?new Yo({header:e.header,staticAccountKeys:e.accountKeys.map(t=>new ue(t)),recentBlockhash:e.recentBlockhash,compiledInstructions:e.instructions.map(t=>({programIdIndex:t.programIdIndex,accountKeyIndexes:t.accounts,data:Rt.default.decode(t.data)})),addressTableLookups:e.addressTableLookups}):new mn(e)}var GE=P({foundation:k(),foundationTerm:k(),initial:k(),taper:k(),terminal:k()}),ZE=ye(j(K(P({epoch:k(),effectiveSlot:k(),amount:k(),postBalance:k(),commission:ne(K(k()))})))),YE=j(P({slot:k(),prioritizationFee:k()})),JE=P({total:k(),validator:k(),foundation:k(),epoch:k()}),XE=P({epoch:k(),slotIndex:k(),slotsInEpoch:k(),absoluteSlot:k(),blockHeight:ne(k()),transactionCount:ne(k())}),QE=P({slotsPerEpoch:k(),leaderScheduleSlotOffset:k(),warmup:dr(),firstNormalEpoch:k(),firstNormalSlot:k()}),eR=su(z(),j(k())),Xn=K(Nt([P({}),z()])),tR=P({err:Xn}),rR=Me("receivedSignature"),nR=P({"solana-core":z(),"feature-set":ne(k())}),sR=P({program:z(),programId:qe,parsed:Hn()}),iR=P({programId:qe,accounts:j(qe),data:z()}),Wh=Ze(P({err:K(Nt([P({}),z()])),logs:K(j(z())),accounts:ne(K(j(K(P({executable:dr(),owner:z(),lamports:k(),data:j(z()),rentEpoch:ne(k())}))))),unitsConsumed:ne(k()),returnData:ne(K(P({programId:z(),data:Co([z(),Me("base64")])}))),innerInstructions:ne(K(j(P({index:k(),instructions:j(Nt([sR,iR]))}))))})),oR=Ze(P({byIdentity:su(z(),j(k())),range:P({firstSlot:k(),lastSlot:k()})}));function aR(r,e,t,n,s,i){let o=t||FE,c;i!=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 n&&(u=async(m,b)=>{let x=await new Promise((S,T)=>{try{n(m,b,(I,A)=>S([I,A]))}catch(I){T(I)}});return await o(...x)}),new Qh.default(async(m,b)=>{let x={method:"POST",body:m,agent:c,headers:Object.assign({"Content-Type":"application/json"},e||{},av)};try{let S=5,T,I=500;for(;u?T=await u(r,x):T=await o(r,x),!(T.status!==429||s===!0||(S-=1,S===0));)console.error(`Server responded with ${T.status} ${T.statusText}. Retrying after ${I}ms delay...`),await Zn(I),I*=2;let A=await T.text();T.ok?b(null,A):b(new Error(`${T.status} ${T.statusText}: ${A}`))}catch(S){S instanceof Error&&b(S)}},{})}function cR(r){return(e,t)=>new Promise((n,s)=>{r.request(e,t,(i,o)=>{if(i){s(i);return}n(o)})})}function uR(r){return e=>new Promise((t,n)=>{e.length===0&&t([]);let s=e.map(i=>r.request(i.methodName,i.args));r.request(s,(i,o)=>{if(i){n(i);return}t(o)})})}var fR=ye(GE),lR=ye(JE),dR=ye(YE),hR=ye(XE),pR=ye(QE),mR=ye(eR),gR=ye(k()),yR=Ze(P({total:k(),circulating:k(),nonCirculating:k(),nonCirculatingAccounts:j(qe)})),Pu=P({amount:z(),uiAmount:K(k()),decimals:k(),uiAmountString:ne(z())}),_R=Ze(j(P({address:qe,amount:z(),uiAmount:K(k()),decimals:k(),uiAmountString:ne(z())}))),bR=Ze(j(P({pubkey:qe,account:P({executable:dr(),owner:qe,lamports:k(),data:ju,rentEpoch:k()})}))),Mu=P({program:z(),parsed:Hn(),space:k()}),wR=Ze(j(P({pubkey:qe,account:P({executable:dr(),owner:qe,lamports:k(),data:Mu,rentEpoch:k()})}))),ER=Ze(j(P({lamports:k(),address:qe}))),pi=P({executable:dr(),owner:qe,lamports:k(),data:ju,rentEpoch:k()}),RR=P({pubkey:qe,account:pi}),vR=Is(Nt([Bo(ce.Buffer),Mu]),Nt([ip,Mu]),r=>Array.isArray(r)?W(r,ju):r),Uu=P({executable:dr(),owner:qe,lamports:k(),data:vR,rentEpoch:k()}),SR=P({pubkey:qe,account:Uu}),xR=P({state:Nt([Me("active"),Me("inactive"),Me("activating"),Me("deactivating")]),active:k(),inactive:k()}),AR=ye(j(P({signature:z(),slot:k(),err:Xn,memo:K(z()),blockTime:ne(K(k()))}))),IR=ye(j(P({signature:z(),slot:k(),err:Xn,memo:K(z()),blockTime:ne(K(k()))}))),kR=P({subscription:k(),result:sa(pi)}),OR=P({pubkey:qe,account:pi}),TR=P({subscription:k(),result:sa(OR)}),NR=P({parent:k(),slot:k(),root:k()}),LR=P({subscription:k(),result:NR}),BR=Nt([P({type:Nt([Me("firstShredReceived"),Me("completed"),Me("optimisticConfirmation"),Me("root")]),slot:k(),timestamp:k()}),P({type:Me("createdBank"),parent:k(),slot:k(),timestamp:k()}),P({type:Me("frozen"),slot:k(),timestamp:k(),stats:P({numTransactionEntries:k(),numSuccessfulTransactions:k(),numFailedTransactions:k(),maxTransactionsPerEntry:k()})}),P({type:Me("dead"),slot:k(),timestamp:k(),err:z()})]),CR=P({subscription:k(),result:BR}),PR=P({subscription:k(),result:sa(Nt([tR,rR]))}),MR=P({subscription:k(),result:k()}),UR=P({pubkey:z(),gossip:K(z()),tpu:K(z()),rpc:K(z()),version:K(z())}),qh=P({votePubkey:z(),nodePubkey:z(),activatedStake:k(),epochVoteAccount:dr(),epochCredits:j(Co([k(),k(),k()])),commission:k(),lastVote:k(),rootSlot:K(k())}),DR=ye(P({current:j(qh),delinquent:j(qh)})),zR=Nt([Me("processed"),Me("confirmed"),Me("finalized")]),FR=P({slot:k(),confirmations:K(k()),err:Xn,confirmationStatus:ne(zR)}),$R=Ze(j(K(FR))),VR=ye(k()),ap=P({accountKey:qe,writableIndexes:j(k()),readonlyIndexes:j(k())}),Ku=P({signatures:j(z()),message:P({accountKeys:j(z()),header:P({numRequiredSignatures:k(),numReadonlySignedAccounts:k(),numReadonlyUnsignedAccounts:k()}),instructions:j(P({accounts:j(k()),data:z(),programIdIndex:k()})),recentBlockhash:z(),addressTableLookups:ne(j(ap))})}),cp=P({pubkey:qe,signer:dr(),writable:dr(),source:ne(Nt([Me("transaction"),Me("lookupTable")]))}),up=P({accountKeys:j(cp),signatures:j(z())}),fp=P({parsed:Hn(),program:z(),programId:qe}),lp=P({accounts:j(qe),data:z(),programId:qe}),WR=Nt([lp,fp]),qR=Nt([P({parsed:Hn(),program:z(),programId:z()}),P({accounts:j(z()),data:z(),programId:z()})]),dp=Is(WR,qR,r=>"accounts"in r?W(r,lp):W(r,fp)),hp=P({signatures:j(z()),message:P({accountKeys:j(cp),instructions:j(dp),recentBlockhash:z(),addressTableLookups:ne(K(j(ap)))})}),Qo=P({accountIndex:k(),mint:z(),owner:ne(z()),programId:ne(z()),uiTokenAmount:Pu}),pp=P({writable:j(qe),readonly:j(qe)}),ia=P({err:Xn,fee:k(),innerInstructions:ne(K(j(P({index:k(),instructions:j(P({accounts:j(k()),data:z(),programIdIndex:k()}))})))),preBalances:j(k()),postBalances:j(k()),logMessages:ne(K(j(z()))),preTokenBalances:ne(K(j(Qo))),postTokenBalances:ne(K(j(Qo))),loadedAddresses:ne(pp),computeUnitsConsumed:ne(k())}),Hu=P({err:Xn,fee:k(),innerInstructions:ne(K(j(P({index:k(),instructions:j(dp)})))),preBalances:j(k()),postBalances:j(k()),logMessages:ne(K(j(z()))),preTokenBalances:ne(K(j(Qo))),postTokenBalances:ne(K(j(Qo))),loadedAddresses:ne(pp),computeUnitsConsumed:ne(k())}),Ls=Nt([Me(0),Me("legacy")]),Qn=P({pubkey:z(),lamports:k(),postBalance:K(k()),rewardType:K(z()),commission:ne(K(k()))}),jR=ye(K(P({blockhash:z(),previousBlockhash:z(),parentSlot:k(),transactions:j(P({transaction:Ku,meta:K(ia),version:ne(Ls)})),rewards:ne(j(Qn)),blockTime:K(k()),blockHeight:K(k())}))),KR=ye(K(P({blockhash:z(),previousBlockhash:z(),parentSlot:k(),rewards:ne(j(Qn)),blockTime:K(k()),blockHeight:K(k())}))),HR=ye(K(P({blockhash:z(),previousBlockhash:z(),parentSlot:k(),transactions:j(P({transaction:up,meta:K(ia),version:ne(Ls)})),rewards:ne(j(Qn)),blockTime:K(k()),blockHeight:K(k())}))),GR=ye(K(P({blockhash:z(),previousBlockhash:z(),parentSlot:k(),transactions:j(P({transaction:hp,meta:K(Hu),version:ne(Ls)})),rewards:ne(j(Qn)),blockTime:K(k()),blockHeight:K(k())}))),ZR=ye(K(P({blockhash:z(),previousBlockhash:z(),parentSlot:k(),transactions:j(P({transaction:up,meta:K(Hu),version:ne(Ls)})),rewards:ne(j(Qn)),blockTime:K(k()),blockHeight:K(k())}))),YR=ye(K(P({blockhash:z(),previousBlockhash:z(),parentSlot:k(),rewards:ne(j(Qn)),blockTime:K(k()),blockHeight:K(k())}))),JR=ye(K(P({blockhash:z(),previousBlockhash:z(),parentSlot:k(),transactions:j(P({transaction:Ku,meta:K(ia)})),rewards:ne(j(Qn)),blockTime:K(k())}))),jh=ye(K(P({blockhash:z(),previousBlockhash:z(),parentSlot:k(),signatures:j(z()),blockTime:K(k())}))),xu=ye(K(P({slot:k(),meta:K(ia),blockTime:ne(K(k())),transaction:Ku,version:ne(Ls)}))),Wo=ye(K(P({slot:k(),transaction:hp,meta:K(Hu),blockTime:ne(K(k())),version:ne(Ls)}))),XR=Ze(P({blockhash:z(),lastValidBlockHeight:k()})),QR=Ze(dr()),ev=P({slot:k(),numTransactions:k(),numSlots:k(),samplePeriodSecs:k()}),tv=ye(j(ev)),rv=Ze(K(P({feeCalculator:P({lamportsPerSignature:k()})}))),nv=ye(z()),sv=ye(z()),iv=P({err:Xn,logs:j(z()),signature:z()}),ov=P({result:sa(iv),subscription:k()}),av={"solana-client":"js/1.0.0-maintenance"},ea=class{constructor(e,t){this._commitment=void 0,this._confirmTransactionInitialTimeout=void 0,this._rpcEndpoint=void 0,this._rpcWsEndpoint=void 0,this._rpcClient=void 0,this._rpcRequest=void 0,this._rpcBatchRequest=void 0,this._rpcWebSocket=void 0,this._rpcWebSocketConnected=!1,this._rpcWebSocketHeartbeat=null,this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketGeneration=0,this._disableBlockhashCaching=!1,this._pollingBlockhash=!1,this._blockhashInfo={latestBlockhash:null,lastFetch:0,transactionSignatures:[],simulatedSignatures:[]},this._nextClientSubscriptionId=0,this._subscriptionDisposeFunctionsByClientSubscriptionId={},this._subscriptionHashByClientSubscriptionId={},this._subscriptionStateChangeCallbacksByHash={},this._subscriptionCallbacksByServerSubscriptionId={},this._subscriptionsByHash={},this._subscriptionsAutoDisposedByRpc=new Set,this.getBlockHeight=(()=>{let p={};return async m=>{let{commitment:b,config:x}=Le(m),S=this._buildArgs([],b,void 0,x),T=Fh(S);return p[T]=p[T]??(async()=>{try{let I=await this._rpcRequest("getBlockHeight",S),A=W(I,ye(k()));if("error"in A)throw new Q(A.error,"failed to get block height information");return A.result}finally{delete p[T]}})(),await p[T]}})();let n,s,i,o,c,u;t&&typeof t=="string"?this._commitment=t:t&&(this._commitment=t.commitment,this._confirmTransactionInitialTimeout=t.confirmTransactionInitialTimeout,n=t.wsEndpoint,s=t.httpHeaders,i=t.fetch,o=t.fetchMiddleware,c=t.disableRetryOnRateLimit,u=t.httpAgent),this._rpcEndpoint=KE(e),this._rpcWsEndpoint=n||qE(e),this._rpcClient=aR(e,s,i,o,c,u),this._rpcRequest=cR(this._rpcClient),this._rpcBatchRequest=uR(this._rpcClient),this._rpcWebSocket=new Cu(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,t){let{commitment:n,config:s}=Le(t),i=this._buildArgs([e.toBase58()],n,void 0,s),o=await this._rpcRequest("getBalance",i),c=W(o,Ze(k()));if("error"in c)throw new Q(c.error,`failed to get balance for ${e.toBase58()}`);return c.result}async getBalance(e,t){return await this.getBalanceAndContext(e,t).then(n=>n.value).catch(n=>{throw new Error("failed to get balance of account "+e.toBase58()+": "+n)})}async getBlockTime(e){let t=await this._rpcRequest("getBlockTime",[e]),n=W(t,ye(K(k())));if("error"in n)throw new Q(n.error,`failed to get block time for slot ${e}`);return n.result}async getMinimumLedgerSlot(){let e=await this._rpcRequest("minimumLedgerSlot",[]),t=W(e,ye(k()));if("error"in t)throw new Q(t.error,"failed to get minimum ledger slot");return t.result}async getFirstAvailableBlock(){let e=await this._rpcRequest("getFirstAvailableBlock",[]),t=W(e,gR);if("error"in t)throw new Q(t.error,"failed to get first available block");return t.result}async getSupply(e){let t={};typeof e=="string"?t={commitment:e}:e?t={...e,commitment:e&&e.commitment||this.commitment}:t={commitment:this.commitment};let n=await this._rpcRequest("getSupply",[t]),s=W(n,yR);if("error"in s)throw new Q(s.error,"failed to get supply");return s.result}async getTokenSupply(e,t){let n=this._buildArgs([e.toBase58()],t),s=await this._rpcRequest("getTokenSupply",n),i=W(s,Ze(Pu));if("error"in i)throw new Q(i.error,"failed to get token supply");return i.result}async getTokenAccountBalance(e,t){let n=this._buildArgs([e.toBase58()],t),s=await this._rpcRequest("getTokenAccountBalance",n),i=W(s,Ze(Pu));if("error"in i)throw new Q(i.error,"failed to get token account balance");return i.result}async getTokenAccountsByOwner(e,t,n){let{commitment:s,config:i}=Le(n),o=[e.toBase58()];"mint"in t?o.push({mint:t.mint.toBase58()}):o.push({programId:t.programId.toBase58()});let c=this._buildArgs(o,s,"base64",i),u=await this._rpcRequest("getTokenAccountsByOwner",c),p=W(u,bR);if("error"in p)throw new Q(p.error,`failed to get token accounts owned by account ${e.toBase58()}`);return p.result}async getParsedTokenAccountsByOwner(e,t,n){let s=[e.toBase58()];"mint"in t?s.push({mint:t.mint.toBase58()}):s.push({programId:t.programId.toBase58()});let i=this._buildArgs(s,n,"jsonParsed"),o=await this._rpcRequest("getTokenAccountsByOwner",i),c=W(o,wR);if("error"in c)throw new Q(c.error,`failed to get token accounts owned by account ${e.toBase58()}`);return c.result}async getLargestAccounts(e){let t={...e,commitment:e&&e.commitment||this.commitment},n=t.filter||t.commitment?[t]:[],s=await this._rpcRequest("getLargestAccounts",n),i=W(s,ER);if("error"in i)throw new Q(i.error,"failed to get largest accounts");return i.result}async getTokenLargestAccounts(e,t){let n=this._buildArgs([e.toBase58()],t),s=await this._rpcRequest("getTokenLargestAccounts",n),i=W(s,_R);if("error"in i)throw new Q(i.error,"failed to get token largest accounts");return i.result}async getAccountInfoAndContext(e,t){let{commitment:n,config:s}=Le(t),i=this._buildArgs([e.toBase58()],n,"base64",s),o=await this._rpcRequest("getAccountInfo",i),c=W(o,Ze(K(pi)));if("error"in c)throw new Q(c.error,`failed to get info about account ${e.toBase58()}`);return c.result}async getParsedAccountInfo(e,t){let{commitment:n,config:s}=Le(t),i=this._buildArgs([e.toBase58()],n,"jsonParsed",s),o=await this._rpcRequest("getAccountInfo",i),c=W(o,Ze(K(Uu)));if("error"in c)throw new Q(c.error,`failed to get info about account ${e.toBase58()}`);return c.result}async getAccountInfo(e,t){try{return(await this.getAccountInfoAndContext(e,t)).value}catch(n){throw new Error("failed to get info about account "+e.toBase58()+": "+n)}}async getMultipleParsedAccounts(e,t){let{commitment:n,config:s}=Le(t),i=e.map(p=>p.toBase58()),o=this._buildArgs([i],n,"jsonParsed",s),c=await this._rpcRequest("getMultipleAccounts",o),u=W(c,Ze(j(K(Uu))));if("error"in u)throw new Q(u.error,`failed to get info for accounts ${i}`);return u.result}async getMultipleAccountsInfoAndContext(e,t){let{commitment:n,config:s}=Le(t),i=e.map(p=>p.toBase58()),o=this._buildArgs([i],n,"base64",s),c=await this._rpcRequest("getMultipleAccounts",o),u=W(c,Ze(j(K(pi))));if("error"in u)throw new Q(u.error,`failed to get info for accounts ${i}`);return u.result}async getMultipleAccountsInfo(e,t){return(await this.getMultipleAccountsInfoAndContext(e,t)).value}async getStakeActivation(e,t,n){let{commitment:s,config:i}=Le(t),o=this._buildArgs([e.toBase58()],s,void 0,{...i,epoch:n??i?.epoch}),c=await this._rpcRequest("getStakeActivation",o),u=W(c,ye(xR));if("error"in u)throw new Q(u.error,`failed to get Stake Activation ${e.toBase58()}`);return u.result}async getProgramAccounts(e,t){let{commitment:n,config:s}=Le(t),{encoding:i,...o}=s||{},c=this._buildArgs([e.toBase58()],n,i||"base64",{...o,...o.filters?{filters:Vh(o.filters)}:null}),u=await this._rpcRequest("getProgramAccounts",c),p=j(RR),m=o.withContext===!0?W(u,Ze(p)):W(u,ye(p));if("error"in m)throw new Q(m.error,`failed to get accounts owned by program ${e.toBase58()}`);return m.result}async getParsedProgramAccounts(e,t){let{commitment:n,config:s}=Le(t),i=this._buildArgs([e.toBase58()],n,"jsonParsed",s),o=await this._rpcRequest("getProgramAccounts",i),c=W(o,ye(j(SR)));if("error"in c)throw new Q(c.error,`failed to get accounts owned by program ${e.toBase58()}`);return c.result}async confirmTransaction(e,t){let n;if(typeof e=="string")n=e;else{let i=e;if(i.abortSignal?.aborted)return Promise.reject(i.abortSignal.reason);n=i.signature}let s;try{s=Rt.default.decode(n)}catch{throw new Error("signature must be base58 encoded: "+n)}return Ae(s.length===64,"signature has invalid length"),typeof e=="string"?await this.confirmTransactionUsingLegacyTimeoutStrategy({commitment:t||this.commitment,signature:n}):"lastValidBlockHeight"in e?await this.confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:t||this.commitment,strategy:e}):await this.confirmTransactionUsingDurableNonceStrategy({commitment:t||this.commitment,strategy:e})}getCancellationPromise(e){return new Promise((t,n)=>{e!=null&&(e.aborted?n(e.reason):e.addEventListener("abort",()=>{n(e.reason)}))})}getTransactionConfirmationPromise({commitment:e,signature:t}){let n,s,i=!1,o=new Promise((u,p)=>{try{n=this.onSignature(t,(b,x)=>{n=void 0;let S={context:x,value:b};u({__type:dn.PROCESSED,response:S})},e);let m=new Promise(b=>{n==null?b():s=this._onSubscriptionStateChange(n,x=>{x==="subscribed"&&b()})});(async()=>{if(await m,i)return;let b=await this.getSignatureStatus(t);if(i||b==null)return;let{context:x,value:S}=b;if(S!=null)if(S?.err)p(S.err);else{switch(e){case"confirmed":case"single":case"singleGossip":{if(S.confirmationStatus==="processed")return;break}case"finalized":case"max":case"root":{if(S.confirmationStatus==="processed"||S.confirmationStatus==="confirmed")return;break}case"processed":case"recent":}i=!0,u({__type:dn.PROCESSED,response:{context:x,value:S}})}})()}catch(m){p(m)}});return{abortConfirmation:()=>{s&&(s(),s=void 0),n!=null&&(this.removeSignatureListener(n),n=void 0)},confirmationPromise:o}}async confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:e,strategy:{abortSignal:t,lastValidBlockHeight:n,signature:s}}){let i=!1,o=new Promise(b=>{let x=async()=>{try{return await this.getBlockHeight(e)}catch{return-1}};(async()=>{let S=await x();if(!i){for(;S<=n;)if(await Zn(1e3),i||(S=await x(),i))return;b({__type:dn.BLOCKHEIGHT_EXCEEDED})}})()}),{abortConfirmation:c,confirmationPromise:u}=this.getTransactionConfirmationPromise({commitment:e,signature:s}),p=this.getCancellationPromise(t),m;try{let b=await Promise.race([p,u,o]);if(b.__type===dn.PROCESSED)m=b.response;else throw new Ho(s)}finally{i=!0,c()}return m}async confirmTransactionUsingDurableNonceStrategy({commitment:e,strategy:{abortSignal:t,minContextSlot:n,nonceAccountPubkey:s,nonceValue:i,signature:o}}){let c=!1,u=new Promise(S=>{let T=i,I=null,A=async()=>{try{let{context:L,value:U}=await this.getNonceAndContext(s,{commitment:e,minContextSlot:n});return I=L.slot,U?.nonce}catch{return T}};(async()=>{if(T=await A(),!c)for(;;){if(i!==T){S({__type:dn.NONCE_INVALID,slotInWhichNonceDidAdvance:I});return}if(await Zn(2e3),c||(T=await A(),c))return}})()}),{abortConfirmation:p,confirmationPromise:m}=this.getTransactionConfirmationPromise({commitment:e,signature:o}),b=this.getCancellationPromise(t),x;try{let S=await Promise.race([b,m,u]);if(S.__type===dn.PROCESSED)x=S.response;else{let T;for(;;){let I=await this.getSignatureStatus(o);if(I==null)break;if(I.context.slot<(S.slotInWhichNonceDidAdvance??n)){await Zn(400);continue}T=I;break}if(T?.value){let I=e||"finalized",{confirmationStatus:A}=T.value;switch(I){case"processed":case"recent":if(A!=="processed"&&A!=="confirmed"&&A!=="finalized")throw new Yn(o);break;case"confirmed":case"single":case"singleGossip":if(A!=="confirmed"&&A!=="finalized")throw new Yn(o);break;case"finalized":case"max":case"root":if(A!=="finalized")throw new Yn(o);break;default:}x={context:T.context,value:{err:T.value.err}}}else throw new Yn(o)}}finally{c=!0,p()}return x}async confirmTransactionUsingLegacyTimeoutStrategy({commitment:e,signature:t}){let n,s=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}}n=setTimeout(()=>u({__type:dn.TIMED_OUT,timeoutMs:p}),p)}),{abortConfirmation:i,confirmationPromise:o}=this.getTransactionConfirmationPromise({commitment:e,signature:t}),c;try{let u=await Promise.race([o,s]);if(u.__type===dn.PROCESSED)c=u.response;else throw new Go(t,u.timeoutMs/1e3)}finally{clearTimeout(n),i()}return c}async getClusterNodes(){let e=await this._rpcRequest("getClusterNodes",[]),t=W(e,ye(j(UR)));if("error"in t)throw new Q(t.error,"failed to get cluster nodes");return t.result}async getVoteAccounts(e){let t=this._buildArgs([],e),n=await this._rpcRequest("getVoteAccounts",t),s=W(n,DR);if("error"in s)throw new Q(s.error,"failed to get vote accounts");return s.result}async getSlot(e){let{commitment:t,config:n}=Le(e),s=this._buildArgs([],t,void 0,n),i=await this._rpcRequest("getSlot",s),o=W(i,ye(k()));if("error"in o)throw new Q(o.error,"failed to get slot");return o.result}async getSlotLeader(e){let{commitment:t,config:n}=Le(e),s=this._buildArgs([],t,void 0,n),i=await this._rpcRequest("getSlotLeader",s),o=W(i,ye(z()));if("error"in o)throw new Q(o.error,"failed to get slot leader");return o.result}async getSlotLeaders(e,t){let n=[e,t],s=await this._rpcRequest("getSlotLeaders",n),i=W(s,ye(j(qe)));if("error"in i)throw new Q(i.error,"failed to get slot leaders");return i.result}async getSignatureStatus(e,t){let{context:n,value:s}=await this.getSignatureStatuses([e],t);Ae(s.length===1);let i=s[0];return{context:n,value:i}}async getSignatureStatuses(e,t){let n=[e];t&&n.push(t);let s=await this._rpcRequest("getSignatureStatuses",n),i=W(s,$R);if("error"in i)throw new Q(i.error,"failed to get signature status");return i.result}async getTransactionCount(e){let{commitment:t,config:n}=Le(e),s=this._buildArgs([],t,void 0,n),i=await this._rpcRequest("getTransactionCount",s),o=W(i,ye(k()));if("error"in o)throw new Q(o.error,"failed to get transaction count");return o.result}async getTotalSupply(e){return(await this.getSupply({commitment:e,excludeNonCirculatingAccountsList:!0})).value.total}async getInflationGovernor(e){let t=this._buildArgs([],e),n=await this._rpcRequest("getInflationGovernor",t),s=W(n,fR);if("error"in s)throw new Q(s.error,"failed to get inflation");return s.result}async getInflationReward(e,t,n){let{commitment:s,config:i}=Le(n),o=this._buildArgs([e.map(p=>p.toBase58())],s,void 0,{...i,epoch:t??i?.epoch}),c=await this._rpcRequest("getInflationReward",o),u=W(c,ZE);if("error"in u)throw new Q(u.error,"failed to get inflation reward");return u.result}async getInflationRate(){let e=await this._rpcRequest("getInflationRate",[]),t=W(e,lR);if("error"in t)throw new Q(t.error,"failed to get inflation rate");return t.result}async getEpochInfo(e){let{commitment:t,config:n}=Le(e),s=this._buildArgs([],t,void 0,n),i=await this._rpcRequest("getEpochInfo",s),o=W(i,hR);if("error"in o)throw new Q(o.error,"failed to get epoch info");return o.result}async getEpochSchedule(){let e=await this._rpcRequest("getEpochSchedule",[]),t=W(e,pR);if("error"in t)throw new Q(t.error,"failed to get epoch schedule");let n=t.result;return new Bu(n.slotsPerEpoch,n.leaderScheduleSlotOffset,n.warmup,n.firstNormalEpoch,n.firstNormalSlot)}async getLeaderSchedule(){let e=await this._rpcRequest("getLeaderSchedule",[]),t=W(e,mR);if("error"in t)throw new Q(t.error,"failed to get leader schedule");return t.result}async getMinimumBalanceForRentExemption(e,t){let n=this._buildArgs([e],t),s=await this._rpcRequest("getMinimumBalanceForRentExemption",n),i=W(s,VR);return"error"in i?(console.warn("Unable to fetch minimum balance for rent exemption"),0):i.result}async getRecentBlockhashAndContext(e){let{context:t,value:{blockhash:n}}=await this.getLatestBlockhashAndContext(e);return{context:t,value:{blockhash:n,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 t=await this._rpcRequest("getRecentPerformanceSamples",e?[e]:[]),n=W(t,tv);if("error"in n)throw new Q(n.error,"failed to get recent performance samples");return n.result}async getFeeCalculatorForBlockhash(e,t){let n=this._buildArgs([e],t),s=await this._rpcRequest("getFeeCalculatorForBlockhash",n),i=W(s,rv);if("error"in i)throw new Q(i.error,"failed to get fee calculator");let{context:o,value:c}=i.result;return{context:o,value:c!==null?c.feeCalculator:null}}async getFeeForMessage(e,t){let n=we(e.serialize()).toString("base64"),s=this._buildArgs([n],t),i=await this._rpcRequest("getFeeForMessage",s),o=W(i,Ze(K(k())));if("error"in o)throw new Q(o.error,"failed to get fee for message");if(o.result===null)throw new Error("invalid blockhash");return o.result}async getRecentPrioritizationFees(e){let t=e?.lockedWritableAccounts?.map(o=>o.toBase58()),n=t?.length?[t]:[],s=await this._rpcRequest("getRecentPrioritizationFees",n),i=W(s,dR);if("error"in i)throw new Q(i.error,"failed to get recent prioritization fees");return i.result}async getRecentBlockhash(e){try{return(await this.getRecentBlockhashAndContext(e)).value}catch(t){throw new Error("failed to get recent blockhash: "+t)}}async getLatestBlockhash(e){try{return(await this.getLatestBlockhashAndContext(e)).value}catch(t){throw new Error("failed to get recent blockhash: "+t)}}async getLatestBlockhashAndContext(e){let{commitment:t,config:n}=Le(e),s=this._buildArgs([],t,void 0,n),i=await this._rpcRequest("getLatestBlockhash",s),o=W(i,XR);if("error"in o)throw new Q(o.error,"failed to get latest blockhash");return o.result}async isBlockhashValid(e,t){let{commitment:n,config:s}=Le(t),i=this._buildArgs([e],n,void 0,s),o=await this._rpcRequest("isBlockhashValid",i),c=W(o,QR);if("error"in c)throw new Q(c.error,"failed to determine if the blockhash `"+e+"`is valid");return c.result}async getVersion(){let e=await this._rpcRequest("getVersion",[]),t=W(e,ye(nR));if("error"in t)throw new Q(t.error,"failed to get version");return t.result}async getGenesisHash(){let e=await this._rpcRequest("getGenesisHash",[]),t=W(e,ye(z()));if("error"in t)throw new Q(t.error,"failed to get genesis hash");return t.result}async getBlock(e,t){let{commitment:n,config:s}=Le(t),i=this._buildArgsAtLeastConfirmed([e],n,void 0,s),o=await this._rpcRequest("getBlock",i);try{switch(s?.transactionDetails){case"accounts":{let c=W(o,HR);if("error"in c)throw c.error;return c.result}case"none":{let c=W(o,KR);if("error"in c)throw c.error;return c.result}default:{let c=W(o,jR);if("error"in c)throw c.error;let{result:u}=c;return u?{...u,transactions:u.transactions.map(({transaction:p,meta:m,version:b})=>({meta:m,transaction:{...p,message:Su(b,p.message)},version:b}))}:null}}}catch(c){throw new Q(c,"failed to get confirmed block")}}async getParsedBlock(e,t){let{commitment:n,config:s}=Le(t),i=this._buildArgsAtLeastConfirmed([e],n,"jsonParsed",s),o=await this._rpcRequest("getBlock",i);try{switch(s?.transactionDetails){case"accounts":{let c=W(o,ZR);if("error"in c)throw c.error;return c.result}case"none":{let c=W(o,YR);if("error"in c)throw c.error;return c.result}default:{let c=W(o,GR);if("error"in c)throw c.error;return c.result}}}catch(c){throw new Q(c,"failed to get block")}}async getBlockProduction(e){let t,n;if(typeof e=="string")n=e;else if(e){let{commitment:c,...u}=e;n=c,t=u}let s=this._buildArgs([],n,"base64",t),i=await this._rpcRequest("getBlockProduction",s),o=W(i,oR);if("error"in o)throw new Q(o.error,"failed to get block production information");return o.result}async getTransaction(e,t){let{commitment:n,config:s}=Le(t),i=this._buildArgsAtLeastConfirmed([e],n,void 0,s),o=await this._rpcRequest("getTransaction",i),c=W(o,xu);if("error"in c)throw new Q(c.error,"failed to get transaction");let u=c.result;return u&&{...u,transaction:{...u.transaction,message:Su(u.version,u.transaction.message)}}}async getParsedTransaction(e,t){let{commitment:n,config:s}=Le(t),i=this._buildArgsAtLeastConfirmed([e],n,"jsonParsed",s),o=await this._rpcRequest("getTransaction",i),c=W(o,Wo);if("error"in c)throw new Q(c.error,"failed to get transaction");return c.result}async getParsedTransactions(e,t){let{commitment:n,config:s}=Le(t),i=e.map(u=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([u],n,"jsonParsed",s)}));return(await this._rpcBatchRequest(i)).map(u=>{let p=W(u,Wo);if("error"in p)throw new Q(p.error,"failed to get transactions");return p.result})}async getTransactions(e,t){let{commitment:n,config:s}=Le(t),i=e.map(u=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([u],n,void 0,s)}));return(await this._rpcBatchRequest(i)).map(u=>{let p=W(u,xu);if("error"in p)throw new Q(p.error,"failed to get transactions");let m=p.result;return m&&{...m,transaction:{...m.transaction,message:Su(m.version,m.transaction.message)}}})}async getConfirmedBlock(e,t){let n=this._buildArgsAtLeastConfirmed([e],t),s=await this._rpcRequest("getBlock",n),i=W(s,JR);if("error"in i)throw new Q(i.error,"failed to get confirmed block");let o=i.result;if(!o)throw new Error("Confirmed block "+e+" not found");let c={...o,transactions:o.transactions.map(({transaction:u,meta:p})=>{let m=new mn(u.message);return{meta:p,transaction:{...u,message:m}}})};return{...c,transactions:c.transactions.map(({transaction:u,meta:p})=>({meta:p,transaction:Se.populate(u.message,u.signatures)}))}}async getBlocks(e,t,n){let s=this._buildArgsAtLeastConfirmed(t!==void 0?[e,t]:[e],n),i=await this._rpcRequest("getBlocks",s),o=W(i,ye(j(k())));if("error"in o)throw new Q(o.error,"failed to get blocks");return o.result}async getBlockSignatures(e,t){let n=this._buildArgsAtLeastConfirmed([e],t,void 0,{transactionDetails:"signatures",rewards:!1}),s=await this._rpcRequest("getBlock",n),i=W(s,jh);if("error"in i)throw new Q(i.error,"failed to get block");let o=i.result;if(!o)throw new Error("Block "+e+" not found");return o}async getConfirmedBlockSignatures(e,t){let n=this._buildArgsAtLeastConfirmed([e],t,void 0,{transactionDetails:"signatures",rewards:!1}),s=await this._rpcRequest("getBlock",n),i=W(s,jh);if("error"in i)throw new Q(i.error,"failed to get confirmed block");let o=i.result;if(!o)throw new Error("Confirmed block "+e+" not found");return o}async getConfirmedTransaction(e,t){let n=this._buildArgsAtLeastConfirmed([e],t),s=await this._rpcRequest("getTransaction",n),i=W(s,xu);if("error"in i)throw new Q(i.error,"failed to get transaction");let o=i.result;if(!o)return o;let c=new mn(o.transaction.message),u=o.transaction.signatures;return{...o,transaction:Se.populate(c,u)}}async getParsedConfirmedTransaction(e,t){let n=this._buildArgsAtLeastConfirmed([e],t,"jsonParsed"),s=await this._rpcRequest("getTransaction",n),i=W(s,Wo);if("error"in i)throw new Q(i.error,"failed to get confirmed transaction");return i.result}async getParsedConfirmedTransactions(e,t){let n=e.map(o=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([o],t,"jsonParsed")}));return(await this._rpcBatchRequest(n)).map(o=>{let c=W(o,Wo);if("error"in c)throw new Q(c.error,"failed to get confirmed transactions");return c.result})}async getConfirmedSignaturesForAddress(e,t,n){let s={},i=await this.getFirstAvailableBlock();for(;!("until"in s)&&(t--,!(t<=0||t<i));)try{let u=await this.getConfirmedBlockSignatures(t,"finalized");u.signatures.length>0&&(s.until=u.signatures[u.signatures.length-1].toString())}catch(u){if(u instanceof Error&&u.message.includes("skipped"))continue;throw u}let o=await this.getSlot("finalized");for(;!("before"in s)&&(n++,!(n>o));)try{let u=await this.getConfirmedBlockSignatures(n);u.signatures.length>0&&(s.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,s)).map(u=>u.signature)}async getConfirmedSignaturesForAddress2(e,t,n){let s=this._buildArgsAtLeastConfirmed([e.toBase58()],n,void 0,t),i=await this._rpcRequest("getConfirmedSignaturesForAddress2",s),o=W(i,AR);if("error"in o)throw new Q(o.error,"failed to get confirmed signatures for address");return o.result}async getSignaturesForAddress(e,t,n){let s=this._buildArgsAtLeastConfirmed([e.toBase58()],n,void 0,t),i=await this._rpcRequest("getSignaturesForAddress",s),o=W(i,IR);if("error"in o)throw new Q(o.error,"failed to get signatures for address");return o.result}async getAddressLookupTable(e,t){let{context:n,value:s}=await this.getAccountInfoAndContext(e,t),i=null;return s!==null&&(i=new Xo({key:e,state:Xo.deserialize(s.data)})),{context:n,value:i}}async getNonceAndContext(e,t){let{context:n,value:s}=await this.getAccountInfoAndContext(e,t),i=null;return s!==null&&(i=Nu.fromAccountData(s.data)),{context:n,value:i}}async getNonce(e,t){return await this.getNonceAndContext(e,t).then(n=>n.value).catch(n=>{throw new Error("failed to get nonce for account "+e.toBase58()+": "+n)})}async requestAirdrop(e,t){let n=await this._rpcRequest("requestAirdrop",[e.toBase58(),t]),s=W(n,nv);if("error"in s)throw new Q(s.error,`airdrop to ${e.toBase58()} failed`);return s.result}async _blockhashWithExpiryBlockHeight(e){if(!e){for(;this._pollingBlockhash;)await Zn(100);let n=Date.now()-this._blockhashInfo.lastFetch>=jE;if(this._blockhashInfo.latestBlockhash!==null&&!n)return this._blockhashInfo.latestBlockhash}return await this._pollNewBlockhash()}async _pollNewBlockhash(){this._pollingBlockhash=!0;try{let e=Date.now(),t=this._blockhashInfo.latestBlockhash,n=t?t.blockhash:null;for(let s=0;s<50;s++){let i=await this.getLatestBlockhash("finalized");if(n!==i.blockhash)return this._blockhashInfo={latestBlockhash:i,lastFetch:Date.now(),transactionSignatures:[],simulatedSignatures:[]},i;await Zn(np/2)}throw new Error(`Unable to obtain a new blockhash after ${Date.now()-e}ms`)}finally{this._pollingBlockhash=!1}}async getStakeMinimumDelegation(e){let{commitment:t,config:n}=Le(e),s=this._buildArgs([],t,"base64",n),i=await this._rpcRequest("getStakeMinimumDelegation",s),o=W(i,Ze(k()));if("error"in o)throw new Q(o.error,"failed to get stake minimum delegation");return o.result}async simulateTransaction(e,t,n){if("message"in e){let I=e.serialize(),A=ce.Buffer.from(I).toString("base64");if(Array.isArray(t)||n!==void 0)throw new Error("Invalid arguments");let L=t||{};L.encoding="base64","commitment"in L||(L.commitment=this.commitment),t&&typeof t=="object"&&"innerInstructions"in t&&(L.innerInstructions=t.innerInstructions);let U=[A,L],B=await this._rpcRequest("simulateTransaction",U),F=W(B,Wh);if("error"in F)throw new Error("failed to simulate transaction: "+F.error.message);return F.result}let s;if(e instanceof Se){let T=e;s=new Se,s.feePayer=T.feePayer,s.instructions=e.instructions,s.nonceInfo=T.nonceInfo,s.signatures=T.signatures}else s=Se.populate(e),s._message=s._json=void 0;if(t!==void 0&&!Array.isArray(t))throw new Error("Invalid arguments");let i=t;if(s.nonceInfo&&i)s.sign(...i);else{let T=this._disableBlockhashCaching;for(;;){let I=await this._blockhashWithExpiryBlockHeight(T);if(s.lastValidBlockHeight=I.lastValidBlockHeight,s.recentBlockhash=I.blockhash,!i)break;if(s.sign(...i),!s.signature)throw new Error("!signature");let A=s.signature.toString("base64");if(!this._blockhashInfo.simulatedSignatures.includes(A)&&!this._blockhashInfo.transactionSignatures.includes(A)){this._blockhashInfo.simulatedSignatures.push(A);break}else T=!0}}let o=s._compile(),c=o.serialize(),p=s._serialize(c).toString("base64"),m={encoding:"base64",commitment:this.commitment};if(n){let T=(Array.isArray(n)?n:o.nonProgramIds()).map(I=>I.toBase58());m.accounts={encoding:"base64",addresses:T}}i&&(m.sigVerify=!0),t&&typeof t=="object"&&"innerInstructions"in t&&(m.innerInstructions=t.innerInstructions);let b=[p,m],x=await this._rpcRequest("simulateTransaction",b),S=W(x,Wh);if("error"in S){let T;if("data"in S.error&&(T=S.error.data.logs,T&&Array.isArray(T))){let I=`
|
|
12
|
-
`,A=I+T.join(I);console.error(S.error.message,A)}throw new hi({action:"simulate",signature:"",transactionMessage:S.error.message,logs:T})}return S.result}async sendTransaction(e,t,n){if("version"in e){if(t&&Array.isArray(t))throw new Error("Invalid arguments");let o=e.serialize();return await this.sendRawTransaction(o,t)}if(t===void 0||!Array.isArray(t))throw new Error("Invalid arguments");let s=t;if(e.nonceInfo)e.sign(...s);else{let o=this._disableBlockhashCaching;for(;;){let c=await this._blockhashWithExpiryBlockHeight(o);if(e.lastValidBlockHeight=c.lastValidBlockHeight,e.recentBlockhash=c.blockhash,e.sign(...s),!e.signature)throw new Error("!signature");let u=e.signature.toString("base64");if(this._blockhashInfo.transactionSignatures.includes(u))o=!0;else{this._blockhashInfo.transactionSignatures.push(u);break}}}let i=e.serialize();return await this.sendRawTransaction(i,n)}async sendRawTransaction(e,t){let n=we(e).toString("base64");return await this.sendEncodedTransaction(n,t)}async sendEncodedTransaction(e,t){let n={encoding:"base64"},s=t&&t.skipPreflight,i=s===!0?"processed":t&&t.preflightCommitment||this.commitment;t&&t.maxRetries!=null&&(n.maxRetries=t.maxRetries),t&&t.minContextSlot!=null&&(n.minContextSlot=t.minContextSlot),s&&(n.skipPreflight=s),i&&(n.preflightCommitment=i);let o=[e,n],c=await this._rpcRequest("sendTransaction",o),u=W(c,sv);if("error"in u){let p;throw"data"in u.error&&(p=u.error.data.logs),new hi({action:s?"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(([t,n])=>{this._setSubscription(t,{...n,state:"pending"})})}_setSubscription(e,t){let n=this._subscriptionsByHash[e]?.state;if(this._subscriptionsByHash[e]=t,n!==t.state){let s=this._subscriptionStateChangeCallbacksByHash[e];s&&s.forEach(i=>{try{i(t.state)}catch{}})}}_onSubscriptionStateChange(e,t){let n=this._subscriptionHashByClientSubscriptionId[e];if(n==null)return()=>{};let s=this._subscriptionStateChangeCallbacksByHash[n]||=new Set;return s.add(t),()=>{s.delete(t),s.size===0&&delete this._subscriptionStateChangeCallbacksByHash[n]}}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(n){n instanceof Error&&console.log(`Error when closing socket connection: ${n.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,t=()=>e===this._rpcWebSocketGeneration;await Promise.all(Object.keys(this._subscriptionsByHash).map(async n=>{let s=this._subscriptionsByHash[n];if(s!==void 0)switch(s.state){case"pending":case"unsubscribed":if(s.callbacks.size===0){delete this._subscriptionsByHash[n],s.state==="unsubscribed"&&delete this._subscriptionCallbacksByServerSubscriptionId[s.serverSubscriptionId],await this._updateSubscriptions();return}await(async()=>{let{args:i,method:o}=s;try{this._setSubscription(n,{...s,state:"subscribing"});let c=await this._rpcWebSocket.call(o,i);this._setSubscription(n,{...s,serverSubscriptionId:c,state:"subscribed"}),this._subscriptionCallbacksByServerSubscriptionId[c]=s.callbacks,await this._updateSubscriptions()}catch(c){if(console.error(`Received ${c instanceof Error?"":"JSON-RPC "}error calling \`${o}\``,{args:i,error:c}),!t())return;this._setSubscription(n,{...s,state:"pending"}),await this._updateSubscriptions()}})();break;case"subscribed":s.callbacks.size===0&&await(async()=>{let{serverSubscriptionId:i,unsubscribeMethod:o}=s;if(this._subscriptionsAutoDisposedByRpc.has(i))this._subscriptionsAutoDisposedByRpc.delete(i);else{this._setSubscription(n,{...s,state:"unsubscribing"}),this._setSubscription(n,{...s,state:"unsubscribing"});try{await this._rpcWebSocket.call(o,[i])}catch(c){if(c instanceof Error&&console.error(`${o} error:`,c.message),!t())return;this._setSubscription(n,{...s,state:"subscribed"}),await this._updateSubscriptions();return}}this._setSubscription(n,{...s,state:"unsubscribed"}),await this._updateSubscriptions()})();break}}))}_handleServerNotification(e,t){let n=this._subscriptionCallbacksByServerSubscriptionId[e];n!==void 0&&n.forEach(s=>{try{s(...t)}catch(i){console.error(i)}})}_wsOnAccountNotification(e){let{result:t,subscription:n}=W(e,kR);this._handleServerNotification(n,[t.value,t.context])}_makeSubscription(e,t){let n=this._nextClientSubscriptionId++,s=Fh([e.method,t]),i=this._subscriptionsByHash[s];return i===void 0?this._subscriptionsByHash[s]={...e,args:t,callbacks:new Set([e.callback]),state:"pending"}:i.callbacks.add(e.callback),this._subscriptionHashByClientSubscriptionId[n]=s,this._subscriptionDisposeFunctionsByClientSubscriptionId[n]=async()=>{delete this._subscriptionDisposeFunctionsByClientSubscriptionId[n],delete this._subscriptionHashByClientSubscriptionId[n];let o=this._subscriptionsByHash[s];Ae(o!==void 0,`Could not find a \`Subscription\` when tearing down client subscription #${n}`),o.callbacks.delete(e.callback),await this._updateSubscriptions()},this._updateSubscriptions(),n}onAccountChange(e,t,n){let{commitment:s,config:i}=Le(n),o=this._buildArgs([e.toBase58()],s||this._commitment||"finalized","base64",i);return this._makeSubscription({callback:t,method:"accountSubscribe",unsubscribeMethod:"accountUnsubscribe"},o)}async removeAccountChangeListener(e){await this._unsubscribeClientSubscription(e,"account change")}_wsOnProgramAccountNotification(e){let{result:t,subscription:n}=W(e,TR);this._handleServerNotification(n,[{accountId:t.value.pubkey,accountInfo:t.value.account},t.context])}onProgramAccountChange(e,t,n,s){let{commitment:i,config:o}=Le(n),c=this._buildArgs([e.toBase58()],i||this._commitment||"finalized","base64",o||(s?{filters:Vh(s)}:void 0));return this._makeSubscription({callback:t,method:"programSubscribe",unsubscribeMethod:"programUnsubscribe"},c)}async removeProgramAccountChangeListener(e){await this._unsubscribeClientSubscription(e,"program account change")}onLogs(e,t,n){let s=this._buildArgs([typeof e=="object"?{mentions:[e.toString()]}:e],n||this._commitment||"finalized");return this._makeSubscription({callback:t,method:"logsSubscribe",unsubscribeMethod:"logsUnsubscribe"},s)}async removeOnLogsListener(e){await this._unsubscribeClientSubscription(e,"logs")}_wsOnLogsNotification(e){let{result:t,subscription:n}=W(e,ov);this._handleServerNotification(n,[t.value,t.context])}_wsOnSlotNotification(e){let{result:t,subscription:n}=W(e,LR);this._handleServerNotification(n,[t])}onSlotChange(e){return this._makeSubscription({callback:e,method:"slotSubscribe",unsubscribeMethod:"slotUnsubscribe"},[])}async removeSlotChangeListener(e){await this._unsubscribeClientSubscription(e,"slot change")}_wsOnSlotUpdatesNotification(e){let{result:t,subscription:n}=W(e,CR);this._handleServerNotification(n,[t])}onSlotUpdate(e){return this._makeSubscription({callback:e,method:"slotsUpdatesSubscribe",unsubscribeMethod:"slotsUpdatesUnsubscribe"},[])}async removeSlotUpdateListener(e){await this._unsubscribeClientSubscription(e,"slot update")}async _unsubscribeClientSubscription(e,t){let n=this._subscriptionDisposeFunctionsByClientSubscriptionId[e];n?await n():console.warn(`Ignored unsubscribe request because an active subscription with id \`${e}\` for '${t}' events could not be found.`)}_buildArgs(e,t,n,s){let i=t||this._commitment;if(i||n||s){let o={};n&&(o.encoding=n),i&&(o.commitment=i),s&&(o=Object.assign(o,s)),e.push(o)}return e}_buildArgsAtLeastConfirmed(e,t,n,s){let i=t||this._commitment;if(i&&!["confirmed","finalized"].includes(i))throw new Error("Using Connection with default commitment: `"+this._commitment+"`, but method requires at least `confirmed`");return this._buildArgs(e,t,n,s)}_wsOnSignatureNotification(e){let{result:t,subscription:n}=W(e,PR);t.value!=="receivedSignature"&&this._subscriptionsAutoDisposedByRpc.add(n),this._handleServerNotification(n,t.value==="receivedSignature"?[{type:"received"},t.context]:[{type:"status",result:t.value},t.context])}onSignature(e,t,n){let s=this._buildArgs([e],n||this._commitment||"finalized"),i=this._makeSubscription({callback:(o,c)=>{if(o.type==="status"){t(o.result,c);try{this.removeSignatureListener(i)}catch{}}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},s);return i}onSignatureWithOptions(e,t,n){let{commitment:s,...i}={...n,commitment:n&&n.commitment||this._commitment||"finalized"},o=this._buildArgs([e],s,void 0,i),c=this._makeSubscription({callback:(u,p)=>{t(u,p);try{this.removeSignatureListener(c)}catch{}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},o);return c}async removeSignatureListener(e){await this._unsubscribeClientSubscription(e,"signature result")}_wsOnRootNotification(e){let{result:t,subscription:n}=W(e,MR);this._handleServerNotification(n,[t])}onRootChange(e){return this._makeSubscription({callback:e,method:"rootSubscribe",unsubscribeMethod:"rootUnsubscribe"},[])}async removeRootChangeListener(e){await this._unsubscribeClientSubscription(e,"root change")}},Du=class r{constructor(e){this._keypair=void 0,this._keypair=e??Ch()}static generate(){return new r(Ch())}static fromSecretKey(e,t){if(e.byteLength!==64)throw new Error("bad secret key size");let n=e.slice(32,64);if(!t||!t.skipValidation){let s=e.slice(0,32),i=Ou(s);for(let o=0;o<32;o++)if(n[o]!==i[o])throw new Error("provided secretKey is invalid")}return new r({publicKey:n,secretKey:e})}static fromSeed(e){let t=Ou(e),n=new Uint8Array(64);return n.set(e),n.set(t,32),new r({publicKey:t,secretKey:n})}get publicKey(){return new ue(this._keypair.publicKey)}get secretKey(){return new Uint8Array(this._keypair.secretKey)}},fi=Object.freeze({CreateLookupTable:{index:0,layout:R.struct([R.u32("instruction"),Ts("recentSlot"),R.u8("bumpSeed")])},FreezeLookupTable:{index:1,layout:R.struct([R.u32("instruction")])},ExtendLookupTable:{index:2,layout:R.struct([R.u32("instruction"),Ts(),R.seq(be(),R.offset(R.u32(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:R.struct([R.u32("instruction")])},CloseLookupTable:{index:4,layout:R.struct([R.u32("instruction")])}});var zu=class{constructor(){}static createLookupTable(e){let[t,n]=ue.findProgramAddressSync([e.authority.toBuffer(),tu().encode(e.recentSlot)],this.programId),s=fi.CreateLookupTable,i=Ee(s,{recentSlot:BigInt(e.recentSlot),bumpSeed:n}),o=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1},{pubkey:e.payer,isSigner:!0,isWritable:!0},{pubkey:Ft.programId,isSigner:!1,isWritable:!1}];return[new Te({programId:this.programId,keys:o,data:i}),t]}static freezeLookupTable(e){let t=fi.FreezeLookupTable,n=Ee(t),s=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return new Te({programId:this.programId,keys:s,data:n})}static extendLookupTable(e){let t=fi.ExtendLookupTable,n=Ee(t,{addresses:e.addresses.map(i=>i.toBytes())}),s=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return e.payer&&s.push({pubkey:e.payer,isSigner:!0,isWritable:!0},{pubkey:Ft.programId,isSigner:!1,isWritable:!1}),new Te({programId:this.programId,keys:s,data:n})}static deactivateLookupTable(e){let t=fi.DeactivateLookupTable,n=Ee(t),s=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return new Te({programId:this.programId,keys:s,data:n})}static closeLookupTable(e){let t=fi.CloseLookupTable,n=Ee(t),s=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1},{pubkey:e.recipient,isSigner:!1,isWritable:!0}];return new Te({programId:this.programId,keys:s,data:n})}};zu.programId=new ue("AddressLookupTab1e1111111111111111111111111");var qo=Object.freeze({RequestUnits:{index:0,layout:R.struct([R.u8("instruction"),R.u32("units"),R.u32("additionalFee")])},RequestHeapFrame:{index:1,layout:R.struct([R.u8("instruction"),R.u32("bytes")])},SetComputeUnitLimit:{index:2,layout:R.struct([R.u8("instruction"),R.u32("units")])},SetComputeUnitPrice:{index:3,layout:R.struct([R.u8("instruction"),Ts("microLamports")])}}),Fu=class{constructor(){}static requestUnits(e){let t=qo.RequestUnits,n=Ee(t,e);return new Te({keys:[],programId:this.programId,data:n})}static requestHeapFrame(e){let t=qo.RequestHeapFrame,n=Ee(t,e);return new Te({keys:[],programId:this.programId,data:n})}static setComputeUnitLimit(e){let t=qo.SetComputeUnitLimit,n=Ee(t,e);return new Te({keys:[],programId:this.programId,data:n})}static setComputeUnitPrice(e){let t=qo.SetComputeUnitPrice,n=Ee(t,{microLamports:BigInt(e.microLamports)});return new Te({keys:[],programId:this.programId,data:n})}};Fu.programId=new ue("ComputeBudget111111111111111111111111111111");var Kh=64,Hh=32,Gh=64,Zh=R.struct([R.u8("numSignatures"),R.u8("padding"),R.u16("signatureOffset"),R.u16("signatureInstructionIndex"),R.u16("publicKeyOffset"),R.u16("publicKeyInstructionIndex"),R.u16("messageDataOffset"),R.u16("messageDataSize"),R.u16("messageInstructionIndex")]),$u=class r{constructor(){}static createInstructionWithPublicKey(e){let{publicKey:t,message:n,signature:s,instructionIndex:i}=e;Ae(t.length===Hh,`Public Key must be ${Hh} bytes but received ${t.length} bytes`),Ae(s.length===Gh,`Signature must be ${Gh} bytes but received ${s.length} bytes`);let o=Zh.span,c=o+t.length,u=c+s.length,p=1,m=ce.Buffer.alloc(u+n.length),b=i??65535;return Zh.encode({numSignatures:p,padding:0,signatureOffset:c,signatureInstructionIndex:b,publicKeyOffset:o,publicKeyInstructionIndex:b,messageDataOffset:u,messageDataSize:n.length,messageInstructionIndex:b},m),m.fill(t,o),m.fill(s,c),m.fill(n,u),new Te({keys:[],programId:r.programId,data:m})}static createInstructionWithPrivateKey(e){let{privateKey:t,message:n,instructionIndex:s}=e;Ae(t.length===Kh,`Private key must be ${Kh} bytes but received ${t.length} bytes`);try{let i=Du.fromSecretKey(t),o=i.publicKey.toBytes(),c=Wu(n,i.secretKey);return this.createInstructionWithPublicKey({publicKey:o,message:n,signature:c,instructionIndex:s})}catch(i){throw new Error(`Error creating instruction; ${i}`)}}};$u.programId=new ue("Ed25519SigVerify111111111111111111111111111");var cv=(r,e)=>{let t=ci.sign(r,e);return[t.toCompactRawBytes(),t.recovery]};ci.utils.isValidPrivateKey;var uv=ci.getPublicKey,Yh=32,Au=20,Jh=64,fv=11,Iu=R.struct([R.u8("numSignatures"),R.u16("signatureOffset"),R.u8("signatureInstructionIndex"),R.u16("ethAddressOffset"),R.u8("ethAddressInstructionIndex"),R.u16("messageDataOffset"),R.u16("messageDataSize"),R.u8("messageInstructionIndex"),R.blob(20,"ethAddress"),R.blob(64,"signature"),R.u8("recoveryId")]),Vu=class r{constructor(){}static publicKeyToEthAddress(e){Ae(e.length===Jh,`Public key must be ${Jh} bytes but received ${e.length} bytes`);try{return ce.Buffer.from(mu(we(e))).slice(-Au)}catch(t){throw new Error(`Error constructing Ethereum address: ${t}`)}}static createInstructionWithPublicKey(e){let{publicKey:t,message:n,signature:s,recoveryId:i,instructionIndex:o}=e;return r.createInstructionWithEthAddress({ethAddress:r.publicKeyToEthAddress(t),message:n,signature:s,recoveryId:i,instructionIndex:o})}static createInstructionWithEthAddress(e){let{ethAddress:t,message:n,signature:s,recoveryId:i,instructionIndex:o=0}=e,c;typeof t=="string"?t.startsWith("0x")?c=ce.Buffer.from(t.substr(2),"hex"):c=ce.Buffer.from(t,"hex"):c=t,Ae(c.length===Au,`Address must be ${Au} bytes but received ${c.length} bytes`);let u=1+fv,p=u,m=u+c.length,b=m+s.length+1,x=1,S=ce.Buffer.alloc(Iu.span+n.length);return Iu.encode({numSignatures:x,signatureOffset:m,signatureInstructionIndex:o,ethAddressOffset:p,ethAddressInstructionIndex:o,messageDataOffset:b,messageDataSize:n.length,messageInstructionIndex:o,signature:we(s),ethAddress:we(c),recoveryId:i},S),S.fill(we(n),Iu.span),new Te({keys:[],programId:r.programId,data:S})}static createInstructionWithPrivateKey(e){let{privateKey:t,message:n,instructionIndex:s}=e;Ae(t.length===Yh,`Private key must be ${Yh} bytes but received ${t.length} bytes`);try{let i=we(t),o=uv(i,!1).slice(1),c=ce.Buffer.from(mu(we(n))),[u,p]=cv(c,i);return this.createInstructionWithPublicKey({publicKey:o,message:n,signature:u,recoveryId:p,instructionIndex:s})}catch(i){throw new Error(`Error creating instruction; ${i}`)}}};Vu.programId=new ue("KeccakSecp256k11111111111111111111111111111");var mp,lv=new ue("StakeConfig11111111111111111111111111111111");var mi=class{constructor(e,t,n){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=e,this.epoch=t,this.custodian=n}};mp=mi;mi.default=new mp(0,0,ue.default);var hn=Object.freeze({Initialize:{index:0,layout:R.struct([R.u32("instruction"),AE(),IE()])},Authorize:{index:1,layout:R.struct([R.u32("instruction"),be("newAuthorized"),R.u32("stakeAuthorizationType")])},Delegate:{index:2,layout:R.struct([R.u32("instruction")])},Split:{index:3,layout:R.struct([R.u32("instruction"),R.ns64("lamports")])},Withdraw:{index:4,layout:R.struct([R.u32("instruction"),R.ns64("lamports")])},Deactivate:{index:5,layout:R.struct([R.u32("instruction")])},Merge:{index:7,layout:R.struct([R.u32("instruction")])},AuthorizeWithSeed:{index:8,layout:R.struct([R.u32("instruction"),be("newAuthorized"),R.u32("stakeAuthorizationType"),ks("authoritySeed"),be("authorityOwner")])}}),PI=Object.freeze({Staker:{index:0},Withdrawer:{index:1}}),ta=class{constructor(){}static initialize(e){let{stakePubkey:t,authorized:n,lockup:s}=e,i=s||mi.default,o=hn.Initialize,c=Ee(o,{authorized:{staker:we(n.staker.toBuffer()),withdrawer:we(n.withdrawer.toBuffer())},lockup:{unixTimestamp:i.unixTimestamp,epoch:i.epoch,custodian:we(i.custodian.toBuffer())}}),u={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:di,isSigner:!1,isWritable:!1}],programId:this.programId,data:c};return new Te(u)}static createAccountWithSeed(e){let t=new Se;t.add(Ft.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:this.space,programId:this.programId}));let{stakePubkey:n,authorized:s,lockup:i}=e;return t.add(this.initialize({stakePubkey:n,authorized:s,lockup:i}))}static createAccount(e){let t=new Se;t.add(Ft.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,lamports:e.lamports,space:this.space,programId:this.programId}));let{stakePubkey:n,authorized:s,lockup:i}=e;return t.add(this.initialize({stakePubkey:n,authorized:s,lockup:i}))}static delegate(e){let{stakePubkey:t,authorizedPubkey:n,votePubkey:s}=e,i=hn.Delegate,o=Ee(i);return new Se().add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:s,isSigner:!1,isWritable:!1},{pubkey:zr,isSigner:!1,isWritable:!1},{pubkey:Eu,isSigner:!1,isWritable:!1},{pubkey:lv,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static authorize(e){let{stakePubkey:t,authorizedPubkey:n,newAuthorizedPubkey:s,stakeAuthorizationType:i,custodianPubkey:o}=e,c=hn.Authorize,u=Ee(c,{newAuthorized:we(s.toBuffer()),stakeAuthorizationType:i.index}),p=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:zr,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}];return o&&p.push({pubkey:o,isSigner:!0,isWritable:!1}),new Se().add({keys:p,programId:this.programId,data:u})}static authorizeWithSeed(e){let{stakePubkey:t,authorityBase:n,authoritySeed:s,authorityOwner:i,newAuthorizedPubkey:o,stakeAuthorizationType:c,custodianPubkey:u}=e,p=hn.AuthorizeWithSeed,m=Ee(p,{newAuthorized:we(o.toBuffer()),stakeAuthorizationType:c.index,authoritySeed:s,authorityOwner:we(i.toBuffer())}),b=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1},{pubkey:zr,isSigner:!1,isWritable:!1}];return u&&b.push({pubkey:u,isSigner:!0,isWritable:!1}),new Se().add({keys:b,programId:this.programId,data:m})}static splitInstruction(e){let{stakePubkey:t,authorizedPubkey:n,splitStakePubkey:s,lamports:i}=e,o=hn.Split,c=Ee(o,{lamports:i});return new Te({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:c})}static split(e,t){let n=new Se;return n.add(Ft.createAccount({fromPubkey:e.authorizedPubkey,newAccountPubkey:e.splitStakePubkey,lamports:t,space:this.space,programId:this.programId})),n.add(this.splitInstruction(e))}static splitWithSeed(e,t){let{stakePubkey:n,authorizedPubkey:s,splitStakePubkey:i,basePubkey:o,seed:c,lamports:u}=e,p=new Se;return p.add(Ft.allocate({accountPubkey:i,basePubkey:o,seed:c,space:this.space,programId:this.programId})),t&&t>0&&p.add(Ft.transfer({fromPubkey:e.authorizedPubkey,toPubkey:i,lamports:t})),p.add(this.splitInstruction({stakePubkey:n,authorizedPubkey:s,splitStakePubkey:i,lamports:u}))}static merge(e){let{stakePubkey:t,sourceStakePubKey:n,authorizedPubkey:s}=e,i=hn.Merge,o=Ee(i);return new Se().add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:zr,isSigner:!1,isWritable:!1},{pubkey:Eu,isSigner:!1,isWritable:!1},{pubkey:s,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static withdraw(e){let{stakePubkey:t,authorizedPubkey:n,toPubkey:s,lamports:i,custodianPubkey:o}=e,c=hn.Withdraw,u=Ee(c,{lamports:i}),p=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:zr,isSigner:!1,isWritable:!1},{pubkey:Eu,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return o&&p.push({pubkey:o,isSigner:!0,isWritable:!1}),new Se().add({keys:p,programId:this.programId,data:u})}static deactivate(e){let{stakePubkey:t,authorizedPubkey:n}=e,s=hn.Deactivate,i=Ee(s);return new Se().add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:zr,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}};ta.programId=new ue("Stake11111111111111111111111111111111111111");ta.space=200;var li=Object.freeze({InitializeAccount:{index:0,layout:R.struct([R.u32("instruction"),kE()])},Authorize:{index:1,layout:R.struct([R.u32("instruction"),be("newAuthorized"),R.u32("voteAuthorizationType")])},Withdraw:{index:3,layout:R.struct([R.u32("instruction"),R.ns64("lamports")])},UpdateValidatorIdentity:{index:4,layout:R.struct([R.u32("instruction")])},AuthorizeWithSeed:{index:10,layout:R.struct([R.u32("instruction"),OE()])}}),MI=Object.freeze({Voter:{index:0},Withdrawer:{index:1}}),ra=class r{constructor(){}static initializeAccount(e){let{votePubkey:t,nodePubkey:n,voteInit:s}=e,i=li.InitializeAccount,o=Ee(i,{voteInit:{nodePubkey:we(s.nodePubkey.toBuffer()),authorizedVoter:we(s.authorizedVoter.toBuffer()),authorizedWithdrawer:we(s.authorizedWithdrawer.toBuffer()),commission:s.commission}}),c={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:di,isSigner:!1,isWritable:!1},{pubkey:zr,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:o};return new Te(c)}static createAccount(e){let t=new Se;return t.add(Ft.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.votePubkey,lamports:e.lamports,space:this.space,programId:this.programId})),t.add(this.initializeAccount({votePubkey:e.votePubkey,nodePubkey:e.voteInit.nodePubkey,voteInit:e.voteInit}))}static authorize(e){let{votePubkey:t,authorizedPubkey:n,newAuthorizedPubkey:s,voteAuthorizationType:i}=e,o=li.Authorize,c=Ee(o,{newAuthorized:we(s.toBuffer()),voteAuthorizationType:i.index}),u=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:zr,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return new Se().add({keys:u,programId:this.programId,data:c})}static authorizeWithSeed(e){let{currentAuthorityDerivedKeyBasePubkey:t,currentAuthorityDerivedKeyOwnerPubkey:n,currentAuthorityDerivedKeySeed:s,newAuthorizedPubkey:i,voteAuthorizationType:o,votePubkey:c}=e,u=li.AuthorizeWithSeed,p=Ee(u,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:we(n.toBuffer()),currentAuthorityDerivedKeySeed:s,newAuthorized:we(i.toBuffer()),voteAuthorizationType:o.index}}),m=[{pubkey:c,isSigner:!1,isWritable:!0},{pubkey:zr,isSigner:!1,isWritable:!1},{pubkey:t,isSigner:!0,isWritable:!1}];return new Se().add({keys:m,programId:this.programId,data:p})}static withdraw(e){let{votePubkey:t,authorizedWithdrawerPubkey:n,lamports:s,toPubkey:i}=e,o=li.Withdraw,c=Ee(o,{lamports:s}),u=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}];return new Se().add({keys:u,programId:this.programId,data:c})}static safeWithdraw(e,t,n){if(e.lamports>t-n)throw new Error("Withdraw will leave vote account with insufficient funds.");return r.withdraw(e)}static updateValidatorIdentity(e){let{votePubkey:t,authorizedWithdrawerPubkey:n,nodePubkey:s}=e,i=li.UpdateValidatorIdentity,o=Ee(i),c=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:s,isSigner:!0,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return new Se().add({keys:c,programId:this.programId,data:o})}};ra.programId=new ue("Vote111111111111111111111111111111111111111");ra.space=3762;var UI=new ue("Va1idator1nfo111111111111111111111111111111"),DI=P({name:z(),website:ne(z()),details:ne(z()),iconUrl:ne(z()),keybaseUsername:ne(z())});var zI=new ue("Vote111111111111111111111111111111111111111"),FI=R.struct([be("nodePubkey"),be("authorizedWithdrawer"),R.u8("commission"),R.nu64(),R.seq(R.struct([R.nu64("slot"),R.u32("confirmationCount")]),R.offset(R.u32(),-8),"votes"),R.u8("rootSlotValid"),R.nu64("rootSlot"),R.nu64(),R.seq(R.struct([R.nu64("epoch"),be("authorizedVoter")]),R.offset(R.u32(),-8),"authorizedVoters"),R.struct([R.seq(R.struct([be("authorizedPubkey"),R.nu64("epochOfLastAuthorizedSwitch"),R.nu64("targetEpoch")]),32,"buf"),R.nu64("idx"),R.u8("isEmpty")],"priorVoters"),R.nu64(),R.seq(R.struct([R.nu64("epoch"),R.nu64("credits"),R.nu64("prevCredits")]),R.offset(R.u32(),-8),"epochCredits"),R.struct([R.nu64("slot"),R.nu64("timestamp")],"lastTimestamp")]);var Gu=r=>({request:r,signMessage:e=>r({method:"signMessage",params:{message:e}}),signTransaction:e=>r({method:"signTransaction",params:{transaction:e}}),signAndSendTransaction:e=>r({method:"signAndSendTransaction",params:e})});function Zu(r){return Buffer.from(r.serialize({verifySignatures:!1})).toString("base64")}function Yu(r){let e=Buffer.from(r,"base64");return na.deserializeMessageVersion(e)==="legacy"?Jo.deserialize(e):Se.from(e)}function dv(r){return async t=>{if(t.method==="connect")return await r(t);if(t.method==="signMessage")return await r(t);if(t.method==="signAndSendTransaction"){let{transaction:n,options:s}=t.params,i={transaction:Yu(n),options:s};return await r({method:"signAndSendTransaction",params:i})}if(t.method==="signTransaction"){let{transaction:n}=t.params,s={transaction:Yu(n)},{signedTransaction:i}=await r({method:"signTransaction",params:s});return{signedTransaction:Zu(i)}}}}function Ju(r){return async t=>{if(t.method==="connect")return await r(t);if(t.method==="signMessage")return await r(t);if(t.method==="signAndSendTransaction"){let{transaction:n}=t.params,s={transaction:Zu(n)};return await r({method:"signAndSendTransaction",params:s})}if(t.method==="signTransaction"){let{transaction:n}=t.params,s={transaction:Zu(n)},{signedTransaction:i}=await r({method:"signTransaction",params:s});return{signedTransaction:Yu(i)}}}}var gp=({miniAppHost:r,emitter:e})=>{let t,n=null;return{visible:!1,get onback(){return n},set onback(s){n&&e.removeListener("backNavigationTriggered",n),n=s,s&&e.addListener("backNavigationTriggered",s)},async show(){await r.updateBackState({visible:!0}),this.visible=!0},async hide(){await r.updateBackState({visible:!1}),this.visible=!1},async enableWebNavigation(){t=hv({back:this,emitter:e})},async disableWebNavigation(){t?.(),t=void 0}}};function hv({emitter:r,back:e}){let t=pv();if(t)return mv({emitter:r,back:e,navigation:t});if(typeof window<"u")return gv({emitter:r,back:e,window})}function pv(){if(typeof window<"u"&&window.navigation!==void 0)return window.navigation}function mv({emitter:r,back:e,navigation:t}){function n(){t.canGoBack?e.show():e.hide()}function s(){e.visible&&t.canGoBack&&t.back()}return t.addEventListener("navigatesuccess",n),r.addListener("backNavigationTriggered",s),()=>{t.removeEventListener("navigatesuccess",n),r.removeListener("backNavigationTriggered",s)}}function gv({emitter:r,back:e,window:t}){e.show();function n(){e.visible&&t.history.back()}return r.addListener("backNavigationTriggered",n),()=>{r.removeListener("backNavigationTriggered",n)}}var yp="0.1.1";function _p(){return yp}var oa=class r extends Error{constructor(e,t={}){let n=(()=>{if(t.cause instanceof r){if(t.cause.details)return t.cause.details;if(t.cause.shortMessage)return t.cause.shortMessage}return t.cause?.message?t.cause.message:t.details})(),s=t.cause instanceof r&&t.cause.docsPath||t.docsPath,o=`https://oxlib.sh${s??""}`,c=[e||"An error occurred.",...t.metaMessages?["",...t.metaMessages]:[],...n||s?["",n?`Details: ${n}`:void 0,s?`See: ${o}`:void 0]:[]].filter(u=>typeof u=="string").join(`
|
|
13
|
-
`);super(c,t.cause?{cause:t.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@${_p()}`}),this.cause=t.cause,this.details=n,this.docs=o,this.docsPath=s,this.shortMessage=e}walk(e){return bp(this,e)}};function bp(r,e){return e?.(r)?r:r&&typeof r=="object"&&"cause"in r&&r.cause?bp(r.cause,e):e?null:r}function aa(r,e={}){let{raw:t=!1}=e,n=r;if(t)return r;if(n.error){let{code:s}=n.error,i=s===es.code?es:s===gi.code?gi:s===xi.code?xi:s===vi.code?vi:s===Ei.code?Ei:s===Si.code?Si:s===wi.code?wi:s===Ai.code?Ai:s===yi.code?yi:s===_i.code?_i:s===bi.code?bi:s===Ri.code?Ri:At;throw new i(n.error)}return n.result}var At=class extends Error{constructor(e){let{code:t,message:n,data:s}=e;super(n),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=t,this.data=s}},gi=class r extends At{constructor(e={}){super({message:"Missing or invalid parameters.",...e,code:r.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(gi,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});var yi=class r extends At{constructor(e={}){super({message:"Requested resource not found.",...e,code:r.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(yi,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});var _i=class r extends At{constructor(e={}){super({message:"Requested resource not available.",...e,code:r.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(_i,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});var bi=class r extends At{constructor(e={}){super({message:"Transaction creation failed.",...e,code:r.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(bi,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});var wi=class r extends At{constructor(e={}){super({message:"Method is not implemented.",...e,code:r.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(wi,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});var Ei=class r extends At{constructor(e={}){super({message:"Rate limit exceeded.",...e,code:r.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(Ei,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});var Ri=class r extends At{constructor(e={}){super({message:"JSON-RPC version not supported.",...e,code:r.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(Ri,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});var vi=class r extends At{constructor(e={}){super({message:"Input is not a valid JSON-RPC request.",...e,code:r.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(vi,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});var Si=class r extends At{constructor(e={}){super({message:"Method does not exist.",...e,code:r.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(Si,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});var xi=class r extends At{constructor(e={}){super({message:"Invalid method parameters.",...e,code:r.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(xi,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});var es=class r extends At{constructor(e={}){super({message:"Internal JSON-RPC error.",...e,code:r.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(es,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});var Ai=class r extends At{constructor(e={}){super({message:"Failed to parse JSON-RPC response.",...e,code:r.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(Ai,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});var vr=class extends Error{constructor(e,t){super(t),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=t}},Ii=class extends vr{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(Ii,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});var ki=class extends vr{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(ki,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});var Oi=class extends vr{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(Oi,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});var Ti=class extends vr{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(Ti,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});var Ni=class extends vr{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(Ni,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});function Ep(){let r=new Gn.default;return{get eventNames(){return r.eventNames.bind(r)},get listenerCount(){return r.listenerCount.bind(r)},get listeners(){return r.listeners.bind(r)},addListener:r.addListener.bind(r),emit:r.emit.bind(r),off:r.off.bind(r),on:r.on.bind(r),once:r.once.bind(r),removeAllListeners:r.removeAllListeners.bind(r),removeListener:r.removeListener.bind(r)}}function Rp(r,e={}){let{includeEvents:t=!0}=e;if(!r)throw new Xu;return{...t?{on:r.on?.bind(r),removeListener:r.removeListener?.bind(r)}:{},async request(n){let s=await r.request(n);return s&&typeof s=="object"&&"jsonrpc"in s?aa(s):s}}}var Xu=class extends oa{constructor(){super("`provider` is undefined."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.IsUndefinedError"})}};function vp(r={}){let e=r.id??0;return{prepare(t){return bv({id:e++,...t})},get id(){return e}}}function bv(r){return{...r,jsonrpc:"2.0"}}var xp=Symbol("Comlink.proxy"),Ev=Symbol("Comlink.endpoint"),Rv=Symbol("Comlink.releaseProxy"),Qu=Symbol("Comlink.finalizer"),ua=Symbol("Comlink.thrown"),Ap=r=>typeof r=="object"&&r!==null||typeof r=="function",vv={canHandle:r=>Ap(r)&&r[xp],serialize(r){let{port1:e,port2:t}=new MessageChannel;return kp(r,e),[t,[t]]},deserialize(r){return r.start(),tf(r)}},Sv={canHandle:r=>Ap(r)&&ua in r,serialize({value:r}){let e;return r instanceof Error?e={isError:!0,value:{message:r.message,name:r.name,stack:r.stack}}:e={isError:!1,value:r},[e,[]]},deserialize(r){throw r.isError?Object.assign(new Error(r.value.message),r.value):r.value}},Ip=new Map([["proxy",vv],["throw",Sv]]);function xv(r,e){for(let t of r)if(e===t||t==="*"||t instanceof RegExp&&t.test(e))return!0;return!1}function kp(r,e=globalThis,t=["*"]){e.addEventListener("message",function n(s){if(!s||!s.data)return;if(!xv(t,s.origin)){console.warn(`Invalid origin '${s.origin}' for comlink proxy`);return}let{id:i,type:o,path:c}=Object.assign({path:[]},s.data),u=(s.data.argumentList||[]).map(ts),p;try{let m=c.slice(0,-1).reduce((x,S)=>x[S],r),b=c.reduce((x,S)=>x[S],r);switch(o){case"GET":p=b;break;case"SET":m[c.slice(-1)[0]]=ts(s.data.value),p=!0;break;case"APPLY":p=b.apply(m,u);break;case"CONSTRUCT":{let x=new b(...u);p=Nv(x)}break;case"ENDPOINT":{let{port1:x,port2:S}=new MessageChannel;kp(r,S),p=Tv(x,[x])}break;case"RELEASE":p=void 0;break;default:return}}catch(m){p={value:m,[ua]:0}}Promise.resolve(p).catch(m=>({value:m,[ua]:0})).then(m=>{let[b,x]=da(m);e.postMessage(Object.assign(Object.assign({},b),{id:i}),x),o==="RELEASE"&&(e.removeEventListener("message",n),Op(e),Qu in r&&typeof r[Qu]=="function"&&r[Qu]())}).catch(m=>{let[b,x]=da({value:new TypeError("Unserializable return value"),[ua]:0});e.postMessage(Object.assign(Object.assign({},b),{id:i}),x)})}),e.start&&e.start()}function Av(r){return r.constructor.name==="MessagePort"}function Op(r){Av(r)&&r.close()}function tf(r,e){let t=new Map;return r.addEventListener("message",function(s){let{data:i}=s;if(!i||!i.id)return;let o=t.get(i.id);if(o)try{o(i)}finally{t.delete(i.id)}}),ef(r,t,[],e)}function ca(r){if(r)throw new Error("Proxy has been released and is not useable")}function Tp(r){return Bs(r,new Map,{type:"RELEASE"}).then(()=>{Op(r)})}var fa=new WeakMap,la="FinalizationRegistry"in globalThis&&new FinalizationRegistry(r=>{let e=(fa.get(r)||0)-1;fa.set(r,e),e===0&&Tp(r)});function Iv(r,e){let t=(fa.get(e)||0)+1;fa.set(e,t),la&&la.register(r,e,r)}function kv(r){la&&la.unregister(r)}function ef(r,e,t=[],n=function(){}){let s=!1,i=new Proxy(n,{get(o,c){if(ca(s),c===Rv)return()=>{kv(i),Tp(r),e.clear(),s=!0};if(c==="then"){if(t.length===0)return{then:()=>i};let u=Bs(r,e,{type:"GET",path:t.map(p=>p.toString())}).then(ts);return u.then.bind(u)}return ef(r,e,[...t,c])},set(o,c,u){ca(s);let[p,m]=da(u);return Bs(r,e,{type:"SET",path:[...t,c].map(b=>b.toString()),value:p},m).then(ts)},apply(o,c,u){ca(s);let p=t[t.length-1];if(p===Ev)return Bs(r,e,{type:"ENDPOINT"}).then(ts);if(p==="bind")return ef(r,e,t.slice(0,-1));let[m,b]=Sp(u);return Bs(r,e,{type:"APPLY",path:t.map(x=>x.toString()),argumentList:m},b).then(ts)},construct(o,c){ca(s);let[u,p]=Sp(c);return Bs(r,e,{type:"CONSTRUCT",path:t.map(m=>m.toString()),argumentList:u},p).then(ts)}});return Iv(i,r),i}function Ov(r){return Array.prototype.concat.apply([],r)}function Sp(r){let e=r.map(da);return[e.map(t=>t[0]),Ov(e.map(t=>t[1]))]}var Np=new WeakMap;function Tv(r,e){return Np.set(r,e),r}function Nv(r){return Object.assign(r,{[xp]:!0})}function Lp(r,e=globalThis,t="*"){return{postMessage:(n,s)=>r.postMessage(n,t,s),addEventListener:e.addEventListener.bind(e),removeEventListener:e.removeEventListener.bind(e)}}function da(r){for(let[e,t]of Ip)if(t.canHandle(r)){let[n,s]=t.serialize(r);return[{type:"HANDLER",name:e,value:n},s]}return[{type:"RAW",value:r},Np.get(r)||[]]}function ts(r){switch(r.type){case"HANDLER":return Ip.get(r.name).deserialize(r.value);case"RAW":return r.value}}function Bs(r,e,t,n){return new Promise(s=>{let i=Lv();e.set(i,s),r.start&&r.start(),r.postMessage(Object.assign({id:i},t),n)})}function Lv(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}var Bv={postMessage(){},addEventListener:()=>{},removeEventListener:()=>{}},Cv={postMessage:r=>{window.ReactNativeWebView.postMessage(JSON.stringify(r))},addEventListener:(r,e,...t)=>{document.addEventListener("FarcasterFrameCallback",e,...t)},removeEventListener:(r,e)=>{document.removeEventListener("FarcasterFrameCallback",e)}},Bp=typeof window>"u"?Bv:window?.ReactNativeWebView?Cv:Lp(window?.parent??window);var ie=tf(Bp);var rf=Ep(),Pv=vp();function Mv({code:r,details:e}){switch(r){case 4001:return new Ii;case 4100:return new ki;case 4200:return new Oi;case 4900:return new Ti;case 4901:return new Ni;default:return new vr(r,e??"Unknown provider RPC error")}}var Cs=Rp({...rf,async request(r){let e=Pv.prepare(r);try{let t=await ie.ethProviderRequestV2(e).then(n=>aa(n,{request:e,raw:!0}));if(t.error)throw Mv(t.error);return t.result}catch(t){if(t instanceof Error&&t.message.match(/cannot read property 'apply'/i))return await ie.ethProviderRequest(e);throw t instanceof vr||t instanceof At?t:new es({message:t instanceof Error?t.message:void 0})}}});async function Cp(){try{let r=await ie.getCapabilities();return!r.includes("wallet.getEthereumProvider")&&!r.includes("wallet.getEvmProvider")?void 0:Cs}catch{return Cs}}function Pp(r){let e=new CustomEvent("eip6963:announceProvider",{detail:Object.freeze(r)});window.dispatchEvent(e);let t=()=>window.dispatchEvent(e);return window.addEventListener("eip6963:requestProvider",t),()=>window.removeEventListener("eip6963:requestProvider",t)}typeof document<"u"&&(document.addEventListener("eip6963:requestProvider",()=>{ie.eip6963RequestProvider()}),document.addEventListener("FarcasterFrameEthProviderEvent",r=>{if(r instanceof MessageEvent){let e=r.data;rf.emit(e.event,...e.params)}}),document.addEventListener("FarcasterFrameEvent",r=>{if(r instanceof MessageEvent){let e=r.data;e.event==="eip6963:announceProvider"&&Pp({info:e.info,provider:Cs})}}));typeof window<"u"&&(window.addEventListener("eip6963:requestProvider",()=>{ie.eip6963RequestProvider()}),window.addEventListener("message",r=>{if(r instanceof MessageEvent&&r.data.type==="frameEthProviderEvent"){let e=r.data;rf.emit(e.event,...e.params)}}),window.addEventListener("message",r=>{if(r instanceof MessageEvent&&r.data.type==="frameEvent"){let e=r.data.event;e.event==="eip6963:announceProvider"&&Pp({info:e.info,provider:Cs})}}));var _f={};Qt(_f,{quickAuth:()=>Ms});var Uv=new TextEncoder,ha=new TextDecoder,pk=2**32;var Dv=r=>{let e=atob(r),t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t},Mp=r=>{let e=r;e instanceof Uint8Array&&(e=ha.decode(e)),e=e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return Dv(e)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}};var Up=Mp;function Fv(r){return typeof r=="object"&&r!==null}function nf(r){if(!Fv(r)||Object.prototype.toString.call(r)!=="[object Object]")return!1;if(Object.getPrototypeOf(r)===null)return!0;let e=r;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(r)===e}var It=class extends Error{constructor(e,t){super(e,t),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}};It.code="ERR_JOSE_GENERIC";var sf=class extends It{constructor(e,t,n="unspecified",s="unspecified"){super(e,{cause:{claim:n,reason:s,payload:t}}),this.code="ERR_JWT_CLAIM_VALIDATION_FAILED",this.claim=n,this.reason=s,this.payload=t}};sf.code="ERR_JWT_CLAIM_VALIDATION_FAILED";var of=class extends It{constructor(e,t,n="unspecified",s="unspecified"){super(e,{cause:{claim:n,reason:s,payload:t}}),this.code="ERR_JWT_EXPIRED",this.claim=n,this.reason=s,this.payload=t}};of.code="ERR_JWT_EXPIRED";var af=class extends It{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}};af.code="ERR_JOSE_ALG_NOT_ALLOWED";var cf=class extends It{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}};cf.code="ERR_JOSE_NOT_SUPPORTED";var uf=class extends It{constructor(e="decryption operation failed",t){super(e,t),this.code="ERR_JWE_DECRYPTION_FAILED"}};uf.code="ERR_JWE_DECRYPTION_FAILED";var ff=class extends It{constructor(){super(...arguments),this.code="ERR_JWE_INVALID"}};ff.code="ERR_JWE_INVALID";var lf=class extends It{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}};lf.code="ERR_JWS_INVALID";var hr=class extends It{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}};hr.code="ERR_JWT_INVALID";var df=class extends It{constructor(){super(...arguments),this.code="ERR_JWK_INVALID"}};df.code="ERR_JWK_INVALID";var hf=class extends It{constructor(){super(...arguments),this.code="ERR_JWKS_INVALID"}};hf.code="ERR_JWKS_INVALID";var pf=class extends It{constructor(e="no applicable key found in the JSON Web Key Set",t){super(e,t),this.code="ERR_JWKS_NO_MATCHING_KEY"}};pf.code="ERR_JWKS_NO_MATCHING_KEY";var mf=class extends It{constructor(e="multiple matching keys found in the JSON Web Key Set",t){super(e,t),this.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS"}};mf.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";var gf=class extends It{constructor(e="request timed out",t){super(e,t),this.code="ERR_JWKS_TIMEOUT"}};gf.code="ERR_JWKS_TIMEOUT";var yf=class extends It{constructor(e="signature verification failed",t){super(e,t),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}};yf.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";function Dp(r){if(typeof r!="string")throw new hr("JWTs must use Compact JWS serialization, JWT must be a string");let{1:e,length:t}=r.split(".");if(t===5)throw new hr("Only JWTs using Compact JWS serialization can be decoded");if(t!==3)throw new hr("Invalid JWT");if(!e)throw new hr("JWTs must contain a payload");let n;try{n=Up(e)}catch{throw new hr("Failed to base64url decode the payload")}let s;try{s=JSON.parse(ha.decode(n))}catch{throw new hr("Failed to parse the decoded payload as JSON")}if(!nf(s))throw new hr("Invalid JWT Claims Set");return s}function zp(r){return Dp(r)}var pa=class r extends Error{constructor(e,t={}){let n=(()=>{if(t.cause instanceof r){if(t.cause.details)return t.cause.details;if(t.cause.shortMessage)return t.cause.shortMessage}return t.cause&&"details"in t.cause&&typeof t.cause.details=="string"?t.cause.details:t.cause?.message?t.cause.message:t.details})(),s=[e||"An error occurred.",...t.metaMessages?["",...t.metaMessages]:[],...n?["",n?`Details: ${n}`:void 0]:[]].filter(i=>typeof i=="string").join(`
|
|
14
|
-
`);super(
|
|
15
|
-
- `).slice(1);return{...
|
|
44
|
+
For a list of runtimes that currently support Ed25519 operations, visit https://github.com/WICG/webcrypto-secure-curves/issues/20.`,[_$]:"No signature verification implementation could be found.",[v$]:"No key generation implementation could be found.",[b$]:"No signing implementation could be found.",[w$]:"No key export implementation could be found.",[OA]:"Timestamp value must be in the range [-(2n ** 63n), (2n ** 63n) - 1]. `$value` given",[RT]:"Transaction processing left an account with an outstanding borrowed reference",[fT]:"Account in use",[hT]:"Account loaded twice",[pT]:"Attempt to debit an account but found no record of a prior credit.",[LT]:"Transaction loads an address table account that doesn't exist",[_T]:"This transaction has already been processed",[vT]:"Blockhash not found",[bT]:"Loader call chain is too deep",[kT]:"Transactions are currently disabled due to cluster maintenance",[jT]:"Transaction contains a duplicate instruction ($index) that is not allowed",[gT]:"Insufficient funds for fee",[FT]:"Transaction results in an account ($accountIndex) with insufficient funds for rent",[yT]:"This account may not be used to pay transaction fees",[xT]:"Transaction contains an invalid account reference",[BT]:"Transaction loads an address table account with invalid data",[UT]:"Transaction address table lookup uses an invalid index",[zT]:"Transaction loads an address table account with an invalid owner",[VT]:"LoadedAccountsDataSizeLimit set for transaction must be greater than 0.",[ET]:"This program may not be used for executing instructions",[CT]:"Transaction leaves an account with a lower balance than rent-exempt minimum",[OT]:"Transaction loads a writable account that cannot be written",[ZT]:"Transaction exceeded max loaded accounts data size cap",[wT]:"Transaction requires a fee but has no signature present",[mT]:"Attempt to load a program that does not exist",[WT]:"Execution of the program referenced by account at index $accountIndex is temporarily restricted.",[KT]:"ResanitizationNeeded",[IT]:"Transaction failed to sanitize accounts offsets correctly",[ST]:"Transaction did not pass signature verification",[PT]:"Transaction locked too many accounts",[qT]:"Sum of account balances before and after transaction do not match",[dT]:"The transaction failed with the error `$errorName`",[$T]:"Transaction version is unsupported",[NT]:"Transaction would exceed account data limit within the block",[MT]:"Transaction would exceed total account data limit",[TT]:"Transaction would exceed max account limit within the block",[AT]:"Transaction would exceed max Block Cost Limit",[DT]:"Transaction would exceed max Vote Cost Limit",[aT]:"Attempted to sign a transaction with an address that is not a signer for it",[tT]:"Transaction is missing an address at index: $index.",[sT]:"Transaction has no expected signers therefore it cannot be encoded",[qO]:"Transaction does not have a blockhash lifetime",[GO]:"Transaction is not a durable nonce transaction",[JO]:"Contents of these address lookup tables unknown: $lookupTableAddresses",[YO]:"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",[QO]:"No fee payer set in CompiledTransaction",[XO]:"Could not find program address at index $index",[uT]:"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",[lT]:"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",[rT]:"Transaction is missing a fee payer.",[nT]:"Could not determine this transaction's signature. Make sure that the transaction has been signed by its fee payer.",[oT]:"Transaction first instruction is not advance nonce account instruction.",[iT]:"Transaction with no instructions cannot be durable nonce transaction.",[KO]:"This transaction includes an address (`$programAddress`) which is both invoked and set as the fee payer. Program addresses may not pay fees",[WO]:"This transaction includes an address (`$programAddress`) which is both invoked and marked writable. Program addresses may not be writable",[cT]:"The transaction message expected the transaction to have $signerAddressesLength signatures, got $signaturesLength.",[eT]:"Transaction is missing signatures for addresses: $addresses.",[HO]:"Transaction version must be in the range [0, 127]. `$actualVersion` given"};function wN(t,e={}){{let r=`Solana error #${t}; Decode this error by running \`npx @solana/errors decode -- ${t}`;return Object.keys(e).length&&(r+=` '${bN(e)}'`),`${r}\``}}var kn=class extends Error{cause=this.cause;context;constructor(...[t,e]){let r,i;if(e){let{cause:o,...a}=e;o&&(i={cause:o}),Object.keys(a).length>0&&(r=a)}let n=wN(t,r);super(n,i),this.context={__code:t,...r},this.name="SolanaError"}};function xN(t,e){return"fixedSize"in e?e.fixedSize:e.getSizeFromValue(t)}function ix(t){return Object.freeze({...t,encode:e=>{let r=new Uint8Array(xN(e,t));return t.write(e,r,0),r}})}function ox(t){return Object.freeze({...t,decode:(e,r=0)=>t.read(e,r)[0]})}function lo(t){return"fixedSize"in t&&typeof t.fixedSize=="number"}function ax(t,e){if(lo(t)!==lo(e))throw new kn(Zg);if(lo(t)&&lo(e)&&t.fixedSize!==e.fixedSize)throw new kn(Vg,{decoderFixedSize:e.fixedSize,encoderFixedSize:t.fixedSize});if(!lo(t)&&!lo(e)&&t.maxSize!==e.maxSize)throw new kn(Kg,{decoderMaxSize:e.maxSize,encoderMaxSize:t.maxSize});return{...e,...t,decode:e.decode,encode:t.encode,read:e.read,write:t.write}}function sx(t,e,r=0){if(e.length-r<=0)throw new kn(jg,{codecDescription:t})}function cx(t,e,r,i=0){let n=r.length-i;if(n<e)throw new kn(Fg,{bytesLength:n,codecDescription:t,expected:e})}function SN(t,e,r,i){if(i<e||i>r)throw new kn(Wg,{codecDescription:t,max:r,min:e,value:i})}function ux(t){return t?.endian!==1}function EN(t){return ix({fixedSize:t.size,write(e,r,i){t.range&&SN(t.name,t.range[0],t.range[1],e);let n=new ArrayBuffer(t.size);return t.set(new DataView(n),e,ux(t.config)),r.set(new Uint8Array(n),i),i+t.size}})}function IN(t){return ox({fixedSize:t.size,read(e,r=0){sx(t.name,e,r),cx(t.name,t.size,e,r);let i=new DataView(kN(e,r,t.size));return[t.get(i,ux(t.config)),r+t.size]}})}function kN(t,e,r){let i=t.byteOffset+(e??0),n=r??t.byteLength;return t.buffer.slice(i,i+n)}var qg=(t={})=>EN({config:t,name:"u64",range:[0n,BigInt("0xffffffffffffffff")],set:(e,r,i)=>e.setBigUint64(0,BigInt(r),i),size:8}),RN=(t={})=>IN({config:t,get:(e,r)=>e.getBigUint64(0,r),name:"u64",size:8}),lx=(t={})=>ax(qg(t),RN(t));var Gg=class extends TypeError{constructor(e,r){let i,{message:n,explanation:o,...a}=e,{path:s}=e,c=s.length===0?n:`At path: ${s.join(".")} -- ${n}`;super(o??c),o!=null&&(this.cause=c),Object.assign(this,a),this.name=this.constructor.name,this.failures=()=>i??(i=[e,...r()])}};function AN(t){return pa(t)&&typeof t[Symbol.iterator]=="function"}function pa(t){return typeof t=="object"&&t!=null}function $u(t){return pa(t)&&!Array.isArray(t)}function Er(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function $N(t){let{done:e,value:r}=t.next();return e?void 0:r}function ON(t,e,r,i){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});let{path:n,branch:o}=e,{type:a}=r,{refinement:s,message:c=`Expected a value of type \`${a}\`${s?` with refinement \`${s}\``:""}, but received: \`${Er(i)}\``}=t;return{value:i,type:a,refinement:s,key:n[n.length-1],path:n,branch:o,...t,message:c}}function*dx(t,e,r,i){AN(t)||(t=[t]);for(let n of t){let o=ON(n,e,r,i);o&&(yield o)}}function*Hg(t,e,r={}){let{path:i=[],branch:n=[t],coerce:o=!1,mask:a=!1}=r,s={path:i,branch:n,mask:a};o&&(t=e.coercer(t,s));let c="valid";for(let l of e.validator(t,s))l.explanation=r.message,c="not_valid",yield[l,void 0];for(let[l,h,g]of e.entries(t,s)){let w=Hg(h,g,{path:l===void 0?i:[...i,l],branch:l===void 0?n:[...n,h],coerce:o,mask:a,message:r.message});for(let v of w)v[0]?(c=v[0].refinement!=null?"not_refined":"not_valid",yield[v[0],void 0]):o&&(h=v[1],l===void 0?t=h:t instanceof Map?t.set(l,h):t instanceof Set?t.add(h):pa(t)&&(h!==void 0||l in t)&&(t[l]=h))}if(c!=="not_valid")for(let l of e.refiner(t,s))l.explanation=r.message,c="not_refined",yield[l,void 0];c==="valid"&&(yield[void 0,t])}var yr=class{constructor(e){let{type:r,schema:i,validator:n,refiner:o,coercer:a=c=>c,entries:s=function*(){}}=e;this.type=r,this.schema=i,this.entries=s,this.coercer=a,n?this.validator=(c,l)=>{let h=n(c,l);return dx(h,l,this,c)}:this.validator=()=>[],o?this.refiner=(c,l)=>{let h=o(c,l);return dx(h,l,this,c)}:this.refiner=()=>[]}assert(e,r){return fx(e,this,r)}create(e,r){return G(e,this,r)}is(e){return hx(e,this)}mask(e,r){return TN(e,this,r)}validate(e,r={}){return ma(e,this,r)}};function fx(t,e,r){let i=ma(t,e,{message:r});if(i[0])throw i[0]}function G(t,e,r){let i=ma(t,e,{coerce:!0,message:r});if(i[0])throw i[0];return i[1]}function TN(t,e,r){let i=ma(t,e,{coerce:!0,mask:!0,message:r});if(i[0])throw i[0];return i[1]}function hx(t,e){return!ma(t,e)[0]}function ma(t,e,r={}){let i=Hg(t,e,r),n=$N(i);return n[0]?[new Gg(n[0],function*(){for(let a of i)a[0]&&(yield a[0])}),void 0]:[void 0,n[1]]}function ni(t,e){return new yr({type:t,schema:null,validator:e})}function px(){return ni("any",()=>!0)}function H(t){return new yr({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: ${Er(e)}`}})}function Ir(){return ni("boolean",t=>typeof t=="boolean")}function Ou(t){return ni("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${Er(e)}`)}function je(t){let e=Er(t),r=typeof t;return new yr({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(i){return i===t||`Expected the literal \`${e}\`, but received: ${Er(i)}`}})}function NN(){return ni("never",()=>!1)}function Y(t){return new yr({...t,validator:(e,r)=>e===null||t.validator(e,r),refiner:(e,r)=>e===null||t.refiner(e,r)})}function O(){return ni("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${Er(t)}`)}function ae(t){return new yr({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function Jg(t,e){return new yr({type:"record",schema:null,*entries(r){if(pa(r))for(let i in r){let n=r[i];yield[i,i,t],yield[i,n,e]}},validator(r){return $u(r)||`Expected an object, but received: ${Er(r)}`},coercer(r){return $u(r)?{...r}:r}})}function K(){return ni("string",t=>typeof t=="string"||`Expected a string, but received: ${Er(t)}`)}function Tu(t){let e=NN();return new yr({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: ${Er(r)}`},coercer(r){return Array.isArray(r)?r.slice():r}})}function U(t){let e=Object.keys(t);return new yr({type:"type",schema:t,*entries(r){if(pa(r))for(let i of e)yield[i,r[i],t[i]]},validator(r){return $u(r)||`Expected an object, but received: ${Er(r)}`},coercer(r){return $u(r)?{...r}:r}})}function Ct(t){let e=t.map(r=>r.type).join(" | ");return new yr({type:"union",schema:null,coercer(r,i){for(let n of t){let[o,a]=n.validate(r,{coerce:!0,mask:i.mask});if(!o)return a}return r},validator(r,i){let n=[];for(let o of t){let[...a]=Hg(r,o,i),[s]=a;if(s[0])for(let[c]of a)c&&n.push(c);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${Er(r)}`,...n]}})}function ii(){return ni("unknown",()=>!0)}function fo(t,e,r){return new yr({...t,coercer:(i,n)=>hx(i,e)?t.coercer(r(i,n),n):t.coercer(i,n)})}var SS=Cr(Cx());var Fx=Cr(na(),1);var oi=Cr(Mx(),1);var jx=oi.default;var i2=class extends oi.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 Zx(t,e){return new i2(t,e)}var o2=class{encode(t){return JSON.stringify(t)}decode(t){return JSON.parse(t)}},Vx=class extends oi.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,...a}={},s,c){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=a,this.current_reconnects=0,this.generate_request_id=s||(()=>typeof this.rpc_id=="number"?++this.rpc_id:Number(this.rpc_id)+1),c?this.dataPack=c:this.dataPack=new o2,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 a=this.generate_request_id(t,e),s={jsonrpc:"2.0",method:t,params:e||void 0,id:a};this.socket.send(this.dataPack.encode(s),i,c=>{if(c)return o(c);this.queue[a]={promise:[n,o]},r&&(this.queue[a].timeout=setTimeout(()=>{delete this.queue[a],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=Fx.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 qx=[],Gx=[],Hx=[],a2=BigInt(0),wa=BigInt(1),s2=BigInt(2),c2=BigInt(7),u2=BigInt(256),l2=BigInt(113);for(let t=0,e=wa,r=1,i=0;t<24;t++){[r,i]=[i,(2*r+3*i)%5],qx.push(2*(5*i+r)),Gx.push((t+1)*(t+2)/2%64);let n=a2;for(let o=0;o<7;o++)e=(e<<wa^(e>>c2)*l2)%u2,e&s2&&(n^=wa<<(wa<<BigInt(o))-wa);Hx.push(n)}var[d2,f2]=sg(Hx,!0),Kx=(t,e,r)=>r>32?lg(t,e,r):cg(t,e,r),Wx=(t,e,r)=>r>32?dg(t,e,r):ug(t,e,r);function h2(t,e=24){let r=new Uint32Array(10);for(let i=24-e;i<24;i++){for(let a=0;a<10;a++)r[a]=t[a]^t[a+10]^t[a+20]^t[a+30]^t[a+40];for(let a=0;a<10;a+=2){let s=(a+8)%10,c=(a+2)%10,l=r[c],h=r[c+1],g=Kx(l,h,1)^r[s],w=Wx(l,h,1)^r[s+1];for(let v=0;v<50;v+=10)t[a+v]^=g,t[a+v+1]^=w}let n=t[2],o=t[3];for(let a=0;a<24;a++){let s=Gx[a],c=Kx(n,o,s),l=Wx(n,o,s),h=qx[a];n=t[h],o=t[h+1],t[h]=c,t[h+1]=l}for(let a=0;a<50;a+=10){for(let s=0;s<10;s++)r[s]=t[a+s];for(let s=0;s<10;s++)t[a+s]^=~r[(s+2)%10]&r[(s+4)%10]}t[0]^=d2[i],t[1]^=f2[i]}r.fill(0)}var Cu=class t extends pn{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,ia(i),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=yw(this.state)}keccak(){ng||ig(this.state32),h2(this.state32,this.rounds),ng||ig(this.state32),this.posOut=0,this.pos=0}update(e){Zr(this);let{blockLen:r,state:i}=this;e=mn(e);let n=e.length;for(let o=0;o<n;){let a=Math.min(r-this.pos,n-o);for(let s=0;s<a;s++)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){Zr(this,!1),hn(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 a=Math.min(i-this.posOut,o-n);e.set(r.subarray(this.posOut,this.posOut+a),n),this.posOut+=a,n+=a}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return ia(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(Vc(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:a}=this;return e||(e=new t(r,i,n,a,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=a,e.destroyed=this.destroyed,e}},On=(t,e,r)=>no(()=>new Cu(e,t,r)),aC=On(6,144,224/8),sC=On(6,136,256/8),cC=On(6,104,384/8),uC=On(6,72,512/8),lC=On(1,144,224/8),s0=On(1,136,256/8),dC=On(1,104,384/8),fC=On(1,72,512/8),Jx=(t,e,r)=>vw((i={})=>new Cu(e,t,i.dkLen===void 0?r:i.dkLen,!0)),hC=Jx(31,168,128/8),pC=Jx(31,136,256/8);var Du=class extends pn{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,gw(e);let i=mn(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 a=0;a<o.length;a++)o[a]^=54;this.iHash.update(o),this.oHash=e.create();for(let a=0;a<o.length;a++)o[a]^=106;this.oHash.update(o),o.fill(0)}update(e){return Zr(this),this.iHash.update(e),this}digestInto(e){Zr(this),hn(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:a,outputLen:s}=this;return e=e,e.finished=n,e.destroyed=o,e.blockLen=a,e.outputLen=s,e.oHash=r._cloneInto(e.oHash),e.iHash=i._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},c0=(t,e,r)=>new Du(t,e).update(r).digest();c0.create=(t,e)=>new Du(t,e);function Yx(t){t.lowS!==void 0&&xr("lowS",t.lowS),t.prehash!==void 0&&xr("prehash",t.prehash)}function p2(t){let e=sa(t);Lr(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:m2,hexToBytes:g2}=Jc,u0=class extends Error{constructor(e=""){super(e)}},Jr={Err:u0,_tlv:{encode:(t,e)=>{let{Err:r}=Jr;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=Gn(i);if(n.length/2&128)throw new r("tlv.encode: long form length too big");let o=i>127?Gn(n.length/2|128):"";return Gn(t)+o+n+e},decode(t,e){let{Err:r}=Jr,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),a=0;if(!o)a=n;else{let c=n&127;if(!c)throw new r("tlv.decode(long): indefinite length not supported");if(c>4)throw new r("tlv.decode(long): byte length is too big");let l=e.subarray(i,i+c);if(l.length!==c)throw new r("tlv.decode: length bytes not complete");if(l[0]===0)throw new r("tlv.decode(long): zero leftmost byte");for(let h of l)a=a<<8|h;if(i+=c,a<128)throw new r("tlv.decode(long): not minimal encoding")}let s=e.subarray(i,i+a);if(s.length!==a)throw new r("tlv.decode: wrong value length");return{v:s,l:e.subarray(i+a)}}},_int:{encode(t){let{Err:e}=Jr;if(t<Yr)throw new e("integer: negative integers are not allowed");let r=Gn(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}=Jr;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 m2(t)}},toSig(t){let{Err:e,_int:r,_tlv:i}=Jr,n=typeof t=="string"?g2(t):t;oo(n);let{v:o,l:a}=i.decode(48,n);if(a.length)throw new e("invalid signature: left bytes after parsing");let{v:s,l:c}=i.decode(2,o),{v:l,l:h}=i.decode(2,c);if(h.length)throw new e("invalid signature: left bytes after parsing");return{r:r.decode(s),s:r.decode(l)}},hexFromSig(t){let{_tlv:e,_int:r}=Jr,i=e.encode(2,r.encode(t.r)),n=e.encode(2,r.encode(t.s)),o=i+n;return e.encode(48,o)}},Yr=BigInt(0),At=BigInt(1),xC=BigInt(2),Xx=BigInt(3),SC=BigInt(4);function y2(t){let e=p2(t),{Fp:r}=e,i=wn(e.n,e.nBitLength),n=e.toBytes||((k,R,z)=>{let F=R.toAffine();return qr(Uint8Array.from([4]),r.toBytes(F.x),r.toBytes(F.y))}),o=e.fromBytes||(k=>{let R=k.subarray(1),z=r.fromBytes(R.subarray(0,r.BYTES)),F=r.fromBytes(R.subarray(r.BYTES,2*r.BYTES));return{x:z,y:F}});function a(k){let{a:R,b:z}=e,F=r.sqr(k),P=r.mul(F,k);return r.add(r.add(P,r.mul(k,R)),z)}if(!r.eql(r.sqr(e.Gy),a(e.Gx)))throw new Error("bad generator point: equation left != right");function s(k){return oa(k,At,e.n)}function c(k){let{allowedPrivateKeyLengths:R,nByteLength:z,wrapPrivateKey:F,n:P}=e;if(R&&typeof k!="bigint"){if(_n(k)&&(k=Kr(k)),typeof k!="string"||!R.includes(k.length))throw new Error("invalid private key");k=k.padStart(z*2,"0")}let C;try{C=typeof k=="bigint"?k:Wr(Ge("private key",k,z))}catch{throw new Error("invalid private key, expected hex or "+z+" bytes, got "+typeof k)}return F&&(C=Ne(C,P)),nr("private key",C,At,P),C}function l(k){if(!(k instanceof w))throw new Error("ProjectivePoint expected")}let h=Yn((k,R)=>{let{px:z,py:F,pz:P}=k;if(r.eql(P,r.ONE))return{x:z,y:F};let C=k.is0();R==null&&(R=C?r.ONE:r.inv(P));let ee=r.mul(z,R),X=r.mul(F,R),Q=r.mul(P,R);if(C)return{x:r.ZERO,y:r.ZERO};if(!r.eql(Q,r.ONE))throw new Error("invZ was invalid");return{x:ee,y:X}}),g=Yn(k=>{if(k.is0()){if(e.allowInfinityPoint&&!r.is0(k.py))return;throw new Error("bad point: ZERO")}let{x:R,y:z}=k.toAffine();if(!r.isValid(R)||!r.isValid(z))throw new Error("bad point: x or y not FE");let F=r.sqr(z),P=a(R);if(!r.eql(F,P))throw new Error("bad point: equation left != right");if(!k.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class w{constructor(R,z,F){if(this.px=R,this.py=z,this.pz=F,R==null||!r.isValid(R))throw new Error("x required");if(z==null||!r.isValid(z))throw new Error("y required");if(F==null||!r.isValid(F))throw new Error("z required");Object.freeze(this)}static fromAffine(R){let{x:z,y:F}=R||{};if(!R||!r.isValid(z)||!r.isValid(F))throw new Error("invalid affine point");if(R instanceof w)throw new Error("projective point not allowed");let P=C=>r.eql(C,r.ZERO);return P(z)&&P(F)?w.ZERO:new w(z,F,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(R){let z=r.invertBatch(R.map(F=>F.pz));return R.map((F,P)=>F.toAffine(z[P])).map(w.fromAffine)}static fromHex(R){let z=w.fromAffine(o(Ge("pointHex",R)));return z.assertValidity(),z}static fromPrivateKey(R){return w.BASE.multiply(c(R))}static msm(R,z){return eu(w,i,R,z)}_setWindowSize(R){$.setWindowSize(this,R)}assertValidity(){g(this)}hasEvenY(){let{y:R}=this.toAffine();if(r.isOdd)return!r.isOdd(R);throw new Error("Field doesn't support isOdd")}equals(R){l(R);let{px:z,py:F,pz:P}=this,{px:C,py:ee,pz:X}=R,Q=r.eql(r.mul(z,X),r.mul(C,P)),ie=r.eql(r.mul(F,X),r.mul(ee,P));return Q&&ie}negate(){return new w(this.px,r.neg(this.py),this.pz)}double(){let{a:R,b:z}=e,F=r.mul(z,Xx),{px:P,py:C,pz:ee}=this,X=r.ZERO,Q=r.ZERO,ie=r.ZERO,te=r.mul(P,P),$e=r.mul(C,C),oe=r.mul(ee,ee),he=r.mul(P,C);return he=r.add(he,he),ie=r.mul(P,ee),ie=r.add(ie,ie),X=r.mul(R,ie),Q=r.mul(F,oe),Q=r.add(X,Q),X=r.sub($e,Q),Q=r.add($e,Q),Q=r.mul(X,Q),X=r.mul(he,X),ie=r.mul(F,ie),oe=r.mul(R,oe),he=r.sub(te,oe),he=r.mul(R,he),he=r.add(he,ie),ie=r.add(te,te),te=r.add(ie,te),te=r.add(te,oe),te=r.mul(te,he),Q=r.add(Q,te),oe=r.mul(C,ee),oe=r.add(oe,oe),te=r.mul(oe,he),X=r.sub(X,te),ie=r.mul(oe,$e),ie=r.add(ie,ie),ie=r.add(ie,ie),new w(X,Q,ie)}add(R){l(R);let{px:z,py:F,pz:P}=this,{px:C,py:ee,pz:X}=R,Q=r.ZERO,ie=r.ZERO,te=r.ZERO,$e=e.a,oe=r.mul(e.b,Xx),he=r.mul(z,C),S=r.mul(F,ee),u=r.mul(P,X),f=r.add(z,F),p=r.add(C,ee);f=r.mul(f,p),p=r.add(he,S),f=r.sub(f,p),p=r.add(z,P);let m=r.add(C,X);return p=r.mul(p,m),m=r.add(he,u),p=r.sub(p,m),m=r.add(F,P),Q=r.add(ee,X),m=r.mul(m,Q),Q=r.add(S,u),m=r.sub(m,Q),te=r.mul($e,p),Q=r.mul(oe,u),te=r.add(Q,te),Q=r.sub(S,te),te=r.add(S,te),ie=r.mul(Q,te),S=r.add(he,he),S=r.add(S,he),u=r.mul($e,u),p=r.mul(oe,p),S=r.add(S,u),u=r.sub(he,u),u=r.mul($e,u),p=r.add(p,u),he=r.mul(S,p),ie=r.add(ie,he),he=r.mul(m,p),Q=r.mul(f,Q),Q=r.sub(Q,he),he=r.mul(f,S),te=r.mul(m,te),te=r.add(te,he),new w(Q,ie,te)}subtract(R){return this.add(R.negate())}is0(){return this.equals(w.ZERO)}wNAF(R){return $.wNAFCached(this,R,w.normalizeZ)}multiplyUnsafe(R){let{endo:z,n:F}=e;nr("scalar",R,Yr,F);let P=w.ZERO;if(R===Yr)return P;if(this.is0()||R===At)return this;if(!z||$.hasPrecomputes(this))return $.wNAFCachedUnsafe(this,R,w.normalizeZ);let{k1neg:C,k1:ee,k2neg:X,k2:Q}=z.splitScalar(R),ie=P,te=P,$e=this;for(;ee>Yr||Q>Yr;)ee&At&&(ie=ie.add($e)),Q&At&&(te=te.add($e)),$e=$e.double(),ee>>=At,Q>>=At;return C&&(ie=ie.negate()),X&&(te=te.negate()),te=new w(r.mul(te.px,z.beta),te.py,te.pz),ie.add(te)}multiply(R){let{endo:z,n:F}=e;nr("scalar",R,At,F);let P,C;if(z){let{k1neg:ee,k1:X,k2neg:Q,k2:ie}=z.splitScalar(R),{p:te,f:$e}=this.wNAF(X),{p:oe,f:he}=this.wNAF(ie);te=$.constTimeNegate(ee,te),oe=$.constTimeNegate(Q,oe),oe=new w(r.mul(oe.px,z.beta),oe.py,oe.pz),P=te.add(oe),C=$e.add(he)}else{let{p:ee,f:X}=this.wNAF(R);P=ee,C=X}return w.normalizeZ([P,C])[0]}multiplyAndAddUnsafe(R,z,F){let P=w.BASE,C=(X,Q)=>Q===Yr||Q===At||!X.equals(P)?X.multiplyUnsafe(Q):X.multiply(Q),ee=C(this,z).add(C(R,F));return ee.is0()?void 0:ee}toAffine(R){return h(this,R)}isTorsionFree(){let{h:R,isTorsionFree:z}=e;if(R===At)return!0;if(z)return z(w,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:R,clearCofactor:z}=e;return R===At?this:z?z(w,this):this.multiplyUnsafe(e.h)}toRawBytes(R=!0){return xr("isCompressed",R),this.assertValidity(),n(w,this,R)}toHex(R=!0){return xr("isCompressed",R),Kr(this.toRawBytes(R))}}w.BASE=new w(e.Gx,e.Gy,r.ONE),w.ZERO=new w(r.ZERO,r.ONE,r.ZERO);let v=e.nBitLength,$=Qc(w,e.endo?Math.ceil(v/2):v);return{CURVE:e,ProjectivePoint:w,normPrivateKeyToScalar:c,weierstrassEquation:a,isWithinCurveOrder:s}}function _2(t){let e=sa(t);return Lr(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function Qx(t){let e=_2(t),{Fp:r,n:i}=e,n=r.BYTES+1,o=2*r.BYTES+1;function a(u){return Ne(u,i)}function s(u){return Yc(u,i)}let{ProjectivePoint:c,normPrivateKeyToScalar:l,weierstrassEquation:h,isWithinCurveOrder:g}=y2({...e,toBytes(u,f,p){let m=f.toAffine(),y=r.toBytes(m.x),x=qr;return xr("isCompressed",p),p?x(Uint8Array.from([f.hasEvenY()?2:3]),y):x(Uint8Array.from([4]),y,r.toBytes(m.y))},fromBytes(u){let f=u.length,p=u[0],m=u.subarray(1);if(f===n&&(p===2||p===3)){let y=Wr(m);if(!oa(y,At,r.ORDER))throw new Error("Point is not on curve");let x=h(y),I;try{I=r.sqrt(x)}catch(b){let B=b instanceof Error?": "+b.message:"";throw new Error("Point is not on curve"+B)}let _=(I&At)===At;return(p&1)===1!==_&&(I=r.neg(I)),{x:y,y:I}}else if(f===o&&p===4){let y=r.fromBytes(m.subarray(0,r.BYTES)),x=r.fromBytes(m.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=u=>Kr(bn(u,e.nByteLength));function v(u){let f=i>>At;return u>f}function $(u){return v(u)?a(-u):u}let k=(u,f,p)=>Wr(u.slice(f,p));class R{constructor(f,p,m){this.r=f,this.s=p,this.recovery=m,this.assertValidity()}static fromCompact(f){let p=e.nByteLength;return f=Ge("compactSignature",f,p*2),new R(k(f,0,p),k(f,p,2*p))}static fromDER(f){let{r:p,s:m}=Jr.toSig(Ge("DER",f));return new R(p,m)}assertValidity(){nr("r",this.r,At,i),nr("s",this.s,At,i)}addRecoveryBit(f){return new R(this.r,this.s,f)}recoverPublicKey(f){let{r:p,s:m,recovery:y}=this,x=X(Ge("msgHash",f));if(y==null||![0,1,2,3].includes(y))throw new Error("recovery id invalid");let I=y===2||y===3?p+e.n:p;if(I>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");let _=(y&1)===0?"02":"03",d=c.fromHex(_+w(I)),b=s(I),B=a(-x*b),V=a(m*b),W=c.BASE.multiplyAndAddUnsafe(d,B,V);if(!W)throw new Error("point at infinify");return W.assertValidity(),W}hasHighS(){return v(this.s)}normalizeS(){return this.hasHighS()?new R(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Hn(this.toDERHex())}toDERHex(){return Jr.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Hn(this.toCompactHex())}toCompactHex(){return w(this.r)+w(this.s)}}let z={isValidPrivateKey(u){try{return l(u),!0}catch{return!1}},normPrivateKeyToScalar:l,randomPrivateKey:()=>{let u=wg(e.n);return Ow(e.randomBytes(u),e.n)},precompute(u=8,f=c.BASE){return f._setWindowSize(u),f.multiply(BigInt(3)),f}};function F(u,f=!0){return c.fromPrivateKey(u).toRawBytes(f)}function P(u){let f=_n(u),p=typeof u=="string",m=(f||p)&&u.length;return f?m===n||m===o:p?m===2*n||m===2*o:u instanceof c}function C(u,f,p=!0){if(P(u))throw new Error("first arg must be private key");if(!P(f))throw new Error("second arg must be public key");return c.fromHex(f).multiply(l(u)).toRawBytes(p)}let ee=e.bits2int||function(u){if(u.length>8192)throw new Error("input is too large");let f=Wr(u),p=u.length*8-e.nBitLength;return p>0?f>>BigInt(p):f},X=e.bits2int_modN||function(u){return a(ee(u))},Q=aa(e.nBitLength);function ie(u){return nr("num < 2^"+e.nBitLength,u,Yr,Q),bn(u,e.nByteLength)}function te(u,f,p=$e){if(["recovered","canonical"].some(ce=>ce in p))throw new Error("sign() legacy options not supported");let{hash:m,randomBytes:y}=e,{lowS:x,prehash:I,extraEntropy:_}=p;x==null&&(x=!0),u=Ge("msgHash",u),Yx(p),I&&(u=Ge("prehashed msgHash",m(u)));let d=X(u),b=l(f),B=[ie(b),ie(d)];if(_!=null&&_!==!1){let ce=_===!0?y(r.BYTES):_;B.push(Ge("extraEntropy",ce))}let V=qr(...B),W=d;function re(ce){let fe=ee(ce);if(!g(fe))return;let Ce=s(fe),me=c.BASE.multiply(fe).toAffine(),ye=a(me.x);if(ye===Yr)return;let ar=a(Ce*a(W+ye*b));if(ar===Yr)return;let ke=(me.x===ye?0:2)|Number(me.y&At),Be=ar;return x&&v(ar)&&(Be=$(ar),ke^=1),new R(ye,Be,ke)}return{seed:V,k2sig:re}}let $e={lowS:e.lowS,prehash:!1},oe={lowS:e.lowS,prehash:!1};function he(u,f,p=$e){let{seed:m,k2sig:y}=te(u,f,p),x=e;return yg(x.hash.outputLen,x.nByteLength,x.hmac)(m,y)}c.BASE._setWindowSize(8);function S(u,f,p,m=oe){let y=u;f=Ge("msgHash",f),p=Ge("publicKey",p);let{lowS:x,prehash:I,format:_}=m;if(Yx(m),"strict"in m)throw new Error("options.strict was renamed to lowS");if(_!==void 0&&_!=="compact"&&_!=="der")throw new Error("format must be compact or der");let d=typeof y=="string"||_n(y),b=!d&&!_&&typeof y=="object"&&y!==null&&typeof y.r=="bigint"&&typeof y.s=="bigint";if(!d&&!b)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let B,V;try{if(b&&(B=new R(y.r,y.s)),d){try{_!=="compact"&&(B=R.fromDER(y))}catch(ke){if(!(ke instanceof Jr.Err))throw ke}!B&&_!=="der"&&(B=R.fromCompact(y))}V=c.fromHex(p)}catch{return!1}if(!B||x&&B.hasHighS())return!1;I&&(f=e.hash(f));let{r:W,s:re}=B,ce=X(f),fe=s(re),Ce=a(ce*fe),me=a(W*fe),ye=c.BASE.multiplyAndAddUnsafe(V,Ce,me)?.toAffine();return ye?a(ye.x)===W:!1}return{CURVE:e,getPublicKey:F,getSharedSecret:C,sign:he,verify:S,ProjectivePoint:c,Signature:R,utils:z}}function v2(t){return{hash:t,hmac:(e,...r)=>c0(t,e,og(...r)),randomBytes:Wc}}function eS(t,e){let r=i=>Qx({...t,...v2(i)});return{...r(e),create:r}}var nS=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),tS=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),b2=BigInt(1),l0=BigInt(2),rS=(t,e)=>(t+e/l0)/e;function w2(t){let e=nS,r=BigInt(3),i=BigInt(6),n=BigInt(11),o=BigInt(22),a=BigInt(23),s=BigInt(44),c=BigInt(88),l=t*t*t%e,h=l*l*t%e,g=Me(h,r,e)*h%e,w=Me(g,r,e)*h%e,v=Me(w,l0,e)*l%e,$=Me(v,n,e)*v%e,k=Me($,o,e)*$%e,R=Me(k,s,e)*k%e,z=Me(R,c,e)*R%e,F=Me(z,s,e)*k%e,P=Me(F,r,e)*h%e,C=Me(P,a,e)*$%e,ee=Me(C,i,e)*l%e,X=Me(ee,l0,e);if(!d0.eql(d0.sqr(X),t))throw new Error("Cannot find square root");return X}var d0=wn(nS,void 0,void 0,{sqrt:w2}),xa=eS({a:BigInt(0),b:BigInt(7),Fp:d0,n:tS,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{let e=tS,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),i=-b2*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),n=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,a=BigInt("0x100000000000000000000000000000000"),s=rS(o*t,e),c=rS(-i*t,e),l=Ne(t-s*r-c*n,e),h=Ne(-s*i-c*o,e),g=l>a,w=h>a;if(g&&(l=e-l),w&&(h=e-h),l>a||h>a)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:g,k1:l,k2neg:w,k2:h}}}},ca),NC=BigInt(0);var PC=xa.ProjectivePoint;var FC=Qn.utils.randomPrivateKey,iS=()=>{let t=Qn.utils.randomPrivateKey(),e=w0(t),r=new Uint8Array(64);return r.set(t),r.set(e,32),{publicKey:e,secretKey:r}},w0=Qn.getPublicKey;function oS(t){try{return Qn.ExtendedPoint.fromHex(t),!0}catch{return!1}}var z0=(t,e)=>Qn.sign(t,e.slice(0,32)),x2=Qn.verify,we=t=>ue.Buffer.isBuffer(t)?t:t instanceof Uint8Array?ue.Buffer.from(t.buffer,t.byteOffset,t.byteLength):ue.Buffer.from(t),x0=class{constructor(e){Object.assign(this,e)}encode(){return ue.Buffer.from((0,go.serialize)(Fu,this))}static decode(e){return(0,go.deserialize)(Fu,this,e)}static decodeUnchecked(e){return(0,go.deserializeUnchecked)(Fu,this,e)}};var Fu=new Map,ES,S2=32,Pn=32;function E2(t){return t._bn!==void 0}var aS=1,de=class t extends x0{constructor(e){if(super({}),this._bn=void 0,E2(e))this._bn=e._bn;else{if(typeof e=="string"){let r=$t.default.decode(e);if(r.length!=Pn)throw new Error("Invalid public key input");this._bn=new b0.default(r)}else this._bn=new b0.default(e);if(this._bn.byteLength()>Pn)throw new Error("Invalid public key input")}}static unique(){let e=new t(aS);return aS+=1,new t(e.toBuffer())}equals(e){return this._bn.eq(e._bn)}toBase58(){return $t.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(ue.Buffer);if(e.length===Pn)return e;let r=ue.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=ue.Buffer.concat([e.toBuffer(),ue.Buffer.from(r),i.toBuffer()]),o=ca(n);return new t(o)}static createProgramAddressSync(e,r){let i=ue.Buffer.alloc(0);e.forEach(function(o){if(o.length>S2)throw new TypeError("Max seed length exceeded");i=ue.Buffer.concat([i,we(o)])}),i=ue.Buffer.concat([i,r.toBuffer(),ue.Buffer.from("ProgramDerivedAddress")]);let n=ca(i);if(oS(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(ue.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 oS(r.toBytes())}};ES=de;de.default=new ES("11111111111111111111111111111111");Fu.set(de,{kind:"struct",fields:[["_bn","u256"]]});var ZC=new de("BPFLoader1111111111111111111111111111111111"),ci=1232,B0=127,Zu=64,Vu=class extends Error{constructor(e){super(`Signature ${e} has expired: block height exceeded.`),this.signature=void 0,this.signature=e}};Object.defineProperty(Vu.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});var Ku=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(Ku.prototype,"name",{value:"TransactionExpiredTimeoutError"});var si=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(si.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});var po=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,a)=>{i.set(o.toBase58(),a)});let n=o=>{let a=i.get(o.toBase58());if(a===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return a};return e.map(o=>({programIdIndex:n(o.programId),accountKeyIndexes:o.keys.map(a=>n(a.pubkey)),data:o.data}))}},be=(t="publicKey")=>E.blob(32,t),I2=(t="signature")=>E.blob(64,t),ho=(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,a)=>r(o,a).chars.toString(),n.encode=(o,a,s)=>{let c={chars:ue.Buffer.from(o,"utf8")};return i(c,a,s)},n.alloc=o=>E.u32().span+E.u32().span+ue.Buffer.from(o,"utf8").length,n},k2=(t="authorized")=>E.struct([be("staker"),be("withdrawer")],t),R2=(t="lockup")=>E.struct([E.ns64("unixTimestamp"),E.ns64("epoch"),be("custodian")],t),A2=(t="voteInit")=>E.struct([be("nodePubkey"),be("authorizedVoter"),be("authorizedWithdrawer"),E.u8("commission")],t),$2=(t="voteAuthorizeWithSeedArgs")=>E.struct([E.u32("voteAuthorizationType"),be("currentAuthorityDerivedKeyOwnerPubkey"),ho("currentAuthorityDerivedKeySeed"),be("newAuthorized")],t);function IS(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 IS({layout:n},e[n.property]);return 0},i=0;return t.layout.fields.forEach(n=>{i+=r(n)}),i}function lr(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 dr(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 Ae(t,e){if(!t)throw new Error(e||"Assertion failed")}var Wu=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=a=>{let s=a.toBase58(),c=i.get(s);return c===void 0&&(c={isSigner:!1,isWritable:!1,isInvoked:!1},i.set(s,c)),c},o=n(r);o.isSigner=!0,o.isWritable=!0;for(let a of e){n(a.programId).isInvoked=!0;for(let s of a.keys){let c=n(s.pubkey);c.isSigner||=s.isSigner,c.isWritable||=s.isWritable}}return new t(r,i)}getMessageComponents(){let e=[...this.keyMetaMap.entries()];Ae(e.length<=256,"Max static account keys length exceeded");let r=e.filter(([,c])=>c.isSigner&&c.isWritable),i=e.filter(([,c])=>c.isSigner&&!c.isWritable),n=e.filter(([,c])=>!c.isSigner&&c.isWritable),o=e.filter(([,c])=>!c.isSigner&&!c.isWritable),a={numRequiredSignatures:r.length+i.length,numReadonlySignedAccounts:i.length,numReadonlyUnsignedAccounts:o.length};{Ae(r.length>0,"Expected at least one writable signer key");let[c]=r[0];Ae(c===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}let s=[...r.map(([c])=>new de(c)),...i.map(([c])=>new de(c)),...n.map(([c])=>new de(c)),...o.map(([c])=>new de(c))];return[a,s]}extractTableLookup(e){let[r,i]=this.drainKeysFoundInLookupTable(e.state.addresses,a=>!a.isSigner&&!a.isInvoked&&a.isWritable),[n,o]=this.drainKeysFoundInLookupTable(e.state.addresses,a=>!a.isSigner&&!a.isInvoked&&!a.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,a]of this.keyMetaMap.entries())if(r(a)){let s=new de(o),c=e.findIndex(l=>l.equals(s));c>=0&&(Ae(c<256,"Max lookup table index exceeded"),i.push(c),n.push(s),this.keyMetaMap.delete(o))}return[i,n]}},kS="Reached end of buffer unexpectedly";function Qr(t){if(t.length===0)throw new Error(kS);return t.shift()}function fr(t,...e){let[r]=e;if(e.length===2?r+(e[1]??0)>t.length:r>=t.length)throw new Error(kS);return t.splice(...e)}var Ln=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 de(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:$t.default.decode(e.data)}))}get addressTableLookups(){return[]}getAccountKeys(){return new po(this.staticAccountKeys)}static compile(e){let r=Wu.compile(e.instructions,e.payerKey),[i,n]=r.getMessageComponents(),a=new po(n).compileInstructions(e.instructions).map(s=>({programIdIndex:s.programIdIndex,accounts:s.accountKeyIndexes,data:$t.default.encode(s.data)}));return new t({header:i,accountKeys:n,recentBlockhash:e.recentBlockhash,instructions:a})}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=[];dr(r,e);let i=this.instructions.map(g=>{let{accounts:w,programIdIndex:v}=g,$=Array.from($t.default.decode(g.data)),k=[];dr(k,w.length);let R=[];return dr(R,$.length),{programIdIndex:v,keyIndicesCount:ue.Buffer.from(k),keyIndices:w,dataLength:ue.Buffer.from(R),data:$}}),n=[];dr(n,i.length);let o=ue.Buffer.alloc(ci);ue.Buffer.from(n).copy(o);let a=n.length;i.forEach(g=>{let v=E.struct([E.u8("programIdIndex"),E.blob(g.keyIndicesCount.length,"keyIndicesCount"),E.seq(E.u8("keyIndex"),g.keyIndices.length,"keyIndices"),E.blob(g.dataLength.length,"dataLength"),E.seq(E.u8("userdatum"),g.data.length,"data")]).encode(g,o,a);a+=v}),o=o.slice(0,a);let s=E.struct([E.blob(1,"numRequiredSignatures"),E.blob(1,"numReadonlySignedAccounts"),E.blob(1,"numReadonlyUnsignedAccounts"),E.blob(r.length,"keyCount"),E.seq(be("key"),e,"keys"),be("recentBlockhash")]),c={numRequiredSignatures:ue.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:ue.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:ue.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:ue.Buffer.from(r),keys:this.accountKeys.map(g=>we(g.toBytes())),recentBlockhash:$t.default.decode(this.recentBlockhash)},l=ue.Buffer.alloc(2048),h=s.encode(c,l);return o.copy(l,h),l.slice(0,h+o.length)}static from(e){let r=[...e],i=Qr(r);if(i!==(i&B0))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");let n=Qr(r),o=Qr(r),a=lr(r),s=[];for(let w=0;w<a;w++){let v=fr(r,0,Pn);s.push(new de(ue.Buffer.from(v)))}let c=fr(r,0,Pn),l=lr(r),h=[];for(let w=0;w<l;w++){let v=Qr(r),$=lr(r),k=fr(r,0,$),R=lr(r),z=fr(r,0,R),F=$t.default.encode(ue.Buffer.from(z));h.push({programIdIndex:v,accounts:k,data:F})}let g={header:{numRequiredSignatures:i,numReadonlySignedAccounts:n,numReadonlyUnsignedAccounts:o},recentBlockhash:$t.default.encode(ue.Buffer.from(c)),accountKeys:s,instructions:h};return new t(g)}},qu=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 po(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((a,s)=>a+s.writableIndexes.length,0);return n<o}else if(e>=this.header.numRequiredSignatures){let n=e-r,a=i-r-this.header.numReadonlyUnsignedAccounts;return n<a}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=Wu.compile(e.instructions,e.payerKey),i=new Array,n={writable:new Array,readonly:new Array},o=e.addressLookupTableAccounts||[];for(let h of o){let g=r.extractTableLookup(h);if(g!==void 0){let[w,{writable:v,readonly:$}]=g;i.push(w),n.writable.push(...v),n.readonly.push(...$)}}let[a,s]=r.getMessageComponents(),l=new po(s,n).compileInstructions(e.instructions);return new t({header:a,staticAccountKeys:s,recentBlockhash:e.recentBlockhash,compiledInstructions:l,addressTableLookups:i})}serialize(){let e=Array();dr(e,this.staticAccountKeys.length);let r=this.serializeInstructions(),i=Array();dr(i,this.compiledInstructions.length);let n=this.serializeAddressTableLookups(),o=Array();dr(o,this.addressTableLookups.length);let a=E.struct([E.u8("prefix"),E.struct([E.u8("numRequiredSignatures"),E.u8("numReadonlySignedAccounts"),E.u8("numReadonlyUnsignedAccounts")],"header"),E.blob(e.length,"staticAccountKeysLength"),E.seq(be(),this.staticAccountKeys.length,"staticAccountKeys"),be("recentBlockhash"),E.blob(i.length,"instructionsLength"),E.blob(r.length,"serializedInstructions"),E.blob(o.length,"addressTableLookupsLength"),E.blob(n.length,"serializedAddressTableLookups")]),s=new Uint8Array(ci),l=a.encode({prefix:128,header:this.header,staticAccountKeysLength:new Uint8Array(e),staticAccountKeys:this.staticAccountKeys.map(h=>h.toBytes()),recentBlockhash:$t.default.decode(this.recentBlockhash),instructionsLength:new Uint8Array(i),serializedInstructions:r,addressTableLookupsLength:new Uint8Array(o),serializedAddressTableLookups:n},s);return s.slice(0,l)}serializeInstructions(){let e=0,r=new Uint8Array(ci);for(let i of this.compiledInstructions){let n=Array();dr(n,i.accountKeyIndexes.length);let o=Array();dr(o,i.data.length);let a=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+=a.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(ci);for(let i of this.addressTableLookups){let n=Array();dr(n,i.writableIndexes.length);let o=Array();dr(o,i.readonlyIndexes.length);let a=E.struct([be("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+=a.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=Qr(r),n=i&B0;Ae(i!==n,"Expected versioned message but received legacy message");let o=n;Ae(o===0,`Expected versioned message with version 0 but found version ${o}`);let a={numRequiredSignatures:Qr(r),numReadonlySignedAccounts:Qr(r),numReadonlyUnsignedAccounts:Qr(r)},s=[],c=lr(r);for(let $=0;$<c;$++)s.push(new de(fr(r,0,Pn)));let l=$t.default.encode(fr(r,0,Pn)),h=lr(r),g=[];for(let $=0;$<h;$++){let k=Qr(r),R=lr(r),z=fr(r,0,R),F=lr(r),P=new Uint8Array(fr(r,0,F));g.push({programIdIndex:k,accountKeyIndexes:z,data:P})}let w=lr(r),v=[];for(let $=0;$<w;$++){let k=new de(fr(r,0,Pn)),R=lr(r),z=fr(r,0,R),F=lr(r),P=fr(r,0,F);v.push({accountKey:k,writableIndexes:z,readonlyIndexes:P})}return new t({header:a,staticAccountKeys:s,recentBlockhash:l,compiledInstructions:g,addressTableLookups:v})}},el={deserializeMessageVersion(t){let e=t[0],r=e&B0;return r===e?"legacy":r},deserialize:t=>{let e=el.deserializeMessageVersion(t);if(e==="legacy")return Ln.from(t);if(e===0)return qu.deserialize(t);throw new Error(`Transaction message version ${e} deserialization is not supported`)}},Tn=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}({}),O2=ue.Buffer.alloc(Zu).fill(0),ze=class{constructor(e){this.keys=void 0,this.programId=void 0,this.data=ue.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]}}},Ie=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 ze(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 k=0;k<r.length;k++)if(r[k].programId===void 0)throw new Error(`Transaction instruction index ${k} has undefined program id`);let n=[],o=[];r.forEach(k=>{k.keys.forEach(z=>{o.push({...z})});let R=k.programId.toString();n.includes(R)||n.push(R)}),n.forEach(k=>{o.push({pubkey:new de(k),isSigner:!1,isWritable:!1})});let a=[];o.forEach(k=>{let R=k.pubkey.toString(),z=a.findIndex(F=>F.pubkey.toString()===R);z>-1?(a[z].isWritable=a[z].isWritable||k.isWritable,a[z].isSigner=a[z].isSigner||k.isSigner):a.push(k)}),a.sort(function(k,R){if(k.isSigner!==R.isSigner)return k.isSigner?-1:1;if(k.isWritable!==R.isWritable)return k.isWritable?-1:1;let z={localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"};return k.pubkey.toBase58().localeCompare(R.pubkey.toBase58(),"en",z)});let s=a.findIndex(k=>k.pubkey.equals(i));if(s>-1){let[k]=a.splice(s,1);k.isSigner=!0,k.isWritable=!0,a.unshift(k)}else a.unshift({pubkey:i,isSigner:!0,isWritable:!0});for(let k of this.signatures){let R=a.findIndex(z=>z.pubkey.equals(k.publicKey));if(R>-1)a[R].isSigner||(a[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: ${k.publicKey.toString()}`)}let c=0,l=0,h=0,g=[],w=[];a.forEach(({pubkey:k,isSigner:R,isWritable:z})=>{R?(g.push(k.toString()),c+=1,z||(l+=1)):(w.push(k.toString()),z||(h+=1))});let v=g.concat(w),$=r.map(k=>{let{data:R,programId:z}=k;return{programIdIndex:v.indexOf(z.toString()),accounts:k.keys.map(F=>v.indexOf(F.pubkey.toString())),data:$t.default.encode(R)}});return $.forEach(k=>{Ae(k.programIdIndex>=0),k.accounts.forEach(R=>Ae(R>=0))}),new Ln({header:{numRequiredSignatures:c,numReadonlySignedAccounts:l,numReadonlyUnsignedAccounts:h},accountKeys:v,recentBlockhash:e,instructions:$})}_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 a=o.publicKey.toString();r.has(a)||(r.add(a),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 a=o.publicKey.toString();r.has(a)||(r.add(a),i.push(o))}let n=this._compile();this._partialSign(n,...i)}_partialSign(e,...r){let i=e.serialize();r.forEach(n=>{let o=z0(i,n.secretKey);this._addSignature(n.publicKey,we(o))})}addSignature(e,r){this._compile(),this._addSignature(e,r)}_addSignature(e,r){Ae(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=ue.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):x2(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 a="Signature verification failed.";throw o.invalid&&(a+=`
|
|
45
|
+
Invalid signature for public key${o.invalid.length===1?"":"(s)"} [\`${o.invalid.map(s=>s.toBase58()).join("`, `")}\`].`),o.missing&&(a+=`
|
|
46
|
+
Missing signature for public key${o.missing.length===1?"":"(s)"} [\`${o.missing.map(s=>s.toBase58()).join("`, `")}\`].`),new Error(a)}}return this._serialize(n)}_serialize(e){let{signatures:r}=this,i=[];dr(i,r.length);let n=i.length+r.length*64+e.length,o=ue.Buffer.alloc(n);return Ae(r.length<256),ue.Buffer.from(i).copy(o,0),r.forEach(({signature:a},s)=>{a!==null&&(Ae(a.length===64,"signature has invalid length"),ue.Buffer.from(a).copy(o,i.length+s*64))}),e.copy(o,i.length+r.length*64),Ae(o.length<=ci,`Transaction too large: ${o.length} > ${ci}`),o}get keys(){return Ae(this.instructions.length===1),this.instructions[0].keys.map(e=>e.pubkey)}get programId(){return Ae(this.instructions.length===1),this.instructions[0].programId}get data(){return Ae(this.instructions.length===1),this.instructions[0].data}static from(e){let r=[...e],i=lr(r),n=[];for(let o=0;o<i;o++){let a=fr(r,0,Zu);n.push($t.default.encode(ue.Buffer.from(a)))}return t.populate(Ln.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 a={signature:n==$t.default.encode(O2)?null:$t.default.decode(n),publicKey:e.accountKeys[o]};i.signatures.push(a)}),e.instructions.forEach(n=>{let o=n.accounts.map(a=>{let s=e.accountKeys[a];return{pubkey:s,isSigner:i.signatures.some(c=>c.publicKey.toString()===s.toString())||e.isAccountSigner(a),isWritable:e.isAccountWritable(a)}});i.instructions.push(new ze({keys:o,programId:e.accountKeys[n.programIdIndex],data:$t.default.decode(n.data)}))}),i._message=e,i._json=i.toJSON(),i}};var Gu=class t{get version(){return this.message.version}constructor(e,r){if(this.signatures=void 0,this.message=void 0,r!==void 0)Ae(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(Zu));this.signatures=i}this.message=e}serialize(){let e=this.message.serialize(),r=Array();dr(r,this.signatures.length);let i=E.struct([E.blob(r.length,"encodedSignaturesLength"),E.seq(I2(),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=lr(r);for(let a=0;a<n;a++)i.push(new Uint8Array(fr(r,0,Zu)));let o=el.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(a=>a.equals(n.publicKey));Ae(o>=0,`Cannot sign with non signer key ${n.publicKey.toBase58()}`),this.signatures[o]=z0(r,n.secretKey)}}addSignature(e,r){Ae(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));Ae(n>=0,`Can not add signature; \`${e.toBase58()}\` is not required to sign this transaction`),this.signatures[n]=r}},T2=160,N2=64,P2=T2/N2,RS=1e3/P2,Xr=new de("SysvarC1ock11111111111111111111111111111111"),VC=new de("SysvarEpochSchedu1e111111111111111111111111"),KC=new de("Sysvar1nstructions1111111111111111111111111"),f0=new de("SysvarRecentB1ockHashes11111111111111111111"),ka=new de("SysvarRent111111111111111111111111111111111"),WC=new de("SysvarRewards111111111111111111111111111111"),qC=new de("SysvarS1otHashes111111111111111111111111111"),GC=new de("SysvarS1otHistory11111111111111111111111111"),h0=new de("SysvarStakeHistory1111111111111111111111111"),Ra=class extends Error{constructor({action:e,signature:r,transactionMessage:i,logs:n}){let o=n?`Logs:
|
|
47
|
+
${JSON.stringify(n.slice(-10),null,2)}. `:"",a="\nCatch the `SendTransactionError` and call `getLogs()` on it for full details.",s;switch(e){case"send":s=`Transaction ${r} resulted in an error.
|
|
48
|
+
${i}. `+o+a;break;case"simulate":s=`Simulation failed.
|
|
49
|
+
Message: ${i}.
|
|
50
|
+
`+o+a;break;default:s=`Unknown action '${(c=>c)(e)}'`}super(s),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 ne=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 sS(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),a;if(e.recentBlockhash!=null&&e.lastValidBlockHeight!=null)a=(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:s}=e.nonceInfo,c=s.keys[0].pubkey;a=(await t.confirmTransaction({abortSignal:i?.abortSignal,minContextSlot:e.minNonceContextSlot,nonceAccountPubkey:c,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."),a=(await t.confirmTransaction(o,i&&i.commitment)).value;if(a.err)throw o!=null?new Ra({action:"send",signature:o,transactionMessage:`Status: (${JSON.stringify(a)})`}):new Error(`Transaction ${o} failed (${JSON.stringify(a)})`);return o}function ai(t){return new Promise(e=>setTimeout(e,t))}function xe(t,e){let r=t.layout.span>=0?t.layout.span:IS(t,e),i=ue.Buffer.alloc(r),n=Object.assign({instruction:t.index},e);return t.layout.encode(n,i),i}var L2=E.nu64("lamportsPerSignature"),AS=E.struct([E.u32("version"),E.u32("state"),be("authorizedPubkey"),be("nonce"),E.struct([L2],"feeCalculator")]),cS=AS.span,S0=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=AS.decode(we(e),0);return new t({authorizedPubkey:new de(r.authorizedPubkey),nonce:new de(r.nonce).toString(),feeCalculator:r.feeCalculator})}};function mo(t){let e=(0,xS.blob)(8,t),r=e.decode.bind(e),i=e.encode.bind(e),n=e,o=lx();return n.decode=(a,s)=>{let c=r(a,s);return o.decode(c)},n.encode=(a,s,c)=>{let l=o.encode(a);return i(l,s,c)},n}var _r=Object.freeze({Create:{index:0,layout:E.struct([E.u32("instruction"),E.ns64("lamports"),E.ns64("space"),be("programId")])},Assign:{index:1,layout:E.struct([E.u32("instruction"),be("programId")])},Transfer:{index:2,layout:E.struct([E.u32("instruction"),mo("lamports")])},CreateWithSeed:{index:3,layout:E.struct([E.u32("instruction"),be("base"),ho("seed"),E.ns64("lamports"),E.ns64("space"),be("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"),be("authorized")])},AuthorizeNonceAccount:{index:7,layout:E.struct([E.u32("instruction"),be("authorized")])},Allocate:{index:8,layout:E.struct([E.u32("instruction"),E.ns64("space")])},AllocateWithSeed:{index:9,layout:E.struct([E.u32("instruction"),be("base"),ho("seed"),E.ns64("space"),be("programId")])},AssignWithSeed:{index:10,layout:E.struct([E.u32("instruction"),be("base"),ho("seed"),be("programId")])},TransferWithSeed:{index:11,layout:E.struct([E.u32("instruction"),mo("lamports"),ho("seed"),be("programId")])},UpgradeNonceAccount:{index:12,layout:E.struct([E.u32("instruction")])}}),Yt=class t{constructor(){}static createAccount(e){let r=_r.Create,i=xe(r,{lamports:e.lamports,space:e.space,programId:we(e.programId.toBuffer())});return new ze({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=_r.TransferWithSeed;r=xe(n,{lamports:BigInt(e.lamports),seed:e.seed,programId:we(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=_r.Transfer;r=xe(n,{lamports:BigInt(e.lamports)}),i=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]}return new ze({keys:i,programId:this.programId,data:r})}static assign(e){let r,i;if("basePubkey"in e){let n=_r.AssignWithSeed;r=xe(n,{base:we(e.basePubkey.toBuffer()),seed:e.seed,programId:we(e.programId.toBuffer())}),i=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]}else{let n=_r.Assign;r=xe(n,{programId:we(e.programId.toBuffer())}),i=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]}return new ze({keys:i,programId:this.programId,data:r})}static createAccountWithSeed(e){let r=_r.CreateWithSeed,i=xe(r,{base:we(e.basePubkey.toBuffer()),seed:e.seed,lamports:e.lamports,space:e.space,programId:we(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 ze({keys:n,programId:this.programId,data:i})}static createNonceAccount(e){let r=new Ie;"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:cS,programId:this.programId})):r.add(t.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,lamports:e.lamports,space:cS,programId:this.programId}));let i={noncePubkey:e.noncePubkey,authorizedPubkey:e.authorizedPubkey};return r.add(this.nonceInitialize(i)),r}static nonceInitialize(e){let r=_r.InitializeNonceAccount,i=xe(r,{authorized:we(e.authorizedPubkey.toBuffer())}),n={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:f0,isSigner:!1,isWritable:!1},{pubkey:ka,isSigner:!1,isWritable:!1}],programId:this.programId,data:i};return new ze(n)}static nonceAdvance(e){let r=_r.AdvanceNonceAccount,i=xe(r),n={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:f0,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:i};return new ze(n)}static nonceWithdraw(e){let r=_r.WithdrawNonceAccount,i=xe(r,{lamports:e.lamports});return new ze({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0},{pubkey:f0,isSigner:!1,isWritable:!1},{pubkey:ka,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static nonceAuthorize(e){let r=_r.AuthorizeNonceAccount,i=xe(r,{authorized:we(e.newAuthorizedPubkey.toBuffer())});return new ze({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=_r.AllocateWithSeed;r=xe(n,{base:we(e.basePubkey.toBuffer()),seed:e.seed,space:e.space,programId:we(e.programId.toBuffer())}),i=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]}else{let n=_r.Allocate;r=xe(n,{space:e.space}),i=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]}return new ze({keys:i,programId:this.programId,data:r})}};Yt.programId=new de("11111111111111111111111111111111");var z2=ci-300,E0=class t{constructor(){}static getMinNumSignatures(e){return 2*(Math.ceil(e/t.chunkSize)+1+1)}static async load(e,r,i,n,o){{let g=await e.getMinimumBalanceForRentExemption(o.length),w=await e.getAccountInfo(i.publicKey,"confirmed"),v=null;if(w!==null){if(w.executable)return console.error("Program load failed, account is already executable"),!1;w.data.length!==o.length&&(v=v||new Ie,v.add(Yt.allocate({accountPubkey:i.publicKey,space:o.length}))),w.owner.equals(n)||(v=v||new Ie,v.add(Yt.assign({accountPubkey:i.publicKey,programId:n}))),w.lamports<g&&(v=v||new Ie,v.add(Yt.transfer({fromPubkey:r.publicKey,toPubkey:i.publicKey,lamports:g-w.lamports})))}else v=new Ie().add(Yt.createAccount({fromPubkey:r.publicKey,newAccountPubkey:i.publicKey,lamports:g>0?g:1,space:o.length,programId:n}));v!==null&&await sS(e,v,[r,i],{commitment:"confirmed"})}let a=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")]),s=t.chunkSize,c=0,l=o,h=[];for(;l.length>0;){let g=l.slice(0,s),w=ue.Buffer.alloc(s+16);a.encode({instruction:0,offset:c,bytes:g,bytesLength:0,bytesLengthPadding:0},w);let v=new Ie().add({keys:[{pubkey:i.publicKey,isSigner:!0,isWritable:!0}],programId:n,data:w});h.push(sS(e,v,[r,i],{commitment:"confirmed"})),e._rpcEndpoint.includes("solana.com")&&await ai(1e3/4),c+=s,l=l.slice(s)}await Promise.all(h);{let g=E.struct([E.u32("instruction")]),w=ue.Buffer.alloc(g.span);g.encode({instruction:1},w);let v=new Ie().add({keys:[{pubkey:i.publicKey,isSigner:!0,isWritable:!0},{pubkey:ka,isSigner:!1,isWritable:!1}],programId:n,data:w}),$="processed",k=await e.sendTransaction(v,[r,i],{preflightCommitment:$}),{context:R,value:z}=await e.confirmTransaction({signature:k,lastValidBlockHeight:v.lastValidBlockHeight,blockhash:v.recentBlockhash},$);if(z.err)throw new Error(`Transaction ${k} failed (${JSON.stringify(z)})`);for(;;){try{if(await e.getSlot({commitment:$})>R.slot)break}catch{}await new Promise(F=>setTimeout(F,Math.round(RS/2)))}}return!0}};E0.chunkSize=z2;var HC=new de("BPFLoader2111111111111111111111111111111111");function B2(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var p0,uS;function U2(){if(uS)return p0;uS=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,a,s,c,l,h,g;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(g=t.call(i),g==="[object Array]"){for(s="[",a=i.length-1,o=0;o<a;o++)s+=r(i[o],!0)+",";return a>-1&&(s+=r(i[o],!0)),s+"]"}else if(g==="[object Object]"){for(c=e(i).sort(),a=c.length,s="",o=0;o<a;)l=c[o],h=r(i[l],!1),h!==void 0&&(s&&(s+=","),s+=JSON.stringify(l)+":"+h),o++;return"{"+s+"}"}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 p0=function(i){var n=r(i,!1);if(n!==void 0)return""+n},p0}var C2=U2(),lS=B2(C2),Sa=32;function m0(t){let e=0;for(;t>1;)t/=2,e++;return e}function D2(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 I0=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=m0(D2(e+Sa+1))-m0(Sa)-1,i=this.getSlotsInEpoch(r),n=e-(i-Sa);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)*Sa:(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+m0(Sa)):this.slotsPerEpoch}},M2=globalThis.fetch,k0=class extends Vx{constructor(e,r,i){let n=o=>{let a=Zx(o,{autoconnect:!0,max_reconnects:5,reconnect:!0,reconnect_interval:1e3,...r});return"socket"in a?this.underlyingSocket=a.socket:this.underlyingSocket=a,a};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 j2(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 dS=56,Hu=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=j2(F2,e),i=e.length-dS;Ae(i>=0,"lookup table is invalid"),Ae(i%32===0,"lookup table is invalid");let n=i/32,{addresses:o}=E.struct([E.seq(be(),n,"addresses")]).decode(e.slice(dS));return{deactivationSlot:r.deactivationSlot,lastExtendedSlot:r.lastExtendedSlot,lastExtendedSlotStartIndex:r.lastExtendedStartIndex,authority:r.authority.length!==0?new de(r.authority[0]):void 0,addresses:o.map(a=>new de(a))}}},F2={index:1,layout:E.struct([E.u32("typeIndex"),mo("deactivationSlot"),E.nu64("lastExtendedSlot"),E.u8("lastExtendedStartIndex"),E.u8(),E.seq(be(),E.offset(E.u8(),-1),"authority")])},Z2=/^[^:]+:\/\/([^:[]+|\[[^\]]+\])(:\d+)?(.*)/i;function V2(t){let e=t.match(Z2);if(e==null)throw TypeError(`Failed to validate endpoint URL \`${t}\``);let[r,i,n,o]=e,a=t.startsWith("https:")?"wss:":"ws:",s=n==null?null:parseInt(n.slice(1),10),c=s==null?"":`:${s+1}`;return`${a}//${i}${c}${o}`}var He=fo(Ou(de),K(),t=>new de(t)),$S=Tu([K(),je("base64")]),U0=fo(Ou(ue.Buffer),$S,t=>ue.Buffer.from(t[0],"base64")),K2=30*1e3;function W2(t){if(/^https?:/.test(t)===!1)throw new TypeError("Endpoint URL must start with `http:` or `https:`.");return t}function Ue(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 fS(t){return t.map(e=>"memcmp"in e?{...e,memcmp:{...e.memcmp,encoding:e.memcmp.encoding??"base58"}}:e)}function OS(t){return Ct([U({jsonrpc:je("2.0"),id:K(),result:t}),U({jsonrpc:je("2.0"),id:K(),error:U({code:ii(),message:K(),data:ae(px())})})])}var q2=OS(ii());function ve(t){return fo(OS(t),q2,e=>"error"in e?e:{...e,result:G(e.result,t)})}function tt(t){return ve(U({context:U({slot:O()}),value:t}))}function tl(t){return U({context:U({slot:O()}),value:t})}function g0(t,e){return t===0?new qu({header:e.header,staticAccountKeys:e.accountKeys.map(r=>new de(r)),recentBlockhash:e.recentBlockhash,compiledInstructions:e.instructions.map(r=>({programIdIndex:r.programIdIndex,accountKeyIndexes:r.accounts,data:$t.default.decode(r.data)})),addressTableLookups:e.addressTableLookups}):new Ln(e)}var G2=U({foundation:O(),foundationTerm:O(),initial:O(),taper:O(),terminal:O()}),H2=ve(H(Y(U({epoch:O(),effectiveSlot:O(),amount:O(),postBalance:O(),commission:ae(Y(O()))})))),J2=H(U({slot:O(),prioritizationFee:O()})),Y2=U({total:O(),validator:O(),foundation:O(),epoch:O()}),X2=U({epoch:O(),slotIndex:O(),slotsInEpoch:O(),absoluteSlot:O(),blockHeight:ae(O()),transactionCount:ae(O())}),Q2=U({slotsPerEpoch:O(),leaderScheduleSlotOffset:O(),warmup:Ir(),firstNormalEpoch:O(),firstNormalSlot:O()}),e6=Jg(K(),H(O())),ui=Y(Ct([U({}),K()])),t6=U({err:ui}),r6=je("receivedSignature"),n6=U({"solana-core":K(),"feature-set":ae(O())}),i6=U({program:K(),programId:He,parsed:ii()}),o6=U({programId:He,accounts:H(He),data:K()}),hS=tt(U({err:Y(Ct([U({}),K()])),logs:Y(H(K())),accounts:ae(Y(H(Y(U({executable:Ir(),owner:K(),lamports:O(),data:H(K()),rentEpoch:ae(O())}))))),unitsConsumed:ae(O()),returnData:ae(Y(U({programId:K(),data:Tu([K(),je("base64")])}))),innerInstructions:ae(Y(H(U({index:O(),instructions:H(Ct([i6,o6]))}))))})),a6=tt(U({byIdentity:Jg(K(),H(O())),range:U({firstSlot:O(),lastSlot:O()})}));function s6(t,e,r,i,n,o){let a=r||M2,s;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 c;return i&&(c=async(h,g)=>{let w=await new Promise((v,$)=>{try{i(h,g,(k,R)=>v([k,R]))}catch(k){$(k)}});return await a(...w)}),new SS.default(async(h,g)=>{let w={method:"POST",body:h,agent:s,headers:Object.assign({"Content-Type":"application/json"},e||{},s4)};try{let v=5,$,k=500;for(;c?$=await c(t,w):$=await a(t,w),!($.status!==429||n===!0||(v-=1,v===0));)console.error(`Server responded with ${$.status} ${$.statusText}. Retrying after ${k}ms delay...`),await ai(k),k*=2;let R=await $.text();$.ok?g(null,R):g(new Error(`${$.status} ${$.statusText}: ${R}`))}catch(v){v instanceof Error&&g(v)}},{})}function c6(t){return(e,r)=>new Promise((i,n)=>{t.request(e,r,(o,a)=>{if(o){n(o);return}i(a)})})}function u6(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,a)=>{if(o){i(o);return}r(a)})})}var l6=ve(G2),d6=ve(Y2),f6=ve(J2),h6=ve(X2),p6=ve(Q2),m6=ve(e6),g6=ve(O()),y6=tt(U({total:O(),circulating:O(),nonCirculating:O(),nonCirculatingAccounts:H(He)})),R0=U({amount:K(),uiAmount:Y(O()),decimals:O(),uiAmountString:ae(K())}),_6=tt(H(U({address:He,amount:K(),uiAmount:Y(O()),decimals:O(),uiAmountString:ae(K())}))),v6=tt(H(U({pubkey:He,account:U({executable:Ir(),owner:He,lamports:O(),data:U0,rentEpoch:O()})}))),A0=U({program:K(),parsed:ii(),space:O()}),b6=tt(H(U({pubkey:He,account:U({executable:Ir(),owner:He,lamports:O(),data:A0,rentEpoch:O()})}))),w6=tt(H(U({lamports:O(),address:He}))),Aa=U({executable:Ir(),owner:He,lamports:O(),data:U0,rentEpoch:O()}),x6=U({pubkey:He,account:Aa}),S6=fo(Ct([Ou(ue.Buffer),A0]),Ct([$S,A0]),t=>Array.isArray(t)?G(t,U0):t),$0=U({executable:Ir(),owner:He,lamports:O(),data:S6,rentEpoch:O()}),E6=U({pubkey:He,account:$0}),I6=U({state:Ct([je("active"),je("inactive"),je("activating"),je("deactivating")]),active:O(),inactive:O()}),k6=ve(H(U({signature:K(),slot:O(),err:ui,memo:Y(K()),blockTime:ae(Y(O()))}))),R6=ve(H(U({signature:K(),slot:O(),err:ui,memo:Y(K()),blockTime:ae(Y(O()))}))),A6=U({subscription:O(),result:tl(Aa)}),$6=U({pubkey:He,account:Aa}),O6=U({subscription:O(),result:tl($6)}),T6=U({parent:O(),slot:O(),root:O()}),N6=U({subscription:O(),result:T6}),P6=Ct([U({type:Ct([je("firstShredReceived"),je("completed"),je("optimisticConfirmation"),je("root")]),slot:O(),timestamp:O()}),U({type:je("createdBank"),parent:O(),slot:O(),timestamp:O()}),U({type:je("frozen"),slot:O(),timestamp:O(),stats:U({numTransactionEntries:O(),numSuccessfulTransactions:O(),numFailedTransactions:O(),maxTransactionsPerEntry:O()})}),U({type:je("dead"),slot:O(),timestamp:O(),err:K()})]),L6=U({subscription:O(),result:P6}),z6=U({subscription:O(),result:tl(Ct([t6,r6]))}),B6=U({subscription:O(),result:O()}),U6=U({pubkey:K(),gossip:Y(K()),tpu:Y(K()),rpc:Y(K()),version:Y(K())}),pS=U({votePubkey:K(),nodePubkey:K(),activatedStake:O(),epochVoteAccount:Ir(),epochCredits:H(Tu([O(),O(),O()])),commission:O(),lastVote:O(),rootSlot:Y(O())}),C6=ve(U({current:H(pS),delinquent:H(pS)})),D6=Ct([je("processed"),je("confirmed"),je("finalized")]),M6=U({slot:O(),confirmations:Y(O()),err:ui,confirmationStatus:ae(D6)}),j6=tt(H(Y(M6))),F6=ve(O()),TS=U({accountKey:He,writableIndexes:H(O()),readonlyIndexes:H(O())}),C0=U({signatures:H(K()),message:U({accountKeys:H(K()),header:U({numRequiredSignatures:O(),numReadonlySignedAccounts:O(),numReadonlyUnsignedAccounts:O()}),instructions:H(U({accounts:H(O()),data:K(),programIdIndex:O()})),recentBlockhash:K(),addressTableLookups:ae(H(TS))})}),NS=U({pubkey:He,signer:Ir(),writable:Ir(),source:ae(Ct([je("transaction"),je("lookupTable")]))}),PS=U({accountKeys:H(NS),signatures:H(K())}),LS=U({parsed:ii(),program:K(),programId:He}),zS=U({accounts:H(He),data:K(),programId:He}),Z6=Ct([zS,LS]),V6=Ct([U({parsed:ii(),program:K(),programId:K()}),U({accounts:H(K()),data:K(),programId:K()})]),BS=fo(Z6,V6,t=>"accounts"in t?G(t,zS):G(t,LS)),US=U({signatures:H(K()),message:U({accountKeys:H(NS),instructions:H(BS),recentBlockhash:K(),addressTableLookups:ae(Y(H(TS)))})}),Ju=U({accountIndex:O(),mint:K(),owner:ae(K()),programId:ae(K()),uiTokenAmount:R0}),CS=U({writable:H(He),readonly:H(He)}),rl=U({err:ui,fee:O(),innerInstructions:ae(Y(H(U({index:O(),instructions:H(U({accounts:H(O()),data:K(),programIdIndex:O()}))})))),preBalances:H(O()),postBalances:H(O()),logMessages:ae(Y(H(K()))),preTokenBalances:ae(Y(H(Ju))),postTokenBalances:ae(Y(H(Ju))),loadedAddresses:ae(CS),computeUnitsConsumed:ae(O())}),D0=U({err:ui,fee:O(),innerInstructions:ae(Y(H(U({index:O(),instructions:H(BS)})))),preBalances:H(O()),postBalances:H(O()),logMessages:ae(Y(H(K()))),preTokenBalances:ae(Y(H(Ju))),postTokenBalances:ae(Y(H(Ju))),loadedAddresses:ae(CS),computeUnitsConsumed:ae(O())}),yo=Ct([je(0),je("legacy")]),li=U({pubkey:K(),lamports:O(),postBalance:Y(O()),rewardType:Y(K()),commission:ae(Y(O()))}),K6=ve(Y(U({blockhash:K(),previousBlockhash:K(),parentSlot:O(),transactions:H(U({transaction:C0,meta:Y(rl),version:ae(yo)})),rewards:ae(H(li)),blockTime:Y(O()),blockHeight:Y(O())}))),W6=ve(Y(U({blockhash:K(),previousBlockhash:K(),parentSlot:O(),rewards:ae(H(li)),blockTime:Y(O()),blockHeight:Y(O())}))),q6=ve(Y(U({blockhash:K(),previousBlockhash:K(),parentSlot:O(),transactions:H(U({transaction:PS,meta:Y(rl),version:ae(yo)})),rewards:ae(H(li)),blockTime:Y(O()),blockHeight:Y(O())}))),G6=ve(Y(U({blockhash:K(),previousBlockhash:K(),parentSlot:O(),transactions:H(U({transaction:US,meta:Y(D0),version:ae(yo)})),rewards:ae(H(li)),blockTime:Y(O()),blockHeight:Y(O())}))),H6=ve(Y(U({blockhash:K(),previousBlockhash:K(),parentSlot:O(),transactions:H(U({transaction:PS,meta:Y(D0),version:ae(yo)})),rewards:ae(H(li)),blockTime:Y(O()),blockHeight:Y(O())}))),J6=ve(Y(U({blockhash:K(),previousBlockhash:K(),parentSlot:O(),rewards:ae(H(li)),blockTime:Y(O()),blockHeight:Y(O())}))),Y6=ve(Y(U({blockhash:K(),previousBlockhash:K(),parentSlot:O(),transactions:H(U({transaction:C0,meta:Y(rl)})),rewards:ae(H(li)),blockTime:Y(O())}))),mS=ve(Y(U({blockhash:K(),previousBlockhash:K(),parentSlot:O(),signatures:H(K()),blockTime:Y(O())}))),y0=ve(Y(U({slot:O(),meta:Y(rl),blockTime:ae(Y(O())),transaction:C0,version:ae(yo)}))),Mu=ve(Y(U({slot:O(),transaction:US,meta:Y(D0),blockTime:ae(Y(O())),version:ae(yo)}))),X6=tt(U({blockhash:K(),lastValidBlockHeight:O()})),Q6=tt(Ir()),e4=U({slot:O(),numTransactions:O(),numSlots:O(),samplePeriodSecs:O()}),t4=ve(H(e4)),r4=tt(Y(U({feeCalculator:U({lamportsPerSignature:O()})}))),n4=ve(K()),i4=ve(K()),o4=U({err:ui,logs:H(K()),signature:K()}),a4=U({result:tl(o4),subscription:O()}),s4={"solana-client":"js/1.0.0-maintenance"},Yu=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 l={};return async h=>{let{commitment:g,config:w}=Ue(h),v=this._buildArgs([],g,void 0,w),$=lS(v);return l[$]=l[$]??(async()=>{try{let k=await this._rpcRequest("getBlockHeight",v),R=G(k,ve(O()));if("error"in R)throw new ne(R.error,"failed to get block height information");return R.result}finally{delete l[$]}})(),await l[$]}})();let i,n,o,a,s,c;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,a=r.fetchMiddleware,s=r.disableRetryOnRateLimit,c=r.httpAgent),this._rpcEndpoint=W2(e),this._rpcWsEndpoint=i||V2(e),this._rpcClient=s6(e,n,o,a,s,c),this._rpcRequest=c6(this._rpcClient),this._rpcBatchRequest=u6(this._rpcClient),this._rpcWebSocket=new k0(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}=Ue(r),o=this._buildArgs([e.toBase58()],i,void 0,n),a=await this._rpcRequest("getBalance",o),s=G(a,tt(O()));if("error"in s)throw new ne(s.error,`failed to get balance for ${e.toBase58()}`);return s.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=G(r,ve(Y(O())));if("error"in i)throw new ne(i.error,`failed to get block time for slot ${e}`);return i.result}async getMinimumLedgerSlot(){let e=await this._rpcRequest("minimumLedgerSlot",[]),r=G(e,ve(O()));if("error"in r)throw new ne(r.error,"failed to get minimum ledger slot");return r.result}async getFirstAvailableBlock(){let e=await this._rpcRequest("getFirstAvailableBlock",[]),r=G(e,g6);if("error"in r)throw new ne(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=G(i,y6);if("error"in n)throw new ne(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=G(n,tt(R0));if("error"in o)throw new ne(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=G(n,tt(R0));if("error"in o)throw new ne(o.error,"failed to get token account balance");return o.result}async getTokenAccountsByOwner(e,r,i){let{commitment:n,config:o}=Ue(i),a=[e.toBase58()];"mint"in r?a.push({mint:r.mint.toBase58()}):a.push({programId:r.programId.toBase58()});let s=this._buildArgs(a,n,"base64",o),c=await this._rpcRequest("getTokenAccountsByOwner",s),l=G(c,v6);if("error"in l)throw new ne(l.error,`failed to get token accounts owned by account ${e.toBase58()}`);return l.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"),a=await this._rpcRequest("getTokenAccountsByOwner",o),s=G(a,b6);if("error"in s)throw new ne(s.error,`failed to get token accounts owned by account ${e.toBase58()}`);return s.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=G(n,w6);if("error"in o)throw new ne(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=G(n,_6);if("error"in o)throw new ne(o.error,"failed to get token largest accounts");return o.result}async getAccountInfoAndContext(e,r){let{commitment:i,config:n}=Ue(r),o=this._buildArgs([e.toBase58()],i,"base64",n),a=await this._rpcRequest("getAccountInfo",o),s=G(a,tt(Y(Aa)));if("error"in s)throw new ne(s.error,`failed to get info about account ${e.toBase58()}`);return s.result}async getParsedAccountInfo(e,r){let{commitment:i,config:n}=Ue(r),o=this._buildArgs([e.toBase58()],i,"jsonParsed",n),a=await this._rpcRequest("getAccountInfo",o),s=G(a,tt(Y($0)));if("error"in s)throw new ne(s.error,`failed to get info about account ${e.toBase58()}`);return s.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}=Ue(r),o=e.map(l=>l.toBase58()),a=this._buildArgs([o],i,"jsonParsed",n),s=await this._rpcRequest("getMultipleAccounts",a),c=G(s,tt(H(Y($0))));if("error"in c)throw new ne(c.error,`failed to get info for accounts ${o}`);return c.result}async getMultipleAccountsInfoAndContext(e,r){let{commitment:i,config:n}=Ue(r),o=e.map(l=>l.toBase58()),a=this._buildArgs([o],i,"base64",n),s=await this._rpcRequest("getMultipleAccounts",a),c=G(s,tt(H(Y(Aa))));if("error"in c)throw new ne(c.error,`failed to get info for accounts ${o}`);return c.result}async getMultipleAccountsInfo(e,r){return(await this.getMultipleAccountsInfoAndContext(e,r)).value}async getStakeActivation(e,r,i){let{commitment:n,config:o}=Ue(r),a=this._buildArgs([e.toBase58()],n,void 0,{...o,epoch:i??o?.epoch}),s=await this._rpcRequest("getStakeActivation",a),c=G(s,ve(I6));if("error"in c)throw new ne(c.error,`failed to get Stake Activation ${e.toBase58()}`);return c.result}async getProgramAccounts(e,r){let{commitment:i,config:n}=Ue(r),{encoding:o,...a}=n||{},s=this._buildArgs([e.toBase58()],i,o||"base64",{...a,...a.filters?{filters:fS(a.filters)}:null}),c=await this._rpcRequest("getProgramAccounts",s),l=H(x6),h=a.withContext===!0?G(c,tt(l)):G(c,ve(l));if("error"in h)throw new ne(h.error,`failed to get accounts owned by program ${e.toBase58()}`);return h.result}async getParsedProgramAccounts(e,r){let{commitment:i,config:n}=Ue(r),o=this._buildArgs([e.toBase58()],i,"jsonParsed",n),a=await this._rpcRequest("getProgramAccounts",o),s=G(a,ve(H(E6)));if("error"in s)throw new ne(s.error,`failed to get accounts owned by program ${e.toBase58()}`);return s.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=$t.default.decode(i)}catch{throw new Error("signature must be base58 encoded: "+i)}return Ae(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,a=new Promise((c,l)=>{try{i=this.onSignature(r,(g,w)=>{i=void 0;let v={context:w,value:g};c({__type:Tn.PROCESSED,response:v})},e);let h=new Promise(g=>{i==null?g():n=this._onSubscriptionStateChange(i,w=>{w==="subscribed"&&g()})});(async()=>{if(await h,o)return;let g=await this.getSignatureStatus(r);if(o||g==null)return;let{context:w,value:v}=g;if(v!=null)if(v?.err)l(v.err);else{switch(e){case"confirmed":case"single":case"singleGossip":{if(v.confirmationStatus==="processed")return;break}case"finalized":case"max":case"root":{if(v.confirmationStatus==="processed"||v.confirmationStatus==="confirmed")return;break}case"processed":case"recent":}o=!0,c({__type:Tn.PROCESSED,response:{context:w,value:v}})}})()}catch(h){l(h)}});return{abortConfirmation:()=>{n&&(n(),n=void 0),i!=null&&(this.removeSignatureListener(i),i=void 0)},confirmationPromise:a}}async confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:e,strategy:{abortSignal:r,lastValidBlockHeight:i,signature:n}}){let o=!1,a=new Promise(g=>{let w=async()=>{try{return await this.getBlockHeight(e)}catch{return-1}};(async()=>{let v=await w();if(!o){for(;v<=i;)if(await ai(1e3),o||(v=await w(),o))return;g({__type:Tn.BLOCKHEIGHT_EXCEEDED})}})()}),{abortConfirmation:s,confirmationPromise:c}=this.getTransactionConfirmationPromise({commitment:e,signature:n}),l=this.getCancellationPromise(r),h;try{let g=await Promise.race([l,c,a]);if(g.__type===Tn.PROCESSED)h=g.response;else throw new Vu(n)}finally{o=!0,s()}return h}async confirmTransactionUsingDurableNonceStrategy({commitment:e,strategy:{abortSignal:r,minContextSlot:i,nonceAccountPubkey:n,nonceValue:o,signature:a}}){let s=!1,c=new Promise(v=>{let $=o,k=null,R=async()=>{try{let{context:z,value:F}=await this.getNonceAndContext(n,{commitment:e,minContextSlot:i});return k=z.slot,F?.nonce}catch{return $}};(async()=>{if($=await R(),!s)for(;;){if(o!==$){v({__type:Tn.NONCE_INVALID,slotInWhichNonceDidAdvance:k});return}if(await ai(2e3),s||($=await R(),s))return}})()}),{abortConfirmation:l,confirmationPromise:h}=this.getTransactionConfirmationPromise({commitment:e,signature:a}),g=this.getCancellationPromise(r),w;try{let v=await Promise.race([g,h,c]);if(v.__type===Tn.PROCESSED)w=v.response;else{let $;for(;;){let k=await this.getSignatureStatus(a);if(k==null)break;if(k.context.slot<(v.slotInWhichNonceDidAdvance??i)){await ai(400);continue}$=k;break}if($?.value){let k=e||"finalized",{confirmationStatus:R}=$.value;switch(k){case"processed":case"recent":if(R!=="processed"&&R!=="confirmed"&&R!=="finalized")throw new si(a);break;case"confirmed":case"single":case"singleGossip":if(R!=="confirmed"&&R!=="finalized")throw new si(a);break;case"finalized":case"max":case"root":if(R!=="finalized")throw new si(a);break;default:}w={context:$.context,value:{err:$.value.err}}}else throw new si(a)}}finally{s=!0,l()}return w}async confirmTransactionUsingLegacyTimeoutStrategy({commitment:e,signature:r}){let i,n=new Promise(c=>{let l=this._confirmTransactionInitialTimeout||6e4;switch(e){case"processed":case"recent":case"single":case"confirmed":case"singleGossip":{l=this._confirmTransactionInitialTimeout||3e4;break}}i=setTimeout(()=>c({__type:Tn.TIMED_OUT,timeoutMs:l}),l)}),{abortConfirmation:o,confirmationPromise:a}=this.getTransactionConfirmationPromise({commitment:e,signature:r}),s;try{let c=await Promise.race([a,n]);if(c.__type===Tn.PROCESSED)s=c.response;else throw new Ku(r,c.timeoutMs/1e3)}finally{clearTimeout(i),o()}return s}async getClusterNodes(){let e=await this._rpcRequest("getClusterNodes",[]),r=G(e,ve(H(U6)));if("error"in r)throw new ne(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=G(i,C6);if("error"in n)throw new ne(n.error,"failed to get vote accounts");return n.result}async getSlot(e){let{commitment:r,config:i}=Ue(e),n=this._buildArgs([],r,void 0,i),o=await this._rpcRequest("getSlot",n),a=G(o,ve(O()));if("error"in a)throw new ne(a.error,"failed to get slot");return a.result}async getSlotLeader(e){let{commitment:r,config:i}=Ue(e),n=this._buildArgs([],r,void 0,i),o=await this._rpcRequest("getSlotLeader",n),a=G(o,ve(K()));if("error"in a)throw new ne(a.error,"failed to get slot leader");return a.result}async getSlotLeaders(e,r){let i=[e,r],n=await this._rpcRequest("getSlotLeaders",i),o=G(n,ve(H(He)));if("error"in o)throw new ne(o.error,"failed to get slot leaders");return o.result}async getSignatureStatus(e,r){let{context:i,value:n}=await this.getSignatureStatuses([e],r);Ae(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=G(n,j6);if("error"in o)throw new ne(o.error,"failed to get signature status");return o.result}async getTransactionCount(e){let{commitment:r,config:i}=Ue(e),n=this._buildArgs([],r,void 0,i),o=await this._rpcRequest("getTransactionCount",n),a=G(o,ve(O()));if("error"in a)throw new ne(a.error,"failed to get transaction count");return a.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=G(i,l6);if("error"in n)throw new ne(n.error,"failed to get inflation");return n.result}async getInflationReward(e,r,i){let{commitment:n,config:o}=Ue(i),a=this._buildArgs([e.map(l=>l.toBase58())],n,void 0,{...o,epoch:r??o?.epoch}),s=await this._rpcRequest("getInflationReward",a),c=G(s,H2);if("error"in c)throw new ne(c.error,"failed to get inflation reward");return c.result}async getInflationRate(){let e=await this._rpcRequest("getInflationRate",[]),r=G(e,d6);if("error"in r)throw new ne(r.error,"failed to get inflation rate");return r.result}async getEpochInfo(e){let{commitment:r,config:i}=Ue(e),n=this._buildArgs([],r,void 0,i),o=await this._rpcRequest("getEpochInfo",n),a=G(o,h6);if("error"in a)throw new ne(a.error,"failed to get epoch info");return a.result}async getEpochSchedule(){let e=await this._rpcRequest("getEpochSchedule",[]),r=G(e,p6);if("error"in r)throw new ne(r.error,"failed to get epoch schedule");let i=r.result;return new I0(i.slotsPerEpoch,i.leaderScheduleSlotOffset,i.warmup,i.firstNormalEpoch,i.firstNormalSlot)}async getLeaderSchedule(){let e=await this._rpcRequest("getLeaderSchedule",[]),r=G(e,m6);if("error"in r)throw new ne(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=G(n,F6);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=G(r,t4);if("error"in i)throw new ne(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=G(n,r4);if("error"in o)throw new ne(o.error,"failed to get fee calculator");let{context:a,value:s}=o.result;return{context:a,value:s!==null?s.feeCalculator:null}}async getFeeForMessage(e,r){let i=we(e.serialize()).toString("base64"),n=this._buildArgs([i],r),o=await this._rpcRequest("getFeeForMessage",n),a=G(o,tt(Y(O())));if("error"in a)throw new ne(a.error,"failed to get fee for message");if(a.result===null)throw new Error("invalid blockhash");return a.result}async getRecentPrioritizationFees(e){let r=e?.lockedWritableAccounts?.map(a=>a.toBase58()),i=r?.length?[r]:[],n=await this._rpcRequest("getRecentPrioritizationFees",i),o=G(n,f6);if("error"in o)throw new ne(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}=Ue(e),n=this._buildArgs([],r,void 0,i),o=await this._rpcRequest("getLatestBlockhash",n),a=G(o,X6);if("error"in a)throw new ne(a.error,"failed to get latest blockhash");return a.result}async isBlockhashValid(e,r){let{commitment:i,config:n}=Ue(r),o=this._buildArgs([e],i,void 0,n),a=await this._rpcRequest("isBlockhashValid",o),s=G(a,Q6);if("error"in s)throw new ne(s.error,"failed to determine if the blockhash `"+e+"`is valid");return s.result}async getVersion(){let e=await this._rpcRequest("getVersion",[]),r=G(e,ve(n6));if("error"in r)throw new ne(r.error,"failed to get version");return r.result}async getGenesisHash(){let e=await this._rpcRequest("getGenesisHash",[]),r=G(e,ve(K()));if("error"in r)throw new ne(r.error,"failed to get genesis hash");return r.result}async getBlock(e,r){let{commitment:i,config:n}=Ue(r),o=this._buildArgsAtLeastConfirmed([e],i,void 0,n),a=await this._rpcRequest("getBlock",o);try{switch(n?.transactionDetails){case"accounts":{let s=G(a,q6);if("error"in s)throw s.error;return s.result}case"none":{let s=G(a,W6);if("error"in s)throw s.error;return s.result}default:{let s=G(a,K6);if("error"in s)throw s.error;let{result:c}=s;return c?{...c,transactions:c.transactions.map(({transaction:l,meta:h,version:g})=>({meta:h,transaction:{...l,message:g0(g,l.message)},version:g}))}:null}}}catch(s){throw new ne(s,"failed to get confirmed block")}}async getParsedBlock(e,r){let{commitment:i,config:n}=Ue(r),o=this._buildArgsAtLeastConfirmed([e],i,"jsonParsed",n),a=await this._rpcRequest("getBlock",o);try{switch(n?.transactionDetails){case"accounts":{let s=G(a,H6);if("error"in s)throw s.error;return s.result}case"none":{let s=G(a,J6);if("error"in s)throw s.error;return s.result}default:{let s=G(a,G6);if("error"in s)throw s.error;return s.result}}}catch(s){throw new ne(s,"failed to get block")}}async getBlockProduction(e){let r,i;if(typeof e=="string")i=e;else if(e){let{commitment:s,...c}=e;i=s,r=c}let n=this._buildArgs([],i,"base64",r),o=await this._rpcRequest("getBlockProduction",n),a=G(o,a6);if("error"in a)throw new ne(a.error,"failed to get block production information");return a.result}async getTransaction(e,r){let{commitment:i,config:n}=Ue(r),o=this._buildArgsAtLeastConfirmed([e],i,void 0,n),a=await this._rpcRequest("getTransaction",o),s=G(a,y0);if("error"in s)throw new ne(s.error,"failed to get transaction");let c=s.result;return c&&{...c,transaction:{...c.transaction,message:g0(c.version,c.transaction.message)}}}async getParsedTransaction(e,r){let{commitment:i,config:n}=Ue(r),o=this._buildArgsAtLeastConfirmed([e],i,"jsonParsed",n),a=await this._rpcRequest("getTransaction",o),s=G(a,Mu);if("error"in s)throw new ne(s.error,"failed to get transaction");return s.result}async getParsedTransactions(e,r){let{commitment:i,config:n}=Ue(r),o=e.map(c=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([c],i,"jsonParsed",n)}));return(await this._rpcBatchRequest(o)).map(c=>{let l=G(c,Mu);if("error"in l)throw new ne(l.error,"failed to get transactions");return l.result})}async getTransactions(e,r){let{commitment:i,config:n}=Ue(r),o=e.map(c=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([c],i,void 0,n)}));return(await this._rpcBatchRequest(o)).map(c=>{let l=G(c,y0);if("error"in l)throw new ne(l.error,"failed to get transactions");let h=l.result;return h&&{...h,transaction:{...h.transaction,message:g0(h.version,h.transaction.message)}}})}async getConfirmedBlock(e,r){let i=this._buildArgsAtLeastConfirmed([e],r),n=await this._rpcRequest("getBlock",i),o=G(n,Y6);if("error"in o)throw new ne(o.error,"failed to get confirmed block");let a=o.result;if(!a)throw new Error("Confirmed block "+e+" not found");let s={...a,transactions:a.transactions.map(({transaction:c,meta:l})=>{let h=new Ln(c.message);return{meta:l,transaction:{...c,message:h}}})};return{...s,transactions:s.transactions.map(({transaction:c,meta:l})=>({meta:l,transaction:Ie.populate(c.message,c.signatures)}))}}async getBlocks(e,r,i){let n=this._buildArgsAtLeastConfirmed(r!==void 0?[e,r]:[e],i),o=await this._rpcRequest("getBlocks",n),a=G(o,ve(H(O())));if("error"in a)throw new ne(a.error,"failed to get blocks");return a.result}async getBlockSignatures(e,r){let i=this._buildArgsAtLeastConfirmed([e],r,void 0,{transactionDetails:"signatures",rewards:!1}),n=await this._rpcRequest("getBlock",i),o=G(n,mS);if("error"in o)throw new ne(o.error,"failed to get block");let a=o.result;if(!a)throw new Error("Block "+e+" not found");return a}async getConfirmedBlockSignatures(e,r){let i=this._buildArgsAtLeastConfirmed([e],r,void 0,{transactionDetails:"signatures",rewards:!1}),n=await this._rpcRequest("getBlock",i),o=G(n,mS);if("error"in o)throw new ne(o.error,"failed to get confirmed block");let a=o.result;if(!a)throw new Error("Confirmed block "+e+" not found");return a}async getConfirmedTransaction(e,r){let i=this._buildArgsAtLeastConfirmed([e],r),n=await this._rpcRequest("getTransaction",i),o=G(n,y0);if("error"in o)throw new ne(o.error,"failed to get transaction");let a=o.result;if(!a)return a;let s=new Ln(a.transaction.message),c=a.transaction.signatures;return{...a,transaction:Ie.populate(s,c)}}async getParsedConfirmedTransaction(e,r){let i=this._buildArgsAtLeastConfirmed([e],r,"jsonParsed"),n=await this._rpcRequest("getTransaction",i),o=G(n,Mu);if("error"in o)throw new ne(o.error,"failed to get confirmed transaction");return o.result}async getParsedConfirmedTransactions(e,r){let i=e.map(a=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([a],r,"jsonParsed")}));return(await this._rpcBatchRequest(i)).map(a=>{let s=G(a,Mu);if("error"in s)throw new ne(s.error,"failed to get confirmed transactions");return s.result})}async getConfirmedSignaturesForAddress(e,r,i){let n={},o=await this.getFirstAvailableBlock();for(;!("until"in n)&&(r--,!(r<=0||r<o));)try{let c=await this.getConfirmedBlockSignatures(r,"finalized");c.signatures.length>0&&(n.until=c.signatures[c.signatures.length-1].toString())}catch(c){if(c instanceof Error&&c.message.includes("skipped"))continue;throw c}let a=await this.getSlot("finalized");for(;!("before"in n)&&(i++,!(i>a));)try{let c=await this.getConfirmedBlockSignatures(i);c.signatures.length>0&&(n.before=c.signatures[c.signatures.length-1].toString())}catch(c){if(c instanceof Error&&c.message.includes("skipped"))continue;throw c}return(await this.getConfirmedSignaturesForAddress2(e,n)).map(c=>c.signature)}async getConfirmedSignaturesForAddress2(e,r,i){let n=this._buildArgsAtLeastConfirmed([e.toBase58()],i,void 0,r),o=await this._rpcRequest("getConfirmedSignaturesForAddress2",n),a=G(o,k6);if("error"in a)throw new ne(a.error,"failed to get confirmed signatures for address");return a.result}async getSignaturesForAddress(e,r,i){let n=this._buildArgsAtLeastConfirmed([e.toBase58()],i,void 0,r),o=await this._rpcRequest("getSignaturesForAddress",n),a=G(o,R6);if("error"in a)throw new ne(a.error,"failed to get signatures for address");return a.result}async getAddressLookupTable(e,r){let{context:i,value:n}=await this.getAccountInfoAndContext(e,r),o=null;return n!==null&&(o=new Hu({key:e,state:Hu.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=S0.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=G(i,n4);if("error"in n)throw new ne(n.error,`airdrop to ${e.toBase58()} failed`);return n.result}async _blockhashWithExpiryBlockHeight(e){if(!e){for(;this._pollingBlockhash;)await ai(100);let i=Date.now()-this._blockhashInfo.lastFetch>=K2;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 ai(RS/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}=Ue(e),n=this._buildArgs([],r,"base64",i),o=await this._rpcRequest("getStakeMinimumDelegation",n),a=G(o,tt(O()));if("error"in a)throw new ne(a.error,"failed to get stake minimum delegation");return a.result}async simulateTransaction(e,r,i){if("message"in e){let k=e.serialize(),R=ue.Buffer.from(k).toString("base64");if(Array.isArray(r)||i!==void 0)throw new Error("Invalid arguments");let z=r||{};z.encoding="base64","commitment"in z||(z.commitment=this.commitment),r&&typeof r=="object"&&"innerInstructions"in r&&(z.innerInstructions=r.innerInstructions);let F=[R,z],P=await this._rpcRequest("simulateTransaction",F),C=G(P,hS);if("error"in C)throw new Error("failed to simulate transaction: "+C.error.message);return C.result}let n;if(e instanceof Ie){let $=e;n=new Ie,n.feePayer=$.feePayer,n.instructions=e.instructions,n.nonceInfo=$.nonceInfo,n.signatures=$.signatures}else n=Ie.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 $=this._disableBlockhashCaching;for(;;){let k=await this._blockhashWithExpiryBlockHeight($);if(n.lastValidBlockHeight=k.lastValidBlockHeight,n.recentBlockhash=k.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 $=!0}}let a=n._compile(),s=a.serialize(),l=n._serialize(s).toString("base64"),h={encoding:"base64",commitment:this.commitment};if(i){let $=(Array.isArray(i)?i:a.nonProgramIds()).map(k=>k.toBase58());h.accounts={encoding:"base64",addresses:$}}o&&(h.sigVerify=!0),r&&typeof r=="object"&&"innerInstructions"in r&&(h.innerInstructions=r.innerInstructions);let g=[l,h],w=await this._rpcRequest("simulateTransaction",g),v=G(w,hS);if("error"in v){let $;if("data"in v.error&&($=v.error.data.logs,$&&Array.isArray($))){let k=`
|
|
51
|
+
`,R=k+$.join(k);console.error(v.error.message,R)}throw new Ra({action:"simulate",signature:"",transactionMessage:v.error.message,logs:$})}return v.result}async sendTransaction(e,r,i){if("version"in e){if(r&&Array.isArray(r))throw new Error("Invalid arguments");let a=e.serialize();return await this.sendRawTransaction(a,r)}if(r===void 0||!Array.isArray(r))throw new Error("Invalid arguments");let n=r;if(e.nonceInfo)e.sign(...n);else{let a=this._disableBlockhashCaching;for(;;){let s=await this._blockhashWithExpiryBlockHeight(a);if(e.lastValidBlockHeight=s.lastValidBlockHeight,e.recentBlockhash=s.blockhash,e.sign(...n),!e.signature)throw new Error("!signature");let c=e.signature.toString("base64");if(this._blockhashInfo.transactionSignatures.includes(c))a=!0;else{this._blockhashInfo.transactionSignatures.push(c);break}}}let o=e.serialize();return await this.sendRawTransaction(o,i)}async sendRawTransaction(e,r){let i=we(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 a=[e,i],s=await this._rpcRequest("sendTransaction",a),c=G(s,i4);if("error"in c){let l;throw"data"in c.error&&(l=c.error.data.logs),new Ra({action:n?"send":"simulate",signature:"",transactionMessage:c.error.message,logs:l})}return c.result}_wsOnOpen(){this._rpcWebSocketConnected=!0,this._rpcWebSocketHeartbeat=setInterval(()=>{(async()=>{try{await this._rpcWebSocket.notify("ping")}catch{}})()},5e3),this._updateSubscriptions()}_wsOnError(e){this._rpcWebSocketConnected=!1,console.error("ws error:",e.message)}_wsOnClose(e){if(this._rpcWebSocketConnected=!1,this._rpcWebSocketGeneration=(this._rpcWebSocketGeneration+1)%Number.MAX_SAFE_INTEGER,this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null),this._rpcWebSocketHeartbeat&&(clearInterval(this._rpcWebSocketHeartbeat),this._rpcWebSocketHeartbeat=null),e===1e3){this._updateSubscriptions();return}this._subscriptionCallbacksByServerSubscriptionId={},Object.entries(this._subscriptionsByHash).forEach(([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:a}=n;try{this._setSubscription(i,{...n,state:"subscribing"});let s=await this._rpcWebSocket.call(a,o);this._setSubscription(i,{...n,serverSubscriptionId:s,state:"subscribed"}),this._subscriptionCallbacksByServerSubscriptionId[s]=n.callbacks,await this._updateSubscriptions()}catch(s){if(console.error(`Received ${s instanceof Error?"":"JSON-RPC "}error calling \`${a}\``,{args:o,error:s}),!r())return;this._setSubscription(i,{...n,state:"pending"}),await this._updateSubscriptions()}})();break;case"subscribed":n.callbacks.size===0&&await(async()=>{let{serverSubscriptionId:o,unsubscribeMethod:a}=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(a,[o])}catch(s){if(s instanceof Error&&console.error(`${a} error:`,s.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}=G(e,A6);this._handleServerNotification(i,[r.value,r.context])}_makeSubscription(e,r){let i=this._nextClientSubscriptionId++,n=lS([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 a=this._subscriptionsByHash[n];Ae(a!==void 0,`Could not find a \`Subscription\` when tearing down client subscription #${i}`),a.callbacks.delete(e.callback),await this._updateSubscriptions()},this._updateSubscriptions(),i}onAccountChange(e,r,i){let{commitment:n,config:o}=Ue(i),a=this._buildArgs([e.toBase58()],n||this._commitment||"finalized","base64",o);return this._makeSubscription({callback:r,method:"accountSubscribe",unsubscribeMethod:"accountUnsubscribe"},a)}async removeAccountChangeListener(e){await this._unsubscribeClientSubscription(e,"account change")}_wsOnProgramAccountNotification(e){let{result:r,subscription:i}=G(e,O6);this._handleServerNotification(i,[{accountId:r.value.pubkey,accountInfo:r.value.account},r.context])}onProgramAccountChange(e,r,i,n){let{commitment:o,config:a}=Ue(i),s=this._buildArgs([e.toBase58()],o||this._commitment||"finalized","base64",a||(n?{filters:fS(n)}:void 0));return this._makeSubscription({callback:r,method:"programSubscribe",unsubscribeMethod:"programUnsubscribe"},s)}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}=G(e,a4);this._handleServerNotification(i,[r.value,r.context])}_wsOnSlotNotification(e){let{result:r,subscription:i}=G(e,N6);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}=G(e,L6);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 a={};i&&(a.encoding=i),o&&(a.commitment=o),n&&(a=Object.assign(a,n)),e.push(a)}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}=G(e,z6);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:(a,s)=>{if(a.type==="status"){r(a.result,s);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"},a=this._buildArgs([e],n,void 0,o),s=this._makeSubscription({callback:(c,l)=>{r(c,l);try{this.removeSignatureListener(s)}catch{}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},a);return s}async removeSignatureListener(e){await this._unsubscribeClientSubscription(e,"signature result")}_wsOnRootNotification(e){let{result:r,subscription:i}=G(e,B6);this._handleServerNotification(i,[r])}onRootChange(e){return this._makeSubscription({callback:e,method:"rootSubscribe",unsubscribeMethod:"rootUnsubscribe"},[])}async removeRootChangeListener(e){await this._unsubscribeClientSubscription(e,"root change")}},O0=class t{constructor(e){this._keypair=void 0,this._keypair=e??iS()}static generate(){return new t(iS())}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=w0(n);for(let a=0;a<32;a++)if(i[a]!==o[a])throw new Error("provided secretKey is invalid")}return new t({publicKey:i,secretKey:e})}static fromSeed(e){let r=w0(e),i=new Uint8Array(64);return i.set(e),i.set(r,32),new t({publicKey:r,secretKey:i})}get publicKey(){return new de(this._keypair.publicKey)}get secretKey(){return new Uint8Array(this._keypair.secretKey)}},Ea=Object.freeze({CreateLookupTable:{index:0,layout:E.struct([E.u32("instruction"),mo("recentSlot"),E.u8("bumpSeed")])},FreezeLookupTable:{index:1,layout:E.struct([E.u32("instruction")])},ExtendLookupTable:{index:2,layout:E.struct([E.u32("instruction"),mo(),E.seq(be(),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 T0=class{constructor(){}static createLookupTable(e){let[r,i]=de.findProgramAddressSync([e.authority.toBuffer(),qg().encode(e.recentSlot)],this.programId),n=Ea.CreateLookupTable,o=xe(n,{recentSlot:BigInt(e.recentSlot),bumpSeed:i}),a=[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1},{pubkey:e.payer,isSigner:!0,isWritable:!0},{pubkey:Yt.programId,isSigner:!1,isWritable:!1}];return[new ze({programId:this.programId,keys:a,data:o}),r]}static freezeLookupTable(e){let r=Ea.FreezeLookupTable,i=xe(r),n=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return new ze({programId:this.programId,keys:n,data:i})}static extendLookupTable(e){let r=Ea.ExtendLookupTable,i=xe(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:Yt.programId,isSigner:!1,isWritable:!1}),new ze({programId:this.programId,keys:n,data:i})}static deactivateLookupTable(e){let r=Ea.DeactivateLookupTable,i=xe(r),n=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return new ze({programId:this.programId,keys:n,data:i})}static closeLookupTable(e){let r=Ea.CloseLookupTable,i=xe(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 ze({programId:this.programId,keys:n,data:i})}};T0.programId=new de("AddressLookupTab1e1111111111111111111111111");var ju=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"),mo("microLamports")])}}),N0=class{constructor(){}static requestUnits(e){let r=ju.RequestUnits,i=xe(r,e);return new ze({keys:[],programId:this.programId,data:i})}static requestHeapFrame(e){let r=ju.RequestHeapFrame,i=xe(r,e);return new ze({keys:[],programId:this.programId,data:i})}static setComputeUnitLimit(e){let r=ju.SetComputeUnitLimit,i=xe(r,e);return new ze({keys:[],programId:this.programId,data:i})}static setComputeUnitPrice(e){let r=ju.SetComputeUnitPrice,i=xe(r,{microLamports:BigInt(e.microLamports)});return new ze({keys:[],programId:this.programId,data:i})}};N0.programId=new de("ComputeBudget111111111111111111111111111111");var gS=64,yS=32,_S=64,vS=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")]),P0=class t{constructor(){}static createInstructionWithPublicKey(e){let{publicKey:r,message:i,signature:n,instructionIndex:o}=e;Ae(r.length===yS,`Public Key must be ${yS} bytes but received ${r.length} bytes`),Ae(n.length===_S,`Signature must be ${_S} bytes but received ${n.length} bytes`);let a=vS.span,s=a+r.length,c=s+n.length,l=1,h=ue.Buffer.alloc(c+i.length),g=o??65535;return vS.encode({numSignatures:l,padding:0,signatureOffset:s,signatureInstructionIndex:g,publicKeyOffset:a,publicKeyInstructionIndex:g,messageDataOffset:c,messageDataSize:i.length,messageInstructionIndex:g},h),h.fill(r,a),h.fill(n,s),h.fill(i,c),new ze({keys:[],programId:t.programId,data:h})}static createInstructionWithPrivateKey(e){let{privateKey:r,message:i,instructionIndex:n}=e;Ae(r.length===gS,`Private key must be ${gS} bytes but received ${r.length} bytes`);try{let o=O0.fromSecretKey(r),a=o.publicKey.toBytes(),s=z0(i,o.secretKey);return this.createInstructionWithPublicKey({publicKey:a,message:i,signature:s,instructionIndex:n})}catch(o){throw new Error(`Error creating instruction; ${o}`)}}};P0.programId=new de("Ed25519SigVerify111111111111111111111111111");var c4=(t,e)=>{let r=xa.sign(t,e);return[r.toCompactRawBytes(),r.recovery]};xa.utils.isValidPrivateKey;var u4=xa.getPublicKey,bS=32,_0=20,wS=64,l4=11,v0=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")]),L0=class t{constructor(){}static publicKeyToEthAddress(e){Ae(e.length===wS,`Public key must be ${wS} bytes but received ${e.length} bytes`);try{return ue.Buffer.from(s0(we(e))).slice(-_0)}catch(r){throw new Error(`Error constructing Ethereum address: ${r}`)}}static createInstructionWithPublicKey(e){let{publicKey:r,message:i,signature:n,recoveryId:o,instructionIndex:a}=e;return t.createInstructionWithEthAddress({ethAddress:t.publicKeyToEthAddress(r),message:i,signature:n,recoveryId:o,instructionIndex:a})}static createInstructionWithEthAddress(e){let{ethAddress:r,message:i,signature:n,recoveryId:o,instructionIndex:a=0}=e,s;typeof r=="string"?r.startsWith("0x")?s=ue.Buffer.from(r.substr(2),"hex"):s=ue.Buffer.from(r,"hex"):s=r,Ae(s.length===_0,`Address must be ${_0} bytes but received ${s.length} bytes`);let c=1+l4,l=c,h=c+s.length,g=h+n.length+1,w=1,v=ue.Buffer.alloc(v0.span+i.length);return v0.encode({numSignatures:w,signatureOffset:h,signatureInstructionIndex:a,ethAddressOffset:l,ethAddressInstructionIndex:a,messageDataOffset:g,messageDataSize:i.length,messageInstructionIndex:a,signature:we(n),ethAddress:we(s),recoveryId:o},v),v.fill(we(i),v0.span),new ze({keys:[],programId:t.programId,data:v})}static createInstructionWithPrivateKey(e){let{privateKey:r,message:i,instructionIndex:n}=e;Ae(r.length===bS,`Private key must be ${bS} bytes but received ${r.length} bytes`);try{let o=we(r),a=u4(o,!1).slice(1),s=ue.Buffer.from(s0(we(i))),[c,l]=c4(s,o);return this.createInstructionWithPublicKey({publicKey:a,message:i,signature:c,recoveryId:l,instructionIndex:n})}catch(o){throw new Error(`Error creating instruction; ${o}`)}}};L0.programId=new de("KeccakSecp256k11111111111111111111111111111");var DS,d4=new de("StakeConfig11111111111111111111111111111111");var $a=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}};DS=$a;$a.default=new DS(0,0,de.default);var Nn=Object.freeze({Initialize:{index:0,layout:E.struct([E.u32("instruction"),k2(),R2()])},Authorize:{index:1,layout:E.struct([E.u32("instruction"),be("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"),be("newAuthorized"),E.u32("stakeAuthorizationType"),ho("authoritySeed"),be("authorityOwner")])}}),JC=Object.freeze({Staker:{index:0},Withdrawer:{index:1}}),Xu=class{constructor(){}static initialize(e){let{stakePubkey:r,authorized:i,lockup:n}=e,o=n||$a.default,a=Nn.Initialize,s=xe(a,{authorized:{staker:we(i.staker.toBuffer()),withdrawer:we(i.withdrawer.toBuffer())},lockup:{unixTimestamp:o.unixTimestamp,epoch:o.epoch,custodian:we(o.custodian.toBuffer())}}),c={keys:[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:ka,isSigner:!1,isWritable:!1}],programId:this.programId,data:s};return new ze(c)}static createAccountWithSeed(e){let r=new Ie;r.add(Yt.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 Ie;r.add(Yt.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=Nn.Delegate,a=xe(o);return new Ie().add({keys:[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!1},{pubkey:Xr,isSigner:!1,isWritable:!1},{pubkey:h0,isSigner:!1,isWritable:!1},{pubkey:d4,isSigner:!1,isWritable:!1},{pubkey:i,isSigner:!0,isWritable:!1}],programId:this.programId,data:a})}static authorize(e){let{stakePubkey:r,authorizedPubkey:i,newAuthorizedPubkey:n,stakeAuthorizationType:o,custodianPubkey:a}=e,s=Nn.Authorize,c=xe(s,{newAuthorized:we(n.toBuffer()),stakeAuthorizationType:o.index}),l=[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:Xr,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!0,isWritable:!1}];return a&&l.push({pubkey:a,isSigner:!0,isWritable:!1}),new Ie().add({keys:l,programId:this.programId,data:c})}static authorizeWithSeed(e){let{stakePubkey:r,authorityBase:i,authoritySeed:n,authorityOwner:o,newAuthorizedPubkey:a,stakeAuthorizationType:s,custodianPubkey:c}=e,l=Nn.AuthorizeWithSeed,h=xe(l,{newAuthorized:we(a.toBuffer()),stakeAuthorizationType:s.index,authoritySeed:n,authorityOwner:we(o.toBuffer())}),g=[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!0,isWritable:!1},{pubkey:Xr,isSigner:!1,isWritable:!1}];return c&&g.push({pubkey:c,isSigner:!0,isWritable:!1}),new Ie().add({keys:g,programId:this.programId,data:h})}static splitInstruction(e){let{stakePubkey:r,authorizedPubkey:i,splitStakePubkey:n,lamports:o}=e,a=Nn.Split,s=xe(a,{lamports:o});return new ze({keys:[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!0,isWritable:!1}],programId:this.programId,data:s})}static split(e,r){let i=new Ie;return i.add(Yt.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:a,seed:s,lamports:c}=e,l=new Ie;return l.add(Yt.allocate({accountPubkey:o,basePubkey:a,seed:s,space:this.space,programId:this.programId})),r&&r>0&&l.add(Yt.transfer({fromPubkey:e.authorizedPubkey,toPubkey:o,lamports:r})),l.add(this.splitInstruction({stakePubkey:i,authorizedPubkey:n,splitStakePubkey:o,lamports:c}))}static merge(e){let{stakePubkey:r,sourceStakePubKey:i,authorizedPubkey:n}=e,o=Nn.Merge,a=xe(o);return new Ie().add({keys:[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:Xr,isSigner:!1,isWritable:!1},{pubkey:h0,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:a})}static withdraw(e){let{stakePubkey:r,authorizedPubkey:i,toPubkey:n,lamports:o,custodianPubkey:a}=e,s=Nn.Withdraw,c=xe(s,{lamports:o}),l=[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:Xr,isSigner:!1,isWritable:!1},{pubkey:h0,isSigner:!1,isWritable:!1},{pubkey:i,isSigner:!0,isWritable:!1}];return a&&l.push({pubkey:a,isSigner:!0,isWritable:!1}),new Ie().add({keys:l,programId:this.programId,data:c})}static deactivate(e){let{stakePubkey:r,authorizedPubkey:i}=e,n=Nn.Deactivate,o=xe(n);return new Ie().add({keys:[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:Xr,isSigner:!1,isWritable:!1},{pubkey:i,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}};Xu.programId=new de("Stake11111111111111111111111111111111111111");Xu.space=200;var Ia=Object.freeze({InitializeAccount:{index:0,layout:E.struct([E.u32("instruction"),A2()])},Authorize:{index:1,layout:E.struct([E.u32("instruction"),be("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"),$2()])}}),YC=Object.freeze({Voter:{index:0},Withdrawer:{index:1}}),Qu=class t{constructor(){}static initializeAccount(e){let{votePubkey:r,nodePubkey:i,voteInit:n}=e,o=Ia.InitializeAccount,a=xe(o,{voteInit:{nodePubkey:we(n.nodePubkey.toBuffer()),authorizedVoter:we(n.authorizedVoter.toBuffer()),authorizedWithdrawer:we(n.authorizedWithdrawer.toBuffer()),commission:n.commission}}),s={keys:[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:ka,isSigner:!1,isWritable:!1},{pubkey:Xr,isSigner:!1,isWritable:!1},{pubkey:i,isSigner:!0,isWritable:!1}],programId:this.programId,data:a};return new ze(s)}static createAccount(e){let r=new Ie;return r.add(Yt.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,a=Ia.Authorize,s=xe(a,{newAuthorized:we(n.toBuffer()),voteAuthorizationType:o.index}),c=[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:Xr,isSigner:!1,isWritable:!1},{pubkey:i,isSigner:!0,isWritable:!1}];return new Ie().add({keys:c,programId:this.programId,data:s})}static authorizeWithSeed(e){let{currentAuthorityDerivedKeyBasePubkey:r,currentAuthorityDerivedKeyOwnerPubkey:i,currentAuthorityDerivedKeySeed:n,newAuthorizedPubkey:o,voteAuthorizationType:a,votePubkey:s}=e,c=Ia.AuthorizeWithSeed,l=xe(c,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:we(i.toBuffer()),currentAuthorityDerivedKeySeed:n,newAuthorized:we(o.toBuffer()),voteAuthorizationType:a.index}}),h=[{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:Xr,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return new Ie().add({keys:h,programId:this.programId,data:l})}static withdraw(e){let{votePubkey:r,authorizedWithdrawerPubkey:i,lamports:n,toPubkey:o}=e,a=Ia.Withdraw,s=xe(a,{lamports:n}),c=[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:o,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!0,isWritable:!1}];return new Ie().add({keys:c,programId:this.programId,data:s})}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=Ia.UpdateValidatorIdentity,a=xe(o),s=[{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1},{pubkey:i,isSigner:!0,isWritable:!1}];return new Ie().add({keys:s,programId:this.programId,data:a})}};Qu.programId=new de("Vote111111111111111111111111111111111111111");Qu.space=3762;var XC=new de("Va1idator1nfo111111111111111111111111111111"),QC=U({name:K(),website:ae(K()),details:ae(K()),iconUrl:ae(K()),keybaseUsername:ae(K())});var e3=new de("Vote111111111111111111111111111111111111111"),t3=E.struct([be("nodePubkey"),be("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"),be("authorizedVoter")]),E.offset(E.u32(),-8),"authorizedVoters"),E.struct([E.seq(E.struct([be("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 M0=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 j0(t){return Buffer.from(t.serialize({verifySignatures:!1})).toString("base64")}function F0(t){let e=Buffer.from(t,"base64");return el.deserializeMessageVersion(e)==="legacy"?Gu.deserialize(e):Ie.from(e)}function f4(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:F0(i),options:n};return await t({method:"signAndSendTransaction",params:o})}if(r.method==="signTransaction"){let{transaction:i}=r.params,n={transaction:F0(i)},{signedTransaction:o}=await t({method:"signTransaction",params:n});return{signedTransaction:j0(o)}}}}function Z0(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}=r.params,n={transaction:j0(i)};return await t({method:"signAndSendTransaction",params:n})}if(r.method==="signTransaction"){let{transaction:i}=r.params,n={transaction:j0(i)},{signedTransaction:o}=await t({method:"signTransaction",params:n});return{signedTransaction:F0(o)}}}}var MS=({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=h4({back:this,emitter:e})},async disableWebNavigation(){r?.(),r=void 0}}};function h4({emitter:t,back:e}){let r=p4();if(r)return m4({emitter:t,back:e,navigation:r});if(typeof window<"u")return g4({emitter:t,back:e,window})}function p4(){if(typeof window<"u"&&window.navigation!==void 0)return window.navigation}function m4({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 g4({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 jS="0.1.1";function FS(){return jS}var di=class t extends Error{static setStaticOptions(e){t.prototype.docsOrigin=e.docsOrigin,t.prototype.showVersion=e.showVersion,t.prototype.version=e.version}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=r.cause instanceof t&&r.cause.docsPath||r.docsPath,o=r.docsOrigin??t.prototype.docsOrigin,a=`${o}${n??""}`,s=!!(r.version??t.prototype.showVersion),c=r.version??t.prototype.version,l=[e||"An error occurred.",...r.metaMessages?["",...r.metaMessages]:[],...i||n||s?["",i?`Details: ${i}`:void 0,n?`See: ${a}`:void 0,s?`Version: ${c}`:void 0]:[]].filter(h=>typeof h=="string").join(`
|
|
52
|
+
`);super(l,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,"docsOrigin",{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,"showVersion",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{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"}),this.cause=r.cause,this.details=i,this.docs=a,this.docsOrigin=o,this.docsPath=n,this.shortMessage=e,this.showVersion=s,this.version=c}walk(e){return ZS(this,e)}};Object.defineProperty(di,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:`ox@${FS()}`}});di.setStaticOptions(di.defaultStaticOptions);function ZS(t,e){return e?.(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause?ZS(t.cause,e):e?null:t}function nl(t,e={}){let{raw:r=!1}=e,i=t;if(r)return t;if(i.error)throw V0(i.error);return i.result}function V0(t){let e=t;if(e instanceof Error&&!("code"in e))return new kr({cause:e,data:e,message:e.message,stack:e.stack});let{code:r}=e;return r===kr.code?new kr(e):r===Oa.code?new Oa(e):r===Da.code?new Da(e):r===Ua.code?new Ua(e):r===za.code?new za(e):r===Ca.code?new Ca(e):r===La.code?new La(e):r===Ma.code?new Ma(e):r===Ta.code?new Ta(e):r===Na.code?new Na(e):r===Pa.code?new Pa(e):r===Ba.code?new Ba(e):new kr({cause:e instanceof Error?e:void 0,data:e,message:e.message,stack:e instanceof Error?e.stack:void 0})}var Vt=class extends Error{constructor(e){let{cause:r,code:i,message:n,data:o,stack:a}=e;super(n,{cause:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.BaseError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"stack",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),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.cause=r,this.code=i,this.data=o,this.stack=a??""}},Oa=class t extends Vt{constructor(e={}){super({code:t.code,data:e.data,message:e.message??"Missing or invalid parameters."}),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(Oa,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});var Ta=class t extends Vt{constructor(e={}){super({code:t.code,data:e.data,message:e.message??"Requested resource not found."}),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(Ta,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});var Na=class t extends Vt{constructor(e={}){super({code:t.code,data:e.data,message:e.message??"Requested resource not available."}),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(Na,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});var Pa=class t extends Vt{constructor(e={}){super({code:t.code,data:e.data,message:e.message??"Transaction creation failed."}),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(Pa,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});var La=class t extends Vt{constructor(e={}){super({code:t.code,data:e.data,message:e.message??"Method is not implemented."}),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(La,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});var za=class t extends Vt{constructor(e={}){super({code:t.code,data:e.data,message:e.message??"Rate limit exceeded."}),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(za,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});var Ba=class t extends Vt{constructor(e={}){super({code:t.code,data:e.data,message:e.message??"JSON-RPC version not supported."}),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(Ba,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});var Ua=class t extends Vt{constructor(e={}){super({code:t.code,data:e.data,message:e.message??"Input is not a valid JSON-RPC request."}),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(Ua,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});var Ca=class t extends Vt{constructor(e={}){super({code:t.code,data:e.data,message:e.message??"Method does not exist."}),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(Ca,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});var Da=class t extends Vt{constructor(e={}){super({code:t.code,data:e.data,message:e.message??"Invalid method parameters."}),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(Da,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});var kr=class t extends Vt{constructor(e={}){super({cause:e.cause,code:t.code,data:e.data,message:e.message??"Internal JSON-RPC error.",stack:e.stack}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.InternalError"})}};Object.defineProperty(kr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});var Ma=class t extends Vt{constructor(e={}){super({code:t.code,data:e.data,message:e.message??"Failed to parse JSON-RPC response."}),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(Ma,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});var Ot=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}},fi=class extends Ot{constructor({message:e="The user rejected the request."}={}){super(4001,e),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.UserRejectedRequestError"})}};Object.defineProperty(fi,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});var hi=class extends Ot{constructor({message:e="The requested method and/or account has not been authorized by the user."}={}){super(4100,e),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.UnauthorizedError"})}};Object.defineProperty(hi,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});var pi=class extends Ot{constructor({message:e="The provider does not support the requested method."}={}){super(4200,e),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.UnsupportedMethodError"})}};Object.defineProperty(pi,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});var mi=class extends Ot{constructor({message:e="The provider is disconnected from all chains."}={}){super(4900,e),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.DisconnectedError"})}};Object.defineProperty(mi,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});var gi=class extends Ot{constructor({message:e="The provider is not connected to the requested chain."}={}){super(4901,e),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.ChainDisconnectedError"})}};Object.defineProperty(gi,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});var ja=class extends Ot{constructor({message:e="An error occurred when attempting to switch chain."}={}){super(4902,e),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.SwitchChainError"})}};Object.defineProperty(ja,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});var Fa=class extends Ot{constructor({message:e="This Wallet does not support a capability that was not marked as optional."}={}){super(5700,e),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.UnsupportedNonOptionalCapabilityError"})}};Object.defineProperty(Fa,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});var Za=class extends Ot{constructor({message:e="This Wallet does not support the requested chain ID."}={}){super(5710,e),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.UnsupportedChainIdError"})}};Object.defineProperty(Za,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});var Va=class extends Ot{constructor({message:e="There is already a bundle submitted with this ID."}={}){super(5720,e),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.DuplicateIdError"})}};Object.defineProperty(Va,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});var Ka=class extends Ot{constructor({message:e="This bundle id is unknown / has not been submitted."}={}){super(5730,e),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.UnknownBundleIdError"})}};Object.defineProperty(Ka,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});var Wa=class extends Ot{constructor({message:e="The call bundle is too large for the Wallet to process."}={}){super(5740,e),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.BundleTooLargeError"})}};Object.defineProperty(Wa,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});var qa=class extends Ot{constructor({message:e="The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."}={}){super(5750,e),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.AtomicReadyWalletRejectedUpgradeError"})}};Object.defineProperty(qa,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});var Ga=class extends Ot{constructor({message:e="The wallet does not support atomic execution but the request requires it."}={}){super(5760,e),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.AtomicityNotSupportedError"})}};Object.defineProperty(Ga,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});function KS(){let t=new oi.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 WS(t,e={}){if(!t)throw new K0;return{...t,async request(r){try{let i=await t.request(r);return i&&typeof i=="object"&&"jsonrpc"in i?nl(i):i}catch(i){throw _4(i)}}}}function _4(t){let e=V0(t);if(e instanceof kr){if(!e.data)return e;let{code:r}=e.data;if(r===mi.code)return new mi(e);if(r===gi.code)return new gi(e);if(r===fi.code)return new fi(e);if(r===hi.code)return new hi(e);if(r===pi.code)return new pi(e);if(r===ja.code)return new ja(e);if(r===qa.code)return new qa(e);if(r===Ga.code)return new Ga(e);if(r===Wa.code)return new Wa(e);if(r===Ka.code)return new Ka(e);if(r===Va.code)return new Va(e);if(r===Za.code)return new Za(e);if(r===Fa.code)return new Fa(e)}return e}var K0=class extends di{constructor(){super("`provider` is undefined."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.IsUndefinedError"})}};function qS(t={}){let e=t.id??0;return{prepare(r){return b4({id:e++,...r})},get id(){return e}}}function b4(t){return{...t,jsonrpc:"2.0"}}var HS=Symbol("Comlink.proxy"),x4=Symbol("Comlink.endpoint"),S4=Symbol("Comlink.releaseProxy"),W0=Symbol("Comlink.finalizer"),ol=Symbol("Comlink.thrown"),JS=t=>typeof t=="object"&&t!==null||typeof t=="function",E4={canHandle:t=>JS(t)&&t[HS],serialize(t){let{port1:e,port2:r}=new MessageChannel;return XS(t,e),[r,[r]]},deserialize(t){return t.start(),G0(t)}},I4={canHandle:t=>JS(t)&&ol 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}},YS=new Map([["proxy",E4],["throw",I4]]);function k4(t,e){for(let r of t)if(e===r||r==="*"||r instanceof RegExp&&r.test(e))return!0;return!1}function XS(t,e=globalThis,r=["*"]){e.addEventListener("message",function i(n){if(!n||!n.data)return;if(!k4(r,n.origin)){console.warn(`Invalid origin '${n.origin}' for comlink proxy`);return}let{id:o,type:a,path:s}=Object.assign({path:[]},n.data),c=(n.data.argumentList||[]).map(yi),l;try{let h=s.slice(0,-1).reduce((w,v)=>w[v],t),g=s.reduce((w,v)=>w[v],t);switch(a){case"GET":l=g;break;case"SET":h[s.slice(-1)[0]]=yi(n.data.value),l=!0;break;case"APPLY":l=g.apply(h,c);break;case"CONSTRUCT":{let w=new g(...c);l=N4(w)}break;case"ENDPOINT":{let{port1:w,port2:v}=new MessageChannel;XS(t,v),l=T4(w,[w])}break;case"RELEASE":l=void 0;break;default:return}}catch(h){l={value:h,[ol]:0}}Promise.resolve(l).catch(h=>({value:h,[ol]:0})).then(h=>{let[g,w]=cl(h);e.postMessage(Object.assign(Object.assign({},g),{id:o}),w),a==="RELEASE"&&(e.removeEventListener("message",i),QS(e),W0 in t&&typeof t[W0]=="function"&&t[W0]())}).catch(h=>{let[g,w]=cl({value:new TypeError("Unserializable return value"),[ol]:0});e.postMessage(Object.assign(Object.assign({},g),{id:o}),w)})}),e.start&&e.start()}function R4(t){return t.constructor.name==="MessagePort"}function QS(t){R4(t)&&t.close()}function G0(t,e){let r=new Map;return t.addEventListener("message",function(n){let{data:o}=n;if(!o||!o.id)return;let a=r.get(o.id);if(a)try{a(o)}finally{r.delete(o.id)}}),q0(t,r,[],e)}function il(t){if(t)throw new Error("Proxy has been released and is not useable")}function e1(t){return _o(t,new Map,{type:"RELEASE"}).then(()=>{QS(t)})}var al=new WeakMap,sl="FinalizationRegistry"in globalThis&&new FinalizationRegistry(t=>{let e=(al.get(t)||0)-1;al.set(t,e),e===0&&e1(t)});function A4(t,e){let r=(al.get(e)||0)+1;al.set(e,r),sl&&sl.register(t,e,t)}function $4(t){sl&&sl.unregister(t)}function q0(t,e,r=[],i=function(){}){let n=!1,o=new Proxy(i,{get(a,s){if(il(n),s===S4)return()=>{$4(o),e1(t),e.clear(),n=!0};if(s==="then"){if(r.length===0)return{then:()=>o};let c=_o(t,e,{type:"GET",path:r.map(l=>l.toString())}).then(yi);return c.then.bind(c)}return q0(t,e,[...r,s])},set(a,s,c){il(n);let[l,h]=cl(c);return _o(t,e,{type:"SET",path:[...r,s].map(g=>g.toString()),value:l},h).then(yi)},apply(a,s,c){il(n);let l=r[r.length-1];if(l===x4)return _o(t,e,{type:"ENDPOINT"}).then(yi);if(l==="bind")return q0(t,e,r.slice(0,-1));let[h,g]=GS(c);return _o(t,e,{type:"APPLY",path:r.map(w=>w.toString()),argumentList:h},g).then(yi)},construct(a,s){il(n);let[c,l]=GS(s);return _o(t,e,{type:"CONSTRUCT",path:r.map(h=>h.toString()),argumentList:c},l).then(yi)}});return A4(o,t),o}function O4(t){return Array.prototype.concat.apply([],t)}function GS(t){let e=t.map(cl);return[e.map(r=>r[0]),O4(e.map(r=>r[1]))]}var t1=new WeakMap;function T4(t,e){return t1.set(t,e),t}function N4(t){return Object.assign(t,{[HS]:!0})}function r1(t,e=globalThis,r="*"){return{postMessage:(i,n)=>t.postMessage(i,r,n),addEventListener:e.addEventListener.bind(e),removeEventListener:e.removeEventListener.bind(e)}}function cl(t){for(let[e,r]of YS)if(r.canHandle(t)){let[i,n]=r.serialize(t);return[{type:"HANDLER",name:e,value:i},n]}return[{type:"RAW",value:t},t1.get(t)||[]]}function yi(t){switch(t.type){case"HANDLER":return YS.get(t.name).deserialize(t.value);case"RAW":return t.value}}function _o(t,e,r,i){return new Promise(n=>{let o=P4();e.set(o,n),t.start&&t.start(),t.postMessage(Object.assign({id:o},r),i)})}function P4(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}var L4={postMessage(){},addEventListener:()=>{},removeEventListener:()=>{}},z4={postMessage:t=>{window.ReactNativeWebView.postMessage(JSON.stringify(t))},addEventListener:(t,e,...r)=>{document.addEventListener("FarcasterFrameCallback",e,...r)},removeEventListener:(t,e)=>{document.removeEventListener("FarcasterFrameCallback",e)}},n1=typeof window>"u"?L4:window?.ReactNativeWebView?z4:r1(window?.parent??window);var se=G0(n1);var H0=KS(),B4=qS();function U4({code:t,details:e}){switch(t){case 4001:return new fi;case 4100:return new hi;case 4200:return new pi;case 4900:return new mi;case 4901:return new gi;default:return new Ot(t,e??"Unknown provider RPC error")}}var C4={...H0,async request(t){let e=B4.prepare(t);try{let r=await se.ethProviderRequestV2(e).then(i=>nl(i,{request:e,raw:!0}));if(r.error)throw U4(r.error);return r.result}catch(r){if(r instanceof Error&&r.message.match(/cannot read property 'apply'/i))return await se.ethProviderRequest(e);throw r instanceof Ot||r instanceof Vt?r:new kr({message:r instanceof Error?r.message:void 0})}}},vo=WS(C4);async function i1(){try{let t=await se.getCapabilities();return!t.includes("wallet.getEthereumProvider")&&!t.includes("wallet.getEvmProvider")?void 0:vo}catch{return vo}}function o1(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",()=>{se.eip6963RequestProvider()}),document.addEventListener("FarcasterFrameEthProviderEvent",t=>{if(t instanceof MessageEvent){let e=t.data;H0.emit(e.event,...e.params)}}),document.addEventListener("FarcasterFrameEvent",t=>{if(t instanceof MessageEvent){let e=t.data;e.event==="eip6963:announceProvider"&&o1({info:e.info,provider:vo})}}));typeof window<"u"&&(window.addEventListener("eip6963:requestProvider",()=>{se.eip6963RequestProvider()}),window.addEventListener("message",t=>{if(t instanceof MessageEvent&&t.data.type==="frameEthProviderEvent"){let e=t.data;H0.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"&&o1({info:e.info,provider:vo})}}));var ly={};Et(ly,{quickAuth:()=>wo});var D4=new TextEncoder,ul=new TextDecoder,$3=2**32;var M4=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},a1=t=>{let e=t;e instanceof Uint8Array&&(e=ul.decode(e)),e=e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return M4(e)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}};var s1=a1;function F4(t){return typeof t=="object"&&t!==null}function J0(t){if(!F4(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 Lt=class extends Error{constructor(e,r){super(e,r),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}};Lt.code="ERR_JOSE_GENERIC";var Y0=class extends Lt{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}};Y0.code="ERR_JWT_CLAIM_VALIDATION_FAILED";var X0=class extends Lt{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}};X0.code="ERR_JWT_EXPIRED";var Q0=class extends Lt{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}};Q0.code="ERR_JOSE_ALG_NOT_ALLOWED";var ey=class extends Lt{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}};ey.code="ERR_JOSE_NOT_SUPPORTED";var ty=class extends Lt{constructor(e="decryption operation failed",r){super(e,r),this.code="ERR_JWE_DECRYPTION_FAILED"}};ty.code="ERR_JWE_DECRYPTION_FAILED";var ry=class extends Lt{constructor(){super(...arguments),this.code="ERR_JWE_INVALID"}};ry.code="ERR_JWE_INVALID";var ny=class extends Lt{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}};ny.code="ERR_JWS_INVALID";var Rr=class extends Lt{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}};Rr.code="ERR_JWT_INVALID";var iy=class extends Lt{constructor(){super(...arguments),this.code="ERR_JWK_INVALID"}};iy.code="ERR_JWK_INVALID";var oy=class extends Lt{constructor(){super(...arguments),this.code="ERR_JWKS_INVALID"}};oy.code="ERR_JWKS_INVALID";var ay=class extends Lt{constructor(e="no applicable key found in the JSON Web Key Set",r){super(e,r),this.code="ERR_JWKS_NO_MATCHING_KEY"}};ay.code="ERR_JWKS_NO_MATCHING_KEY";var sy=class extends Lt{constructor(e="multiple matching keys found in the JSON Web Key Set",r){super(e,r),this.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS"}};sy.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";var cy=class extends Lt{constructor(e="request timed out",r){super(e,r),this.code="ERR_JWKS_TIMEOUT"}};cy.code="ERR_JWKS_TIMEOUT";var uy=class extends Lt{constructor(e="signature verification failed",r){super(e,r),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}};uy.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";function c1(t){if(typeof t!="string")throw new Rr("JWTs must use Compact JWS serialization, JWT must be a string");let{1:e,length:r}=t.split(".");if(r===5)throw new Rr("Only JWTs using Compact JWS serialization can be decoded");if(r!==3)throw new Rr("Invalid JWT");if(!e)throw new Rr("JWTs must contain a payload");let i;try{i=s1(e)}catch{throw new Rr("Failed to base64url decode the payload")}let n;try{n=JSON.parse(ul.decode(i))}catch{throw new Rr("Failed to parse the decoded payload as JSON")}if(!J0(n))throw new Rr("Invalid JWT Claims Set");return n}function u1(t){return c1(t)}var ll=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(`
|
|
53
|
+
`);super(n,r.cause?{cause:r.cause}:void 0),this.name="BaseError",this.cause=r.cause,this.details=i,this.shortMessage=e}},bo=class extends ll{constructor({status:e}){super(`Request failed with status ${e}`),this.name="RequestFailedError"}},dl=class extends ll{constructor(e){super(e),this.name="InvalidToken"}};async function l1({origin:t}){let e=await fetch(`${t}/nonce`,{method:"POST"});if(!e.ok)throw new bo({status:e.status});return await e.json()}async function d1({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 bo({status:r.status});let i=await r.json();if(i.valid===!1)throw new dl(i.message??"unknown");return{token:i.token}}function f1(t={}){return{origin:t.origin??"https://auth.farcaster.xyz"}}function h1(t={}){let e=f1(t);return{generateNonce:()=>l1(e),verifySiwf:r=>d1(e,r)}}var Z4=/^(?:(?<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)?/,V4=/(?: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 p1(t){let{scheme:e,statement:r,...i}=t.match(Z4)?.groups??{},{chainId:n,expirationTime:o,issuedAt:a,notBefore:s,requestId:c,...l}=t.match(V4)?.groups??{},h=t.split("Resources:")[1]?.split(`
|
|
54
|
+
- `).slice(1);return{...i,...l,...n?{chainId:Number(n)}:{},...o?{expirationTime:new Date(o)}:{},...a?{issuedAt:new Date(a)}:{},...s?{notBefore:new Date(s)}:{},...c?{requestId:c}:{},...h?{resources:h}:{},...e?{scheme:e}:{},...r?{statement:r}:{}}}var wo=(()=>{let t,e;async function r(i){let n=h1({origin:i.quickAuthServerOrigin}),{nonce:o}=await n.generateNonce(),a=await se.signIn({nonce:o,acceptAuthAddress:!0});if(a.result){let s=p1(a.result.message);if(!s.domain)throw new Error("Missing domain on SIWE message");let c=await n.verifySiwf({domain:s.domain,message:a.result.message,signature:a.result.signature});return t={token:c.token,payload:u1(c.token)},c}throw a.error.type==="rejected_by_user"?new zn.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(),a=new Headers(n?.headers);return a.set("Authorization",`Bearer ${o}`),fetch(i,{...n,headers:a})}}})();function W4(){let t=new jx;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 zt=W4();var{solanaProviderRequest:m1}=se,g1;m1&&(g1=M0(Z0(m1)));async function dy(){let t;try{t=await se.getCapabilities()}catch{}if(t?.includes("wallet.getSolanaProvider"))return g1}var y1=null;async function q4(t=1e3){if(y1===!0)return!0;if(typeof window>"u"||!window.ReactNativeWebView&&window===window.parent)return!1;let e=await Promise.race([se.context.then(r=>!!r),new Promise(r=>{setTimeout(()=>r(!1),t)})]).catch(()=>!1);return e&&(y1=!0),e}var _1=async()=>{let t=await se.addFrame();if(t.result)return t.result;throw t.error.type==="invalid_domain_manifest"?new bi.InvalidDomainManifest:t.error.type==="rejected_by_user"?new bi.RejectedByUser:new Error("Unreachable")},fy={...zt,getCapabilities:se.getCapabilities,getChains:se.getChains,isInMiniApp:q4,context:se.context,back:MS({miniAppHost:se,emitter:zt}),quickAuth:wo,actions:{setPrimaryButton:se.setPrimaryButton.bind(se),ready:async(t={})=>await se.ready(t),close:se.close.bind(se),viewCast:se.viewCast.bind(se),viewProfile:se.viewProfile.bind(se),openMiniApp:se.openMiniApp.bind(se),signIn:async t=>{let e=await se.signIn({...t,acceptAuthAddress:t.acceptAuthAddress??!0});if(e.result)return e.result;throw e.error.type==="rejected_by_user"?new zn.RejectedByUser:new Error("Unreachable")},openUrl:t=>{let e=typeof t=="string"?t:t.url;return se.openUrl(e.trim())},addFrame:_1,addMiniApp:_1,composeCast(t={}){return se.composeCast(t)},viewToken:se.viewToken.bind(se),sendToken:se.sendToken.bind(se),swapToken:se.swapToken.bind(se),requestCameraAndMicrophoneAccess:se.requestCameraAndMicrophoneAccess.bind(se)},experimental:{getSolanaProvider:dy,signManifest:async t=>{let e=await se.signManifest(t);if(e.result)return e.result;throw e.error.type==="rejected_by_user"?new Bn.RejectedByUser:e.error.type==="invalid_domain"?new Bn.InvalidDomain:e.error.type==="generic_error"?new Bn.GenericError(e.error.message):new Error("Unreachable")},quickAuth(t){return wo.getToken(t)}},wallet:{ethProvider:vo,getEthereumProvider:i1,getSolanaProvider:dy},haptics:{impactOccurred:se.impactOccurred.bind(se),notificationOccurred:se.notificationOccurred.bind(se),selectionChanged:se.selectionChanged.bind(se)}};typeof document<"u"&&document.addEventListener("FarcasterFrameEvent",t=>{if(t instanceof MessageEvent){let e=t.data;e.event==="primary_button_clicked"?zt.emit("primaryButtonClicked"):e.event==="miniapp_added"?zt.emit("miniAppAdded",{notificationDetails:e.notificationDetails}):e.event==="miniapp_add_rejected"?zt.emit("miniAppAddRejected",{reason:e.reason}):e.event==="miniapp_removed"?zt.emit("miniAppRemoved"):e.event==="notifications_enabled"?zt.emit("notificationsEnabled",{notificationDetails:e.notificationDetails}):e.event==="notifications_disabled"?zt.emit("notificationsDisabled"):e.event==="back_navigation_triggered"&&zt.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"?zt.emit("primaryButtonClicked"):e.event==="miniapp_added"?zt.emit("miniAppAdded",{notificationDetails:e.notificationDetails}):e.event==="miniapp_add_rejected"?zt.emit("miniAppAddRejected",{reason:e.reason}):e.event==="miniapp_removed"?zt.emit("miniAppRemoved"):e.event==="notifications_enabled"?zt.emit("notificationsEnabled",{notificationDetails:e.notificationDetails}):e.event==="notifications_disabled"?zt.emit("notificationsDisabled"):e.event==="back_navigation_triggered"&&zt.emit("backNavigationTriggered")}});typeof console<"u"&&console.warn&&console.warn("@farcaster/frame-sdk is deprecated. Please use @farcaster/miniapp-sdk instead.");var b1=fy,v1=!1,G4=new Proxy(se,{get(t,e,r){return!v1&&typeof console<"u"&&console.warn&&(v1=!0,console.warn("frameHost is deprecated. Please use miniAppHost instead.")),Reflect.get(t,e,r)}}),H4=b1;return Tl(J4);})();
|
|
16
55
|
/*! Bundled license information:
|
|
17
56
|
|
|
18
57
|
ieee754/index.js:
|