@anthropic-ai/claude-agent-sdk 0.3.209 → 0.3.211
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/README.md +1 -1
- package/bridge.d.ts +8 -6
- package/bridge.mjs +76 -76
- package/browser-sdk.js +12 -12
- package/manifest.json +21 -20
- package/manifest.zst.json +25 -24
- package/package.json +10 -10
- package/sdk-tools.d.ts +55 -2
- package/sdk.d.ts +78 -9
- package/sdk.mjs +58 -58
package/browser-sdk.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// (c) Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://code.claude.com/docs/en/legal-and-compliance.
|
|
2
2
|
|
|
3
|
-
// Version: 0.3.
|
|
4
|
-
var aE=Object.create;var{getPrototypeOf:uE,defineProperty:ma,getOwnPropertyNames:C_,getOwnPropertyDescriptor:lE}=Object,O_=Object.prototype.hasOwnProperty;function D_(e){return this[e]}var cE,dE,N_=(e,t,r)=>{var i=e!=null&&typeof e==="object";if(i){var n=t?cE??=new WeakMap:dE??=new WeakMap,o=n.get(e);if(o)return o}r=e!=null?aE(uE(e)):{};let s=t||!e||!e.__esModule?ma(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let h of C_(e))if(!O_.call(s,h))ma(s,h,{get:D_.bind(e,h),enumerable:!0})}if(i)n.set(e,s);return s},kt=(e)=>{var t=(R_??=new WeakMap).get(e),r;if(t)return t;if(t=ma({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function"){for(var i of C_(e))if(!O_.call(t,i))ma(t,i,{get:D_.bind(e,i),enumerable:!(r=lE(e,i))||r.enumerable})}return R_.set(e,t),t},R_,Xe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var fE=(e)=>e;function hE(e,t){this[e]=fE.bind(null,t)}var wn=(e,t)=>{for(var r in t)ma(e,r,{get:t[r],enumerable:!0,configurable:!0,set:hE.bind(t,r)})};var ga=(e,t)=>()=>(e&&(t=e(e=0)),t);var $i=((e)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),pE=Symbol.dispose||Symbol.for("Symbol.dispose"),mE=Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose"),Kt=(e,t,r)=>{if(t!=null){if(typeof t!=="object"&&typeof t!=="function")throw TypeError('Object expected to be assigned to "using" declaration');var i;if(r)i=t[mE];if(i===void 0)i=t[pE];if(typeof i!=="function")throw TypeError("Object not disposable");e.push([r,i,t])}else if(r)e.push([r]);return t},Vt=(e,t,r)=>{var i=typeof SuppressedError==="function"?SuppressedError:function(s,h,v,b){return b=Error(v),b.name="SuppressedError",b.error=s,b.suppressed=h,b},n=(s)=>t=r?new i(s,t,"An error was suppressed during disposal"):(r=!0,s),o=(s)=>{while(s=e.pop())try{var h=s[1]&&s[1].call(s[2]);if(s[0])return Promise.resolve(h).then(o,(v)=>(n(v),o()))}catch(v){n(v)}if(r)throw t};return o()};var $r={};wn($r,{transcode:()=>d$,resolveObjectURL:()=>u$,kStringMaxLength:()=>k1,kMaxLength:()=>ba,isUtf8:()=>l$,isAscii:()=>c$,default:()=>f$,constants:()=>NI,btoa:()=>RI,atob:()=>CI,INSPECT_MAX_BYTES:()=>x1,File:()=>OI,Buffer:()=>fe,Blob:()=>DI});function II(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");if(r===-1)r=t;var i=r===t?0:4-r%4;return[r,i]}function $I(e,t){return(e+t)*3/4-t}function TI(e){var t,r=II(e),i=r[0],n=r[1],o=new Uint8Array($I(i,n)),s=0,h=n>0?i-4:i,v;for(v=0;v<h;v+=4)t=Sn[e.charCodeAt(v)]<<18|Sn[e.charCodeAt(v+1)]<<12|Sn[e.charCodeAt(v+2)]<<6|Sn[e.charCodeAt(v+3)],o[s++]=t>>16&255,o[s++]=t>>8&255,o[s++]=t&255;if(n===2)t=Sn[e.charCodeAt(v)]<<2|Sn[e.charCodeAt(v+1)]>>4,o[s++]=t&255;if(n===1)t=Sn[e.charCodeAt(v)]<<10|Sn[e.charCodeAt(v+1)]<<4|Sn[e.charCodeAt(v+2)]>>2,o[s++]=t>>8&255,o[s++]=t&255;return o}function PI(e){return Wn[e>>18&63]+Wn[e>>12&63]+Wn[e>>6&63]+Wn[e&63]}function AI(e,t,r){var i,n=[];for(var o=t;o<r;o+=3)i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),n.push(PI(i));return n.join("")}function y1(e){var t,r=e.length,i=r%3,n=[],o=16383;for(var s=0,h=r-i;s<h;s+=o)n.push(AI(e,s,s+o>h?h:s+o));if(i===1)t=e[r-1],n.push(Wn[t>>2]+Wn[t<<4&63]+"==");else if(i===2)t=(e[r-2]<<8)+e[r-1],n.push(Wn[t>>10]+Wn[t>>4&63]+Wn[t<<2&63]+"=");return n.join("")}function Ac(e,t,r,i,n){var o,s,h=n*8-i-1,v=(1<<h)-1,b=v>>1,_=-7,g=r?n-1:0,S=r?-1:1,x=e[t+g];g+=S,o=x&(1<<-_)-1,x>>=-_,_+=h;for(;_>0;o=o*256+e[t+g],g+=S,_-=8);s=o&(1<<-_)-1,o>>=-_,_+=i;for(;_>0;s=s*256+e[t+g],g+=S,_-=8);if(o===0)o=1-b;else if(o===v)return s?NaN:(x?-1:1)*(1/0);else s=s+Math.pow(2,i),o=o-b;return(x?-1:1)*s*Math.pow(2,o-i)}function S1(e,t,r,i,n,o){var s,h,v,b=o*8-n-1,_=(1<<b)-1,g=_>>1,S=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=i?0:o-1,M=i?1:-1,I=t<0||t===0&&1/t<0?1:0;if(t=Math.abs(t),isNaN(t)||t===1/0)h=isNaN(t)?1:0,s=_;else{if(s=Math.floor(Math.log(t)/Math.LN2),t*(v=Math.pow(2,-s))<1)s--,v*=2;if(s+g>=1)t+=S/v;else t+=S*Math.pow(2,1-g);if(t*v>=2)s++,v/=2;if(s+g>=_)h=0,s=_;else if(s+g>=1)h=(t*v-1)*Math.pow(2,n),s=s+g;else h=t*Math.pow(2,g-1)*Math.pow(2,n),s=0}for(;n>=8;e[r+x]=h&255,x+=M,h/=256,n-=8);s=s<<n|h,b+=n;for(;b>0;e[r+x]=s&255,x+=M,s/=256,b-=8);e[r+x-M]|=I*128}function ii(e){if(e>ba)throw RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,fe.prototype),t}function dm(e,t,r){return class extends r{constructor(){super();Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function fe(e,t,r){if(typeof e==="number"){if(typeof t==="string")throw TypeError('The "string" argument must be of type string. Received type number');return fm(e)}return M1(e,t,r)}function M1(e,t,r){if(typeof e==="string")return LI(e,t);if(ArrayBuffer.isView(e))return FI(e);if(e==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Gn(e,ArrayBuffer)||e&&Gn(e.buffer,ArrayBuffer))return lm(e,t,r);if(typeof SharedArrayBuffer<"u"&&(Gn(e,SharedArrayBuffer)||e&&Gn(e.buffer,SharedArrayBuffer)))return lm(e,t,r);if(typeof e==="number")throw TypeError('The "value" argument must not be of type number. Received type number');let i=e.valueOf&&e.valueOf();if(i!=null&&i!==e)return fe.from(i,t,r);let n=qI(e);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]==="function")return fe.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function E1(e){if(typeof e!=="number")throw TypeError('"size" argument must be of type number');else if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function UI(e,t,r){if(E1(e),e<=0)return ii(e);if(t!==void 0)return typeof r==="string"?ii(e).fill(t,r):ii(e).fill(t);return ii(e)}function fm(e){return E1(e),ii(e<0?0:hm(e)|0)}function LI(e,t){if(typeof t!=="string"||t==="")t="utf8";if(!fe.isEncoding(t))throw TypeError("Unknown encoding: "+t);let r=I1(e,t)|0,i=ii(r),n=i.write(e,t);if(n!==r)i=i.slice(0,n);return i}function um(e){let t=e.length<0?0:hm(e.length)|0,r=ii(t);for(let i=0;i<t;i+=1)r[i]=e[i]&255;return r}function FI(e){if(Gn(e,Uint8Array)){let t=new Uint8Array(e);return lm(t.buffer,t.byteOffset,t.byteLength)}return um(e)}function lm(e,t,r){if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');let i;if(t===void 0&&r===void 0)i=new Uint8Array(e);else if(r===void 0)i=new Uint8Array(e,t);else i=new Uint8Array(e,t,r);return Object.setPrototypeOf(i,fe.prototype),i}function qI(e){if(fe.isBuffer(e)){let t=hm(e.length)|0,r=ii(t);if(r.length===0)return r;return e.copy(r,0,0,t),r}if(e.length!==void 0){if(typeof e.length!=="number"||Number.isNaN(e.length))return ii(0);return um(e)}if(e.type==="Buffer"&&Array.isArray(e.data))return um(e.data)}function hm(e){if(e>=ba)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ba.toString(16)+" bytes");return e|0}function I1(e,t){if(fe.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Gn(e,ArrayBuffer))return e.byteLength;if(typeof e!=="string")throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&r===0)return 0;let n=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return cm(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return N1(e).length;default:if(n)return i?-1:cm(e).length;t=(""+t).toLowerCase(),n=!0}}function BI(e,t,r){let i=!1;if(t===void 0||t<0)t=0;if(t>this.length)return"";if(r===void 0||r>this.length)r=this.length;if(r<=0)return"";if(r>>>=0,t>>>=0,r<=t)return"";if(!e)e="utf8";while(!0)switch(e){case"hex":return QI(this,t,r);case"utf8":case"utf-8":return T1(this,t,r);case"ascii":return XI(this,t,r);case"latin1":case"binary":return YI(this,t,r);case"base64":return GI(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e$(this,t,r);default:if(i)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function fo(e,t,r){let i=e[t];e[t]=e[r],e[r]=i}function $1(e,t,r,i,n){if(e.length===0)return-1;if(typeof r==="string")i=r,r=0;else if(r>2147483647)r=2147483647;else if(r<-2147483648)r=-2147483648;if(r=+r,Number.isNaN(r))r=n?0:e.length-1;if(r<0)r=e.length+r;if(r>=e.length)if(n)return-1;else r=e.length-1;else if(r<0)if(n)r=0;else return-1;if(typeof t==="string")t=fe.from(t,i);if(fe.isBuffer(t)){if(t.length===0)return-1;return b1(e,t,r,i,n)}else if(typeof t==="number"){if(t=t&255,typeof Uint8Array.prototype.indexOf==="function")if(n)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return b1(e,[t],r,i,n)}throw TypeError("val must be string, number or Buffer")}function b1(e,t,r,i,n){let o=1,s=e.length,h=t.length;if(i!==void 0){if(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le"){if(e.length<2||t.length<2)return-1;o=2,s/=2,h/=2,r/=2}}function v(_,g){if(o===1)return _[g];else return _.readUInt16BE(g*o)}let b;if(n){let _=-1;for(b=r;b<s;b++)if(v(e,b)===v(t,_===-1?0:b-_)){if(_===-1)_=b;if(b-_+1===h)return _*o}else{if(_!==-1)b-=b-_;_=-1}}else{if(r+h>s)r=s-h;for(b=r;b>=0;b--){let _=!0;for(let g=0;g<h;g++)if(v(e,b+g)!==v(t,g)){_=!1;break}if(_)return b}}return-1}function HI(e,t,r,i){r=Number(r)||0;let n=e.length-r;if(!i)i=n;else if(i=Number(i),i>n)i=n;let o=t.length;if(i>o/2)i=o/2;let s;for(s=0;s<i;++s){let h=parseInt(t.substr(s*2,2),16);if(Number.isNaN(h))return s;e[r+s]=h}return s}function ZI(e,t,r,i){return Rc(cm(t,e.length-r),e,r,i)}function KI(e,t,r,i){return Rc(i$(t),e,r,i)}function VI(e,t,r,i){return Rc(N1(t),e,r,i)}function WI(e,t,r,i){return Rc(o$(t,e.length-r),e,r,i)}function GI(e,t,r){if(t===0&&r===e.length)return y1(e);else return y1(e.slice(t,r))}function T1(e,t,r){r=Math.min(e.length,r);let i=[],n=t;while(n<r){let o=e[n],s=null,h=o>239?4:o>223?3:o>191?2:1;if(n+h<=r){let v,b,_,g;switch(h){case 1:if(o<128)s=o;break;case 2:if(v=e[n+1],(v&192)===128){if(g=(o&31)<<6|v&63,g>127)s=g}break;case 3:if(v=e[n+1],b=e[n+2],(v&192)===128&&(b&192)===128){if(g=(o&15)<<12|(v&63)<<6|b&63,g>2047&&(g<55296||g>57343))s=g}break;case 4:if(v=e[n+1],b=e[n+2],_=e[n+3],(v&192)===128&&(b&192)===128&&(_&192)===128){if(g=(o&15)<<18|(v&63)<<12|(b&63)<<6|_&63,g>65535&&g<1114112)s=g}}}if(s===null)s=65533,h=1;else if(s>65535)s-=65536,i.push(s>>>10&1023|55296),s=56320|s&1023;i.push(s),n+=h}return JI(i)}function JI(e){let t=e.length;if(t<=_1)return String.fromCharCode.apply(String,e);let r="",i=0;while(i<t)r+=String.fromCharCode.apply(String,e.slice(i,i+=_1));return r}function XI(e,t,r){let i="";r=Math.min(e.length,r);for(let n=t;n<r;++n)i+=String.fromCharCode(e[n]&127);return i}function YI(e,t,r){let i="";r=Math.min(e.length,r);for(let n=t;n<r;++n)i+=String.fromCharCode(e[n]);return i}function QI(e,t,r){let i=e.length;if(!t||t<0)t=0;if(!r||r<0||r>i)r=i;let n="";for(let o=t;o<r;++o)n+=s$[e[o]];return n}function e$(e,t,r){let i=e.slice(t,r),n="";for(let o=0;o<i.length-1;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}function Ir(e,t,r){if(e%1!==0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function Yr(e,t,r,i,n,o){if(!fe.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<o)throw RangeError('"value" argument is out of bounds');if(r+i>e.length)throw RangeError("Index out of range")}function P1(e,t,r,i,n){D1(t,i,n,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,r}function A1(e,t,r,i,n){D1(t,i,n,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o=o>>8,e[r+6]=o,o=o>>8,e[r+5]=o,o=o>>8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s=s>>8,e[r+2]=s,s=s>>8,e[r+1]=s,s=s>>8,e[r]=s,r+8}function R1(e,t,r,i,n,o){if(r+i>e.length)throw RangeError("Index out of range");if(r<0)throw RangeError("Index out of range")}function C1(e,t,r,i,n){if(t=+t,r=r>>>0,!n)R1(e,t,r,4,340282346638528860000000000000000000000,-340282346638528860000000000000000000000);return S1(e,t,r,i,23,4),r+4}function O1(e,t,r,i,n){if(t=+t,r=r>>>0,!n)R1(e,t,r,8,179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,-179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);return S1(e,t,r,i,52,8),r+8}function w1(e){let t="",r=e.length,i=e[0]==="-"?1:0;for(;r>=i+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function t$(e,t,r){if(ns(t,"offset"),e[t]===void 0||e[t+r]===void 0)_a(t,e.length-(r+1))}function D1(e,t,r,i,n,o){if(e>r||e<t){let s=typeof t==="bigint"?"n":"",h;if(o>3)if(t===0||t===BigInt(0))h=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`;else h=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`;else h=`>= ${t}${s} and <= ${r}${s}`;throw new am("value",h,e)}t$(i,n,o)}function ns(e,t){if(typeof e!=="number")throw new jI(t,"number",e)}function _a(e,t,r){if(Math.floor(e)!==e)throw ns(e,r),new am(r||"offset","an integer",e);if(t<0)throw new zI;throw new am(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}function n$(e){if(e=e.split("=")[0],e=e.trim().replace(r$,""),e.length<2)return"";while(e.length%4!==0)e=e+"=";return e}function cm(e,t){t=t||1/0;let r,i=e.length,n=null,o=[];for(let s=0;s<i;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!n){if(r>56319){if((t-=3)>-1)o.push(239,191,189);continue}else if(s+1===i){if((t-=3)>-1)o.push(239,191,189);continue}n=r;continue}if(r<56320){if((t-=3)>-1)o.push(239,191,189);n=r;continue}r=(n-55296<<10|r-56320)+65536}else if(n){if((t-=3)>-1)o.push(239,191,189)}if(n=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw Error("Invalid code point")}return o}function i$(e){let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function o$(e,t){let r,i,n,o=[];for(let s=0;s<e.length;++s){if((t-=2)<0)break;r=e.charCodeAt(s),i=r>>8,n=r%256,o.push(n),o.push(i)}return o}function N1(e){return TI(n$(e))}function Rc(e,t,r,i){let n;for(n=0;n<i;++n){if(n+r>=t.length||n>=e.length)break;t[n+r]=e[n]}return n}function Gn(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function Ai(e){return typeof BigInt>"u"?a$:e}function a$(){throw Error("BigInt not supported")}function pm(e){return()=>{throw Error(e+" is not implemented for node:buffer browser polyfill")}}var Wn,Sn,sm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",co,g1,v1,x1=50,ba=2147483647,k1=536870888,RI,CI,OI,DI,NI,zI,jI,am,_1=4096,r$,s$,u$,l$,c$=(e)=>{for(let t of e)if(t.charCodeAt(0)>127)return!1;return!0},d$,f$;var Tr=ga(()=>{Wn=[],Sn=[];for(co=0,g1=sm.length;co<g1;++co)Wn[co]=sm[co],Sn[sm.charCodeAt(co)]=co;Sn[45]=62;Sn[95]=63;v1=typeof Symbol==="function"&&typeof Symbol.for==="function"?Symbol.for("nodejs.util.inspect.custom"):null,RI=globalThis.btoa,CI=globalThis.atob,OI=globalThis.File,DI=globalThis.Blob,NI={MAX_LENGTH:ba,MAX_STRING_LENGTH:k1};zI=dm("ERR_BUFFER_OUT_OF_BOUNDS",function(e){if(e)return`${e} is outside of buffer bounds`;return"Attempt to access memory outside buffer bounds"},RangeError),jI=dm("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),am=dm("ERR_OUT_OF_RANGE",function(e,t,r){let i=`The value of "${e}" is out of range.`,n=r;if(Number.isInteger(r)&&Math.abs(r)>4294967296)n=w1(String(r));else if(typeof r==="bigint"){if(n=String(r),r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))n=w1(n);n+="n"}return i+=` It must be ${t}. Received ${n}`,i},RangeError);Object.defineProperty(fe.prototype,"parent",{enumerable:!0,get:function(){if(!fe.isBuffer(this))return;return this.buffer}});Object.defineProperty(fe.prototype,"offset",{enumerable:!0,get:function(){if(!fe.isBuffer(this))return;return this.byteOffset}});fe.poolSize=8192;fe.from=function(e,t,r){return M1(e,t,r)};Object.setPrototypeOf(fe.prototype,Uint8Array.prototype);Object.setPrototypeOf(fe,Uint8Array);fe.alloc=function(e,t,r){return UI(e,t,r)};fe.allocUnsafe=function(e){return fm(e)};fe.allocUnsafeSlow=function(e){return fm(e)};fe.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==fe.prototype};fe.compare=function(e,t){if(Gn(e,Uint8Array))e=fe.from(e,e.offset,e.byteLength);if(Gn(t,Uint8Array))t=fe.from(t,t.offset,t.byteLength);if(!fe.isBuffer(e)||!fe.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,i=t.length;for(let n=0,o=Math.min(r,i);n<o;++n)if(e[n]!==t[n]){r=e[n],i=t[n];break}if(r<i)return-1;if(i<r)return 1;return 0};fe.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}};fe.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return fe.alloc(0);let r;if(t===void 0){t=0;for(r=0;r<e.length;++r)t+=e[r].length}let i=fe.allocUnsafe(t),n=0;for(r=0;r<e.length;++r){let o=e[r];if(Gn(o,Uint8Array))if(n+o.length>i.length){if(!fe.isBuffer(o))o=fe.from(o);o.copy(i,n)}else Uint8Array.prototype.set.call(i,o,n);else if(!fe.isBuffer(o))throw TypeError('"list" argument must be an Array of Buffers');else o.copy(i,n);n+=o.length}return i};fe.byteLength=I1;fe.prototype._isBuffer=!0;fe.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)fo(this,t,t+1);return this};fe.prototype.swap32=function(){let e=this.length;if(e%4!==0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)fo(this,t,t+3),fo(this,t+1,t+2);return this};fe.prototype.swap64=function(){let e=this.length;if(e%8!==0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)fo(this,t,t+7),fo(this,t+1,t+6),fo(this,t+2,t+5),fo(this,t+3,t+4);return this};fe.prototype.toString=function(){let e=this.length;if(e===0)return"";if(arguments.length===0)return T1(this,0,e);return BI.apply(this,arguments)};fe.prototype.toLocaleString=fe.prototype.toString;fe.prototype.equals=function(e){if(!fe.isBuffer(e))throw TypeError("Argument must be a Buffer");if(this===e)return!0;return fe.compare(this,e)===0};fe.prototype.inspect=function(){let e="",t=x1;if(e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t)e+=" ... ";return"<Buffer "+e+">"};if(v1)fe.prototype[v1]=fe.prototype.inspect;fe.prototype.compare=function(e,t,r,i,n){if(Gn(e,Uint8Array))e=fe.from(e,e.offset,e.byteLength);if(!fe.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0)t=0;if(r===void 0)r=e?e.length:0;if(i===void 0)i=0;if(n===void 0)n=this.length;if(t<0||r>e.length||i<0||n>this.length)throw RangeError("out of range index");if(i>=n&&t>=r)return 0;if(i>=n)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,i>>>=0,n>>>=0,this===e)return 0;let o=n-i,s=r-t,h=Math.min(o,s),v=this.slice(i,n),b=e.slice(t,r);for(let _=0;_<h;++_)if(v[_]!==b[_]){o=v[_],s=b[_];break}if(o<s)return-1;if(s<o)return 1;return 0};fe.prototype.includes=function(e,t,r){return this.indexOf(e,t,r)!==-1};fe.prototype.indexOf=function(e,t,r){return $1(this,e,t,r,!0)};fe.prototype.lastIndexOf=function(e,t,r){return $1(this,e,t,r,!1)};fe.prototype.write=function(e,t,r,i){if(t===void 0)i="utf8",r=this.length,t=0;else if(r===void 0&&typeof t==="string")i=t,r=this.length,t=0;else if(isFinite(t))if(t=t>>>0,isFinite(r)){if(r=r>>>0,i===void 0)i="utf8"}else i=r,r=void 0;else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let n=this.length-t;if(r===void 0||r>n)r=n;if(e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");if(!i)i="utf8";let o=!1;for(;;)switch(i){case"hex":return HI(this,e,t,r);case"utf8":case"utf-8":return ZI(this,e,t,r);case"ascii":case"latin1":case"binary":return KI(this,e,t,r);case"base64":return VI(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return WI(this,e,t,r);default:if(o)throw TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}};fe.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};fe.prototype.slice=function(e,t){let r=this.length;if(e=~~e,t=t===void 0?r:~~t,e<0){if(e+=r,e<0)e=0}else if(e>r)e=r;if(t<0){if(t+=r,t<0)t=0}else if(t>r)t=r;if(t<e)t=e;let i=this.subarray(e,t);return Object.setPrototypeOf(i,fe.prototype),i};fe.prototype.readUintLE=fe.prototype.readUIntLE=function(e,t,r){if(e=e>>>0,t=t>>>0,!r)Ir(e,t,this.length);let i=this[e],n=1,o=0;while(++o<t&&(n*=256))i+=this[e+o]*n;return i};fe.prototype.readUintBE=fe.prototype.readUIntBE=function(e,t,r){if(e=e>>>0,t=t>>>0,!r)Ir(e,t,this.length);let i=this[e+--t],n=1;while(t>0&&(n*=256))i+=this[e+--t]*n;return i};fe.prototype.readUint8=fe.prototype.readUInt8=function(e,t){if(e=e>>>0,!t)Ir(e,1,this.length);return this[e]};fe.prototype.readUint16LE=fe.prototype.readUInt16LE=function(e,t){if(e=e>>>0,!t)Ir(e,2,this.length);return this[e]|this[e+1]<<8};fe.prototype.readUint16BE=fe.prototype.readUInt16BE=function(e,t){if(e=e>>>0,!t)Ir(e,2,this.length);return this[e]<<8|this[e+1]};fe.prototype.readUint32LE=fe.prototype.readUInt32LE=function(e,t){if(e=e>>>0,!t)Ir(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};fe.prototype.readUint32BE=fe.prototype.readUInt32BE=function(e,t){if(e=e>>>0,!t)Ir(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};fe.prototype.readBigUInt64LE=Ai(function(e){e=e>>>0,ns(e,"offset");let t=this[e],r=this[e+7];if(t===void 0||r===void 0)_a(e,this.length-8);let i=t+this[++e]*256+this[++e]*65536+this[++e]*16777216,n=this[++e]+this[++e]*256+this[++e]*65536+r*16777216;return BigInt(i)+(BigInt(n)<<BigInt(32))});fe.prototype.readBigUInt64BE=Ai(function(e){e=e>>>0,ns(e,"offset");let t=this[e],r=this[e+7];if(t===void 0||r===void 0)_a(e,this.length-8);let i=t*16777216+this[++e]*65536+this[++e]*256+this[++e],n=this[++e]*16777216+this[++e]*65536+this[++e]*256+r;return(BigInt(i)<<BigInt(32))+BigInt(n)});fe.prototype.readIntLE=function(e,t,r){if(e=e>>>0,t=t>>>0,!r)Ir(e,t,this.length);let i=this[e],n=1,o=0;while(++o<t&&(n*=256))i+=this[e+o]*n;if(n*=128,i>=n)i-=Math.pow(2,8*t);return i};fe.prototype.readIntBE=function(e,t,r){if(e=e>>>0,t=t>>>0,!r)Ir(e,t,this.length);let i=t,n=1,o=this[e+--i];while(i>0&&(n*=256))o+=this[e+--i]*n;if(n*=128,o>=n)o-=Math.pow(2,8*t);return o};fe.prototype.readInt8=function(e,t){if(e=e>>>0,!t)Ir(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};fe.prototype.readInt16LE=function(e,t){if(e=e>>>0,!t)Ir(e,2,this.length);let r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};fe.prototype.readInt16BE=function(e,t){if(e=e>>>0,!t)Ir(e,2,this.length);let r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};fe.prototype.readInt32LE=function(e,t){if(e=e>>>0,!t)Ir(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};fe.prototype.readInt32BE=function(e,t){if(e=e>>>0,!t)Ir(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};fe.prototype.readBigInt64LE=Ai(function(e){e=e>>>0,ns(e,"offset");let t=this[e],r=this[e+7];if(t===void 0||r===void 0)_a(e,this.length-8);let i=this[e+4]+this[e+5]*256+this[e+6]*65536+(r<<24);return(BigInt(i)<<BigInt(32))+BigInt(t+this[++e]*256+this[++e]*65536+this[++e]*16777216)});fe.prototype.readBigInt64BE=Ai(function(e){e=e>>>0,ns(e,"offset");let t=this[e],r=this[e+7];if(t===void 0||r===void 0)_a(e,this.length-8);let i=(t<<24)+this[++e]*65536+this[++e]*256+this[++e];return(BigInt(i)<<BigInt(32))+BigInt(this[++e]*16777216+this[++e]*65536+this[++e]*256+r)});fe.prototype.readFloatLE=function(e,t){if(e=e>>>0,!t)Ir(e,4,this.length);return Ac(this,e,!0,23,4)};fe.prototype.readFloatBE=function(e,t){if(e=e>>>0,!t)Ir(e,4,this.length);return Ac(this,e,!1,23,4)};fe.prototype.readDoubleLE=function(e,t){if(e=e>>>0,!t)Ir(e,8,this.length);return Ac(this,e,!0,52,8)};fe.prototype.readDoubleBE=function(e,t){if(e=e>>>0,!t)Ir(e,8,this.length);return Ac(this,e,!1,52,8)};fe.prototype.writeUintLE=fe.prototype.writeUIntLE=function(e,t,r,i){if(e=+e,t=t>>>0,r=r>>>0,!i){let s=Math.pow(2,8*r)-1;Yr(this,e,t,r,s,0)}let n=1,o=0;this[t]=e&255;while(++o<r&&(n*=256))this[t+o]=e/n&255;return t+r};fe.prototype.writeUintBE=fe.prototype.writeUIntBE=function(e,t,r,i){if(e=+e,t=t>>>0,r=r>>>0,!i){let s=Math.pow(2,8*r)-1;Yr(this,e,t,r,s,0)}let n=r-1,o=1;this[t+n]=e&255;while(--n>=0&&(o*=256))this[t+n]=e/o&255;return t+r};fe.prototype.writeUint8=fe.prototype.writeUInt8=function(e,t,r){if(e=+e,t=t>>>0,!r)Yr(this,e,t,1,255,0);return this[t]=e&255,t+1};fe.prototype.writeUint16LE=fe.prototype.writeUInt16LE=function(e,t,r){if(e=+e,t=t>>>0,!r)Yr(this,e,t,2,65535,0);return this[t]=e&255,this[t+1]=e>>>8,t+2};fe.prototype.writeUint16BE=fe.prototype.writeUInt16BE=function(e,t,r){if(e=+e,t=t>>>0,!r)Yr(this,e,t,2,65535,0);return this[t]=e>>>8,this[t+1]=e&255,t+2};fe.prototype.writeUint32LE=fe.prototype.writeUInt32LE=function(e,t,r){if(e=+e,t=t>>>0,!r)Yr(this,e,t,4,4294967295,0);return this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4};fe.prototype.writeUint32BE=fe.prototype.writeUInt32BE=function(e,t,r){if(e=+e,t=t>>>0,!r)Yr(this,e,t,4,4294967295,0);return this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};fe.prototype.writeBigUInt64LE=Ai(function(e,t=0){return P1(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});fe.prototype.writeBigUInt64BE=Ai(function(e,t=0){return A1(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});fe.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t=t>>>0,!i){let h=Math.pow(2,8*r-1);Yr(this,e,t,r,h-1,-h)}let n=0,o=1,s=0;this[t]=e&255;while(++n<r&&(o*=256)){if(e<0&&s===0&&this[t+n-1]!==0)s=1;this[t+n]=(e/o>>0)-s&255}return t+r};fe.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t=t>>>0,!i){let h=Math.pow(2,8*r-1);Yr(this,e,t,r,h-1,-h)}let n=r-1,o=1,s=0;this[t+n]=e&255;while(--n>=0&&(o*=256)){if(e<0&&s===0&&this[t+n+1]!==0)s=1;this[t+n]=(e/o>>0)-s&255}return t+r};fe.prototype.writeInt8=function(e,t,r){if(e=+e,t=t>>>0,!r)Yr(this,e,t,1,127,-128);if(e<0)e=255+e+1;return this[t]=e&255,t+1};fe.prototype.writeInt16LE=function(e,t,r){if(e=+e,t=t>>>0,!r)Yr(this,e,t,2,32767,-32768);return this[t]=e&255,this[t+1]=e>>>8,t+2};fe.prototype.writeInt16BE=function(e,t,r){if(e=+e,t=t>>>0,!r)Yr(this,e,t,2,32767,-32768);return this[t]=e>>>8,this[t+1]=e&255,t+2};fe.prototype.writeInt32LE=function(e,t,r){if(e=+e,t=t>>>0,!r)Yr(this,e,t,4,2147483647,-2147483648);return this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4};fe.prototype.writeInt32BE=function(e,t,r){if(e=+e,t=t>>>0,!r)Yr(this,e,t,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;return this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};fe.prototype.writeBigInt64LE=Ai(function(e,t=0){return P1(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});fe.prototype.writeBigInt64BE=Ai(function(e,t=0){return A1(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});fe.prototype.writeFloatLE=function(e,t,r){return C1(this,e,t,!0,r)};fe.prototype.writeFloatBE=function(e,t,r){return C1(this,e,t,!1,r)};fe.prototype.writeDoubleLE=function(e,t,r){return O1(this,e,t,!0,r)};fe.prototype.writeDoubleBE=function(e,t,r){return O1(this,e,t,!1,r)};fe.prototype.copy=function(e,t,r,i){if(!fe.isBuffer(e))throw TypeError("argument should be a Buffer");if(!r)r=0;if(!i&&i!==0)i=this.length;if(t>=e.length)t=e.length;if(!t)t=0;if(i>0&&i<r)i=r;if(i===r)return 0;if(e.length===0||this.length===0)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(i<0)throw RangeError("sourceEnd out of bounds");if(i>this.length)i=this.length;if(e.length-t<i-r)i=e.length-t+r;let n=i-r;if(this===e&&typeof Uint8Array.prototype.copyWithin==="function")this.copyWithin(t,r,i);else Uint8Array.prototype.set.call(e,this.subarray(r,i),t);return n};fe.prototype.fill=function(e,t,r,i){if(typeof e==="string"){if(typeof t==="string")i=t,t=0,r=this.length;else if(typeof r==="string")i=r,r=this.length;if(i!==void 0&&typeof i!=="string")throw TypeError("encoding must be a string");if(typeof i==="string"&&!fe.isEncoding(i))throw TypeError("Unknown encoding: "+i);if(e.length===1){let o=e.charCodeAt(0);if(i==="utf8"&&o<128||i==="latin1")e=o}}else if(typeof e==="number")e=e&255;else if(typeof e==="boolean")e=Number(e);if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t=t>>>0,r=r===void 0?this.length:r>>>0,!e)e=0;let n;if(typeof e==="number")for(n=t;n<r;++n)this[n]=e;else{let o=fe.isBuffer(e)?e:fe.from(e,i),s=o.length;if(s===0)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(n=0;n<r-t;++n)this[n+t]=o[n%s]}return this};r$=/[^+/0-9A-Za-z-_]/g;s$=function(){let e=Array(256);for(let t=0;t<16;++t){let r=t*16;for(let i=0;i<16;++i)e[r+i]="0123456789abcdef"[t]+"0123456789abcdef"[i]}return e}();u$=pm("resolveObjectURL"),l$=pm("isUtf8"),d$=pm("transcode"),f$=fe});var K1={};wn(K1,{types:()=>S$,promisify:()=>q1,log:()=>U1,isUndefined:()=>is,isSymbol:()=>k$,isString:()=>jc,isRegExp:()=>Cc,isPrimitive:()=>M$,isObject:()=>os,isNumber:()=>j1,isNullOrUndefined:()=>x$,isNull:()=>zc,isFunction:()=>Dc,isError:()=>Oc,isDate:()=>vm,isBuffer:()=>E$,isBoolean:()=>_m,isArray:()=>z1,inspect:()=>ho,inherits:()=>L1,format:()=>bm,deprecate:()=>p$,default:()=>T$,debuglog:()=>m$,callbackifyOnRejected:()=>xm,callbackify:()=>B1,_extend:()=>Sm,TextEncoder:()=>H1,TextDecoder:()=>Z1});function bm(e,...t){if(!jc(e)){var r=[e];for(var i=0;i<t.length;i++)r.push(ho(t[i]));return r.join(" ")}var i=0,n=t.length,o=String(e).replace(h$,function(h){if(h==="%%")return"%";if(i>=n)return h;switch(h){case"%s":return String(t[i++]);case"%d":return Number(t[i++]);case"%j":try{return JSON.stringify(t[i++])}catch(v){return"[Circular]"}default:return h}});for(var s=t[i];i<n;s=t[++i])if(zc(s)||!os(s))o+=" "+s;else o+=" "+ho(s);return o}function p$(e,t){if(typeof process>"u"||process?.noDeprecation===!0)return e;var r=!1;function i(...n){if(!r){if(process.throwDeprecation)throw Error(t);else if(process.traceDeprecation)console.trace(t);else console.error(t);r=!0}return e.apply(this,...n)}return i}function g$(e,t){var r=ho.styles[t];if(r)return"\x1B["+ho.colors[r][0]+"m"+e+"\x1B["+ho.colors[r][1]+"m";else return e}function y$(e,t){return e}function v$(e){var t={};return e.forEach(function(r,i){t[r]=!0}),t}function Nc(e,t,r){if(e.customInspect&&t&&Dc(t.inspect)&&t.inspect!==ho&&!(t.constructor&&t.constructor.prototype===t)){var i=t.inspect(r,e);if(!jc(i))i=Nc(e,i,r);return i}var n=b$(e,t);if(n)return n;var o=Object.keys(t),s=v$(o);if(e.showHidden)o=Object.getOwnPropertyNames(t);if(Oc(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return mm(t);if(o.length===0){if(Dc(t)){var h=t.name?": "+t.name:"";return e.stylize("[Function"+h+"]","special")}if(Cc(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(vm(t))return e.stylize(Date.prototype.toString.call(t),"date");if(Oc(t))return mm(t)}var v="",b=!1,_=["{","}"];if(z1(t))b=!0,_=["[","]"];if(Dc(t)){var g=t.name?": "+t.name:"";v=" [Function"+g+"]"}if(Cc(t))v=" "+RegExp.prototype.toString.call(t);if(vm(t))v=" "+Date.prototype.toUTCString.call(t);if(Oc(t))v=" "+mm(t);if(o.length===0&&(!b||t.length==0))return _[0]+v+_[1];if(r<0)if(Cc(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");else return e.stylize("[Object]","special");e.seen.push(t);var S;if(b)S=_$(e,t,r,s,o);else S=o.map(function(x){return ym(e,t,r,s,x,b)});return e.seen.pop(),w$(S,v,_)}function b$(e,t){if(is(t))return e.stylize("undefined","undefined");if(jc(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(j1(t))return e.stylize(""+t,"number");if(_m(t))return e.stylize(""+t,"boolean");if(zc(t))return e.stylize("null","null")}function mm(e){return"["+Error.prototype.toString.call(e)+"]"}function _$(e,t,r,i,n){var o=[];for(var s=0,h=t.length;s<h;++s)if(F1(t,String(s)))o.push(ym(e,t,r,i,String(s),!0));else o.push("");return n.forEach(function(v){if(!v.match(/^\d+$/))o.push(ym(e,t,r,i,v,!0))}),o}function ym(e,t,r,i,n,o){var s,h,v;if(v=Object.getOwnPropertyDescriptor(t,n)||{value:t[n]},v.get)if(v.set)h=e.stylize("[Getter/Setter]","special");else h=e.stylize("[Getter]","special");else if(v.set)h=e.stylize("[Setter]","special");if(!F1(i,n))s="["+n+"]";if(!h)if(e.seen.indexOf(v.value)<0){if(zc(r))h=Nc(e,v.value,null);else h=Nc(e,v.value,r-1);if(h.indexOf(`
|
|
3
|
+
// Version: 0.3.211
|
|
4
|
+
var a8=Object.create;var{getPrototypeOf:u8,defineProperty:ma,getOwnPropertyNames:C_,getOwnPropertyDescriptor:l8}=Object,O_=Object.prototype.hasOwnProperty;function D_(e){return this[e]}var c8,d8,N_=(e,t,r)=>{var i=e!=null&&typeof e==="object";if(i){var n=t?c8??=new WeakMap:d8??=new WeakMap,o=n.get(e);if(o)return o}r=e!=null?a8(u8(e)):{};let s=t||!e||!e.__esModule?ma(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let h of C_(e))if(!O_.call(s,h))ma(s,h,{get:D_.bind(e,h),enumerable:!0})}if(i)n.set(e,s);return s},kt=(e)=>{var t=(R_??=new WeakMap).get(e),r;if(t)return t;if(t=ma({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function"){for(var i of C_(e))if(!O_.call(t,i))ma(t,i,{get:D_.bind(e,i),enumerable:!(r=l8(e,i))||r.enumerable})}return R_.set(e,t),t},R_,Xe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var f8=(e)=>e;function h8(e,t){this[e]=f8.bind(null,t)}var wn=(e,t)=>{for(var r in t)ma(e,r,{get:t[r],enumerable:!0,configurable:!0,set:h8.bind(t,r)})};var ga=(e,t)=>()=>(e&&(t=e(e=0)),t);var $i=((e)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),p8=Symbol.dispose||Symbol.for("Symbol.dispose"),m8=Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose"),Kt=(e,t,r)=>{if(t!=null){if(typeof t!=="object"&&typeof t!=="function")throw TypeError('Object expected to be assigned to "using" declaration');var i;if(r)i=t[m8];if(i===void 0)i=t[p8];if(typeof i!=="function")throw TypeError("Object not disposable");e.push([r,i,t])}else if(r)e.push([r]);return t},Vt=(e,t,r)=>{var i=typeof SuppressedError==="function"?SuppressedError:function(s,h,v,b){return b=Error(v),b.name="SuppressedError",b.error=s,b.suppressed=h,b},n=(s)=>t=r?new i(s,t,"An error was suppressed during disposal"):(r=!0,s),o=(s)=>{while(s=e.pop())try{var h=s[1]&&s[1].call(s[2]);if(s[0])return Promise.resolve(h).then(o,(v)=>(n(v),o()))}catch(v){n(v)}if(r)throw t};return o()};var $r={};wn($r,{transcode:()=>d$,resolveObjectURL:()=>u$,kStringMaxLength:()=>k1,kMaxLength:()=>ba,isUtf8:()=>l$,isAscii:()=>c$,default:()=>f$,constants:()=>NI,btoa:()=>RI,atob:()=>CI,INSPECT_MAX_BYTES:()=>x1,File:()=>OI,Buffer:()=>fe,Blob:()=>DI});function II(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");if(r===-1)r=t;var i=r===t?0:4-r%4;return[r,i]}function $I(e,t){return(e+t)*3/4-t}function TI(e){var t,r=II(e),i=r[0],n=r[1],o=new Uint8Array($I(i,n)),s=0,h=n>0?i-4:i,v;for(v=0;v<h;v+=4)t=Sn[e.charCodeAt(v)]<<18|Sn[e.charCodeAt(v+1)]<<12|Sn[e.charCodeAt(v+2)]<<6|Sn[e.charCodeAt(v+3)],o[s++]=t>>16&255,o[s++]=t>>8&255,o[s++]=t&255;if(n===2)t=Sn[e.charCodeAt(v)]<<2|Sn[e.charCodeAt(v+1)]>>4,o[s++]=t&255;if(n===1)t=Sn[e.charCodeAt(v)]<<10|Sn[e.charCodeAt(v+1)]<<4|Sn[e.charCodeAt(v+2)]>>2,o[s++]=t>>8&255,o[s++]=t&255;return o}function PI(e){return Wn[e>>18&63]+Wn[e>>12&63]+Wn[e>>6&63]+Wn[e&63]}function AI(e,t,r){var i,n=[];for(var o=t;o<r;o+=3)i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),n.push(PI(i));return n.join("")}function y1(e){var t,r=e.length,i=r%3,n=[],o=16383;for(var s=0,h=r-i;s<h;s+=o)n.push(AI(e,s,s+o>h?h:s+o));if(i===1)t=e[r-1],n.push(Wn[t>>2]+Wn[t<<4&63]+"==");else if(i===2)t=(e[r-2]<<8)+e[r-1],n.push(Wn[t>>10]+Wn[t>>4&63]+Wn[t<<2&63]+"=");return n.join("")}function Ac(e,t,r,i,n){var o,s,h=n*8-i-1,v=(1<<h)-1,b=v>>1,_=-7,g=r?n-1:0,S=r?-1:1,x=e[t+g];g+=S,o=x&(1<<-_)-1,x>>=-_,_+=h;for(;_>0;o=o*256+e[t+g],g+=S,_-=8);s=o&(1<<-_)-1,o>>=-_,_+=i;for(;_>0;s=s*256+e[t+g],g+=S,_-=8);if(o===0)o=1-b;else if(o===v)return s?NaN:(x?-1:1)*(1/0);else s=s+Math.pow(2,i),o=o-b;return(x?-1:1)*s*Math.pow(2,o-i)}function S1(e,t,r,i,n,o){var s,h,v,b=o*8-n-1,_=(1<<b)-1,g=_>>1,S=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=i?0:o-1,M=i?1:-1,I=t<0||t===0&&1/t<0?1:0;if(t=Math.abs(t),isNaN(t)||t===1/0)h=isNaN(t)?1:0,s=_;else{if(s=Math.floor(Math.log(t)/Math.LN2),t*(v=Math.pow(2,-s))<1)s--,v*=2;if(s+g>=1)t+=S/v;else t+=S*Math.pow(2,1-g);if(t*v>=2)s++,v/=2;if(s+g>=_)h=0,s=_;else if(s+g>=1)h=(t*v-1)*Math.pow(2,n),s=s+g;else h=t*Math.pow(2,g-1)*Math.pow(2,n),s=0}for(;n>=8;e[r+x]=h&255,x+=M,h/=256,n-=8);s=s<<n|h,b+=n;for(;b>0;e[r+x]=s&255,x+=M,s/=256,b-=8);e[r+x-M]|=I*128}function ii(e){if(e>ba)throw RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,fe.prototype),t}function dm(e,t,r){return class extends r{constructor(){super();Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function fe(e,t,r){if(typeof e==="number"){if(typeof t==="string")throw TypeError('The "string" argument must be of type string. Received type number');return fm(e)}return M1(e,t,r)}function M1(e,t,r){if(typeof e==="string")return LI(e,t);if(ArrayBuffer.isView(e))return FI(e);if(e==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Gn(e,ArrayBuffer)||e&&Gn(e.buffer,ArrayBuffer))return lm(e,t,r);if(typeof SharedArrayBuffer<"u"&&(Gn(e,SharedArrayBuffer)||e&&Gn(e.buffer,SharedArrayBuffer)))return lm(e,t,r);if(typeof e==="number")throw TypeError('The "value" argument must not be of type number. Received type number');let i=e.valueOf&&e.valueOf();if(i!=null&&i!==e)return fe.from(i,t,r);let n=qI(e);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]==="function")return fe.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function E1(e){if(typeof e!=="number")throw TypeError('"size" argument must be of type number');else if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function UI(e,t,r){if(E1(e),e<=0)return ii(e);if(t!==void 0)return typeof r==="string"?ii(e).fill(t,r):ii(e).fill(t);return ii(e)}function fm(e){return E1(e),ii(e<0?0:hm(e)|0)}function LI(e,t){if(typeof t!=="string"||t==="")t="utf8";if(!fe.isEncoding(t))throw TypeError("Unknown encoding: "+t);let r=I1(e,t)|0,i=ii(r),n=i.write(e,t);if(n!==r)i=i.slice(0,n);return i}function um(e){let t=e.length<0?0:hm(e.length)|0,r=ii(t);for(let i=0;i<t;i+=1)r[i]=e[i]&255;return r}function FI(e){if(Gn(e,Uint8Array)){let t=new Uint8Array(e);return lm(t.buffer,t.byteOffset,t.byteLength)}return um(e)}function lm(e,t,r){if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');let i;if(t===void 0&&r===void 0)i=new Uint8Array(e);else if(r===void 0)i=new Uint8Array(e,t);else i=new Uint8Array(e,t,r);return Object.setPrototypeOf(i,fe.prototype),i}function qI(e){if(fe.isBuffer(e)){let t=hm(e.length)|0,r=ii(t);if(r.length===0)return r;return e.copy(r,0,0,t),r}if(e.length!==void 0){if(typeof e.length!=="number"||Number.isNaN(e.length))return ii(0);return um(e)}if(e.type==="Buffer"&&Array.isArray(e.data))return um(e.data)}function hm(e){if(e>=ba)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ba.toString(16)+" bytes");return e|0}function I1(e,t){if(fe.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Gn(e,ArrayBuffer))return e.byteLength;if(typeof e!=="string")throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&r===0)return 0;let n=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return cm(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return N1(e).length;default:if(n)return i?-1:cm(e).length;t=(""+t).toLowerCase(),n=!0}}function BI(e,t,r){let i=!1;if(t===void 0||t<0)t=0;if(t>this.length)return"";if(r===void 0||r>this.length)r=this.length;if(r<=0)return"";if(r>>>=0,t>>>=0,r<=t)return"";if(!e)e="utf8";while(!0)switch(e){case"hex":return QI(this,t,r);case"utf8":case"utf-8":return T1(this,t,r);case"ascii":return XI(this,t,r);case"latin1":case"binary":return YI(this,t,r);case"base64":return GI(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e$(this,t,r);default:if(i)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function fo(e,t,r){let i=e[t];e[t]=e[r],e[r]=i}function $1(e,t,r,i,n){if(e.length===0)return-1;if(typeof r==="string")i=r,r=0;else if(r>2147483647)r=2147483647;else if(r<-2147483648)r=-2147483648;if(r=+r,Number.isNaN(r))r=n?0:e.length-1;if(r<0)r=e.length+r;if(r>=e.length)if(n)return-1;else r=e.length-1;else if(r<0)if(n)r=0;else return-1;if(typeof t==="string")t=fe.from(t,i);if(fe.isBuffer(t)){if(t.length===0)return-1;return b1(e,t,r,i,n)}else if(typeof t==="number"){if(t=t&255,typeof Uint8Array.prototype.indexOf==="function")if(n)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return b1(e,[t],r,i,n)}throw TypeError("val must be string, number or Buffer")}function b1(e,t,r,i,n){let o=1,s=e.length,h=t.length;if(i!==void 0){if(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le"){if(e.length<2||t.length<2)return-1;o=2,s/=2,h/=2,r/=2}}function v(_,g){if(o===1)return _[g];else return _.readUInt16BE(g*o)}let b;if(n){let _=-1;for(b=r;b<s;b++)if(v(e,b)===v(t,_===-1?0:b-_)){if(_===-1)_=b;if(b-_+1===h)return _*o}else{if(_!==-1)b-=b-_;_=-1}}else{if(r+h>s)r=s-h;for(b=r;b>=0;b--){let _=!0;for(let g=0;g<h;g++)if(v(e,b+g)!==v(t,g)){_=!1;break}if(_)return b}}return-1}function HI(e,t,r,i){r=Number(r)||0;let n=e.length-r;if(!i)i=n;else if(i=Number(i),i>n)i=n;let o=t.length;if(i>o/2)i=o/2;let s;for(s=0;s<i;++s){let h=parseInt(t.substr(s*2,2),16);if(Number.isNaN(h))return s;e[r+s]=h}return s}function ZI(e,t,r,i){return Rc(cm(t,e.length-r),e,r,i)}function KI(e,t,r,i){return Rc(i$(t),e,r,i)}function VI(e,t,r,i){return Rc(N1(t),e,r,i)}function WI(e,t,r,i){return Rc(o$(t,e.length-r),e,r,i)}function GI(e,t,r){if(t===0&&r===e.length)return y1(e);else return y1(e.slice(t,r))}function T1(e,t,r){r=Math.min(e.length,r);let i=[],n=t;while(n<r){let o=e[n],s=null,h=o>239?4:o>223?3:o>191?2:1;if(n+h<=r){let v,b,_,g;switch(h){case 1:if(o<128)s=o;break;case 2:if(v=e[n+1],(v&192)===128){if(g=(o&31)<<6|v&63,g>127)s=g}break;case 3:if(v=e[n+1],b=e[n+2],(v&192)===128&&(b&192)===128){if(g=(o&15)<<12|(v&63)<<6|b&63,g>2047&&(g<55296||g>57343))s=g}break;case 4:if(v=e[n+1],b=e[n+2],_=e[n+3],(v&192)===128&&(b&192)===128&&(_&192)===128){if(g=(o&15)<<18|(v&63)<<12|(b&63)<<6|_&63,g>65535&&g<1114112)s=g}}}if(s===null)s=65533,h=1;else if(s>65535)s-=65536,i.push(s>>>10&1023|55296),s=56320|s&1023;i.push(s),n+=h}return JI(i)}function JI(e){let t=e.length;if(t<=_1)return String.fromCharCode.apply(String,e);let r="",i=0;while(i<t)r+=String.fromCharCode.apply(String,e.slice(i,i+=_1));return r}function XI(e,t,r){let i="";r=Math.min(e.length,r);for(let n=t;n<r;++n)i+=String.fromCharCode(e[n]&127);return i}function YI(e,t,r){let i="";r=Math.min(e.length,r);for(let n=t;n<r;++n)i+=String.fromCharCode(e[n]);return i}function QI(e,t,r){let i=e.length;if(!t||t<0)t=0;if(!r||r<0||r>i)r=i;let n="";for(let o=t;o<r;++o)n+=s$[e[o]];return n}function e$(e,t,r){let i=e.slice(t,r),n="";for(let o=0;o<i.length-1;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}function Ir(e,t,r){if(e%1!==0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function Yr(e,t,r,i,n,o){if(!fe.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<o)throw RangeError('"value" argument is out of bounds');if(r+i>e.length)throw RangeError("Index out of range")}function P1(e,t,r,i,n){D1(t,i,n,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,r}function A1(e,t,r,i,n){D1(t,i,n,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o=o>>8,e[r+6]=o,o=o>>8,e[r+5]=o,o=o>>8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s=s>>8,e[r+2]=s,s=s>>8,e[r+1]=s,s=s>>8,e[r]=s,r+8}function R1(e,t,r,i,n,o){if(r+i>e.length)throw RangeError("Index out of range");if(r<0)throw RangeError("Index out of range")}function C1(e,t,r,i,n){if(t=+t,r=r>>>0,!n)R1(e,t,r,4,340282346638528860000000000000000000000,-340282346638528860000000000000000000000);return S1(e,t,r,i,23,4),r+4}function O1(e,t,r,i,n){if(t=+t,r=r>>>0,!n)R1(e,t,r,8,179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,-179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);return S1(e,t,r,i,52,8),r+8}function w1(e){let t="",r=e.length,i=e[0]==="-"?1:0;for(;r>=i+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function t$(e,t,r){if(ns(t,"offset"),e[t]===void 0||e[t+r]===void 0)_a(t,e.length-(r+1))}function D1(e,t,r,i,n,o){if(e>r||e<t){let s=typeof t==="bigint"?"n":"",h;if(o>3)if(t===0||t===BigInt(0))h=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`;else h=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`;else h=`>= ${t}${s} and <= ${r}${s}`;throw new am("value",h,e)}t$(i,n,o)}function ns(e,t){if(typeof e!=="number")throw new jI(t,"number",e)}function _a(e,t,r){if(Math.floor(e)!==e)throw ns(e,r),new am(r||"offset","an integer",e);if(t<0)throw new zI;throw new am(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}function n$(e){if(e=e.split("=")[0],e=e.trim().replace(r$,""),e.length<2)return"";while(e.length%4!==0)e=e+"=";return e}function cm(e,t){t=t||1/0;let r,i=e.length,n=null,o=[];for(let s=0;s<i;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!n){if(r>56319){if((t-=3)>-1)o.push(239,191,189);continue}else if(s+1===i){if((t-=3)>-1)o.push(239,191,189);continue}n=r;continue}if(r<56320){if((t-=3)>-1)o.push(239,191,189);n=r;continue}r=(n-55296<<10|r-56320)+65536}else if(n){if((t-=3)>-1)o.push(239,191,189)}if(n=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw Error("Invalid code point")}return o}function i$(e){let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function o$(e,t){let r,i,n,o=[];for(let s=0;s<e.length;++s){if((t-=2)<0)break;r=e.charCodeAt(s),i=r>>8,n=r%256,o.push(n),o.push(i)}return o}function N1(e){return TI(n$(e))}function Rc(e,t,r,i){let n;for(n=0;n<i;++n){if(n+r>=t.length||n>=e.length)break;t[n+r]=e[n]}return n}function Gn(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function Ai(e){return typeof BigInt>"u"?a$:e}function a$(){throw Error("BigInt not supported")}function pm(e){return()=>{throw Error(e+" is not implemented for node:buffer browser polyfill")}}var Wn,Sn,sm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",co,g1,v1,x1=50,ba=2147483647,k1=536870888,RI,CI,OI,DI,NI,zI,jI,am,_1=4096,r$,s$,u$,l$,c$=(e)=>{for(let t of e)if(t.charCodeAt(0)>127)return!1;return!0},d$,f$;var Tr=ga(()=>{Wn=[],Sn=[];for(co=0,g1=sm.length;co<g1;++co)Wn[co]=sm[co],Sn[sm.charCodeAt(co)]=co;Sn[45]=62;Sn[95]=63;v1=typeof Symbol==="function"&&typeof Symbol.for==="function"?Symbol.for("nodejs.util.inspect.custom"):null,RI=globalThis.btoa,CI=globalThis.atob,OI=globalThis.File,DI=globalThis.Blob,NI={MAX_LENGTH:ba,MAX_STRING_LENGTH:k1};zI=dm("ERR_BUFFER_OUT_OF_BOUNDS",function(e){if(e)return`${e} is outside of buffer bounds`;return"Attempt to access memory outside buffer bounds"},RangeError),jI=dm("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),am=dm("ERR_OUT_OF_RANGE",function(e,t,r){let i=`The value of "${e}" is out of range.`,n=r;if(Number.isInteger(r)&&Math.abs(r)>4294967296)n=w1(String(r));else if(typeof r==="bigint"){if(n=String(r),r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))n=w1(n);n+="n"}return i+=` It must be ${t}. Received ${n}`,i},RangeError);Object.defineProperty(fe.prototype,"parent",{enumerable:!0,get:function(){if(!fe.isBuffer(this))return;return this.buffer}});Object.defineProperty(fe.prototype,"offset",{enumerable:!0,get:function(){if(!fe.isBuffer(this))return;return this.byteOffset}});fe.poolSize=8192;fe.from=function(e,t,r){return M1(e,t,r)};Object.setPrototypeOf(fe.prototype,Uint8Array.prototype);Object.setPrototypeOf(fe,Uint8Array);fe.alloc=function(e,t,r){return UI(e,t,r)};fe.allocUnsafe=function(e){return fm(e)};fe.allocUnsafeSlow=function(e){return fm(e)};fe.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==fe.prototype};fe.compare=function(e,t){if(Gn(e,Uint8Array))e=fe.from(e,e.offset,e.byteLength);if(Gn(t,Uint8Array))t=fe.from(t,t.offset,t.byteLength);if(!fe.isBuffer(e)||!fe.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,i=t.length;for(let n=0,o=Math.min(r,i);n<o;++n)if(e[n]!==t[n]){r=e[n],i=t[n];break}if(r<i)return-1;if(i<r)return 1;return 0};fe.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}};fe.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return fe.alloc(0);let r;if(t===void 0){t=0;for(r=0;r<e.length;++r)t+=e[r].length}let i=fe.allocUnsafe(t),n=0;for(r=0;r<e.length;++r){let o=e[r];if(Gn(o,Uint8Array))if(n+o.length>i.length){if(!fe.isBuffer(o))o=fe.from(o);o.copy(i,n)}else Uint8Array.prototype.set.call(i,o,n);else if(!fe.isBuffer(o))throw TypeError('"list" argument must be an Array of Buffers');else o.copy(i,n);n+=o.length}return i};fe.byteLength=I1;fe.prototype._isBuffer=!0;fe.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)fo(this,t,t+1);return this};fe.prototype.swap32=function(){let e=this.length;if(e%4!==0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)fo(this,t,t+3),fo(this,t+1,t+2);return this};fe.prototype.swap64=function(){let e=this.length;if(e%8!==0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)fo(this,t,t+7),fo(this,t+1,t+6),fo(this,t+2,t+5),fo(this,t+3,t+4);return this};fe.prototype.toString=function(){let e=this.length;if(e===0)return"";if(arguments.length===0)return T1(this,0,e);return BI.apply(this,arguments)};fe.prototype.toLocaleString=fe.prototype.toString;fe.prototype.equals=function(e){if(!fe.isBuffer(e))throw TypeError("Argument must be a Buffer");if(this===e)return!0;return fe.compare(this,e)===0};fe.prototype.inspect=function(){let e="",t=x1;if(e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t)e+=" ... ";return"<Buffer "+e+">"};if(v1)fe.prototype[v1]=fe.prototype.inspect;fe.prototype.compare=function(e,t,r,i,n){if(Gn(e,Uint8Array))e=fe.from(e,e.offset,e.byteLength);if(!fe.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0)t=0;if(r===void 0)r=e?e.length:0;if(i===void 0)i=0;if(n===void 0)n=this.length;if(t<0||r>e.length||i<0||n>this.length)throw RangeError("out of range index");if(i>=n&&t>=r)return 0;if(i>=n)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,i>>>=0,n>>>=0,this===e)return 0;let o=n-i,s=r-t,h=Math.min(o,s),v=this.slice(i,n),b=e.slice(t,r);for(let _=0;_<h;++_)if(v[_]!==b[_]){o=v[_],s=b[_];break}if(o<s)return-1;if(s<o)return 1;return 0};fe.prototype.includes=function(e,t,r){return this.indexOf(e,t,r)!==-1};fe.prototype.indexOf=function(e,t,r){return $1(this,e,t,r,!0)};fe.prototype.lastIndexOf=function(e,t,r){return $1(this,e,t,r,!1)};fe.prototype.write=function(e,t,r,i){if(t===void 0)i="utf8",r=this.length,t=0;else if(r===void 0&&typeof t==="string")i=t,r=this.length,t=0;else if(isFinite(t))if(t=t>>>0,isFinite(r)){if(r=r>>>0,i===void 0)i="utf8"}else i=r,r=void 0;else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let n=this.length-t;if(r===void 0||r>n)r=n;if(e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");if(!i)i="utf8";let o=!1;for(;;)switch(i){case"hex":return HI(this,e,t,r);case"utf8":case"utf-8":return ZI(this,e,t,r);case"ascii":case"latin1":case"binary":return KI(this,e,t,r);case"base64":return VI(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return WI(this,e,t,r);default:if(o)throw TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}};fe.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};fe.prototype.slice=function(e,t){let r=this.length;if(e=~~e,t=t===void 0?r:~~t,e<0){if(e+=r,e<0)e=0}else if(e>r)e=r;if(t<0){if(t+=r,t<0)t=0}else if(t>r)t=r;if(t<e)t=e;let i=this.subarray(e,t);return Object.setPrototypeOf(i,fe.prototype),i};fe.prototype.readUintLE=fe.prototype.readUIntLE=function(e,t,r){if(e=e>>>0,t=t>>>0,!r)Ir(e,t,this.length);let i=this[e],n=1,o=0;while(++o<t&&(n*=256))i+=this[e+o]*n;return i};fe.prototype.readUintBE=fe.prototype.readUIntBE=function(e,t,r){if(e=e>>>0,t=t>>>0,!r)Ir(e,t,this.length);let i=this[e+--t],n=1;while(t>0&&(n*=256))i+=this[e+--t]*n;return i};fe.prototype.readUint8=fe.prototype.readUInt8=function(e,t){if(e=e>>>0,!t)Ir(e,1,this.length);return this[e]};fe.prototype.readUint16LE=fe.prototype.readUInt16LE=function(e,t){if(e=e>>>0,!t)Ir(e,2,this.length);return this[e]|this[e+1]<<8};fe.prototype.readUint16BE=fe.prototype.readUInt16BE=function(e,t){if(e=e>>>0,!t)Ir(e,2,this.length);return this[e]<<8|this[e+1]};fe.prototype.readUint32LE=fe.prototype.readUInt32LE=function(e,t){if(e=e>>>0,!t)Ir(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};fe.prototype.readUint32BE=fe.prototype.readUInt32BE=function(e,t){if(e=e>>>0,!t)Ir(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};fe.prototype.readBigUInt64LE=Ai(function(e){e=e>>>0,ns(e,"offset");let t=this[e],r=this[e+7];if(t===void 0||r===void 0)_a(e,this.length-8);let i=t+this[++e]*256+this[++e]*65536+this[++e]*16777216,n=this[++e]+this[++e]*256+this[++e]*65536+r*16777216;return BigInt(i)+(BigInt(n)<<BigInt(32))});fe.prototype.readBigUInt64BE=Ai(function(e){e=e>>>0,ns(e,"offset");let t=this[e],r=this[e+7];if(t===void 0||r===void 0)_a(e,this.length-8);let i=t*16777216+this[++e]*65536+this[++e]*256+this[++e],n=this[++e]*16777216+this[++e]*65536+this[++e]*256+r;return(BigInt(i)<<BigInt(32))+BigInt(n)});fe.prototype.readIntLE=function(e,t,r){if(e=e>>>0,t=t>>>0,!r)Ir(e,t,this.length);let i=this[e],n=1,o=0;while(++o<t&&(n*=256))i+=this[e+o]*n;if(n*=128,i>=n)i-=Math.pow(2,8*t);return i};fe.prototype.readIntBE=function(e,t,r){if(e=e>>>0,t=t>>>0,!r)Ir(e,t,this.length);let i=t,n=1,o=this[e+--i];while(i>0&&(n*=256))o+=this[e+--i]*n;if(n*=128,o>=n)o-=Math.pow(2,8*t);return o};fe.prototype.readInt8=function(e,t){if(e=e>>>0,!t)Ir(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};fe.prototype.readInt16LE=function(e,t){if(e=e>>>0,!t)Ir(e,2,this.length);let r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};fe.prototype.readInt16BE=function(e,t){if(e=e>>>0,!t)Ir(e,2,this.length);let r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};fe.prototype.readInt32LE=function(e,t){if(e=e>>>0,!t)Ir(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};fe.prototype.readInt32BE=function(e,t){if(e=e>>>0,!t)Ir(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};fe.prototype.readBigInt64LE=Ai(function(e){e=e>>>0,ns(e,"offset");let t=this[e],r=this[e+7];if(t===void 0||r===void 0)_a(e,this.length-8);let i=this[e+4]+this[e+5]*256+this[e+6]*65536+(r<<24);return(BigInt(i)<<BigInt(32))+BigInt(t+this[++e]*256+this[++e]*65536+this[++e]*16777216)});fe.prototype.readBigInt64BE=Ai(function(e){e=e>>>0,ns(e,"offset");let t=this[e],r=this[e+7];if(t===void 0||r===void 0)_a(e,this.length-8);let i=(t<<24)+this[++e]*65536+this[++e]*256+this[++e];return(BigInt(i)<<BigInt(32))+BigInt(this[++e]*16777216+this[++e]*65536+this[++e]*256+r)});fe.prototype.readFloatLE=function(e,t){if(e=e>>>0,!t)Ir(e,4,this.length);return Ac(this,e,!0,23,4)};fe.prototype.readFloatBE=function(e,t){if(e=e>>>0,!t)Ir(e,4,this.length);return Ac(this,e,!1,23,4)};fe.prototype.readDoubleLE=function(e,t){if(e=e>>>0,!t)Ir(e,8,this.length);return Ac(this,e,!0,52,8)};fe.prototype.readDoubleBE=function(e,t){if(e=e>>>0,!t)Ir(e,8,this.length);return Ac(this,e,!1,52,8)};fe.prototype.writeUintLE=fe.prototype.writeUIntLE=function(e,t,r,i){if(e=+e,t=t>>>0,r=r>>>0,!i){let s=Math.pow(2,8*r)-1;Yr(this,e,t,r,s,0)}let n=1,o=0;this[t]=e&255;while(++o<r&&(n*=256))this[t+o]=e/n&255;return t+r};fe.prototype.writeUintBE=fe.prototype.writeUIntBE=function(e,t,r,i){if(e=+e,t=t>>>0,r=r>>>0,!i){let s=Math.pow(2,8*r)-1;Yr(this,e,t,r,s,0)}let n=r-1,o=1;this[t+n]=e&255;while(--n>=0&&(o*=256))this[t+n]=e/o&255;return t+r};fe.prototype.writeUint8=fe.prototype.writeUInt8=function(e,t,r){if(e=+e,t=t>>>0,!r)Yr(this,e,t,1,255,0);return this[t]=e&255,t+1};fe.prototype.writeUint16LE=fe.prototype.writeUInt16LE=function(e,t,r){if(e=+e,t=t>>>0,!r)Yr(this,e,t,2,65535,0);return this[t]=e&255,this[t+1]=e>>>8,t+2};fe.prototype.writeUint16BE=fe.prototype.writeUInt16BE=function(e,t,r){if(e=+e,t=t>>>0,!r)Yr(this,e,t,2,65535,0);return this[t]=e>>>8,this[t+1]=e&255,t+2};fe.prototype.writeUint32LE=fe.prototype.writeUInt32LE=function(e,t,r){if(e=+e,t=t>>>0,!r)Yr(this,e,t,4,4294967295,0);return this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4};fe.prototype.writeUint32BE=fe.prototype.writeUInt32BE=function(e,t,r){if(e=+e,t=t>>>0,!r)Yr(this,e,t,4,4294967295,0);return this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};fe.prototype.writeBigUInt64LE=Ai(function(e,t=0){return P1(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});fe.prototype.writeBigUInt64BE=Ai(function(e,t=0){return A1(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});fe.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t=t>>>0,!i){let h=Math.pow(2,8*r-1);Yr(this,e,t,r,h-1,-h)}let n=0,o=1,s=0;this[t]=e&255;while(++n<r&&(o*=256)){if(e<0&&s===0&&this[t+n-1]!==0)s=1;this[t+n]=(e/o>>0)-s&255}return t+r};fe.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t=t>>>0,!i){let h=Math.pow(2,8*r-1);Yr(this,e,t,r,h-1,-h)}let n=r-1,o=1,s=0;this[t+n]=e&255;while(--n>=0&&(o*=256)){if(e<0&&s===0&&this[t+n+1]!==0)s=1;this[t+n]=(e/o>>0)-s&255}return t+r};fe.prototype.writeInt8=function(e,t,r){if(e=+e,t=t>>>0,!r)Yr(this,e,t,1,127,-128);if(e<0)e=255+e+1;return this[t]=e&255,t+1};fe.prototype.writeInt16LE=function(e,t,r){if(e=+e,t=t>>>0,!r)Yr(this,e,t,2,32767,-32768);return this[t]=e&255,this[t+1]=e>>>8,t+2};fe.prototype.writeInt16BE=function(e,t,r){if(e=+e,t=t>>>0,!r)Yr(this,e,t,2,32767,-32768);return this[t]=e>>>8,this[t+1]=e&255,t+2};fe.prototype.writeInt32LE=function(e,t,r){if(e=+e,t=t>>>0,!r)Yr(this,e,t,4,2147483647,-2147483648);return this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4};fe.prototype.writeInt32BE=function(e,t,r){if(e=+e,t=t>>>0,!r)Yr(this,e,t,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;return this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};fe.prototype.writeBigInt64LE=Ai(function(e,t=0){return P1(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});fe.prototype.writeBigInt64BE=Ai(function(e,t=0){return A1(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});fe.prototype.writeFloatLE=function(e,t,r){return C1(this,e,t,!0,r)};fe.prototype.writeFloatBE=function(e,t,r){return C1(this,e,t,!1,r)};fe.prototype.writeDoubleLE=function(e,t,r){return O1(this,e,t,!0,r)};fe.prototype.writeDoubleBE=function(e,t,r){return O1(this,e,t,!1,r)};fe.prototype.copy=function(e,t,r,i){if(!fe.isBuffer(e))throw TypeError("argument should be a Buffer");if(!r)r=0;if(!i&&i!==0)i=this.length;if(t>=e.length)t=e.length;if(!t)t=0;if(i>0&&i<r)i=r;if(i===r)return 0;if(e.length===0||this.length===0)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(i<0)throw RangeError("sourceEnd out of bounds");if(i>this.length)i=this.length;if(e.length-t<i-r)i=e.length-t+r;let n=i-r;if(this===e&&typeof Uint8Array.prototype.copyWithin==="function")this.copyWithin(t,r,i);else Uint8Array.prototype.set.call(e,this.subarray(r,i),t);return n};fe.prototype.fill=function(e,t,r,i){if(typeof e==="string"){if(typeof t==="string")i=t,t=0,r=this.length;else if(typeof r==="string")i=r,r=this.length;if(i!==void 0&&typeof i!=="string")throw TypeError("encoding must be a string");if(typeof i==="string"&&!fe.isEncoding(i))throw TypeError("Unknown encoding: "+i);if(e.length===1){let o=e.charCodeAt(0);if(i==="utf8"&&o<128||i==="latin1")e=o}}else if(typeof e==="number")e=e&255;else if(typeof e==="boolean")e=Number(e);if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t=t>>>0,r=r===void 0?this.length:r>>>0,!e)e=0;let n;if(typeof e==="number")for(n=t;n<r;++n)this[n]=e;else{let o=fe.isBuffer(e)?e:fe.from(e,i),s=o.length;if(s===0)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(n=0;n<r-t;++n)this[n+t]=o[n%s]}return this};r$=/[^+/0-9A-Za-z-_]/g;s$=function(){let e=Array(256);for(let t=0;t<16;++t){let r=t*16;for(let i=0;i<16;++i)e[r+i]="0123456789abcdef"[t]+"0123456789abcdef"[i]}return e}();u$=pm("resolveObjectURL"),l$=pm("isUtf8"),d$=pm("transcode"),f$=fe});var K1={};wn(K1,{types:()=>S$,promisify:()=>q1,log:()=>U1,isUndefined:()=>is,isSymbol:()=>k$,isString:()=>jc,isRegExp:()=>Cc,isPrimitive:()=>M$,isObject:()=>os,isNumber:()=>j1,isNullOrUndefined:()=>x$,isNull:()=>zc,isFunction:()=>Dc,isError:()=>Oc,isDate:()=>vm,isBuffer:()=>E$,isBoolean:()=>_m,isArray:()=>z1,inspect:()=>ho,inherits:()=>L1,format:()=>bm,deprecate:()=>p$,default:()=>T$,debuglog:()=>m$,callbackifyOnRejected:()=>xm,callbackify:()=>B1,_extend:()=>Sm,TextEncoder:()=>H1,TextDecoder:()=>Z1});function bm(e,...t){if(!jc(e)){var r=[e];for(var i=0;i<t.length;i++)r.push(ho(t[i]));return r.join(" ")}var i=0,n=t.length,o=String(e).replace(h$,function(h){if(h==="%%")return"%";if(i>=n)return h;switch(h){case"%s":return String(t[i++]);case"%d":return Number(t[i++]);case"%j":try{return JSON.stringify(t[i++])}catch(v){return"[Circular]"}default:return h}});for(var s=t[i];i<n;s=t[++i])if(zc(s)||!os(s))o+=" "+s;else o+=" "+ho(s);return o}function p$(e,t){if(typeof process>"u"||process?.noDeprecation===!0)return e;var r=!1;function i(...n){if(!r){if(process.throwDeprecation)throw Error(t);else if(process.traceDeprecation)console.trace(t);else console.error(t);r=!0}return e.apply(this,...n)}return i}function g$(e,t){var r=ho.styles[t];if(r)return"\x1B["+ho.colors[r][0]+"m"+e+"\x1B["+ho.colors[r][1]+"m";else return e}function y$(e,t){return e}function v$(e){var t={};return e.forEach(function(r,i){t[r]=!0}),t}function Nc(e,t,r){if(e.customInspect&&t&&Dc(t.inspect)&&t.inspect!==ho&&!(t.constructor&&t.constructor.prototype===t)){var i=t.inspect(r,e);if(!jc(i))i=Nc(e,i,r);return i}var n=b$(e,t);if(n)return n;var o=Object.keys(t),s=v$(o);if(e.showHidden)o=Object.getOwnPropertyNames(t);if(Oc(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return mm(t);if(o.length===0){if(Dc(t)){var h=t.name?": "+t.name:"";return e.stylize("[Function"+h+"]","special")}if(Cc(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(vm(t))return e.stylize(Date.prototype.toString.call(t),"date");if(Oc(t))return mm(t)}var v="",b=!1,_=["{","}"];if(z1(t))b=!0,_=["[","]"];if(Dc(t)){var g=t.name?": "+t.name:"";v=" [Function"+g+"]"}if(Cc(t))v=" "+RegExp.prototype.toString.call(t);if(vm(t))v=" "+Date.prototype.toUTCString.call(t);if(Oc(t))v=" "+mm(t);if(o.length===0&&(!b||t.length==0))return _[0]+v+_[1];if(r<0)if(Cc(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");else return e.stylize("[Object]","special");e.seen.push(t);var S;if(b)S=_$(e,t,r,s,o);else S=o.map(function(x){return ym(e,t,r,s,x,b)});return e.seen.pop(),w$(S,v,_)}function b$(e,t){if(is(t))return e.stylize("undefined","undefined");if(jc(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(j1(t))return e.stylize(""+t,"number");if(_m(t))return e.stylize(""+t,"boolean");if(zc(t))return e.stylize("null","null")}function mm(e){return"["+Error.prototype.toString.call(e)+"]"}function _$(e,t,r,i,n){var o=[];for(var s=0,h=t.length;s<h;++s)if(F1(t,String(s)))o.push(ym(e,t,r,i,String(s),!0));else o.push("");return n.forEach(function(v){if(!v.match(/^\d+$/))o.push(ym(e,t,r,i,v,!0))}),o}function ym(e,t,r,i,n,o){var s,h,v;if(v=Object.getOwnPropertyDescriptor(t,n)||{value:t[n]},v.get)if(v.set)h=e.stylize("[Getter/Setter]","special");else h=e.stylize("[Getter]","special");else if(v.set)h=e.stylize("[Setter]","special");if(!F1(i,n))s="["+n+"]";if(!h)if(e.seen.indexOf(v.value)<0){if(zc(r))h=Nc(e,v.value,null);else h=Nc(e,v.value,r-1);if(h.indexOf(`
|
|
5
5
|
`)>-1)if(o)h=h.split(`
|
|
6
6
|
`).map(function(b){return" "+b}).join(`
|
|
7
7
|
`).slice(2);else h=`
|
|
@@ -10,7 +10,7 @@ var aE=Object.create;var{getPrototypeOf:uE,defineProperty:ma,getOwnPropertyNames
|
|
|
10
10
|
`)}else h=e.stylize("[Circular]","special");if(is(s)){if(o&&n.match(/^\d+$/))return h;if(s=JSON.stringify(""+n),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/))s=s.slice(1,-1),s=e.stylize(s,"name");else s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string")}return s+": "+h}function w$(e,t,r){var i=0,n=e.reduce(function(o,s){if(i++,s.indexOf(`
|
|
11
11
|
`)>=0)i++;return o+s.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(n>60)return r[0]+(t===""?"":t+`
|
|
12
12
|
`)+" "+e.join(`,
|
|
13
|
-
`)+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}function z1(e){return Array.isArray(e)}function _m(e){return typeof e==="boolean"}function zc(e){return e===null}function x$(e){return e==null}function j1(e){return typeof e==="number"}function jc(e){return typeof e==="string"}function k$(e){return typeof e==="symbol"}function is(e){return e===void 0}function Cc(e){return os(e)&&wm(e)==="[object RegExp]"}function os(e){return typeof e==="object"&&e!==null}function vm(e){return os(e)&&wm(e)==="[object Date]"}function Oc(e){return os(e)&&(wm(e)==="[object Error]"||e instanceof Error)}function Dc(e){return typeof e==="function"}function M$(e){return e===null||typeof e==="boolean"||typeof e==="number"||typeof e==="string"||typeof e==="symbol"||typeof e>"u"}function E$(e){return e instanceof Buffer}function wm(e){return Object.prototype.toString.call(e)}function gm(e){return e<10?"0"+e.toString(10):e.toString(10)}function $$(){var e=new Date,t=[gm(e.getHours()),gm(e.getMinutes()),gm(e.getSeconds())].join(":");return[e.getDate(),I$[e.getMonth()],t].join(" ")}function U1(...e){console.log("%s - %s",$$(),bm.apply(null,e))}function L1(e,t){if(t)e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function Sm(e,t){if(!t||!os(t))return e;var r=Object.keys(t),i=r.length;while(i--)e[r[i]]=t[r[i]];return e}function F1(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function xm(e,t){if(!e){var r=Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}function B1(e){if(typeof e!=="function")throw TypeError('The "original" argument must be of type Function');function t(...r){var i=r.pop();if(typeof i!=="function")throw TypeError("The last argument must be of type Function");var n=this,o=function(...s){return i.apply(n,...s)};e.apply(this,r).then(function(s){process.nextTick(o.bind(null,null,s))},function(s){process.nextTick(xm.bind(null,s,o))})}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)),t}var h$,m$,ho,S$=()=>{},I$,q1,H1,Z1,T$;var V1=ga(()=>{h$=/%[sdj%]/g;m$=((e={},t={},r)=>((r=typeof process<"u"&&!1)&&(r=r.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase()),t=new RegExp("^"+r+"$","i"),(i)=>{if(i=i.toUpperCase(),!e[i])if(t.test(i))e[i]=function(...n){console.error("%s: %s",i,pid,bm.apply(null,...n))};else e[i]=function(){};return e[i]}))(),ho=((e)=>(e.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},e.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.custom=Symbol.for("nodejs.util.inspect.custom"),e))(function(e,t,...r){var i={seen:[],stylize:y$};if(r.length>=1)i.depth=r[0];if(r.length>=2)i.colors=r[1];if(_m(t))i.showHidden=t;else if(t)Sm(i,t);if(is(i.showHidden))i.showHidden=!1;if(is(i.depth))i.depth=2;if(is(i.colors))i.colors=!1;if(i.colors)i.stylize=g$;return Nc(i,e,i.depth)});I$=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];q1=((e)=>(e.custom=Symbol.for("nodejs.util.promisify.custom"),e))(function(e){if(typeof e!=="function")throw TypeError('The "original" argument must be of type Function');if(kCustomPromisifiedSymbol&&e[kCustomPromisifiedSymbol]){var t=e[kCustomPromisifiedSymbol];if(typeof t!=="function")throw TypeError('The "nodejs.util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,kCustomPromisifiedSymbol,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(...r){var i,n,o=new Promise(function(s,h){i=s,n=h});r.push(function(s,h){if(s)n(s);else i(h)});try{e.apply(this,r)}catch(s){n(s)}return o}if(Object.setPrototypeOf(t,Object.getPrototypeOf(e)),kCustomPromisifiedSymbol)Object.defineProperty(t,kCustomPromisifiedSymbol,{value:t,enumerable:!1,writable:!1,configurable:!0});return Object.defineProperties(t,Object.getOwnPropertyDescriptors(e))});({TextEncoder:H1,TextDecoder:Z1}=globalThis),T$={TextEncoder:H1,TextDecoder:Z1,promisify:q1,log:U1,inherits:L1,_extend:Sm,callbackifyOnRejected:xm,callbackify:B1}});var Sa={};wn(Sa,{setMaxListeners:()=>iw,once:()=>rw,listenerCount:()=>ow,init:()=>Ri,getMaxListeners:()=>aw,getEventListeners:()=>nw,default:()=>j$,captureRejectionSymbol:()=>Y1,addAbortListener:()=>uw,EventEmitter:()=>Ri});function Q1(e,t){var{_events:r}=e;if(t[0]??=Error("Unhandled error."),!r)throw t[0];var i=r[X1];if(i)for(var n of G1.call(i))n.apply(e,t);var o=r.error;if(!o)throw t[0];for(var n of G1.call(o))n.apply(e,t);return!0}function R$(e,t,r,i){t.then(void 0,function(n){queueMicrotask(()=>C$(e,n,r,i))})}function C$(e,t,r,i){if(typeof e[W1]==="function")e[W1](t,r,...i);else try{e[po]=!1,e.emit("error",t)}finally{e[po]=!0}}function ew(e,t,r){r.warned=!0;let i=Error(`Possible EventEmitter memory leak detected. ${r.length} ${String(t)} listeners added to [${e.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);i.name="MaxListenersExceededWarning",i.emitter=e,i.type=t,i.count=r.length,console.warn(i)}function tw(e,t,...r){this.removeListener(e,t),t.apply(this,r)}function rw(e,t,r){var i=r?.signal;if(sw(i,"options.signal"),i?.aborted)throw new km(void 0,{cause:i?.reason});let{resolve:n,reject:o,promise:s}=$newPromiseCapability(Promise),h=(_)=>{if(e.removeListener(t,v),i!=null)Uc(i,"abort",b);o(_)},v=(..._)=>{if(typeof e.removeListener==="function")e.removeListener("error",h);if(i!=null)Uc(i,"abort",b);n(_)};if(J1(e,t,v,{once:!0}),t!=="error"&&typeof e.once==="function")e.once("error",h);function b(){Uc(e,t,v),Uc(e,"error",h),o(new km(void 0,{cause:i?.reason}))}if(i!=null)J1(i,"abort",b,{once:!0});return s}function nw(e,t){return e.listeners(t)}function iw(e,...t){Em(e,"setMaxListeners",0);var r;if(t&&(r=t.length))for(let i=0;i<r;i++)t[i].setMaxListeners(e);else mo=e}function ow(e,t){return e.listenerCount(t)}function Uc(e,t,r,i){if(typeof e.removeListener==="function")e.removeListener(t,r);else e.removeEventListener(t,r,i)}function J1(e,t,r,i){if(typeof e.on==="function")if(i.once)e.once(t,r);else e.on(t,r);else e.addEventListener(t,r,i)}function ss(e,t,r){let i=TypeError(`The "${e}" argument must be of type ${t}. Received ${r}`);return i.code="ERR_INVALID_ARG_TYPE",i}function N$(e,t,r){let i=RangeError(`The "${e}" argument is out of range. It must be ${t}. Received ${r}`);return i.code="ERR_OUT_OF_RANGE",i}function sw(e,t){if(e!==void 0&&(e===null||typeof e!=="object"||!("aborted"in e)))throw ss(t,"AbortSignal",e)}function Em(e,t,r,i){if(typeof e!=="number")throw ss(t,"number",e);if(r!=null&&e<r||i!=null&&e>i||(r!=null||i!=null)&&Number.isNaN(e))throw N$(t,`${r!=null?`>= ${r}`:""}${r!=null&&i!=null?" && ":""}${i!=null?`<= ${i}`:""}`,e)}function wa(e){if(typeof e!=="function")throw TypeError("The listener must be a function")}function z$(e,t){if(typeof e!=="boolean")throw ss(t,"boolean",e)}function aw(e){return e?._maxListeners??mo}function uw(e,t){if(e===void 0)throw ss("signal","AbortSignal",e);if(sw(e,"signal"),typeof t!=="function")throw ss("listener","function",t);let r;if(e.aborted)queueMicrotask(()=>t());else e.addEventListener("abort",t,{__proto__:null,once:!0}),r=()=>{e.removeEventListener("abort",t)};return{__proto__:null,[Symbol.dispose](){r?.()}}}var Mm,po,X1,P$,A$,W1,Y1,G1,mo=10,Ri=function(e){if(this._events===void 0||this._events===this.__proto__._events)this._events={__proto__:null},this._eventsCount=0;if(this._maxListeners??=void 0,this[po]=e?.captureRejections?Boolean(e?.captureRejections):Ft[po])this.emit=D$},Ft,O$=function(e,...t){if(e==="error")return Q1(this,t);var{_events:r}=this;if(r===void 0)return!1;var i=r[e];if(i===void 0)return!1;let n=i.length>1?i.slice():i;for(let o=0,{length:s}=n;o<s;o++){let h=n[o];switch(t.length){case 0:h.call(this);break;case 1:h.call(this,t[0]);break;case 2:h.call(this,t[0],t[1]);break;case 3:h.call(this,t[0],t[1],t[2]);break;default:h.apply(this,t);break}}return!0},D$=function(e,...t){if(e==="error")return Q1(this,t);var{_events:r}=this;if(r===void 0)return!1;var i=r[e];if(i===void 0)return!1;let n=i.length>1?i.slice():i;for(let o=0,{length:s}=n;o<s;o++){let h=n[o],v;switch(t.length){case 0:v=h.call(this);break;case 1:v=h.call(this,t[0]);break;case 2:v=h.call(this,t[0],t[1]);break;case 3:v=h.call(this,t[0],t[1],t[2]);break;default:v=h.apply(this,t);break}if(v!==void 0&&typeof v?.then==="function"&&v.then===Promise.prototype.then)R$(this,v,e,t)}return!0},km,j$;var xa=ga(()=>{Mm=Symbol.for,po=Symbol("kCapture"),X1=Mm("events.errorMonitor"),P$=Symbol("events.maxEventTargetListeners"),A$=Symbol("events.maxEventTargetListenersWarned"),W1=Mm("nodejs.rejection"),Y1=Mm("nodejs.rejection"),G1=Array.prototype.slice,Ft=Ri.prototype={};Ft._events=void 0;Ft._eventsCount=0;Ft._maxListeners=void 0;Ft.setMaxListeners=function(e){return Em(e,"setMaxListeners",0),this._maxListeners=e,this};Ft.constructor=Ri;Ft.getMaxListeners=function(){return this?._maxListeners??mo};Ft.emit=O$;Ft.addListener=function(e,t){wa(t);var r=this._events;if(!r)r=this._events={__proto__:null},this._eventsCount=0;else if(r.newListener)this.emit("newListener",e,t.listener??t);var i=r[e];if(!i)r[e]=[t],this._eventsCount++;else{i.push(t);var n=this._maxListeners??mo;if(n>0&&i.length>n&&!i.warned)ew(this,e,i)}return this};Ft.on=Ft.addListener;Ft.prependListener=function(e,t){wa(t);var r=this._events;if(!r)r=this._events={__proto__:null},this._eventsCount=0;else if(r.newListener)this.emit("newListener",e,t.listener??t);var i=r[e];if(!i)r[e]=[t],this._eventsCount++;else{i.unshift(t);var n=this._maxListeners??mo;if(n>0&&i.length>n&&!i.warned)ew(this,e,i)}return this};Ft.once=function(e,t){wa(t);let r=tw.bind(this,e,t);return r.listener=t,this.addListener(e,r),this};Ft.prependOnceListener=function(e,t){wa(t);let r=tw.bind(this,e,t);return r.listener=t,this.prependListener(e,r),this};Ft.removeListener=function(e,t){wa(t);var{_events:r}=this;if(!r)return this;var i=r[e];if(!i)return this;var n=i.length;let o=-1;for(let s=n-1;s>=0;s--)if(i[s]===t||i[s].listener===t){o=s;break}if(o<0)return this;if(o===0)i.shift();else i.splice(o,1);if(i.length===0)delete r[e],this._eventsCount--;return this};Ft.off=Ft.removeListener;Ft.removeAllListeners=function(e){var{_events:t}=this;if(e&&t){if(t[e])delete t[e],this._eventsCount--}else this._events={__proto__:null};return this};Ft.listeners=function(e){var{_events:t}=this;if(!t)return[];var r=t[e];if(!r)return[];return r.map((i)=>i.listener??i)};Ft.rawListeners=function(e){var{_events:t}=this;if(!t)return[];var r=t[e];if(!r)return[];return r.slice()};Ft.listenerCount=function(e){var{_events:t}=this;if(!t)return 0;return t[e]?.length??0};Ft.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};Ft[po]=!1;km=class km extends Error{constructor(e="The operation was aborted",t=void 0){if(t!==void 0&&typeof t!=="object")throw ss("options","Object",t);super(e,t);this.code="ABORT_ERR",this.name="AbortError"}};Object.defineProperties(Ri,{captureRejections:{get(){return Ft[po]},set(e){z$(e,"EventEmitter.captureRejections"),Ft[po]=e},enumerable:!0},defaultMaxListeners:{enumerable:!0,get:()=>mo,set:(e)=>{Em(e,"defaultMaxListeners",0),mo=e}},kMaxEventTargetListeners:{value:P$,enumerable:!1,configurable:!1,writable:!1},kMaxEventTargetListenersWarned:{value:A$,enumerable:!1,configurable:!1,writable:!1}});Object.assign(Ri,{once:rw,getEventListeners:nw,getMaxListeners:aw,setMaxListeners:iw,EventEmitter:Ri,usingDomains:!1,captureRejectionSymbol:Y1,errorMonitor:X1,addAbortListener:uw,init:Ri,listenerCount:ow});j$=Ri});var Pm=Xe(function(LK,gw){var Tt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Wt=Tt((e,t)=>{class r extends Error{constructor(i){if(!Array.isArray(i))throw TypeError(`Expected input to be an Array, got ${typeof i}`);let n="";for(let o=0;o<i.length;o++)n+=` ${i[o].stack}
|
|
13
|
+
`)+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}function z1(e){return Array.isArray(e)}function _m(e){return typeof e==="boolean"}function zc(e){return e===null}function x$(e){return e==null}function j1(e){return typeof e==="number"}function jc(e){return typeof e==="string"}function k$(e){return typeof e==="symbol"}function is(e){return e===void 0}function Cc(e){return os(e)&&wm(e)==="[object RegExp]"}function os(e){return typeof e==="object"&&e!==null}function vm(e){return os(e)&&wm(e)==="[object Date]"}function Oc(e){return os(e)&&(wm(e)==="[object Error]"||e instanceof Error)}function Dc(e){return typeof e==="function"}function M$(e){return e===null||typeof e==="boolean"||typeof e==="number"||typeof e==="string"||typeof e==="symbol"||typeof e>"u"}function E$(e){return e instanceof Buffer}function wm(e){return Object.prototype.toString.call(e)}function gm(e){return e<10?"0"+e.toString(10):e.toString(10)}function $$(){var e=new Date,t=[gm(e.getHours()),gm(e.getMinutes()),gm(e.getSeconds())].join(":");return[e.getDate(),I$[e.getMonth()],t].join(" ")}function U1(...e){console.log("%s - %s",$$(),bm.apply(null,e))}function L1(e,t){if(t)e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function Sm(e,t){if(!t||!os(t))return e;var r=Object.keys(t),i=r.length;while(i--)e[r[i]]=t[r[i]];return e}function F1(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function xm(e,t){if(!e){var r=Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}function B1(e){if(typeof e!=="function")throw TypeError('The "original" argument must be of type Function');function t(...r){var i=r.pop();if(typeof i!=="function")throw TypeError("The last argument must be of type Function");var n=this,o=function(...s){return i.apply(n,...s)};e.apply(this,r).then(function(s){process.nextTick(o.bind(null,null,s))},function(s){process.nextTick(xm.bind(null,s,o))})}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)),t}var h$,m$,ho,S$=()=>{},I$,q1,H1,Z1,T$;var V1=ga(()=>{h$=/%[sdj%]/g;m$=((e={},t={},r)=>((r=typeof process<"u"&&!1)&&(r=r.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase()),t=new RegExp("^"+r+"$","i"),(i)=>{if(i=i.toUpperCase(),!e[i])if(t.test(i))e[i]=function(...n){console.error("%s: %s",i,pid,bm.apply(null,...n))};else e[i]=function(){};return e[i]}))(),ho=((e)=>(e.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},e.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.custom=Symbol.for("nodejs.util.inspect.custom"),e))(function(e,t,...r){var i={seen:[],stylize:y$};if(r.length>=1)i.depth=r[0];if(r.length>=2)i.colors=r[1];if(_m(t))i.showHidden=t;else if(t)Sm(i,t);if(is(i.showHidden))i.showHidden=!1;if(is(i.depth))i.depth=2;if(is(i.colors))i.colors=!1;if(i.colors)i.stylize=g$;return Nc(i,e,i.depth)});I$=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];q1=((e)=>(e.custom=Symbol.for("nodejs.util.promisify.custom"),e))(function(e){if(typeof e!=="function")throw TypeError('The "original" argument must be of type Function');if(kCustomPromisifiedSymbol&&e[kCustomPromisifiedSymbol]){var t=e[kCustomPromisifiedSymbol];if(typeof t!=="function")throw TypeError('The "nodejs.util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,kCustomPromisifiedSymbol,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(...r){var i,n,o=new Promise(function(s,h){i=s,n=h});r.push(function(s,h){if(s)n(s);else i(h)});try{e.apply(this,r)}catch(s){n(s)}return o}if(Object.setPrototypeOf(t,Object.getPrototypeOf(e)),kCustomPromisifiedSymbol)Object.defineProperty(t,kCustomPromisifiedSymbol,{value:t,enumerable:!1,writable:!1,configurable:!0});return Object.defineProperties(t,Object.getOwnPropertyDescriptors(e))});({TextEncoder:H1,TextDecoder:Z1}=globalThis),T$={TextEncoder:H1,TextDecoder:Z1,promisify:q1,log:U1,inherits:L1,_extend:Sm,callbackifyOnRejected:xm,callbackify:B1}});var Sa={};wn(Sa,{setMaxListeners:()=>iw,once:()=>rw,listenerCount:()=>ow,init:()=>Ri,getMaxListeners:()=>aw,getEventListeners:()=>nw,default:()=>j$,captureRejectionSymbol:()=>Y1,addAbortListener:()=>uw,EventEmitter:()=>Ri});function Q1(e,t){var{_events:r}=e;if(t[0]??=Error("Unhandled error."),!r)throw t[0];var i=r[X1];if(i)for(var n of G1.call(i))n.apply(e,t);var o=r.error;if(!o)throw t[0];for(var n of G1.call(o))n.apply(e,t);return!0}function R$(e,t,r,i){t.then(void 0,function(n){queueMicrotask(()=>C$(e,n,r,i))})}function C$(e,t,r,i){if(typeof e[W1]==="function")e[W1](t,r,...i);else try{e[po]=!1,e.emit("error",t)}finally{e[po]=!0}}function ew(e,t,r){r.warned=!0;let i=Error(`Possible EventEmitter memory leak detected. ${r.length} ${String(t)} listeners added to [${e.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);i.name="MaxListenersExceededWarning",i.emitter=e,i.type=t,i.count=r.length,console.warn(i)}function tw(e,t,...r){this.removeListener(e,t),t.apply(this,r)}function rw(e,t,r){var i=r?.signal;if(sw(i,"options.signal"),i?.aborted)throw new km(void 0,{cause:i?.reason});let{resolve:n,reject:o,promise:s}=$newPromiseCapability(Promise),h=(_)=>{if(e.removeListener(t,v),i!=null)Uc(i,"abort",b);o(_)},v=(..._)=>{if(typeof e.removeListener==="function")e.removeListener("error",h);if(i!=null)Uc(i,"abort",b);n(_)};if(J1(e,t,v,{once:!0}),t!=="error"&&typeof e.once==="function")e.once("error",h);function b(){Uc(e,t,v),Uc(e,"error",h),o(new km(void 0,{cause:i?.reason}))}if(i!=null)J1(i,"abort",b,{once:!0});return s}function nw(e,t){return e.listeners(t)}function iw(e,...t){Em(e,"setMaxListeners",0);var r;if(t&&(r=t.length))for(let i=0;i<r;i++)t[i].setMaxListeners(e);else mo=e}function ow(e,t){return e.listenerCount(t)}function Uc(e,t,r,i){if(typeof e.removeListener==="function")e.removeListener(t,r);else e.removeEventListener(t,r,i)}function J1(e,t,r,i){if(typeof e.on==="function")if(i.once)e.once(t,r);else e.on(t,r);else e.addEventListener(t,r,i)}function ss(e,t,r){let i=TypeError(`The "${e}" argument must be of type ${t}. Received ${r}`);return i.code="ERR_INVALID_ARG_TYPE",i}function N$(e,t,r){let i=RangeError(`The "${e}" argument is out of range. It must be ${t}. Received ${r}`);return i.code="ERR_OUT_OF_RANGE",i}function sw(e,t){if(e!==void 0&&(e===null||typeof e!=="object"||!("aborted"in e)))throw ss(t,"AbortSignal",e)}function Em(e,t,r,i){if(typeof e!=="number")throw ss(t,"number",e);if(r!=null&&e<r||i!=null&&e>i||(r!=null||i!=null)&&Number.isNaN(e))throw N$(t,`${r!=null?`>= ${r}`:""}${r!=null&&i!=null?" && ":""}${i!=null?`<= ${i}`:""}`,e)}function wa(e){if(typeof e!=="function")throw TypeError("The listener must be a function")}function z$(e,t){if(typeof e!=="boolean")throw ss(t,"boolean",e)}function aw(e){return e?._maxListeners??mo}function uw(e,t){if(e===void 0)throw ss("signal","AbortSignal",e);if(sw(e,"signal"),typeof t!=="function")throw ss("listener","function",t);let r;if(e.aborted)queueMicrotask(()=>t());else e.addEventListener("abort",t,{__proto__:null,once:!0}),r=()=>{e.removeEventListener("abort",t)};return{__proto__:null,[Symbol.dispose](){r?.()}}}var Mm,po,X1,P$,A$,W1,Y1,G1,mo=10,Ri=function(e){if(this._events===void 0||this._events===this.__proto__._events)this._events={__proto__:null},this._eventsCount=0;if(this._maxListeners??=void 0,this[po]=e?.captureRejections?Boolean(e?.captureRejections):Ft[po])this.emit=D$},Ft,O$=function(e,...t){if(e==="error")return Q1(this,t);var{_events:r}=this;if(r===void 0)return!1;var i=r[e];if(i===void 0)return!1;let n=i.length>1?i.slice():i;for(let o=0,{length:s}=n;o<s;o++){let h=n[o];switch(t.length){case 0:h.call(this);break;case 1:h.call(this,t[0]);break;case 2:h.call(this,t[0],t[1]);break;case 3:h.call(this,t[0],t[1],t[2]);break;default:h.apply(this,t);break}}return!0},D$=function(e,...t){if(e==="error")return Q1(this,t);var{_events:r}=this;if(r===void 0)return!1;var i=r[e];if(i===void 0)return!1;let n=i.length>1?i.slice():i;for(let o=0,{length:s}=n;o<s;o++){let h=n[o],v;switch(t.length){case 0:v=h.call(this);break;case 1:v=h.call(this,t[0]);break;case 2:v=h.call(this,t[0],t[1]);break;case 3:v=h.call(this,t[0],t[1],t[2]);break;default:v=h.apply(this,t);break}if(v!==void 0&&typeof v?.then==="function"&&v.then===Promise.prototype.then)R$(this,v,e,t)}return!0},km,j$;var xa=ga(()=>{Mm=Symbol.for,po=Symbol("kCapture"),X1=Mm("events.errorMonitor"),P$=Symbol("events.maxEventTargetListeners"),A$=Symbol("events.maxEventTargetListenersWarned"),W1=Mm("nodejs.rejection"),Y1=Mm("nodejs.rejection"),G1=Array.prototype.slice,Ft=Ri.prototype={};Ft._events=void 0;Ft._eventsCount=0;Ft._maxListeners=void 0;Ft.setMaxListeners=function(e){return Em(e,"setMaxListeners",0),this._maxListeners=e,this};Ft.constructor=Ri;Ft.getMaxListeners=function(){return this?._maxListeners??mo};Ft.emit=O$;Ft.addListener=function(e,t){wa(t);var r=this._events;if(!r)r=this._events={__proto__:null},this._eventsCount=0;else if(r.newListener)this.emit("newListener",e,t.listener??t);var i=r[e];if(!i)r[e]=[t],this._eventsCount++;else{i.push(t);var n=this._maxListeners??mo;if(n>0&&i.length>n&&!i.warned)ew(this,e,i)}return this};Ft.on=Ft.addListener;Ft.prependListener=function(e,t){wa(t);var r=this._events;if(!r)r=this._events={__proto__:null},this._eventsCount=0;else if(r.newListener)this.emit("newListener",e,t.listener??t);var i=r[e];if(!i)r[e]=[t],this._eventsCount++;else{i.unshift(t);var n=this._maxListeners??mo;if(n>0&&i.length>n&&!i.warned)ew(this,e,i)}return this};Ft.once=function(e,t){wa(t);let r=tw.bind(this,e,t);return r.listener=t,this.addListener(e,r),this};Ft.prependOnceListener=function(e,t){wa(t);let r=tw.bind(this,e,t);return r.listener=t,this.prependListener(e,r),this};Ft.removeListener=function(e,t){wa(t);var{_events:r}=this;if(!r)return this;var i=r[e];if(!i)return this;var n=i.length;let o=-1;for(let s=n-1;s>=0;s--)if(i[s]===t||i[s].listener===t){o=s;break}if(o<0)return this;if(o===0)i.shift();else i.splice(o,1);if(i.length===0)delete r[e],this._eventsCount--;return this};Ft.off=Ft.removeListener;Ft.removeAllListeners=function(e){var{_events:t}=this;if(e&&t){if(t[e])delete t[e],this._eventsCount--}else this._events={__proto__:null};return this};Ft.listeners=function(e){var{_events:t}=this;if(!t)return[];var r=t[e];if(!r)return[];return r.map((i)=>i.listener??i)};Ft.rawListeners=function(e){var{_events:t}=this;if(!t)return[];var r=t[e];if(!r)return[];return r.slice()};Ft.listenerCount=function(e){var{_events:t}=this;if(!t)return 0;return t[e]?.length??0};Ft.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};Ft[po]=!1;km=class km extends Error{constructor(e="The operation was aborted",t=void 0){if(t!==void 0&&typeof t!=="object")throw ss("options","Object",t);super(e,t);this.code="ABORT_ERR",this.name="AbortError"}};Object.defineProperties(Ri,{captureRejections:{get(){return Ft[po]},set(e){z$(e,"EventEmitter.captureRejections"),Ft[po]=e},enumerable:!0},defaultMaxListeners:{enumerable:!0,get:()=>mo,set:(e)=>{Em(e,"defaultMaxListeners",0),mo=e}},kMaxEventTargetListeners:{value:P$,enumerable:!1,configurable:!1,writable:!1},kMaxEventTargetListenersWarned:{value:A$,enumerable:!1,configurable:!1,writable:!1}});Object.assign(Ri,{once:rw,getEventListeners:nw,getMaxListeners:aw,setMaxListeners:iw,EventEmitter:Ri,usingDomains:!1,captureRejectionSymbol:Y1,errorMonitor:X1,addAbortListener:uw,init:Ri,listenerCount:ow});j$=Ri});var Pm=Xe(function(KK,gw){var Tt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Wt=Tt((e,t)=>{class r extends Error{constructor(i){if(!Array.isArray(i))throw TypeError(`Expected input to be an Array, got ${typeof i}`);let n="";for(let o=0;o<i.length;o++)n+=` ${i[o].stack}
|
|
14
14
|
`;super(n);this.name="AggregateError",this.errors=i}}t.exports={AggregateError:r,ArrayIsArray(i){return Array.isArray(i)},ArrayPrototypeIncludes(i,n){return i.includes(n)},ArrayPrototypeIndexOf(i,n){return i.indexOf(n)},ArrayPrototypeJoin(i,n){return i.join(n)},ArrayPrototypeMap(i,n){return i.map(n)},ArrayPrototypePop(i,n){return i.pop(n)},ArrayPrototypePush(i,n){return i.push(n)},ArrayPrototypeSlice(i,n,o){return i.slice(n,o)},Error,FunctionPrototypeCall(i,n,...o){return i.call(n,...o)},FunctionPrototypeSymbolHasInstance(i,n){return Function.prototype[Symbol.hasInstance].call(i,n)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(i,n){return Object.defineProperties(i,n)},ObjectDefineProperty(i,n,o){return Object.defineProperty(i,n,o)},ObjectGetOwnPropertyDescriptor(i,n){return Object.getOwnPropertyDescriptor(i,n)},ObjectKeys(i){return Object.keys(i)},ObjectSetPrototypeOf(i,n){return Object.setPrototypeOf(i,n)},Promise,PromisePrototypeCatch(i,n){return i.catch(n)},PromisePrototypeThen(i,n,o){return i.then(n,o)},PromiseReject(i){return Promise.reject(i)},PromiseResolve(i){return Promise.resolve(i)},ReflectApply:Reflect.apply,RegExpPrototypeTest(i,n){return i.test(n)},SafeSet:Set,String,StringPrototypeSlice(i,n,o){return i.slice(n,o)},StringPrototypeToLowerCase(i){return i.toLowerCase()},StringPrototypeToUpperCase(i){return i.toUpperCase()},StringPrototypeTrim(i){return i.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(i,n,o){return i.set(n,o)},Boolean,Uint8Array}}),lw=Tt((e,t)=>{t.exports={format(r,...i){return r.replace(/%([sdifj])/g,function(...[n,o]){let s=i.shift();if(o==="f")return s.toFixed(6);else if(o==="j")return JSON.stringify(s);else if(o==="s"&&typeof s==="object")return`${s.constructor!==Object?s.constructor.name:""} {}`.trim();else return s.toString()})},inspect(r){switch(typeof r){case"string":if(r.includes("'")){if(!r.includes('"'))return`"${r}"`;else if(!r.includes("`")&&!r.includes("${"))return`\`${r}\``}return`'${r}'`;case"number":if(isNaN(r))return"NaN";else if(Object.is(r,-0))return String(r);return r;case"bigint":return`${String(r)}n`;case"boolean":case"undefined":return String(r);case"object":return"{}"}}}}),Hr=Tt((e,t)=>{var{format:r,inspect:i}=lw(),{AggregateError:n}=Wt(),o=globalThis.AggregateError||n,s=Symbol("kIsNodeError"),h=["string","function","number","object","Function","Object","boolean","bigint","symbol"],v=/^([A-Z][a-z0-9]*)+$/,b={};function _(T,P){if(!T)throw new b.ERR_INTERNAL_ASSERTION(P)}function g(T){let P="",R=T.length,C=T[0]==="-"?1:0;for(;R>=C+4;R-=3)P=`_${T.slice(R-3,R)}${P}`;return`${T.slice(0,R)}${P}`}function S(T,P,R){if(typeof P==="function")return _(P.length<=R.length,`Code: ${T}; The provided arguments length (${R.length}) does not match the required ones (${P.length}).`),P(...R);let C=(P.match(/%[dfijoOs]/g)||[]).length;if(_(C===R.length,`Code: ${T}; The provided arguments length (${R.length}) does not match the required ones (${C}).`),R.length===0)return P;return r(P,...R)}function x(T,P,R){if(!R)R=Error;class C extends R{constructor(...N){super(S(T,P,N))}toString(){return`${this.name} [${T}]: ${this.message}`}}Object.defineProperties(C.prototype,{name:{value:R.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${T}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),C.prototype.code=T,C.prototype[s]=!0,b[T]=C}function M(T){let P="__node_internal_"+T.name;return Object.defineProperty(T,"name",{value:P}),T}function I(T,P){if(T&&P&&T!==P){if(Array.isArray(P.errors))return P.errors.push(T),P;let R=new o([P,T],P.message);return R.code=P.code,R}return T||P}class $ extends Error{constructor(T="The operation was aborted",P=void 0){if(P!==void 0&&typeof P!=="object")throw new b.ERR_INVALID_ARG_TYPE("options","Object",P);super(T,P);this.code="ABORT_ERR",this.name="AbortError"}}x("ERR_ASSERTION","%s",Error),x("ERR_INVALID_ARG_TYPE",(T,P,R)=>{if(_(typeof T==="string","'name' must be a string"),!Array.isArray(P))P=[P];let C="The ";if(T.endsWith(" argument"))C+=`${T} `;else C+=`"${T}" ${T.includes(".")?"property":"argument"} `;C+="must be ";let N=[],B=[],ie=[];for(let ue of P)if(_(typeof ue==="string","All expected entries have to be of type string"),h.includes(ue))N.push(ue.toLowerCase());else if(v.test(ue))B.push(ue);else _(ue!=="object",'The value "object" should be written as "Object"'),ie.push(ue);if(B.length>0){let ue=N.indexOf("object");if(ue!==-1)N.splice(N,ue,1),B.push("Object")}if(N.length>0){switch(N.length){case 1:C+=`of type ${N[0]}`;break;case 2:C+=`one of type ${N[0]} or ${N[1]}`;break;default:{let ue=N.pop();C+=`one of type ${N.join(", ")}, or ${ue}`}}if(B.length>0||ie.length>0)C+=" or "}if(B.length>0){switch(B.length){case 1:C+=`an instance of ${B[0]}`;break;case 2:C+=`an instance of ${B[0]} or ${B[1]}`;break;default:{let ue=B.pop();C+=`an instance of ${B.join(", ")}, or ${ue}`}}if(ie.length>0)C+=" or "}switch(ie.length){case 0:break;case 1:if(ie[0].toLowerCase()!==ie[0])C+="an ";C+=`${ie[0]}`;break;case 2:C+=`one of ${ie[0]} or ${ie[1]}`;break;default:{let ue=ie.pop();C+=`one of ${ie.join(", ")}, or ${ue}`}}if(R==null)C+=`. Received ${R}`;else if(typeof R==="function"&&R.name)C+=`. Received function ${R.name}`;else if(typeof R==="object"){var le;if((le=R.constructor)!==null&&le!==void 0&&le.name)C+=`. Received an instance of ${R.constructor.name}`;else{let ue=i(R,{depth:-1});C+=`. Received ${ue}`}}else{let ue=i(R,{colors:!1});if(ue.length>25)ue=`${ue.slice(0,25)}...`;C+=`. Received type ${typeof R} (${ue})`}return C},TypeError),x("ERR_INVALID_ARG_VALUE",(T,P,R="is invalid")=>{let C=i(P);if(C.length>128)C=C.slice(0,128)+"...";return`The ${T.includes(".")?"property":"argument"} '${T}' ${R}. Received ${C}`},TypeError),x("ERR_INVALID_RETURN_VALUE",(T,P,R)=>{var C;let N=R!==null&&R!==void 0&&(C=R.constructor)!==null&&C!==void 0&&C.name?`instance of ${R.constructor.name}`:`type ${typeof R}`;return`Expected ${T} to be returned from the "${P}" function but got ${N}.`},TypeError),x("ERR_MISSING_ARGS",(...T)=>{_(T.length>0,"At least one arg needs to be specified");let P,R=T.length;switch(T=(Array.isArray(T)?T:[T]).map((C)=>`"${C}"`).join(" or "),R){case 1:P+=`The ${T[0]} argument`;break;case 2:P+=`The ${T[0]} and ${T[1]} arguments`;break;default:{let C=T.pop();P+=`The ${T.join(", ")}, and ${C} arguments`}break}return`${P} must be specified`},TypeError),x("ERR_OUT_OF_RANGE",(T,P,R)=>{_(P,'Missing "range" argument');let C;if(Number.isInteger(R)&&Math.abs(R)>4294967296)C=g(String(R));else if(typeof R==="bigint"){C=String(R);let N=BigInt(2)**BigInt(32);if(R>N||R<-N)C=g(C);C+="n"}else C=i(R);return`The value of "${T}" is out of range. It must be ${P}. Received ${C}`},RangeError),x("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),x("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),x("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),x("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),x("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),x("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),x("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),x("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),x("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),x("ERR_STREAM_WRITE_AFTER_END","write after end",Error),x("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),t.exports={AbortError:$,aggregateTwoErrors:M(I),hideStackFrames:M,codes:b}}),U$=Tt((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});var r=new WeakMap,i=new WeakMap;function n(F){let ee=r.get(F);return console.assert(ee!=null,"'this' is expected an Event object, but got",F),ee}function o(F){if(F.passiveListener!=null){if(typeof console<"u"&&typeof console.error==="function")console.error("Unable to preventDefault inside passive event listener invocation.",F.passiveListener);return}if(!F.event.cancelable)return;if(F.canceled=!0,typeof F.event.preventDefault==="function")F.event.preventDefault()}function s(F,ee){r.set(this,{eventTarget:F,event:ee,eventPhase:2,currentTarget:F,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:ee.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let a=Object.keys(ee);for(let c=0;c<a.length;++c){let f=a[c];if(!(f in this))Object.defineProperty(this,f,h(f))}}if(s.prototype={get type(){return n(this).event.type},get target(){return n(this).eventTarget},get currentTarget(){return n(this).currentTarget},composedPath(){let F=n(this).currentTarget;if(F==null)return[];return[F]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return n(this).eventPhase},stopPropagation(){let F=n(this);if(F.stopped=!0,typeof F.event.stopPropagation==="function")F.event.stopPropagation()},stopImmediatePropagation(){let F=n(this);if(F.stopped=!0,F.immediateStopped=!0,typeof F.event.stopImmediatePropagation==="function")F.event.stopImmediatePropagation()},get bubbles(){return Boolean(n(this).event.bubbles)},get cancelable(){return Boolean(n(this).event.cancelable)},preventDefault(){o(n(this))},get defaultPrevented(){return n(this).canceled},get composed(){return Boolean(n(this).event.composed)},get timeStamp(){return n(this).timeStamp},get srcElement(){return n(this).eventTarget},get cancelBubble(){return n(this).stopped},set cancelBubble(F){if(!F)return;let ee=n(this);if(ee.stopped=!0,typeof ee.event.cancelBubble==="boolean")ee.event.cancelBubble=!0},get returnValue(){return!n(this).canceled},set returnValue(F){if(!F)o(n(this))},initEvent(){}},Object.defineProperty(s.prototype,"constructor",{value:s,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.Event<"u")Object.setPrototypeOf(s.prototype,window.Event.prototype),i.set(window.Event.prototype,s);function h(F){return{get(){return n(this).event[F]},set(ee){n(this).event[F]=ee},configurable:!0,enumerable:!0}}function v(F){return{value(){let ee=n(this).event;return ee[F].apply(ee,arguments)},configurable:!0,enumerable:!0}}function b(F,ee){let a=Object.keys(ee);if(a.length===0)return F;function c(f,l){F.call(this,f,l)}c.prototype=Object.create(F.prototype,{constructor:{value:c,configurable:!0,writable:!0}});for(let f=0;f<a.length;++f){let l=a[f];if(!(l in F.prototype)){let d=typeof Object.getOwnPropertyDescriptor(ee,l).value==="function";Object.defineProperty(c.prototype,l,d?v(l):h(l))}}return c}function _(F){if(F==null||F===Object.prototype)return s;let ee=i.get(F);if(ee==null)ee=b(_(Object.getPrototypeOf(F)),F),i.set(F,ee);return ee}function g(F,ee){return new(_(Object.getPrototypeOf(ee)))(F,ee)}function S(F){return n(F).immediateStopped}function x(F,ee){n(F).eventPhase=ee}function M(F,ee){n(F).currentTarget=ee}function I(F,ee){n(F).passiveListener=ee}var $=new WeakMap,T=1,P=2,R=3;function C(F){return F!==null&&typeof F==="object"}function N(F){let ee=$.get(F);if(ee==null)throw TypeError("'this' is expected an EventTarget object, but got another value.");return ee}function B(F){return{get(){let ee=N(this).get(F);while(ee!=null){if(ee.listenerType===R)return ee.listener;ee=ee.next}return null},set(ee){if(typeof ee!=="function"&&!C(ee))ee=null;let a=N(this),c=null,f=a.get(F);while(f!=null){if(f.listenerType===R)if(c!==null)c.next=f.next;else if(f.next!==null)a.set(F,f.next);else a.delete(F);else c=f;f=f.next}if(ee!==null){let l={listener:ee,listenerType:R,passive:!1,once:!1,next:null};if(c===null)a.set(F,l);else c.next=l}},configurable:!0,enumerable:!0}}function ie(F,ee){Object.defineProperty(F,`on${ee}`,B(ee))}function le(F){function ee(){ue.call(this)}ee.prototype=Object.create(ue.prototype,{constructor:{value:ee,configurable:!0,writable:!0}});for(let a=0;a<F.length;++a)ie(ee.prototype,F[a]);return ee}function ue(){if(this instanceof ue){$.set(this,new Map);return}if(arguments.length===1&&Array.isArray(arguments[0]))return le(arguments[0]);if(arguments.length>0){let F=Array(arguments.length);for(let ee=0;ee<arguments.length;++ee)F[ee]=arguments[ee];return le(F)}throw TypeError("Cannot call a class as a function")}if(ue.prototype={addEventListener(F,ee,a){if(ee==null)return;if(typeof ee!=="function"&&!C(ee))throw TypeError("'listener' should be a function or an object.");let c=N(this),f=C(a),l=(f?Boolean(a.capture):Boolean(a))?T:P,d={listener:ee,listenerType:l,passive:f&&Boolean(a.passive),once:f&&Boolean(a.once),next:null},y=c.get(F);if(y===void 0){c.set(F,d);return}let w=null;while(y!=null){if(y.listener===ee&&y.listenerType===l)return;w=y,y=y.next}w.next=d},removeEventListener(F,ee,a){if(ee==null)return;let c=N(this),f=(C(a)?Boolean(a.capture):Boolean(a))?T:P,l=null,d=c.get(F);while(d!=null){if(d.listener===ee&&d.listenerType===f){if(l!==null)l.next=d.next;else if(d.next!==null)c.set(F,d.next);else c.delete(F);return}l=d,d=d.next}},dispatchEvent(F){if(F==null||typeof F.type!=="string")throw TypeError('"event.type" should be a string.');let ee=N(this),a=F.type,c=ee.get(a);if(c==null)return!0;let f=g(this,F),l=null;while(c!=null){if(c.once)if(l!==null)l.next=c.next;else if(c.next!==null)ee.set(a,c.next);else ee.delete(a);else l=c;if(I(f,c.passive?c.listener:null),typeof c.listener==="function")try{c.listener.call(this,f)}catch(d){if(typeof console<"u"&&typeof console.error==="function")console.error(d)}else if(c.listenerType!==R&&typeof c.listener.handleEvent==="function")c.listener.handleEvent(f);if(S(f))break;c=c.next}return I(f,null),x(f,0),M(f,null),!f.defaultPrevented}},Object.defineProperty(ue.prototype,"constructor",{value:ue,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.EventTarget<"u")Object.setPrototypeOf(ue.prototype,window.EventTarget.prototype);e.defineEventAttribute=ie,e.EventTarget=ue,e.default=ue,t.exports=ue,t.exports.EventTarget=t.exports.default=ue,t.exports.defineEventAttribute=ie}),ka=Tt((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});var r=U$();class i extends r.EventTarget{constructor(){super();throw TypeError("AbortSignal cannot be constructed directly")}get aborted(){let _=s.get(this);if(typeof _!=="boolean")throw TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?"null":typeof this}`);return _}}r.defineEventAttribute(i.prototype,"abort");function n(){let _=Object.create(i.prototype);return r.EventTarget.call(_),s.set(_,!1),_}function o(_){if(s.get(_)!==!1)return;s.set(_,!0),_.dispatchEvent({type:"abort"})}var s=new WeakMap;if(Object.defineProperties(i.prototype,{aborted:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(i.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});class h{constructor(){v.set(this,n())}get signal(){return b(this)}abort(){o(b(this))}}var v=new WeakMap;function b(_){let g=v.get(_);if(g==null)throw TypeError(`Expected 'this' to be an 'AbortController' object, but got ${_===null?"null":typeof _}`);return g}if(Object.defineProperties(h.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(h.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"});e.AbortController=h,e.AbortSignal=i,e.default=h,t.exports=h,t.exports.AbortController=t.exports.default=h,t.exports.AbortSignal=i}),Qr=Tt((e,t)=>{var r=(Tr(),kt($r)),{format:i,inspect:n}=lw(),{codes:{ERR_INVALID_ARG_TYPE:o}}=Hr(),{kResistStopPropagation:s,AggregateError:h,SymbolDispose:v}=Wt(),b=globalThis.AbortSignal||ka().AbortSignal,_=globalThis.AbortController||ka().AbortController,g=Object.getPrototypeOf(async function(){}).constructor,S=globalThis.Blob||r.Blob,x=typeof S<"u"?function($){return $ instanceof S}:function($){return!1},M=($,T)=>{if($!==void 0&&($===null||typeof $!=="object"||!("aborted"in $)))throw new o(T,"AbortSignal",$)},I=($,T)=>{if(typeof $!=="function")throw new o(T,"Function",$)};t.exports={AggregateError:h,kEmptyObject:Object.freeze({}),once($){let T=!1;return function(...P){if(T)return;T=!0,$.apply(this,P)}},createDeferredPromise:function(){let $,T;return{promise:new Promise((P,R)=>{$=P,T=R}),resolve:$,reject:T}},promisify($){return new Promise((T,P)=>{$((R,...C)=>{if(R)return P(R);return T(...C)})})},debuglog(){return function(){}},format:i,inspect:n,types:{isAsyncFunction($){return $ instanceof g},isArrayBufferView($){return ArrayBuffer.isView($)}},isBlob:x,deprecate($,T){return $},addAbortListener:(xa(),kt(Sa)).addAbortListener||function($,T){if($===void 0)throw new o("signal","AbortSignal",$);M($,"signal"),I(T,"listener");let P;if($.aborted)queueMicrotask(()=>T());else $.addEventListener("abort",T,{__proto__:null,once:!0,[s]:!0}),P=()=>{$.removeEventListener("abort",T)};return{__proto__:null,[v](){var R;(R=P)===null||R===void 0||R()}}},AbortSignalAny:b.any||function($){if($.length===1)return $[0];let T=new _,P=()=>T.abort();return $.forEach((R)=>{M(R,"signals"),R.addEventListener("abort",P,{once:!0})}),T.signal.addEventListener("abort",()=>{$.forEach((R)=>R.removeEventListener("abort",P))},{once:!0}),T.signal}},t.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),Ma=Tt((e,t)=>{var{ArrayIsArray:r,ArrayPrototypeIncludes:i,ArrayPrototypeJoin:n,ArrayPrototypeMap:o,NumberIsInteger:s,NumberIsNaN:h,NumberMAX_SAFE_INTEGER:v,NumberMIN_SAFE_INTEGER:b,NumberParseInt:_,ObjectPrototypeHasOwnProperty:g,RegExpPrototypeExec:S,String:x,StringPrototypeToUpperCase:M,StringPrototypeTrim:I}=Wt(),{hideStackFrames:$,codes:{ERR_SOCKET_BAD_PORT:T,ERR_INVALID_ARG_TYPE:P,ERR_INVALID_ARG_VALUE:R,ERR_OUT_OF_RANGE:C,ERR_UNKNOWN_SIGNAL:N}}=Hr(),{normalizeEncoding:B}=Qr(),{isAsyncFunction:ie,isArrayBufferView:le}=Qr().types,ue={};function F(j){return j===(j|0)}function ee(j){return j===j>>>0}var a=/^[0-7]+$/,c="must be a 32-bit unsigned integer or an octal string";function f(j,Z,je){if(typeof j>"u")j=je;if(typeof j==="string"){if(S(a,j)===null)throw new R(Z,j,c);j=_(j,8)}return y(j,Z),j}var l=$((j,Z,je=b,W=v)=>{if(typeof j!=="number")throw new P(Z,"number",j);if(!s(j))throw new C(Z,"an integer",j);if(j<je||j>W)throw new C(Z,`>= ${je} && <= ${W}`,j)}),d=$((j,Z,je=-2147483648,W=2147483647)=>{if(typeof j!=="number")throw new P(Z,"number",j);if(!s(j))throw new C(Z,"an integer",j);if(j<je||j>W)throw new C(Z,`>= ${je} && <= ${W}`,j)}),y=$((j,Z,je=!1)=>{if(typeof j!=="number")throw new P(Z,"number",j);if(!s(j))throw new C(Z,"an integer",j);let W=je?1:0,re=4294967295;if(j<W||j>re)throw new C(Z,`>= ${W} && <= ${re}`,j)});function w(j,Z){if(typeof j!=="string")throw new P(Z,"string",j)}function p(j,Z,je=void 0,W){if(typeof j!=="number")throw new P(Z,"number",j);if(je!=null&&j<je||W!=null&&j>W||(je!=null||W!=null)&&h(j))throw new C(Z,`${je!=null?`>= ${je}`:""}${je!=null&&W!=null?" && ":""}${W!=null?`<= ${W}`:""}`,j)}var u=$((j,Z,je)=>{if(!i(je,j)){let W="must be one of: "+n(o(je,(re)=>typeof re==="string"?`'${re}'`:x(re)),", ");throw new R(Z,j,W)}});function m(j,Z){if(typeof j!=="boolean")throw new P(Z,"boolean",j)}function E(j,Z,je){return j==null||!g(j,Z)?je:j[Z]}var k=$((j,Z,je=null)=>{let W=E(je,"allowArray",!1),re=E(je,"allowFunction",!1);if(!E(je,"nullable",!1)&&j===null||!W&&r(j)||typeof j!=="object"&&(!re||typeof j!=="function"))throw new P(Z,"Object",j)}),A=$((j,Z)=>{if(j!=null&&typeof j!=="object"&&typeof j!=="function")throw new P(Z,"a dictionary",j)}),D=$((j,Z,je=0)=>{if(!r(j))throw new P(Z,"Array",j);if(j.length<je){let W=`must be longer than ${je}`;throw new R(Z,j,W)}});function U(j,Z){D(j,Z);for(let je=0;je<j.length;je++)w(j[je],`${Z}[${je}]`)}function K(j,Z){D(j,Z);for(let je=0;je<j.length;je++)m(j[je],`${Z}[${je}]`)}function he(j,Z){D(j,Z);for(let je=0;je<j.length;je++){let W=j[je],re=`${Z}[${je}]`;if(W==null)throw new P(re,"AbortSignal",W);Q(W,re)}}function J(j,Z="signal"){if(w(j,Z),ue[j]===void 0){if(ue[M(j)]!==void 0)throw new N(j+" (signals must use all capital letters)");throw new N(j)}}var H=$((j,Z="buffer")=>{if(!le(j))throw new P(Z,["Buffer","TypedArray","DataView"],j)});function se(j,Z){let je=B(Z),W=j.length;if(je==="hex"&&W%2!==0)throw new R("encoding",Z,`is invalid for data of length ${W}`)}function V(j,Z="Port",je=!0){if(typeof j!=="number"&&typeof j!=="string"||typeof j==="string"&&I(j).length===0||+j!==+j>>>0||j>65535||j===0&&!je)throw new T(Z,j,je);return j|0}var Q=$((j,Z)=>{if(j!==void 0&&(j===null||typeof j!=="object"||!("aborted"in j)))throw new P(Z,"AbortSignal",j)}),He=$((j,Z)=>{if(typeof j!=="function")throw new P(Z,"Function",j)}),z=$((j,Z)=>{if(typeof j!=="function"||ie(j))throw new P(Z,"Function",j)}),L=$((j,Z)=>{if(j!==void 0)throw new P(Z,"undefined",j)});function ae(j,Z,je){if(!i(je,j))throw new P(Z,`('${n(je,"|")}')`,j)}var G=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Y(j,Z){if(typeof j>"u"||!S(G,j))throw new R(Z,j,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function Me(j){if(typeof j==="string")return Y(j,"hints"),j;else if(r(j)){let Z=j.length,je="";if(Z===0)return je;for(let W=0;W<Z;W++){let re=j[W];if(Y(re,"hints"),je+=re,W!==Z-1)je+=", "}return je}throw new R("hints",j,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}t.exports={isInt32:F,isUint32:ee,parseFileMode:f,validateArray:D,validateStringArray:U,validateBooleanArray:K,validateAbortSignalArray:he,validateBoolean:m,validateBuffer:H,validateDictionary:A,validateEncoding:se,validateFunction:He,validateInt32:d,validateInteger:l,validateNumber:p,validateObject:k,validateOneOf:u,validatePlainFunction:z,validatePort:V,validateSignalName:J,validateString:w,validateUint32:y,validateUndefined:L,validateUnion:ae,validateAbortSignal:Q,validateLinkHeaderValue:Me}}),go=Tt((e,t)=>{t.exports=globalThis.process}),si=Tt((e,t)=>{var{SymbolAsyncIterator:r,SymbolIterator:i,SymbolFor:n}=Wt(),o=n("nodejs.stream.destroyed"),s=n("nodejs.stream.errored"),h=n("nodejs.stream.readable"),v=n("nodejs.stream.writable"),b=n("nodejs.stream.disturbed"),_=n("nodejs.webstream.isClosedPromise"),g=n("nodejs.webstream.controllerErrorFunction");function S(E,k=!1){var A;return!!(E&&typeof E.pipe==="function"&&typeof E.on==="function"&&(!k||typeof E.pause==="function"&&typeof E.resume==="function")&&(!E._writableState||((A=E._readableState)===null||A===void 0?void 0:A.readable)!==!1)&&(!E._writableState||E._readableState))}function x(E){var k;return!!(E&&typeof E.write==="function"&&typeof E.on==="function"&&(!E._readableState||((k=E._writableState)===null||k===void 0?void 0:k.writable)!==!1))}function M(E){return!!(E&&typeof E.pipe==="function"&&E._readableState&&typeof E.on==="function"&&typeof E.write==="function")}function I(E){return E&&(E._readableState||E._writableState||typeof E.write==="function"&&typeof E.on==="function"||typeof E.pipe==="function"&&typeof E.on==="function")}function $(E){return!!(E&&!I(E)&&typeof E.pipeThrough==="function"&&typeof E.getReader==="function"&&typeof E.cancel==="function")}function T(E){return!!(E&&!I(E)&&typeof E.getWriter==="function"&&typeof E.abort==="function")}function P(E){return!!(E&&!I(E)&&typeof E.readable==="object"&&typeof E.writable==="object")}function R(E){return $(E)||T(E)||P(E)}function C(E,k){if(E==null)return!1;if(k===!0)return typeof E[r]==="function";if(k===!1)return typeof E[i]==="function";return typeof E[r]==="function"||typeof E[i]==="function"}function N(E){if(!I(E))return null;let{_writableState:k,_readableState:A}=E,D=k||A;return!!(E.destroyed||E[o]||D!==null&&D!==void 0&&D.destroyed)}function B(E){if(!x(E))return null;if(E.writableEnded===!0)return!0;let k=E._writableState;if(k!==null&&k!==void 0&&k.errored)return!1;if(typeof(k===null||k===void 0?void 0:k.ended)!=="boolean")return null;return k.ended}function ie(E,k){if(!x(E))return null;if(E.writableFinished===!0)return!0;let A=E._writableState;if(A!==null&&A!==void 0&&A.errored)return!1;if(typeof(A===null||A===void 0?void 0:A.finished)!=="boolean")return null;return!!(A.finished||k===!1&&A.ended===!0&&A.length===0)}function le(E){if(!S(E))return null;if(E.readableEnded===!0)return!0;let k=E._readableState;if(!k||k.errored)return!1;if(typeof(k===null||k===void 0?void 0:k.ended)!=="boolean")return null;return k.ended}function ue(E,k){if(!S(E))return null;let A=E._readableState;if(A!==null&&A!==void 0&&A.errored)return!1;if(typeof(A===null||A===void 0?void 0:A.endEmitted)!=="boolean")return null;return!!(A.endEmitted||k===!1&&A.ended===!0&&A.length===0)}function F(E){if(E&&E[h]!=null)return E[h];if(typeof(E===null||E===void 0?void 0:E.readable)!=="boolean")return null;if(N(E))return!1;return S(E)&&E.readable&&!ue(E)}function ee(E){if(E&&E[v]!=null)return E[v];if(typeof(E===null||E===void 0?void 0:E.writable)!=="boolean")return null;if(N(E))return!1;return x(E)&&E.writable&&!B(E)}function a(E,k){if(!I(E))return null;if(N(E))return!0;if((k===null||k===void 0?void 0:k.readable)!==!1&&F(E))return!1;if((k===null||k===void 0?void 0:k.writable)!==!1&&ee(E))return!1;return!0}function c(E){var k,A;if(!I(E))return null;if(E.writableErrored)return E.writableErrored;return(k=(A=E._writableState)===null||A===void 0?void 0:A.errored)!==null&&k!==void 0?k:null}function f(E){var k,A;if(!I(E))return null;if(E.readableErrored)return E.readableErrored;return(k=(A=E._readableState)===null||A===void 0?void 0:A.errored)!==null&&k!==void 0?k:null}function l(E){if(!I(E))return null;if(typeof E.closed==="boolean")return E.closed;let{_writableState:k,_readableState:A}=E;if(typeof(k===null||k===void 0?void 0:k.closed)==="boolean"||typeof(A===null||A===void 0?void 0:A.closed)==="boolean")return(k===null||k===void 0?void 0:k.closed)||(A===null||A===void 0?void 0:A.closed);if(typeof E._closed==="boolean"&&d(E))return E._closed;return null}function d(E){return typeof E._closed==="boolean"&&typeof E._defaultKeepAlive==="boolean"&&typeof E._removedConnection==="boolean"&&typeof E._removedContLen==="boolean"}function y(E){return typeof E._sent100==="boolean"&&d(E)}function w(E){var k;return typeof E._consuming==="boolean"&&typeof E._dumped==="boolean"&&((k=E.req)===null||k===void 0?void 0:k.upgradeOrConnect)===void 0}function p(E){if(!I(E))return null;let{_writableState:k,_readableState:A}=E,D=k||A;return!D&&y(E)||!!(D&&D.autoDestroy&&D.emitClose&&D.closed===!1)}function u(E){var k;return!!(E&&((k=E[b])!==null&&k!==void 0?k:E.readableDidRead||E.readableAborted))}function m(E){var k,A,D,U,K,he,J,H,se,V;return!!(E&&((k=(A=(D=(U=(K=(he=E[s])!==null&&he!==void 0?he:E.readableErrored)!==null&&K!==void 0?K:E.writableErrored)!==null&&U!==void 0?U:(J=E._readableState)===null||J===void 0?void 0:J.errorEmitted)!==null&&D!==void 0?D:(H=E._writableState)===null||H===void 0?void 0:H.errorEmitted)!==null&&A!==void 0?A:(se=E._readableState)===null||se===void 0?void 0:se.errored)!==null&&k!==void 0?k:(V=E._writableState)===null||V===void 0?void 0:V.errored))}t.exports={isDestroyed:N,kIsDestroyed:o,isDisturbed:u,kIsDisturbed:b,isErrored:m,kIsErrored:s,isReadable:F,kIsReadable:h,kIsClosedPromise:_,kControllerErrorFunction:g,kIsWritable:v,isClosed:l,isDuplexNodeStream:M,isFinished:a,isIterable:C,isReadableNodeStream:S,isReadableStream:$,isReadableEnded:le,isReadableFinished:ue,isReadableErrored:f,isNodeStream:I,isWebStream:R,isWritable:ee,isWritableNodeStream:x,isWritableStream:T,isWritableEnded:B,isWritableFinished:ie,isWritableErrored:c,isServerRequest:w,isServerResponse:y,willEmitClose:p,isTransformStream:P}}),Ci=Tt((e,t)=>{var r=go(),{AbortError:i,codes:n}=Hr(),{ERR_INVALID_ARG_TYPE:o,ERR_STREAM_PREMATURE_CLOSE:s}=n,{kEmptyObject:h,once:v}=Qr(),{validateAbortSignal:b,validateFunction:_,validateObject:g,validateBoolean:S}=Ma(),{Promise:x,PromisePrototypeThen:M,SymbolDispose:I}=Wt(),{isClosed:$,isReadable:T,isReadableNodeStream:P,isReadableStream:R,isReadableFinished:C,isReadableErrored:N,isWritable:B,isWritableNodeStream:ie,isWritableStream:le,isWritableFinished:ue,isWritableErrored:F,isNodeStream:ee,willEmitClose:a,kIsClosedPromise:c}=si(),f;function l(u){return u.setHeader&&typeof u.abort==="function"}var d=()=>{};function y(u,m,E){var k,A;if(arguments.length===2)E=m,m=h;else if(m==null)m=h;else g(m,"options");if(_(E,"callback"),b(m.signal,"options.signal"),E=v(E),R(u)||le(u))return w(u,m,E);if(!ee(u))throw new o("stream",["ReadableStream","WritableStream","Stream"],u);let D=(k=m.readable)!==null&&k!==void 0?k:P(u),U=(A=m.writable)!==null&&A!==void 0?A:ie(u),K=u._writableState,he=u._readableState,J=()=>{if(!u.writable)V()},H=a(u)&&P(u)===D&&ie(u)===U,se=ue(u,!1),V=()=>{if(se=!0,u.destroyed)H=!1;if(H&&(!u.readable||D))return;if(!D||Q)E.call(u)},Q=C(u,!1),He=()=>{if(Q=!0,u.destroyed)H=!1;if(H&&(!u.writable||U))return;if(!U||se)E.call(u)},z=(j)=>{E.call(u,j)},L=$(u),ae=()=>{L=!0;let j=F(u)||N(u);if(j&&typeof j!=="boolean")return E.call(u,j);if(D&&!Q&&P(u,!0)){if(!C(u,!1))return E.call(u,new s)}if(U&&!se){if(!ue(u,!1))return E.call(u,new s)}E.call(u)},G=()=>{L=!0;let j=F(u)||N(u);if(j&&typeof j!=="boolean")return E.call(u,j);E.call(u)},Y=()=>{u.req.on("finish",V)};if(l(u)){if(u.on("complete",V),!H)u.on("abort",ae);if(u.req)Y();else u.on("request",Y)}else if(U&&!K)u.on("end",J),u.on("close",J);if(!H&&typeof u.aborted==="boolean")u.on("aborted",ae);if(u.on("end",He),u.on("finish",V),m.error!==!1)u.on("error",z);if(u.on("close",ae),L)r.nextTick(ae);else if(K!==null&&K!==void 0&&K.errorEmitted||he!==null&&he!==void 0&&he.errorEmitted){if(!H)r.nextTick(G)}else if(!D&&(!H||T(u))&&(se||B(u)===!1))r.nextTick(G);else if(!U&&(!H||B(u))&&(Q||T(u)===!1))r.nextTick(G);else if(he&&u.req&&u.aborted)r.nextTick(G);let Me=()=>{if(E=d,u.removeListener("aborted",ae),u.removeListener("complete",V),u.removeListener("abort",ae),u.removeListener("request",Y),u.req)u.req.removeListener("finish",V);u.removeListener("end",J),u.removeListener("close",J),u.removeListener("finish",V),u.removeListener("end",He),u.removeListener("error",z),u.removeListener("close",ae)};if(m.signal&&!L){let j=()=>{let Z=E;Me(),Z.call(u,new i(void 0,{cause:m.signal.reason}))};if(m.signal.aborted)r.nextTick(j);else{f=f||Qr().addAbortListener;let Z=f(m.signal,j),je=E;E=v((...W)=>{Z[I](),je.apply(u,W)})}}return Me}function w(u,m,E){let k=!1,A=d;if(m.signal)if(A=()=>{k=!0,E.call(u,new i(void 0,{cause:m.signal.reason}))},m.signal.aborted)r.nextTick(A);else{f=f||Qr().addAbortListener;let U=f(m.signal,A),K=E;E=v((...he)=>{U[I](),K.apply(u,he)})}let D=(...U)=>{if(!k)r.nextTick(()=>E.apply(u,U))};return M(u[c].promise,D,D),d}function p(u,m){var E;let k=!1;if(m===null)m=h;if((E=m)!==null&&E!==void 0&&E.cleanup)S(m.cleanup,"cleanup"),k=m.cleanup;return new x((A,D)=>{let U=y(u,m,(K)=>{if(k)U();if(K)D(K);else A()})})}t.exports=y,t.exports.finished=p}),as=Tt((e,t)=>{var r=go(),{aggregateTwoErrors:i,codes:{ERR_MULTIPLE_CALLBACK:n},AbortError:o}=Hr(),{Symbol:s}=Wt(),{kIsDestroyed:h,isDestroyed:v,isFinished:b,isServerRequest:_}=si(),g=s("kDestroy"),S=s("kConstruct");function x(a,c,f){if(a){if(a.stack,c&&!c.errored)c.errored=a;if(f&&!f.errored)f.errored=a}}function M(a,c){let f=this._readableState,l=this._writableState,d=l||f;if(l!==null&&l!==void 0&&l.destroyed||f!==null&&f!==void 0&&f.destroyed){if(typeof c==="function")c();return this}if(x(a,l,f),l)l.destroyed=!0;if(f)f.destroyed=!0;if(!d.constructed)this.once(g,function(y){I(this,i(y,a),c)});else I(this,a,c);return this}function I(a,c,f){let l=!1;function d(y){if(l)return;l=!0;let{_readableState:w,_writableState:p}=a;if(x(y,p,w),p)p.closed=!0;if(w)w.closed=!0;if(typeof f==="function")f(y);if(y)r.nextTick($,a,y);else r.nextTick(T,a)}try{a._destroy(c||null,d)}catch(y){d(y)}}function $(a,c){P(a,c),T(a)}function T(a){let{_readableState:c,_writableState:f}=a;if(f)f.closeEmitted=!0;if(c)c.closeEmitted=!0;if(f!==null&&f!==void 0&&f.emitClose||c!==null&&c!==void 0&&c.emitClose)a.emit("close")}function P(a,c){let{_readableState:f,_writableState:l}=a;if(l!==null&&l!==void 0&&l.errorEmitted||f!==null&&f!==void 0&&f.errorEmitted)return;if(l)l.errorEmitted=!0;if(f)f.errorEmitted=!0;a.emit("error",c)}function R(){let a=this._readableState,c=this._writableState;if(a)a.constructed=!0,a.closed=!1,a.closeEmitted=!1,a.destroyed=!1,a.errored=null,a.errorEmitted=!1,a.reading=!1,a.ended=a.readable===!1,a.endEmitted=a.readable===!1;if(c)c.constructed=!0,c.destroyed=!1,c.closed=!1,c.closeEmitted=!1,c.errored=null,c.errorEmitted=!1,c.finalCalled=!1,c.prefinished=!1,c.ended=c.writable===!1,c.ending=c.writable===!1,c.finished=c.writable===!1}function C(a,c,f){let{_readableState:l,_writableState:d}=a;if(d!==null&&d!==void 0&&d.destroyed||l!==null&&l!==void 0&&l.destroyed)return this;if(l!==null&&l!==void 0&&l.autoDestroy||d!==null&&d!==void 0&&d.autoDestroy)a.destroy(c);else if(c){if(c.stack,d&&!d.errored)d.errored=c;if(l&&!l.errored)l.errored=c;if(f)r.nextTick(P,a,c);else P(a,c)}}function N(a,c){if(typeof a._construct!=="function")return;let{_readableState:f,_writableState:l}=a;if(f)f.constructed=!1;if(l)l.constructed=!1;if(a.once(S,c),a.listenerCount(S)>1)return;r.nextTick(B,a)}function B(a){let c=!1;function f(l){if(c){C(a,l!==null&&l!==void 0?l:new n);return}c=!0;let{_readableState:d,_writableState:y}=a,w=y||d;if(d)d.constructed=!0;if(y)y.constructed=!0;if(w.destroyed)a.emit(g,l);else if(l)C(a,l,!0);else r.nextTick(ie,a)}try{a._construct((l)=>{r.nextTick(f,l)})}catch(l){r.nextTick(f,l)}}function ie(a){a.emit(S)}function le(a){return(a===null||a===void 0?void 0:a.setHeader)&&typeof a.abort==="function"}function ue(a){a.emit("close")}function F(a,c){a.emit("error",c),r.nextTick(ue,a)}function ee(a,c){if(!a||v(a))return;if(!c&&!b(a))c=new o;if(_(a))a.socket=null,a.destroy(c);else if(le(a))a.abort();else if(le(a.req))a.req.abort();else if(typeof a.destroy==="function")a.destroy(c);else if(typeof a.close==="function")a.close();else if(c)r.nextTick(F,a,c);else r.nextTick(ue,a);if(!a.destroyed)a[h]=!0}t.exports={construct:N,destroyer:ee,destroy:M,undestroy:R,errorOrDestroy:C}}),Im=Tt((e,t)=>{var{ArrayIsArray:r,ObjectSetPrototypeOf:i}=Wt(),{EventEmitter:n}=(xa(),kt(Sa));function o(h){n.call(this,h)}i(o.prototype,n.prototype),i(o,n),o.prototype.pipe=function(h,v){let b=this;function _(T){if(h.writable&&h.write(T)===!1&&b.pause)b.pause()}b.on("data",_);function g(){if(b.readable&&b.resume)b.resume()}if(h.on("drain",g),!h._isStdio&&(!v||v.end!==!1))b.on("end",x),b.on("close",M);let S=!1;function x(){if(S)return;S=!0,h.end()}function M(){if(S)return;if(S=!0,typeof h.destroy==="function")h.destroy()}function I(T){if($(),n.listenerCount(this,"error")===0)this.emit("error",T)}s(b,"error",I),s(h,"error",I);function $(){b.removeListener("data",_),h.removeListener("drain",g),b.removeListener("end",x),b.removeListener("close",M),b.removeListener("error",I),h.removeListener("error",I),b.removeListener("end",$),b.removeListener("close",$),h.removeListener("close",$)}return b.on("end",$),b.on("close",$),h.on("close",$),h.emit("pipe",b),h};function s(h,v,b){if(typeof h.prependListener==="function")return h.prependListener(v,b);if(!h._events||!h._events[v])h.on(v,b);else if(r(h._events[v]))h._events[v].unshift(b);else h._events[v]=[b,h._events[v]]}t.exports={Stream:o,prependListener:s}}),Lc=Tt((e,t)=>{var{SymbolDispose:r}=Wt(),{AbortError:i,codes:n}=Hr(),{isNodeStream:o,isWebStream:s,kControllerErrorFunction:h}=si(),v=Ci(),{ERR_INVALID_ARG_TYPE:b}=n,_,g=(S,x)=>{if(typeof S!=="object"||!("aborted"in S))throw new b(x,"AbortSignal",S)};t.exports.addAbortSignal=function(S,x){if(g(S,"signal"),!o(x)&&!s(x))throw new b("stream",["ReadableStream","WritableStream","Stream"],x);return t.exports.addAbortSignalNoValidate(S,x)},t.exports.addAbortSignalNoValidate=function(S,x){if(typeof S!=="object"||!("aborted"in S))return x;let M=o(x)?()=>{x.destroy(new i(void 0,{cause:S.reason}))}:()=>{x[h](new i(void 0,{cause:S.reason}))};if(S.aborted)M();else{_=_||Qr().addAbortListener;let I=_(S,M);v(x,I[r])}return x}}),L$=Tt((e,t)=>{var{StringPrototypeSlice:r,SymbolIterator:i,TypedArrayPrototypeSet:n,Uint8Array:o}=Wt(),{Buffer:s}=(Tr(),kt($r)),{inspect:h}=Qr();t.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(v){let b={data:v,next:null};if(this.length>0)this.tail.next=b;else this.head=b;this.tail=b,++this.length}unshift(v){let b={data:v,next:this.head};if(this.length===0)this.tail=b;this.head=b,++this.length}shift(){if(this.length===0)return;let v=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,v}clear(){this.head=this.tail=null,this.length=0}join(v){if(this.length===0)return"";let b=this.head,_=""+b.data;while((b=b.next)!==null)_+=v+b.data;return _}concat(v){if(this.length===0)return s.alloc(0);let b=s.allocUnsafe(v>>>0),_=this.head,g=0;while(_)n(b,_.data,g),g+=_.data.length,_=_.next;return b}consume(v,b){let _=this.head.data;if(v<_.length){let g=_.slice(0,v);return this.head.data=_.slice(v),g}if(v===_.length)return this.shift();return b?this._getString(v):this._getBuffer(v)}first(){return this.head.data}*[i](){for(let v=this.head;v;v=v.next)yield v.data}_getString(v){let b="",_=this.head,g=0;do{let S=_.data;if(v>S.length)b+=S,v-=S.length;else{if(v===S.length)if(b+=S,++g,_.next)this.head=_.next;else this.head=this.tail=null;else b+=r(S,0,v),this.head=_,_.data=r(S,v);break}++g}while((_=_.next)!==null);return this.length-=g,b}_getBuffer(v){let b=s.allocUnsafe(v),_=v,g=this.head,S=0;do{let x=g.data;if(v>x.length)n(b,x,_-v),v-=x.length;else{if(v===x.length)if(n(b,x,_-v),++S,g.next)this.head=g.next;else this.head=this.tail=null;else n(b,new o(x.buffer,x.byteOffset,v),_-v),this.head=g,g.data=x.slice(v);break}++S}while((g=g.next)!==null);return this.length-=S,b}[Symbol.for("nodejs.util.inspect.custom")](v,b){return h(this,{...b,depth:0,customInspect:!1})}}}),Fc=Tt((e,t)=>{var{MathFloor:r,NumberIsInteger:i}=Wt(),{validateInteger:n}=Ma(),{ERR_INVALID_ARG_VALUE:o}=Hr().codes,s=16384,h=16;function v(S,x,M){return S.highWaterMark!=null?S.highWaterMark:x?S[M]:null}function b(S){return S?h:s}function _(S,x){if(n(x,"value",0),S)h=x;else s=x}function g(S,x,M,I){let $=v(x,I,M);if($!=null){if(!i($)||$<0){let T=I?`options.${M}`:"options.highWaterMark";throw new o(T,$)}return r($)}return b(S.objectMode)}t.exports={getHighWaterMark:g,getDefaultHighWaterMark:b,setDefaultHighWaterMark:_}}),F$=Tt((e,t)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var r=(Tr(),kt($r)),i=r.Buffer;function n(s,h){for(var v in s)h[v]=s[v]}if(i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow)t.exports=r;else n(r,e),e.Buffer=o;function o(s,h,v){return i(s,h,v)}o.prototype=Object.create(i.prototype),n(i,o),o.from=function(s,h,v){if(typeof s==="number")throw TypeError("Argument must not be a number");return i(s,h,v)},o.alloc=function(s,h,v){if(typeof s!=="number")throw TypeError("Argument must be a number");var b=i(s);if(h!==void 0)if(typeof v==="string")b.fill(h,v);else b.fill(h);else b.fill(0);return b},o.allocUnsafe=function(s){if(typeof s!=="number")throw TypeError("Argument must be a number");return i(s)},o.allocUnsafeSlow=function(s){if(typeof s!=="number")throw TypeError("Argument must be a number");return r.SlowBuffer(s)}}),q$=Tt((e)=>{var t=F$().Buffer,r=t.isEncoding||function(P){switch(P=""+P,P&&P.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(P){if(!P)return"utf8";var R;while(!0)switch(P){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return P;default:if(R)return;P=(""+P).toLowerCase(),R=!0}}function n(P){var R=i(P);if(typeof R!=="string"&&(t.isEncoding===r||!r(P)))throw Error("Unknown encoding: "+P);return R||P}e.StringDecoder=o;function o(P){this.encoding=n(P);var R;switch(this.encoding){case"utf16le":this.text=S,this.end=x,R=4;break;case"utf8":this.fillLast=b,R=4;break;case"base64":this.text=M,this.end=I,R=3;break;default:this.write=$,this.end=T;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(R)}o.prototype.write=function(P){if(P.length===0)return"";var R,C;if(this.lastNeed){if(R=this.fillLast(P),R===void 0)return"";C=this.lastNeed,this.lastNeed=0}else C=0;if(C<P.length)return R?R+this.text(P,C):this.text(P,C);return R||""},o.prototype.end=g,o.prototype.text=_,o.prototype.fillLast=function(P){if(this.lastNeed<=P.length)return P.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);P.copy(this.lastChar,this.lastTotal-this.lastNeed,0,P.length),this.lastNeed-=P.length};function s(P){if(P<=127)return 0;else if(P>>5===6)return 2;else if(P>>4===14)return 3;else if(P>>3===30)return 4;return P>>6===2?-1:-2}function h(P,R,C){var N=R.length-1;if(N<C)return 0;var B=s(R[N]);if(B>=0){if(B>0)P.lastNeed=B-1;return B}if(--N<C||B===-2)return 0;if(B=s(R[N]),B>=0){if(B>0)P.lastNeed=B-2;return B}if(--N<C||B===-2)return 0;if(B=s(R[N]),B>=0){if(B>0)if(B===2)B=0;else P.lastNeed=B-3;return B}return 0}function v(P,R,C){if((R[0]&192)!==128)return P.lastNeed=0,"�";if(P.lastNeed>1&&R.length>1){if((R[1]&192)!==128)return P.lastNeed=1,"�";if(P.lastNeed>2&&R.length>2){if((R[2]&192)!==128)return P.lastNeed=2,"�"}}}function b(P){var R=this.lastTotal-this.lastNeed,C=v(this,P,R);if(C!==void 0)return C;if(this.lastNeed<=P.length)return P.copy(this.lastChar,R,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);P.copy(this.lastChar,R,0,P.length),this.lastNeed-=P.length}function _(P,R){var C=h(this,P,R);if(!this.lastNeed)return P.toString("utf8",R);this.lastTotal=C;var N=P.length-(C-this.lastNeed);return P.copy(this.lastChar,0,N),P.toString("utf8",R,N)}function g(P){var R=P&&P.length?this.write(P):"";if(this.lastNeed)return R+"�";return R}function S(P,R){if((P.length-R)%2===0){var C=P.toString("utf16le",R);if(C){var N=C.charCodeAt(C.length-1);if(N>=55296&&N<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=P[P.length-2],this.lastChar[1]=P[P.length-1],C.slice(0,-1)}return C}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=P[P.length-1],P.toString("utf16le",R,P.length-1)}function x(P){var R=P&&P.length?this.write(P):"";if(this.lastNeed){var C=this.lastTotal-this.lastNeed;return R+this.lastChar.toString("utf16le",0,C)}return R}function M(P,R){var C=(P.length-R)%3;if(C===0)return P.toString("base64",R);if(this.lastNeed=3-C,this.lastTotal=3,C===1)this.lastChar[0]=P[P.length-1];else this.lastChar[0]=P[P.length-2],this.lastChar[1]=P[P.length-1];return P.toString("base64",R,P.length-C)}function I(P){var R=P&&P.length?this.write(P):"";if(this.lastNeed)return R+this.lastChar.toString("base64",0,3-this.lastNeed);return R}function $(P){return P.toString(this.encoding)}function T(P){return P&&P.length?this.write(P):""}}),cw=Tt((e,t)=>{var r=go(),{PromisePrototypeThen:i,SymbolAsyncIterator:n,SymbolIterator:o}=Wt(),{Buffer:s}=(Tr(),kt($r)),{ERR_INVALID_ARG_TYPE:h,ERR_STREAM_NULL_VALUES:v}=Hr().codes;function b(_,g,S){let x;if(typeof g==="string"||g instanceof s)return new _({objectMode:!0,...S,read(){this.push(g),this.push(null)}});let M;if(g&&g[n])M=!0,x=g[n]();else if(g&&g[o])M=!1,x=g[o]();else throw new h("iterable",["Iterable"],g);let I=new _({objectMode:!0,highWaterMark:1,...S}),$=!1;I._read=function(){if(!$)$=!0,P()},I._destroy=function(R,C){i(T(R),()=>r.nextTick(C,R),(N)=>r.nextTick(C,N||R))};async function T(R){let C=R!==void 0&&R!==null,N=typeof x.throw==="function";if(C&&N){let{value:B,done:ie}=await x.throw(R);if(await B,ie)return}if(typeof x.return==="function"){let{value:B}=await x.return();await B}}async function P(){for(;;){try{let{value:R,done:C}=M?await x.next():x.next();if(C)I.push(null);else{let N=R&&typeof R.then==="function"?await R:R;if(N===null)throw $=!1,new v;else if(I.push(N))continue;else $=!1}}catch(R){I.destroy(R)}break}}return I}t.exports=b}),qc=Tt((e,t)=>{var r=go(),{ArrayPrototypeIndexOf:i,NumberIsInteger:n,NumberIsNaN:o,NumberParseInt:s,ObjectDefineProperties:h,ObjectKeys:v,ObjectSetPrototypeOf:b,Promise:_,SafeSet:g,SymbolAsyncDispose:S,SymbolAsyncIterator:x,Symbol:M}=Wt();t.exports=W,W.ReadableState=je;var{EventEmitter:I}=(xa(),kt(Sa)),{Stream:$,prependListener:T}=Im(),{Buffer:P}=(Tr(),kt($r)),{addAbortSignal:R}=Lc(),C=Ci(),N=Qr().debuglog("stream",(O)=>{N=O}),B=L$(),ie=as(),{getHighWaterMark:le,getDefaultHighWaterMark:ue}=Fc(),{aggregateTwoErrors:F,codes:{ERR_INVALID_ARG_TYPE:ee,ERR_METHOD_NOT_IMPLEMENTED:a,ERR_OUT_OF_RANGE:c,ERR_STREAM_PUSH_AFTER_EOF:f,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:l},AbortError:d}=Hr(),{validateObject:y}=Ma(),w=M("kPaused"),{StringDecoder:p}=q$(),u=cw();b(W.prototype,$.prototype),b(W,$);var m=()=>{},{errorOrDestroy:E}=ie,k=1,A=2,D=4,U=8,K=16,he=32,J=64,H=128,se=256,V=512,Q=1024,He=2048,z=4096,L=8192,ae=16384,G=32768,Y=65536,Me=131072,j=262144;function Z(O){return{enumerable:!1,get(){return(this.state&O)!==0},set(q){if(q)this.state|=O;else this.state&=~O}}}h(je.prototype,{objectMode:Z(k),ended:Z(A),endEmitted:Z(D),reading:Z(U),constructed:Z(K),sync:Z(he),needReadable:Z(J),emittedReadable:Z(H),readableListening:Z(se),resumeScheduled:Z(V),errorEmitted:Z(Q),emitClose:Z(He),autoDestroy:Z(z),destroyed:Z(L),closed:Z(ae),closeEmitted:Z(G),multiAwaitDrain:Z(Y),readingMore:Z(Me),dataEmitted:Z(j)});function je(O,q,X){if(typeof X!=="boolean")X=q instanceof oi();if(this.state=He|z|K|he,O&&O.objectMode)this.state|=k;if(X&&O&&O.readableObjectMode)this.state|=k;if(this.highWaterMark=O?le(this,O,"readableHighWaterMark",X):ue(!1),this.buffer=new B,this.length=0,this.pipes=[],this.flowing=null,this[w]=null,O&&O.emitClose===!1)this.state&=~He;if(O&&O.autoDestroy===!1)this.state&=~z;if(this.errored=null,this.defaultEncoding=O&&O.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,O&&O.encoding)this.decoder=new p(O.encoding),this.encoding=O.encoding}function W(O){if(!(this instanceof W))return new W(O);let q=this instanceof oi();if(this._readableState=new je(O,this,q),O){if(typeof O.read==="function")this._read=O.read;if(typeof O.destroy==="function")this._destroy=O.destroy;if(typeof O.construct==="function")this._construct=O.construct;if(O.signal&&!q)R(O.signal,this)}$.call(this,O),ie.construct(this,()=>{if(this._readableState.needReadable)xe(this,this._readableState)})}W.prototype.destroy=ie.destroy,W.prototype._undestroy=ie.undestroy,W.prototype._destroy=function(O,q){q(O)},W.prototype[I.captureRejectionSymbol]=function(O){this.destroy(O)},W.prototype[S]=function(){let O;if(!this.destroyed)O=this.readableEnded?null:new d,this.destroy(O);return new _((q,X)=>C(this,(te)=>te&&te!==O?X(te):q(null)))},W.prototype.push=function(O,q){return re(this,O,q,!1)},W.prototype.unshift=function(O,q){return re(this,O,q,!0)};function re(O,q,X,te){N("readableAddChunk",q);let Ge=O._readableState,me;if((Ge.state&k)===0){if(typeof q==="string"){if(X=X||Ge.defaultEncoding,Ge.encoding!==X)if(te&&Ge.encoding)q=P.from(q,X).toString(Ge.encoding);else q=P.from(q,X),X=""}else if(q instanceof P)X="";else if($._isUint8Array(q))q=$._uint8ArrayToBuffer(q),X="";else if(q!=null)me=new ee("chunk",["string","Buffer","Uint8Array"],q)}if(me)E(O,me);else if(q===null)Ge.state&=~U,pe(O,Ge);else if((Ge.state&k)!==0||q&&q.length>0)if(te)if((Ge.state&D)!==0)E(O,new l);else if(Ge.destroyed||Ge.errored)return!1;else at(O,Ge,q,!0);else if(Ge.ended)E(O,new f);else if(Ge.destroyed||Ge.errored)return!1;else if(Ge.state&=~U,Ge.decoder&&!X)if(q=Ge.decoder.write(q),Ge.objectMode||q.length!==0)at(O,Ge,q,!1);else xe(O,Ge);else at(O,Ge,q,!1);else if(!te)Ge.state&=~U,xe(O,Ge);return!Ge.ended&&(Ge.length<Ge.highWaterMark||Ge.length===0)}function at(O,q,X,te){if(q.flowing&&q.length===0&&!q.sync&&O.listenerCount("data")>0){if((q.state&Y)!==0)q.awaitDrainWriters.clear();else q.awaitDrainWriters=null;q.dataEmitted=!0,O.emit("data",X)}else{if(q.length+=q.objectMode?1:X.length,te)q.buffer.unshift(X);else q.buffer.push(X);if((q.state&J)!==0)ve(O)}xe(O,q)}W.prototype.isPaused=function(){let O=this._readableState;return O[w]===!0||O.flowing===!1},W.prototype.setEncoding=function(O){let q=new p(O);this._readableState.decoder=q,this._readableState.encoding=this._readableState.decoder.encoding;let X=this._readableState.buffer,te="";for(let Ge of X)te+=q.write(Ge);if(X.clear(),te!=="")X.push(te);return this._readableState.length=te.length,this};var ge=1073741824;function ye(O){if(O>ge)throw new c("size","<= 1GiB",O);else O--,O|=O>>>1,O|=O>>>2,O|=O>>>4,O|=O>>>8,O|=O>>>16,O++;return O}function Gt(O,q){if(O<=0||q.length===0&&q.ended)return 0;if((q.state&k)!==0)return 1;if(o(O)){if(q.flowing&&q.length)return q.buffer.first().length;return q.length}if(O<=q.length)return O;return q.ended?q.length:0}W.prototype.read=function(O){if(N("read",O),O===void 0)O=NaN;else if(!n(O))O=s(O,10);let q=this._readableState,X=O;if(O>q.highWaterMark)q.highWaterMark=ye(O);if(O!==0)q.state&=~H;if(O===0&&q.needReadable&&((q.highWaterMark!==0?q.length>=q.highWaterMark:q.length>0)||q.ended)){if(N("read: emitReadable",q.length,q.ended),q.length===0&&q.ended)kr(this);else ve(this);return null}if(O=Gt(O,q),O===0&&q.ended){if(q.length===0)kr(this);return null}let te=(q.state&J)!==0;if(N("need readable",te),q.length===0||q.length-O<q.highWaterMark)te=!0,N("length less than watermark",te);if(q.ended||q.reading||q.destroyed||q.errored||!q.constructed)te=!1,N("reading, ended or constructing",te);else if(te){if(N("do read"),q.state|=U|he,q.length===0)q.state|=J;try{this._read(q.highWaterMark)}catch(me){E(this,me)}if(q.state&=~he,!q.reading)O=Gt(X,q)}let Ge;if(O>0)Ge=$e(O,q);else Ge=null;if(Ge===null)q.needReadable=q.length<=q.highWaterMark,O=0;else if(q.length-=O,q.multiAwaitDrain)q.awaitDrainWriters.clear();else q.awaitDrainWriters=null;if(q.length===0){if(!q.ended)q.needReadable=!0;if(X!==O&&q.ended)kr(this)}if(Ge!==null&&!q.errorEmitted&&!q.closeEmitted)q.dataEmitted=!0,this.emit("data",Ge);return Ge};function pe(O,q){if(N("onEofChunk"),q.ended)return;if(q.decoder){let X=q.decoder.end();if(X&&X.length)q.buffer.push(X),q.length+=q.objectMode?1:X.length}if(q.ended=!0,q.sync)ve(O);else q.needReadable=!1,q.emittedReadable=!0,tr(O)}function ve(O){let q=O._readableState;if(N("emitReadable",q.needReadable,q.emittedReadable),q.needReadable=!1,!q.emittedReadable)N("emitReadable",q.flowing),q.emittedReadable=!0,r.nextTick(tr,O)}function tr(O){let q=O._readableState;if(N("emitReadable_",q.destroyed,q.length,q.ended),!q.destroyed&&!q.errored&&(q.length||q.ended))O.emit("readable"),q.emittedReadable=!1;q.needReadable=!q.flowing&&!q.ended&&q.length<=q.highWaterMark,Ie(O)}function xe(O,q){if(!q.readingMore&&q.constructed)q.readingMore=!0,r.nextTick(Se,O,q)}function Se(O,q){while(!q.reading&&!q.ended&&(q.length<q.highWaterMark||q.flowing&&q.length===0)){let X=q.length;if(N("maybeReadMore read 0"),O.read(0),X===q.length)break}q.readingMore=!1}W.prototype._read=function(O){throw new a("_read()")},W.prototype.pipe=function(O,q){let X=this,te=this._readableState;if(te.pipes.length===1){if(!te.multiAwaitDrain)te.multiAwaitDrain=!0,te.awaitDrainWriters=new g(te.awaitDrainWriters?[te.awaitDrainWriters]:[])}te.pipes.push(O),N("pipe count=%d opts=%j",te.pipes.length,q);let Ge=(!q||q.end!==!1)&&O!==r.stdout&&O!==r.stderr?we:ft;if(te.endEmitted)r.nextTick(Ge);else X.once("end",Ge);O.on("unpipe",me);function me(zt,At){if(N("onunpipe"),zt===X){if(At&&At.hasUnpiped===!1)At.hasUnpiped=!0,ze()}}function we(){N("onend"),O.end()}let Jt,Pe=!1;function ze(){if(N("cleanup"),O.removeListener("close",Xt),O.removeListener("finish",mt),Jt)O.removeListener("drain",Jt);if(O.removeListener("error",ke),O.removeListener("unpipe",me),X.removeListener("end",we),X.removeListener("end",ft),X.removeListener("data",Ae),Pe=!0,Jt&&te.awaitDrainWriters&&(!O._writableState||O._writableState.needDrain))Jt()}function Ar(){if(!Pe){if(te.pipes.length===1&&te.pipes[0]===O)N("false write response, pause",0),te.awaitDrainWriters=O,te.multiAwaitDrain=!1;else if(te.pipes.length>1&&te.pipes.includes(O))N("false write response, pause",te.awaitDrainWriters.size),te.awaitDrainWriters.add(O);X.pause()}if(!Jt)Jt=zr(X,O),O.on("drain",Jt)}X.on("data",Ae);function Ae(zt){N("ondata");let At=O.write(zt);if(N("dest.write",At),At===!1)Ar()}function ke(zt){if(N("onerror",zt),ft(),O.removeListener("error",ke),O.listenerCount("error")===0){let At=O._writableState||O._readableState;if(At&&!At.errorEmitted)E(O,zt);else O.emit("error",zt)}}T(O,"error",ke);function Xt(){O.removeListener("finish",mt),ft()}O.once("close",Xt);function mt(){N("onfinish"),O.removeListener("close",Xt),ft()}O.once("finish",mt);function ft(){N("unpipe"),X.unpipe(O)}if(O.emit("pipe",X),O.writableNeedDrain===!0)Ar();else if(!te.flowing)N("pipe resume"),X.resume();return O};function zr(O,q){return function(){let X=O._readableState;if(X.awaitDrainWriters===q)N("pipeOnDrain",1),X.awaitDrainWriters=null;else if(X.multiAwaitDrain)N("pipeOnDrain",X.awaitDrainWriters.size),X.awaitDrainWriters.delete(q);if((!X.awaitDrainWriters||X.awaitDrainWriters.size===0)&&O.listenerCount("data"))O.resume()}}W.prototype.unpipe=function(O){let q=this._readableState,X={hasUnpiped:!1};if(q.pipes.length===0)return this;if(!O){let Ge=q.pipes;q.pipes=[],this.pause();for(let me=0;me<Ge.length;me++)Ge[me].emit("unpipe",this,{hasUnpiped:!1});return this}let te=i(q.pipes,O);if(te===-1)return this;if(q.pipes.splice(te,1),q.pipes.length===0)this.pause();return O.emit("unpipe",this,X),this},W.prototype.on=function(O,q){let X=$.prototype.on.call(this,O,q),te=this._readableState;if(O==="data"){if(te.readableListening=this.listenerCount("readable")>0,te.flowing!==!1)this.resume()}else if(O==="readable"){if(!te.endEmitted&&!te.readableListening){if(te.readableListening=te.needReadable=!0,te.flowing=!1,te.emittedReadable=!1,N("on readable",te.length,te.reading),te.length)ve(this);else if(!te.reading)r.nextTick(Re,this)}}return X},W.prototype.addListener=W.prototype.on,W.prototype.removeListener=function(O,q){let X=$.prototype.removeListener.call(this,O,q);if(O==="readable")r.nextTick(Ee,this);return X},W.prototype.off=W.prototype.removeListener,W.prototype.removeAllListeners=function(O){let q=$.prototype.removeAllListeners.apply(this,arguments);if(O==="readable"||O===void 0)r.nextTick(Ee,this);return q};function Ee(O){let q=O._readableState;if(q.readableListening=O.listenerCount("readable")>0,q.resumeScheduled&&q[w]===!1)q.flowing=!0;else if(O.listenerCount("data")>0)O.resume();else if(!q.readableListening)q.flowing=null}function Re(O){N("readable nexttick read 0"),O.read(0)}W.prototype.resume=function(){let O=this._readableState;if(!O.flowing)N("resume"),O.flowing=!O.readableListening,jr(this,O);return O[w]=!1,this};function jr(O,q){if(!q.resumeScheduled)q.resumeScheduled=!0,r.nextTick(Ce,O,q)}function Ce(O,q){if(N("resume",q.reading),!q.reading)O.read(0);if(q.resumeScheduled=!1,O.emit("resume"),Ie(O),q.flowing&&!q.reading)O.read(0)}W.prototype.pause=function(){if(N("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1)N("pause"),this._readableState.flowing=!1,this.emit("pause");return this._readableState[w]=!0,this};function Ie(O){let q=O._readableState;N("flow",q.flowing);while(q.flowing&&O.read()!==null);}W.prototype.wrap=function(O){let q=!1;O.on("data",(te)=>{if(!this.push(te)&&O.pause)q=!0,O.pause()}),O.on("end",()=>{this.push(null)}),O.on("error",(te)=>{E(this,te)}),O.on("close",()=>{this.destroy()}),O.on("destroy",()=>{this.destroy()}),this._read=()=>{if(q&&O.resume)q=!1,O.resume()};let X=v(O);for(let te=1;te<X.length;te++){let Ge=X[te];if(this[Ge]===void 0&&typeof O[Ge]==="function")this[Ge]=O[Ge].bind(O)}return this},W.prototype[x]=function(){return Pr(this)},W.prototype.iterator=function(O){if(O!==void 0)y(O,"options");return Pr(this,O)};function Pr(O,q){if(typeof O.read!=="function")O=W.wrap(O,{objectMode:!0});let X=Oe(O,q);return X.stream=O,X}async function*Oe(O,q){let X=m;function te(we){if(this===O)X(),X=m;else X=we}O.on("readable",te);let Ge,me=C(O,{writable:!1},(we)=>{Ge=we?F(Ge,we):null,X(),X=m});try{while(!0){let we=O.destroyed?null:O.read();if(we!==null)yield we;else if(Ge)throw Ge;else if(Ge===null)return;else await new _(te)}}catch(we){throw Ge=F(Ge,we),Ge}finally{if((Ge||(q===null||q===void 0?void 0:q.destroyOnReturn)!==!1)&&(Ge===void 0||O._readableState.autoDestroy))ie.destroyer(O,null);else O.off("readable",te),me()}}h(W.prototype,{readable:{__proto__:null,get(){let O=this._readableState;return!!O&&O.readable!==!1&&!O.destroyed&&!O.errorEmitted&&!O.endEmitted},set(O){if(this._readableState)this._readableState.readable=!!O}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(O){if(this._readableState)this._readableState.flowing=O}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(O){if(!this._readableState)return;this._readableState.destroyed=O}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),h(je.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[w]!==!1},set(O){this[w]=!!O}}}),W._fromList=$e;function $e(O,q){if(q.length===0)return null;let X;if(q.objectMode)X=q.buffer.shift();else if(!O||O>=q.length){if(q.decoder)X=q.buffer.join("");else if(q.buffer.length===1)X=q.buffer.first();else X=q.buffer.concat(q.length);q.buffer.clear()}else X=q.buffer.consume(O,q.decoder);return X}function kr(O){let q=O._readableState;if(N("endReadable",q.endEmitted),!q.endEmitted)q.ended=!0,r.nextTick(De,q,O)}function De(O,q){if(N("endReadableNT",O.endEmitted,O.length),!O.errored&&!O.closeEmitted&&!O.endEmitted&&O.length===0){if(O.endEmitted=!0,q.emit("end"),q.writable&&q.allowHalfOpen===!1)r.nextTick(Ne,q);else if(O.autoDestroy){let X=q._writableState;if(!X||X.autoDestroy&&(X.finished||X.writable===!1))q.destroy()}}}function Ne(O){if(O.writable&&!O.writableEnded&&!O.destroyed)O.end()}W.from=function(O,q){return u(W,O,q)};var Mr;function Te(){if(Mr===void 0)Mr={};return Mr}W.fromWeb=function(O,q){return Te().newStreamReadableFromReadableStream(O,q)},W.toWeb=function(O,q){return Te().newReadableStreamFromStreamReadable(O,q)},W.wrap=function(O,q){var X,te;return new W({objectMode:(X=(te=O.readableObjectMode)!==null&&te!==void 0?te:O.objectMode)!==null&&X!==void 0?X:!0,...q,destroy(Ge,me){ie.destroyer(O,Ge),me(Ge)}}).wrap(O)}}),$m=Tt((e,t)=>{var r=go(),{ArrayPrototypeSlice:i,Error:n,FunctionPrototypeSymbolHasInstance:o,ObjectDefineProperty:s,ObjectDefineProperties:h,ObjectSetPrototypeOf:v,StringPrototypeToLowerCase:b,Symbol:_,SymbolHasInstance:g}=Wt();t.exports=y,y.WritableState=l;var{EventEmitter:S}=(xa(),kt(Sa)),x=Im().Stream,{Buffer:M}=(Tr(),kt($r)),I=as(),{addAbortSignal:$}=Lc(),{getHighWaterMark:T,getDefaultHighWaterMark:P}=Fc(),{ERR_INVALID_ARG_TYPE:R,ERR_METHOD_NOT_IMPLEMENTED:C,ERR_MULTIPLE_CALLBACK:N,ERR_STREAM_CANNOT_PIPE:B,ERR_STREAM_DESTROYED:ie,ERR_STREAM_ALREADY_FINISHED:le,ERR_STREAM_NULL_VALUES:ue,ERR_STREAM_WRITE_AFTER_END:F,ERR_UNKNOWN_ENCODING:ee}=Hr().codes,{errorOrDestroy:a}=I;v(y.prototype,x.prototype),v(y,x);function c(){}var f=_("kOnFinished");function l(z,L,ae){if(typeof ae!=="boolean")ae=L instanceof oi();if(this.objectMode=!!(z&&z.objectMode),ae)this.objectMode=this.objectMode||!!(z&&z.writableObjectMode);this.highWaterMark=z?T(this,z,"writableHighWaterMark",ae):P(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let G=!!(z&&z.decodeStrings===!1);this.decodeStrings=!G,this.defaultEncoding=z&&z.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=E.bind(void 0,L),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,d(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!z||z.emitClose!==!1,this.autoDestroy=!z||z.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[f]=[]}function d(z){z.buffered=[],z.bufferedIndex=0,z.allBuffers=!0,z.allNoop=!0}l.prototype.getBuffer=function(){return i(this.buffered,this.bufferedIndex)},s(l.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function y(z){let L=this instanceof oi();if(!L&&!o(y,this))return new y(z);if(this._writableState=new l(z,this,L),z){if(typeof z.write==="function")this._write=z.write;if(typeof z.writev==="function")this._writev=z.writev;if(typeof z.destroy==="function")this._destroy=z.destroy;if(typeof z.final==="function")this._final=z.final;if(typeof z.construct==="function")this._construct=z.construct;if(z.signal)$(z.signal,this)}x.call(this,z),I.construct(this,()=>{let ae=this._writableState;if(!ae.writing)U(this,ae);H(this,ae)})}s(y,g,{__proto__:null,value:function(z){if(o(this,z))return!0;if(this!==y)return!1;return z&&z._writableState instanceof l}}),y.prototype.pipe=function(){a(this,new B)};function w(z,L,ae,G){let Y=z._writableState;if(typeof ae==="function")G=ae,ae=Y.defaultEncoding;else{if(!ae)ae=Y.defaultEncoding;else if(ae!=="buffer"&&!M.isEncoding(ae))throw new ee(ae);if(typeof G!=="function")G=c}if(L===null)throw new ue;else if(!Y.objectMode)if(typeof L==="string"){if(Y.decodeStrings!==!1)L=M.from(L,ae),ae="buffer"}else if(L instanceof M)ae="buffer";else if(x._isUint8Array(L))L=x._uint8ArrayToBuffer(L),ae="buffer";else throw new R("chunk",["string","Buffer","Uint8Array"],L);let Me;if(Y.ending)Me=new F;else if(Y.destroyed)Me=new ie("write");if(Me)return r.nextTick(G,Me),a(z,Me,!0),Me;return Y.pendingcb++,p(z,Y,L,ae,G)}y.prototype.write=function(z,L,ae){return w(this,z,L,ae)===!0},y.prototype.cork=function(){this._writableState.corked++},y.prototype.uncork=function(){let z=this._writableState;if(z.corked){if(z.corked--,!z.writing)U(this,z)}},y.prototype.setDefaultEncoding=function(z){if(typeof z==="string")z=b(z);if(!M.isEncoding(z))throw new ee(z);return this._writableState.defaultEncoding=z,this};function p(z,L,ae,G,Y){let Me=L.objectMode?1:ae.length;L.length+=Me;let j=L.length<L.highWaterMark;if(!j)L.needDrain=!0;if(L.writing||L.corked||L.errored||!L.constructed){if(L.buffered.push({chunk:ae,encoding:G,callback:Y}),L.allBuffers&&G!=="buffer")L.allBuffers=!1;if(L.allNoop&&Y!==c)L.allNoop=!1}else L.writelen=Me,L.writecb=Y,L.writing=!0,L.sync=!0,z._write(ae,G,L.onwrite),L.sync=!1;return j&&!L.errored&&!L.destroyed}function u(z,L,ae,G,Y,Me,j){if(L.writelen=G,L.writecb=j,L.writing=!0,L.sync=!0,L.destroyed)L.onwrite(new ie("write"));else if(ae)z._writev(Y,L.onwrite);else z._write(Y,Me,L.onwrite);L.sync=!1}function m(z,L,ae,G){--L.pendingcb,G(ae),D(L),a(z,ae)}function E(z,L){let ae=z._writableState,G=ae.sync,Y=ae.writecb;if(typeof Y!=="function"){a(z,new N);return}if(ae.writing=!1,ae.writecb=null,ae.length-=ae.writelen,ae.writelen=0,L){if(L.stack,!ae.errored)ae.errored=L;if(z._readableState&&!z._readableState.errored)z._readableState.errored=L;if(G)r.nextTick(m,z,ae,L,Y);else m(z,ae,L,Y)}else{if(ae.buffered.length>ae.bufferedIndex)U(z,ae);if(G)if(ae.afterWriteTickInfo!==null&&ae.afterWriteTickInfo.cb===Y)ae.afterWriteTickInfo.count++;else ae.afterWriteTickInfo={count:1,cb:Y,stream:z,state:ae},r.nextTick(k,ae.afterWriteTickInfo);else A(z,ae,1,Y)}}function k({stream:z,state:L,count:ae,cb:G}){return L.afterWriteTickInfo=null,A(z,L,ae,G)}function A(z,L,ae,G){if(!L.ending&&!z.destroyed&&L.length===0&&L.needDrain)L.needDrain=!1,z.emit("drain");while(ae-- >0)L.pendingcb--,G();if(L.destroyed)D(L);H(z,L)}function D(z){if(z.writing)return;for(let Y=z.bufferedIndex;Y<z.buffered.length;++Y){var L;let{chunk:Me,callback:j}=z.buffered[Y],Z=z.objectMode?1:Me.length;z.length-=Z,j((L=z.errored)!==null&&L!==void 0?L:new ie("write"))}let ae=z[f].splice(0);for(let Y=0;Y<ae.length;Y++){var G;ae[Y]((G=z.errored)!==null&&G!==void 0?G:new ie("end"))}d(z)}function U(z,L){if(L.corked||L.bufferProcessing||L.destroyed||!L.constructed)return;let{buffered:ae,bufferedIndex:G,objectMode:Y}=L,Me=ae.length-G;if(!Me)return;let j=G;if(L.bufferProcessing=!0,Me>1&&z._writev){L.pendingcb-=Me-1;let Z=L.allNoop?c:(W)=>{for(let re=j;re<ae.length;++re)ae[re].callback(W)},je=L.allNoop&&j===0?ae:i(ae,j);je.allBuffers=L.allBuffers,u(z,L,!0,L.length,je,"",Z),d(L)}else{do{let{chunk:Z,encoding:je,callback:W}=ae[j];ae[j++]=null;let re=Y?1:Z.length;u(z,L,!1,re,Z,je,W)}while(j<ae.length&&!L.writing);if(j===ae.length)d(L);else if(j>256)ae.splice(0,j),L.bufferedIndex=0;else L.bufferedIndex=j}L.bufferProcessing=!1}y.prototype._write=function(z,L,ae){if(this._writev)this._writev([{chunk:z,encoding:L}],ae);else throw new C("_write()")},y.prototype._writev=null,y.prototype.end=function(z,L,ae){let G=this._writableState;if(typeof z==="function")ae=z,z=null,L=null;else if(typeof L==="function")ae=L,L=null;let Y;if(z!==null&&z!==void 0){let Me=w(this,z,L);if(Me instanceof n)Y=Me}if(G.corked)G.corked=1,this.uncork();if(Y);else if(!G.errored&&!G.ending)G.ending=!0,H(this,G,!0),G.ended=!0;else if(G.finished)Y=new le("end");else if(G.destroyed)Y=new ie("end");if(typeof ae==="function")if(Y||G.finished)r.nextTick(ae,Y);else G[f].push(ae);return this};function K(z){return z.ending&&!z.destroyed&&z.constructed&&z.length===0&&!z.errored&&z.buffered.length===0&&!z.finished&&!z.writing&&!z.errorEmitted&&!z.closeEmitted}function he(z,L){let ae=!1;function G(Y){if(ae){a(z,Y!==null&&Y!==void 0?Y:N());return}if(ae=!0,L.pendingcb--,Y){let Me=L[f].splice(0);for(let j=0;j<Me.length;j++)Me[j](Y);a(z,Y,L.sync)}else if(K(L))L.prefinished=!0,z.emit("prefinish"),L.pendingcb++,r.nextTick(se,z,L)}L.sync=!0,L.pendingcb++;try{z._final(G)}catch(Y){G(Y)}L.sync=!1}function J(z,L){if(!L.prefinished&&!L.finalCalled)if(typeof z._final==="function"&&!L.destroyed)L.finalCalled=!0,he(z,L);else L.prefinished=!0,z.emit("prefinish")}function H(z,L,ae){if(K(L)){if(J(z,L),L.pendingcb===0){if(ae)L.pendingcb++,r.nextTick((G,Y)=>{if(K(Y))se(G,Y);else Y.pendingcb--},z,L);else if(K(L))L.pendingcb++,se(z,L)}}}function se(z,L){L.pendingcb--,L.finished=!0;let ae=L[f].splice(0);for(let G=0;G<ae.length;G++)ae[G]();if(z.emit("finish"),L.autoDestroy){let G=z._readableState;if(!G||G.autoDestroy&&(G.endEmitted||G.readable===!1))z.destroy()}}h(y.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(z){if(this._writableState)this._writableState.destroyed=z}},writable:{__proto__:null,get(){let z=this._writableState;return!!z&&z.writable!==!1&&!z.destroyed&&!z.errored&&!z.ending&&!z.ended},set(z){if(this._writableState)this._writableState.writable=!!z}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let z=this._writableState;if(!z)return!1;return!z.destroyed&&!z.ending&&z.needDrain}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var V=I.destroy;y.prototype.destroy=function(z,L){let ae=this._writableState;if(!ae.destroyed&&(ae.bufferedIndex<ae.buffered.length||ae[f].length))r.nextTick(D,ae);return V.call(this,z,L),this},y.prototype._undestroy=I.undestroy,y.prototype._destroy=function(z,L){L(z)},y.prototype[S.captureRejectionSymbol]=function(z){this.destroy(z)};var Q;function He(){if(Q===void 0)Q={};return Q}y.fromWeb=function(z,L){return He().newStreamWritableFromWritableStream(z,L)},y.toWeb=function(z){return He().newWritableStreamFromStreamWritable(z)}}),B$=Tt((e,t)=>{var r=go(),i=(Tr(),kt($r)),{isReadable:n,isWritable:o,isIterable:s,isNodeStream:h,isReadableNodeStream:v,isWritableNodeStream:b,isDuplexNodeStream:_,isReadableStream:g,isWritableStream:S}=si(),x=Ci(),{AbortError:M,codes:{ERR_INVALID_ARG_TYPE:I,ERR_INVALID_RETURN_VALUE:$}}=Hr(),{destroyer:T}=as(),P=oi(),R=qc(),C=$m(),{createDeferredPromise:N}=Qr(),B=cw(),ie=globalThis.Blob||i.Blob,le=typeof ie<"u"?function(f){return f instanceof ie}:function(f){return!1},ue=globalThis.AbortController||ka().AbortController,{FunctionPrototypeCall:F}=Wt();class ee extends P{constructor(f){super(f);if((f===null||f===void 0?void 0:f.readable)===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if((f===null||f===void 0?void 0:f.writable)===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}}t.exports=function f(l,d){if(_(l))return l;if(v(l))return c({readable:l});if(b(l))return c({writable:l});if(h(l))return c({writable:!1,readable:!1});if(g(l))return c({readable:R.fromWeb(l)});if(S(l))return c({writable:C.fromWeb(l)});if(typeof l==="function"){let{value:w,write:p,final:u,destroy:m}=a(l);if(s(w))return B(ee,w,{objectMode:!0,write:p,final:u,destroy:m});let E=w===null||w===void 0?void 0:w.then;if(typeof E==="function"){let k,A=F(E,w,(D)=>{if(D!=null)throw new $("nully","body",D)},(D)=>{T(k,D)});return k=new ee({objectMode:!0,readable:!1,write:p,final(D){u(async()=>{try{await A,r.nextTick(D,null)}catch(U){r.nextTick(D,U)}})},destroy:m})}throw new $("Iterable, AsyncIterable or AsyncFunction",d,w)}if(le(l))return f(l.arrayBuffer());if(s(l))return B(ee,l,{objectMode:!0,writable:!1});if(g(l===null||l===void 0?void 0:l.readable)&&S(l===null||l===void 0?void 0:l.writable))return ee.fromWeb(l);if(typeof(l===null||l===void 0?void 0:l.writable)==="object"||typeof(l===null||l===void 0?void 0:l.readable)==="object"){let w=l!==null&&l!==void 0&&l.readable?v(l===null||l===void 0?void 0:l.readable)?l===null||l===void 0?void 0:l.readable:f(l.readable):void 0,p=l!==null&&l!==void 0&&l.writable?b(l===null||l===void 0?void 0:l.writable)?l===null||l===void 0?void 0:l.writable:f(l.writable):void 0;return c({readable:w,writable:p})}let y=l===null||l===void 0?void 0:l.then;if(typeof y==="function"){let w;return F(y,l,(p)=>{if(p!=null)w.push(p);w.push(null)},(p)=>{T(w,p)}),w=new ee({objectMode:!0,writable:!1,read(){}})}throw new I(d,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],l)};function a(f){let{promise:l,resolve:d}=N(),y=new ue,w=y.signal;return{value:f(async function*(){while(!0){let p=l;l=null;let{chunk:u,done:m,cb:E}=await p;if(r.nextTick(E),m)return;if(w.aborted)throw new M(void 0,{cause:w.reason});({promise:l,resolve:d}=N()),yield u}}(),{signal:w}),write(p,u,m){let E=d;d=null,E({chunk:p,done:!1,cb:m})},final(p){let u=d;d=null,u({done:!0,cb:p})},destroy(p,u){y.abort(),u(p)}}}function c(f){let l=f.readable&&typeof f.readable.read!=="function"?R.wrap(f.readable):f.readable,d=f.writable,y=!!n(l),w=!!o(d),p,u,m,E,k;function A(D){let U=E;if(E=null,U)U(D);else if(D)k.destroy(D)}if(k=new ee({readableObjectMode:!!(l!==null&&l!==void 0&&l.readableObjectMode),writableObjectMode:!!(d!==null&&d!==void 0&&d.writableObjectMode),readable:y,writable:w}),w)x(d,(D)=>{if(w=!1,D)T(l,D);A(D)}),k._write=function(D,U,K){if(d.write(D,U))K();else p=K},k._final=function(D){d.end(),u=D},d.on("drain",function(){if(p){let D=p;p=null,D()}}),d.on("finish",function(){if(u){let D=u;u=null,D()}});if(y)x(l,(D)=>{if(y=!1,D)T(l,D);A(D)}),l.on("readable",function(){if(m){let D=m;m=null,D()}}),l.on("end",function(){k.push(null)}),k._read=function(){while(!0){let D=l.read();if(D===null){m=k._read;return}if(!k.push(D))return}};return k._destroy=function(D,U){if(!D&&E!==null)D=new M;if(m=null,p=null,u=null,E===null)U(D);else E=U,T(d,D),T(l,D)},k}}),oi=Tt((e,t)=>{var{ObjectDefineProperties:r,ObjectGetOwnPropertyDescriptor:i,ObjectKeys:n,ObjectSetPrototypeOf:o}=Wt();t.exports=v;var s=qc(),h=$m();o(v.prototype,s.prototype),o(v,s);{let S=n(h.prototype);for(let x=0;x<S.length;x++){let M=S[x];if(!v.prototype[M])v.prototype[M]=h.prototype[M]}}function v(S){if(!(this instanceof v))return new v(S);if(s.call(this,S),h.call(this,S),S){if(this.allowHalfOpen=S.allowHalfOpen!==!1,S.readable===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if(S.writable===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}else this.allowHalfOpen=!0}r(v.prototype,{writable:{__proto__:null,...i(h.prototype,"writable")},writableHighWaterMark:{__proto__:null,...i(h.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...i(h.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...i(h.prototype,"writableBuffer")},writableLength:{__proto__:null,...i(h.prototype,"writableLength")},writableFinished:{__proto__:null,...i(h.prototype,"writableFinished")},writableCorked:{__proto__:null,...i(h.prototype,"writableCorked")},writableEnded:{__proto__:null,...i(h.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...i(h.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){if(this._readableState===void 0||this._writableState===void 0)return!1;return this._readableState.destroyed&&this._writableState.destroyed},set(S){if(this._readableState&&this._writableState)this._readableState.destroyed=S,this._writableState.destroyed=S}}});var b;function _(){if(b===void 0)b={};return b}v.fromWeb=function(S,x){return _().newStreamDuplexFromReadableWritablePair(S,x)},v.toWeb=function(S){return _().newReadableWritablePairFromDuplex(S)};var g;v.from=function(S){if(!g)g=B$();return g(S,"body")}}),dw=Tt((e,t)=>{var{ObjectSetPrototypeOf:r,Symbol:i}=Wt();t.exports=v;var{ERR_METHOD_NOT_IMPLEMENTED:n}=Hr().codes,o=oi(),{getHighWaterMark:s}=Fc();r(v.prototype,o.prototype),r(v,o);var h=i("kCallback");function v(g){if(!(this instanceof v))return new v(g);let S=g?s(this,g,"readableHighWaterMark",!0):null;if(S===0)g={...g,highWaterMark:null,readableHighWaterMark:S,writableHighWaterMark:g.writableHighWaterMark||0};if(o.call(this,g),this._readableState.sync=!1,this[h]=null,g){if(typeof g.transform==="function")this._transform=g.transform;if(typeof g.flush==="function")this._flush=g.flush}this.on("prefinish",_)}function b(g){if(typeof this._flush==="function"&&!this.destroyed)this._flush((S,x)=>{if(S){if(g)g(S);else this.destroy(S);return}if(x!=null)this.push(x);if(this.push(null),g)g()});else if(this.push(null),g)g()}function _(){if(this._final!==b)b.call(this)}v.prototype._final=b,v.prototype._transform=function(g,S,x){throw new n("_transform()")},v.prototype._write=function(g,S,x){let M=this._readableState,I=this._writableState,$=M.length;this._transform(g,S,(T,P)=>{if(T){x(T);return}if(P!=null)this.push(P);if(I.ended||$===M.length||M.length<M.highWaterMark)x();else this[h]=x})},v.prototype._read=function(){if(this[h]){let g=this[h];this[h]=null,g()}}}),fw=Tt((e,t)=>{var{ObjectSetPrototypeOf:r}=Wt();t.exports=n;var i=dw();r(n.prototype,i.prototype),r(n,i);function n(o){if(!(this instanceof n))return new n(o);i.call(this,o)}n.prototype._transform=function(o,s,h){h(null,o)}}),Tm=Tt((e,t)=>{var r=go(),{ArrayIsArray:i,Promise:n,SymbolAsyncIterator:o,SymbolDispose:s}=Wt(),h=Ci(),{once:v}=Qr(),b=as(),_=oi(),{aggregateTwoErrors:g,codes:{ERR_INVALID_ARG_TYPE:S,ERR_INVALID_RETURN_VALUE:x,ERR_MISSING_ARGS:M,ERR_STREAM_DESTROYED:I,ERR_STREAM_PREMATURE_CLOSE:$},AbortError:T}=Hr(),{validateFunction:P,validateAbortSignal:R}=Ma(),{isIterable:C,isReadable:N,isReadableNodeStream:B,isNodeStream:ie,isTransformStream:le,isWebStream:ue,isReadableStream:F,isReadableFinished:ee}=si(),a=globalThis.AbortController||ka().AbortController,c,f,l;function d(D,U,K){let he=!1;D.on("close",()=>{he=!0});let J=h(D,{readable:U,writable:K},(H)=>{he=!H});return{destroy:(H)=>{if(he)return;he=!0,b.destroyer(D,H||new I("pipe"))},cleanup:J}}function y(D){return P(D[D.length-1],"streams[stream.length - 1]"),D.pop()}function w(D){if(C(D))return D;else if(B(D))return p(D);throw new S("val",["Readable","Iterable","AsyncIterable"],D)}async function*p(D){if(!f)f=qc();yield*f.prototype[o].call(D)}async function u(D,U,K,{end:he}){let J,H=null,se=(He)=>{if(He)J=He;if(H){let z=H;H=null,z()}},V=()=>new n((He,z)=>{if(J)z(J);else H=()=>{if(J)z(J);else He()}});U.on("drain",se);let Q=h(U,{readable:!1},se);try{if(U.writableNeedDrain)await V();for await(let He of D)if(!U.write(He))await V();if(he)U.end(),await V();K()}catch(He){K(J!==He?g(J,He):He)}finally{Q(),U.off("drain",se)}}async function m(D,U,K,{end:he}){if(le(U))U=U.writable;let J=U.getWriter();try{for await(let H of D)await J.ready,J.write(H).catch(()=>{});if(await J.ready,he)await J.close();K()}catch(H){try{await J.abort(H),K(H)}catch(se){K(se)}}}function E(...D){return k(D,v(y(D)))}function k(D,U,K){if(D.length===1&&i(D[0]))D=D[0];if(D.length<2)throw new M("streams");let he=new a,J=he.signal,H=K===null||K===void 0?void 0:K.signal,se=[];R(H,"options.signal");function V(){Y(new T)}l=l||Qr().addAbortListener;let Q;if(H)Q=l(H,V);let He,z,L=[],ae=0;function G(W){Y(W,--ae===0)}function Y(W,re){var at;if(W&&(!He||He.code==="ERR_STREAM_PREMATURE_CLOSE"))He=W;if(!He&&!re)return;while(L.length)L.shift()(He);if((at=Q)===null||at===void 0||at[s](),he.abort(),re){if(!He)se.forEach((ge)=>ge());r.nextTick(U,He,z)}}let Me;for(let W=0;W<D.length;W++){let re=D[W],at=W<D.length-1,ge=W>0,ye=at||(K===null||K===void 0?void 0:K.end)!==!1,Gt=W===D.length-1;if(ie(re)){let pe=function(ve){if(ve&&ve.name!=="AbortError"&&ve.code!=="ERR_STREAM_PREMATURE_CLOSE")G(ve)};var j=pe;if(ye){let{destroy:ve,cleanup:tr}=d(re,at,ge);if(L.push(ve),N(re)&&Gt)se.push(tr)}if(re.on("error",pe),N(re)&&Gt)se.push(()=>{re.removeListener("error",pe)})}if(W===0)if(typeof re==="function"){if(Me=re({signal:J}),!C(Me))throw new x("Iterable, AsyncIterable or Stream","source",Me)}else if(C(re)||B(re)||le(re))Me=re;else Me=_.from(re);else if(typeof re==="function"){if(le(Me)){var Z;Me=w((Z=Me)===null||Z===void 0?void 0:Z.readable)}else Me=w(Me);if(Me=re(Me,{signal:J}),at){if(!C(Me,!0))throw new x("AsyncIterable",`transform[${W-1}]`,Me)}else{var je;if(!c)c=fw();let pe=new c({objectMode:!0}),ve=(je=Me)===null||je===void 0?void 0:je.then;if(typeof ve==="function")ae++,ve.call(Me,(Se)=>{if(z=Se,Se!=null)pe.write(Se);if(ye)pe.end();r.nextTick(G)},(Se)=>{pe.destroy(Se),r.nextTick(G,Se)});else if(C(Me,!0))ae++,u(Me,pe,G,{end:ye});else if(F(Me)||le(Me)){let Se=Me.readable||Me;ae++,u(Se,pe,G,{end:ye})}else throw new x("AsyncIterable or Promise","destination",Me);Me=pe;let{destroy:tr,cleanup:xe}=d(Me,!1,!0);if(L.push(tr),Gt)se.push(xe)}}else if(ie(re)){if(B(Me)){ae+=2;let pe=A(Me,re,G,{end:ye});if(N(re)&&Gt)se.push(pe)}else if(le(Me)||F(Me)){let pe=Me.readable||Me;ae++,u(pe,re,G,{end:ye})}else if(C(Me))ae++,u(Me,re,G,{end:ye});else throw new S("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],Me);Me=re}else if(ue(re)){if(B(Me))ae++,m(w(Me),re,G,{end:ye});else if(F(Me)||C(Me))ae++,m(Me,re,G,{end:ye});else if(le(Me))ae++,m(Me.readable,re,G,{end:ye});else throw new S("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],Me);Me=re}else Me=_.from(re)}if(J!==null&&J!==void 0&&J.aborted||H!==null&&H!==void 0&&H.aborted)r.nextTick(V);return Me}function A(D,U,K,{end:he}){let J=!1;if(U.on("close",()=>{if(!J)K(new $)}),D.pipe(U,{end:!1}),he){let se=function(){J=!0,U.end()};var H=se;if(ee(D))r.nextTick(se);else D.once("end",se)}else K();return h(D,{readable:!0,writable:!1},(se)=>{let V=D._readableState;if(se&&se.code==="ERR_STREAM_PREMATURE_CLOSE"&&V&&V.ended&&!V.errored&&!V.errorEmitted)D.once("end",K).once("error",K);else K(se)}),h(U,{readable:!1,writable:!0},K)}t.exports={pipelineImpl:k,pipeline:E}}),hw=Tt((e,t)=>{var{pipeline:r}=Tm(),i=oi(),{destroyer:n}=as(),{isNodeStream:o,isReadable:s,isWritable:h,isWebStream:v,isTransformStream:b,isWritableStream:_,isReadableStream:g}=si(),{AbortError:S,codes:{ERR_INVALID_ARG_VALUE:x,ERR_MISSING_ARGS:M}}=Hr(),I=Ci();t.exports=function(...$){if($.length===0)throw new M("streams");if($.length===1)return i.from($[0]);let T=[...$];if(typeof $[0]==="function")$[0]=i.from($[0]);if(typeof $[$.length-1]==="function"){let a=$.length-1;$[a]=i.from($[a])}for(let a=0;a<$.length;++a){if(!o($[a])&&!v($[a]))continue;if(a<$.length-1&&!(s($[a])||g($[a])||b($[a])))throw new x(`streams[${a}]`,T[a],"must be readable");if(a>0&&!(h($[a])||_($[a])||b($[a])))throw new x(`streams[${a}]`,T[a],"must be writable")}let P,R,C,N,B;function ie(a){let c=N;if(N=null,c)c(a);else if(a)B.destroy(a);else if(!ee&&!F)B.destroy()}let le=$[0],ue=r($,ie),F=!!(h(le)||_(le)||b(le)),ee=!!(s(ue)||g(ue)||b(ue));if(B=new i({writableObjectMode:!!(le!==null&&le!==void 0&&le.writableObjectMode),readableObjectMode:!!(ue!==null&&ue!==void 0&&ue.readableObjectMode),writable:F,readable:ee}),F){if(o(le))B._write=function(c,f,l){if(le.write(c,f))l();else P=l},B._final=function(c){le.end(),R=c},le.on("drain",function(){if(P){let c=P;P=null,c()}});else if(v(le)){let c=(b(le)?le.writable:le).getWriter();B._write=async function(f,l,d){try{await c.ready,c.write(f).catch(()=>{}),d()}catch(y){d(y)}},B._final=async function(f){try{await c.ready,c.close().catch(()=>{}),R=f}catch(l){f(l)}}}let a=b(ue)?ue.readable:ue;I(a,()=>{if(R){let c=R;R=null,c()}})}if(ee){if(o(ue))ue.on("readable",function(){if(C){let a=C;C=null,a()}}),ue.on("end",function(){B.push(null)}),B._read=function(){while(!0){let a=ue.read();if(a===null){C=B._read;return}if(!B.push(a))return}};else if(v(ue)){let a=(b(ue)?ue.readable:ue).getReader();B._read=async function(){while(!0)try{let{value:c,done:f}=await a.read();if(!B.push(c))return;if(f){B.push(null);return}}catch{return}}}}return B._destroy=function(a,c){if(!a&&N!==null)a=new S;if(C=null,P=null,R=null,N===null)c(a);else if(N=c,o(ue))n(ue,a)},B}}),H$=Tt((e,t)=>{var r=globalThis.AbortController||ka().AbortController,{codes:{ERR_INVALID_ARG_VALUE:i,ERR_INVALID_ARG_TYPE:n,ERR_MISSING_ARGS:o,ERR_OUT_OF_RANGE:s},AbortError:h}=Hr(),{validateAbortSignal:v,validateInteger:b,validateObject:_}=Ma(),g=Wt().Symbol("kWeak"),S=Wt().Symbol("kResistStopPropagation"),{finished:x}=Ci(),M=hw(),{addAbortSignalNoValidate:I}=Lc(),{isWritable:$,isNodeStream:T}=si(),{deprecate:P}=Qr(),{ArrayPrototypePush:R,Boolean:C,MathFloor:N,Number:B,NumberIsNaN:ie,Promise:le,PromiseReject:ue,PromiseResolve:F,PromisePrototypeThen:ee,Symbol:a}=Wt(),c=a("kEmpty"),f=a("kEof");function l(H,se){if(se!=null)_(se,"options");if((se===null||se===void 0?void 0:se.signal)!=null)v(se.signal,"options.signal");if(T(H)&&!$(H))throw new i("stream",H,"must be writable");let V=M(this,H);if(se!==null&&se!==void 0&&se.signal)I(se.signal,V);return V}function d(H,se){if(typeof H!=="function")throw new n("fn",["Function","AsyncFunction"],H);if(se!=null)_(se,"options");if((se===null||se===void 0?void 0:se.signal)!=null)v(se.signal,"options.signal");let V=1;if((se===null||se===void 0?void 0:se.concurrency)!=null)V=N(se.concurrency);let Q=V-1;if((se===null||se===void 0?void 0:se.highWaterMark)!=null)Q=N(se.highWaterMark);return b(V,"options.concurrency",1),b(Q,"options.highWaterMark",0),Q+=V,async function*(){let He=Qr().AbortSignalAny([se===null||se===void 0?void 0:se.signal].filter(C)),z=this,L=[],ae={signal:He},G,Y,Me=!1,j=0;function Z(){Me=!0,je()}function je(){j-=1,W()}function W(){if(Y&&!Me&&j<V&&L.length<Q)Y(),Y=null}async function re(){try{for await(let at of z){if(Me)return;if(He.aborted)throw new h;try{if(at=H(at,ae),at===c)continue;at=F(at)}catch(ge){at=ue(ge)}if(j+=1,ee(at,je,Z),L.push(at),G)G(),G=null;if(!Me&&(L.length>=Q||j>=V))await new le((ge)=>{Y=ge})}L.push(f)}catch(at){let ge=ue(at);ee(ge,je,Z),L.push(ge)}finally{if(Me=!0,G)G(),G=null}}re();try{while(!0){while(L.length>0){let at=await L[0];if(at===f)return;if(He.aborted)throw new h;if(at!==c)yield at;L.shift(),W()}await new le((at)=>{G=at})}}finally{if(Me=!0,Y)Y(),Y=null}}.call(this)}function y(H=void 0){if(H!=null)_(H,"options");if((H===null||H===void 0?void 0:H.signal)!=null)v(H.signal,"options.signal");return async function*(){let se=0;for await(let Q of this){var V;if(H!==null&&H!==void 0&&(V=H.signal)!==null&&V!==void 0&&V.aborted)throw new h({cause:H.signal.reason});yield[se++,Q]}}.call(this)}async function w(H,se=void 0){for await(let V of E.call(this,H,se))return!0;return!1}async function p(H,se=void 0){if(typeof H!=="function")throw new n("fn",["Function","AsyncFunction"],H);return!await w.call(this,async(...V)=>!await H(...V),se)}async function u(H,se){for await(let V of E.call(this,H,se))return V;return}async function m(H,se){if(typeof H!=="function")throw new n("fn",["Function","AsyncFunction"],H);async function V(Q,He){return await H(Q,He),c}for await(let Q of d.call(this,V,se));}function E(H,se){if(typeof H!=="function")throw new n("fn",["Function","AsyncFunction"],H);async function V(Q,He){if(await H(Q,He))return Q;return c}return d.call(this,V,se)}class k extends o{constructor(){super("reduce");this.message="Reduce of an empty stream requires an initial value"}}async function A(H,se,V){var Q;if(typeof H!=="function")throw new n("reducer",["Function","AsyncFunction"],H);if(V!=null)_(V,"options");if((V===null||V===void 0?void 0:V.signal)!=null)v(V.signal,"options.signal");let He=arguments.length>1;if(V!==null&&V!==void 0&&(Q=V.signal)!==null&&Q!==void 0&&Q.aborted){let Y=new h(void 0,{cause:V.signal.reason});throw this.once("error",()=>{}),await x(this.destroy(Y)),Y}let z=new r,L=z.signal;if(V!==null&&V!==void 0&&V.signal){let Y={once:!0,[g]:this,[S]:!0};V.signal.addEventListener("abort",()=>z.abort(),Y)}let ae=!1;try{for await(let Y of this){var G;if(ae=!0,V!==null&&V!==void 0&&(G=V.signal)!==null&&G!==void 0&&G.aborted)throw new h;if(!He)se=Y,He=!0;else se=await H(se,Y,{signal:L})}if(!ae&&!He)throw new k}finally{z.abort()}return se}async function D(H){if(H!=null)_(H,"options");if((H===null||H===void 0?void 0:H.signal)!=null)v(H.signal,"options.signal");let se=[];for await(let Q of this){var V;if(H!==null&&H!==void 0&&(V=H.signal)!==null&&V!==void 0&&V.aborted)throw new h(void 0,{cause:H.signal.reason});R(se,Q)}return se}function U(H,se){let V=d.call(this,H,se);return async function*(){for await(let Q of V)yield*Q}.call(this)}function K(H){if(H=B(H),ie(H))return 0;if(H<0)throw new s("number",">= 0",H);return H}function he(H,se=void 0){if(se!=null)_(se,"options");if((se===null||se===void 0?void 0:se.signal)!=null)v(se.signal,"options.signal");return H=K(H),async function*(){var V;if(se!==null&&se!==void 0&&(V=se.signal)!==null&&V!==void 0&&V.aborted)throw new h;for await(let He of this){var Q;if(se!==null&&se!==void 0&&(Q=se.signal)!==null&&Q!==void 0&&Q.aborted)throw new h;if(H--<=0)yield He}}.call(this)}function J(H,se=void 0){if(se!=null)_(se,"options");if((se===null||se===void 0?void 0:se.signal)!=null)v(se.signal,"options.signal");return H=K(H),async function*(){var V;if(se!==null&&se!==void 0&&(V=se.signal)!==null&&V!==void 0&&V.aborted)throw new h;for await(let He of this){var Q;if(se!==null&&se!==void 0&&(Q=se.signal)!==null&&Q!==void 0&&Q.aborted)throw new h;if(H-- >0)yield He;if(H<=0)return}}.call(this)}t.exports.streamReturningOperators={asIndexedPairs:P(y,"readable.asIndexedPairs will be removed in a future version."),drop:he,filter:E,flatMap:U,map:d,take:J,compose:l},t.exports.promiseReturningOperators={every:p,forEach:m,reduce:A,toArray:D,some:w,find:u}}),pw=Tt((e,t)=>{var{ArrayPrototypePop:r,Promise:i}=Wt(),{isIterable:n,isNodeStream:o,isWebStream:s}=si(),{pipelineImpl:h}=Tm(),{finished:v}=Ci();mw();function b(..._){return new i((g,S)=>{let x,M,I=_[_.length-1];if(I&&typeof I==="object"&&!o(I)&&!n(I)&&!s(I)){let $=r(_);x=$.signal,M=$.end}h(_,($,T)=>{if($)S($);else g(T)},{signal:x,end:M})})}t.exports={finished:v,pipeline:b}}),mw=Tt((e,t)=>{var{Buffer:r}=(Tr(),kt($r)),{ObjectDefineProperty:i,ObjectKeys:n,ReflectApply:o}=Wt(),{promisify:{custom:s}}=Qr(),{streamReturningOperators:h,promiseReturningOperators:v}=H$(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:b}}=Hr(),_=hw(),{setDefaultHighWaterMark:g,getDefaultHighWaterMark:S}=Fc(),{pipeline:x}=Tm(),{destroyer:M}=as(),I=Ci(),$=pw(),T=si(),P=t.exports=Im().Stream;P.isDestroyed=T.isDestroyed,P.isDisturbed=T.isDisturbed,P.isErrored=T.isErrored,P.isReadable=T.isReadable,P.isWritable=T.isWritable,P.Readable=qc();for(let C of n(h)){let N=function(...ie){if(new.target)throw b();return P.Readable.from(o(B,this,ie))},B=h[C];i(N,"name",{__proto__:null,value:B.name}),i(N,"length",{__proto__:null,value:B.length}),i(P.Readable.prototype,C,{__proto__:null,value:N,enumerable:!1,configurable:!0,writable:!0})}for(let C of n(v)){let N=function(...ie){if(new.target)throw b();return o(B,this,ie)},B=v[C];i(N,"name",{__proto__:null,value:B.name}),i(N,"length",{__proto__:null,value:B.length}),i(P.Readable.prototype,C,{__proto__:null,value:N,enumerable:!1,configurable:!0,writable:!0})}P.Writable=$m(),P.Duplex=oi(),P.Transform=dw(),P.PassThrough=fw(),P.pipeline=x;var{addAbortSignal:R}=Lc();P.addAbortSignal=R,P.finished=I,P.destroy=M,P.compose=_,P.setDefaultHighWaterMark=g,P.getDefaultHighWaterMark=S,i(P,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return $}}),i(x,s,{__proto__:null,enumerable:!0,get(){return $.pipeline}}),i(I,s,{__proto__:null,enumerable:!0,get(){return $.finished}}),P.Stream=P,P._isUint8Array=function(C){return C instanceof Uint8Array},P._uint8ArrayToBuffer=function(C){return r.from(C.buffer,C.byteOffset,C.byteLength)}}),Z$=Tt((e,t)=>{var r=Pm();{let i=mw(),n=pw(),o=i.Readable.destroy;t.exports=i.Readable,t.exports._uint8ArrayToBuffer=i._uint8ArrayToBuffer,t.exports._isUint8Array=i._isUint8Array,t.exports.isDisturbed=i.isDisturbed,t.exports.isErrored=i.isErrored,t.exports.isReadable=i.isReadable,t.exports.Readable=i.Readable,t.exports.Writable=i.Writable,t.exports.Duplex=i.Duplex,t.exports.Transform=i.Transform,t.exports.PassThrough=i.PassThrough,t.exports.addAbortSignal=i.addAbortSignal,t.exports.finished=i.finished,t.exports.destroy=i.destroy,t.exports.destroy=o,t.exports.pipeline=i.pipeline,t.exports.compose=i.compose,Object.defineProperty(i,"promises",{configurable:!0,enumerable:!0,get(){return n}}),t.exports.Stream=i.Stream}t.exports.default=t.exports});gw.exports=Z$()});var dn={};wn(dn,{webcrypto:()=>vA,rng:()=>CP,randomUUID:()=>Vw,randomFillSync:()=>dA,randomFill:()=>cA,randomBytes:()=>Kw,publicEncrypt:()=>sA,publicDecrypt:()=>uA,pseudoRandomBytes:()=>RP,prng:()=>AP,privateEncrypt:()=>aA,privateDecrypt:()=>lA,pbkdf2Sync:()=>UP,pbkdf2:()=>jP,listCiphers:()=>GP,getRandomValues:()=>mA,getHashes:()=>zP,getDiffieHellman:()=>YP,getCurves:()=>yA,getCiphers:()=>WP,default:()=>bA,createVerify:()=>nA,createSign:()=>tA,createHmac:()=>NP,createHash:()=>Fm,createECDH:()=>oA,createDiffieHellmanGroup:()=>XP,createDiffieHellman:()=>QP,createDecipheriv:()=>VP,createDecipher:()=>ZP,createCredentials:()=>fA,createCipheriv:()=>BP,createCipher:()=>FP,constants:()=>hA,Verify:()=>iA,Sign:()=>rA,Hmac:()=>DP,Hash:()=>OP,DiffieHellmanGroup:()=>JP,DiffieHellman:()=>eA,Decipheriv:()=>KP,Decipher:()=>HP,DEFAULT_ENCODING:()=>pA,Cipheriv:()=>qP,Cipher:()=>LP});function J$(e){return this[e]}function yA(){return gA}var K$,V$,yw,W$,G$,X$,Y$,Q$=(e,t,r)=>{var i=e!=null&&typeof e==="object";if(i){var n=t?X$??=new WeakMap:Y$??=new WeakMap,o=n.get(e);if(o)return o}r=e!=null?K$(V$(e)):{};let s=t||!e||!e.__esModule?yw(r,"default",{value:e,enumerable:!0}):r;for(let h of W$(e))if(!G$.call(s,h))yw(s,h,{get:J$.bind(e,h),enumerable:!0});if(i)n.set(e,s);return s},ce=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Bc,Hc,bw,eT,Rm,Cm,Zr,tT,Ia,_w,rT,nT,iT,oT,ww,sT,aT,uT,lT,cT,dT,fT,hT,pT,mT,$a,Zc,Sw,gT,xw,kw,yT,Ta,Om,Dm,vT,Mw,Nm,bT,Ew,_T,Iw,$w,wT,ST,xT,kT,MT,ET,IT,$T,TT,PT,AT,RT,CT,OT,zm,Tw,DT,Pw,NT,zT,jT,UT,ai,Oi,Aw,xn,Rw,Kc,LT,cn,FT,qT,BT,Cw,Jn,Pa,Ow,HT,Dw,ZT,Nw,KT,VT,WT,GT,jm,JT,Um,XT,YT,QT,eP,tP,rP,nP,iP,oP,sP,aP,uP,lP,cP,vw,dP,Ea,fP,zw,jw,hP,pP,Uw,mP,gP,Aa,yP,vP,bP,_P,wP,SP,Lw,xP,Fw,qw,Bw,Lm,Hw,kP,Zw,MP,EP,Am,IP,$P,TP,PP,yt,AP,RP,CP,Kw,OP,Fm,DP,NP,zP,jP,UP,LP,FP,qP,BP,HP,ZP,KP,VP,WP,GP,JP,XP,YP,QP,eA,tA,rA,nA,iA,oA,sA,aA,uA,lA,cA,dA,fA,hA,pA="buffer",mA=(e)=>crypto.getRandomValues(e),Vw=()=>crypto.randomUUID(),gA,vA,bA;var Kr=ga(()=>{K$=Object.create,{getPrototypeOf:V$,defineProperty:yw,getOwnPropertyNames:W$}=Object,G$=Object.prototype.hasOwnProperty;Bc=ce((e,t)=>{t.exports=(Kr(),kt(dn)).randomBytes}),Hc=ce((e,t)=>{t.exports=(Kr(),kt(dn)).createHash}),bw=ce((e,t)=>{t.exports=(Kr(),kt(dn)).createHmac}),eT=ce((e,t)=>{t.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}}),Rm=ce((e,t)=>{var r=isFinite,i=Math.pow(2,30)-1;t.exports=function(n,o){if(typeof n!=="number")throw TypeError("Iterations not a number");if(n<0||!r(n))throw TypeError("Bad iterations");if(typeof o!=="number")throw TypeError("Key length not a number");if(o<0||o>i||o!==o)throw TypeError("Bad key length")}}),Cm=ce((e,t)=>{var r;if(globalThis.process&&globalThis.process.browser)r="utf-8";else if(globalThis.process&&globalThis.process.version)i=parseInt(process.version.split(".")[0].slice(1),10),r=i>=6?"utf-8":"binary";else r="utf-8";var i;t.exports=r}),Zr=ce((e,t)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var r=(Tr(),kt($r)),i=r.Buffer;function n(s,h){for(var v in s)h[v]=s[v]}if(i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow)t.exports=r;else n(r,e),e.Buffer=o;function o(s,h,v){return i(s,h,v)}o.prototype=Object.create(i.prototype),n(i,o),o.from=function(s,h,v){if(typeof s==="number")throw TypeError("Argument must not be a number");return i(s,h,v)},o.alloc=function(s,h,v){if(typeof s!=="number")throw TypeError("Argument must be a number");var b=i(s);if(h!==void 0)if(typeof v==="string")b.fill(h,v);else b.fill(h);else b.fill(0);return b},o.allocUnsafe=function(s){if(typeof s!=="number")throw TypeError("Argument must be a number");return i(s)},o.allocUnsafeSlow=function(s){if(typeof s!=="number")throw TypeError("Argument must be a number");return r.SlowBuffer(s)}}),tT=ce((e,t)=>{var r={}.toString;t.exports=Array.isArray||function(i){return r.call(i)=="[object Array]"}}),Ia=ce((e,t)=>{t.exports=TypeError}),_w=ce((e,t)=>{t.exports=Object}),rT=ce((e,t)=>{t.exports=Error}),nT=ce((e,t)=>{t.exports=EvalError}),iT=ce((e,t)=>{t.exports=RangeError}),oT=ce((e,t)=>{t.exports=ReferenceError}),ww=ce((e,t)=>{t.exports=SyntaxError}),sT=ce((e,t)=>{t.exports=URIError}),aT=ce((e,t)=>{t.exports=Math.abs}),uT=ce((e,t)=>{t.exports=Math.floor}),lT=ce((e,t)=>{t.exports=Math.max}),cT=ce((e,t)=>{t.exports=Math.min}),dT=ce((e,t)=>{t.exports=Math.pow}),fT=ce((e,t)=>{t.exports=Math.round}),hT=ce((e,t)=>{t.exports=Number.isNaN||function(r){return r!==r}}),pT=ce((e,t)=>{var r=hT();t.exports=function(i){if(r(i)||i===0)return i;return i<0?-1:1}}),mT=ce((e,t)=>{t.exports=Object.getOwnPropertyDescriptor}),$a=ce((e,t)=>{var r=mT();if(r)try{r([],"length")}catch(i){r=null}t.exports=r}),Zc=ce((e,t)=>{var r=Object.defineProperty||!1;if(r)try{r({},"a",{value:1})}catch(i){r=!1}t.exports=r}),Sw=ce((e,t)=>{t.exports=function(){if(typeof Symbol!=="function"||typeof Object.getOwnPropertySymbols!=="function")return!1;if(typeof Symbol.iterator==="symbol")return!0;var r={},i=Symbol("test"),n=Object(i);if(typeof i==="string")return!1;if(Object.prototype.toString.call(i)!=="[object Symbol]")return!1;if(Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;r[i]=o;for(var s in r)return!1;if(typeof Object.keys==="function"&&Object.keys(r).length!==0)return!1;if(typeof Object.getOwnPropertyNames==="function"&&Object.getOwnPropertyNames(r).length!==0)return!1;var h=Object.getOwnPropertySymbols(r);if(h.length!==1||h[0]!==i)return!1;if(!Object.prototype.propertyIsEnumerable.call(r,i))return!1;if(typeof Object.getOwnPropertyDescriptor==="function"){var v=Object.getOwnPropertyDescriptor(r,i);if(v.value!==o||v.enumerable!==!0)return!1}return!0}}),gT=ce((e,t)=>{var r=typeof Symbol<"u"&&Symbol,i=Sw();t.exports=function(){if(typeof r!=="function")return!1;if(typeof Symbol!=="function")return!1;if(typeof r("foo")!=="symbol")return!1;if(typeof Symbol("bar")!=="symbol")return!1;return i()}}),xw=ce((e,t)=>{t.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}),kw=ce((e,t)=>{var r=_w();t.exports=r.getPrototypeOf||null}),yT=ce((e,t)=>{var r="Function.prototype.bind called on incompatible ",i=Object.prototype.toString,n=Math.max,o="[object Function]",s=function(b,_){var g=[];for(var S=0;S<b.length;S+=1)g[S]=b[S];for(var x=0;x<_.length;x+=1)g[x+b.length]=_[x];return g},h=function(b,_){var g=[];for(var S=_||0,x=0;S<b.length;S+=1,x+=1)g[x]=b[S];return g},v=function(b,_){var g="";for(var S=0;S<b.length;S+=1)if(g+=b[S],S+1<b.length)g+=_;return g};t.exports=function(b){var _=this;if(typeof _!=="function"||i.apply(_)!==o)throw TypeError(r+_);var g=h(arguments,1),S,x=function(){if(this instanceof S){var P=_.apply(this,s(g,arguments));if(Object(P)===P)return P;return this}return _.apply(b,s(g,arguments))},M=n(0,_.length-g.length),I=[];for(var $=0;$<M;$++)I[$]="$"+$;if(S=Function("binder","return function ("+v(I,",")+"){ return binder.apply(this,arguments); }")(x),_.prototype){var T=function(){};T.prototype=_.prototype,S.prototype=new T,T.prototype=null}return S}}),Ta=ce((e,t)=>{var r=yT();t.exports=Function.prototype.bind||r}),Om=ce((e,t)=>{t.exports=Function.prototype.call}),Dm=ce((e,t)=>{t.exports=Function.prototype.apply}),vT=ce((e,t)=>{t.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply}),Mw=ce((e,t)=>{var r=Ta(),i=Dm(),n=Om(),o=vT();t.exports=o||r.call(n,i)}),Nm=ce((e,t)=>{var r=Ta(),i=Ia(),n=Om(),o=Mw();t.exports=function(s){if(s.length<1||typeof s[0]!=="function")throw new i("a function is required");return o(r,n,s)}}),bT=ce((e,t)=>{var r=Nm(),i=$a(),n;try{n=[].__proto__===Array.prototype}catch(v){if(!v||typeof v!=="object"||!("code"in v)||v.code!=="ERR_PROTO_ACCESS")throw v}var o=!!n&&i&&i(Object.prototype,"__proto__"),s=Object,h=s.getPrototypeOf;t.exports=o&&typeof o.get==="function"?r([o.get]):typeof h==="function"?function(v){return h(v==null?v:s(v))}:!1}),Ew=ce((e,t)=>{var r=xw(),i=kw(),n=bT();t.exports=r?function(o){return r(o)}:i?function(o){if(!o||typeof o!=="object"&&typeof o!=="function")throw TypeError("getProto: not an object");return i(o)}:n?function(o){return n(o)}:null}),_T=ce((e,t)=>{var r=Function.prototype.call,i=Object.prototype.hasOwnProperty,n=Ta();t.exports=n.call(r,i)}),Iw=ce((e,t)=>{var r,i=_w(),n=rT(),o=nT(),s=iT(),h=oT(),v=ww(),b=Ia(),_=sT(),g=aT(),S=uT(),x=lT(),M=cT(),I=dT(),$=fT(),T=pT(),P=Function,R=function(se){try{return P('"use strict"; return ('+se+").constructor;")()}catch(V){}},C=$a(),N=Zc(),B=function(){throw new b},ie=C?function(){try{return arguments.callee,B}catch(se){try{return C(arguments,"callee").get}catch(V){return B}}}():B,le=gT()(),ue=Ew(),F=kw(),ee=xw(),a=Dm(),c=Om(),f={},l=typeof Uint8Array>"u"||!ue?r:ue(Uint8Array),d={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":le&&ue?ue([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":typeof Atomics>"u"?r:Atomics,"%BigInt%":typeof BigInt>"u"?r:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?r:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":o,"%Float16Array%":typeof Float16Array>"u"?r:Float16Array,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":P,"%GeneratorFunction%":f,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":le&&ue?ue(ue([][Symbol.iterator]())):r,"%JSON%":typeof JSON==="object"?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!le||!ue?r:ue(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":i,"%Object.getOwnPropertyDescriptor%":C,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":s,"%ReferenceError%":h,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":typeof Set>"u"||!le||!ue?r:ue(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":le&&ue?ue(""[Symbol.iterator]()):r,"%Symbol%":le?Symbol:r,"%SyntaxError%":v,"%ThrowTypeError%":ie,"%TypedArray%":l,"%TypeError%":b,"%Uint8Array%":typeof Uint8Array>"u"?r:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?r:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?r:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?r:Uint32Array,"%URIError%":_,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?r:WeakSet,"%Function.prototype.call%":c,"%Function.prototype.apply%":a,"%Object.defineProperty%":N,"%Object.getPrototypeOf%":F,"%Math.abs%":g,"%Math.floor%":S,"%Math.max%":x,"%Math.min%":M,"%Math.pow%":I,"%Math.round%":$,"%Math.sign%":T,"%Reflect.getPrototypeOf%":ee};if(ue)try{null.error}catch(se){y=ue(ue(se)),d["%Error.prototype%"]=y}var y,w=function se(V){var Q;if(V==="%AsyncFunction%")Q=R("async function () {}");else if(V==="%GeneratorFunction%")Q=R("function* () {}");else if(V==="%AsyncGeneratorFunction%")Q=R("async function* () {}");else if(V==="%AsyncGenerator%"){var He=se("%AsyncGeneratorFunction%");if(He)Q=He.prototype}else if(V==="%AsyncIteratorPrototype%"){var z=se("%AsyncGenerator%");if(z&&ue)Q=ue(z.prototype)}return d[V]=Q,Q},p={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},u=Ta(),m=_T(),E=u.call(c,Array.prototype.concat),k=u.call(a,Array.prototype.splice),A=u.call(c,String.prototype.replace),D=u.call(c,String.prototype.slice),U=u.call(c,RegExp.prototype.exec),K=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,he=/\\(\\)?/g,J=function(se){var V=D(se,0,1),Q=D(se,-1);if(V==="%"&&Q!=="%")throw new v("invalid intrinsic syntax, expected closing `%`");else if(Q==="%"&&V!=="%")throw new v("invalid intrinsic syntax, expected opening `%`");var He=[];return A(se,K,function(z,L,ae,G){He[He.length]=ae?A(G,he,"$1"):L||z}),He},H=function(se,V){var Q=se,He;if(m(p,Q))He=p[Q],Q="%"+He[0]+"%";if(m(d,Q)){var z=d[Q];if(z===f)z=w(Q);if(typeof z>"u"&&!V)throw new b("intrinsic "+se+" exists, but is not available. Please file an issue!");return{alias:He,name:Q,value:z}}throw new v("intrinsic "+se+" does not exist!")};t.exports=function(se,V){if(typeof se!=="string"||se.length===0)throw new b("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof V!=="boolean")throw new b('"allowMissing" argument must be a boolean');if(U(/^%?[^%]*%?$/,se)===null)throw new v("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Q=J(se),He=Q.length>0?Q[0]:"",z=H("%"+He+"%",V),L=z.name,ae=z.value,G=!1,Y=z.alias;if(Y)He=Y[0],k(Q,E([0,1],Y));for(var Me=1,j=!0;Me<Q.length;Me+=1){var Z=Q[Me],je=D(Z,0,1),W=D(Z,-1);if((je==='"'||je==="'"||je==="`"||(W==='"'||W==="'"||W==="`"))&&je!==W)throw new v("property names with quotes must have matching quotes");if(Z==="constructor"||!j)G=!0;if(He+="."+Z,L="%"+He+"%",m(d,L))ae=d[L];else if(ae!=null){if(!(Z in ae)){if(!V)throw new b("base intrinsic for "+se+" exists, but the property is not available.");return}if(C&&Me+1>=Q.length){var re=C(ae,Z);if(j=!!re,j&&"get"in re&&!("originalValue"in re.get))ae=re.get;else ae=ae[Z]}else j=m(ae,Z),ae=ae[Z];if(j&&!G)d[L]=ae}}return ae}}),$w=ce((e,t)=>{var r=Iw(),i=Nm(),n=i([r("%String.prototype.indexOf%")]);t.exports=function(o,s){var h=r(o,!!s);if(typeof h==="function"&&n(o,".prototype.")>-1)return i([h]);return h}}),wT=ce((e,t)=>{var r=Function.prototype.toString,i=typeof Reflect==="object"&&Reflect!==null&&Reflect.apply,n,o;if(typeof i==="function"&&typeof Object.defineProperty==="function")try{n=Object.defineProperty({},"length",{get:function(){throw o}}),o={},i(function(){throw 42},null,n)}catch(C){if(C!==o)i=null}else i=null;var s=/^\s*class\b/,h=function(C){try{var N=r.call(C);return s.test(N)}catch(B){return!1}},v=function(C){try{if(h(C))return!1;return r.call(C),!0}catch(N){return!1}},b=Object.prototype.toString,_="[object Object]",g="[object Function]",S="[object GeneratorFunction]",x="[object HTMLAllCollection]",M="[object HTML document.all class]",I="[object HTMLCollection]",$=typeof Symbol==="function"&&!!Symbol.toStringTag,T=!(0 in[,]),P=function(){return!1};if(typeof document==="object"){if(R=document.all,b.call(R)===b.call(document.all))P=function(C){if((T||!C)&&(typeof C>"u"||typeof C==="object"))try{var N=b.call(C);return(N===x||N===M||N===I||N===_)&&C("")==null}catch(B){}return!1}}var R;t.exports=i?function(C){if(P(C))return!0;if(!C)return!1;if(typeof C!=="function"&&typeof C!=="object")return!1;try{i(C,null,n)}catch(N){if(N!==o)return!1}return!h(C)&&v(C)}:function(C){if(P(C))return!0;if(!C)return!1;if(typeof C!=="function"&&typeof C!=="object")return!1;if($)return v(C);if(h(C))return!1;var N=b.call(C);if(N!==g&&N!==S&&!/^\[object HTML/.test(N))return!1;return v(C)}}),ST=ce((e,t)=>{var r=wT(),i=Object.prototype.toString,n=Object.prototype.hasOwnProperty,o=function(b,_,g){for(var S=0,x=b.length;S<x;S++)if(n.call(b,S))if(g==null)_(b[S],S,b);else _.call(g,b[S],S,b)},s=function(b,_,g){for(var S=0,x=b.length;S<x;S++)if(g==null)_(b.charAt(S),S,b);else _.call(g,b.charAt(S),S,b)},h=function(b,_,g){for(var S in b)if(n.call(b,S))if(g==null)_(b[S],S,b);else _.call(g,b[S],S,b)};function v(b){return i.call(b)==="[object Array]"}t.exports=function(b,_,g){if(!r(_))throw TypeError("iterator must be a function");var S;if(arguments.length>=3)S=g;if(v(b))o(b,_,S);else if(typeof b==="string")s(b,_,S);else h(b,_,S)}}),xT=ce((e,t)=>{t.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]}),kT=ce((e,t)=>{var r=xT(),i=typeof globalThis>"u"?globalThis:globalThis;t.exports=function(){var n=[];for(var o=0;o<r.length;o++)if(typeof i[r[o]]==="function")n[n.length]=r[o];return n}}),MT=ce((e,t)=>{var r=Zc(),i=ww(),n=Ia(),o=$a();t.exports=function(s,h,v){if(!s||typeof s!=="object"&&typeof s!=="function")throw new n("`obj` must be an object or a function`");if(typeof h!=="string"&&typeof h!=="symbol")throw new n("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!=="boolean"&&arguments[3]!==null)throw new n("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!=="boolean"&&arguments[4]!==null)throw new n("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!=="boolean"&&arguments[5]!==null)throw new n("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!=="boolean")throw new n("`loose`, if provided, must be a boolean");var b=arguments.length>3?arguments[3]:null,_=arguments.length>4?arguments[4]:null,g=arguments.length>5?arguments[5]:null,S=arguments.length>6?arguments[6]:!1,x=!!o&&o(s,h);if(r)r(s,h,{configurable:g===null&&x?x.configurable:!g,enumerable:b===null&&x?x.enumerable:!b,value:v,writable:_===null&&x?x.writable:!_});else if(S||!b&&!_&&!g)s[h]=v;else throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}),ET=ce((e,t)=>{var r=Zc(),i=function(){return!!r};i.hasArrayLengthDefineBug=function(){if(!r)return null;try{return r([],"length",{value:1}).length!==1}catch(n){return!0}},t.exports=i}),IT=ce((e,t)=>{var r=Iw(),i=MT(),n=ET()(),o=$a(),s=Ia(),h=r("%Math.floor%");t.exports=function(v,b){if(typeof v!=="function")throw new s("`fn` is not a function");if(typeof b!=="number"||b<0||b>4294967295||h(b)!==b)throw new s("`length` must be a positive 32-bit integer");var _=arguments.length>2&&!!arguments[2],g=!0,S=!0;if("length"in v&&o){var x=o(v,"length");if(x&&!x.configurable)g=!1;if(x&&!x.writable)S=!1}if(g||S||!_)if(n)i(v,"length",b,!0,!0);else i(v,"length",b);return v}}),$T=ce((e,t)=>{var r=Ta(),i=Dm(),n=Mw();t.exports=function(){return n(r,i,arguments)}}),TT=ce((e,t)=>{var r=IT(),i=Zc(),n=Nm(),o=$T();if(t.exports=function(s){var h=n(arguments),v=s.length-(arguments.length-1);return r(h,1+(v>0?v:0),!0)},i)i(t.exports,"apply",{value:o});else t.exports.apply=o}),PT=ce((e,t)=>{var r=Sw();t.exports=function(){return r()&&!!Symbol.toStringTag}}),AT=ce((e,t)=>{var r=ST(),i=kT(),n=TT(),o=$w(),s=$a(),h=Ew(),v=o("Object.prototype.toString"),b=PT()(),_=typeof globalThis>"u"?globalThis:globalThis,g=i(),S=o("String.prototype.slice"),x=o("Array.prototype.indexOf",!0)||function(T,P){for(var R=0;R<T.length;R+=1)if(T[R]===P)return R;return-1},M={__proto__:null};if(b&&s&&h)r(g,function(T){var P=new _[T];if(Symbol.toStringTag in P&&h){var R=h(P),C=s(R,Symbol.toStringTag);if(!C&&R){var N=h(R);C=s(N,Symbol.toStringTag)}M["$"+T]=n(C.get)}});else r(g,function(T){var P=new _[T],R=P.slice||P.set;if(R)M["$"+T]=n(R)});var I=function(T){var P=!1;return r(M,function(R,C){if(!P)try{if("$"+R(T)===C)P=S(C,1)}catch(N){}}),P},$=function(T){var P=!1;return r(M,function(R,C){if(!P)try{R(T),P=S(C,1)}catch(N){}}),P};t.exports=function(T){if(!T||typeof T!=="object")return!1;if(!b){var P=S(v(T),8,-1);if(x(g,P)>-1)return P;if(P!=="Object")return!1;return $(T)}if(!s)return null;return I(T)}}),RT=ce((e,t)=>{var r=AT();t.exports=function(i){return!!r(i)}}),CT=ce((e,t)=>{var r=Ia(),i=$w(),n=i("TypedArray.prototype.buffer",!0),o=RT();t.exports=n||function(s){if(!o(s))throw new r("Not a Typed Array");return s.buffer}}),OT=ce((e,t)=>{var r=Zr().Buffer,i=tT(),n=CT(),o=ArrayBuffer.isView||function(b){try{return n(b),!0}catch(_){return!1}},s=typeof Uint8Array<"u",h=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",v=h&&(r.prototype instanceof Uint8Array||r.TYPED_ARRAY_SUPPORT);t.exports=function(b,_){if(r.isBuffer(b)){if(b.constructor&&!("isBuffer"in b))return r.from(b);return b}if(typeof b==="string")return r.from(b,_);if(h&&o(b)){if(b.byteLength===0)return r.alloc(0);if(v){var g=r.from(b.buffer,b.byteOffset,b.byteLength);if(g.byteLength===b.byteLength)return g}var S=b instanceof Uint8Array?b:new Uint8Array(b.buffer,b.byteOffset,b.byteLength),x=r.from(S);if(x.length===b.byteLength)return x}if(s&&b instanceof Uint8Array)return r.from(b);var M=i(b);if(M)for(var I=0;I<b.length;I+=1){var $=b[I];if(typeof $!=="number"||$<0||$>255||~~$!==$)throw RangeError("Array items must be numbers in the range 0-255.")}if(M||r.isBuffer(b)&&b.constructor&&typeof b.constructor.isBuffer==="function"&&b.constructor.isBuffer(b))return r.from(b);throw TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}}),zm=ce((e,t)=>{var r=Zr().Buffer,i=OT(),n=typeof Uint8Array<"u",o=n&&typeof ArrayBuffer<"u",s=o&&ArrayBuffer.isView;t.exports=function(h,v,b){if(typeof h==="string"||r.isBuffer(h)||n&&h instanceof Uint8Array||s&&s(h))return i(h,v);throw TypeError(b+" must be a string, a Buffer, a Uint8Array, or a DataView")}}),Tw=ce((e,t)=>{var r={__proto__:null,md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,"sha512-256":32,rmd160:20,ripemd160:20},i={__proto__:null,"sha-1":"sha1","sha-224":"sha224","sha-256":"sha256","sha-384":"sha384","sha-512":"sha512","ripemd-160":"ripemd160"},n=bw(),o=Zr().Buffer,s=Rm(),h=Cm(),v=zm();function b(_,g,S,x,M){s(S,x),_=v(_,h,"Password"),g=v(g,h,"Salt");var I=(M||"sha1").toLowerCase(),$=i[I]||I,T=r[$];if(typeof T!=="number"||!T)throw TypeError("Digest algorithm not supported: "+M);var P=o.allocUnsafe(x),R=o.allocUnsafe(g.length+4);g.copy(R,0,0,g.length);var C=0,N=T,B=Math.ceil(x/N);for(var ie=1;ie<=B;ie++){R.writeUInt32BE(ie,g.length);var le=n($,_).update(R).digest(),ue=le;for(var F=1;F<S;F++){ue=n($,_).update(ue).digest();for(var ee=0;ee<N;ee++)le[ee]^=ue[ee]}le.copy(P,C),C+=N}return P}t.exports=b}),DT=ce((e,t)=>{var r=Zr().Buffer,i=Rm(),n=Cm(),o=Tw(),s=zm(),h,v=globalThis.crypto&&globalThis.crypto.subtle,b={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},_=[],g;function S(){if(g)return g;if(globalThis.process&&globalThis.process.nextTick)g=globalThis.process.nextTick;else if(globalThis.queueMicrotask)g=globalThis.queueMicrotask;else if(globalThis.setImmediate)g=globalThis.setImmediate;else g=globalThis.setTimeout;return g}function x($,T,P,R,C){return v.importKey("raw",$,{name:"PBKDF2"},!1,["deriveBits"]).then(function(N){return v.deriveBits({name:"PBKDF2",salt:T,iterations:P,hash:{name:C}},N,R<<3)}).then(function(N){return r.from(N)})}function M($){if(globalThis.process&&!globalThis.process.browser)return Promise.resolve(!1);if(!v||!v.importKey||!v.deriveBits)return Promise.resolve(!1);if(_[$]!==void 0)return _[$];h=h||r.alloc(8);var T=x(h,h,10,128,$).then(function(){return!0},function(){return!1});return _[$]=T,T}function I($,T){$.then(function(P){S()(function(){T(null,P)})},function(P){S()(function(){T(P)})})}t.exports=function($,T,P,R,C,N){if(typeof C==="function")N=C,C=void 0;if(i(P,R),$=s($,n,"Password"),T=s(T,n,"Salt"),typeof N!=="function")throw Error("No callback provided to pbkdf2");C=C||"sha1";var B=b[C.toLowerCase()];if(!B||typeof globalThis.Promise!=="function"){S()(function(){var ie;try{ie=o($,T,P,R,C)}catch(le){N(le);return}N(null,ie)});return}I(M(B).then(function(ie){if(ie)return x($,T,P,R,B);return o($,T,P,R,C)}),N)}}),Pw=ce((e)=>{var t=(Kr(),kt(dn)),r=Rm(),i=Cm(),n=zm();function o(h,v,b,_,g,S){if(r(b,_),h=n(h,i,"Password"),v=n(v,i,"Salt"),typeof g==="function")S=g,g="sha1";if(typeof S!=="function")throw Error("No callback provided to pbkdf2");return t.pbkdf2(h,v,b,_,g,S)}function s(h,v,b,_,g){return r(b,_),h=n(h,i,"Password"),v=n(v,i,"Salt"),g=g||"sha1",t.pbkdf2Sync(h,v,b,_,g)}if(!t.pbkdf2Sync||t.pbkdf2Sync.toString().indexOf("keylen, digest")===-1)e.pbkdf2Sync=Tw(),e.pbkdf2=DT();else e.pbkdf2Sync=s,e.pbkdf2=o}),NT=ce((e)=>{var t=(Kr(),kt(dn));e.createCipher=e.Cipher=t.createCipher,e.createCipheriv=e.Cipheriv=t.createCipheriv,e.createDecipher=e.Decipher=t.createDecipher,e.createDecipheriv=e.Decipheriv=t.createDecipheriv,e.listCiphers=e.getCiphers=t.getCiphers}),zT=ce((e)=>{var t=(Kr(),kt(dn));e.DiffieHellmanGroup=t.DiffieHellmanGroup,e.createDiffieHellmanGroup=t.createDiffieHellmanGroup,e.getDiffieHellman=t.getDiffieHellman,e.createDiffieHellman=t.createDiffieHellman,e.DiffieHellman=t.DiffieHellman}),jT=ce((e)=>{var t=(Kr(),kt(dn));e.createSign=t.createSign,e.Sign=t.Sign,e.createVerify=t.createVerify,e.Verify=t.Verify}),UT=ce((e,t)=>{t.exports={name:"elliptic",version:"6.6.1",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}}),ai=ce((e,t)=>{(function(r,i){function n(a,c){if(!a)throw Error(c||"Assertion failed")}function o(a,c){a.super_=c;var f=function(){};f.prototype=c.prototype,a.prototype=new f,a.prototype.constructor=a}function s(a,c,f){if(s.isBN(a))return a;if(this.negative=0,this.words=null,this.length=0,this.red=null,a!==null){if(c==="le"||c==="be")f=c,c=10;this._init(a||0,c||10,f||"be")}}if(typeof r==="object")r.exports=s;else i.BN=s;s.BN=s,s.wordSize=26;var h;try{if(typeof window<"u"&&typeof window.Buffer<"u")h=window.Buffer;else h=(Tr(),kt($r)).Buffer}catch(a){}s.isBN=function(a){if(a instanceof s)return!0;return a!==null&&typeof a==="object"&&a.constructor.wordSize===s.wordSize&&Array.isArray(a.words)},s.max=function(a,c){if(a.cmp(c)>0)return a;return c},s.min=function(a,c){if(a.cmp(c)<0)return a;return c},s.prototype._init=function(a,c,f){if(typeof a==="number")return this._initNumber(a,c,f);if(typeof a==="object")return this._initArray(a,c,f);if(c==="hex")c=16;n(c===(c|0)&&c>=2&&c<=36),a=a.toString().replace(/\s+/g,"");var l=0;if(a[0]==="-")l++,this.negative=1;if(l<a.length){if(c===16)this._parseHex(a,l,f);else if(this._parseBase(a,c,l),f==="le")this._initArray(this.toArray(),c,f)}},s.prototype._initNumber=function(a,c,f){if(a<0)this.negative=1,a=-a;if(a<67108864)this.words=[a&67108863],this.length=1;else if(a<4503599627370496)this.words=[a&67108863,a/67108864&67108863],this.length=2;else n(a<9007199254740992),this.words=[a&67108863,a/67108864&67108863,1],this.length=3;if(f!=="le")return;this._initArray(this.toArray(),c,f)},s.prototype._initArray=function(a,c,f){if(n(typeof a.length==="number"),a.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(a.length/3),this.words=Array(this.length);for(var l=0;l<this.length;l++)this.words[l]=0;var d,y,w=0;if(f==="be"){for(l=a.length-1,d=0;l>=0;l-=3)if(y=a[l]|a[l-1]<<8|a[l-2]<<16,this.words[d]|=y<<w&67108863,this.words[d+1]=y>>>26-w&67108863,w+=24,w>=26)w-=26,d++}else if(f==="le"){for(l=0,d=0;l<a.length;l+=3)if(y=a[l]|a[l+1]<<8|a[l+2]<<16,this.words[d]|=y<<w&67108863,this.words[d+1]=y>>>26-w&67108863,w+=24,w>=26)w-=26,d++}return this.strip()};function v(a,c){var f=a.charCodeAt(c);if(f>=65&&f<=70)return f-55;else if(f>=97&&f<=102)return f-87;else return f-48&15}function b(a,c,f){var l=v(a,f);if(f-1>=c)l|=v(a,f-1)<<4;return l}s.prototype._parseHex=function(a,c,f){this.length=Math.ceil((a.length-c)/6),this.words=Array(this.length);for(var l=0;l<this.length;l++)this.words[l]=0;var d=0,y=0,w;if(f==="be")for(l=a.length-1;l>=c;l-=2)if(w=b(a,c,l)<<d,this.words[y]|=w&67108863,d>=18)d-=18,y+=1,this.words[y]|=w>>>26;else d+=8;else{var p=a.length-c;for(l=p%2===0?c+1:c;l<a.length;l+=2)if(w=b(a,c,l)<<d,this.words[y]|=w&67108863,d>=18)d-=18,y+=1,this.words[y]|=w>>>26;else d+=8}this.strip()};function _(a,c,f,l){var d=0,y=Math.min(a.length,f);for(var w=c;w<y;w++){var p=a.charCodeAt(w)-48;if(d*=l,p>=49)d+=p-49+10;else if(p>=17)d+=p-17+10;else d+=p}return d}s.prototype._parseBase=function(a,c,f){this.words=[0],this.length=1;for(var l=0,d=1;d<=67108863;d*=c)l++;l--,d=d/c|0;var y=a.length-f,w=y%l,p=Math.min(y,y-w)+f,u=0;for(var m=f;m<p;m+=l)if(u=_(a,m,m+l,c),this.imuln(d),this.words[0]+u<67108864)this.words[0]+=u;else this._iaddn(u);if(w!==0){var E=1;u=_(a,m,a.length,c);for(m=0;m<w;m++)E*=c;if(this.imuln(E),this.words[0]+u<67108864)this.words[0]+=u;else this._iaddn(u)}this.strip()},s.prototype.copy=function(a){a.words=Array(this.length);for(var c=0;c<this.length;c++)a.words[c]=this.words[c];a.length=this.length,a.negative=this.negative,a.red=this.red},s.prototype.clone=function(){var a=new s(null);return this.copy(a),a},s.prototype._expand=function(a){while(this.length<a)this.words[this.length++]=0;return this},s.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},s.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},s.prototype.inspect=function(){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"],S=[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],x=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(s.prototype.toString=function(a,c){a=a||10,c=c|0||1;var f;if(a===16||a==="hex"){f="";var l=0,d=0;for(var y=0;y<this.length;y++){var w=this.words[y],p=((w<<l|d)&16777215).toString(16);if(d=w>>>24-l&16777215,l+=2,l>=26)l-=26,y--;if(d!==0||y!==this.length-1)f=g[6-p.length]+p+f;else f=p+f}if(d!==0)f=d.toString(16)+f;while(f.length%c!==0)f="0"+f;if(this.negative!==0)f="-"+f;return f}if(a===(a|0)&&a>=2&&a<=36){var u=S[a],m=x[a];f="";var E=this.clone();E.negative=0;while(!E.isZero()){var k=E.modn(m).toString(a);if(E=E.idivn(m),!E.isZero())f=g[u-k.length]+k+f;else f=k+f}if(this.isZero())f="0"+f;while(f.length%c!==0)f="0"+f;if(this.negative!==0)f="-"+f;return f}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var a=this.words[0];if(this.length===2)a+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)a+=4503599627370496+this.words[1]*67108864;else if(this.length>2)n(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-a:a},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(a,c){return n(typeof h<"u"),this.toArrayLike(h,a,c)},s.prototype.toArray=function(a,c){return this.toArrayLike(Array,a,c)},s.prototype.toArrayLike=function(a,c,f){var l=this.byteLength(),d=f||Math.max(1,l);n(l<=d,"byte array longer than desired length"),n(d>0,"Requested array length <= 0"),this.strip();var y=c==="le",w=new a(d),p,u,m=this.clone();if(!y){for(u=0;u<d-l;u++)w[u]=0;for(u=0;!m.isZero();u++)p=m.andln(255),m.iushrn(8),w[d-u-1]=p}else{for(u=0;!m.isZero();u++)p=m.andln(255),m.iushrn(8),w[u]=p;for(;u<d;u++)w[u]=0}return w},Math.clz32)s.prototype._countBits=function(a){return 32-Math.clz32(a)};else s.prototype._countBits=function(a){var c=a,f=0;if(c>=4096)f+=13,c>>>=13;if(c>=64)f+=7,c>>>=7;if(c>=8)f+=4,c>>>=4;if(c>=2)f+=2,c>>>=2;return f+c};s.prototype._zeroBits=function(a){if(a===0)return 26;var c=a,f=0;if((c&8191)===0)f+=13,c>>>=13;if((c&127)===0)f+=7,c>>>=7;if((c&15)===0)f+=4,c>>>=4;if((c&3)===0)f+=2,c>>>=2;if((c&1)===0)f++;return f},s.prototype.bitLength=function(){var a=this.words[this.length-1],c=this._countBits(a);return(this.length-1)*26+c};function M(a){var c=Array(a.bitLength());for(var f=0;f<c.length;f++){var l=f/26|0,d=f%26;c[f]=(a.words[l]&1<<d)>>>d}return c}s.prototype.zeroBits=function(){if(this.isZero())return 0;var a=0;for(var c=0;c<this.length;c++){var f=this._zeroBits(this.words[c]);if(a+=f,f!==26)break}return a},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(a){if(this.negative!==0)return this.abs().inotn(a).iaddn(1);return this.clone()},s.prototype.fromTwos=function(a){if(this.testn(a-1))return this.notn(a).iaddn(1).ineg();return this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},s.prototype.iuor=function(a){while(this.length<a.length)this.words[this.length++]=0;for(var c=0;c<a.length;c++)this.words[c]=this.words[c]|a.words[c];return this.strip()},s.prototype.ior=function(a){return n((this.negative|a.negative)===0),this.iuor(a)},s.prototype.or=function(a){if(this.length>a.length)return this.clone().ior(a);return a.clone().ior(this)},s.prototype.uor=function(a){if(this.length>a.length)return this.clone().iuor(a);return a.clone().iuor(this)},s.prototype.iuand=function(a){var c;if(this.length>a.length)c=a;else c=this;for(var f=0;f<c.length;f++)this.words[f]=this.words[f]&a.words[f];return this.length=c.length,this.strip()},s.prototype.iand=function(a){return n((this.negative|a.negative)===0),this.iuand(a)},s.prototype.and=function(a){if(this.length>a.length)return this.clone().iand(a);return a.clone().iand(this)},s.prototype.uand=function(a){if(this.length>a.length)return this.clone().iuand(a);return a.clone().iuand(this)},s.prototype.iuxor=function(a){var c,f;if(this.length>a.length)c=this,f=a;else c=a,f=this;for(var l=0;l<f.length;l++)this.words[l]=c.words[l]^f.words[l];if(this!==c)for(;l<c.length;l++)this.words[l]=c.words[l];return this.length=c.length,this.strip()},s.prototype.ixor=function(a){return n((this.negative|a.negative)===0),this.iuxor(a)},s.prototype.xor=function(a){if(this.length>a.length)return this.clone().ixor(a);return a.clone().ixor(this)},s.prototype.uxor=function(a){if(this.length>a.length)return this.clone().iuxor(a);return a.clone().iuxor(this)},s.prototype.inotn=function(a){n(typeof a==="number"&&a>=0);var c=Math.ceil(a/26)|0,f=a%26;if(this._expand(c),f>0)c--;for(var l=0;l<c;l++)this.words[l]=~this.words[l]&67108863;if(f>0)this.words[l]=~this.words[l]&67108863>>26-f;return this.strip()},s.prototype.notn=function(a){return this.clone().inotn(a)},s.prototype.setn=function(a,c){n(typeof a==="number"&&a>=0);var f=a/26|0,l=a%26;if(this._expand(f+1),c)this.words[f]=this.words[f]|1<<l;else this.words[f]=this.words[f]&~(1<<l);return this.strip()},s.prototype.iadd=function(a){var c;if(this.negative!==0&&a.negative===0)return this.negative=0,c=this.isub(a),this.negative^=1,this._normSign();else if(this.negative===0&&a.negative!==0)return a.negative=0,c=this.isub(a),a.negative=1,c._normSign();var f,l;if(this.length>a.length)f=this,l=a;else f=a,l=this;var d=0;for(var y=0;y<l.length;y++)c=(f.words[y]|0)+(l.words[y]|0)+d,this.words[y]=c&67108863,d=c>>>26;for(;d!==0&&y<f.length;y++)c=(f.words[y]|0)+d,this.words[y]=c&67108863,d=c>>>26;if(this.length=f.length,d!==0)this.words[this.length]=d,this.length++;else if(f!==this)for(;y<f.length;y++)this.words[y]=f.words[y];return this},s.prototype.add=function(a){var c;if(a.negative!==0&&this.negative===0)return a.negative=0,c=this.sub(a),a.negative^=1,c;else if(a.negative===0&&this.negative!==0)return this.negative=0,c=a.sub(this),this.negative=1,c;if(this.length>a.length)return this.clone().iadd(a);return a.clone().iadd(this)},s.prototype.isub=function(a){if(a.negative!==0){a.negative=0;var c=this.iadd(a);return a.negative=1,c._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(a),this.negative=1,this._normSign();var f=this.cmp(a);if(f===0)return this.negative=0,this.length=1,this.words[0]=0,this;var l,d;if(f>0)l=this,d=a;else l=a,d=this;var y=0;for(var w=0;w<d.length;w++)c=(l.words[w]|0)-(d.words[w]|0)+y,y=c>>26,this.words[w]=c&67108863;for(;y!==0&&w<l.length;w++)c=(l.words[w]|0)+y,y=c>>26,this.words[w]=c&67108863;if(y===0&&w<l.length&&l!==this)for(;w<l.length;w++)this.words[w]=l.words[w];if(this.length=Math.max(this.length,w),l!==this)this.negative=1;return this.strip()},s.prototype.sub=function(a){return this.clone().isub(a)};function I(a,c,f){f.negative=c.negative^a.negative;var l=a.length+c.length|0;f.length=l,l=l-1|0;var d=a.words[0]|0,y=c.words[0]|0,w=d*y,p=w&67108863,u=w/67108864|0;f.words[0]=p;for(var m=1;m<l;m++){var E=u>>>26,k=u&67108863,A=Math.min(m,c.length-1);for(var D=Math.max(0,m-a.length+1);D<=A;D++){var U=m-D|0;d=a.words[U]|0,y=c.words[D]|0,w=d*y+k,E+=w/67108864|0,k=w&67108863}f.words[m]=k|0,u=E|0}if(u!==0)f.words[m]=u|0;else f.length--;return f.strip()}var $=function(a,c,f){var l=a.words,d=c.words,y=f.words,w=0,p,u,m,E=l[0]|0,k=E&8191,A=E>>>13,D=l[1]|0,U=D&8191,K=D>>>13,he=l[2]|0,J=he&8191,H=he>>>13,se=l[3]|0,V=se&8191,Q=se>>>13,He=l[4]|0,z=He&8191,L=He>>>13,ae=l[5]|0,G=ae&8191,Y=ae>>>13,Me=l[6]|0,j=Me&8191,Z=Me>>>13,je=l[7]|0,W=je&8191,re=je>>>13,at=l[8]|0,ge=at&8191,ye=at>>>13,Gt=l[9]|0,pe=Gt&8191,ve=Gt>>>13,tr=d[0]|0,xe=tr&8191,Se=tr>>>13,zr=d[1]|0,Ee=zr&8191,Re=zr>>>13,jr=d[2]|0,Ce=jr&8191,Ie=jr>>>13,Pr=d[3]|0,Oe=Pr&8191,$e=Pr>>>13,kr=d[4]|0,De=kr&8191,Ne=kr>>>13,Mr=d[5]|0,Te=Mr&8191,O=Mr>>>13,q=d[6]|0,X=q&8191,te=q>>>13,Ge=d[7]|0,me=Ge&8191,we=Ge>>>13,Jt=d[8]|0,Pe=Jt&8191,ze=Jt>>>13,Ar=d[9]|0,Ae=Ar&8191,ke=Ar>>>13;f.negative=a.negative^c.negative,f.length=19,p=Math.imul(k,xe),u=Math.imul(k,Se),u=u+Math.imul(A,xe)|0,m=Math.imul(A,Se);var Xt=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,p=Math.imul(U,xe),u=Math.imul(U,Se),u=u+Math.imul(K,xe)|0,m=Math.imul(K,Se),p=p+Math.imul(k,Ee)|0,u=u+Math.imul(k,Re)|0,u=u+Math.imul(A,Ee)|0,m=m+Math.imul(A,Re)|0;var mt=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(mt>>>26)|0,mt&=67108863,p=Math.imul(J,xe),u=Math.imul(J,Se),u=u+Math.imul(H,xe)|0,m=Math.imul(H,Se),p=p+Math.imul(U,Ee)|0,u=u+Math.imul(U,Re)|0,u=u+Math.imul(K,Ee)|0,m=m+Math.imul(K,Re)|0,p=p+Math.imul(k,Ce)|0,u=u+Math.imul(k,Ie)|0,u=u+Math.imul(A,Ce)|0,m=m+Math.imul(A,Ie)|0;var ft=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(ft>>>26)|0,ft&=67108863,p=Math.imul(V,xe),u=Math.imul(V,Se),u=u+Math.imul(Q,xe)|0,m=Math.imul(Q,Se),p=p+Math.imul(J,Ee)|0,u=u+Math.imul(J,Re)|0,u=u+Math.imul(H,Ee)|0,m=m+Math.imul(H,Re)|0,p=p+Math.imul(U,Ce)|0,u=u+Math.imul(U,Ie)|0,u=u+Math.imul(K,Ce)|0,m=m+Math.imul(K,Ie)|0,p=p+Math.imul(k,Oe)|0,u=u+Math.imul(k,$e)|0,u=u+Math.imul(A,Oe)|0,m=m+Math.imul(A,$e)|0;var zt=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(zt>>>26)|0,zt&=67108863,p=Math.imul(z,xe),u=Math.imul(z,Se),u=u+Math.imul(L,xe)|0,m=Math.imul(L,Se),p=p+Math.imul(V,Ee)|0,u=u+Math.imul(V,Re)|0,u=u+Math.imul(Q,Ee)|0,m=m+Math.imul(Q,Re)|0,p=p+Math.imul(J,Ce)|0,u=u+Math.imul(J,Ie)|0,u=u+Math.imul(H,Ce)|0,m=m+Math.imul(H,Ie)|0,p=p+Math.imul(U,Oe)|0,u=u+Math.imul(U,$e)|0,u=u+Math.imul(K,Oe)|0,m=m+Math.imul(K,$e)|0,p=p+Math.imul(k,De)|0,u=u+Math.imul(k,Ne)|0,u=u+Math.imul(A,De)|0,m=m+Math.imul(A,Ne)|0;var At=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(At>>>26)|0,At&=67108863,p=Math.imul(G,xe),u=Math.imul(G,Se),u=u+Math.imul(Y,xe)|0,m=Math.imul(Y,Se),p=p+Math.imul(z,Ee)|0,u=u+Math.imul(z,Re)|0,u=u+Math.imul(L,Ee)|0,m=m+Math.imul(L,Re)|0,p=p+Math.imul(V,Ce)|0,u=u+Math.imul(V,Ie)|0,u=u+Math.imul(Q,Ce)|0,m=m+Math.imul(Q,Ie)|0,p=p+Math.imul(J,Oe)|0,u=u+Math.imul(J,$e)|0,u=u+Math.imul(H,Oe)|0,m=m+Math.imul(H,$e)|0,p=p+Math.imul(U,De)|0,u=u+Math.imul(U,Ne)|0,u=u+Math.imul(K,De)|0,m=m+Math.imul(K,Ne)|0,p=p+Math.imul(k,Te)|0,u=u+Math.imul(k,O)|0,u=u+Math.imul(A,Te)|0,m=m+Math.imul(A,O)|0;var sr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(sr>>>26)|0,sr&=67108863,p=Math.imul(j,xe),u=Math.imul(j,Se),u=u+Math.imul(Z,xe)|0,m=Math.imul(Z,Se),p=p+Math.imul(G,Ee)|0,u=u+Math.imul(G,Re)|0,u=u+Math.imul(Y,Ee)|0,m=m+Math.imul(Y,Re)|0,p=p+Math.imul(z,Ce)|0,u=u+Math.imul(z,Ie)|0,u=u+Math.imul(L,Ce)|0,m=m+Math.imul(L,Ie)|0,p=p+Math.imul(V,Oe)|0,u=u+Math.imul(V,$e)|0,u=u+Math.imul(Q,Oe)|0,m=m+Math.imul(Q,$e)|0,p=p+Math.imul(J,De)|0,u=u+Math.imul(J,Ne)|0,u=u+Math.imul(H,De)|0,m=m+Math.imul(H,Ne)|0,p=p+Math.imul(U,Te)|0,u=u+Math.imul(U,O)|0,u=u+Math.imul(K,Te)|0,m=m+Math.imul(K,O)|0,p=p+Math.imul(k,X)|0,u=u+Math.imul(k,te)|0,u=u+Math.imul(A,X)|0,m=m+Math.imul(A,te)|0;var ar=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(ar>>>26)|0,ar&=67108863,p=Math.imul(W,xe),u=Math.imul(W,Se),u=u+Math.imul(re,xe)|0,m=Math.imul(re,Se),p=p+Math.imul(j,Ee)|0,u=u+Math.imul(j,Re)|0,u=u+Math.imul(Z,Ee)|0,m=m+Math.imul(Z,Re)|0,p=p+Math.imul(G,Ce)|0,u=u+Math.imul(G,Ie)|0,u=u+Math.imul(Y,Ce)|0,m=m+Math.imul(Y,Ie)|0,p=p+Math.imul(z,Oe)|0,u=u+Math.imul(z,$e)|0,u=u+Math.imul(L,Oe)|0,m=m+Math.imul(L,$e)|0,p=p+Math.imul(V,De)|0,u=u+Math.imul(V,Ne)|0,u=u+Math.imul(Q,De)|0,m=m+Math.imul(Q,Ne)|0,p=p+Math.imul(J,Te)|0,u=u+Math.imul(J,O)|0,u=u+Math.imul(H,Te)|0,m=m+Math.imul(H,O)|0,p=p+Math.imul(U,X)|0,u=u+Math.imul(U,te)|0,u=u+Math.imul(K,X)|0,m=m+Math.imul(K,te)|0,p=p+Math.imul(k,me)|0,u=u+Math.imul(k,we)|0,u=u+Math.imul(A,me)|0,m=m+Math.imul(A,we)|0;var ur=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(ur>>>26)|0,ur&=67108863,p=Math.imul(ge,xe),u=Math.imul(ge,Se),u=u+Math.imul(ye,xe)|0,m=Math.imul(ye,Se),p=p+Math.imul(W,Ee)|0,u=u+Math.imul(W,Re)|0,u=u+Math.imul(re,Ee)|0,m=m+Math.imul(re,Re)|0,p=p+Math.imul(j,Ce)|0,u=u+Math.imul(j,Ie)|0,u=u+Math.imul(Z,Ce)|0,m=m+Math.imul(Z,Ie)|0,p=p+Math.imul(G,Oe)|0,u=u+Math.imul(G,$e)|0,u=u+Math.imul(Y,Oe)|0,m=m+Math.imul(Y,$e)|0,p=p+Math.imul(z,De)|0,u=u+Math.imul(z,Ne)|0,u=u+Math.imul(L,De)|0,m=m+Math.imul(L,Ne)|0,p=p+Math.imul(V,Te)|0,u=u+Math.imul(V,O)|0,u=u+Math.imul(Q,Te)|0,m=m+Math.imul(Q,O)|0,p=p+Math.imul(J,X)|0,u=u+Math.imul(J,te)|0,u=u+Math.imul(H,X)|0,m=m+Math.imul(H,te)|0,p=p+Math.imul(U,me)|0,u=u+Math.imul(U,we)|0,u=u+Math.imul(K,me)|0,m=m+Math.imul(K,we)|0,p=p+Math.imul(k,Pe)|0,u=u+Math.imul(k,ze)|0,u=u+Math.imul(A,Pe)|0,m=m+Math.imul(A,ze)|0;var lr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(lr>>>26)|0,lr&=67108863,p=Math.imul(pe,xe),u=Math.imul(pe,Se),u=u+Math.imul(ve,xe)|0,m=Math.imul(ve,Se),p=p+Math.imul(ge,Ee)|0,u=u+Math.imul(ge,Re)|0,u=u+Math.imul(ye,Ee)|0,m=m+Math.imul(ye,Re)|0,p=p+Math.imul(W,Ce)|0,u=u+Math.imul(W,Ie)|0,u=u+Math.imul(re,Ce)|0,m=m+Math.imul(re,Ie)|0,p=p+Math.imul(j,Oe)|0,u=u+Math.imul(j,$e)|0,u=u+Math.imul(Z,Oe)|0,m=m+Math.imul(Z,$e)|0,p=p+Math.imul(G,De)|0,u=u+Math.imul(G,Ne)|0,u=u+Math.imul(Y,De)|0,m=m+Math.imul(Y,Ne)|0,p=p+Math.imul(z,Te)|0,u=u+Math.imul(z,O)|0,u=u+Math.imul(L,Te)|0,m=m+Math.imul(L,O)|0,p=p+Math.imul(V,X)|0,u=u+Math.imul(V,te)|0,u=u+Math.imul(Q,X)|0,m=m+Math.imul(Q,te)|0,p=p+Math.imul(J,me)|0,u=u+Math.imul(J,we)|0,u=u+Math.imul(H,me)|0,m=m+Math.imul(H,we)|0,p=p+Math.imul(U,Pe)|0,u=u+Math.imul(U,ze)|0,u=u+Math.imul(K,Pe)|0,m=m+Math.imul(K,ze)|0,p=p+Math.imul(k,Ae)|0,u=u+Math.imul(k,ke)|0,u=u+Math.imul(A,Ae)|0,m=m+Math.imul(A,ke)|0;var cr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(cr>>>26)|0,cr&=67108863,p=Math.imul(pe,Ee),u=Math.imul(pe,Re),u=u+Math.imul(ve,Ee)|0,m=Math.imul(ve,Re),p=p+Math.imul(ge,Ce)|0,u=u+Math.imul(ge,Ie)|0,u=u+Math.imul(ye,Ce)|0,m=m+Math.imul(ye,Ie)|0,p=p+Math.imul(W,Oe)|0,u=u+Math.imul(W,$e)|0,u=u+Math.imul(re,Oe)|0,m=m+Math.imul(re,$e)|0,p=p+Math.imul(j,De)|0,u=u+Math.imul(j,Ne)|0,u=u+Math.imul(Z,De)|0,m=m+Math.imul(Z,Ne)|0,p=p+Math.imul(G,Te)|0,u=u+Math.imul(G,O)|0,u=u+Math.imul(Y,Te)|0,m=m+Math.imul(Y,O)|0,p=p+Math.imul(z,X)|0,u=u+Math.imul(z,te)|0,u=u+Math.imul(L,X)|0,m=m+Math.imul(L,te)|0,p=p+Math.imul(V,me)|0,u=u+Math.imul(V,we)|0,u=u+Math.imul(Q,me)|0,m=m+Math.imul(Q,we)|0,p=p+Math.imul(J,Pe)|0,u=u+Math.imul(J,ze)|0,u=u+Math.imul(H,Pe)|0,m=m+Math.imul(H,ze)|0,p=p+Math.imul(U,Ae)|0,u=u+Math.imul(U,ke)|0,u=u+Math.imul(K,Ae)|0,m=m+Math.imul(K,ke)|0;var dr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(dr>>>26)|0,dr&=67108863,p=Math.imul(pe,Ce),u=Math.imul(pe,Ie),u=u+Math.imul(ve,Ce)|0,m=Math.imul(ve,Ie),p=p+Math.imul(ge,Oe)|0,u=u+Math.imul(ge,$e)|0,u=u+Math.imul(ye,Oe)|0,m=m+Math.imul(ye,$e)|0,p=p+Math.imul(W,De)|0,u=u+Math.imul(W,Ne)|0,u=u+Math.imul(re,De)|0,m=m+Math.imul(re,Ne)|0,p=p+Math.imul(j,Te)|0,u=u+Math.imul(j,O)|0,u=u+Math.imul(Z,Te)|0,m=m+Math.imul(Z,O)|0,p=p+Math.imul(G,X)|0,u=u+Math.imul(G,te)|0,u=u+Math.imul(Y,X)|0,m=m+Math.imul(Y,te)|0,p=p+Math.imul(z,me)|0,u=u+Math.imul(z,we)|0,u=u+Math.imul(L,me)|0,m=m+Math.imul(L,we)|0,p=p+Math.imul(V,Pe)|0,u=u+Math.imul(V,ze)|0,u=u+Math.imul(Q,Pe)|0,m=m+Math.imul(Q,ze)|0,p=p+Math.imul(J,Ae)|0,u=u+Math.imul(J,ke)|0,u=u+Math.imul(H,Ae)|0,m=m+Math.imul(H,ke)|0;var fr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(fr>>>26)|0,fr&=67108863,p=Math.imul(pe,Oe),u=Math.imul(pe,$e),u=u+Math.imul(ve,Oe)|0,m=Math.imul(ve,$e),p=p+Math.imul(ge,De)|0,u=u+Math.imul(ge,Ne)|0,u=u+Math.imul(ye,De)|0,m=m+Math.imul(ye,Ne)|0,p=p+Math.imul(W,Te)|0,u=u+Math.imul(W,O)|0,u=u+Math.imul(re,Te)|0,m=m+Math.imul(re,O)|0,p=p+Math.imul(j,X)|0,u=u+Math.imul(j,te)|0,u=u+Math.imul(Z,X)|0,m=m+Math.imul(Z,te)|0,p=p+Math.imul(G,me)|0,u=u+Math.imul(G,we)|0,u=u+Math.imul(Y,me)|0,m=m+Math.imul(Y,we)|0,p=p+Math.imul(z,Pe)|0,u=u+Math.imul(z,ze)|0,u=u+Math.imul(L,Pe)|0,m=m+Math.imul(L,ze)|0,p=p+Math.imul(V,Ae)|0,u=u+Math.imul(V,ke)|0,u=u+Math.imul(Q,Ae)|0,m=m+Math.imul(Q,ke)|0;var hr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(hr>>>26)|0,hr&=67108863,p=Math.imul(pe,De),u=Math.imul(pe,Ne),u=u+Math.imul(ve,De)|0,m=Math.imul(ve,Ne),p=p+Math.imul(ge,Te)|0,u=u+Math.imul(ge,O)|0,u=u+Math.imul(ye,Te)|0,m=m+Math.imul(ye,O)|0,p=p+Math.imul(W,X)|0,u=u+Math.imul(W,te)|0,u=u+Math.imul(re,X)|0,m=m+Math.imul(re,te)|0,p=p+Math.imul(j,me)|0,u=u+Math.imul(j,we)|0,u=u+Math.imul(Z,me)|0,m=m+Math.imul(Z,we)|0,p=p+Math.imul(G,Pe)|0,u=u+Math.imul(G,ze)|0,u=u+Math.imul(Y,Pe)|0,m=m+Math.imul(Y,ze)|0,p=p+Math.imul(z,Ae)|0,u=u+Math.imul(z,ke)|0,u=u+Math.imul(L,Ae)|0,m=m+Math.imul(L,ke)|0;var pr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(pr>>>26)|0,pr&=67108863,p=Math.imul(pe,Te),u=Math.imul(pe,O),u=u+Math.imul(ve,Te)|0,m=Math.imul(ve,O),p=p+Math.imul(ge,X)|0,u=u+Math.imul(ge,te)|0,u=u+Math.imul(ye,X)|0,m=m+Math.imul(ye,te)|0,p=p+Math.imul(W,me)|0,u=u+Math.imul(W,we)|0,u=u+Math.imul(re,me)|0,m=m+Math.imul(re,we)|0,p=p+Math.imul(j,Pe)|0,u=u+Math.imul(j,ze)|0,u=u+Math.imul(Z,Pe)|0,m=m+Math.imul(Z,ze)|0,p=p+Math.imul(G,Ae)|0,u=u+Math.imul(G,ke)|0,u=u+Math.imul(Y,Ae)|0,m=m+Math.imul(Y,ke)|0;var mr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(mr>>>26)|0,mr&=67108863,p=Math.imul(pe,X),u=Math.imul(pe,te),u=u+Math.imul(ve,X)|0,m=Math.imul(ve,te),p=p+Math.imul(ge,me)|0,u=u+Math.imul(ge,we)|0,u=u+Math.imul(ye,me)|0,m=m+Math.imul(ye,we)|0,p=p+Math.imul(W,Pe)|0,u=u+Math.imul(W,ze)|0,u=u+Math.imul(re,Pe)|0,m=m+Math.imul(re,ze)|0,p=p+Math.imul(j,Ae)|0,u=u+Math.imul(j,ke)|0,u=u+Math.imul(Z,Ae)|0,m=m+Math.imul(Z,ke)|0;var gr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(gr>>>26)|0,gr&=67108863,p=Math.imul(pe,me),u=Math.imul(pe,we),u=u+Math.imul(ve,me)|0,m=Math.imul(ve,we),p=p+Math.imul(ge,Pe)|0,u=u+Math.imul(ge,ze)|0,u=u+Math.imul(ye,Pe)|0,m=m+Math.imul(ye,ze)|0,p=p+Math.imul(W,Ae)|0,u=u+Math.imul(W,ke)|0,u=u+Math.imul(re,Ae)|0,m=m+Math.imul(re,ke)|0;var yr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(yr>>>26)|0,yr&=67108863,p=Math.imul(pe,Pe),u=Math.imul(pe,ze),u=u+Math.imul(ve,Pe)|0,m=Math.imul(ve,ze),p=p+Math.imul(ge,Ae)|0,u=u+Math.imul(ge,ke)|0,u=u+Math.imul(ye,Ae)|0,m=m+Math.imul(ye,ke)|0;var vr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(vr>>>26)|0,vr&=67108863,p=Math.imul(pe,Ae),u=Math.imul(pe,ke),u=u+Math.imul(ve,Ae)|0,m=Math.imul(ve,ke);var br=(w+p|0)+((u&8191)<<13)|0;if(w=(m+(u>>>13)|0)+(br>>>26)|0,br&=67108863,y[0]=Xt,y[1]=mt,y[2]=ft,y[3]=zt,y[4]=At,y[5]=sr,y[6]=ar,y[7]=ur,y[8]=lr,y[9]=cr,y[10]=dr,y[11]=fr,y[12]=hr,y[13]=pr,y[14]=mr,y[15]=gr,y[16]=yr,y[17]=vr,y[18]=br,w!==0)y[19]=w,f.length++;return f};if(!Math.imul)$=I;function T(a,c,f){f.negative=c.negative^a.negative,f.length=a.length+c.length;var l=0,d=0;for(var y=0;y<f.length-1;y++){var w=d;d=0;var p=l&67108863,u=Math.min(y,c.length-1);for(var m=Math.max(0,y-a.length+1);m<=u;m++){var E=y-m,k=a.words[E]|0,A=c.words[m]|0,D=k*A,U=D&67108863;w=w+(D/67108864|0)|0,U=U+p|0,p=U&67108863,w=w+(U>>>26)|0,d+=w>>>26,w&=67108863}f.words[y]=p,l=w,w=d}if(l!==0)f.words[y]=l;else f.length--;return f.strip()}function P(a,c,f){var l=new R;return l.mulp(a,c,f)}s.prototype.mulTo=function(a,c){var f,l=this.length+a.length;if(this.length===10&&a.length===10)f=$(this,a,c);else if(l<63)f=I(this,a,c);else if(l<1024)f=T(this,a,c);else f=P(this,a,c);return f};function R(a,c){this.x=a,this.y=c}R.prototype.makeRBT=function(a){var c=Array(a),f=s.prototype._countBits(a)-1;for(var l=0;l<a;l++)c[l]=this.revBin(l,f,a);return c},R.prototype.revBin=function(a,c,f){if(a===0||a===f-1)return a;var l=0;for(var d=0;d<c;d++)l|=(a&1)<<c-d-1,a>>=1;return l},R.prototype.permute=function(a,c,f,l,d,y){for(var w=0;w<y;w++)l[w]=c[a[w]],d[w]=f[a[w]]},R.prototype.transform=function(a,c,f,l,d,y){this.permute(y,a,c,f,l,d);for(var w=1;w<d;w<<=1){var p=w<<1,u=Math.cos(2*Math.PI/p),m=Math.sin(2*Math.PI/p);for(var E=0;E<d;E+=p){var k=u,A=m;for(var D=0;D<w;D++){var U=f[E+D],K=l[E+D],he=f[E+D+w],J=l[E+D+w],H=k*he-A*J;if(J=k*J+A*he,he=H,f[E+D]=U+he,l[E+D]=K+J,f[E+D+w]=U-he,l[E+D+w]=K-J,D!==p)H=u*k-m*A,A=u*A+m*k,k=H}}}},R.prototype.guessLen13b=function(a,c){var f=Math.max(c,a)|1,l=f&1,d=0;for(f=f/2|0;f;f=f>>>1)d++;return 1<<d+1+l},R.prototype.conjugate=function(a,c,f){if(f<=1)return;for(var l=0;l<f/2;l++){var d=a[l];a[l]=a[f-l-1],a[f-l-1]=d,d=c[l],c[l]=-c[f-l-1],c[f-l-1]=-d}},R.prototype.normalize13b=function(a,c){var f=0;for(var l=0;l<c/2;l++){var d=Math.round(a[2*l+1]/c)*8192+Math.round(a[2*l]/c)+f;if(a[l]=d&67108863,d<67108864)f=0;else f=d/67108864|0}return a},R.prototype.convert13b=function(a,c,f,l){var d=0;for(var y=0;y<c;y++)d=d+(a[y]|0),f[2*y]=d&8191,d=d>>>13,f[2*y+1]=d&8191,d=d>>>13;for(y=2*c;y<l;++y)f[y]=0;n(d===0),n((d&-8192)===0)},R.prototype.stub=function(a){var c=Array(a);for(var f=0;f<a;f++)c[f]=0;return c},R.prototype.mulp=function(a,c,f){var l=2*this.guessLen13b(a.length,c.length),d=this.makeRBT(l),y=this.stub(l),w=Array(l),p=Array(l),u=Array(l),m=Array(l),E=Array(l),k=Array(l),A=f.words;A.length=l,this.convert13b(a.words,a.length,w,l),this.convert13b(c.words,c.length,m,l),this.transform(w,y,p,u,l,d),this.transform(m,y,E,k,l,d);for(var D=0;D<l;D++){var U=p[D]*E[D]-u[D]*k[D];u[D]=p[D]*k[D]+u[D]*E[D],p[D]=U}return this.conjugate(p,u,l),this.transform(p,u,A,y,l,d),this.conjugate(A,y,l),this.normalize13b(A,l),f.negative=a.negative^c.negative,f.length=a.length+c.length,f.strip()},s.prototype.mul=function(a){var c=new s(null);return c.words=Array(this.length+a.length),this.mulTo(a,c)},s.prototype.mulf=function(a){var c=new s(null);return c.words=Array(this.length+a.length),P(this,a,c)},s.prototype.imul=function(a){return this.clone().mulTo(a,this)},s.prototype.imuln=function(a){n(typeof a==="number"),n(a<67108864);var c=0;for(var f=0;f<this.length;f++){var l=(this.words[f]|0)*a,d=(l&67108863)+(c&67108863);c>>=26,c+=l/67108864|0,c+=d>>>26,this.words[f]=d&67108863}if(c!==0)this.words[f]=c,this.length++;return this.length=a===0?1:this.length,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 c=M(a);if(c.length===0)return new s(1);var f=this;for(var l=0;l<c.length;l++,f=f.sqr())if(c[l]!==0)break;if(++l<c.length)for(var d=f.sqr();l<c.length;l++,d=d.sqr()){if(c[l]===0)continue;f=f.mul(d)}return f},s.prototype.iushln=function(a){n(typeof a==="number"&&a>=0);var c=a%26,f=(a-c)/26,l=67108863>>>26-c<<26-c,d;if(c!==0){var y=0;for(d=0;d<this.length;d++){var w=this.words[d]&l,p=(this.words[d]|0)-w<<c;this.words[d]=p|y,y=w>>>26-c}if(y)this.words[d]=y,this.length++}if(f!==0){for(d=this.length-1;d>=0;d--)this.words[d+f]=this.words[d];for(d=0;d<f;d++)this.words[d]=0;this.length+=f}return this.strip()},s.prototype.ishln=function(a){return n(this.negative===0),this.iushln(a)},s.prototype.iushrn=function(a,c,f){n(typeof a==="number"&&a>=0);var l;if(c)l=(c-c%26)/26;else l=0;var d=a%26,y=Math.min((a-d)/26,this.length),w=67108863^67108863>>>d<<d,p=f;if(l-=y,l=Math.max(0,l),p){for(var u=0;u<y;u++)p.words[u]=this.words[u];p.length=y}if(y===0);else if(this.length>y){this.length-=y;for(u=0;u<this.length;u++)this.words[u]=this.words[u+y]}else this.words[0]=0,this.length=1;var m=0;for(u=this.length-1;u>=0&&(m!==0||u>=l);u--){var E=this.words[u]|0;this.words[u]=m<<26-d|E>>>d,m=E&w}if(p&&m!==0)p.words[p.length++]=m;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},s.prototype.ishrn=function(a,c,f){return n(this.negative===0),this.iushrn(a,c,f)},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){n(typeof a==="number"&&a>=0);var c=a%26,f=(a-c)/26,l=1<<c;if(this.length<=f)return!1;var d=this.words[f];return!!(d&l)},s.prototype.imaskn=function(a){n(typeof a==="number"&&a>=0);var c=a%26,f=(a-c)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=f)return this;if(c!==0)f++;if(this.length=Math.min(f,this.length),c!==0){var l=67108863^67108863>>>c<<c;this.words[this.length-1]&=l}return this.strip()},s.prototype.maskn=function(a){return this.clone().imaskn(a)},s.prototype.iaddn=function(a){if(n(typeof a==="number"),n(a<67108864),a<0)return this.isubn(-a);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<a)return this.words[0]=a-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(a),this.negative=1,this}return this._iaddn(a)},s.prototype._iaddn=function(a){this.words[0]+=a;for(var c=0;c<this.length&&this.words[c]>=67108864;c++)if(this.words[c]-=67108864,c===this.length-1)this.words[c+1]=1;else this.words[c+1]++;return this.length=Math.max(this.length,c+1),this},s.prototype.isubn=function(a){if(n(typeof a==="number"),n(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 c=0;c<this.length&&this.words[c]<0;c++)this.words[c]+=67108864,this.words[c+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,c,f){var l=a.length+f,d;this._expand(l);var y,w=0;for(d=0;d<a.length;d++){y=(this.words[d+f]|0)+w;var p=(a.words[d]|0)*c;y-=p&67108863,w=(y>>26)-(p/67108864|0),this.words[d+f]=y&67108863}for(;d<this.length-f;d++)y=(this.words[d+f]|0)+w,w=y>>26,this.words[d+f]=y&67108863;if(w===0)return this.strip();n(w===-1),w=0;for(d=0;d<this.length;d++)y=-(this.words[d]|0)+w,w=y>>26,this.words[d]=y&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(a,c){var f=this.length-a.length,l=this.clone(),d=a,y=d.words[d.length-1]|0,w=this._countBits(y);if(f=26-w,f!==0)d=d.ushln(f),l.iushln(f),y=d.words[d.length-1]|0;var p=l.length-d.length,u;if(c!=="mod"){u=new s(null),u.length=p+1,u.words=Array(u.length);for(var m=0;m<u.length;m++)u.words[m]=0}var E=l.clone()._ishlnsubmul(d,1,p);if(E.negative===0){if(l=E,u)u.words[p]=1}for(var k=p-1;k>=0;k--){var A=(l.words[d.length+k]|0)*67108864+(l.words[d.length+k-1]|0);A=Math.min(A/y|0,67108863),l._ishlnsubmul(d,A,k);while(l.negative!==0)if(A--,l.negative=0,l._ishlnsubmul(d,1,k),!l.isZero())l.negative^=1;if(u)u.words[k]=A}if(u)u.strip();if(l.strip(),c!=="div"&&f!==0)l.iushrn(f);return{div:u||null,mod:l}},s.prototype.divmod=function(a,c,f){if(n(!a.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var l,d,y;if(this.negative!==0&&a.negative===0){if(y=this.neg().divmod(a,c),c!=="mod")l=y.div.neg();if(c!=="div"){if(d=y.mod.neg(),f&&d.negative!==0)d.iadd(a)}return{div:l,mod:d}}if(this.negative===0&&a.negative!==0){if(y=this.divmod(a.neg(),c),c!=="mod")l=y.div.neg();return{div:l,mod:y.mod}}if((this.negative&a.negative)!==0){if(y=this.neg().divmod(a.neg(),c),c!=="div"){if(d=y.mod.neg(),f&&d.negative!==0)d.isub(a)}return{div:y.div,mod:d}}if(a.length>this.length||this.cmp(a)<0)return{div:new s(0),mod:this};if(a.length===1){if(c==="div")return{div:this.divn(a.words[0]),mod:null};if(c==="mod")return{div:null,mod:new s(this.modn(a.words[0]))};return{div:this.divn(a.words[0]),mod:new s(this.modn(a.words[0]))}}return this._wordDiv(a,c)},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 c=this.divmod(a);if(c.mod.isZero())return c.div;var f=c.div.negative!==0?c.mod.isub(a):c.mod,l=a.ushrn(1),d=a.andln(1),y=f.cmp(l);if(y<0||d===1&&y===0)return c.div;return c.div.negative!==0?c.div.isubn(1):c.div.iaddn(1)},s.prototype.modn=function(a){n(a<=67108863);var c=67108864%a,f=0;for(var l=this.length-1;l>=0;l--)f=(c*f+(this.words[l]|0))%a;return f},s.prototype.idivn=function(a){n(a<=67108863);var c=0;for(var f=this.length-1;f>=0;f--){var l=(this.words[f]|0)+c*67108864;this.words[f]=l/a|0,c=l%a}return this.strip()},s.prototype.divn=function(a){return this.clone().idivn(a)},s.prototype.egcd=function(a){n(a.negative===0),n(!a.isZero());var c=this,f=a.clone();if(c.negative!==0)c=c.umod(a);else c=c.clone();var l=new s(1),d=new s(0),y=new s(0),w=new s(1),p=0;while(c.isEven()&&f.isEven())c.iushrn(1),f.iushrn(1),++p;var u=f.clone(),m=c.clone();while(!c.isZero()){for(var E=0,k=1;(c.words[0]&k)===0&&E<26;++E,k<<=1);if(E>0){c.iushrn(E);while(E-- >0){if(l.isOdd()||d.isOdd())l.iadd(u),d.isub(m);l.iushrn(1),d.iushrn(1)}}for(var A=0,D=1;(f.words[0]&D)===0&&A<26;++A,D<<=1);if(A>0){f.iushrn(A);while(A-- >0){if(y.isOdd()||w.isOdd())y.iadd(u),w.isub(m);y.iushrn(1),w.iushrn(1)}}if(c.cmp(f)>=0)c.isub(f),l.isub(y),d.isub(w);else f.isub(c),y.isub(l),w.isub(d)}return{a:y,b:w,gcd:f.iushln(p)}},s.prototype._invmp=function(a){n(a.negative===0),n(!a.isZero());var c=this,f=a.clone();if(c.negative!==0)c=c.umod(a);else c=c.clone();var l=new s(1),d=new s(0),y=f.clone();while(c.cmpn(1)>0&&f.cmpn(1)>0){for(var w=0,p=1;(c.words[0]&p)===0&&w<26;++w,p<<=1);if(w>0){c.iushrn(w);while(w-- >0){if(l.isOdd())l.iadd(y);l.iushrn(1)}}for(var u=0,m=1;(f.words[0]&m)===0&&u<26;++u,m<<=1);if(u>0){f.iushrn(u);while(u-- >0){if(d.isOdd())d.iadd(y);d.iushrn(1)}}if(c.cmp(f)>=0)c.isub(f),l.isub(d);else f.isub(c),d.isub(l)}var E;if(c.cmpn(1)===0)E=l;else E=d;if(E.cmpn(0)<0)E.iadd(a);return E},s.prototype.gcd=function(a){if(this.isZero())return a.abs();if(a.isZero())return this.abs();var c=this.clone(),f=a.clone();c.negative=0,f.negative=0;for(var l=0;c.isEven()&&f.isEven();l++)c.iushrn(1),f.iushrn(1);do{while(c.isEven())c.iushrn(1);while(f.isEven())f.iushrn(1);var d=c.cmp(f);if(d<0){var y=c;c=f,f=y}else if(d===0||f.cmpn(1)===0)break;c.isub(f)}while(!0);return f.iushln(l)},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){n(typeof a==="number");var c=a%26,f=(a-c)/26,l=1<<c;if(this.length<=f)return this._expand(f+1),this.words[f]|=l,this;var d=l;for(var y=f;d!==0&&y<this.length;y++){var w=this.words[y]|0;w+=d,d=w>>>26,w&=67108863,this.words[y]=w}if(d!==0)this.words[y]=d,this.length++;return this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(a){var c=a<0;if(this.negative!==0&&!c)return-1;if(this.negative===0&&c)return 1;this.strip();var f;if(this.length>1)f=1;else{if(c)a=-a;n(a<=67108863,"Number is too big");var l=this.words[0]|0;f=l===a?0:l<a?-1:1}if(this.negative!==0)return-f|0;return f},s.prototype.cmp=function(a){if(this.negative!==0&&a.negative===0)return-1;if(this.negative===0&&a.negative!==0)return 1;var c=this.ucmp(a);if(this.negative!==0)return-c|0;return c},s.prototype.ucmp=function(a){if(this.length>a.length)return 1;if(this.length<a.length)return-1;var c=0;for(var f=this.length-1;f>=0;f--){var l=this.words[f]|0,d=a.words[f]|0;if(l===d)continue;if(l<d)c=-1;else if(l>d)c=1;break}return c},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 F(a)},s.prototype.toRed=function(a){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),a.convertTo(this)._forceRed(a)},s.prototype.fromRed=function(){return n(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 n(!this.red,"Already a number in reduction context"),this._forceRed(a)},s.prototype.redAdd=function(a){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,a)},s.prototype.redIAdd=function(a){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,a)},s.prototype.redSub=function(a){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,a)},s.prototype.redISub=function(a){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,a)},s.prototype.redShl=function(a){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,a)},s.prototype.redMul=function(a){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.mul(this,a)},s.prototype.redIMul=function(a){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.imul(this,a)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(a){return n(this.red&&!a.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,a)};var C={k256:null,p224:null,p192:null,p25519:null};function N(a,c){this.name=a,this.p=new s(c,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}N.prototype._tmp=function(){var a=new s(null);return a.words=Array(Math.ceil(this.n/13)),a},N.prototype.ireduce=function(a){var c=a,f;do this.split(c,this.tmp),c=this.imulK(c),c=c.iadd(this.tmp),f=c.bitLength();while(f>this.n);var l=f<this.n?-1:c.ucmp(this.p);if(l===0)c.words[0]=0,c.length=1;else if(l>0)c.isub(this.p);else if(c.strip!==void 0)c.strip();else c._strip();return c},N.prototype.split=function(a,c){a.iushrn(this.n,0,c)},N.prototype.imulK=function(a){return a.imul(this.k)};function B(){N.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(B,N),B.prototype.split=function(a,c){var f=4194303,l=Math.min(a.length,9);for(var d=0;d<l;d++)c.words[d]=a.words[d];if(c.length=l,a.length<=9){a.words[0]=0,a.length=1;return}var y=a.words[9];c.words[c.length++]=y&f;for(d=10;d<a.length;d++){var w=a.words[d]|0;a.words[d-10]=(w&f)<<4|y>>>22,y=w}if(y>>>=22,a.words[d-10]=y,y===0&&a.length>10)a.length-=10;else a.length-=9},B.prototype.imulK=function(a){a.words[a.length]=0,a.words[a.length+1]=0,a.length+=2;var c=0;for(var f=0;f<a.length;f++){var l=a.words[f]|0;c+=l*977,a.words[f]=c&67108863,c=l*64+(c/67108864|0)}if(a.words[a.length-1]===0){if(a.length--,a.words[a.length-1]===0)a.length--}return a};function ie(){N.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(ie,N);function le(){N.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(le,N);function ue(){N.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(ue,N),ue.prototype.imulK=function(a){var c=0;for(var f=0;f<a.length;f++){var l=(a.words[f]|0)*19+c,d=l&67108863;l>>>=26,a.words[f]=d,c=l}if(c!==0)a.words[a.length++]=c;return a},s._prime=function(a){if(C[a])return C[a];var c;if(a==="k256")c=new B;else if(a==="p224")c=new ie;else if(a==="p192")c=new le;else if(a==="p25519")c=new ue;else throw Error("Unknown prime "+a);return C[a]=c,c};function F(a){if(typeof a==="string"){var c=s._prime(a);this.m=c.p,this.prime=c}else n(a.gtn(1),"modulus must be greater than 1"),this.m=a,this.prime=null}F.prototype._verify1=function(a){n(a.negative===0,"red works only with positives"),n(a.red,"red works only with red numbers")},F.prototype._verify2=function(a,c){n((a.negative|c.negative)===0,"red works only with positives"),n(a.red&&a.red===c.red,"red works only with red numbers")},F.prototype.imod=function(a){if(this.prime)return this.prime.ireduce(a)._forceRed(this);return a.umod(this.m)._forceRed(this)},F.prototype.neg=function(a){if(a.isZero())return a.clone();return this.m.sub(a)._forceRed(this)},F.prototype.add=function(a,c){this._verify2(a,c);var f=a.add(c);if(f.cmp(this.m)>=0)f.isub(this.m);return f._forceRed(this)},F.prototype.iadd=function(a,c){this._verify2(a,c);var f=a.iadd(c);if(f.cmp(this.m)>=0)f.isub(this.m);return f},F.prototype.sub=function(a,c){this._verify2(a,c);var f=a.sub(c);if(f.cmpn(0)<0)f.iadd(this.m);return f._forceRed(this)},F.prototype.isub=function(a,c){this._verify2(a,c);var f=a.isub(c);if(f.cmpn(0)<0)f.iadd(this.m);return f},F.prototype.shl=function(a,c){return this._verify1(a),this.imod(a.ushln(c))},F.prototype.imul=function(a,c){return this._verify2(a,c),this.imod(a.imul(c))},F.prototype.mul=function(a,c){return this._verify2(a,c),this.imod(a.mul(c))},F.prototype.isqr=function(a){return this.imul(a,a.clone())},F.prototype.sqr=function(a){return this.mul(a,a)},F.prototype.sqrt=function(a){if(a.isZero())return a.clone();var c=this.m.andln(3);if(n(c%2===1),c===3){var f=this.m.add(new s(1)).iushrn(2);return this.pow(a,f)}var l=this.m.subn(1),d=0;while(!l.isZero()&&l.andln(1)===0)d++,l.iushrn(1);n(!l.isZero());var y=new s(1).toRed(this),w=y.redNeg(),p=this.m.subn(1).iushrn(1),u=this.m.bitLength();u=new s(2*u*u).toRed(this);while(this.pow(u,p).cmp(w)!==0)u.redIAdd(w);var m=this.pow(u,l),E=this.pow(a,l.addn(1).iushrn(1)),k=this.pow(a,l),A=d;while(k.cmp(y)!==0){var D=k;for(var U=0;D.cmp(y)!==0;U++)D=D.redSqr();n(U<A);var K=this.pow(m,new s(1).iushln(A-U-1));E=E.redMul(K),m=K.redSqr(),k=k.redMul(m),A=U}return E},F.prototype.invm=function(a){var c=a._invmp(this.m);if(c.negative!==0)return c.negative=0,this.imod(c).redNeg();else return this.imod(c)},F.prototype.pow=function(a,c){if(c.isZero())return new s(1).toRed(this);if(c.cmpn(1)===0)return a.clone();var f=4,l=Array(1<<f);l[0]=new s(1).toRed(this),l[1]=a;for(var d=2;d<l.length;d++)l[d]=this.mul(l[d-1],a);var y=l[0],w=0,p=0,u=c.bitLength()%26;if(u===0)u=26;for(d=c.length-1;d>=0;d--){var m=c.words[d];for(var E=u-1;E>=0;E--){var k=m>>E&1;if(y!==l[0])y=this.sqr(y);if(k===0&&w===0){p=0;continue}if(w<<=1,w|=k,p++,p!==f&&(d!==0||E!==0))continue;y=this.mul(y,l[w]),p=0,w=0}u=26}return y},F.prototype.convertTo=function(a){var c=a.umod(this.m);return c===a?c.clone():c},F.prototype.convertFrom=function(a){var c=a.clone();return c.red=null,c},s.mont=function(a){return new ee(a)};function ee(a){if(F.call(this,a),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)}o(ee,F),ee.prototype.convertTo=function(a){return this.imod(a.ushln(this.shift))},ee.prototype.convertFrom=function(a){var c=this.imod(a.mul(this.rinv));return c.red=null,c},ee.prototype.imul=function(a,c){if(a.isZero()||c.isZero())return a.words[0]=0,a.length=1,a;var f=a.imul(c),l=f.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=f.isub(l).iushrn(this.shift),y=d;if(d.cmp(this.m)>=0)y=d.isub(this.m);else if(d.cmpn(0)<0)y=d.iadd(this.m);return y._forceRed(this)},ee.prototype.mul=function(a,c){if(a.isZero()||c.isZero())return new s(0)._forceRed(this);var f=a.mul(c),l=f.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=f.isub(l).iushrn(this.shift),y=d;if(d.cmp(this.m)>=0)y=d.isub(this.m);else if(d.cmpn(0)<0)y=d.iadd(this.m);return y._forceRed(this)},ee.prototype.invm=function(a){var c=this.imod(a._invmp(this.m).mul(this.r2));return c._forceRed(this)}})(typeof t>"u"||t,e)}),Oi=ce((e,t)=>{t.exports=r;function r(i,n){if(!i)throw Error(n||"Assertion failed")}r.equal=function(i,n,o){if(i!=n)throw Error(o||"Assertion failed: "+i+" != "+n)}}),Aw=ce((e)=>{var t=e;function r(o,s){if(Array.isArray(o))return o.slice();if(!o)return[];var h=[];if(typeof o!=="string"){for(var v=0;v<o.length;v++)h[v]=o[v]|0;return h}if(s==="hex"){if(o=o.replace(/[^a-z0-9]+/ig,""),o.length%2!==0)o="0"+o;for(var v=0;v<o.length;v+=2)h.push(parseInt(o[v]+o[v+1],16))}else for(var v=0;v<o.length;v++){var b=o.charCodeAt(v),_=b>>8,g=b&255;if(_)h.push(_,g);else h.push(g)}return h}t.toArray=r;function i(o){if(o.length===1)return"0"+o;else return o}t.zero2=i;function n(o){var s="";for(var h=0;h<o.length;h++)s+=i(o[h].toString(16));return s}t.toHex=n,t.encode=function(o,s){if(s==="hex")return n(o);else return o}}),xn=ce((e)=>{var t=e,r=ai(),i=Oi(),n=Aw();t.assert=i,t.toArray=n.toArray,t.zero2=n.zero2,t.toHex=n.toHex,t.encode=n.encode;function o(_,g,S){var x=Array(Math.max(_.bitLength(),S)+1),M;for(M=0;M<x.length;M+=1)x[M]=0;var I=1<<g+1,$=_.clone();for(M=0;M<x.length;M++){var T,P=$.andln(I-1);if($.isOdd()){if(P>(I>>1)-1)T=(I>>1)-P;else T=P;$.isubn(T)}else T=0;x[M]=T,$.iushrn(1)}return x}t.getNAF=o;function s(_,g){var S=[[],[]];_=_.clone(),g=g.clone();var x=0,M=0,I;while(_.cmpn(-x)>0||g.cmpn(-M)>0){var $=_.andln(3)+x&3,T=g.andln(3)+M&3;if($===3)$=-1;if(T===3)T=-1;var P;if(($&1)===0)P=0;else if(I=_.andln(7)+x&7,(I===3||I===5)&&T===2)P=-$;else P=$;S[0].push(P);var R;if((T&1)===0)R=0;else if(I=g.andln(7)+M&7,(I===3||I===5)&&$===2)R=-T;else R=T;if(S[1].push(R),2*x===P+1)x=1-x;if(2*M===R+1)M=1-M;_.iushrn(1),g.iushrn(1)}return S}t.getJSF=s;function h(_,g,S){var x="_"+g;_.prototype[g]=function(){return this[x]!==void 0?this[x]:this[x]=S.call(this)}}t.cachedProperty=h;function v(_){return typeof _==="string"?t.toArray(_,"hex"):_}t.parseBytes=v;function b(_){return new r(_,"hex","le")}t.intFromLE=b}),Rw=ce((e,t)=>{var r;t.exports=function(o){if(!r)r=new i(null);return r.generate(o)};function i(o){this.rand=o}if(t.exports.Rand=i,i.prototype.generate=function(o){return this._rand(o)},i.prototype._rand=function(o){if(this.rand.getBytes)return this.rand.getBytes(o);var s=new Uint8Array(o);for(var h=0;h<s.length;h++)s[h]=this.rand.getByte();return s},typeof self==="object"){if(self.crypto&&self.crypto.getRandomValues)i.prototype._rand=function(o){var s=new Uint8Array(o);return self.crypto.getRandomValues(s),s};else if(self.msCrypto&&self.msCrypto.getRandomValues)i.prototype._rand=function(o){var s=new Uint8Array(o);return self.msCrypto.getRandomValues(s),s};else if(typeof window==="object")i.prototype._rand=function(){throw Error("Not implemented yet")}}else try{if(n=(Kr(),kt(dn)),typeof n.randomBytes!=="function")throw Error("Not supported");i.prototype._rand=function(o){return n.randomBytes(o)}}catch(o){}var n}),Kc=ce((e,t)=>{var r=ai(),i=xn(),n=i.getNAF,o=i.getJSF,s=i.assert;function h(b,_){this.type=b,this.p=new r(_.p,16),this.red=_.prime?r.red(_.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=_.n&&new r(_.n,16),this.g=_.g&&this.pointFromJSON(_.g,_.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],this._bitLength=this.n?this.n.bitLength():0;var g=this.n&&this.p.div(this.n);if(!g||g.cmpn(100)>0)this.redN=null;else this._maxwellTrick=!0,this.redN=this.n.toRed(this.red)}t.exports=h,h.prototype.point=function(){throw Error("Not implemented")},h.prototype.validate=function(){throw Error("Not implemented")},h.prototype._fixedNafMul=function(b,_){s(b.precomputed);var g=b._getDoubles(),S=n(_,1,this._bitLength),x=(1<<g.step+1)-(g.step%2===0?2:1);x/=3;var M=[],I,$;for(I=0;I<S.length;I+=g.step){$=0;for(var T=I+g.step-1;T>=I;T--)$=($<<1)+S[T];M.push($)}var P=this.jpoint(null,null,null),R=this.jpoint(null,null,null);for(var C=x;C>0;C--){for(I=0;I<M.length;I++)if($=M[I],$===C)R=R.mixedAdd(g.points[I]);else if($===-C)R=R.mixedAdd(g.points[I].neg());P=P.add(R)}return P.toP()},h.prototype._wnafMul=function(b,_){var g=4,S=b._getNAFPoints(g);g=S.wnd;var x=S.points,M=n(_,g,this._bitLength),I=this.jpoint(null,null,null);for(var $=M.length-1;$>=0;$--){for(var T=0;$>=0&&M[$]===0;$--)T++;if($>=0)T++;if(I=I.dblp(T),$<0)break;var P=M[$];if(s(P!==0),b.type==="affine")if(P>0)I=I.mixedAdd(x[P-1>>1]);else I=I.mixedAdd(x[-P-1>>1].neg());else if(P>0)I=I.add(x[P-1>>1]);else I=I.add(x[-P-1>>1].neg())}return b.type==="affine"?I.toP():I},h.prototype._wnafMulAdd=function(b,_,g,S,x){var M=this._wnafT1,I=this._wnafT2,$=this._wnafT3,T=0,P,R,C;for(P=0;P<S;P++){C=_[P];var N=C._getNAFPoints(b);M[P]=N.wnd,I[P]=N.points}for(P=S-1;P>=1;P-=2){var B=P-1,ie=P;if(M[B]!==1||M[ie]!==1){$[B]=n(g[B],M[B],this._bitLength),$[ie]=n(g[ie],M[ie],this._bitLength),T=Math.max($[B].length,T),T=Math.max($[ie].length,T);continue}var le=[_[B],null,null,_[ie]];if(_[B].y.cmp(_[ie].y)===0)le[1]=_[B].add(_[ie]),le[2]=_[B].toJ().mixedAdd(_[ie].neg());else if(_[B].y.cmp(_[ie].y.redNeg())===0)le[1]=_[B].toJ().mixedAdd(_[ie]),le[2]=_[B].add(_[ie].neg());else le[1]=_[B].toJ().mixedAdd(_[ie]),le[2]=_[B].toJ().mixedAdd(_[ie].neg());var ue=[-3,-1,-5,-7,0,7,5,1,3],F=o(g[B],g[ie]);T=Math.max(F[0].length,T),$[B]=Array(T),$[ie]=Array(T);for(R=0;R<T;R++){var ee=F[0][R]|0,a=F[1][R]|0;$[B][R]=ue[(ee+1)*3+(a+1)],$[ie][R]=0,I[B]=le}}var c=this.jpoint(null,null,null),f=this._wnafT4;for(P=T;P>=0;P--){var l=0;while(P>=0){var d=!0;for(R=0;R<S;R++)if(f[R]=$[R][P]|0,f[R]!==0)d=!1;if(!d)break;l++,P--}if(P>=0)l++;if(c=c.dblp(l),P<0)break;for(R=0;R<S;R++){var y=f[R];if(y===0)continue;else if(y>0)C=I[R][y-1>>1];else if(y<0)C=I[R][-y-1>>1].neg();if(C.type==="affine")c=c.mixedAdd(C);else c=c.add(C)}}for(P=0;P<S;P++)I[P]=null;if(x)return c;else return c.toP()};function v(b,_){this.curve=b,this.type=_,this.precomputed=null}h.BasePoint=v,v.prototype.eq=function(){throw Error("Not implemented")},v.prototype.validate=function(){return this.curve.validate(this)},h.prototype.decodePoint=function(b,_){b=i.toArray(b,_);var g=this.p.byteLength();if((b[0]===4||b[0]===6||b[0]===7)&&b.length-1===2*g){if(b[0]===6)s(b[b.length-1]%2===0);else if(b[0]===7)s(b[b.length-1]%2===1);var S=this.point(b.slice(1,1+g),b.slice(1+g,1+2*g));return S}else if((b[0]===2||b[0]===3)&&b.length-1===g)return this.pointFromX(b.slice(1,1+g),b[0]===3);throw Error("Unknown point format")},v.prototype.encodeCompressed=function(b){return this.encode(b,!0)},v.prototype._encode=function(b){var _=this.curve.p.byteLength(),g=this.getX().toArray("be",_);if(b)return[this.getY().isEven()?2:3].concat(g);return[4].concat(g,this.getY().toArray("be",_))},v.prototype.encode=function(b,_){return i.encode(this._encode(_),b)},v.prototype.precompute=function(b){if(this.precomputed)return this;var _={doubles:null,naf:null,beta:null};return _.naf=this._getNAFPoints(8),_.doubles=this._getDoubles(4,b),_.beta=this._getBeta(),this.precomputed=_,this},v.prototype._hasDoubles=function(b){if(!this.precomputed)return!1;var _=this.precomputed.doubles;if(!_)return!1;return _.points.length>=Math.ceil((b.bitLength()+1)/_.step)},v.prototype._getDoubles=function(b,_){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;var g=[this],S=this;for(var x=0;x<_;x+=b){for(var M=0;M<b;M++)S=S.dbl();g.push(S)}return{step:b,points:g}},v.prototype._getNAFPoints=function(b){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;var _=[this],g=(1<<b)-1,S=g===1?null:this.dbl();for(var x=1;x<g;x++)_[x]=_[x-1].add(S);return{wnd:b,points:_}},v.prototype._getBeta=function(){return null},v.prototype.dblp=function(b){var _=this;for(var g=0;g<b;g++)_=_.dbl();return _}}),LT=ce((e,t)=>{if(typeof Object.create==="function")t.exports=function(r,i){if(i)r.super_=i,r.prototype=Object.create(i.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}})};else t.exports=function(r,i){if(i){r.super_=i;var n=function(){};n.prototype=i.prototype,r.prototype=new n,r.prototype.constructor=r}}}),cn=ce((e,t)=>{try{if(r=(V1(),kt(K1)),typeof r.inherits!=="function")throw"";t.exports=r.inherits}catch(i){t.exports=LT()}var r}),FT=ce((e,t)=>{var r=xn(),i=ai(),n=cn(),o=Kc(),s=r.assert;function h(_){o.call(this,"short",_),this.a=new i(_.a,16).toRed(this.red),this.b=new i(_.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(_),this._endoWnafT1=[,,,,],this._endoWnafT2=[,,,,]}n(h,o),t.exports=h,h.prototype._getEndomorphism=function(_){if(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)return;var g,S;if(_.beta)g=new i(_.beta,16).toRed(this.red);else{var x=this._getEndoRoots(this.p);g=x[0].cmp(x[1])<0?x[0]:x[1],g=g.toRed(this.red)}if(_.lambda)S=new i(_.lambda,16);else{var M=this._getEndoRoots(this.n);if(this.g.mul(M[0]).x.cmp(this.g.x.redMul(g))===0)S=M[0];else S=M[1],s(this.g.mul(S).x.cmp(this.g.x.redMul(g))===0)}var I;if(_.basis)I=_.basis.map(function($){return{a:new i($.a,16),b:new i($.b,16)}});else I=this._getEndoBasis(S);return{beta:g,lambda:S,basis:I}},h.prototype._getEndoRoots=function(_){var g=_===this.p?this.red:i.mont(_),S=new i(2).toRed(g).redInvm(),x=S.redNeg(),M=new i(3).toRed(g).redNeg().redSqrt().redMul(S),I=x.redAdd(M).fromRed(),$=x.redSub(M).fromRed();return[I,$]},h.prototype._getEndoBasis=function(_){var g=this.n.ushrn(Math.floor(this.n.bitLength()/2)),S=_,x=this.n.clone(),M=new i(1),I=new i(0),$=new i(0),T=new i(1),P,R,C,N,B,ie,le,ue=0,F,ee;while(S.cmpn(0)!==0){var a=x.div(S);F=x.sub(a.mul(S)),ee=$.sub(a.mul(M));var c=T.sub(a.mul(I));if(!C&&F.cmp(g)<0)P=le.neg(),R=M,C=F.neg(),N=ee;else if(C&&++ue===2)break;le=F,x=S,S=F,$=M,M=ee,T=I,I=c}B=F.neg(),ie=ee;var f=C.sqr().add(N.sqr()),l=B.sqr().add(ie.sqr());if(l.cmp(f)>=0)B=P,ie=R;if(C.negative)C=C.neg(),N=N.neg();if(B.negative)B=B.neg(),ie=ie.neg();return[{a:C,b:N},{a:B,b:ie}]},h.prototype._endoSplit=function(_){var g=this.endo.basis,S=g[0],x=g[1],M=x.b.mul(_).divRound(this.n),I=S.b.neg().mul(_).divRound(this.n),$=M.mul(S.a),T=I.mul(x.a),P=M.mul(S.b),R=I.mul(x.b),C=_.sub($).sub(T),N=P.add(R).neg();return{k1:C,k2:N}},h.prototype.pointFromX=function(_,g){if(_=new i(_,16),!_.red)_=_.toRed(this.red);var S=_.redSqr().redMul(_).redIAdd(_.redMul(this.a)).redIAdd(this.b),x=S.redSqrt();if(x.redSqr().redSub(S).cmp(this.zero)!==0)throw Error("invalid point");var M=x.fromRed().isOdd();if(g&&!M||!g&&M)x=x.redNeg();return this.point(_,x)},h.prototype.validate=function(_){if(_.inf)return!0;var{x:g,y:S}=_,x=this.a.redMul(g),M=g.redSqr().redMul(g).redIAdd(x).redIAdd(this.b);return S.redSqr().redISub(M).cmpn(0)===0},h.prototype._endoWnafMulAdd=function(_,g,S){var x=this._endoWnafT1,M=this._endoWnafT2;for(var I=0;I<_.length;I++){var $=this._endoSplit(g[I]),T=_[I],P=T._getBeta();if($.k1.negative)$.k1.ineg(),T=T.neg(!0);if($.k2.negative)$.k2.ineg(),P=P.neg(!0);x[I*2]=T,x[I*2+1]=P,M[I*2]=$.k1,M[I*2+1]=$.k2}var R=this._wnafMulAdd(1,x,M,I*2,S);for(var C=0;C<I*2;C++)x[C]=null,M[C]=null;return R};function v(_,g,S,x){if(o.BasePoint.call(this,_,"affine"),g===null&&S===null)this.x=null,this.y=null,this.inf=!0;else{if(this.x=new i(g,16),this.y=new i(S,16),x)this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red);if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);this.inf=!1}}n(v,o.BasePoint),h.prototype.point=function(_,g,S){return new v(this,_,g,S)},h.prototype.pointFromJSON=function(_,g){return v.fromJSON(this,_,g)},v.prototype._getBeta=function(){if(!this.curve.endo)return;var _=this.precomputed;if(_&&_.beta)return _.beta;var g=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(_){var S=this.curve,x=function(M){return S.point(M.x.redMul(S.endo.beta),M.y)};_.beta=g,g.precomputed={beta:null,naf:_.naf&&{wnd:_.naf.wnd,points:_.naf.points.map(x)},doubles:_.doubles&&{step:_.doubles.step,points:_.doubles.points.map(x)}}}return g},v.prototype.toJSON=function(){if(!this.precomputed)return[this.x,this.y];return[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]},v.fromJSON=function(_,g,S){if(typeof g==="string")g=JSON.parse(g);var x=_.point(g[0],g[1],S);if(!g[2])return x;function M($){return _.point($[0],$[1],S)}var I=g[2];return x.precomputed={beta:null,doubles:I.doubles&&{step:I.doubles.step,points:[x].concat(I.doubles.points.map(M))},naf:I.naf&&{wnd:I.naf.wnd,points:[x].concat(I.naf.points.map(M))}},x},v.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},v.prototype.isInfinity=function(){return this.inf},v.prototype.add=function(_){if(this.inf)return _;if(_.inf)return this;if(this.eq(_))return this.dbl();if(this.neg().eq(_))return this.curve.point(null,null);if(this.x.cmp(_.x)===0)return this.curve.point(null,null);var g=this.y.redSub(_.y);if(g.cmpn(0)!==0)g=g.redMul(this.x.redSub(_.x).redInvm());var S=g.redSqr().redISub(this.x).redISub(_.x),x=g.redMul(this.x.redSub(S)).redISub(this.y);return this.curve.point(S,x)},v.prototype.dbl=function(){if(this.inf)return this;var _=this.y.redAdd(this.y);if(_.cmpn(0)===0)return this.curve.point(null,null);var g=this.curve.a,S=this.x.redSqr(),x=_.redInvm(),M=S.redAdd(S).redIAdd(S).redIAdd(g).redMul(x),I=M.redSqr().redISub(this.x.redAdd(this.x)),$=M.redMul(this.x.redSub(I)).redISub(this.y);return this.curve.point(I,$)},v.prototype.getX=function(){return this.x.fromRed()},v.prototype.getY=function(){return this.y.fromRed()},v.prototype.mul=function(_){if(_=new i(_,16),this.isInfinity())return this;else if(this._hasDoubles(_))return this.curve._fixedNafMul(this,_);else if(this.curve.endo)return this.curve._endoWnafMulAdd([this],[_]);else return this.curve._wnafMul(this,_)},v.prototype.mulAdd=function(_,g,S){var x=[this,g],M=[_,S];if(this.curve.endo)return this.curve._endoWnafMulAdd(x,M);else return this.curve._wnafMulAdd(1,x,M,2)},v.prototype.jmulAdd=function(_,g,S){var x=[this,g],M=[_,S];if(this.curve.endo)return this.curve._endoWnafMulAdd(x,M,!0);else return this.curve._wnafMulAdd(1,x,M,2,!0)},v.prototype.eq=function(_){return this===_||this.inf===_.inf&&(this.inf||this.x.cmp(_.x)===0&&this.y.cmp(_.y)===0)},v.prototype.neg=function(_){if(this.inf)return this;var g=this.curve.point(this.x,this.y.redNeg());if(_&&this.precomputed){var S=this.precomputed,x=function(M){return M.neg()};g.precomputed={naf:S.naf&&{wnd:S.naf.wnd,points:S.naf.points.map(x)},doubles:S.doubles&&{step:S.doubles.step,points:S.doubles.points.map(x)}}}return g},v.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var _=this.curve.jpoint(this.x,this.y,this.curve.one);return _};function b(_,g,S,x){if(o.BasePoint.call(this,_,"jacobian"),g===null&&S===null&&x===null)this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0);else this.x=new i(g,16),this.y=new i(S,16),this.z=new i(x,16);if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red);this.zOne=this.z===this.curve.one}n(b,o.BasePoint),h.prototype.jpoint=function(_,g,S){return new b(this,_,g,S)},b.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var _=this.z.redInvm(),g=_.redSqr(),S=this.x.redMul(g),x=this.y.redMul(g).redMul(_);return this.curve.point(S,x)},b.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},b.prototype.add=function(_){if(this.isInfinity())return _;if(_.isInfinity())return this;var g=_.z.redSqr(),S=this.z.redSqr(),x=this.x.redMul(g),M=_.x.redMul(S),I=this.y.redMul(g.redMul(_.z)),$=_.y.redMul(S.redMul(this.z)),T=x.redSub(M),P=I.redSub($);if(T.cmpn(0)===0)if(P.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl();var R=T.redSqr(),C=R.redMul(T),N=x.redMul(R),B=P.redSqr().redIAdd(C).redISub(N).redISub(N),ie=P.redMul(N.redISub(B)).redISub(I.redMul(C)),le=this.z.redMul(_.z).redMul(T);return this.curve.jpoint(B,ie,le)},b.prototype.mixedAdd=function(_){if(this.isInfinity())return _.toJ();if(_.isInfinity())return this;var g=this.z.redSqr(),S=this.x,x=_.x.redMul(g),M=this.y,I=_.y.redMul(g).redMul(this.z),$=S.redSub(x),T=M.redSub(I);if($.cmpn(0)===0)if(T.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl();var P=$.redSqr(),R=P.redMul($),C=S.redMul(P),N=T.redSqr().redIAdd(R).redISub(C).redISub(C),B=T.redMul(C.redISub(N)).redISub(M.redMul(R)),ie=this.z.redMul($);return this.curve.jpoint(N,B,ie)},b.prototype.dblp=function(_){if(_===0)return this;if(this.isInfinity())return this;if(!_)return this.dbl();var g;if(this.curve.zeroA||this.curve.threeA){var S=this;for(g=0;g<_;g++)S=S.dbl();return S}var x=this.curve.a,M=this.curve.tinv,I=this.x,$=this.y,T=this.z,P=T.redSqr().redSqr(),R=$.redAdd($);for(g=0;g<_;g++){var C=I.redSqr(),N=R.redSqr(),B=N.redSqr(),ie=C.redAdd(C).redIAdd(C).redIAdd(x.redMul(P)),le=I.redMul(N),ue=ie.redSqr().redISub(le.redAdd(le)),F=le.redISub(ue),ee=ie.redMul(F);ee=ee.redIAdd(ee).redISub(B);var a=R.redMul(T);if(g+1<_)P=P.redMul(B);I=ue,T=a,R=ee}return this.curve.jpoint(I,R.redMul(M),T)},b.prototype.dbl=function(){if(this.isInfinity())return this;if(this.curve.zeroA)return this._zeroDbl();else if(this.curve.threeA)return this._threeDbl();else return this._dbl()},b.prototype._zeroDbl=function(){var _,g,S;if(this.zOne){var x=this.x.redSqr(),M=this.y.redSqr(),I=M.redSqr(),$=this.x.redAdd(M).redSqr().redISub(x).redISub(I);$=$.redIAdd($);var T=x.redAdd(x).redIAdd(x),P=T.redSqr().redISub($).redISub($),R=I.redIAdd(I);R=R.redIAdd(R),R=R.redIAdd(R),_=P,g=T.redMul($.redISub(P)).redISub(R),S=this.y.redAdd(this.y)}else{var C=this.x.redSqr(),N=this.y.redSqr(),B=N.redSqr(),ie=this.x.redAdd(N).redSqr().redISub(C).redISub(B);ie=ie.redIAdd(ie);var le=C.redAdd(C).redIAdd(C),ue=le.redSqr(),F=B.redIAdd(B);F=F.redIAdd(F),F=F.redIAdd(F),_=ue.redISub(ie).redISub(ie),g=le.redMul(ie.redISub(_)).redISub(F),S=this.y.redMul(this.z),S=S.redIAdd(S)}return this.curve.jpoint(_,g,S)},b.prototype._threeDbl=function(){var _,g,S;if(this.zOne){var x=this.x.redSqr(),M=this.y.redSqr(),I=M.redSqr(),$=this.x.redAdd(M).redSqr().redISub(x).redISub(I);$=$.redIAdd($);var T=x.redAdd(x).redIAdd(x).redIAdd(this.curve.a),P=T.redSqr().redISub($).redISub($);_=P;var R=I.redIAdd(I);R=R.redIAdd(R),R=R.redIAdd(R),g=T.redMul($.redISub(P)).redISub(R),S=this.y.redAdd(this.y)}else{var C=this.z.redSqr(),N=this.y.redSqr(),B=this.x.redMul(N),ie=this.x.redSub(C).redMul(this.x.redAdd(C));ie=ie.redAdd(ie).redIAdd(ie);var le=B.redIAdd(B);le=le.redIAdd(le);var ue=le.redAdd(le);_=ie.redSqr().redISub(ue),S=this.y.redAdd(this.z).redSqr().redISub(N).redISub(C);var F=N.redSqr();F=F.redIAdd(F),F=F.redIAdd(F),F=F.redIAdd(F),g=ie.redMul(le.redISub(_)).redISub(F)}return this.curve.jpoint(_,g,S)},b.prototype._dbl=function(){var _=this.curve.a,g=this.x,S=this.y,x=this.z,M=x.redSqr().redSqr(),I=g.redSqr(),$=S.redSqr(),T=I.redAdd(I).redIAdd(I).redIAdd(_.redMul(M)),P=g.redAdd(g);P=P.redIAdd(P);var R=P.redMul($),C=T.redSqr().redISub(R.redAdd(R)),N=R.redISub(C),B=$.redSqr();B=B.redIAdd(B),B=B.redIAdd(B),B=B.redIAdd(B);var ie=T.redMul(N).redISub(B),le=S.redAdd(S).redMul(x);return this.curve.jpoint(C,ie,le)},b.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var _=this.x.redSqr(),g=this.y.redSqr(),S=this.z.redSqr(),x=g.redSqr(),M=_.redAdd(_).redIAdd(_),I=M.redSqr(),$=this.x.redAdd(g).redSqr().redISub(_).redISub(x);$=$.redIAdd($),$=$.redAdd($).redIAdd($),$=$.redISub(I);var T=$.redSqr(),P=x.redIAdd(x);P=P.redIAdd(P),P=P.redIAdd(P),P=P.redIAdd(P);var R=M.redIAdd($).redSqr().redISub(I).redISub(T).redISub(P),C=g.redMul(R);C=C.redIAdd(C),C=C.redIAdd(C);var N=this.x.redMul(T).redISub(C);N=N.redIAdd(N),N=N.redIAdd(N);var B=this.y.redMul(R.redMul(P.redISub(R)).redISub($.redMul(T)));B=B.redIAdd(B),B=B.redIAdd(B),B=B.redIAdd(B);var ie=this.z.redAdd($).redSqr().redISub(S).redISub(T);return this.curve.jpoint(N,B,ie)},b.prototype.mul=function(_,g){return _=new i(_,g),this.curve._wnafMul(this,_)},b.prototype.eq=function(_){if(_.type==="affine")return this.eq(_.toJ());if(this===_)return!0;var g=this.z.redSqr(),S=_.z.redSqr();if(this.x.redMul(S).redISub(_.x.redMul(g)).cmpn(0)!==0)return!1;var x=g.redMul(this.z),M=S.redMul(_.z);return this.y.redMul(M).redISub(_.y.redMul(x)).cmpn(0)===0},b.prototype.eqXToP=function(_){var g=this.z.redSqr(),S=_.toRed(this.curve.red).redMul(g);if(this.x.cmp(S)===0)return!0;var x=_.clone(),M=this.curve.redN.redMul(g);for(;;){if(x.iadd(this.curve.n),x.cmp(this.curve.p)>=0)return!1;if(S.redIAdd(M),this.x.cmp(S)===0)return!0}},b.prototype.inspect=function(){if(this.isInfinity())return"<EC JPoint Infinity>";return"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},b.prototype.isInfinity=function(){return this.z.cmpn(0)===0}}),qT=ce((e,t)=>{var r=ai(),i=cn(),n=Kc(),o=xn();function s(v){n.call(this,"mont",v),this.a=new r(v.a,16).toRed(this.red),this.b=new r(v.b,16).toRed(this.red),this.i4=new r(4).toRed(this.red).redInvm(),this.two=new r(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}i(s,n),t.exports=s,s.prototype.validate=function(v){var b=v.normalize().x,_=b.redSqr(),g=_.redMul(b).redAdd(_.redMul(this.a)).redAdd(b),S=g.redSqrt();return S.redSqr().cmp(g)===0};function h(v,b,_){if(n.BasePoint.call(this,v,"projective"),b===null&&_===null)this.x=this.curve.one,this.z=this.curve.zero;else{if(this.x=new r(b,16),this.z=new r(_,16),!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red)}}i(h,n.BasePoint),s.prototype.decodePoint=function(v,b){return this.point(o.toArray(v,b),1)},s.prototype.point=function(v,b){return new h(this,v,b)},s.prototype.pointFromJSON=function(v){return h.fromJSON(this,v)},h.prototype.precompute=function(){},h.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},h.fromJSON=function(v,b){return new h(v,b[0],b[1]||v.one)},h.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},h.prototype.isInfinity=function(){return this.z.cmpn(0)===0},h.prototype.dbl=function(){var v=this.x.redAdd(this.z),b=v.redSqr(),_=this.x.redSub(this.z),g=_.redSqr(),S=b.redSub(g),x=b.redMul(g),M=S.redMul(g.redAdd(this.curve.a24.redMul(S)));return this.curve.point(x,M)},h.prototype.add=function(){throw Error("Not supported on Montgomery curve")},h.prototype.diffAdd=function(v,b){var _=this.x.redAdd(this.z),g=this.x.redSub(this.z),S=v.x.redAdd(v.z),x=v.x.redSub(v.z),M=x.redMul(_),I=S.redMul(g),$=b.z.redMul(M.redAdd(I).redSqr()),T=b.x.redMul(M.redISub(I).redSqr());return this.curve.point($,T)},h.prototype.mul=function(v){var b=v.clone(),_=this,g=this.curve.point(null,null),S=this;for(var x=[];b.cmpn(0)!==0;b.iushrn(1))x.push(b.andln(1));for(var M=x.length-1;M>=0;M--)if(x[M]===0)_=_.diffAdd(g,S),g=g.dbl();else g=_.diffAdd(g,S),_=_.dbl();return g},h.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},h.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},h.prototype.eq=function(v){return this.getX().cmp(v.getX())===0},h.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},h.prototype.getX=function(){return this.normalize(),this.x.fromRed()}}),BT=ce((e,t)=>{var r=xn(),i=ai(),n=cn(),o=Kc(),s=r.assert;function h(b){this.twisted=(b.a|0)!==1,this.mOneA=this.twisted&&(b.a|0)===-1,this.extended=this.mOneA,o.call(this,"edwards",b),this.a=new i(b.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(b.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(b.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(b.c|0)===1}n(h,o),t.exports=h,h.prototype._mulA=function(b){if(this.mOneA)return b.redNeg();else return this.a.redMul(b)},h.prototype._mulC=function(b){if(this.oneC)return b;else return this.c.redMul(b)},h.prototype.jpoint=function(b,_,g,S){return this.point(b,_,g,S)},h.prototype.pointFromX=function(b,_){if(b=new i(b,16),!b.red)b=b.toRed(this.red);var g=b.redSqr(),S=this.c2.redSub(this.a.redMul(g)),x=this.one.redSub(this.c2.redMul(this.d).redMul(g)),M=S.redMul(x.redInvm()),I=M.redSqrt();if(I.redSqr().redSub(M).cmp(this.zero)!==0)throw Error("invalid point");var $=I.fromRed().isOdd();if(_&&!$||!_&&$)I=I.redNeg();return this.point(b,I)},h.prototype.pointFromY=function(b,_){if(b=new i(b,16),!b.red)b=b.toRed(this.red);var g=b.redSqr(),S=g.redSub(this.c2),x=g.redMul(this.d).redMul(this.c2).redSub(this.a),M=S.redMul(x.redInvm());if(M.cmp(this.zero)===0)if(_)throw Error("invalid point");else return this.point(this.zero,b);var I=M.redSqrt();if(I.redSqr().redSub(M).cmp(this.zero)!==0)throw Error("invalid point");if(I.fromRed().isOdd()!==_)I=I.redNeg();return this.point(I,b)},h.prototype.validate=function(b){if(b.isInfinity())return!0;b.normalize();var _=b.x.redSqr(),g=b.y.redSqr(),S=_.redMul(this.a).redAdd(g),x=this.c2.redMul(this.one.redAdd(this.d.redMul(_).redMul(g)));return S.cmp(x)===0};function v(b,_,g,S,x){if(o.BasePoint.call(this,b,"projective"),_===null&&g===null&&S===null)this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0;else{if(this.x=new i(_,16),this.y=new i(g,16),this.z=S?new i(S,16):this.curve.one,this.t=x&&new i(x,16),!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red);if(this.t&&!this.t.red)this.t=this.t.toRed(this.curve.red);if(this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t){if(this.t=this.x.redMul(this.y),!this.zOne)this.t=this.t.redMul(this.z.redInvm())}}}n(v,o.BasePoint),h.prototype.pointFromJSON=function(b){return v.fromJSON(this,b)},h.prototype.point=function(b,_,g,S){return new v(this,b,_,g,S)},v.fromJSON=function(b,_){return new v(b,_[0],_[1],_[2])},v.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},v.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},v.prototype._extDbl=function(){var b=this.x.redSqr(),_=this.y.redSqr(),g=this.z.redSqr();g=g.redIAdd(g);var S=this.curve._mulA(b),x=this.x.redAdd(this.y).redSqr().redISub(b).redISub(_),M=S.redAdd(_),I=M.redSub(g),$=S.redSub(_),T=x.redMul(I),P=M.redMul($),R=x.redMul($),C=I.redMul(M);return this.curve.point(T,P,C,R)},v.prototype._projDbl=function(){var b=this.x.redAdd(this.y).redSqr(),_=this.x.redSqr(),g=this.y.redSqr(),S,x,M,I,$,T;if(this.curve.twisted){I=this.curve._mulA(_);var P=I.redAdd(g);if(this.zOne)S=b.redSub(_).redSub(g).redMul(P.redSub(this.curve.two)),x=P.redMul(I.redSub(g)),M=P.redSqr().redSub(P).redSub(P);else $=this.z.redSqr(),T=P.redSub($).redISub($),S=b.redSub(_).redISub(g).redMul(T),x=P.redMul(I.redSub(g)),M=P.redMul(T)}else I=_.redAdd(g),$=this.curve._mulC(this.z).redSqr(),T=I.redSub($).redSub($),S=this.curve._mulC(b.redISub(I)).redMul(T),x=this.curve._mulC(I).redMul(_.redISub(g)),M=I.redMul(T);return this.curve.point(S,x,M)},v.prototype.dbl=function(){if(this.isInfinity())return this;if(this.curve.extended)return this._extDbl();else return this._projDbl()},v.prototype._extAdd=function(b){var _=this.y.redSub(this.x).redMul(b.y.redSub(b.x)),g=this.y.redAdd(this.x).redMul(b.y.redAdd(b.x)),S=this.t.redMul(this.curve.dd).redMul(b.t),x=this.z.redMul(b.z.redAdd(b.z)),M=g.redSub(_),I=x.redSub(S),$=x.redAdd(S),T=g.redAdd(_),P=M.redMul(I),R=$.redMul(T),C=M.redMul(T),N=I.redMul($);return this.curve.point(P,R,N,C)},v.prototype._projAdd=function(b){var _=this.z.redMul(b.z),g=_.redSqr(),S=this.x.redMul(b.x),x=this.y.redMul(b.y),M=this.curve.d.redMul(S).redMul(x),I=g.redSub(M),$=g.redAdd(M),T=this.x.redAdd(this.y).redMul(b.x.redAdd(b.y)).redISub(S).redISub(x),P=_.redMul(I).redMul(T),R,C;if(this.curve.twisted)R=_.redMul($).redMul(x.redSub(this.curve._mulA(S))),C=I.redMul($);else R=_.redMul($).redMul(x.redSub(S)),C=this.curve._mulC(I).redMul($);return this.curve.point(P,R,C)},v.prototype.add=function(b){if(this.isInfinity())return b;if(b.isInfinity())return this;if(this.curve.extended)return this._extAdd(b);else return this._projAdd(b)},v.prototype.mul=function(b){if(this._hasDoubles(b))return this.curve._fixedNafMul(this,b);else return this.curve._wnafMul(this,b)},v.prototype.mulAdd=function(b,_,g){return this.curve._wnafMulAdd(1,[this,_],[b,g],2,!1)},v.prototype.jmulAdd=function(b,_,g){return this.curve._wnafMulAdd(1,[this,_],[b,g],2,!0)},v.prototype.normalize=function(){if(this.zOne)return this;var b=this.z.redInvm();if(this.x=this.x.redMul(b),this.y=this.y.redMul(b),this.t)this.t=this.t.redMul(b);return this.z=this.curve.one,this.zOne=!0,this},v.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},v.prototype.getX=function(){return this.normalize(),this.x.fromRed()},v.prototype.getY=function(){return this.normalize(),this.y.fromRed()},v.prototype.eq=function(b){return this===b||this.getX().cmp(b.getX())===0&&this.getY().cmp(b.getY())===0},v.prototype.eqXToP=function(b){var _=b.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(_)===0)return!0;var g=b.clone(),S=this.curve.redN.redMul(this.z);for(;;){if(g.iadd(this.curve.n),g.cmp(this.curve.p)>=0)return!1;if(_.redIAdd(S),this.x.cmp(_)===0)return!0}},v.prototype.toP=v.prototype.normalize,v.prototype.mixedAdd=v.prototype.add}),Cw=ce((e)=>{var t=e;t.base=Kc(),t.short=FT(),t.mont=qT(),t.edwards=BT()}),Jn=ce((e)=>{var t=Oi(),r=cn();e.inherits=r;function i(c,f){if((c.charCodeAt(f)&64512)!==55296)return!1;if(f<0||f+1>=c.length)return!1;return(c.charCodeAt(f+1)&64512)===56320}function n(c,f){if(Array.isArray(c))return c.slice();if(!c)return[];var l=[];if(typeof c==="string"){if(!f){var d=0;for(var y=0;y<c.length;y++){var w=c.charCodeAt(y);if(w<128)l[d++]=w;else if(w<2048)l[d++]=w>>6|192,l[d++]=w&63|128;else if(i(c,y))w=65536+((w&1023)<<10)+(c.charCodeAt(++y)&1023),l[d++]=w>>18|240,l[d++]=w>>12&63|128,l[d++]=w>>6&63|128,l[d++]=w&63|128;else l[d++]=w>>12|224,l[d++]=w>>6&63|128,l[d++]=w&63|128}}else if(f==="hex"){if(c=c.replace(/[^a-z0-9]+/ig,""),c.length%2!==0)c="0"+c;for(y=0;y<c.length;y+=2)l.push(parseInt(c[y]+c[y+1],16))}}else for(y=0;y<c.length;y++)l[y]=c[y]|0;return l}e.toArray=n;function o(c){var f="";for(var l=0;l<c.length;l++)f+=v(c[l].toString(16));return f}e.toHex=o;function s(c){var f=c>>>24|c>>>8&65280|c<<8&16711680|(c&255)<<24;return f>>>0}e.htonl=s;function h(c,f){var l="";for(var d=0;d<c.length;d++){var y=c[d];if(f==="little")y=s(y);l+=b(y.toString(16))}return l}e.toHex32=h;function v(c){if(c.length===1)return"0"+c;else return c}e.zero2=v;function b(c){if(c.length===7)return"0"+c;else if(c.length===6)return"00"+c;else if(c.length===5)return"000"+c;else if(c.length===4)return"0000"+c;else if(c.length===3)return"00000"+c;else if(c.length===2)return"000000"+c;else if(c.length===1)return"0000000"+c;else return c}e.zero8=b;function _(c,f,l,d){var y=l-f;t(y%4===0);var w=Array(y/4);for(var p=0,u=f;p<w.length;p++,u+=4){var m;if(d==="big")m=c[u]<<24|c[u+1]<<16|c[u+2]<<8|c[u+3];else m=c[u+3]<<24|c[u+2]<<16|c[u+1]<<8|c[u];w[p]=m>>>0}return w}e.join32=_;function g(c,f){var l=Array(c.length*4);for(var d=0,y=0;d<c.length;d++,y+=4){var w=c[d];if(f==="big")l[y]=w>>>24,l[y+1]=w>>>16&255,l[y+2]=w>>>8&255,l[y+3]=w&255;else l[y+3]=w>>>24,l[y+2]=w>>>16&255,l[y+1]=w>>>8&255,l[y]=w&255}return l}e.split32=g;function S(c,f){return c>>>f|c<<32-f}e.rotr32=S;function x(c,f){return c<<f|c>>>32-f}e.rotl32=x;function M(c,f){return c+f>>>0}e.sum32=M;function I(c,f,l){return c+f+l>>>0}e.sum32_3=I;function $(c,f,l,d){return c+f+l+d>>>0}e.sum32_4=$;function T(c,f,l,d,y){return c+f+l+d+y>>>0}e.sum32_5=T;function P(c,f,l,d){var y=c[f],w=c[f+1],p=d+w>>>0,u=(p<d?1:0)+l+y;c[f]=u>>>0,c[f+1]=p}e.sum64=P;function R(c,f,l,d){var y=f+d>>>0,w=(y<f?1:0)+c+l;return w>>>0}e.sum64_hi=R;function C(c,f,l,d){var y=f+d;return y>>>0}e.sum64_lo=C;function N(c,f,l,d,y,w,p,u){var m=0,E=f;E=E+d>>>0,m+=E<f?1:0,E=E+w>>>0,m+=E<w?1:0,E=E+u>>>0,m+=E<u?1:0;var k=c+l+y+p+m;return k>>>0}e.sum64_4_hi=N;function B(c,f,l,d,y,w,p,u){var m=f+d+w+u;return m>>>0}e.sum64_4_lo=B;function ie(c,f,l,d,y,w,p,u,m,E){var k=0,A=f;A=A+d>>>0,k+=A<f?1:0,A=A+w>>>0,k+=A<w?1:0,A=A+u>>>0,k+=A<u?1:0,A=A+E>>>0,k+=A<E?1:0;var D=c+l+y+p+m+k;return D>>>0}e.sum64_5_hi=ie;function le(c,f,l,d,y,w,p,u,m,E){var k=f+d+w+u+E;return k>>>0}e.sum64_5_lo=le;function ue(c,f,l){var d=f<<32-l|c>>>l;return d>>>0}e.rotr64_hi=ue;function F(c,f,l){var d=c<<32-l|f>>>l;return d>>>0}e.rotr64_lo=F;function ee(c,f,l){return c>>>l}e.shr64_hi=ee;function a(c,f,l){var d=c<<32-l|f>>>l;return d>>>0}e.shr64_lo=a}),Pa=ce((e)=>{var t=Jn(),r=Oi();function i(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=i,i.prototype.update=function(n,o){if(n=t.toArray(n,o),!this.pending)this.pending=n;else this.pending=this.pending.concat(n);if(this.pendingTotal+=n.length,this.pending.length>=this._delta8){n=this.pending;var s=n.length%this._delta8;if(this.pending=n.slice(n.length-s,n.length),this.pending.length===0)this.pending=null;n=t.join32(n,0,n.length-s,this.endian);for(var h=0;h<n.length;h+=this._delta32)this._update(n,h,h+this._delta32)}return this},i.prototype.digest=function(n){return this.update(this._pad()),r(this.pending===null),this._digest(n)},i.prototype._pad=function(){var n=this.pendingTotal,o=this._delta8,s=o-(n+this.padLength)%o,h=Array(s+this.padLength);h[0]=128;for(var v=1;v<s;v++)h[v]=0;if(n<<=3,this.endian==="big"){for(var b=8;b<this.padLength;b++)h[v++]=0;h[v++]=0,h[v++]=0,h[v++]=0,h[v++]=0,h[v++]=n>>>24&255,h[v++]=n>>>16&255,h[v++]=n>>>8&255,h[v++]=n&255}else{h[v++]=n&255,h[v++]=n>>>8&255,h[v++]=n>>>16&255,h[v++]=n>>>24&255,h[v++]=0,h[v++]=0,h[v++]=0,h[v++]=0;for(b=8;b<this.padLength;b++)h[v++]=0}return h}}),Ow=ce((e)=>{var t=Jn(),r=t.rotr32;function i(g,S,x,M){if(g===0)return n(S,x,M);if(g===1||g===3)return s(S,x,M);if(g===2)return o(S,x,M)}e.ft_1=i;function n(g,S,x){return g&S^~g&x}e.ch32=n;function o(g,S,x){return g&S^g&x^S&x}e.maj32=o;function s(g,S,x){return g^S^x}e.p32=s;function h(g){return r(g,2)^r(g,13)^r(g,22)}e.s0_256=h;function v(g){return r(g,6)^r(g,11)^r(g,25)}e.s1_256=v;function b(g){return r(g,7)^r(g,18)^g>>>3}e.g0_256=b;function _(g){return r(g,17)^r(g,19)^g>>>10}e.g1_256=_}),HT=ce((e,t)=>{var r=Jn(),i=Pa(),n=Ow(),o=r.rotl32,s=r.sum32,h=r.sum32_5,v=n.ft_1,b=i.BlockHash,_=[1518500249,1859775393,2400959708,3395469782];function g(){if(!(this instanceof g))return new g;b.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)}r.inherits(g,b),t.exports=g,g.blockSize=512,g.outSize=160,g.hmacStrength=80,g.padLength=64,g.prototype._update=function(S,x){var M=this.W;for(var I=0;I<16;I++)M[I]=S[x+I];for(;I<M.length;I++)M[I]=o(M[I-3]^M[I-8]^M[I-14]^M[I-16],1);var $=this.h[0],T=this.h[1],P=this.h[2],R=this.h[3],C=this.h[4];for(I=0;I<M.length;I++){var N=~~(I/20),B=h(o($,5),v(N,T,P,R),C,M[I],_[N]);C=R,R=P,P=o(T,30),T=$,$=B}this.h[0]=s(this.h[0],$),this.h[1]=s(this.h[1],T),this.h[2]=s(this.h[2],P),this.h[3]=s(this.h[3],R),this.h[4]=s(this.h[4],C)},g.prototype._digest=function(S){if(S==="hex")return r.toHex32(this.h,"big");else return r.split32(this.h,"big")}}),Dw=ce((e,t)=>{var r=Jn(),i=Pa(),n=Ow(),o=Oi(),s=r.sum32,h=r.sum32_4,v=r.sum32_5,b=n.ch32,_=n.maj32,g=n.s0_256,S=n.s1_256,x=n.g0_256,M=n.g1_256,I=i.BlockHash,$=[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];function T(){if(!(this instanceof T))return new T;I.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=$,this.W=Array(64)}r.inherits(T,I),t.exports=T,T.blockSize=512,T.outSize=256,T.hmacStrength=192,T.padLength=64,T.prototype._update=function(P,R){var C=this.W;for(var N=0;N<16;N++)C[N]=P[R+N];for(;N<C.length;N++)C[N]=h(M(C[N-2]),C[N-7],x(C[N-15]),C[N-16]);var B=this.h[0],ie=this.h[1],le=this.h[2],ue=this.h[3],F=this.h[4],ee=this.h[5],a=this.h[6],c=this.h[7];o(this.k.length===C.length);for(N=0;N<C.length;N++){var f=v(c,S(F),b(F,ee,a),this.k[N],C[N]),l=s(g(B),_(B,ie,le));c=a,a=ee,ee=F,F=s(ue,f),ue=le,le=ie,ie=B,B=s(f,l)}this.h[0]=s(this.h[0],B),this.h[1]=s(this.h[1],ie),this.h[2]=s(this.h[2],le),this.h[3]=s(this.h[3],ue),this.h[4]=s(this.h[4],F),this.h[5]=s(this.h[5],ee),this.h[6]=s(this.h[6],a),this.h[7]=s(this.h[7],c)},T.prototype._digest=function(P){if(P==="hex")return r.toHex32(this.h,"big");else return r.split32(this.h,"big")}}),ZT=ce((e,t)=>{var r=Jn(),i=Dw();function n(){if(!(this instanceof n))return new n;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}r.inherits(n,i),t.exports=n,n.blockSize=512,n.outSize=224,n.hmacStrength=192,n.padLength=64,n.prototype._digest=function(o){if(o==="hex")return r.toHex32(this.h.slice(0,7),"big");else return r.split32(this.h.slice(0,7),"big")}}),Nw=ce((e,t)=>{var r=Jn(),i=Pa(),n=Oi(),o=r.rotr64_hi,s=r.rotr64_lo,h=r.shr64_hi,v=r.shr64_lo,b=r.sum64,_=r.sum64_hi,g=r.sum64_lo,S=r.sum64_4_hi,x=r.sum64_4_lo,M=r.sum64_5_hi,I=r.sum64_5_lo,$=i.BlockHash,T=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function P(){if(!(this instanceof P))return new P;$.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=T,this.W=Array(160)}r.inherits(P,$),t.exports=P,P.blockSize=1024,P.outSize=512,P.hmacStrength=192,P.padLength=128,P.prototype._prepareBlock=function(l,d){var y=this.W;for(var w=0;w<32;w++)y[w]=l[d+w];for(;w<y.length;w+=2){var p=c(y[w-4],y[w-3]),u=f(y[w-4],y[w-3]),m=y[w-14],E=y[w-13],k=ee(y[w-30],y[w-29]),A=a(y[w-30],y[w-29]),D=y[w-32],U=y[w-31];y[w]=S(p,u,m,E,k,A,D,U),y[w+1]=x(p,u,m,E,k,A,D,U)}},P.prototype._update=function(l,d){this._prepareBlock(l,d);var y=this.W,w=this.h[0],p=this.h[1],u=this.h[2],m=this.h[3],E=this.h[4],k=this.h[5],A=this.h[6],D=this.h[7],U=this.h[8],K=this.h[9],he=this.h[10],J=this.h[11],H=this.h[12],se=this.h[13],V=this.h[14],Q=this.h[15];n(this.k.length===y.length);for(var He=0;He<y.length;He+=2){var z=V,L=Q,ae=ue(U,K),G=F(U,K),Y=R(U,K,he,J,H,se),Me=C(U,K,he,J,H,se),j=this.k[He],Z=this.k[He+1],je=y[He],W=y[He+1],re=M(z,L,ae,G,Y,Me,j,Z,je,W),at=I(z,L,ae,G,Y,Me,j,Z,je,W);z=ie(w,p),L=le(w,p),ae=N(w,p,u,m,E,k),G=B(w,p,u,m,E,k);var ge=_(z,L,ae,G),ye=g(z,L,ae,G);V=H,Q=se,H=he,se=J,he=U,J=K,U=_(A,D,re,at),K=g(D,D,re,at),A=E,D=k,E=u,k=m,u=w,m=p,w=_(re,at,ge,ye),p=g(re,at,ge,ye)}b(this.h,0,w,p),b(this.h,2,u,m),b(this.h,4,E,k),b(this.h,6,A,D),b(this.h,8,U,K),b(this.h,10,he,J),b(this.h,12,H,se),b(this.h,14,V,Q)},P.prototype._digest=function(l){if(l==="hex")return r.toHex32(this.h,"big");else return r.split32(this.h,"big")};function R(l,d,y,w,p){var u=l&y^~l&p;if(u<0)u+=4294967296;return u}function C(l,d,y,w,p,u){var m=d&w^~d&u;if(m<0)m+=4294967296;return m}function N(l,d,y,w,p){var u=l&y^l&p^y&p;if(u<0)u+=4294967296;return u}function B(l,d,y,w,p,u){var m=d&w^d&u^w&u;if(m<0)m+=4294967296;return m}function ie(l,d){var y=o(l,d,28),w=o(d,l,2),p=o(d,l,7),u=y^w^p;if(u<0)u+=4294967296;return u}function le(l,d){var y=s(l,d,28),w=s(d,l,2),p=s(d,l,7),u=y^w^p;if(u<0)u+=4294967296;return u}function ue(l,d){var y=o(l,d,14),w=o(l,d,18),p=o(d,l,9),u=y^w^p;if(u<0)u+=4294967296;return u}function F(l,d){var y=s(l,d,14),w=s(l,d,18),p=s(d,l,9),u=y^w^p;if(u<0)u+=4294967296;return u}function ee(l,d){var y=o(l,d,1),w=o(l,d,8),p=h(l,d,7),u=y^w^p;if(u<0)u+=4294967296;return u}function a(l,d){var y=s(l,d,1),w=s(l,d,8),p=v(l,d,7),u=y^w^p;if(u<0)u+=4294967296;return u}function c(l,d){var y=o(l,d,19),w=o(d,l,29),p=h(l,d,6),u=y^w^p;if(u<0)u+=4294967296;return u}function f(l,d){var y=s(l,d,19),w=s(d,l,29),p=v(l,d,6),u=y^w^p;if(u<0)u+=4294967296;return u}}),KT=ce((e,t)=>{var r=Jn(),i=Nw();function n(){if(!(this instanceof n))return new n;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}r.inherits(n,i),t.exports=n,n.blockSize=1024,n.outSize=384,n.hmacStrength=192,n.padLength=128,n.prototype._digest=function(o){if(o==="hex")return r.toHex32(this.h.slice(0,12),"big");else return r.split32(this.h.slice(0,12),"big")}}),VT=ce((e)=>{e.sha1=HT(),e.sha224=ZT(),e.sha256=Dw(),e.sha384=KT(),e.sha512=Nw()}),WT=ce((e)=>{var t=Jn(),r=Pa(),i=t.rotl32,n=t.sum32,o=t.sum32_3,s=t.sum32_4,h=r.BlockHash;function v(){if(!(this instanceof v))return new v;h.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}t.inherits(v,h),e.ripemd160=v,v.blockSize=512,v.outSize=160,v.hmacStrength=192,v.padLength=64,v.prototype._update=function($,T){var P=this.h[0],R=this.h[1],C=this.h[2],N=this.h[3],B=this.h[4],ie=P,le=R,ue=C,F=N,ee=B;for(var a=0;a<80;a++){var c=n(i(s(P,b(a,R,C,N),$[S[a]+T],_(a)),M[a]),B);P=B,B=N,N=i(C,10),C=R,R=c,c=n(i(s(ie,b(79-a,le,ue,F),$[x[a]+T],g(a)),I[a]),ee),ie=ee,ee=F,F=i(ue,10),ue=le,le=c}c=o(this.h[1],C,F),this.h[1]=o(this.h[2],N,ee),this.h[2]=o(this.h[3],B,ie),this.h[3]=o(this.h[4],P,le),this.h[4]=o(this.h[0],R,ue),this.h[0]=c},v.prototype._digest=function($){if($==="hex")return t.toHex32(this.h,"little");else return t.split32(this.h,"little")};function b($,T,P,R){if($<=15)return T^P^R;else if($<=31)return T&P|~T&R;else if($<=47)return(T|~P)^R;else if($<=63)return T&R|P&~R;else return T^(P|~R)}function _($){if($<=15)return 0;else if($<=31)return 1518500249;else if($<=47)return 1859775393;else if($<=63)return 2400959708;else return 2840853838}function g($){if($<=15)return 1352829926;else if($<=31)return 1548603684;else if($<=47)return 1836072691;else if($<=63)return 2053994217;else return 0}var S=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],x=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],M=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],I=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]}),GT=ce((e,t)=>{var r=Jn(),i=Oi();function n(o,s,h){if(!(this instanceof n))return new n(o,s,h);this.Hash=o,this.blockSize=o.blockSize/8,this.outSize=o.outSize/8,this.inner=null,this.outer=null,this._init(r.toArray(s,h))}t.exports=n,n.prototype._init=function(o){if(o.length>this.blockSize)o=new this.Hash().update(o).digest();i(o.length<=this.blockSize);for(var s=o.length;s<this.blockSize;s++)o.push(0);for(s=0;s<o.length;s++)o[s]^=54;this.inner=new this.Hash().update(o);for(s=0;s<o.length;s++)o[s]^=106;this.outer=new this.Hash().update(o)},n.prototype.update=function(o,s){return this.inner.update(o,s),this},n.prototype.digest=function(o){return this.outer.update(this.inner.digest()),this.outer.digest(o)}}),jm=ce((e)=>{var t=e;t.utils=Jn(),t.common=Pa(),t.sha=VT(),t.ripemd=WT(),t.hmac=GT(),t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160}),JT=ce((e,t)=>{t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}}),Um=ce((e)=>{var t=e,r=jm(),i=Cw(),n=xn(),o=n.assert;function s(b){if(b.type==="short")this.curve=new i.short(b);else if(b.type==="edwards")this.curve=new i.edwards(b);else this.curve=new i.mont(b);this.g=this.curve.g,this.n=this.curve.n,this.hash=b.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}t.PresetCurve=s;function h(b,_){Object.defineProperty(t,b,{configurable:!0,enumerable:!0,get:function(){var g=new s(_);return Object.defineProperty(t,b,{configurable:!0,enumerable:!0,value:g}),g}})}h("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:r.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),h("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:r.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),h("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:r.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),h("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:r.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),h("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:r.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),h("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["9"]}),h("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var v;try{v=JT()}catch(b){v=void 0}h("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:r.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",v]})}),XT=ce((e,t)=>{var r=jm(),i=Aw(),n=Oi();function o(s){if(!(this instanceof o))return new o(s);this.hash=s.hash,this.predResist=!!s.predResist,this.outLen=this.hash.outSize,this.minEntropy=s.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var h=i.toArray(s.entropy,s.entropyEnc||"hex"),v=i.toArray(s.nonce,s.nonceEnc||"hex"),b=i.toArray(s.pers,s.persEnc||"hex");n(h.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(h,v,b)}t.exports=o,o.prototype._init=function(s,h,v){var b=s.concat(h).concat(v);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var _=0;_<this.V.length;_++)this.K[_]=0,this.V[_]=1;this._update(b),this._reseed=1,this.reseedInterval=281474976710656},o.prototype._hmac=function(){return new r.hmac(this.hash,this.K)},o.prototype._update=function(s){var h=this._hmac().update(this.V).update([0]);if(s)h=h.update(s);if(this.K=h.digest(),this.V=this._hmac().update(this.V).digest(),!s)return;this.K=this._hmac().update(this.V).update([1]).update(s).digest(),this.V=this._hmac().update(this.V).digest()},o.prototype.reseed=function(s,h,v,b){if(typeof h!=="string")b=v,v=h,h=null;s=i.toArray(s,h),v=i.toArray(v,b),n(s.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(s.concat(v||[])),this._reseed=1},o.prototype.generate=function(s,h,v,b){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");if(typeof h!=="string")b=v,v=h,h=null;if(v)v=i.toArray(v,b||"hex"),this._update(v);var _=[];while(_.length<s)this.V=this._hmac().update(this.V).digest(),_=_.concat(this.V);var g=_.slice(0,s);return this._update(v),this._reseed++,i.encode(g,h)}}),YT=ce((e,t)=>{var r=ai(),i=xn(),n=i.assert;function o(s,h){if(this.ec=s,this.priv=null,this.pub=null,h.priv)this._importPrivate(h.priv,h.privEnc);if(h.pub)this._importPublic(h.pub,h.pubEnc)}t.exports=o,o.fromPublic=function(s,h,v){if(h instanceof o)return h;return new o(s,{pub:h,pubEnc:v})},o.fromPrivate=function(s,h,v){if(h instanceof o)return h;return new o(s,{priv:h,privEnc:v})},o.prototype.validate=function(){var s=this.getPublic();if(s.isInfinity())return{result:!1,reason:"Invalid public key"};if(!s.validate())return{result:!1,reason:"Public key is not a point"};if(!s.mul(this.ec.curve.n).isInfinity())return{result:!1,reason:"Public key * N != O"};return{result:!0,reason:null}},o.prototype.getPublic=function(s,h){if(typeof s==="string")h=s,s=null;if(!this.pub)this.pub=this.ec.g.mul(this.priv);if(!h)return this.pub;return this.pub.encode(h,s)},o.prototype.getPrivate=function(s){if(s==="hex")return this.priv.toString(16,2);else return this.priv},o.prototype._importPrivate=function(s,h){this.priv=new r(s,h||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(s,h){if(s.x||s.y){if(this.ec.curve.type==="mont")n(s.x,"Need x coordinate");else if(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")n(s.x&&s.y,"Need both x and y coordinate");this.pub=this.ec.curve.point(s.x,s.y);return}this.pub=this.ec.curve.decodePoint(s,h)},o.prototype.derive=function(s){if(!s.validate())n(s.validate(),"public point not validated");return s.mul(this.priv).getX()},o.prototype.sign=function(s,h,v){return this.ec.sign(s,this,h,v)},o.prototype.verify=function(s,h,v){return this.ec.verify(s,h,this,void 0,v)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}}),QT=ce((e,t)=>{var r=ai(),i=xn(),n=i.assert;function o(_,g){if(_ instanceof o)return _;if(this._importDER(_,g))return;if(n(_.r&&_.s,"Signature without r or s"),this.r=new r(_.r,16),this.s=new r(_.s,16),_.recoveryParam===void 0)this.recoveryParam=null;else this.recoveryParam=_.recoveryParam}t.exports=o;function s(){this.place=0}function h(_,g){var S=_[g.place++];if(!(S&128))return S;var x=S&15;if(x===0||x>4)return!1;if(_[g.place]===0)return!1;var M=0;for(var I=0,$=g.place;I<x;I++,$++)M<<=8,M|=_[$],M>>>=0;if(M<=127)return!1;return g.place=$,M}function v(_){var g=0,S=_.length-1;while(!_[g]&&!(_[g+1]&128)&&g<S)g++;if(g===0)return _;return _.slice(g)}o.prototype._importDER=function(_,g){_=i.toArray(_,g);var S=new s;if(_[S.place++]!==48)return!1;var x=h(_,S);if(x===!1)return!1;if(x+S.place!==_.length)return!1;if(_[S.place++]!==2)return!1;var M=h(_,S);if(M===!1)return!1;if((_[S.place]&128)!==0)return!1;var I=_.slice(S.place,M+S.place);if(S.place+=M,_[S.place++]!==2)return!1;var $=h(_,S);if($===!1)return!1;if(_.length!==$+S.place)return!1;if((_[S.place]&128)!==0)return!1;var T=_.slice(S.place,$+S.place);if(I[0]===0)if(I[1]&128)I=I.slice(1);else return!1;if(T[0]===0)if(T[1]&128)T=T.slice(1);else return!1;return this.r=new r(I),this.s=new r(T),this.recoveryParam=null,!0};function b(_,g){if(g<128){_.push(g);return}var S=1+(Math.log(g)/Math.LN2>>>3);_.push(S|128);while(--S)_.push(g>>>(S<<3)&255);_.push(g)}o.prototype.toDER=function(_){var g=this.r.toArray(),S=this.s.toArray();if(g[0]&128)g=[0].concat(g);if(S[0]&128)S=[0].concat(S);g=v(g),S=v(S);while(!S[0]&&!(S[1]&128))S=S.slice(1);var x=[2];b(x,g.length),x=x.concat(g),x.push(2),b(x,S.length);var M=x.concat(S),I=[48];return b(I,M.length),I=I.concat(M),i.encode(I,_)}}),eP=ce((e,t)=>{var r=ai(),i=XT(),n=xn(),o=Um(),s=Rw(),h=n.assert,v=YT(),b=QT();function _(g){if(!(this instanceof _))return new _(g);if(typeof g==="string")h(Object.prototype.hasOwnProperty.call(o,g),"Unknown curve "+g),g=o[g];if(g instanceof o.PresetCurve)g={curve:g};this.curve=g.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=g.curve.g,this.g.precompute(g.curve.n.bitLength()+1),this.hash=g.hash||g.curve.hash}t.exports=_,_.prototype.keyPair=function(g){return new v(this,g)},_.prototype.keyFromPrivate=function(g,S){return v.fromPrivate(this,g,S)},_.prototype.keyFromPublic=function(g,S){return v.fromPublic(this,g,S)},_.prototype.genKeyPair=function(g){if(!g)g={};var S=new i({hash:this.hash,pers:g.pers,persEnc:g.persEnc||"utf8",entropy:g.entropy||s(this.hash.hmacStrength),entropyEnc:g.entropy&&g.entropyEnc||"utf8",nonce:this.n.toArray()}),x=this.n.byteLength(),M=this.n.sub(new r(2));for(;;){var I=new r(S.generate(x));if(I.cmp(M)>0)continue;return I.iaddn(1),this.keyFromPrivate(I)}},_.prototype._truncateToN=function(g,S,x){var M;if(r.isBN(g)||typeof g==="number")g=new r(g,16),M=g.byteLength();else if(typeof g==="object")M=g.length,g=new r(g,16);else{var I=g.toString();M=I.length+1>>>1,g=new r(I,16)}if(typeof x!=="number")x=M*8;var $=x-this.n.bitLength();if($>0)g=g.ushrn($);if(!S&&g.cmp(this.n)>=0)return g.sub(this.n);else return g},_.prototype.sign=function(g,S,x,M){if(typeof x==="object")M=x,x=null;if(!M)M={};if(typeof g!=="string"&&typeof g!=="number"&&!r.isBN(g)){h(typeof g==="object"&&g&&typeof g.length==="number","Expected message to be an array-like, a hex string, or a BN instance"),h(g.length>>>0===g.length);for(var I=0;I<g.length;I++)h((g[I]&255)===g[I])}S=this.keyFromPrivate(S,x),g=this._truncateToN(g,!1,M.msgBitLength),h(!g.isNeg(),"Can not sign a negative message");var $=this.n.byteLength(),T=S.getPrivate().toArray("be",$),P=g.toArray("be",$);h(new r(P).eq(g),"Can not sign message");var R=new i({hash:this.hash,entropy:T,nonce:P,pers:M.pers,persEnc:M.persEnc||"utf8"}),C=this.n.sub(new r(1));for(var N=0;;N++){var B=M.k?M.k(N):new r(R.generate(this.n.byteLength()));if(B=this._truncateToN(B,!0),B.cmpn(1)<=0||B.cmp(C)>=0)continue;var ie=this.g.mul(B);if(ie.isInfinity())continue;var le=ie.getX(),ue=le.umod(this.n);if(ue.cmpn(0)===0)continue;var F=B.invm(this.n).mul(ue.mul(S.getPrivate()).iadd(g));if(F=F.umod(this.n),F.cmpn(0)===0)continue;var ee=(ie.getY().isOdd()?1:0)|(le.cmp(ue)!==0?2:0);if(M.canonical&&F.cmp(this.nh)>0)F=this.n.sub(F),ee^=1;return new b({r:ue,s:F,recoveryParam:ee})}},_.prototype.verify=function(g,S,x,M,I){if(!I)I={};g=this._truncateToN(g,!1,I.msgBitLength),x=this.keyFromPublic(x,M),S=new b(S,"hex");var{r:$,s:T}=S;if($.cmpn(1)<0||$.cmp(this.n)>=0)return!1;if(T.cmpn(1)<0||T.cmp(this.n)>=0)return!1;var P=T.invm(this.n),R=P.mul(g).umod(this.n),C=P.mul($).umod(this.n),N;if(!this.curve._maxwellTrick){if(N=this.g.mulAdd(R,x.getPublic(),C),N.isInfinity())return!1;return N.getX().umod(this.n).cmp($)===0}if(N=this.g.jmulAdd(R,x.getPublic(),C),N.isInfinity())return!1;return N.eqXToP($)},_.prototype.recoverPubKey=function(g,S,x,M){h((3&x)===x,"The recovery param is more than two bits"),S=new b(S,M);var I=this.n,$=new r(g),T=S.r,P=S.s,R=x&1,C=x>>1;if(T.cmp(this.curve.p.umod(this.curve.n))>=0&&C)throw Error("Unable to find sencond key candinate");if(C)T=this.curve.pointFromX(T.add(this.curve.n),R);else T=this.curve.pointFromX(T,R);var N=S.r.invm(I),B=I.sub($).mul(N).umod(I),ie=P.mul(N).umod(I);return this.g.mulAdd(B,T,ie)},_.prototype.getKeyRecoveryParam=function(g,S,x,M){if(S=new b(S,M),S.recoveryParam!==null)return S.recoveryParam;for(var I=0;I<4;I++){var $;try{$=this.recoverPubKey(g,S,I)}catch(T){continue}if($.eq(x))return I}throw Error("Unable to find valid recovery factor")}}),tP=ce((e,t)=>{var r=xn(),i=r.assert,n=r.parseBytes,o=r.cachedProperty;function s(h,v){if(this.eddsa=h,this._secret=n(v.secret),h.isPoint(v.pub))this._pub=v.pub;else this._pubBytes=n(v.pub)}s.fromPublic=function(h,v){if(v instanceof s)return v;return new s(h,{pub:v})},s.fromSecret=function(h,v){if(v instanceof s)return v;return new s(h,{secret:v})},s.prototype.secret=function(){return this._secret},o(s,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),o(s,"pub",function(){if(this._pubBytes)return this.eddsa.decodePoint(this._pubBytes);return this.eddsa.g.mul(this.priv())}),o(s,"privBytes",function(){var h=this.eddsa,v=this.hash(),b=h.encodingLength-1,_=v.slice(0,h.encodingLength);return _[0]&=248,_[b]&=127,_[b]|=64,_}),o(s,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),o(s,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),o(s,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),s.prototype.sign=function(h){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(h,this)},s.prototype.verify=function(h,v){return this.eddsa.verify(h,v,this)},s.prototype.getSecret=function(h){return i(this._secret,"KeyPair is public only"),r.encode(this.secret(),h)},s.prototype.getPublic=function(h){return r.encode(this.pubBytes(),h)},t.exports=s}),rP=ce((e,t)=>{var r=ai(),i=xn(),n=i.assert,o=i.cachedProperty,s=i.parseBytes;function h(v,b){if(this.eddsa=v,typeof b!=="object")b=s(b);if(Array.isArray(b))n(b.length===v.encodingLength*2,"Signature has invalid size"),b={R:b.slice(0,v.encodingLength),S:b.slice(v.encodingLength)};if(n(b.R&&b.S,"Signature without R or S"),v.isPoint(b.R))this._R=b.R;if(b.S instanceof r)this._S=b.S;this._Rencoded=Array.isArray(b.R)?b.R:b.Rencoded,this._Sencoded=Array.isArray(b.S)?b.S:b.Sencoded}o(h,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),o(h,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),o(h,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),o(h,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),h.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},h.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},t.exports=h}),nP=ce((e,t)=>{var r=jm(),i=Um(),n=xn(),o=n.assert,s=n.parseBytes,h=tP(),v=rP();function b(_){if(o(_==="ed25519","only tested with ed25519 so far"),!(this instanceof b))return new b(_);_=i[_].curve,this.curve=_,this.g=_.g,this.g.precompute(_.n.bitLength()+1),this.pointClass=_.point().constructor,this.encodingLength=Math.ceil(_.n.bitLength()/8),this.hash=r.sha512}t.exports=b,b.prototype.sign=function(_,g){_=s(_);var S=this.keyFromSecret(g),x=this.hashInt(S.messagePrefix(),_),M=this.g.mul(x),I=this.encodePoint(M),$=this.hashInt(I,S.pubBytes(),_).mul(S.priv()),T=x.add($).umod(this.curve.n);return this.makeSignature({R:M,S:T,Rencoded:I})},b.prototype.verify=function(_,g,S){if(_=s(_),g=this.makeSignature(g),g.S().gte(g.eddsa.curve.n)||g.S().isNeg())return!1;var x=this.keyFromPublic(S),M=this.hashInt(g.Rencoded(),x.pubBytes(),_),I=this.g.mul(g.S()),$=g.R().add(x.pub().mul(M));return $.eq(I)},b.prototype.hashInt=function(){var _=this.hash();for(var g=0;g<arguments.length;g++)_.update(arguments[g]);return n.intFromLE(_.digest()).umod(this.curve.n)},b.prototype.keyFromPublic=function(_){return h.fromPublic(this,_)},b.prototype.keyFromSecret=function(_){return h.fromSecret(this,_)},b.prototype.makeSignature=function(_){if(_ instanceof v)return _;return new v(this,_)},b.prototype.encodePoint=function(_){var g=_.getY().toArray("le",this.encodingLength);return g[this.encodingLength-1]|=_.getX().isOdd()?128:0,g},b.prototype.decodePoint=function(_){_=n.parseBytes(_);var g=_.length-1,S=_.slice(0,g).concat(_[g]&-129),x=(_[g]&128)!==0,M=n.intFromLE(S);return this.curve.pointFromY(M,x)},b.prototype.encodeInt=function(_){return _.toArray("le",this.encodingLength)},b.prototype.decodeInt=function(_){return n.intFromLE(_)},b.prototype.isPoint=function(_){return _ instanceof this.pointClass}}),iP=ce((e)=>{var t=e;t.version=UT().version,t.utils=xn(),t.rand=Rw(),t.curve=Cw(),t.curves=Um(),t.ec=eP(),t.eddsa=nP()}),oP=ce((e,t)=>{(function(r,i){function n(a,c){if(!a)throw Error(c||"Assertion failed")}function o(a,c){a.super_=c;var f=function(){};f.prototype=c.prototype,a.prototype=new f,a.prototype.constructor=a}function s(a,c,f){if(s.isBN(a))return a;if(this.negative=0,this.words=null,this.length=0,this.red=null,a!==null){if(c==="le"||c==="be")f=c,c=10;this._init(a||0,c||10,f||"be")}}if(typeof r==="object")r.exports=s;else i.BN=s;s.BN=s,s.wordSize=26;var h;try{if(typeof window<"u"&&typeof window.Buffer<"u")h=window.Buffer;else h=(Tr(),kt($r)).Buffer}catch(a){}s.isBN=function(a){if(a instanceof s)return!0;return a!==null&&typeof a==="object"&&a.constructor.wordSize===s.wordSize&&Array.isArray(a.words)},s.max=function(a,c){if(a.cmp(c)>0)return a;return c},s.min=function(a,c){if(a.cmp(c)<0)return a;return c},s.prototype._init=function(a,c,f){if(typeof a==="number")return this._initNumber(a,c,f);if(typeof a==="object")return this._initArray(a,c,f);if(c==="hex")c=16;n(c===(c|0)&&c>=2&&c<=36),a=a.toString().replace(/\s+/g,"");var l=0;if(a[0]==="-")l++,this.negative=1;if(l<a.length){if(c===16)this._parseHex(a,l,f);else if(this._parseBase(a,c,l),f==="le")this._initArray(this.toArray(),c,f)}},s.prototype._initNumber=function(a,c,f){if(a<0)this.negative=1,a=-a;if(a<67108864)this.words=[a&67108863],this.length=1;else if(a<4503599627370496)this.words=[a&67108863,a/67108864&67108863],this.length=2;else n(a<9007199254740992),this.words=[a&67108863,a/67108864&67108863,1],this.length=3;if(f!=="le")return;this._initArray(this.toArray(),c,f)},s.prototype._initArray=function(a,c,f){if(n(typeof a.length==="number"),a.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(a.length/3),this.words=Array(this.length);for(var l=0;l<this.length;l++)this.words[l]=0;var d,y,w=0;if(f==="be"){for(l=a.length-1,d=0;l>=0;l-=3)if(y=a[l]|a[l-1]<<8|a[l-2]<<16,this.words[d]|=y<<w&67108863,this.words[d+1]=y>>>26-w&67108863,w+=24,w>=26)w-=26,d++}else if(f==="le"){for(l=0,d=0;l<a.length;l+=3)if(y=a[l]|a[l+1]<<8|a[l+2]<<16,this.words[d]|=y<<w&67108863,this.words[d+1]=y>>>26-w&67108863,w+=24,w>=26)w-=26,d++}return this.strip()};function v(a,c){var f=a.charCodeAt(c);if(f>=65&&f<=70)return f-55;else if(f>=97&&f<=102)return f-87;else return f-48&15}function b(a,c,f){var l=v(a,f);if(f-1>=c)l|=v(a,f-1)<<4;return l}s.prototype._parseHex=function(a,c,f){this.length=Math.ceil((a.length-c)/6),this.words=Array(this.length);for(var l=0;l<this.length;l++)this.words[l]=0;var d=0,y=0,w;if(f==="be")for(l=a.length-1;l>=c;l-=2)if(w=b(a,c,l)<<d,this.words[y]|=w&67108863,d>=18)d-=18,y+=1,this.words[y]|=w>>>26;else d+=8;else{var p=a.length-c;for(l=p%2===0?c+1:c;l<a.length;l+=2)if(w=b(a,c,l)<<d,this.words[y]|=w&67108863,d>=18)d-=18,y+=1,this.words[y]|=w>>>26;else d+=8}this.strip()};function _(a,c,f,l){var d=0,y=Math.min(a.length,f);for(var w=c;w<y;w++){var p=a.charCodeAt(w)-48;if(d*=l,p>=49)d+=p-49+10;else if(p>=17)d+=p-17+10;else d+=p}return d}s.prototype._parseBase=function(a,c,f){this.words=[0],this.length=1;for(var l=0,d=1;d<=67108863;d*=c)l++;l--,d=d/c|0;var y=a.length-f,w=y%l,p=Math.min(y,y-w)+f,u=0;for(var m=f;m<p;m+=l)if(u=_(a,m,m+l,c),this.imuln(d),this.words[0]+u<67108864)this.words[0]+=u;else this._iaddn(u);if(w!==0){var E=1;u=_(a,m,a.length,c);for(m=0;m<w;m++)E*=c;if(this.imuln(E),this.words[0]+u<67108864)this.words[0]+=u;else this._iaddn(u)}this.strip()},s.prototype.copy=function(a){a.words=Array(this.length);for(var c=0;c<this.length;c++)a.words[c]=this.words[c];a.length=this.length,a.negative=this.negative,a.red=this.red},s.prototype.clone=function(){var a=new s(null);return this.copy(a),a},s.prototype._expand=function(a){while(this.length<a)this.words[this.length++]=0;return this},s.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},s.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},s.prototype.inspect=function(){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"],S=[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],x=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(s.prototype.toString=function(a,c){a=a||10,c=c|0||1;var f;if(a===16||a==="hex"){f="";var l=0,d=0;for(var y=0;y<this.length;y++){var w=this.words[y],p=((w<<l|d)&16777215).toString(16);if(d=w>>>24-l&16777215,l+=2,l>=26)l-=26,y--;if(d!==0||y!==this.length-1)f=g[6-p.length]+p+f;else f=p+f}if(d!==0)f=d.toString(16)+f;while(f.length%c!==0)f="0"+f;if(this.negative!==0)f="-"+f;return f}if(a===(a|0)&&a>=2&&a<=36){var u=S[a],m=x[a];f="";var E=this.clone();E.negative=0;while(!E.isZero()){var k=E.modn(m).toString(a);if(E=E.idivn(m),!E.isZero())f=g[u-k.length]+k+f;else f=k+f}if(this.isZero())f="0"+f;while(f.length%c!==0)f="0"+f;if(this.negative!==0)f="-"+f;return f}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var a=this.words[0];if(this.length===2)a+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)a+=4503599627370496+this.words[1]*67108864;else if(this.length>2)n(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-a:a},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(a,c){return n(typeof h<"u"),this.toArrayLike(h,a,c)},s.prototype.toArray=function(a,c){return this.toArrayLike(Array,a,c)},s.prototype.toArrayLike=function(a,c,f){var l=this.byteLength(),d=f||Math.max(1,l);n(l<=d,"byte array longer than desired length"),n(d>0,"Requested array length <= 0"),this.strip();var y=c==="le",w=new a(d),p,u,m=this.clone();if(!y){for(u=0;u<d-l;u++)w[u]=0;for(u=0;!m.isZero();u++)p=m.andln(255),m.iushrn(8),w[d-u-1]=p}else{for(u=0;!m.isZero();u++)p=m.andln(255),m.iushrn(8),w[u]=p;for(;u<d;u++)w[u]=0}return w},Math.clz32)s.prototype._countBits=function(a){return 32-Math.clz32(a)};else s.prototype._countBits=function(a){var c=a,f=0;if(c>=4096)f+=13,c>>>=13;if(c>=64)f+=7,c>>>=7;if(c>=8)f+=4,c>>>=4;if(c>=2)f+=2,c>>>=2;return f+c};s.prototype._zeroBits=function(a){if(a===0)return 26;var c=a,f=0;if((c&8191)===0)f+=13,c>>>=13;if((c&127)===0)f+=7,c>>>=7;if((c&15)===0)f+=4,c>>>=4;if((c&3)===0)f+=2,c>>>=2;if((c&1)===0)f++;return f},s.prototype.bitLength=function(){var a=this.words[this.length-1],c=this._countBits(a);return(this.length-1)*26+c};function M(a){var c=Array(a.bitLength());for(var f=0;f<c.length;f++){var l=f/26|0,d=f%26;c[f]=(a.words[l]&1<<d)>>>d}return c}s.prototype.zeroBits=function(){if(this.isZero())return 0;var a=0;for(var c=0;c<this.length;c++){var f=this._zeroBits(this.words[c]);if(a+=f,f!==26)break}return a},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(a){if(this.negative!==0)return this.abs().inotn(a).iaddn(1);return this.clone()},s.prototype.fromTwos=function(a){if(this.testn(a-1))return this.notn(a).iaddn(1).ineg();return this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},s.prototype.iuor=function(a){while(this.length<a.length)this.words[this.length++]=0;for(var c=0;c<a.length;c++)this.words[c]=this.words[c]|a.words[c];return this.strip()},s.prototype.ior=function(a){return n((this.negative|a.negative)===0),this.iuor(a)},s.prototype.or=function(a){if(this.length>a.length)return this.clone().ior(a);return a.clone().ior(this)},s.prototype.uor=function(a){if(this.length>a.length)return this.clone().iuor(a);return a.clone().iuor(this)},s.prototype.iuand=function(a){var c;if(this.length>a.length)c=a;else c=this;for(var f=0;f<c.length;f++)this.words[f]=this.words[f]&a.words[f];return this.length=c.length,this.strip()},s.prototype.iand=function(a){return n((this.negative|a.negative)===0),this.iuand(a)},s.prototype.and=function(a){if(this.length>a.length)return this.clone().iand(a);return a.clone().iand(this)},s.prototype.uand=function(a){if(this.length>a.length)return this.clone().iuand(a);return a.clone().iuand(this)},s.prototype.iuxor=function(a){var c,f;if(this.length>a.length)c=this,f=a;else c=a,f=this;for(var l=0;l<f.length;l++)this.words[l]=c.words[l]^f.words[l];if(this!==c)for(;l<c.length;l++)this.words[l]=c.words[l];return this.length=c.length,this.strip()},s.prototype.ixor=function(a){return n((this.negative|a.negative)===0),this.iuxor(a)},s.prototype.xor=function(a){if(this.length>a.length)return this.clone().ixor(a);return a.clone().ixor(this)},s.prototype.uxor=function(a){if(this.length>a.length)return this.clone().iuxor(a);return a.clone().iuxor(this)},s.prototype.inotn=function(a){n(typeof a==="number"&&a>=0);var c=Math.ceil(a/26)|0,f=a%26;if(this._expand(c),f>0)c--;for(var l=0;l<c;l++)this.words[l]=~this.words[l]&67108863;if(f>0)this.words[l]=~this.words[l]&67108863>>26-f;return this.strip()},s.prototype.notn=function(a){return this.clone().inotn(a)},s.prototype.setn=function(a,c){n(typeof a==="number"&&a>=0);var f=a/26|0,l=a%26;if(this._expand(f+1),c)this.words[f]=this.words[f]|1<<l;else this.words[f]=this.words[f]&~(1<<l);return this.strip()},s.prototype.iadd=function(a){var c;if(this.negative!==0&&a.negative===0)return this.negative=0,c=this.isub(a),this.negative^=1,this._normSign();else if(this.negative===0&&a.negative!==0)return a.negative=0,c=this.isub(a),a.negative=1,c._normSign();var f,l;if(this.length>a.length)f=this,l=a;else f=a,l=this;var d=0;for(var y=0;y<l.length;y++)c=(f.words[y]|0)+(l.words[y]|0)+d,this.words[y]=c&67108863,d=c>>>26;for(;d!==0&&y<f.length;y++)c=(f.words[y]|0)+d,this.words[y]=c&67108863,d=c>>>26;if(this.length=f.length,d!==0)this.words[this.length]=d,this.length++;else if(f!==this)for(;y<f.length;y++)this.words[y]=f.words[y];return this},s.prototype.add=function(a){var c;if(a.negative!==0&&this.negative===0)return a.negative=0,c=this.sub(a),a.negative^=1,c;else if(a.negative===0&&this.negative!==0)return this.negative=0,c=a.sub(this),this.negative=1,c;if(this.length>a.length)return this.clone().iadd(a);return a.clone().iadd(this)},s.prototype.isub=function(a){if(a.negative!==0){a.negative=0;var c=this.iadd(a);return a.negative=1,c._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(a),this.negative=1,this._normSign();var f=this.cmp(a);if(f===0)return this.negative=0,this.length=1,this.words[0]=0,this;var l,d;if(f>0)l=this,d=a;else l=a,d=this;var y=0;for(var w=0;w<d.length;w++)c=(l.words[w]|0)-(d.words[w]|0)+y,y=c>>26,this.words[w]=c&67108863;for(;y!==0&&w<l.length;w++)c=(l.words[w]|0)+y,y=c>>26,this.words[w]=c&67108863;if(y===0&&w<l.length&&l!==this)for(;w<l.length;w++)this.words[w]=l.words[w];if(this.length=Math.max(this.length,w),l!==this)this.negative=1;return this.strip()},s.prototype.sub=function(a){return this.clone().isub(a)};function I(a,c,f){f.negative=c.negative^a.negative;var l=a.length+c.length|0;f.length=l,l=l-1|0;var d=a.words[0]|0,y=c.words[0]|0,w=d*y,p=w&67108863,u=w/67108864|0;f.words[0]=p;for(var m=1;m<l;m++){var E=u>>>26,k=u&67108863,A=Math.min(m,c.length-1);for(var D=Math.max(0,m-a.length+1);D<=A;D++){var U=m-D|0;d=a.words[U]|0,y=c.words[D]|0,w=d*y+k,E+=w/67108864|0,k=w&67108863}f.words[m]=k|0,u=E|0}if(u!==0)f.words[m]=u|0;else f.length--;return f.strip()}var $=function(a,c,f){var l=a.words,d=c.words,y=f.words,w=0,p,u,m,E=l[0]|0,k=E&8191,A=E>>>13,D=l[1]|0,U=D&8191,K=D>>>13,he=l[2]|0,J=he&8191,H=he>>>13,se=l[3]|0,V=se&8191,Q=se>>>13,He=l[4]|0,z=He&8191,L=He>>>13,ae=l[5]|0,G=ae&8191,Y=ae>>>13,Me=l[6]|0,j=Me&8191,Z=Me>>>13,je=l[7]|0,W=je&8191,re=je>>>13,at=l[8]|0,ge=at&8191,ye=at>>>13,Gt=l[9]|0,pe=Gt&8191,ve=Gt>>>13,tr=d[0]|0,xe=tr&8191,Se=tr>>>13,zr=d[1]|0,Ee=zr&8191,Re=zr>>>13,jr=d[2]|0,Ce=jr&8191,Ie=jr>>>13,Pr=d[3]|0,Oe=Pr&8191,$e=Pr>>>13,kr=d[4]|0,De=kr&8191,Ne=kr>>>13,Mr=d[5]|0,Te=Mr&8191,O=Mr>>>13,q=d[6]|0,X=q&8191,te=q>>>13,Ge=d[7]|0,me=Ge&8191,we=Ge>>>13,Jt=d[8]|0,Pe=Jt&8191,ze=Jt>>>13,Ar=d[9]|0,Ae=Ar&8191,ke=Ar>>>13;f.negative=a.negative^c.negative,f.length=19,p=Math.imul(k,xe),u=Math.imul(k,Se),u=u+Math.imul(A,xe)|0,m=Math.imul(A,Se);var Xt=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,p=Math.imul(U,xe),u=Math.imul(U,Se),u=u+Math.imul(K,xe)|0,m=Math.imul(K,Se),p=p+Math.imul(k,Ee)|0,u=u+Math.imul(k,Re)|0,u=u+Math.imul(A,Ee)|0,m=m+Math.imul(A,Re)|0;var mt=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(mt>>>26)|0,mt&=67108863,p=Math.imul(J,xe),u=Math.imul(J,Se),u=u+Math.imul(H,xe)|0,m=Math.imul(H,Se),p=p+Math.imul(U,Ee)|0,u=u+Math.imul(U,Re)|0,u=u+Math.imul(K,Ee)|0,m=m+Math.imul(K,Re)|0,p=p+Math.imul(k,Ce)|0,u=u+Math.imul(k,Ie)|0,u=u+Math.imul(A,Ce)|0,m=m+Math.imul(A,Ie)|0;var ft=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(ft>>>26)|0,ft&=67108863,p=Math.imul(V,xe),u=Math.imul(V,Se),u=u+Math.imul(Q,xe)|0,m=Math.imul(Q,Se),p=p+Math.imul(J,Ee)|0,u=u+Math.imul(J,Re)|0,u=u+Math.imul(H,Ee)|0,m=m+Math.imul(H,Re)|0,p=p+Math.imul(U,Ce)|0,u=u+Math.imul(U,Ie)|0,u=u+Math.imul(K,Ce)|0,m=m+Math.imul(K,Ie)|0,p=p+Math.imul(k,Oe)|0,u=u+Math.imul(k,$e)|0,u=u+Math.imul(A,Oe)|0,m=m+Math.imul(A,$e)|0;var zt=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(zt>>>26)|0,zt&=67108863,p=Math.imul(z,xe),u=Math.imul(z,Se),u=u+Math.imul(L,xe)|0,m=Math.imul(L,Se),p=p+Math.imul(V,Ee)|0,u=u+Math.imul(V,Re)|0,u=u+Math.imul(Q,Ee)|0,m=m+Math.imul(Q,Re)|0,p=p+Math.imul(J,Ce)|0,u=u+Math.imul(J,Ie)|0,u=u+Math.imul(H,Ce)|0,m=m+Math.imul(H,Ie)|0,p=p+Math.imul(U,Oe)|0,u=u+Math.imul(U,$e)|0,u=u+Math.imul(K,Oe)|0,m=m+Math.imul(K,$e)|0,p=p+Math.imul(k,De)|0,u=u+Math.imul(k,Ne)|0,u=u+Math.imul(A,De)|0,m=m+Math.imul(A,Ne)|0;var At=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(At>>>26)|0,At&=67108863,p=Math.imul(G,xe),u=Math.imul(G,Se),u=u+Math.imul(Y,xe)|0,m=Math.imul(Y,Se),p=p+Math.imul(z,Ee)|0,u=u+Math.imul(z,Re)|0,u=u+Math.imul(L,Ee)|0,m=m+Math.imul(L,Re)|0,p=p+Math.imul(V,Ce)|0,u=u+Math.imul(V,Ie)|0,u=u+Math.imul(Q,Ce)|0,m=m+Math.imul(Q,Ie)|0,p=p+Math.imul(J,Oe)|0,u=u+Math.imul(J,$e)|0,u=u+Math.imul(H,Oe)|0,m=m+Math.imul(H,$e)|0,p=p+Math.imul(U,De)|0,u=u+Math.imul(U,Ne)|0,u=u+Math.imul(K,De)|0,m=m+Math.imul(K,Ne)|0,p=p+Math.imul(k,Te)|0,u=u+Math.imul(k,O)|0,u=u+Math.imul(A,Te)|0,m=m+Math.imul(A,O)|0;var sr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(sr>>>26)|0,sr&=67108863,p=Math.imul(j,xe),u=Math.imul(j,Se),u=u+Math.imul(Z,xe)|0,m=Math.imul(Z,Se),p=p+Math.imul(G,Ee)|0,u=u+Math.imul(G,Re)|0,u=u+Math.imul(Y,Ee)|0,m=m+Math.imul(Y,Re)|0,p=p+Math.imul(z,Ce)|0,u=u+Math.imul(z,Ie)|0,u=u+Math.imul(L,Ce)|0,m=m+Math.imul(L,Ie)|0,p=p+Math.imul(V,Oe)|0,u=u+Math.imul(V,$e)|0,u=u+Math.imul(Q,Oe)|0,m=m+Math.imul(Q,$e)|0,p=p+Math.imul(J,De)|0,u=u+Math.imul(J,Ne)|0,u=u+Math.imul(H,De)|0,m=m+Math.imul(H,Ne)|0,p=p+Math.imul(U,Te)|0,u=u+Math.imul(U,O)|0,u=u+Math.imul(K,Te)|0,m=m+Math.imul(K,O)|0,p=p+Math.imul(k,X)|0,u=u+Math.imul(k,te)|0,u=u+Math.imul(A,X)|0,m=m+Math.imul(A,te)|0;var ar=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(ar>>>26)|0,ar&=67108863,p=Math.imul(W,xe),u=Math.imul(W,Se),u=u+Math.imul(re,xe)|0,m=Math.imul(re,Se),p=p+Math.imul(j,Ee)|0,u=u+Math.imul(j,Re)|0,u=u+Math.imul(Z,Ee)|0,m=m+Math.imul(Z,Re)|0,p=p+Math.imul(G,Ce)|0,u=u+Math.imul(G,Ie)|0,u=u+Math.imul(Y,Ce)|0,m=m+Math.imul(Y,Ie)|0,p=p+Math.imul(z,Oe)|0,u=u+Math.imul(z,$e)|0,u=u+Math.imul(L,Oe)|0,m=m+Math.imul(L,$e)|0,p=p+Math.imul(V,De)|0,u=u+Math.imul(V,Ne)|0,u=u+Math.imul(Q,De)|0,m=m+Math.imul(Q,Ne)|0,p=p+Math.imul(J,Te)|0,u=u+Math.imul(J,O)|0,u=u+Math.imul(H,Te)|0,m=m+Math.imul(H,O)|0,p=p+Math.imul(U,X)|0,u=u+Math.imul(U,te)|0,u=u+Math.imul(K,X)|0,m=m+Math.imul(K,te)|0,p=p+Math.imul(k,me)|0,u=u+Math.imul(k,we)|0,u=u+Math.imul(A,me)|0,m=m+Math.imul(A,we)|0;var ur=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(ur>>>26)|0,ur&=67108863,p=Math.imul(ge,xe),u=Math.imul(ge,Se),u=u+Math.imul(ye,xe)|0,m=Math.imul(ye,Se),p=p+Math.imul(W,Ee)|0,u=u+Math.imul(W,Re)|0,u=u+Math.imul(re,Ee)|0,m=m+Math.imul(re,Re)|0,p=p+Math.imul(j,Ce)|0,u=u+Math.imul(j,Ie)|0,u=u+Math.imul(Z,Ce)|0,m=m+Math.imul(Z,Ie)|0,p=p+Math.imul(G,Oe)|0,u=u+Math.imul(G,$e)|0,u=u+Math.imul(Y,Oe)|0,m=m+Math.imul(Y,$e)|0,p=p+Math.imul(z,De)|0,u=u+Math.imul(z,Ne)|0,u=u+Math.imul(L,De)|0,m=m+Math.imul(L,Ne)|0,p=p+Math.imul(V,Te)|0,u=u+Math.imul(V,O)|0,u=u+Math.imul(Q,Te)|0,m=m+Math.imul(Q,O)|0,p=p+Math.imul(J,X)|0,u=u+Math.imul(J,te)|0,u=u+Math.imul(H,X)|0,m=m+Math.imul(H,te)|0,p=p+Math.imul(U,me)|0,u=u+Math.imul(U,we)|0,u=u+Math.imul(K,me)|0,m=m+Math.imul(K,we)|0,p=p+Math.imul(k,Pe)|0,u=u+Math.imul(k,ze)|0,u=u+Math.imul(A,Pe)|0,m=m+Math.imul(A,ze)|0;var lr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(lr>>>26)|0,lr&=67108863,p=Math.imul(pe,xe),u=Math.imul(pe,Se),u=u+Math.imul(ve,xe)|0,m=Math.imul(ve,Se),p=p+Math.imul(ge,Ee)|0,u=u+Math.imul(ge,Re)|0,u=u+Math.imul(ye,Ee)|0,m=m+Math.imul(ye,Re)|0,p=p+Math.imul(W,Ce)|0,u=u+Math.imul(W,Ie)|0,u=u+Math.imul(re,Ce)|0,m=m+Math.imul(re,Ie)|0,p=p+Math.imul(j,Oe)|0,u=u+Math.imul(j,$e)|0,u=u+Math.imul(Z,Oe)|0,m=m+Math.imul(Z,$e)|0,p=p+Math.imul(G,De)|0,u=u+Math.imul(G,Ne)|0,u=u+Math.imul(Y,De)|0,m=m+Math.imul(Y,Ne)|0,p=p+Math.imul(z,Te)|0,u=u+Math.imul(z,O)|0,u=u+Math.imul(L,Te)|0,m=m+Math.imul(L,O)|0,p=p+Math.imul(V,X)|0,u=u+Math.imul(V,te)|0,u=u+Math.imul(Q,X)|0,m=m+Math.imul(Q,te)|0,p=p+Math.imul(J,me)|0,u=u+Math.imul(J,we)|0,u=u+Math.imul(H,me)|0,m=m+Math.imul(H,we)|0,p=p+Math.imul(U,Pe)|0,u=u+Math.imul(U,ze)|0,u=u+Math.imul(K,Pe)|0,m=m+Math.imul(K,ze)|0,p=p+Math.imul(k,Ae)|0,u=u+Math.imul(k,ke)|0,u=u+Math.imul(A,Ae)|0,m=m+Math.imul(A,ke)|0;var cr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(cr>>>26)|0,cr&=67108863,p=Math.imul(pe,Ee),u=Math.imul(pe,Re),u=u+Math.imul(ve,Ee)|0,m=Math.imul(ve,Re),p=p+Math.imul(ge,Ce)|0,u=u+Math.imul(ge,Ie)|0,u=u+Math.imul(ye,Ce)|0,m=m+Math.imul(ye,Ie)|0,p=p+Math.imul(W,Oe)|0,u=u+Math.imul(W,$e)|0,u=u+Math.imul(re,Oe)|0,m=m+Math.imul(re,$e)|0,p=p+Math.imul(j,De)|0,u=u+Math.imul(j,Ne)|0,u=u+Math.imul(Z,De)|0,m=m+Math.imul(Z,Ne)|0,p=p+Math.imul(G,Te)|0,u=u+Math.imul(G,O)|0,u=u+Math.imul(Y,Te)|0,m=m+Math.imul(Y,O)|0,p=p+Math.imul(z,X)|0,u=u+Math.imul(z,te)|0,u=u+Math.imul(L,X)|0,m=m+Math.imul(L,te)|0,p=p+Math.imul(V,me)|0,u=u+Math.imul(V,we)|0,u=u+Math.imul(Q,me)|0,m=m+Math.imul(Q,we)|0,p=p+Math.imul(J,Pe)|0,u=u+Math.imul(J,ze)|0,u=u+Math.imul(H,Pe)|0,m=m+Math.imul(H,ze)|0,p=p+Math.imul(U,Ae)|0,u=u+Math.imul(U,ke)|0,u=u+Math.imul(K,Ae)|0,m=m+Math.imul(K,ke)|0;var dr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(dr>>>26)|0,dr&=67108863,p=Math.imul(pe,Ce),u=Math.imul(pe,Ie),u=u+Math.imul(ve,Ce)|0,m=Math.imul(ve,Ie),p=p+Math.imul(ge,Oe)|0,u=u+Math.imul(ge,$e)|0,u=u+Math.imul(ye,Oe)|0,m=m+Math.imul(ye,$e)|0,p=p+Math.imul(W,De)|0,u=u+Math.imul(W,Ne)|0,u=u+Math.imul(re,De)|0,m=m+Math.imul(re,Ne)|0,p=p+Math.imul(j,Te)|0,u=u+Math.imul(j,O)|0,u=u+Math.imul(Z,Te)|0,m=m+Math.imul(Z,O)|0,p=p+Math.imul(G,X)|0,u=u+Math.imul(G,te)|0,u=u+Math.imul(Y,X)|0,m=m+Math.imul(Y,te)|0,p=p+Math.imul(z,me)|0,u=u+Math.imul(z,we)|0,u=u+Math.imul(L,me)|0,m=m+Math.imul(L,we)|0,p=p+Math.imul(V,Pe)|0,u=u+Math.imul(V,ze)|0,u=u+Math.imul(Q,Pe)|0,m=m+Math.imul(Q,ze)|0,p=p+Math.imul(J,Ae)|0,u=u+Math.imul(J,ke)|0,u=u+Math.imul(H,Ae)|0,m=m+Math.imul(H,ke)|0;var fr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(fr>>>26)|0,fr&=67108863,p=Math.imul(pe,Oe),u=Math.imul(pe,$e),u=u+Math.imul(ve,Oe)|0,m=Math.imul(ve,$e),p=p+Math.imul(ge,De)|0,u=u+Math.imul(ge,Ne)|0,u=u+Math.imul(ye,De)|0,m=m+Math.imul(ye,Ne)|0,p=p+Math.imul(W,Te)|0,u=u+Math.imul(W,O)|0,u=u+Math.imul(re,Te)|0,m=m+Math.imul(re,O)|0,p=p+Math.imul(j,X)|0,u=u+Math.imul(j,te)|0,u=u+Math.imul(Z,X)|0,m=m+Math.imul(Z,te)|0,p=p+Math.imul(G,me)|0,u=u+Math.imul(G,we)|0,u=u+Math.imul(Y,me)|0,m=m+Math.imul(Y,we)|0,p=p+Math.imul(z,Pe)|0,u=u+Math.imul(z,ze)|0,u=u+Math.imul(L,Pe)|0,m=m+Math.imul(L,ze)|0,p=p+Math.imul(V,Ae)|0,u=u+Math.imul(V,ke)|0,u=u+Math.imul(Q,Ae)|0,m=m+Math.imul(Q,ke)|0;var hr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(hr>>>26)|0,hr&=67108863,p=Math.imul(pe,De),u=Math.imul(pe,Ne),u=u+Math.imul(ve,De)|0,m=Math.imul(ve,Ne),p=p+Math.imul(ge,Te)|0,u=u+Math.imul(ge,O)|0,u=u+Math.imul(ye,Te)|0,m=m+Math.imul(ye,O)|0,p=p+Math.imul(W,X)|0,u=u+Math.imul(W,te)|0,u=u+Math.imul(re,X)|0,m=m+Math.imul(re,te)|0,p=p+Math.imul(j,me)|0,u=u+Math.imul(j,we)|0,u=u+Math.imul(Z,me)|0,m=m+Math.imul(Z,we)|0,p=p+Math.imul(G,Pe)|0,u=u+Math.imul(G,ze)|0,u=u+Math.imul(Y,Pe)|0,m=m+Math.imul(Y,ze)|0,p=p+Math.imul(z,Ae)|0,u=u+Math.imul(z,ke)|0,u=u+Math.imul(L,Ae)|0,m=m+Math.imul(L,ke)|0;var pr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(pr>>>26)|0,pr&=67108863,p=Math.imul(pe,Te),u=Math.imul(pe,O),u=u+Math.imul(ve,Te)|0,m=Math.imul(ve,O),p=p+Math.imul(ge,X)|0,u=u+Math.imul(ge,te)|0,u=u+Math.imul(ye,X)|0,m=m+Math.imul(ye,te)|0,p=p+Math.imul(W,me)|0,u=u+Math.imul(W,we)|0,u=u+Math.imul(re,me)|0,m=m+Math.imul(re,we)|0,p=p+Math.imul(j,Pe)|0,u=u+Math.imul(j,ze)|0,u=u+Math.imul(Z,Pe)|0,m=m+Math.imul(Z,ze)|0,p=p+Math.imul(G,Ae)|0,u=u+Math.imul(G,ke)|0,u=u+Math.imul(Y,Ae)|0,m=m+Math.imul(Y,ke)|0;var mr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(mr>>>26)|0,mr&=67108863,p=Math.imul(pe,X),u=Math.imul(pe,te),u=u+Math.imul(ve,X)|0,m=Math.imul(ve,te),p=p+Math.imul(ge,me)|0,u=u+Math.imul(ge,we)|0,u=u+Math.imul(ye,me)|0,m=m+Math.imul(ye,we)|0,p=p+Math.imul(W,Pe)|0,u=u+Math.imul(W,ze)|0,u=u+Math.imul(re,Pe)|0,m=m+Math.imul(re,ze)|0,p=p+Math.imul(j,Ae)|0,u=u+Math.imul(j,ke)|0,u=u+Math.imul(Z,Ae)|0,m=m+Math.imul(Z,ke)|0;var gr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(gr>>>26)|0,gr&=67108863,p=Math.imul(pe,me),u=Math.imul(pe,we),u=u+Math.imul(ve,me)|0,m=Math.imul(ve,we),p=p+Math.imul(ge,Pe)|0,u=u+Math.imul(ge,ze)|0,u=u+Math.imul(ye,Pe)|0,m=m+Math.imul(ye,ze)|0,p=p+Math.imul(W,Ae)|0,u=u+Math.imul(W,ke)|0,u=u+Math.imul(re,Ae)|0,m=m+Math.imul(re,ke)|0;var yr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(yr>>>26)|0,yr&=67108863,p=Math.imul(pe,Pe),u=Math.imul(pe,ze),u=u+Math.imul(ve,Pe)|0,m=Math.imul(ve,ze),p=p+Math.imul(ge,Ae)|0,u=u+Math.imul(ge,ke)|0,u=u+Math.imul(ye,Ae)|0,m=m+Math.imul(ye,ke)|0;var vr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(vr>>>26)|0,vr&=67108863,p=Math.imul(pe,Ae),u=Math.imul(pe,ke),u=u+Math.imul(ve,Ae)|0,m=Math.imul(ve,ke);var br=(w+p|0)+((u&8191)<<13)|0;if(w=(m+(u>>>13)|0)+(br>>>26)|0,br&=67108863,y[0]=Xt,y[1]=mt,y[2]=ft,y[3]=zt,y[4]=At,y[5]=sr,y[6]=ar,y[7]=ur,y[8]=lr,y[9]=cr,y[10]=dr,y[11]=fr,y[12]=hr,y[13]=pr,y[14]=mr,y[15]=gr,y[16]=yr,y[17]=vr,y[18]=br,w!==0)y[19]=w,f.length++;return f};if(!Math.imul)$=I;function T(a,c,f){f.negative=c.negative^a.negative,f.length=a.length+c.length;var l=0,d=0;for(var y=0;y<f.length-1;y++){var w=d;d=0;var p=l&67108863,u=Math.min(y,c.length-1);for(var m=Math.max(0,y-a.length+1);m<=u;m++){var E=y-m,k=a.words[E]|0,A=c.words[m]|0,D=k*A,U=D&67108863;w=w+(D/67108864|0)|0,U=U+p|0,p=U&67108863,w=w+(U>>>26)|0,d+=w>>>26,w&=67108863}f.words[y]=p,l=w,w=d}if(l!==0)f.words[y]=l;else f.length--;return f.strip()}function P(a,c,f){var l=new R;return l.mulp(a,c,f)}s.prototype.mulTo=function(a,c){var f,l=this.length+a.length;if(this.length===10&&a.length===10)f=$(this,a,c);else if(l<63)f=I(this,a,c);else if(l<1024)f=T(this,a,c);else f=P(this,a,c);return f};function R(a,c){this.x=a,this.y=c}R.prototype.makeRBT=function(a){var c=Array(a),f=s.prototype._countBits(a)-1;for(var l=0;l<a;l++)c[l]=this.revBin(l,f,a);return c},R.prototype.revBin=function(a,c,f){if(a===0||a===f-1)return a;var l=0;for(var d=0;d<c;d++)l|=(a&1)<<c-d-1,a>>=1;return l},R.prototype.permute=function(a,c,f,l,d,y){for(var w=0;w<y;w++)l[w]=c[a[w]],d[w]=f[a[w]]},R.prototype.transform=function(a,c,f,l,d,y){this.permute(y,a,c,f,l,d);for(var w=1;w<d;w<<=1){var p=w<<1,u=Math.cos(2*Math.PI/p),m=Math.sin(2*Math.PI/p);for(var E=0;E<d;E+=p){var k=u,A=m;for(var D=0;D<w;D++){var U=f[E+D],K=l[E+D],he=f[E+D+w],J=l[E+D+w],H=k*he-A*J;if(J=k*J+A*he,he=H,f[E+D]=U+he,l[E+D]=K+J,f[E+D+w]=U-he,l[E+D+w]=K-J,D!==p)H=u*k-m*A,A=u*A+m*k,k=H}}}},R.prototype.guessLen13b=function(a,c){var f=Math.max(c,a)|1,l=f&1,d=0;for(f=f/2|0;f;f=f>>>1)d++;return 1<<d+1+l},R.prototype.conjugate=function(a,c,f){if(f<=1)return;for(var l=0;l<f/2;l++){var d=a[l];a[l]=a[f-l-1],a[f-l-1]=d,d=c[l],c[l]=-c[f-l-1],c[f-l-1]=-d}},R.prototype.normalize13b=function(a,c){var f=0;for(var l=0;l<c/2;l++){var d=Math.round(a[2*l+1]/c)*8192+Math.round(a[2*l]/c)+f;if(a[l]=d&67108863,d<67108864)f=0;else f=d/67108864|0}return a},R.prototype.convert13b=function(a,c,f,l){var d=0;for(var y=0;y<c;y++)d=d+(a[y]|0),f[2*y]=d&8191,d=d>>>13,f[2*y+1]=d&8191,d=d>>>13;for(y=2*c;y<l;++y)f[y]=0;n(d===0),n((d&-8192)===0)},R.prototype.stub=function(a){var c=Array(a);for(var f=0;f<a;f++)c[f]=0;return c},R.prototype.mulp=function(a,c,f){var l=2*this.guessLen13b(a.length,c.length),d=this.makeRBT(l),y=this.stub(l),w=Array(l),p=Array(l),u=Array(l),m=Array(l),E=Array(l),k=Array(l),A=f.words;A.length=l,this.convert13b(a.words,a.length,w,l),this.convert13b(c.words,c.length,m,l),this.transform(w,y,p,u,l,d),this.transform(m,y,E,k,l,d);for(var D=0;D<l;D++){var U=p[D]*E[D]-u[D]*k[D];u[D]=p[D]*k[D]+u[D]*E[D],p[D]=U}return this.conjugate(p,u,l),this.transform(p,u,A,y,l,d),this.conjugate(A,y,l),this.normalize13b(A,l),f.negative=a.negative^c.negative,f.length=a.length+c.length,f.strip()},s.prototype.mul=function(a){var c=new s(null);return c.words=Array(this.length+a.length),this.mulTo(a,c)},s.prototype.mulf=function(a){var c=new s(null);return c.words=Array(this.length+a.length),P(this,a,c)},s.prototype.imul=function(a){return this.clone().mulTo(a,this)},s.prototype.imuln=function(a){n(typeof a==="number"),n(a<67108864);var c=0;for(var f=0;f<this.length;f++){var l=(this.words[f]|0)*a,d=(l&67108863)+(c&67108863);c>>=26,c+=l/67108864|0,c+=d>>>26,this.words[f]=d&67108863}if(c!==0)this.words[f]=c,this.length++;return this.length=a===0?1:this.length,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 c=M(a);if(c.length===0)return new s(1);var f=this;for(var l=0;l<c.length;l++,f=f.sqr())if(c[l]!==0)break;if(++l<c.length)for(var d=f.sqr();l<c.length;l++,d=d.sqr()){if(c[l]===0)continue;f=f.mul(d)}return f},s.prototype.iushln=function(a){n(typeof a==="number"&&a>=0);var c=a%26,f=(a-c)/26,l=67108863>>>26-c<<26-c,d;if(c!==0){var y=0;for(d=0;d<this.length;d++){var w=this.words[d]&l,p=(this.words[d]|0)-w<<c;this.words[d]=p|y,y=w>>>26-c}if(y)this.words[d]=y,this.length++}if(f!==0){for(d=this.length-1;d>=0;d--)this.words[d+f]=this.words[d];for(d=0;d<f;d++)this.words[d]=0;this.length+=f}return this.strip()},s.prototype.ishln=function(a){return n(this.negative===0),this.iushln(a)},s.prototype.iushrn=function(a,c,f){n(typeof a==="number"&&a>=0);var l;if(c)l=(c-c%26)/26;else l=0;var d=a%26,y=Math.min((a-d)/26,this.length),w=67108863^67108863>>>d<<d,p=f;if(l-=y,l=Math.max(0,l),p){for(var u=0;u<y;u++)p.words[u]=this.words[u];p.length=y}if(y===0);else if(this.length>y){this.length-=y;for(u=0;u<this.length;u++)this.words[u]=this.words[u+y]}else this.words[0]=0,this.length=1;var m=0;for(u=this.length-1;u>=0&&(m!==0||u>=l);u--){var E=this.words[u]|0;this.words[u]=m<<26-d|E>>>d,m=E&w}if(p&&m!==0)p.words[p.length++]=m;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},s.prototype.ishrn=function(a,c,f){return n(this.negative===0),this.iushrn(a,c,f)},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){n(typeof a==="number"&&a>=0);var c=a%26,f=(a-c)/26,l=1<<c;if(this.length<=f)return!1;var d=this.words[f];return!!(d&l)},s.prototype.imaskn=function(a){n(typeof a==="number"&&a>=0);var c=a%26,f=(a-c)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=f)return this;if(c!==0)f++;if(this.length=Math.min(f,this.length),c!==0){var l=67108863^67108863>>>c<<c;this.words[this.length-1]&=l}return this.strip()},s.prototype.maskn=function(a){return this.clone().imaskn(a)},s.prototype.iaddn=function(a){if(n(typeof a==="number"),n(a<67108864),a<0)return this.isubn(-a);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<a)return this.words[0]=a-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(a),this.negative=1,this}return this._iaddn(a)},s.prototype._iaddn=function(a){this.words[0]+=a;for(var c=0;c<this.length&&this.words[c]>=67108864;c++)if(this.words[c]-=67108864,c===this.length-1)this.words[c+1]=1;else this.words[c+1]++;return this.length=Math.max(this.length,c+1),this},s.prototype.isubn=function(a){if(n(typeof a==="number"),n(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 c=0;c<this.length&&this.words[c]<0;c++)this.words[c]+=67108864,this.words[c+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,c,f){var l=a.length+f,d;this._expand(l);var y,w=0;for(d=0;d<a.length;d++){y=(this.words[d+f]|0)+w;var p=(a.words[d]|0)*c;y-=p&67108863,w=(y>>26)-(p/67108864|0),this.words[d+f]=y&67108863}for(;d<this.length-f;d++)y=(this.words[d+f]|0)+w,w=y>>26,this.words[d+f]=y&67108863;if(w===0)return this.strip();n(w===-1),w=0;for(d=0;d<this.length;d++)y=-(this.words[d]|0)+w,w=y>>26,this.words[d]=y&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(a,c){var f=this.length-a.length,l=this.clone(),d=a,y=d.words[d.length-1]|0,w=this._countBits(y);if(f=26-w,f!==0)d=d.ushln(f),l.iushln(f),y=d.words[d.length-1]|0;var p=l.length-d.length,u;if(c!=="mod"){u=new s(null),u.length=p+1,u.words=Array(u.length);for(var m=0;m<u.length;m++)u.words[m]=0}var E=l.clone()._ishlnsubmul(d,1,p);if(E.negative===0){if(l=E,u)u.words[p]=1}for(var k=p-1;k>=0;k--){var A=(l.words[d.length+k]|0)*67108864+(l.words[d.length+k-1]|0);A=Math.min(A/y|0,67108863),l._ishlnsubmul(d,A,k);while(l.negative!==0)if(A--,l.negative=0,l._ishlnsubmul(d,1,k),!l.isZero())l.negative^=1;if(u)u.words[k]=A}if(u)u.strip();if(l.strip(),c!=="div"&&f!==0)l.iushrn(f);return{div:u||null,mod:l}},s.prototype.divmod=function(a,c,f){if(n(!a.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var l,d,y;if(this.negative!==0&&a.negative===0){if(y=this.neg().divmod(a,c),c!=="mod")l=y.div.neg();if(c!=="div"){if(d=y.mod.neg(),f&&d.negative!==0)d.iadd(a)}return{div:l,mod:d}}if(this.negative===0&&a.negative!==0){if(y=this.divmod(a.neg(),c),c!=="mod")l=y.div.neg();return{div:l,mod:y.mod}}if((this.negative&a.negative)!==0){if(y=this.neg().divmod(a.neg(),c),c!=="div"){if(d=y.mod.neg(),f&&d.negative!==0)d.isub(a)}return{div:y.div,mod:d}}if(a.length>this.length||this.cmp(a)<0)return{div:new s(0),mod:this};if(a.length===1){if(c==="div")return{div:this.divn(a.words[0]),mod:null};if(c==="mod")return{div:null,mod:new s(this.modn(a.words[0]))};return{div:this.divn(a.words[0]),mod:new s(this.modn(a.words[0]))}}return this._wordDiv(a,c)},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 c=this.divmod(a);if(c.mod.isZero())return c.div;var f=c.div.negative!==0?c.mod.isub(a):c.mod,l=a.ushrn(1),d=a.andln(1),y=f.cmp(l);if(y<0||d===1&&y===0)return c.div;return c.div.negative!==0?c.div.isubn(1):c.div.iaddn(1)},s.prototype.modn=function(a){n(a<=67108863);var c=67108864%a,f=0;for(var l=this.length-1;l>=0;l--)f=(c*f+(this.words[l]|0))%a;return f},s.prototype.idivn=function(a){n(a<=67108863);var c=0;for(var f=this.length-1;f>=0;f--){var l=(this.words[f]|0)+c*67108864;this.words[f]=l/a|0,c=l%a}return this.strip()},s.prototype.divn=function(a){return this.clone().idivn(a)},s.prototype.egcd=function(a){n(a.negative===0),n(!a.isZero());var c=this,f=a.clone();if(c.negative!==0)c=c.umod(a);else c=c.clone();var l=new s(1),d=new s(0),y=new s(0),w=new s(1),p=0;while(c.isEven()&&f.isEven())c.iushrn(1),f.iushrn(1),++p;var u=f.clone(),m=c.clone();while(!c.isZero()){for(var E=0,k=1;(c.words[0]&k)===0&&E<26;++E,k<<=1);if(E>0){c.iushrn(E);while(E-- >0){if(l.isOdd()||d.isOdd())l.iadd(u),d.isub(m);l.iushrn(1),d.iushrn(1)}}for(var A=0,D=1;(f.words[0]&D)===0&&A<26;++A,D<<=1);if(A>0){f.iushrn(A);while(A-- >0){if(y.isOdd()||w.isOdd())y.iadd(u),w.isub(m);y.iushrn(1),w.iushrn(1)}}if(c.cmp(f)>=0)c.isub(f),l.isub(y),d.isub(w);else f.isub(c),y.isub(l),w.isub(d)}return{a:y,b:w,gcd:f.iushln(p)}},s.prototype._invmp=function(a){n(a.negative===0),n(!a.isZero());var c=this,f=a.clone();if(c.negative!==0)c=c.umod(a);else c=c.clone();var l=new s(1),d=new s(0),y=f.clone();while(c.cmpn(1)>0&&f.cmpn(1)>0){for(var w=0,p=1;(c.words[0]&p)===0&&w<26;++w,p<<=1);if(w>0){c.iushrn(w);while(w-- >0){if(l.isOdd())l.iadd(y);l.iushrn(1)}}for(var u=0,m=1;(f.words[0]&m)===0&&u<26;++u,m<<=1);if(u>0){f.iushrn(u);while(u-- >0){if(d.isOdd())d.iadd(y);d.iushrn(1)}}if(c.cmp(f)>=0)c.isub(f),l.isub(d);else f.isub(c),d.isub(l)}var E;if(c.cmpn(1)===0)E=l;else E=d;if(E.cmpn(0)<0)E.iadd(a);return E},s.prototype.gcd=function(a){if(this.isZero())return a.abs();if(a.isZero())return this.abs();var c=this.clone(),f=a.clone();c.negative=0,f.negative=0;for(var l=0;c.isEven()&&f.isEven();l++)c.iushrn(1),f.iushrn(1);do{while(c.isEven())c.iushrn(1);while(f.isEven())f.iushrn(1);var d=c.cmp(f);if(d<0){var y=c;c=f,f=y}else if(d===0||f.cmpn(1)===0)break;c.isub(f)}while(!0);return f.iushln(l)},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){n(typeof a==="number");var c=a%26,f=(a-c)/26,l=1<<c;if(this.length<=f)return this._expand(f+1),this.words[f]|=l,this;var d=l;for(var y=f;d!==0&&y<this.length;y++){var w=this.words[y]|0;w+=d,d=w>>>26,w&=67108863,this.words[y]=w}if(d!==0)this.words[y]=d,this.length++;return this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(a){var c=a<0;if(this.negative!==0&&!c)return-1;if(this.negative===0&&c)return 1;this.strip();var f;if(this.length>1)f=1;else{if(c)a=-a;n(a<=67108863,"Number is too big");var l=this.words[0]|0;f=l===a?0:l<a?-1:1}if(this.negative!==0)return-f|0;return f},s.prototype.cmp=function(a){if(this.negative!==0&&a.negative===0)return-1;if(this.negative===0&&a.negative!==0)return 1;var c=this.ucmp(a);if(this.negative!==0)return-c|0;return c},s.prototype.ucmp=function(a){if(this.length>a.length)return 1;if(this.length<a.length)return-1;var c=0;for(var f=this.length-1;f>=0;f--){var l=this.words[f]|0,d=a.words[f]|0;if(l===d)continue;if(l<d)c=-1;else if(l>d)c=1;break}return c},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 F(a)},s.prototype.toRed=function(a){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),a.convertTo(this)._forceRed(a)},s.prototype.fromRed=function(){return n(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 n(!this.red,"Already a number in reduction context"),this._forceRed(a)},s.prototype.redAdd=function(a){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,a)},s.prototype.redIAdd=function(a){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,a)},s.prototype.redSub=function(a){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,a)},s.prototype.redISub=function(a){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,a)},s.prototype.redShl=function(a){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,a)},s.prototype.redMul=function(a){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.mul(this,a)},s.prototype.redIMul=function(a){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.imul(this,a)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(a){return n(this.red&&!a.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,a)};var C={k256:null,p224:null,p192:null,p25519:null};function N(a,c){this.name=a,this.p=new s(c,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}N.prototype._tmp=function(){var a=new s(null);return a.words=Array(Math.ceil(this.n/13)),a},N.prototype.ireduce=function(a){var c=a,f;do this.split(c,this.tmp),c=this.imulK(c),c=c.iadd(this.tmp),f=c.bitLength();while(f>this.n);var l=f<this.n?-1:c.ucmp(this.p);if(l===0)c.words[0]=0,c.length=1;else if(l>0)c.isub(this.p);else if(c.strip!==void 0)c.strip();else c._strip();return c},N.prototype.split=function(a,c){a.iushrn(this.n,0,c)},N.prototype.imulK=function(a){return a.imul(this.k)};function B(){N.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(B,N),B.prototype.split=function(a,c){var f=4194303,l=Math.min(a.length,9);for(var d=0;d<l;d++)c.words[d]=a.words[d];if(c.length=l,a.length<=9){a.words[0]=0,a.length=1;return}var y=a.words[9];c.words[c.length++]=y&f;for(d=10;d<a.length;d++){var w=a.words[d]|0;a.words[d-10]=(w&f)<<4|y>>>22,y=w}if(y>>>=22,a.words[d-10]=y,y===0&&a.length>10)a.length-=10;else a.length-=9},B.prototype.imulK=function(a){a.words[a.length]=0,a.words[a.length+1]=0,a.length+=2;var c=0;for(var f=0;f<a.length;f++){var l=a.words[f]|0;c+=l*977,a.words[f]=c&67108863,c=l*64+(c/67108864|0)}if(a.words[a.length-1]===0){if(a.length--,a.words[a.length-1]===0)a.length--}return a};function ie(){N.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(ie,N);function le(){N.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(le,N);function ue(){N.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(ue,N),ue.prototype.imulK=function(a){var c=0;for(var f=0;f<a.length;f++){var l=(a.words[f]|0)*19+c,d=l&67108863;l>>>=26,a.words[f]=d,c=l}if(c!==0)a.words[a.length++]=c;return a},s._prime=function(a){if(C[a])return C[a];var c;if(a==="k256")c=new B;else if(a==="p224")c=new ie;else if(a==="p192")c=new le;else if(a==="p25519")c=new ue;else throw Error("Unknown prime "+a);return C[a]=c,c};function F(a){if(typeof a==="string"){var c=s._prime(a);this.m=c.p,this.prime=c}else n(a.gtn(1),"modulus must be greater than 1"),this.m=a,this.prime=null}F.prototype._verify1=function(a){n(a.negative===0,"red works only with positives"),n(a.red,"red works only with red numbers")},F.prototype._verify2=function(a,c){n((a.negative|c.negative)===0,"red works only with positives"),n(a.red&&a.red===c.red,"red works only with red numbers")},F.prototype.imod=function(a){if(this.prime)return this.prime.ireduce(a)._forceRed(this);return a.umod(this.m)._forceRed(this)},F.prototype.neg=function(a){if(a.isZero())return a.clone();return this.m.sub(a)._forceRed(this)},F.prototype.add=function(a,c){this._verify2(a,c);var f=a.add(c);if(f.cmp(this.m)>=0)f.isub(this.m);return f._forceRed(this)},F.prototype.iadd=function(a,c){this._verify2(a,c);var f=a.iadd(c);if(f.cmp(this.m)>=0)f.isub(this.m);return f},F.prototype.sub=function(a,c){this._verify2(a,c);var f=a.sub(c);if(f.cmpn(0)<0)f.iadd(this.m);return f._forceRed(this)},F.prototype.isub=function(a,c){this._verify2(a,c);var f=a.isub(c);if(f.cmpn(0)<0)f.iadd(this.m);return f},F.prototype.shl=function(a,c){return this._verify1(a),this.imod(a.ushln(c))},F.prototype.imul=function(a,c){return this._verify2(a,c),this.imod(a.imul(c))},F.prototype.mul=function(a,c){return this._verify2(a,c),this.imod(a.mul(c))},F.prototype.isqr=function(a){return this.imul(a,a.clone())},F.prototype.sqr=function(a){return this.mul(a,a)},F.prototype.sqrt=function(a){if(a.isZero())return a.clone();var c=this.m.andln(3);if(n(c%2===1),c===3){var f=this.m.add(new s(1)).iushrn(2);return this.pow(a,f)}var l=this.m.subn(1),d=0;while(!l.isZero()&&l.andln(1)===0)d++,l.iushrn(1);n(!l.isZero());var y=new s(1).toRed(this),w=y.redNeg(),p=this.m.subn(1).iushrn(1),u=this.m.bitLength();u=new s(2*u*u).toRed(this);while(this.pow(u,p).cmp(w)!==0)u.redIAdd(w);var m=this.pow(u,l),E=this.pow(a,l.addn(1).iushrn(1)),k=this.pow(a,l),A=d;while(k.cmp(y)!==0){var D=k;for(var U=0;D.cmp(y)!==0;U++)D=D.redSqr();n(U<A);var K=this.pow(m,new s(1).iushln(A-U-1));E=E.redMul(K),m=K.redSqr(),k=k.redMul(m),A=U}return E},F.prototype.invm=function(a){var c=a._invmp(this.m);if(c.negative!==0)return c.negative=0,this.imod(c).redNeg();else return this.imod(c)},F.prototype.pow=function(a,c){if(c.isZero())return new s(1).toRed(this);if(c.cmpn(1)===0)return a.clone();var f=4,l=Array(1<<f);l[0]=new s(1).toRed(this),l[1]=a;for(var d=2;d<l.length;d++)l[d]=this.mul(l[d-1],a);var y=l[0],w=0,p=0,u=c.bitLength()%26;if(u===0)u=26;for(d=c.length-1;d>=0;d--){var m=c.words[d];for(var E=u-1;E>=0;E--){var k=m>>E&1;if(y!==l[0])y=this.sqr(y);if(k===0&&w===0){p=0;continue}if(w<<=1,w|=k,p++,p!==f&&(d!==0||E!==0))continue;y=this.mul(y,l[w]),p=0,w=0}u=26}return y},F.prototype.convertTo=function(a){var c=a.umod(this.m);return c===a?c.clone():c},F.prototype.convertFrom=function(a){var c=a.clone();return c.red=null,c},s.mont=function(a){return new ee(a)};function ee(a){if(F.call(this,a),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)}o(ee,F),ee.prototype.convertTo=function(a){return this.imod(a.ushln(this.shift))},ee.prototype.convertFrom=function(a){var c=this.imod(a.mul(this.rinv));return c.red=null,c},ee.prototype.imul=function(a,c){if(a.isZero()||c.isZero())return a.words[0]=0,a.length=1,a;var f=a.imul(c),l=f.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=f.isub(l).iushrn(this.shift),y=d;if(d.cmp(this.m)>=0)y=d.isub(this.m);else if(d.cmpn(0)<0)y=d.iadd(this.m);return y._forceRed(this)},ee.prototype.mul=function(a,c){if(a.isZero()||c.isZero())return new s(0)._forceRed(this);var f=a.mul(c),l=f.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=f.isub(l).iushrn(this.shift),y=d;if(d.cmp(this.m)>=0)y=d.isub(this.m);else if(d.cmpn(0)<0)y=d.iadd(this.m);return y._forceRed(this)},ee.prototype.invm=function(a){var c=this.imod(a._invmp(this.m).mul(this.r2));return c._forceRed(this)}})(typeof t>"u"||t,e)}),sP=ce((e,t)=>{var r=iP(),i=oP();t.exports=function(h){return new o(h)};var n={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};n.p224=n.secp224r1,n.p256=n.secp256r1=n.prime256v1,n.p192=n.secp192r1=n.prime192v1,n.p384=n.secp384r1,n.p521=n.secp521r1;function o(h){if(this.curveType=n[h],!this.curveType)this.curveType={name:h};this.curve=new r.ec(this.curveType.name),this.keys=void 0}o.prototype.generateKeys=function(h,v){return this.keys=this.curve.genKeyPair(),this.getPublicKey(h,v)},o.prototype.computeSecret=function(h,v,b){if(v=v||"utf8",!Buffer.isBuffer(h))h=new Buffer(h,v);var _=this.curve.keyFromPublic(h).getPublic(),g=_.mul(this.keys.getPrivate()).getX();return s(g,b,this.curveType.byteLength)},o.prototype.getPublicKey=function(h,v){var b=this.keys.getPublic(v==="compressed",!0);if(v==="hybrid")if(b[b.length-1]%2)b[0]=7;else b[0]=6;return s(b,h)},o.prototype.getPrivateKey=function(h){return s(this.keys.getPrivate(),h)},o.prototype.setPublicKey=function(h,v){if(v=v||"utf8",!Buffer.isBuffer(h))h=new Buffer(h,v);return this.keys._importPublic(h),this},o.prototype.setPrivateKey=function(h,v){if(v=v||"utf8",!Buffer.isBuffer(h))h=new Buffer(h,v);var b=new i(h);return b=b.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(b),this};function s(h,v,b){if(!Array.isArray(h))h=h.toArray();var _=new Buffer(h);if(b&&_.length<b){var g=new Buffer(b-_.length);g.fill(0),_=Buffer.concat([g,_])}if(!v)return _;else return _.toString(v)}}),aP=ce((e,t)=>{var r=(Kr(),kt(dn)).createECDH;t.exports=r||sP()}),uP=ce((e,t)=>{(function(r,i){function n(a,c){if(!a)throw Error(c||"Assertion failed")}function o(a,c){a.super_=c;var f=function(){};f.prototype=c.prototype,a.prototype=new f,a.prototype.constructor=a}function s(a,c,f){if(s.isBN(a))return a;if(this.negative=0,this.words=null,this.length=0,this.red=null,a!==null){if(c==="le"||c==="be")f=c,c=10;this._init(a||0,c||10,f||"be")}}if(typeof r==="object")r.exports=s;else i.BN=s;s.BN=s,s.wordSize=26;var h;try{if(typeof window<"u"&&typeof window.Buffer<"u")h=window.Buffer;else h=(Tr(),kt($r)).Buffer}catch(a){}s.isBN=function(a){if(a instanceof s)return!0;return a!==null&&typeof a==="object"&&a.constructor.wordSize===s.wordSize&&Array.isArray(a.words)},s.max=function(a,c){if(a.cmp(c)>0)return a;return c},s.min=function(a,c){if(a.cmp(c)<0)return a;return c},s.prototype._init=function(a,c,f){if(typeof a==="number")return this._initNumber(a,c,f);if(typeof a==="object")return this._initArray(a,c,f);if(c==="hex")c=16;n(c===(c|0)&&c>=2&&c<=36),a=a.toString().replace(/\s+/g,"");var l=0;if(a[0]==="-")l++,this.negative=1;if(l<a.length){if(c===16)this._parseHex(a,l,f);else if(this._parseBase(a,c,l),f==="le")this._initArray(this.toArray(),c,f)}},s.prototype._initNumber=function(a,c,f){if(a<0)this.negative=1,a=-a;if(a<67108864)this.words=[a&67108863],this.length=1;else if(a<4503599627370496)this.words=[a&67108863,a/67108864&67108863],this.length=2;else n(a<9007199254740992),this.words=[a&67108863,a/67108864&67108863,1],this.length=3;if(f!=="le")return;this._initArray(this.toArray(),c,f)},s.prototype._initArray=function(a,c,f){if(n(typeof a.length==="number"),a.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(a.length/3),this.words=Array(this.length);for(var l=0;l<this.length;l++)this.words[l]=0;var d,y,w=0;if(f==="be"){for(l=a.length-1,d=0;l>=0;l-=3)if(y=a[l]|a[l-1]<<8|a[l-2]<<16,this.words[d]|=y<<w&67108863,this.words[d+1]=y>>>26-w&67108863,w+=24,w>=26)w-=26,d++}else if(f==="le"){for(l=0,d=0;l<a.length;l+=3)if(y=a[l]|a[l+1]<<8|a[l+2]<<16,this.words[d]|=y<<w&67108863,this.words[d+1]=y>>>26-w&67108863,w+=24,w>=26)w-=26,d++}return this.strip()};function v(a,c){var f=a.charCodeAt(c);if(f>=65&&f<=70)return f-55;else if(f>=97&&f<=102)return f-87;else return f-48&15}function b(a,c,f){var l=v(a,f);if(f-1>=c)l|=v(a,f-1)<<4;return l}s.prototype._parseHex=function(a,c,f){this.length=Math.ceil((a.length-c)/6),this.words=Array(this.length);for(var l=0;l<this.length;l++)this.words[l]=0;var d=0,y=0,w;if(f==="be")for(l=a.length-1;l>=c;l-=2)if(w=b(a,c,l)<<d,this.words[y]|=w&67108863,d>=18)d-=18,y+=1,this.words[y]|=w>>>26;else d+=8;else{var p=a.length-c;for(l=p%2===0?c+1:c;l<a.length;l+=2)if(w=b(a,c,l)<<d,this.words[y]|=w&67108863,d>=18)d-=18,y+=1,this.words[y]|=w>>>26;else d+=8}this.strip()};function _(a,c,f,l){var d=0,y=Math.min(a.length,f);for(var w=c;w<y;w++){var p=a.charCodeAt(w)-48;if(d*=l,p>=49)d+=p-49+10;else if(p>=17)d+=p-17+10;else d+=p}return d}s.prototype._parseBase=function(a,c,f){this.words=[0],this.length=1;for(var l=0,d=1;d<=67108863;d*=c)l++;l--,d=d/c|0;var y=a.length-f,w=y%l,p=Math.min(y,y-w)+f,u=0;for(var m=f;m<p;m+=l)if(u=_(a,m,m+l,c),this.imuln(d),this.words[0]+u<67108864)this.words[0]+=u;else this._iaddn(u);if(w!==0){var E=1;u=_(a,m,a.length,c);for(m=0;m<w;m++)E*=c;if(this.imuln(E),this.words[0]+u<67108864)this.words[0]+=u;else this._iaddn(u)}this.strip()},s.prototype.copy=function(a){a.words=Array(this.length);for(var c=0;c<this.length;c++)a.words[c]=this.words[c];a.length=this.length,a.negative=this.negative,a.red=this.red},s.prototype.clone=function(){var a=new s(null);return this.copy(a),a},s.prototype._expand=function(a){while(this.length<a)this.words[this.length++]=0;return this},s.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},s.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},s.prototype.inspect=function(){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"],S=[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],x=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(s.prototype.toString=function(a,c){a=a||10,c=c|0||1;var f;if(a===16||a==="hex"){f="";var l=0,d=0;for(var y=0;y<this.length;y++){var w=this.words[y],p=((w<<l|d)&16777215).toString(16);if(d=w>>>24-l&16777215,l+=2,l>=26)l-=26,y--;if(d!==0||y!==this.length-1)f=g[6-p.length]+p+f;else f=p+f}if(d!==0)f=d.toString(16)+f;while(f.length%c!==0)f="0"+f;if(this.negative!==0)f="-"+f;return f}if(a===(a|0)&&a>=2&&a<=36){var u=S[a],m=x[a];f="";var E=this.clone();E.negative=0;while(!E.isZero()){var k=E.modn(m).toString(a);if(E=E.idivn(m),!E.isZero())f=g[u-k.length]+k+f;else f=k+f}if(this.isZero())f="0"+f;while(f.length%c!==0)f="0"+f;if(this.negative!==0)f="-"+f;return f}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var a=this.words[0];if(this.length===2)a+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)a+=4503599627370496+this.words[1]*67108864;else if(this.length>2)n(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-a:a},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(a,c){return n(typeof h<"u"),this.toArrayLike(h,a,c)},s.prototype.toArray=function(a,c){return this.toArrayLike(Array,a,c)},s.prototype.toArrayLike=function(a,c,f){var l=this.byteLength(),d=f||Math.max(1,l);n(l<=d,"byte array longer than desired length"),n(d>0,"Requested array length <= 0"),this.strip();var y=c==="le",w=new a(d),p,u,m=this.clone();if(!y){for(u=0;u<d-l;u++)w[u]=0;for(u=0;!m.isZero();u++)p=m.andln(255),m.iushrn(8),w[d-u-1]=p}else{for(u=0;!m.isZero();u++)p=m.andln(255),m.iushrn(8),w[u]=p;for(;u<d;u++)w[u]=0}return w},Math.clz32)s.prototype._countBits=function(a){return 32-Math.clz32(a)};else s.prototype._countBits=function(a){var c=a,f=0;if(c>=4096)f+=13,c>>>=13;if(c>=64)f+=7,c>>>=7;if(c>=8)f+=4,c>>>=4;if(c>=2)f+=2,c>>>=2;return f+c};s.prototype._zeroBits=function(a){if(a===0)return 26;var c=a,f=0;if((c&8191)===0)f+=13,c>>>=13;if((c&127)===0)f+=7,c>>>=7;if((c&15)===0)f+=4,c>>>=4;if((c&3)===0)f+=2,c>>>=2;if((c&1)===0)f++;return f},s.prototype.bitLength=function(){var a=this.words[this.length-1],c=this._countBits(a);return(this.length-1)*26+c};function M(a){var c=Array(a.bitLength());for(var f=0;f<c.length;f++){var l=f/26|0,d=f%26;c[f]=(a.words[l]&1<<d)>>>d}return c}s.prototype.zeroBits=function(){if(this.isZero())return 0;var a=0;for(var c=0;c<this.length;c++){var f=this._zeroBits(this.words[c]);if(a+=f,f!==26)break}return a},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(a){if(this.negative!==0)return this.abs().inotn(a).iaddn(1);return this.clone()},s.prototype.fromTwos=function(a){if(this.testn(a-1))return this.notn(a).iaddn(1).ineg();return this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},s.prototype.iuor=function(a){while(this.length<a.length)this.words[this.length++]=0;for(var c=0;c<a.length;c++)this.words[c]=this.words[c]|a.words[c];return this.strip()},s.prototype.ior=function(a){return n((this.negative|a.negative)===0),this.iuor(a)},s.prototype.or=function(a){if(this.length>a.length)return this.clone().ior(a);return a.clone().ior(this)},s.prototype.uor=function(a){if(this.length>a.length)return this.clone().iuor(a);return a.clone().iuor(this)},s.prototype.iuand=function(a){var c;if(this.length>a.length)c=a;else c=this;for(var f=0;f<c.length;f++)this.words[f]=this.words[f]&a.words[f];return this.length=c.length,this.strip()},s.prototype.iand=function(a){return n((this.negative|a.negative)===0),this.iuand(a)},s.prototype.and=function(a){if(this.length>a.length)return this.clone().iand(a);return a.clone().iand(this)},s.prototype.uand=function(a){if(this.length>a.length)return this.clone().iuand(a);return a.clone().iuand(this)},s.prototype.iuxor=function(a){var c,f;if(this.length>a.length)c=this,f=a;else c=a,f=this;for(var l=0;l<f.length;l++)this.words[l]=c.words[l]^f.words[l];if(this!==c)for(;l<c.length;l++)this.words[l]=c.words[l];return this.length=c.length,this.strip()},s.prototype.ixor=function(a){return n((this.negative|a.negative)===0),this.iuxor(a)},s.prototype.xor=function(a){if(this.length>a.length)return this.clone().ixor(a);return a.clone().ixor(this)},s.prototype.uxor=function(a){if(this.length>a.length)return this.clone().iuxor(a);return a.clone().iuxor(this)},s.prototype.inotn=function(a){n(typeof a==="number"&&a>=0);var c=Math.ceil(a/26)|0,f=a%26;if(this._expand(c),f>0)c--;for(var l=0;l<c;l++)this.words[l]=~this.words[l]&67108863;if(f>0)this.words[l]=~this.words[l]&67108863>>26-f;return this.strip()},s.prototype.notn=function(a){return this.clone().inotn(a)},s.prototype.setn=function(a,c){n(typeof a==="number"&&a>=0);var f=a/26|0,l=a%26;if(this._expand(f+1),c)this.words[f]=this.words[f]|1<<l;else this.words[f]=this.words[f]&~(1<<l);return this.strip()},s.prototype.iadd=function(a){var c;if(this.negative!==0&&a.negative===0)return this.negative=0,c=this.isub(a),this.negative^=1,this._normSign();else if(this.negative===0&&a.negative!==0)return a.negative=0,c=this.isub(a),a.negative=1,c._normSign();var f,l;if(this.length>a.length)f=this,l=a;else f=a,l=this;var d=0;for(var y=0;y<l.length;y++)c=(f.words[y]|0)+(l.words[y]|0)+d,this.words[y]=c&67108863,d=c>>>26;for(;d!==0&&y<f.length;y++)c=(f.words[y]|0)+d,this.words[y]=c&67108863,d=c>>>26;if(this.length=f.length,d!==0)this.words[this.length]=d,this.length++;else if(f!==this)for(;y<f.length;y++)this.words[y]=f.words[y];return this},s.prototype.add=function(a){var c;if(a.negative!==0&&this.negative===0)return a.negative=0,c=this.sub(a),a.negative^=1,c;else if(a.negative===0&&this.negative!==0)return this.negative=0,c=a.sub(this),this.negative=1,c;if(this.length>a.length)return this.clone().iadd(a);return a.clone().iadd(this)},s.prototype.isub=function(a){if(a.negative!==0){a.negative=0;var c=this.iadd(a);return a.negative=1,c._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(a),this.negative=1,this._normSign();var f=this.cmp(a);if(f===0)return this.negative=0,this.length=1,this.words[0]=0,this;var l,d;if(f>0)l=this,d=a;else l=a,d=this;var y=0;for(var w=0;w<d.length;w++)c=(l.words[w]|0)-(d.words[w]|0)+y,y=c>>26,this.words[w]=c&67108863;for(;y!==0&&w<l.length;w++)c=(l.words[w]|0)+y,y=c>>26,this.words[w]=c&67108863;if(y===0&&w<l.length&&l!==this)for(;w<l.length;w++)this.words[w]=l.words[w];if(this.length=Math.max(this.length,w),l!==this)this.negative=1;return this.strip()},s.prototype.sub=function(a){return this.clone().isub(a)};function I(a,c,f){f.negative=c.negative^a.negative;var l=a.length+c.length|0;f.length=l,l=l-1|0;var d=a.words[0]|0,y=c.words[0]|0,w=d*y,p=w&67108863,u=w/67108864|0;f.words[0]=p;for(var m=1;m<l;m++){var E=u>>>26,k=u&67108863,A=Math.min(m,c.length-1);for(var D=Math.max(0,m-a.length+1);D<=A;D++){var U=m-D|0;d=a.words[U]|0,y=c.words[D]|0,w=d*y+k,E+=w/67108864|0,k=w&67108863}f.words[m]=k|0,u=E|0}if(u!==0)f.words[m]=u|0;else f.length--;return f.strip()}var $=function(a,c,f){var l=a.words,d=c.words,y=f.words,w=0,p,u,m,E=l[0]|0,k=E&8191,A=E>>>13,D=l[1]|0,U=D&8191,K=D>>>13,he=l[2]|0,J=he&8191,H=he>>>13,se=l[3]|0,V=se&8191,Q=se>>>13,He=l[4]|0,z=He&8191,L=He>>>13,ae=l[5]|0,G=ae&8191,Y=ae>>>13,Me=l[6]|0,j=Me&8191,Z=Me>>>13,je=l[7]|0,W=je&8191,re=je>>>13,at=l[8]|0,ge=at&8191,ye=at>>>13,Gt=l[9]|0,pe=Gt&8191,ve=Gt>>>13,tr=d[0]|0,xe=tr&8191,Se=tr>>>13,zr=d[1]|0,Ee=zr&8191,Re=zr>>>13,jr=d[2]|0,Ce=jr&8191,Ie=jr>>>13,Pr=d[3]|0,Oe=Pr&8191,$e=Pr>>>13,kr=d[4]|0,De=kr&8191,Ne=kr>>>13,Mr=d[5]|0,Te=Mr&8191,O=Mr>>>13,q=d[6]|0,X=q&8191,te=q>>>13,Ge=d[7]|0,me=Ge&8191,we=Ge>>>13,Jt=d[8]|0,Pe=Jt&8191,ze=Jt>>>13,Ar=d[9]|0,Ae=Ar&8191,ke=Ar>>>13;f.negative=a.negative^c.negative,f.length=19,p=Math.imul(k,xe),u=Math.imul(k,Se),u=u+Math.imul(A,xe)|0,m=Math.imul(A,Se);var Xt=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,p=Math.imul(U,xe),u=Math.imul(U,Se),u=u+Math.imul(K,xe)|0,m=Math.imul(K,Se),p=p+Math.imul(k,Ee)|0,u=u+Math.imul(k,Re)|0,u=u+Math.imul(A,Ee)|0,m=m+Math.imul(A,Re)|0;var mt=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(mt>>>26)|0,mt&=67108863,p=Math.imul(J,xe),u=Math.imul(J,Se),u=u+Math.imul(H,xe)|0,m=Math.imul(H,Se),p=p+Math.imul(U,Ee)|0,u=u+Math.imul(U,Re)|0,u=u+Math.imul(K,Ee)|0,m=m+Math.imul(K,Re)|0,p=p+Math.imul(k,Ce)|0,u=u+Math.imul(k,Ie)|0,u=u+Math.imul(A,Ce)|0,m=m+Math.imul(A,Ie)|0;var ft=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(ft>>>26)|0,ft&=67108863,p=Math.imul(V,xe),u=Math.imul(V,Se),u=u+Math.imul(Q,xe)|0,m=Math.imul(Q,Se),p=p+Math.imul(J,Ee)|0,u=u+Math.imul(J,Re)|0,u=u+Math.imul(H,Ee)|0,m=m+Math.imul(H,Re)|0,p=p+Math.imul(U,Ce)|0,u=u+Math.imul(U,Ie)|0,u=u+Math.imul(K,Ce)|0,m=m+Math.imul(K,Ie)|0,p=p+Math.imul(k,Oe)|0,u=u+Math.imul(k,$e)|0,u=u+Math.imul(A,Oe)|0,m=m+Math.imul(A,$e)|0;var zt=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(zt>>>26)|0,zt&=67108863,p=Math.imul(z,xe),u=Math.imul(z,Se),u=u+Math.imul(L,xe)|0,m=Math.imul(L,Se),p=p+Math.imul(V,Ee)|0,u=u+Math.imul(V,Re)|0,u=u+Math.imul(Q,Ee)|0,m=m+Math.imul(Q,Re)|0,p=p+Math.imul(J,Ce)|0,u=u+Math.imul(J,Ie)|0,u=u+Math.imul(H,Ce)|0,m=m+Math.imul(H,Ie)|0,p=p+Math.imul(U,Oe)|0,u=u+Math.imul(U,$e)|0,u=u+Math.imul(K,Oe)|0,m=m+Math.imul(K,$e)|0,p=p+Math.imul(k,De)|0,u=u+Math.imul(k,Ne)|0,u=u+Math.imul(A,De)|0,m=m+Math.imul(A,Ne)|0;var At=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(At>>>26)|0,At&=67108863,p=Math.imul(G,xe),u=Math.imul(G,Se),u=u+Math.imul(Y,xe)|0,m=Math.imul(Y,Se),p=p+Math.imul(z,Ee)|0,u=u+Math.imul(z,Re)|0,u=u+Math.imul(L,Ee)|0,m=m+Math.imul(L,Re)|0,p=p+Math.imul(V,Ce)|0,u=u+Math.imul(V,Ie)|0,u=u+Math.imul(Q,Ce)|0,m=m+Math.imul(Q,Ie)|0,p=p+Math.imul(J,Oe)|0,u=u+Math.imul(J,$e)|0,u=u+Math.imul(H,Oe)|0,m=m+Math.imul(H,$e)|0,p=p+Math.imul(U,De)|0,u=u+Math.imul(U,Ne)|0,u=u+Math.imul(K,De)|0,m=m+Math.imul(K,Ne)|0,p=p+Math.imul(k,Te)|0,u=u+Math.imul(k,O)|0,u=u+Math.imul(A,Te)|0,m=m+Math.imul(A,O)|0;var sr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(sr>>>26)|0,sr&=67108863,p=Math.imul(j,xe),u=Math.imul(j,Se),u=u+Math.imul(Z,xe)|0,m=Math.imul(Z,Se),p=p+Math.imul(G,Ee)|0,u=u+Math.imul(G,Re)|0,u=u+Math.imul(Y,Ee)|0,m=m+Math.imul(Y,Re)|0,p=p+Math.imul(z,Ce)|0,u=u+Math.imul(z,Ie)|0,u=u+Math.imul(L,Ce)|0,m=m+Math.imul(L,Ie)|0,p=p+Math.imul(V,Oe)|0,u=u+Math.imul(V,$e)|0,u=u+Math.imul(Q,Oe)|0,m=m+Math.imul(Q,$e)|0,p=p+Math.imul(J,De)|0,u=u+Math.imul(J,Ne)|0,u=u+Math.imul(H,De)|0,m=m+Math.imul(H,Ne)|0,p=p+Math.imul(U,Te)|0,u=u+Math.imul(U,O)|0,u=u+Math.imul(K,Te)|0,m=m+Math.imul(K,O)|0,p=p+Math.imul(k,X)|0,u=u+Math.imul(k,te)|0,u=u+Math.imul(A,X)|0,m=m+Math.imul(A,te)|0;var ar=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(ar>>>26)|0,ar&=67108863,p=Math.imul(W,xe),u=Math.imul(W,Se),u=u+Math.imul(re,xe)|0,m=Math.imul(re,Se),p=p+Math.imul(j,Ee)|0,u=u+Math.imul(j,Re)|0,u=u+Math.imul(Z,Ee)|0,m=m+Math.imul(Z,Re)|0,p=p+Math.imul(G,Ce)|0,u=u+Math.imul(G,Ie)|0,u=u+Math.imul(Y,Ce)|0,m=m+Math.imul(Y,Ie)|0,p=p+Math.imul(z,Oe)|0,u=u+Math.imul(z,$e)|0,u=u+Math.imul(L,Oe)|0,m=m+Math.imul(L,$e)|0,p=p+Math.imul(V,De)|0,u=u+Math.imul(V,Ne)|0,u=u+Math.imul(Q,De)|0,m=m+Math.imul(Q,Ne)|0,p=p+Math.imul(J,Te)|0,u=u+Math.imul(J,O)|0,u=u+Math.imul(H,Te)|0,m=m+Math.imul(H,O)|0,p=p+Math.imul(U,X)|0,u=u+Math.imul(U,te)|0,u=u+Math.imul(K,X)|0,m=m+Math.imul(K,te)|0,p=p+Math.imul(k,me)|0,u=u+Math.imul(k,we)|0,u=u+Math.imul(A,me)|0,m=m+Math.imul(A,we)|0;var ur=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(ur>>>26)|0,ur&=67108863,p=Math.imul(ge,xe),u=Math.imul(ge,Se),u=u+Math.imul(ye,xe)|0,m=Math.imul(ye,Se),p=p+Math.imul(W,Ee)|0,u=u+Math.imul(W,Re)|0,u=u+Math.imul(re,Ee)|0,m=m+Math.imul(re,Re)|0,p=p+Math.imul(j,Ce)|0,u=u+Math.imul(j,Ie)|0,u=u+Math.imul(Z,Ce)|0,m=m+Math.imul(Z,Ie)|0,p=p+Math.imul(G,Oe)|0,u=u+Math.imul(G,$e)|0,u=u+Math.imul(Y,Oe)|0,m=m+Math.imul(Y,$e)|0,p=p+Math.imul(z,De)|0,u=u+Math.imul(z,Ne)|0,u=u+Math.imul(L,De)|0,m=m+Math.imul(L,Ne)|0,p=p+Math.imul(V,Te)|0,u=u+Math.imul(V,O)|0,u=u+Math.imul(Q,Te)|0,m=m+Math.imul(Q,O)|0,p=p+Math.imul(J,X)|0,u=u+Math.imul(J,te)|0,u=u+Math.imul(H,X)|0,m=m+Math.imul(H,te)|0,p=p+Math.imul(U,me)|0,u=u+Math.imul(U,we)|0,u=u+Math.imul(K,me)|0,m=m+Math.imul(K,we)|0,p=p+Math.imul(k,Pe)|0,u=u+Math.imul(k,ze)|0,u=u+Math.imul(A,Pe)|0,m=m+Math.imul(A,ze)|0;var lr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(lr>>>26)|0,lr&=67108863,p=Math.imul(pe,xe),u=Math.imul(pe,Se),u=u+Math.imul(ve,xe)|0,m=Math.imul(ve,Se),p=p+Math.imul(ge,Ee)|0,u=u+Math.imul(ge,Re)|0,u=u+Math.imul(ye,Ee)|0,m=m+Math.imul(ye,Re)|0,p=p+Math.imul(W,Ce)|0,u=u+Math.imul(W,Ie)|0,u=u+Math.imul(re,Ce)|0,m=m+Math.imul(re,Ie)|0,p=p+Math.imul(j,Oe)|0,u=u+Math.imul(j,$e)|0,u=u+Math.imul(Z,Oe)|0,m=m+Math.imul(Z,$e)|0,p=p+Math.imul(G,De)|0,u=u+Math.imul(G,Ne)|0,u=u+Math.imul(Y,De)|0,m=m+Math.imul(Y,Ne)|0,p=p+Math.imul(z,Te)|0,u=u+Math.imul(z,O)|0,u=u+Math.imul(L,Te)|0,m=m+Math.imul(L,O)|0,p=p+Math.imul(V,X)|0,u=u+Math.imul(V,te)|0,u=u+Math.imul(Q,X)|0,m=m+Math.imul(Q,te)|0,p=p+Math.imul(J,me)|0,u=u+Math.imul(J,we)|0,u=u+Math.imul(H,me)|0,m=m+Math.imul(H,we)|0,p=p+Math.imul(U,Pe)|0,u=u+Math.imul(U,ze)|0,u=u+Math.imul(K,Pe)|0,m=m+Math.imul(K,ze)|0,p=p+Math.imul(k,Ae)|0,u=u+Math.imul(k,ke)|0,u=u+Math.imul(A,Ae)|0,m=m+Math.imul(A,ke)|0;var cr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(cr>>>26)|0,cr&=67108863,p=Math.imul(pe,Ee),u=Math.imul(pe,Re),u=u+Math.imul(ve,Ee)|0,m=Math.imul(ve,Re),p=p+Math.imul(ge,Ce)|0,u=u+Math.imul(ge,Ie)|0,u=u+Math.imul(ye,Ce)|0,m=m+Math.imul(ye,Ie)|0,p=p+Math.imul(W,Oe)|0,u=u+Math.imul(W,$e)|0,u=u+Math.imul(re,Oe)|0,m=m+Math.imul(re,$e)|0,p=p+Math.imul(j,De)|0,u=u+Math.imul(j,Ne)|0,u=u+Math.imul(Z,De)|0,m=m+Math.imul(Z,Ne)|0,p=p+Math.imul(G,Te)|0,u=u+Math.imul(G,O)|0,u=u+Math.imul(Y,Te)|0,m=m+Math.imul(Y,O)|0,p=p+Math.imul(z,X)|0,u=u+Math.imul(z,te)|0,u=u+Math.imul(L,X)|0,m=m+Math.imul(L,te)|0,p=p+Math.imul(V,me)|0,u=u+Math.imul(V,we)|0,u=u+Math.imul(Q,me)|0,m=m+Math.imul(Q,we)|0,p=p+Math.imul(J,Pe)|0,u=u+Math.imul(J,ze)|0,u=u+Math.imul(H,Pe)|0,m=m+Math.imul(H,ze)|0,p=p+Math.imul(U,Ae)|0,u=u+Math.imul(U,ke)|0,u=u+Math.imul(K,Ae)|0,m=m+Math.imul(K,ke)|0;var dr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(dr>>>26)|0,dr&=67108863,p=Math.imul(pe,Ce),u=Math.imul(pe,Ie),u=u+Math.imul(ve,Ce)|0,m=Math.imul(ve,Ie),p=p+Math.imul(ge,Oe)|0,u=u+Math.imul(ge,$e)|0,u=u+Math.imul(ye,Oe)|0,m=m+Math.imul(ye,$e)|0,p=p+Math.imul(W,De)|0,u=u+Math.imul(W,Ne)|0,u=u+Math.imul(re,De)|0,m=m+Math.imul(re,Ne)|0,p=p+Math.imul(j,Te)|0,u=u+Math.imul(j,O)|0,u=u+Math.imul(Z,Te)|0,m=m+Math.imul(Z,O)|0,p=p+Math.imul(G,X)|0,u=u+Math.imul(G,te)|0,u=u+Math.imul(Y,X)|0,m=m+Math.imul(Y,te)|0,p=p+Math.imul(z,me)|0,u=u+Math.imul(z,we)|0,u=u+Math.imul(L,me)|0,m=m+Math.imul(L,we)|0,p=p+Math.imul(V,Pe)|0,u=u+Math.imul(V,ze)|0,u=u+Math.imul(Q,Pe)|0,m=m+Math.imul(Q,ze)|0,p=p+Math.imul(J,Ae)|0,u=u+Math.imul(J,ke)|0,u=u+Math.imul(H,Ae)|0,m=m+Math.imul(H,ke)|0;var fr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(fr>>>26)|0,fr&=67108863,p=Math.imul(pe,Oe),u=Math.imul(pe,$e),u=u+Math.imul(ve,Oe)|0,m=Math.imul(ve,$e),p=p+Math.imul(ge,De)|0,u=u+Math.imul(ge,Ne)|0,u=u+Math.imul(ye,De)|0,m=m+Math.imul(ye,Ne)|0,p=p+Math.imul(W,Te)|0,u=u+Math.imul(W,O)|0,u=u+Math.imul(re,Te)|0,m=m+Math.imul(re,O)|0,p=p+Math.imul(j,X)|0,u=u+Math.imul(j,te)|0,u=u+Math.imul(Z,X)|0,m=m+Math.imul(Z,te)|0,p=p+Math.imul(G,me)|0,u=u+Math.imul(G,we)|0,u=u+Math.imul(Y,me)|0,m=m+Math.imul(Y,we)|0,p=p+Math.imul(z,Pe)|0,u=u+Math.imul(z,ze)|0,u=u+Math.imul(L,Pe)|0,m=m+Math.imul(L,ze)|0,p=p+Math.imul(V,Ae)|0,u=u+Math.imul(V,ke)|0,u=u+Math.imul(Q,Ae)|0,m=m+Math.imul(Q,ke)|0;var hr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(hr>>>26)|0,hr&=67108863,p=Math.imul(pe,De),u=Math.imul(pe,Ne),u=u+Math.imul(ve,De)|0,m=Math.imul(ve,Ne),p=p+Math.imul(ge,Te)|0,u=u+Math.imul(ge,O)|0,u=u+Math.imul(ye,Te)|0,m=m+Math.imul(ye,O)|0,p=p+Math.imul(W,X)|0,u=u+Math.imul(W,te)|0,u=u+Math.imul(re,X)|0,m=m+Math.imul(re,te)|0,p=p+Math.imul(j,me)|0,u=u+Math.imul(j,we)|0,u=u+Math.imul(Z,me)|0,m=m+Math.imul(Z,we)|0,p=p+Math.imul(G,Pe)|0,u=u+Math.imul(G,ze)|0,u=u+Math.imul(Y,Pe)|0,m=m+Math.imul(Y,ze)|0,p=p+Math.imul(z,Ae)|0,u=u+Math.imul(z,ke)|0,u=u+Math.imul(L,Ae)|0,m=m+Math.imul(L,ke)|0;var pr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(pr>>>26)|0,pr&=67108863,p=Math.imul(pe,Te),u=Math.imul(pe,O),u=u+Math.imul(ve,Te)|0,m=Math.imul(ve,O),p=p+Math.imul(ge,X)|0,u=u+Math.imul(ge,te)|0,u=u+Math.imul(ye,X)|0,m=m+Math.imul(ye,te)|0,p=p+Math.imul(W,me)|0,u=u+Math.imul(W,we)|0,u=u+Math.imul(re,me)|0,m=m+Math.imul(re,we)|0,p=p+Math.imul(j,Pe)|0,u=u+Math.imul(j,ze)|0,u=u+Math.imul(Z,Pe)|0,m=m+Math.imul(Z,ze)|0,p=p+Math.imul(G,Ae)|0,u=u+Math.imul(G,ke)|0,u=u+Math.imul(Y,Ae)|0,m=m+Math.imul(Y,ke)|0;var mr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(mr>>>26)|0,mr&=67108863,p=Math.imul(pe,X),u=Math.imul(pe,te),u=u+Math.imul(ve,X)|0,m=Math.imul(ve,te),p=p+Math.imul(ge,me)|0,u=u+Math.imul(ge,we)|0,u=u+Math.imul(ye,me)|0,m=m+Math.imul(ye,we)|0,p=p+Math.imul(W,Pe)|0,u=u+Math.imul(W,ze)|0,u=u+Math.imul(re,Pe)|0,m=m+Math.imul(re,ze)|0,p=p+Math.imul(j,Ae)|0,u=u+Math.imul(j,ke)|0,u=u+Math.imul(Z,Ae)|0,m=m+Math.imul(Z,ke)|0;var gr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(gr>>>26)|0,gr&=67108863,p=Math.imul(pe,me),u=Math.imul(pe,we),u=u+Math.imul(ve,me)|0,m=Math.imul(ve,we),p=p+Math.imul(ge,Pe)|0,u=u+Math.imul(ge,ze)|0,u=u+Math.imul(ye,Pe)|0,m=m+Math.imul(ye,ze)|0,p=p+Math.imul(W,Ae)|0,u=u+Math.imul(W,ke)|0,u=u+Math.imul(re,Ae)|0,m=m+Math.imul(re,ke)|0;var yr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(yr>>>26)|0,yr&=67108863,p=Math.imul(pe,Pe),u=Math.imul(pe,ze),u=u+Math.imul(ve,Pe)|0,m=Math.imul(ve,ze),p=p+Math.imul(ge,Ae)|0,u=u+Math.imul(ge,ke)|0,u=u+Math.imul(ye,Ae)|0,m=m+Math.imul(ye,ke)|0;var vr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(vr>>>26)|0,vr&=67108863,p=Math.imul(pe,Ae),u=Math.imul(pe,ke),u=u+Math.imul(ve,Ae)|0,m=Math.imul(ve,ke);var br=(w+p|0)+((u&8191)<<13)|0;if(w=(m+(u>>>13)|0)+(br>>>26)|0,br&=67108863,y[0]=Xt,y[1]=mt,y[2]=ft,y[3]=zt,y[4]=At,y[5]=sr,y[6]=ar,y[7]=ur,y[8]=lr,y[9]=cr,y[10]=dr,y[11]=fr,y[12]=hr,y[13]=pr,y[14]=mr,y[15]=gr,y[16]=yr,y[17]=vr,y[18]=br,w!==0)y[19]=w,f.length++;return f};if(!Math.imul)$=I;function T(a,c,f){f.negative=c.negative^a.negative,f.length=a.length+c.length;var l=0,d=0;for(var y=0;y<f.length-1;y++){var w=d;d=0;var p=l&67108863,u=Math.min(y,c.length-1);for(var m=Math.max(0,y-a.length+1);m<=u;m++){var E=y-m,k=a.words[E]|0,A=c.words[m]|0,D=k*A,U=D&67108863;w=w+(D/67108864|0)|0,U=U+p|0,p=U&67108863,w=w+(U>>>26)|0,d+=w>>>26,w&=67108863}f.words[y]=p,l=w,w=d}if(l!==0)f.words[y]=l;else f.length--;return f.strip()}function P(a,c,f){var l=new R;return l.mulp(a,c,f)}s.prototype.mulTo=function(a,c){var f,l=this.length+a.length;if(this.length===10&&a.length===10)f=$(this,a,c);else if(l<63)f=I(this,a,c);else if(l<1024)f=T(this,a,c);else f=P(this,a,c);return f};function R(a,c){this.x=a,this.y=c}R.prototype.makeRBT=function(a){var c=Array(a),f=s.prototype._countBits(a)-1;for(var l=0;l<a;l++)c[l]=this.revBin(l,f,a);return c},R.prototype.revBin=function(a,c,f){if(a===0||a===f-1)return a;var l=0;for(var d=0;d<c;d++)l|=(a&1)<<c-d-1,a>>=1;return l},R.prototype.permute=function(a,c,f,l,d,y){for(var w=0;w<y;w++)l[w]=c[a[w]],d[w]=f[a[w]]},R.prototype.transform=function(a,c,f,l,d,y){this.permute(y,a,c,f,l,d);for(var w=1;w<d;w<<=1){var p=w<<1,u=Math.cos(2*Math.PI/p),m=Math.sin(2*Math.PI/p);for(var E=0;E<d;E+=p){var k=u,A=m;for(var D=0;D<w;D++){var U=f[E+D],K=l[E+D],he=f[E+D+w],J=l[E+D+w],H=k*he-A*J;if(J=k*J+A*he,he=H,f[E+D]=U+he,l[E+D]=K+J,f[E+D+w]=U-he,l[E+D+w]=K-J,D!==p)H=u*k-m*A,A=u*A+m*k,k=H}}}},R.prototype.guessLen13b=function(a,c){var f=Math.max(c,a)|1,l=f&1,d=0;for(f=f/2|0;f;f=f>>>1)d++;return 1<<d+1+l},R.prototype.conjugate=function(a,c,f){if(f<=1)return;for(var l=0;l<f/2;l++){var d=a[l];a[l]=a[f-l-1],a[f-l-1]=d,d=c[l],c[l]=-c[f-l-1],c[f-l-1]=-d}},R.prototype.normalize13b=function(a,c){var f=0;for(var l=0;l<c/2;l++){var d=Math.round(a[2*l+1]/c)*8192+Math.round(a[2*l]/c)+f;if(a[l]=d&67108863,d<67108864)f=0;else f=d/67108864|0}return a},R.prototype.convert13b=function(a,c,f,l){var d=0;for(var y=0;y<c;y++)d=d+(a[y]|0),f[2*y]=d&8191,d=d>>>13,f[2*y+1]=d&8191,d=d>>>13;for(y=2*c;y<l;++y)f[y]=0;n(d===0),n((d&-8192)===0)},R.prototype.stub=function(a){var c=Array(a);for(var f=0;f<a;f++)c[f]=0;return c},R.prototype.mulp=function(a,c,f){var l=2*this.guessLen13b(a.length,c.length),d=this.makeRBT(l),y=this.stub(l),w=Array(l),p=Array(l),u=Array(l),m=Array(l),E=Array(l),k=Array(l),A=f.words;A.length=l,this.convert13b(a.words,a.length,w,l),this.convert13b(c.words,c.length,m,l),this.transform(w,y,p,u,l,d),this.transform(m,y,E,k,l,d);for(var D=0;D<l;D++){var U=p[D]*E[D]-u[D]*k[D];u[D]=p[D]*k[D]+u[D]*E[D],p[D]=U}return this.conjugate(p,u,l),this.transform(p,u,A,y,l,d),this.conjugate(A,y,l),this.normalize13b(A,l),f.negative=a.negative^c.negative,f.length=a.length+c.length,f.strip()},s.prototype.mul=function(a){var c=new s(null);return c.words=Array(this.length+a.length),this.mulTo(a,c)},s.prototype.mulf=function(a){var c=new s(null);return c.words=Array(this.length+a.length),P(this,a,c)},s.prototype.imul=function(a){return this.clone().mulTo(a,this)},s.prototype.imuln=function(a){n(typeof a==="number"),n(a<67108864);var c=0;for(var f=0;f<this.length;f++){var l=(this.words[f]|0)*a,d=(l&67108863)+(c&67108863);c>>=26,c+=l/67108864|0,c+=d>>>26,this.words[f]=d&67108863}if(c!==0)this.words[f]=c,this.length++;return this.length=a===0?1:this.length,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 c=M(a);if(c.length===0)return new s(1);var f=this;for(var l=0;l<c.length;l++,f=f.sqr())if(c[l]!==0)break;if(++l<c.length)for(var d=f.sqr();l<c.length;l++,d=d.sqr()){if(c[l]===0)continue;f=f.mul(d)}return f},s.prototype.iushln=function(a){n(typeof a==="number"&&a>=0);var c=a%26,f=(a-c)/26,l=67108863>>>26-c<<26-c,d;if(c!==0){var y=0;for(d=0;d<this.length;d++){var w=this.words[d]&l,p=(this.words[d]|0)-w<<c;this.words[d]=p|y,y=w>>>26-c}if(y)this.words[d]=y,this.length++}if(f!==0){for(d=this.length-1;d>=0;d--)this.words[d+f]=this.words[d];for(d=0;d<f;d++)this.words[d]=0;this.length+=f}return this.strip()},s.prototype.ishln=function(a){return n(this.negative===0),this.iushln(a)},s.prototype.iushrn=function(a,c,f){n(typeof a==="number"&&a>=0);var l;if(c)l=(c-c%26)/26;else l=0;var d=a%26,y=Math.min((a-d)/26,this.length),w=67108863^67108863>>>d<<d,p=f;if(l-=y,l=Math.max(0,l),p){for(var u=0;u<y;u++)p.words[u]=this.words[u];p.length=y}if(y===0);else if(this.length>y){this.length-=y;for(u=0;u<this.length;u++)this.words[u]=this.words[u+y]}else this.words[0]=0,this.length=1;var m=0;for(u=this.length-1;u>=0&&(m!==0||u>=l);u--){var E=this.words[u]|0;this.words[u]=m<<26-d|E>>>d,m=E&w}if(p&&m!==0)p.words[p.length++]=m;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},s.prototype.ishrn=function(a,c,f){return n(this.negative===0),this.iushrn(a,c,f)},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){n(typeof a==="number"&&a>=0);var c=a%26,f=(a-c)/26,l=1<<c;if(this.length<=f)return!1;var d=this.words[f];return!!(d&l)},s.prototype.imaskn=function(a){n(typeof a==="number"&&a>=0);var c=a%26,f=(a-c)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=f)return this;if(c!==0)f++;if(this.length=Math.min(f,this.length),c!==0){var l=67108863^67108863>>>c<<c;this.words[this.length-1]&=l}return this.strip()},s.prototype.maskn=function(a){return this.clone().imaskn(a)},s.prototype.iaddn=function(a){if(n(typeof a==="number"),n(a<67108864),a<0)return this.isubn(-a);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<a)return this.words[0]=a-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(a),this.negative=1,this}return this._iaddn(a)},s.prototype._iaddn=function(a){this.words[0]+=a;for(var c=0;c<this.length&&this.words[c]>=67108864;c++)if(this.words[c]-=67108864,c===this.length-1)this.words[c+1]=1;else this.words[c+1]++;return this.length=Math.max(this.length,c+1),this},s.prototype.isubn=function(a){if(n(typeof a==="number"),n(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 c=0;c<this.length&&this.words[c]<0;c++)this.words[c]+=67108864,this.words[c+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,c,f){var l=a.length+f,d;this._expand(l);var y,w=0;for(d=0;d<a.length;d++){y=(this.words[d+f]|0)+w;var p=(a.words[d]|0)*c;y-=p&67108863,w=(y>>26)-(p/67108864|0),this.words[d+f]=y&67108863}for(;d<this.length-f;d++)y=(this.words[d+f]|0)+w,w=y>>26,this.words[d+f]=y&67108863;if(w===0)return this.strip();n(w===-1),w=0;for(d=0;d<this.length;d++)y=-(this.words[d]|0)+w,w=y>>26,this.words[d]=y&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(a,c){var f=this.length-a.length,l=this.clone(),d=a,y=d.words[d.length-1]|0,w=this._countBits(y);if(f=26-w,f!==0)d=d.ushln(f),l.iushln(f),y=d.words[d.length-1]|0;var p=l.length-d.length,u;if(c!=="mod"){u=new s(null),u.length=p+1,u.words=Array(u.length);for(var m=0;m<u.length;m++)u.words[m]=0}var E=l.clone()._ishlnsubmul(d,1,p);if(E.negative===0){if(l=E,u)u.words[p]=1}for(var k=p-1;k>=0;k--){var A=(l.words[d.length+k]|0)*67108864+(l.words[d.length+k-1]|0);A=Math.min(A/y|0,67108863),l._ishlnsubmul(d,A,k);while(l.negative!==0)if(A--,l.negative=0,l._ishlnsubmul(d,1,k),!l.isZero())l.negative^=1;if(u)u.words[k]=A}if(u)u.strip();if(l.strip(),c!=="div"&&f!==0)l.iushrn(f);return{div:u||null,mod:l}},s.prototype.divmod=function(a,c,f){if(n(!a.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var l,d,y;if(this.negative!==0&&a.negative===0){if(y=this.neg().divmod(a,c),c!=="mod")l=y.div.neg();if(c!=="div"){if(d=y.mod.neg(),f&&d.negative!==0)d.iadd(a)}return{div:l,mod:d}}if(this.negative===0&&a.negative!==0){if(y=this.divmod(a.neg(),c),c!=="mod")l=y.div.neg();return{div:l,mod:y.mod}}if((this.negative&a.negative)!==0){if(y=this.neg().divmod(a.neg(),c),c!=="div"){if(d=y.mod.neg(),f&&d.negative!==0)d.isub(a)}return{div:y.div,mod:d}}if(a.length>this.length||this.cmp(a)<0)return{div:new s(0),mod:this};if(a.length===1){if(c==="div")return{div:this.divn(a.words[0]),mod:null};if(c==="mod")return{div:null,mod:new s(this.modn(a.words[0]))};return{div:this.divn(a.words[0]),mod:new s(this.modn(a.words[0]))}}return this._wordDiv(a,c)},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 c=this.divmod(a);if(c.mod.isZero())return c.div;var f=c.div.negative!==0?c.mod.isub(a):c.mod,l=a.ushrn(1),d=a.andln(1),y=f.cmp(l);if(y<0||d===1&&y===0)return c.div;return c.div.negative!==0?c.div.isubn(1):c.div.iaddn(1)},s.prototype.modn=function(a){n(a<=67108863);var c=67108864%a,f=0;for(var l=this.length-1;l>=0;l--)f=(c*f+(this.words[l]|0))%a;return f},s.prototype.idivn=function(a){n(a<=67108863);var c=0;for(var f=this.length-1;f>=0;f--){var l=(this.words[f]|0)+c*67108864;this.words[f]=l/a|0,c=l%a}return this.strip()},s.prototype.divn=function(a){return this.clone().idivn(a)},s.prototype.egcd=function(a){n(a.negative===0),n(!a.isZero());var c=this,f=a.clone();if(c.negative!==0)c=c.umod(a);else c=c.clone();var l=new s(1),d=new s(0),y=new s(0),w=new s(1),p=0;while(c.isEven()&&f.isEven())c.iushrn(1),f.iushrn(1),++p;var u=f.clone(),m=c.clone();while(!c.isZero()){for(var E=0,k=1;(c.words[0]&k)===0&&E<26;++E,k<<=1);if(E>0){c.iushrn(E);while(E-- >0){if(l.isOdd()||d.isOdd())l.iadd(u),d.isub(m);l.iushrn(1),d.iushrn(1)}}for(var A=0,D=1;(f.words[0]&D)===0&&A<26;++A,D<<=1);if(A>0){f.iushrn(A);while(A-- >0){if(y.isOdd()||w.isOdd())y.iadd(u),w.isub(m);y.iushrn(1),w.iushrn(1)}}if(c.cmp(f)>=0)c.isub(f),l.isub(y),d.isub(w);else f.isub(c),y.isub(l),w.isub(d)}return{a:y,b:w,gcd:f.iushln(p)}},s.prototype._invmp=function(a){n(a.negative===0),n(!a.isZero());var c=this,f=a.clone();if(c.negative!==0)c=c.umod(a);else c=c.clone();var l=new s(1),d=new s(0),y=f.clone();while(c.cmpn(1)>0&&f.cmpn(1)>0){for(var w=0,p=1;(c.words[0]&p)===0&&w<26;++w,p<<=1);if(w>0){c.iushrn(w);while(w-- >0){if(l.isOdd())l.iadd(y);l.iushrn(1)}}for(var u=0,m=1;(f.words[0]&m)===0&&u<26;++u,m<<=1);if(u>0){f.iushrn(u);while(u-- >0){if(d.isOdd())d.iadd(y);d.iushrn(1)}}if(c.cmp(f)>=0)c.isub(f),l.isub(d);else f.isub(c),d.isub(l)}var E;if(c.cmpn(1)===0)E=l;else E=d;if(E.cmpn(0)<0)E.iadd(a);return E},s.prototype.gcd=function(a){if(this.isZero())return a.abs();if(a.isZero())return this.abs();var c=this.clone(),f=a.clone();c.negative=0,f.negative=0;for(var l=0;c.isEven()&&f.isEven();l++)c.iushrn(1),f.iushrn(1);do{while(c.isEven())c.iushrn(1);while(f.isEven())f.iushrn(1);var d=c.cmp(f);if(d<0){var y=c;c=f,f=y}else if(d===0||f.cmpn(1)===0)break;c.isub(f)}while(!0);return f.iushln(l)},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){n(typeof a==="number");var c=a%26,f=(a-c)/26,l=1<<c;if(this.length<=f)return this._expand(f+1),this.words[f]|=l,this;var d=l;for(var y=f;d!==0&&y<this.length;y++){var w=this.words[y]|0;w+=d,d=w>>>26,w&=67108863,this.words[y]=w}if(d!==0)this.words[y]=d,this.length++;return this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(a){var c=a<0;if(this.negative!==0&&!c)return-1;if(this.negative===0&&c)return 1;this.strip();var f;if(this.length>1)f=1;else{if(c)a=-a;n(a<=67108863,"Number is too big");var l=this.words[0]|0;f=l===a?0:l<a?-1:1}if(this.negative!==0)return-f|0;return f},s.prototype.cmp=function(a){if(this.negative!==0&&a.negative===0)return-1;if(this.negative===0&&a.negative!==0)return 1;var c=this.ucmp(a);if(this.negative!==0)return-c|0;return c},s.prototype.ucmp=function(a){if(this.length>a.length)return 1;if(this.length<a.length)return-1;var c=0;for(var f=this.length-1;f>=0;f--){var l=this.words[f]|0,d=a.words[f]|0;if(l===d)continue;if(l<d)c=-1;else if(l>d)c=1;break}return c},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 F(a)},s.prototype.toRed=function(a){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),a.convertTo(this)._forceRed(a)},s.prototype.fromRed=function(){return n(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 n(!this.red,"Already a number in reduction context"),this._forceRed(a)},s.prototype.redAdd=function(a){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,a)},s.prototype.redIAdd=function(a){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,a)},s.prototype.redSub=function(a){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,a)},s.prototype.redISub=function(a){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,a)},s.prototype.redShl=function(a){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,a)},s.prototype.redMul=function(a){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.mul(this,a)},s.prototype.redIMul=function(a){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.imul(this,a)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(a){return n(this.red&&!a.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,a)};var C={k256:null,p224:null,p192:null,p25519:null};function N(a,c){this.name=a,this.p=new s(c,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}N.prototype._tmp=function(){var a=new s(null);return a.words=Array(Math.ceil(this.n/13)),a},N.prototype.ireduce=function(a){var c=a,f;do this.split(c,this.tmp),c=this.imulK(c),c=c.iadd(this.tmp),f=c.bitLength();while(f>this.n);var l=f<this.n?-1:c.ucmp(this.p);if(l===0)c.words[0]=0,c.length=1;else if(l>0)c.isub(this.p);else if(c.strip!==void 0)c.strip();else c._strip();return c},N.prototype.split=function(a,c){a.iushrn(this.n,0,c)},N.prototype.imulK=function(a){return a.imul(this.k)};function B(){N.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(B,N),B.prototype.split=function(a,c){var f=4194303,l=Math.min(a.length,9);for(var d=0;d<l;d++)c.words[d]=a.words[d];if(c.length=l,a.length<=9){a.words[0]=0,a.length=1;return}var y=a.words[9];c.words[c.length++]=y&f;for(d=10;d<a.length;d++){var w=a.words[d]|0;a.words[d-10]=(w&f)<<4|y>>>22,y=w}if(y>>>=22,a.words[d-10]=y,y===0&&a.length>10)a.length-=10;else a.length-=9},B.prototype.imulK=function(a){a.words[a.length]=0,a.words[a.length+1]=0,a.length+=2;var c=0;for(var f=0;f<a.length;f++){var l=a.words[f]|0;c+=l*977,a.words[f]=c&67108863,c=l*64+(c/67108864|0)}if(a.words[a.length-1]===0){if(a.length--,a.words[a.length-1]===0)a.length--}return a};function ie(){N.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(ie,N);function le(){N.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(le,N);function ue(){N.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(ue,N),ue.prototype.imulK=function(a){var c=0;for(var f=0;f<a.length;f++){var l=(a.words[f]|0)*19+c,d=l&67108863;l>>>=26,a.words[f]=d,c=l}if(c!==0)a.words[a.length++]=c;return a},s._prime=function(a){if(C[a])return C[a];var c;if(a==="k256")c=new B;else if(a==="p224")c=new ie;else if(a==="p192")c=new le;else if(a==="p25519")c=new ue;else throw Error("Unknown prime "+a);return C[a]=c,c};function F(a){if(typeof a==="string"){var c=s._prime(a);this.m=c.p,this.prime=c}else n(a.gtn(1),"modulus must be greater than 1"),this.m=a,this.prime=null}F.prototype._verify1=function(a){n(a.negative===0,"red works only with positives"),n(a.red,"red works only with red numbers")},F.prototype._verify2=function(a,c){n((a.negative|c.negative)===0,"red works only with positives"),n(a.red&&a.red===c.red,"red works only with red numbers")},F.prototype.imod=function(a){if(this.prime)return this.prime.ireduce(a)._forceRed(this);return a.umod(this.m)._forceRed(this)},F.prototype.neg=function(a){if(a.isZero())return a.clone();return this.m.sub(a)._forceRed(this)},F.prototype.add=function(a,c){this._verify2(a,c);var f=a.add(c);if(f.cmp(this.m)>=0)f.isub(this.m);return f._forceRed(this)},F.prototype.iadd=function(a,c){this._verify2(a,c);var f=a.iadd(c);if(f.cmp(this.m)>=0)f.isub(this.m);return f},F.prototype.sub=function(a,c){this._verify2(a,c);var f=a.sub(c);if(f.cmpn(0)<0)f.iadd(this.m);return f._forceRed(this)},F.prototype.isub=function(a,c){this._verify2(a,c);var f=a.isub(c);if(f.cmpn(0)<0)f.iadd(this.m);return f},F.prototype.shl=function(a,c){return this._verify1(a),this.imod(a.ushln(c))},F.prototype.imul=function(a,c){return this._verify2(a,c),this.imod(a.imul(c))},F.prototype.mul=function(a,c){return this._verify2(a,c),this.imod(a.mul(c))},F.prototype.isqr=function(a){return this.imul(a,a.clone())},F.prototype.sqr=function(a){return this.mul(a,a)},F.prototype.sqrt=function(a){if(a.isZero())return a.clone();var c=this.m.andln(3);if(n(c%2===1),c===3){var f=this.m.add(new s(1)).iushrn(2);return this.pow(a,f)}var l=this.m.subn(1),d=0;while(!l.isZero()&&l.andln(1)===0)d++,l.iushrn(1);n(!l.isZero());var y=new s(1).toRed(this),w=y.redNeg(),p=this.m.subn(1).iushrn(1),u=this.m.bitLength();u=new s(2*u*u).toRed(this);while(this.pow(u,p).cmp(w)!==0)u.redIAdd(w);var m=this.pow(u,l),E=this.pow(a,l.addn(1).iushrn(1)),k=this.pow(a,l),A=d;while(k.cmp(y)!==0){var D=k;for(var U=0;D.cmp(y)!==0;U++)D=D.redSqr();n(U<A);var K=this.pow(m,new s(1).iushln(A-U-1));E=E.redMul(K),m=K.redSqr(),k=k.redMul(m),A=U}return E},F.prototype.invm=function(a){var c=a._invmp(this.m);if(c.negative!==0)return c.negative=0,this.imod(c).redNeg();else return this.imod(c)},F.prototype.pow=function(a,c){if(c.isZero())return new s(1).toRed(this);if(c.cmpn(1)===0)return a.clone();var f=4,l=Array(1<<f);l[0]=new s(1).toRed(this),l[1]=a;for(var d=2;d<l.length;d++)l[d]=this.mul(l[d-1],a);var y=l[0],w=0,p=0,u=c.bitLength()%26;if(u===0)u=26;for(d=c.length-1;d>=0;d--){var m=c.words[d];for(var E=u-1;E>=0;E--){var k=m>>E&1;if(y!==l[0])y=this.sqr(y);if(k===0&&w===0){p=0;continue}if(w<<=1,w|=k,p++,p!==f&&(d!==0||E!==0))continue;y=this.mul(y,l[w]),p=0,w=0}u=26}return y},F.prototype.convertTo=function(a){var c=a.umod(this.m);return c===a?c.clone():c},F.prototype.convertFrom=function(a){var c=a.clone();return c.red=null,c},s.mont=function(a){return new ee(a)};function ee(a){if(F.call(this,a),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)}o(ee,F),ee.prototype.convertTo=function(a){return this.imod(a.ushln(this.shift))},ee.prototype.convertFrom=function(a){var c=this.imod(a.mul(this.rinv));return c.red=null,c},ee.prototype.imul=function(a,c){if(a.isZero()||c.isZero())return a.words[0]=0,a.length=1,a;var f=a.imul(c),l=f.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=f.isub(l).iushrn(this.shift),y=d;if(d.cmp(this.m)>=0)y=d.isub(this.m);else if(d.cmpn(0)<0)y=d.iadd(this.m);return y._forceRed(this)},ee.prototype.mul=function(a,c){if(a.isZero()||c.isZero())return new s(0)._forceRed(this);var f=a.mul(c),l=f.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=f.isub(l).iushrn(this.shift),y=d;if(d.cmp(this.m)>=0)y=d.isub(this.m);else if(d.cmpn(0)<0)y=d.iadd(this.m);return y._forceRed(this)},ee.prototype.invm=function(a){var c=this.imod(a._invmp(this.m).mul(this.r2));return c._forceRed(this)}})(typeof t>"u"||t,e)}),lP=ce((e)=>{var t=Aa(),r=cn(),i=e;i.define=function(o,s){return new n(o,s)};function n(o,s){this.name=o,this.body=s,this.decoders={},this.encoders={}}n.prototype._createNamed=function(o){var s;try{s=(()=>{throw new Error("Cannot require module "+"vm");})().runInThisContext("(function "+this.name+`(entity) {
|
|
15
15
|
this._initNamed(entity);
|
|
16
16
|
})`)}catch(h){s=function(v){this._initNamed(v)}}return r(s,o),s.prototype._initNamed=function(h){o.call(this,h)},new s(this)},n.prototype._getDecoder=function(o){if(o=o||"der",!this.decoders.hasOwnProperty(o))this.decoders[o]=this._createNamed(t.decoders[o]);return this.decoders[o]},n.prototype.decode=function(o,s,h){return this._getDecoder(s).decode(o,h)},n.prototype._getEncoder=function(o){if(o=o||"der",!this.encoders.hasOwnProperty(o))this.encoders[o]=this._createNamed(t.encoders[o]);return this.encoders[o]},n.prototype.encode=function(o,s,h){return this._getEncoder(s).encode(o,h)}}),cP=ce((e)=>{var t=cn();function r(n){this._reporterState={obj:null,path:[],options:n||{},errors:[]}}e.Reporter=r,r.prototype.isError=function(n){return n instanceof i},r.prototype.save=function(){var n=this._reporterState;return{obj:n.obj,pathLen:n.path.length}},r.prototype.restore=function(n){var o=this._reporterState;o.obj=n.obj,o.path=o.path.slice(0,n.pathLen)},r.prototype.enterKey=function(n){return this._reporterState.path.push(n)},r.prototype.exitKey=function(n){var o=this._reporterState;o.path=o.path.slice(0,n-1)},r.prototype.leaveKey=function(n,o,s){var h=this._reporterState;if(this.exitKey(n),h.obj!==null)h.obj[o]=s},r.prototype.path=function(){return this._reporterState.path.join("/")},r.prototype.enterObject=function(){var n=this._reporterState,o=n.obj;return n.obj={},o},r.prototype.leaveObject=function(n){var o=this._reporterState,s=o.obj;return o.obj=n,s},r.prototype.error=function(n){var o,s=this._reporterState,h=n instanceof i;if(h)o=n;else o=new i(s.path.map(function(v){return"["+JSON.stringify(v)+"]"}).join(""),n.message||n,n.stack);if(!s.options.partial)throw o;if(!h)s.errors.push(o);return o},r.prototype.wrapResult=function(n){var o=this._reporterState;if(!o.options.partial)return n;return{result:this.isError(n)?null:n,errors:o.errors}};function i(n,o){this.path=n,this.rethrow(o)}t(i,Error),i.prototype.rethrow=function(n){if(this.message=n+" at: "+(this.path||"(shallow)"),Error.captureStackTrace)Error.captureStackTrace(this,i);if(!this.stack)try{throw Error(this.message)}catch(o){this.stack=o.stack}return this}}),vw=ce((e)=>{var t=cn(),r=Ea().Reporter,i=(Tr(),kt($r)).Buffer;function n(s,h){if(r.call(this,h),!i.isBuffer(s)){this.error("Input not Buffer");return}this.base=s,this.offset=0,this.length=s.length}t(n,r),e.DecoderBuffer=n,n.prototype.save=function(){return{offset:this.offset,reporter:r.prototype.save.call(this)}},n.prototype.restore=function(s){var h=new n(this.base);return h.offset=s.offset,h.length=this.offset,this.offset=s.offset,r.prototype.restore.call(this,s.reporter),h},n.prototype.isEmpty=function(){return this.offset===this.length},n.prototype.readUInt8=function(s){if(this.offset+1<=this.length)return this.base.readUInt8(this.offset++,!0);else return this.error(s||"DecoderBuffer overrun")},n.prototype.skip=function(s,h){if(!(this.offset+s<=this.length))return this.error(h||"DecoderBuffer overrun");var v=new n(this.base);return v._reporterState=this._reporterState,v.offset=this.offset,v.length=this.offset+s,this.offset+=s,v},n.prototype.raw=function(s){return this.base.slice(s?s.offset:this.offset,this.length)};function o(s,h){if(Array.isArray(s))this.length=0,this.value=s.map(function(v){if(!(v instanceof o))v=new o(v,h);return this.length+=v.length,v},this);else if(typeof s==="number"){if(!(0<=s&&s<=255))return h.error("non-byte EncoderBuffer value");this.value=s,this.length=1}else if(typeof s==="string")this.value=s,this.length=i.byteLength(s);else if(i.isBuffer(s))this.value=s,this.length=s.length;else return h.error("Unsupported type: "+typeof s)}e.EncoderBuffer=o,o.prototype.join=function(s,h){if(!s)s=new i(this.length);if(!h)h=0;if(this.length===0)return s;if(Array.isArray(this.value))this.value.forEach(function(v){v.join(s,h),h+=v.length});else{if(typeof this.value==="number")s[h]=this.value;else if(typeof this.value==="string")s.write(this.value,h);else if(i.isBuffer(this.value))this.value.copy(s,h);h+=this.length}return s}}),dP=ce((e,t)=>{var r=Ea().Reporter,i=Ea().EncoderBuffer,n=Ea().DecoderBuffer,o=Oi(),s=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],h=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(s),v=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function b(g,S){var x={};if(this._baseState=x,x.enc=g,x.parent=S||null,x.children=null,x.tag=null,x.args=null,x.reverseArgs=null,x.choice=null,x.optional=!1,x.any=!1,x.obj=!1,x.use=null,x.useDecoder=null,x.key=null,x.default=null,x.explicit=null,x.implicit=null,x.contains=null,!x.parent)x.children=[],this._wrap()}t.exports=b;var _=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];b.prototype.clone=function(){var g=this._baseState,S={};_.forEach(function(M){S[M]=g[M]});var x=new this.constructor(S.parent);return x._baseState=S,x},b.prototype._wrap=function(){var g=this._baseState;h.forEach(function(S){this[S]=function(){var x=new this.constructor(this);return g.children.push(x),x[S].apply(x,arguments)}},this)},b.prototype._init=function(g){var S=this._baseState;o(S.parent===null),g.call(this),S.children=S.children.filter(function(x){return x._baseState.parent===this},this),o.equal(S.children.length,1,"Root node can have only one child")},b.prototype._useArgs=function(g){var S=this._baseState,x=g.filter(function(M){return M instanceof this.constructor},this);if(g=g.filter(function(M){return!(M instanceof this.constructor)},this),x.length!==0)o(S.children===null),S.children=x,x.forEach(function(M){M._baseState.parent=this},this);if(g.length!==0)o(S.args===null),S.args=g,S.reverseArgs=g.map(function(M){if(typeof M!=="object"||M.constructor!==Object)return M;var I={};return Object.keys(M).forEach(function($){if($==($|0))$|=0;var T=M[$];I[T]=$}),I})},v.forEach(function(g){b.prototype[g]=function(){var S=this._baseState;throw Error(g+" not implemented for encoding: "+S.enc)}}),s.forEach(function(g){b.prototype[g]=function(){var S=this._baseState,x=Array.prototype.slice.call(arguments);return o(S.tag===null),S.tag=g,this._useArgs(x),this}}),b.prototype.use=function(g){o(g);var S=this._baseState;return o(S.use===null),S.use=g,this},b.prototype.optional=function(){var g=this._baseState;return g.optional=!0,this},b.prototype.def=function(g){var S=this._baseState;return o(S.default===null),S.default=g,S.optional=!0,this},b.prototype.explicit=function(g){var S=this._baseState;return o(S.explicit===null&&S.implicit===null),S.explicit=g,this},b.prototype.implicit=function(g){var S=this._baseState;return o(S.explicit===null&&S.implicit===null),S.implicit=g,this},b.prototype.obj=function(){var g=this._baseState,S=Array.prototype.slice.call(arguments);if(g.obj=!0,S.length!==0)this._useArgs(S);return this},b.prototype.key=function(g){var S=this._baseState;return o(S.key===null),S.key=g,this},b.prototype.any=function(){var g=this._baseState;return g.any=!0,this},b.prototype.choice=function(g){var S=this._baseState;return o(S.choice===null),S.choice=g,this._useArgs(Object.keys(g).map(function(x){return g[x]})),this},b.prototype.contains=function(g){var S=this._baseState;return o(S.use===null),S.contains=g,this},b.prototype._decode=function(g,S){var x=this._baseState;if(x.parent===null)return g.wrapResult(x.children[0]._decode(g,S));var M=x.default,I=!0,$=null;if(x.key!==null)$=g.enterKey(x.key);if(x.optional){var T=null;if(x.explicit!==null)T=x.explicit;else if(x.implicit!==null)T=x.implicit;else if(x.tag!==null)T=x.tag;if(T===null&&!x.any){var P=g.save();try{if(x.choice===null)this._decodeGeneric(x.tag,g,S);else this._decodeChoice(g,S);I=!0}catch(le){I=!1}g.restore(P)}else if(I=this._peekTag(g,T,x.any),g.isError(I))return I}var R;if(x.obj&&I)R=g.enterObject();if(I){if(x.explicit!==null){var C=this._decodeTag(g,x.explicit);if(g.isError(C))return C;g=C}var N=g.offset;if(x.use===null&&x.choice===null){if(x.any)var P=g.save();var B=this._decodeTag(g,x.implicit!==null?x.implicit:x.tag,x.any);if(g.isError(B))return B;if(x.any)M=g.raw(P);else g=B}if(S&&S.track&&x.tag!==null)S.track(g.path(),N,g.length,"tagged");if(S&&S.track&&x.tag!==null)S.track(g.path(),g.offset,g.length,"content");if(x.any)M=M;else if(x.choice===null)M=this._decodeGeneric(x.tag,g,S);else M=this._decodeChoice(g,S);if(g.isError(M))return M;if(!x.any&&x.choice===null&&x.children!==null)x.children.forEach(function(le){le._decode(g,S)});if(x.contains&&(x.tag==="octstr"||x.tag==="bitstr")){var ie=new n(M);M=this._getUse(x.contains,g._reporterState.obj)._decode(ie,S)}}if(x.obj&&I)M=g.leaveObject(R);if(x.key!==null&&(M!==null||I===!0))g.leaveKey($,x.key,M);else if($!==null)g.exitKey($);return M},b.prototype._decodeGeneric=function(g,S,x){var M=this._baseState;if(g==="seq"||g==="set")return null;if(g==="seqof"||g==="setof")return this._decodeList(S,g,M.args[0],x);else if(/str$/.test(g))return this._decodeStr(S,g,x);else if(g==="objid"&&M.args)return this._decodeObjid(S,M.args[0],M.args[1],x);else if(g==="objid")return this._decodeObjid(S,null,null,x);else if(g==="gentime"||g==="utctime")return this._decodeTime(S,g,x);else if(g==="null_")return this._decodeNull(S,x);else if(g==="bool")return this._decodeBool(S,x);else if(g==="objDesc")return this._decodeStr(S,g,x);else if(g==="int"||g==="enum")return this._decodeInt(S,M.args&&M.args[0],x);if(M.use!==null)return this._getUse(M.use,S._reporterState.obj)._decode(S,x);else return S.error("unknown tag: "+g)},b.prototype._getUse=function(g,S){var x=this._baseState;if(x.useDecoder=this._use(g,S),o(x.useDecoder._baseState.parent===null),x.useDecoder=x.useDecoder._baseState.children[0],x.implicit!==x.useDecoder._baseState.implicit)x.useDecoder=x.useDecoder.clone(),x.useDecoder._baseState.implicit=x.implicit;return x.useDecoder},b.prototype._decodeChoice=function(g,S){var x=this._baseState,M=null,I=!1;if(Object.keys(x.choice).some(function($){var T=g.save(),P=x.choice[$];try{var R=P._decode(g,S);if(g.isError(R))return!1;M={type:$,value:R},I=!0}catch(C){return g.restore(T),!1}return!0},this),!I)return g.error("Choice not matched");return M},b.prototype._createEncoderBuffer=function(g){return new i(g,this.reporter)},b.prototype._encode=function(g,S,x){var M=this._baseState;if(M.default!==null&&M.default===g)return;var I=this._encodeValue(g,S,x);if(I===void 0)return;if(this._skipDefault(I,S,x))return;return I},b.prototype._encodeValue=function(g,S,x){var M=this._baseState;if(M.parent===null)return M.children[0]._encode(g,S||new r);var P=null;if(this.reporter=S,M.optional&&g===void 0)if(M.default!==null)g=M.default;else return;var I=null,$=!1;if(M.any)P=this._createEncoderBuffer(g);else if(M.choice)P=this._encodeChoice(g,S);else if(M.contains)I=this._getUse(M.contains,x)._encode(g,S),$=!0;else if(M.children)I=M.children.map(function(N){if(N._baseState.tag==="null_")return N._encode(null,S,g);if(N._baseState.key===null)return S.error("Child should have a key");var B=S.enterKey(N._baseState.key);if(typeof g!=="object")return S.error("Child expected, but input is not object");var ie=N._encode(g[N._baseState.key],S,g);return S.leaveKey(B),ie},this).filter(function(N){return N}),I=this._createEncoderBuffer(I);else if(M.tag==="seqof"||M.tag==="setof"){if(!(M.args&&M.args.length===1))return S.error("Too many args for : "+M.tag);if(!Array.isArray(g))return S.error("seqof/setof, but data is not Array");var T=this.clone();T._baseState.implicit=null,I=this._createEncoderBuffer(g.map(function(N){var B=this._baseState;return this._getUse(B.args[0],g)._encode(N,S)},T))}else if(M.use!==null)P=this._getUse(M.use,x)._encode(g,S);else I=this._encodePrimitive(M.tag,g),$=!0;var P;if(!M.any&&M.choice===null){var R=M.implicit!==null?M.implicit:M.tag,C=M.implicit===null?"universal":"context";if(R===null){if(M.use===null)S.error("Tag could be omitted only for .use()")}else if(M.use===null)P=this._encodeComposite(R,$,C,I)}if(M.explicit!==null)P=this._encodeComposite(M.explicit,!1,"context",P);return P},b.prototype._encodeChoice=function(g,S){var x=this._baseState,M=x.choice[g.type];if(!M)o(!1,g.type+" not found in "+JSON.stringify(Object.keys(x.choice)));return M._encode(g.value,S)},b.prototype._encodePrimitive=function(g,S){var x=this._baseState;if(/str$/.test(g))return this._encodeStr(S,g);else if(g==="objid"&&x.args)return this._encodeObjid(S,x.reverseArgs[0],x.args[1]);else if(g==="objid")return this._encodeObjid(S,null,null);else if(g==="gentime"||g==="utctime")return this._encodeTime(S,g);else if(g==="null_")return this._encodeNull();else if(g==="int"||g==="enum")return this._encodeInt(S,x.args&&x.reverseArgs[0]);else if(g==="bool")return this._encodeBool(S);else if(g==="objDesc")return this._encodeStr(S,g);else throw Error("Unsupported tag: "+g)},b.prototype._isNumstr=function(g){return/^[0-9 ]*$/.test(g)},b.prototype._isPrintstr=function(g){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(g)}}),Ea=ce((e)=>{var t=e;t.Reporter=cP().Reporter,t.DecoderBuffer=vw().DecoderBuffer,t.EncoderBuffer=vw().EncoderBuffer,t.Node=dP()}),fP=ce((e)=>{var t=zw();e.tagClass={0:"universal",1:"application",2:"context",3:"private"},e.tagClassByName=t._reverse(e.tagClass),e.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},e.tagByName=t._reverse(e.tag)}),zw=ce((e)=>{var t=e;t._reverse=function(r){var i={};return Object.keys(r).forEach(function(n){if((n|0)==n)n=n|0;var o=r[n];i[o]=n}),i},t.der=fP()}),jw=ce((e,t)=>{var r=cn(),i=Aa(),n=i.base,o=i.bignum,s=i.constants.der;function h(g){this.enc="der",this.name=g.name,this.entity=g,this.tree=new v,this.tree._init(g.body)}t.exports=h,h.prototype.decode=function(g,S){if(!(g instanceof n.DecoderBuffer))g=new n.DecoderBuffer(g,S);return this.tree._decode(g,S)};function v(g){n.Node.call(this,"der",g)}r(v,n.Node),v.prototype._peekTag=function(g,S,x){if(g.isEmpty())return!1;var M=g.save(),I=b(g,'Failed to peek tag: "'+S+'"');if(g.isError(I))return I;return g.restore(M),I.tag===S||I.tagStr===S||I.tagStr+"of"===S||x},v.prototype._decodeTag=function(g,S,x){var M=b(g,'Failed to decode tag of "'+S+'"');if(g.isError(M))return M;var I=_(g,M.primitive,'Failed to get length of "'+S+'"');if(g.isError(I))return I;if(!x&&M.tag!==S&&M.tagStr!==S&&M.tagStr+"of"!==S)return g.error('Failed to match tag: "'+S+'"');if(M.primitive||I!==null)return g.skip(I,'Failed to match body of: "'+S+'"');var $=g.save(),T=this._skipUntilEnd(g,'Failed to skip indefinite length body: "'+this.tag+'"');if(g.isError(T))return T;return I=g.offset-$.offset,g.restore($),g.skip(I,'Failed to match body of: "'+S+'"')},v.prototype._skipUntilEnd=function(g,S){while(!0){var x=b(g,S);if(g.isError(x))return x;var M=_(g,x.primitive,S);if(g.isError(M))return M;var I;if(x.primitive||M!==null)I=g.skip(M);else I=this._skipUntilEnd(g,S);if(g.isError(I))return I;if(x.tagStr==="end")break}},v.prototype._decodeList=function(g,S,x,M){var I=[];while(!g.isEmpty()){var $=this._peekTag(g,"end");if(g.isError($))return $;var T=x.decode(g,"der",M);if(g.isError(T)&&$)break;I.push(T)}return I},v.prototype._decodeStr=function(g,S){if(S==="bitstr"){var x=g.readUInt8();if(g.isError(x))return x;return{unused:x,data:g.raw()}}else if(S==="bmpstr"){var M=g.raw();if(M.length%2===1)return g.error("Decoding of string type: bmpstr length mismatch");var I="";for(var $=0;$<M.length/2;$++)I+=String.fromCharCode(M.readUInt16BE($*2));return I}else if(S==="numstr"){var T=g.raw().toString("ascii");if(!this._isNumstr(T))return g.error("Decoding of string type: numstr unsupported characters");return T}else if(S==="octstr")return g.raw();else if(S==="objDesc")return g.raw();else if(S==="printstr"){var P=g.raw().toString("ascii");if(!this._isPrintstr(P))return g.error("Decoding of string type: printstr unsupported characters");return P}else if(/str$/.test(S))return g.raw().toString();else return g.error("Decoding of string type: "+S+" unsupported")},v.prototype._decodeObjid=function(g,S,x){var M,I=[],$=0;while(!g.isEmpty()){var T=g.readUInt8();if($<<=7,$|=T&127,(T&128)===0)I.push($),$=0}if(T&128)I.push($);var P=I[0]/40|0,R=I[0]%40;if(x)M=I;else M=[P,R].concat(I.slice(1));if(S){var C=S[M.join(" ")];if(C===void 0)C=S[M.join(".")];if(C!==void 0)M=C}return M},v.prototype._decodeTime=function(g,S){var x=g.raw().toString();if(S==="gentime")var M=x.slice(0,4)|0,I=x.slice(4,6)|0,$=x.slice(6,8)|0,T=x.slice(8,10)|0,P=x.slice(10,12)|0,R=x.slice(12,14)|0;else if(S==="utctime"){var M=x.slice(0,2)|0,I=x.slice(2,4)|0,$=x.slice(4,6)|0,T=x.slice(6,8)|0,P=x.slice(8,10)|0,R=x.slice(10,12)|0;if(M<70)M=2000+M;else M=1900+M}else return g.error("Decoding "+S+" time is not supported yet");return Date.UTC(M,I-1,$,T,P,R,0)},v.prototype._decodeNull=function(g){return null},v.prototype._decodeBool=function(g){var S=g.readUInt8();if(g.isError(S))return S;else return S!==0},v.prototype._decodeInt=function(g,S){var x=g.raw(),M=new o(x);if(S)M=S[M.toString(10)]||M;return M},v.prototype._use=function(g,S){if(typeof g==="function")g=g(S);return g._getDecoder("der").tree};function b(g,S){var x=g.readUInt8(S);if(g.isError(x))return x;var M=s.tagClass[x>>6],I=(x&32)===0;if((x&31)===31){var $=x;x=0;while(($&128)===128){if($=g.readUInt8(S),g.isError($))return $;x<<=7,x|=$&127}}else x&=31;var T=s.tag[x];return{cls:M,primitive:I,tag:x,tagStr:T}}function _(g,S,x){var M=g.readUInt8(x);if(g.isError(M))return M;if(!S&&M===128)return null;if((M&128)===0)return M;var I=M&127;if(I>4)return g.error("length octect is too long");M=0;for(var $=0;$<I;$++){M<<=8;var T=g.readUInt8(x);if(g.isError(T))return T;M|=T}return M}}),hP=ce((e,t)=>{var r=cn(),i=(Tr(),kt($r)).Buffer,n=jw();function o(s){n.call(this,s),this.enc="pem"}r(o,n),t.exports=o,o.prototype.decode=function(s,h){var v=s.toString().split(/[\r\n]+/g),b=h.label.toUpperCase(),_=/^-----(BEGIN|END) ([^-]+)-----$/,g=-1,S=-1;for(var x=0;x<v.length;x++){var M=v[x].match(_);if(M===null)continue;if(M[2]!==b)continue;if(g===-1){if(M[1]!=="BEGIN")break;g=x}else{if(M[1]!=="END")break;S=x;break}}if(g===-1||S===-1)throw Error("PEM section not found for: "+b);var I=v.slice(g+1,S).join("");I.replace(/[^a-z0-9\+\/=]+/gi,"");var $=new i(I,"base64");return n.prototype.decode.call(this,$,h)}}),pP=ce((e)=>{var t=e;t.der=jw(),t.pem=hP()}),Uw=ce((e,t)=>{var r=cn(),i=(Tr(),kt($r)).Buffer,n=Aa(),o=n.base,s=n.constants.der;function h(g){this.enc="der",this.name=g.name,this.entity=g,this.tree=new v,this.tree._init(g.body)}t.exports=h,h.prototype.encode=function(g,S){return this.tree._encode(g,S).join()};function v(g){o.Node.call(this,"der",g)}r(v,o.Node),v.prototype._encodeComposite=function(g,S,x,M){var I=_(g,S,x,this.reporter);if(M.length<128){var P=new i(2);return P[0]=I,P[1]=M.length,this._createEncoderBuffer([P,M])}var $=1;for(var T=M.length;T>=256;T>>=8)$++;var P=new i(2+$);P[0]=I,P[1]=128|$;for(var T=1+$,R=M.length;R>0;T--,R>>=8)P[T]=R&255;return this._createEncoderBuffer([P,M])},v.prototype._encodeStr=function(g,S){if(S==="bitstr")return this._createEncoderBuffer([g.unused|0,g.data]);else if(S==="bmpstr"){var x=new i(g.length*2);for(var M=0;M<g.length;M++)x.writeUInt16BE(g.charCodeAt(M),M*2);return this._createEncoderBuffer(x)}else if(S==="numstr"){if(!this._isNumstr(g))return this.reporter.error("Encoding of string type: numstr supports only digits and space");return this._createEncoderBuffer(g)}else if(S==="printstr"){if(!this._isPrintstr(g))return this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark");return this._createEncoderBuffer(g)}else if(/str$/.test(S))return this._createEncoderBuffer(g);else if(S==="objDesc")return this._createEncoderBuffer(g);else return this.reporter.error("Encoding of string type: "+S+" unsupported")},v.prototype._encodeObjid=function(g,S,x){if(typeof g==="string"){if(!S)return this.reporter.error("string objid given, but no values map found");if(!S.hasOwnProperty(g))return this.reporter.error("objid not found in values map");g=S[g].split(/[\s\.]+/g);for(var M=0;M<g.length;M++)g[M]|=0}else if(Array.isArray(g)){g=g.slice();for(var M=0;M<g.length;M++)g[M]|=0}if(!Array.isArray(g))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(g));if(!x){if(g[1]>=40)return this.reporter.error("Second objid identifier OOB");g.splice(0,2,g[0]*40+g[1])}var I=0;for(var M=0;M<g.length;M++){var $=g[M];for(I++;$>=128;$>>=7)I++}var T=new i(I),P=T.length-1;for(var M=g.length-1;M>=0;M--){var $=g[M];T[P--]=$&127;while(($>>=7)>0)T[P--]=128|$&127}return this._createEncoderBuffer(T)};function b(g){if(g<10)return"0"+g;else return g}v.prototype._encodeTime=function(g,S){var x,M=new Date(g);if(S==="gentime")x=[b(M.getFullYear()),b(M.getUTCMonth()+1),b(M.getUTCDate()),b(M.getUTCHours()),b(M.getUTCMinutes()),b(M.getUTCSeconds()),"Z"].join("");else if(S==="utctime")x=[b(M.getFullYear()%100),b(M.getUTCMonth()+1),b(M.getUTCDate()),b(M.getUTCHours()),b(M.getUTCMinutes()),b(M.getUTCSeconds()),"Z"].join("");else this.reporter.error("Encoding "+S+" time is not supported yet");return this._encodeStr(x,"octstr")},v.prototype._encodeNull=function(){return this._createEncoderBuffer("")},v.prototype._encodeInt=function(g,S){if(typeof g==="string"){if(!S)return this.reporter.error("String int or enum given, but no values map");if(!S.hasOwnProperty(g))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(g));g=S[g]}if(typeof g!=="number"&&!i.isBuffer(g)){var x=g.toArray();if(!g.sign&&x[0]&128)x.unshift(0);g=new i(x)}if(i.isBuffer(g)){var M=g.length;if(g.length===0)M++;var $=new i(M);if(g.copy($),g.length===0)$[0]=0;return this._createEncoderBuffer($)}if(g<128)return this._createEncoderBuffer(g);if(g<256)return this._createEncoderBuffer([0,g]);var M=1;for(var I=g;I>=256;I>>=8)M++;var $=Array(M);for(var I=$.length-1;I>=0;I--)$[I]=g&255,g>>=8;if($[0]&128)$.unshift(0);return this._createEncoderBuffer(new i($))},v.prototype._encodeBool=function(g){return this._createEncoderBuffer(g?255:0)},v.prototype._use=function(g,S){if(typeof g==="function")g=g(S);return g._getEncoder("der").tree},v.prototype._skipDefault=function(g,S,x){var M=this._baseState,I;if(M.default===null)return!1;var $=g.join();if(M.defaultBuffer===void 0)M.defaultBuffer=this._encodeValue(M.default,S,x).join();if($.length!==M.defaultBuffer.length)return!1;for(I=0;I<$.length;I++)if($[I]!==M.defaultBuffer[I])return!1;return!0};function _(g,S,x,M){var I;if(g==="seqof")g="seq";else if(g==="setof")g="set";if(s.tagByName.hasOwnProperty(g))I=s.tagByName[g];else if(typeof g==="number"&&(g|0)===g)I=g;else return M.error("Unknown tag: "+g);if(I>=31)return M.error("Multi-octet tag encoding unsupported");if(!S)I|=32;return I|=s.tagClassByName[x||"universal"]<<6,I}}),mP=ce((e,t)=>{var r=cn(),i=Uw();function n(o){i.call(this,o),this.enc="pem"}r(n,i),t.exports=n,n.prototype.encode=function(o,s){var h=i.prototype.encode.call(this,o),v=h.toString("base64"),b=["-----BEGIN "+s.label+"-----"];for(var _=0;_<v.length;_+=64)b.push(v.slice(_,_+64));return b.push("-----END "+s.label+"-----"),b.join(`
|
|
@@ -20,11 +20,11 @@ https://github.com/browserify/crypto-browserify`)},e.constants={DH_CHECK_P_NOT_S
|
|
|
20
20
|
`:""},this._extScope=e,this._scope=new Bn.Scope({parent:e}),this._nodes=[new Tk]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,i){let n=this._scope.toName(t);if(r!==void 0&&i)this._constants[n.str]=r;return this._leafNode(new xk(e,n,r)),n}const(e,t,r){return this._def(Bn.varKinds.const,e,t,r)}let(e,t,r){return this._def(Bn.varKinds.let,e,t,r)}var(e,t,r){return this._def(Bn.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new $b(e,t,r))}add(e,t){return this._leafNode(new kk(e,an.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==xt.nil)this._leafNode(new $k(e));return this}object(...e){let t=["{"];for(let[r,i]of e){if(t.length>1)t.push(",");if(t.push(r),r!==i||this.opts.es5)t.push(":"),(0,xt.addCodeArg)(t,i)}return t.push("}"),new xt._Code(t)}if(e,t,r){if(this._blockNode(new ki(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new ki(e))}else(){return this._elseNode(new sc)}endIf(){return this._endBlockNode(ki,sc)}_for(e,t){if(this._blockNode(e),t)this.code(t).endFor();return this}for(e,t){return this._for(new Pk(e),t)}forRange(e,t,r,i,n=this.opts.es5?Bn.varKinds.var:Bn.varKinds.let){let o=this._scope.toName(e);return this._for(new Ak(n,o,t,r),()=>i(o))}forOf(e,t,r,i=Bn.varKinds.const){let n=this._scope.toName(e);if(this.opts.es5){let o=t instanceof xt.Name?t:this.var("_arr",t);return this.forRange("_i",0,xt._`${o}.length`,(s)=>{this.var(n,xt._`${o}[${s}]`),r(n)})}return this._for(new Eb("of",i,n,t),()=>r(n))}forIn(e,t,r,i=this.opts.es5?Bn.varKinds.var:Bn.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,xt._`Object.keys(${t})`,r);let n=this._scope.toName(e);return this._for(new Eb("in",i,n,t),()=>r(n))}endFor(){return this._endBlockNode(na)}label(e){return this._leafNode(new Mk(e))}break(e){return this._leafNode(new Ek(e))}return(e){let t=new Sp;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(Sp)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let i=new Rk;if(this._blockNode(i),this.code(e),t){let n=this.name("e");this._currNode=i.catch=new xp(n),t(n)}if(r)this._currNode=i.finally=new kp,this.code(r);return this._endBlockNode(xp,kp)}throw(e){return this._leafNode(new Ik(e))}block(e,t){if(this._blockStarts.push(this._nodes.length),e)this.code(e).endBlock(t);return this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error("CodeGen: not in self-balancing block");let r=this._nodes.length-t;if(r<0||e!==void 0&&r!==e)throw Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=xt.nil,r,i){if(this._blockNode(new wp(e,t,r)),i)this.code(i).endFunc();return this}endFunc(){return this._endBlockNode(wp)}optimize(e=1){while(e-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof ki))throw Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}}an.CodeGen=Ck;function Zo(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function Mp(e,t){return t instanceof xt._CodeOrName?Zo(e,t.names):e}function ia(e,t,r){if(e instanceof xt.Name)return i(e);if(!n(e))return e;return new xt._Code(e._items.reduce((o,s)=>{if(s instanceof xt.Name)s=i(s);if(s instanceof xt._Code)o.push(...s._items);else o.push(s);return o},[]));function i(o){let s=r[o.str];if(s===void 0||t[o.str]!==1)return o;return delete t[o.str],s}function n(o){return o instanceof xt._Code&&o._items.some((s)=>s instanceof xt.Name&&t[s.str]===1&&r[s.str]!==void 0)}}function MN(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function Ok(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:xt._`!${Ib(e)}`}an.not=Ok;var EN=Dk(an.operators.AND);function IN(...e){return e.reduce(EN)}an.and=IN;var $N=Dk(an.operators.OR);function TN(...e){return e.reduce($N)}an.or=TN;function Dk(e){return(t,r)=>t===xt.nil?r:r===xt.nil?t:xt._`${Ib(t)} ${e} ${Ib(r)}`}function Ib(e){return e instanceof xt.Name?e:xt._`(${e})`}});var Mt=Xe(function(Hk){Object.defineProperty(Hk,"__esModule",{value:!0});Hk.checkStrictMode=Hk.getErrorPath=Hk.Type=Hk.useFunc=Hk.setEvaluated=Hk.evaluatedPropsToName=Hk.mergeEvaluated=Hk.eachItem=Hk.unescapeJsonPointer=Hk.escapeJsonPointer=Hk.escapeFragment=Hk.unescapeFragment=Hk.schemaRefOrVal=Hk.schemaHasRulesButRef=Hk.schemaHasRules=Hk.checkUnknownRules=Hk.alwaysValidSchema=Hk.toHash=void 0;var jt=gt(),CN=oc();function ON(e){let t={};for(let r of e)t[r]=!0;return t}Hk.toHash=ON;function DN(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return Uk(e,t),!Lk(t,e.self.RULES.all)}Hk.alwaysValidSchema=DN;function Uk(e,t=e.schema){let{opts:r,self:i}=e;if(!r.strictSchema)return;if(typeof t==="boolean")return;let n=i.RULES.keywords;for(let o in t)if(!n[o])Bk(e,`unknown keyword: "${o}"`)}Hk.checkUnknownRules=Uk;function Lk(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}Hk.schemaHasRules=Lk;function NN(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}Hk.schemaHasRulesButRef=NN;function zN({topSchemaRef:e,schemaPath:t},r,i,n){if(!n){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return jt._`${r}`}return jt._`${e}${t}${(0,jt.getProperty)(i)}`}Hk.schemaRefOrVal=zN;function jN(e){return Fk(decodeURIComponent(e))}Hk.unescapeFragment=jN;function UN(e){return encodeURIComponent(Pb(e))}Hk.escapeFragment=UN;function Pb(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}Hk.escapeJsonPointer=Pb;function Fk(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}Hk.unescapeJsonPointer=Fk;function LN(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}Hk.eachItem=LN;function zk({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:i}){return(n,o,s,h)=>{let v=s===void 0?o:s instanceof jt.Name?(o instanceof jt.Name?e(n,o,s):t(n,o,s),s):o instanceof jt.Name?(t(n,s,o),o):r(o,s);return h===jt.Name&&!(v instanceof jt.Name)?i(n,v):v}}Hk.mergeEvaluated={props:zk({mergeNames:(e,t,r)=>e.if(jt._`${r} !== true && ${t} !== undefined`,()=>{e.if(jt._`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,jt._`${r} || {}`).code(jt._`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if(jt._`${r} !== true`,()=>{if(t===!0)e.assign(r,!0);else e.assign(r,jt._`${r} || {}`),Ab(e,r,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:qk}),items:zk({mergeNames:(e,t,r)=>e.if(jt._`${r} !== true && ${t} !== undefined`,()=>e.assign(r,jt._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if(jt._`${r} !== true`,()=>e.assign(r,t===!0?!0:jt._`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function qk(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",jt._`{}`);if(t!==void 0)Ab(e,r,t);return r}Hk.evaluatedPropsToName=qk;function Ab(e,t,r){Object.keys(r).forEach((i)=>e.assign(jt._`${t}${(0,jt.getProperty)(i)}`,!0))}Hk.setEvaluated=Ab;var jk={};function FN(e,t){return e.scopeValue("func",{ref:t,code:jk[t.code]||(jk[t.code]=new CN._Code(t.code))})}Hk.useFunc=FN;var Tb;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Tb||(Hk.Type=Tb={}));function qN(e,t,r){if(e instanceof jt.Name){let i=t===Tb.Num;return r?i?jt._`"[" + ${e} + "]"`:jt._`"['" + ${e} + "']"`:i?jt._`"/" + ${e}`:jt._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,jt.getProperty)(e).toString():"/"+Pb(e)}Hk.getErrorPath=qN;function Bk(e,t,r=e.opts.strictSchema){if(!r)return;if(t=`strict mode: ${t}`,r===!0)throw Error(t);e.self.logger.warn(t)}Hk.checkStrictMode=Bk});var Mi=Xe(function(Kk){Object.defineProperty(Kk,"__esModule",{value:!0});var Br=gt(),sz={data:new Br.Name("data"),valCxt:new Br.Name("valCxt"),instancePath:new Br.Name("instancePath"),parentData:new Br.Name("parentData"),parentDataProperty:new Br.Name("parentDataProperty"),rootData:new Br.Name("rootData"),dynamicAnchors:new Br.Name("dynamicAnchors"),vErrors:new Br.Name("vErrors"),errors:new Br.Name("errors"),this:new Br.Name("this"),self:new Br.Name("self"),scope:new Br.Name("scope"),json:new Br.Name("json"),jsonPos:new Br.Name("jsonPos"),jsonLen:new Br.Name("jsonLen"),jsonPart:new Br.Name("jsonPart")};Kk.default=sz});var ac=Xe(function(Jk){Object.defineProperty(Jk,"__esModule",{value:!0});Jk.extendErrors=Jk.resetErrorsCount=Jk.reportExtraError=Jk.reportError=Jk.keyword$DataError=Jk.keywordError=void 0;var Et=gt(),Tp=Mt(),Jr=Mi();Jk.keywordError={message:({keyword:e})=>Et.str`must pass "${e}" keyword validation`};Jk.keyword$DataError={message:({keyword:e,schemaType:t})=>t?Et.str`"${e}" keyword must be ${t} ($data)`:Et.str`"${e}" keyword is invalid ($data)`};function uz(e,t=Jk.keywordError,r,i){let{it:n}=e,{gen:o,compositeRule:s,allErrors:h}=n,v=Gk(e,t,r);if(i!==null&&i!==void 0?i:s||h)Vk(o,v);else Wk(n,Et._`[${v}]`)}Jk.reportError=uz;function lz(e,t=Jk.keywordError,r){let{it:i}=e,{gen:n,compositeRule:o,allErrors:s}=i,h=Gk(e,t,r);if(Vk(n,h),!(o||s))Wk(i,Jr.default.vErrors)}Jk.reportExtraError=lz;function cz(e,t){e.assign(Jr.default.errors,t),e.if(Et._`${Jr.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(Et._`${Jr.default.vErrors}.length`,t),()=>e.assign(Jr.default.vErrors,null)))}Jk.resetErrorsCount=cz;function dz({gen:e,keyword:t,schemaValue:r,data:i,errsCount:n,it:o}){if(n===void 0)throw Error("ajv implementation error");let s=e.name("err");e.forRange("i",n,Jr.default.errors,(h)=>{if(e.const(s,Et._`${Jr.default.vErrors}[${h}]`),e.if(Et._`${s}.instancePath === undefined`,()=>e.assign(Et._`${s}.instancePath`,(0,Et.strConcat)(Jr.default.instancePath,o.errorPath))),e.assign(Et._`${s}.schemaPath`,Et.str`${o.errSchemaPath}/${t}`),o.opts.verbose)e.assign(Et._`${s}.schema`,r),e.assign(Et._`${s}.data`,i)})}Jk.extendErrors=dz;function Vk(e,t){let r=e.const("err",t);e.if(Et._`${Jr.default.vErrors} === null`,()=>e.assign(Jr.default.vErrors,Et._`[${r}]`),Et._`${Jr.default.vErrors}.push(${r})`),e.code(Et._`${Jr.default.errors}++`)}function Wk(e,t){let{gen:r,validateName:i,schemaEnv:n}=e;if(n.$async)r.throw(Et._`new ${e.ValidationError}(${t})`);else r.assign(Et._`${i}.errors`,t),r.return(!1)}var Ko={keyword:new Et.Name("keyword"),schemaPath:new Et.Name("schemaPath"),params:new Et.Name("params"),propertyName:new Et.Name("propertyName"),message:new Et.Name("message"),schema:new Et.Name("schema"),parentSchema:new Et.Name("parentSchema")};function Gk(e,t,r){let{createErrors:i}=e.it;if(i===!1)return Et._`{}`;return fz(e,t,r)}function fz(e,t,r={}){let{gen:i,it:n}=e,o=[hz(n,r),pz(e,r)];return mz(e,t,o),i.object(...o)}function hz({errorPath:e},{instancePath:t}){let r=t?Et.str`${e}${(0,Tp.getErrorPath)(t,Tp.Type.Str)}`:e;return[Jr.default.instancePath,(0,Et.strConcat)(Jr.default.instancePath,r)]}function pz({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:i}){let n=i?t:Et.str`${t}/${e}`;if(r)n=Et.str`${n}${(0,Tp.getErrorPath)(r,Tp.Type.Str)}`;return[Ko.schemaPath,n]}function mz(e,{params:t,message:r},i){let{keyword:n,data:o,schemaValue:s,it:h}=e,{opts:v,propertyName:b,topSchemaRef:_,schemaPath:g}=h;if(i.push([Ko.keyword,n],[Ko.params,typeof t=="function"?t(e):t||Et._`{}`]),v.messages)i.push([Ko.message,typeof r=="function"?r(e):r]);if(v.verbose)i.push([Ko.schema,s],[Ko.parentSchema,Et._`${_}${g}`],[Jr.default.data,o]);if(b)i.push([Ko.propertyName,b])}});var tM=Xe(function(Qk){Object.defineProperty(Qk,"__esModule",{value:!0});Qk.boolOrEmptySchema=Qk.topBoolOrEmptySchema=void 0;var _z=ac(),wz=gt(),Sz=Mi(),xz={message:"boolean schema is false"};function kz(e){let{gen:t,schema:r,validateName:i}=e;if(r===!1)Yk(e,!1);else if(typeof r=="object"&&r.$async===!0)t.return(Sz.default.data);else t.assign(wz._`${i}.errors`,null),t.return(!0)}Qk.topBoolOrEmptySchema=kz;function Mz(e,t){let{gen:r,schema:i}=e;if(i===!1)r.var(t,!1),Yk(e);else r.var(t,!0)}Qk.boolOrEmptySchema=Mz;function Yk(e,t){let{gen:r,data:i}=e,n={gen:r,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,_z.reportError)(n,xz,void 0,t)}});var Cb=Xe(function(rM){Object.defineProperty(rM,"__esModule",{value:!0});rM.getRules=rM.isJSONType=void 0;var Iz=["string","number","integer","boolean","null","object","array"],$z=new Set(Iz);function Tz(e){return typeof e=="string"&&$z.has(e)}rM.isJSONType=Tz;function Pz(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}rM.getRules=Pz});var Ob=Xe(function(sM){Object.defineProperty(sM,"__esModule",{value:!0});sM.shouldUseRule=sM.shouldUseGroup=sM.schemaHasRulesForType=void 0;function Rz({schema:e,self:t},r){let i=t.RULES.types[r];return i&&i!==!0&&iM(e,i)}sM.schemaHasRulesForType=Rz;function iM(e,t){return t.rules.some((r)=>oM(e,r))}sM.shouldUseGroup=iM;function oM(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some((i)=>e[i]!==void 0))}sM.shouldUseRule=oM});var uc=Xe(function(dM){Object.defineProperty(dM,"__esModule",{value:!0});dM.reportTypeError=dM.checkDataTypes=dM.checkDataType=dM.coerceAndCheckDataType=dM.getJSONTypes=dM.getSchemaTypes=dM.DataType=void 0;var Dz=Cb(),Nz=Ob(),zz=ac(),pt=gt(),uM=Mt(),oa;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(oa||(dM.DataType=oa={}));function jz(e){let t=lM(e.type);if(t.includes("null")){if(e.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(e.nullable===!0)t.push("null")}return t}dM.getSchemaTypes=jz;function lM(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(Dz.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}dM.getJSONTypes=lM;function Uz(e,t){let{gen:r,data:i,opts:n}=e,o=Lz(t,n.coerceTypes),s=t.length>0&&!(o.length===0&&t.length===1&&(0,Nz.schemaHasRulesForType)(e,t[0]));if(s){let h=Nb(t,i,n.strictNumbers,oa.Wrong);r.if(h,()=>{if(o.length)Fz(e,t,o);else zb(e)})}return s}dM.coerceAndCheckDataType=Uz;var cM=new Set(["string","number","integer","boolean","null"]);function Lz(e,t){return t?e.filter((r)=>cM.has(r)||t==="array"&&r==="array"):[]}function Fz(e,t,r){let{gen:i,data:n,opts:o}=e,s=i.let("dataType",pt._`typeof ${n}`),h=i.let("coerced",pt._`undefined`);if(o.coerceTypes==="array")i.if(pt._`${s} == 'object' && Array.isArray(${n}) && ${n}.length == 1`,()=>i.assign(n,pt._`${n}[0]`).assign(s,pt._`typeof ${n}`).if(Nb(t,n,o.strictNumbers),()=>i.assign(h,n)));i.if(pt._`${h} !== undefined`);for(let b of r)if(cM.has(b)||b==="array"&&o.coerceTypes==="array")v(b);i.else(),zb(e),i.endIf(),i.if(pt._`${h} !== undefined`,()=>{i.assign(n,h),qz(e,h)});function v(b){switch(b){case"string":i.elseIf(pt._`${s} == "number" || ${s} == "boolean"`).assign(h,pt._`"" + ${n}`).elseIf(pt._`${n} === null`).assign(h,pt._`""`);return;case"number":i.elseIf(pt._`${s} == "boolean" || ${n} === null
|
|
21
21
|
|| (${s} == "string" && ${n} && ${n} == +${n})`).assign(h,pt._`+${n}`);return;case"integer":i.elseIf(pt._`${s} === "boolean" || ${n} === null
|
|
22
22
|
|| (${s} === "string" && ${n} && ${n} == +${n} && !(${n} % 1))`).assign(h,pt._`+${n}`);return;case"boolean":i.elseIf(pt._`${n} === "false" || ${n} === 0 || ${n} === null`).assign(h,!1).elseIf(pt._`${n} === "true" || ${n} === 1`).assign(h,!0);return;case"null":i.elseIf(pt._`${n} === "" || ${n} === 0 || ${n} === false`),i.assign(h,null);return;case"array":i.elseIf(pt._`${s} === "string" || ${s} === "number"
|
|
23
|
-
|| ${s} === "boolean" || ${n} === null`).assign(h,pt._`[${n}]`)}}}function qz({gen:e,parentData:t,parentDataProperty:r},i){e.if(pt._`${t} !== undefined`,()=>e.assign(pt._`${t}[${r}]`,i))}function Db(e,t,r,i=oa.Correct){let n=i===oa.Correct?pt.operators.EQ:pt.operators.NEQ,o;switch(e){case"null":return pt._`${t} ${n} null`;case"array":o=pt._`Array.isArray(${t})`;break;case"object":o=pt._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=s(pt._`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=s();break;default:return pt._`typeof ${t} ${n} ${e}`}return i===oa.Correct?o:(0,pt.not)(o);function s(h=pt.nil){return(0,pt.and)(pt._`typeof ${t} == "number"`,h,r?pt._`isFinite(${t})`:pt.nil)}}dM.checkDataType=Db;function Nb(e,t,r,i){if(e.length===1)return Db(e[0],t,r,i);let n,o=(0,uM.toHash)(e);if(o.array&&o.object){let s=pt._`typeof ${t} != "object"`;n=o.null?s:pt._`!${t} || ${s}`,delete o.null,delete o.array,delete o.object}else n=pt.nil;if(o.number)delete o.integer;for(let s in o)n=(0,pt.and)(n,Db(s,t,r,i));return n}dM.checkDataTypes=Nb;var Bz={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?pt._`{type: ${e}}`:pt._`{type: ${t}}`};function zb(e){let t=Hz(e);(0,zz.reportError)(t,Bz)}dM.reportTypeError=zb;function Hz(e){let{gen:t,data:r,schema:i}=e,n=(0,uM.schemaRefOrVal)(e,i,"type");return{gen:t,keyword:"type",data:r,schema:i.type,schemaCode:n,schemaValue:n,parentSchema:i,params:{},it:e}}});var gM=Xe(function(pM){Object.defineProperty(pM,"__esModule",{value:!0});pM.assignDefaults=void 0;var sa=gt(),Xz=Mt();function Yz(e,t){let{properties:r,items:i}=e.schema;if(t==="object"&&r)for(let n in r)hM(e,n,r[n].default);else if(t==="array"&&Array.isArray(i))i.forEach((n,o)=>hM(e,o,n.default))}pM.assignDefaults=Yz;function hM(e,t,r){let{gen:i,compositeRule:n,data:o,opts:s}=e;if(r===void 0)return;let h=sa._`${o}${(0,sa.getProperty)(t)}`;if(n){(0,Xz.checkStrictMode)(e,`default is ignored for: ${h}`);return}let v=sa._`${h} === undefined`;if(s.useDefaults==="empty")v=sa._`${v} || ${h} === null || ${h} === ""`;i.if(v,sa._`${h} = ${(0,sa.stringify)(r)}`)}});var Rn=Xe(function(bM){Object.defineProperty(bM,"__esModule",{value:!0});bM.validateUnion=bM.validateArray=bM.usePattern=bM.callValidateCode=bM.schemaProperties=bM.allSchemaProperties=bM.noPropertyInData=bM.propertyInData=bM.isOwnProperty=bM.hasPropFunc=bM.reportMissingProp=bM.checkMissingProp=bM.checkReportMissingProp=void 0;var Bt=gt(),jb=Mt(),oo=Mi(),Qz=Mt();function ej(e,t){let{gen:r,data:i,it:n}=e;r.if(Lb(r,i,t,n.opts.ownProperties),()=>{e.setParams({missingProperty:Bt._`${t}`},!0),e.error()})}bM.checkReportMissingProp=ej;function tj({gen:e,data:t,it:{opts:r}},i,n){return(0,Bt.or)(...i.map((o)=>(0,Bt.and)(Lb(e,t,o,r.ownProperties),Bt._`${n} = ${o}`)))}bM.checkMissingProp=tj;function rj(e,t){e.setParams({missingProperty:t},!0),e.error()}bM.reportMissingProp=rj;function yM(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:Bt._`Object.prototype.hasOwnProperty`})}bM.hasPropFunc=yM;function Ub(e,t,r){return Bt._`${yM(e)}.call(${t}, ${r})`}bM.isOwnProperty=Ub;function nj(e,t,r,i){let n=Bt._`${t}${(0,Bt.getProperty)(r)} !== undefined`;return i?Bt._`${n} && ${Ub(e,t,r)}`:n}bM.propertyInData=nj;function Lb(e,t,r,i){let n=Bt._`${t}${(0,Bt.getProperty)(r)} === undefined`;return i?(0,Bt.or)(n,(0,Bt.not)(Ub(e,t,r))):n}bM.noPropertyInData=Lb;function vM(e){return e?Object.keys(e).filter((t)=>t!=="__proto__"):[]}bM.allSchemaProperties=vM;function ij(e,t){return vM(t).filter((r)=>!(0,jb.alwaysValidSchema)(e,t[r]))}bM.schemaProperties=ij;function oj({schemaCode:e,data:t,it:{gen:r,topSchemaRef:i,schemaPath:n,errorPath:o},it:s},h,v,b){let _=b?Bt._`${e}, ${t}, ${i}${n}`:t,g=[[oo.default.instancePath,(0,Bt.strConcat)(oo.default.instancePath,o)],[oo.default.parentData,s.parentData],[oo.default.parentDataProperty,s.parentDataProperty],[oo.default.rootData,oo.default.rootData]];if(s.opts.dynamicRef)g.push([oo.default.dynamicAnchors,oo.default.dynamicAnchors]);let S=Bt._`${_}, ${r.object(...g)}`;return v!==Bt.nil?Bt._`${h}.call(${v}, ${S})`:Bt._`${h}(${S})`}bM.callValidateCode=oj;var sj=Bt._`new RegExp`;function aj({gen:e,it:{opts:t}},r){let i=t.unicodeRegExp?"u":"",{regExp:n}=t.code,o=n(r,i);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:Bt._`${n.code==="new RegExp"?sj:(0,Qz.useFunc)(e,n)}(${r}, ${i})`})}bM.usePattern=aj;function uj(e){let{gen:t,data:r,keyword:i,it:n}=e,o=t.name("valid");if(n.allErrors){let h=t.let("valid",!0);return s(()=>t.assign(h,!1)),h}return t.var(o,!0),s(()=>t.break()),o;function s(h){let v=t.const("len",Bt._`${r}.length`);t.forRange("i",0,v,(b)=>{e.subschema({keyword:i,dataProp:b,dataPropType:jb.Type.Num},o),t.if((0,Bt.not)(o),h)})}}bM.validateArray=uj;function lj(e){let{gen:t,schema:r,keyword:i,it:n}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(r.some((v)=>(0,jb.alwaysValidSchema)(n,v))&&!n.opts.unevaluated)return;let s=t.let("valid",!1),h=t.name("_valid");t.block(()=>r.forEach((v,b)=>{let _=e.subschema({keyword:i,schemaProp:b,compositeRule:!0},h);if(t.assign(s,Bt._`${s} || ${h}`),!e.mergeValidEvaluated(_,h))t.if((0,Bt.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}bM.validateUnion=lj});var MM=Xe(function(xM){Object.defineProperty(xM,"__esModule",{value:!0});xM.validateKeywordUsage=xM.validSchemaType=xM.funcKeywordCode=xM.macroKeywordCode=void 0;var Xr=gt(),Vo=Mi(),Sj=Rn(),xj=ac();function kj(e,t){let{gen:r,keyword:i,schema:n,parentSchema:o,it:s}=e,h=t.macro.call(s.self,n,o,s),v=SM(r,i,h);if(s.opts.validateSchema!==!1)s.self.validateSchema(h,!0);let b=r.name("valid");e.subschema({schema:h,schemaPath:Xr.nil,errSchemaPath:`${s.errSchemaPath}/${i}`,topSchemaRef:v,compositeRule:!0},b),e.pass(b,()=>e.error(!0))}xM.macroKeywordCode=kj;function Mj(e,t){var r;let{gen:i,keyword:n,schema:o,parentSchema:s,$data:h,it:v}=e;Ij(v,t);let b=!h&&t.compile?t.compile.call(v.self,o,s,v):t.validate,_=SM(i,n,b),g=i.let("valid");e.block$data(g,S),e.ok((r=t.valid)!==null&&r!==void 0?r:g);function S(){if(t.errors===!1){if(I(),t.modifying)wM(e);$(()=>e.error())}else{let T=t.async?x():M();if(t.modifying)wM(e);$(()=>Ej(e,T))}}function x(){let T=i.let("ruleErrs",null);return i.try(()=>I(Xr._`await `),(P)=>i.assign(g,!1).if(Xr._`${P} instanceof ${v.ValidationError}`,()=>i.assign(T,Xr._`${P}.errors`),()=>i.throw(P))),T}function M(){let T=Xr._`${_}.errors`;return i.assign(T,null),I(Xr.nil),T}function I(T=t.async?Xr._`await `:Xr.nil){let P=v.opts.passContext?Vo.default.this:Vo.default.self,R=!(("compile"in t)&&!h||t.schema===!1);i.assign(g,Xr._`${T}${(0,Sj.callValidateCode)(e,_,P,R)}`,t.modifying)}function $(T){var P;i.if((0,Xr.not)((P=t.valid)!==null&&P!==void 0?P:g),T)}}xM.funcKeywordCode=Mj;function wM(e){let{gen:t,data:r,it:i}=e;t.if(i.parentData,()=>t.assign(r,Xr._`${i.parentData}[${i.parentDataProperty}]`))}function Ej(e,t){let{gen:r}=e;r.if(Xr._`Array.isArray(${t})`,()=>{r.assign(Vo.default.vErrors,Xr._`${Vo.default.vErrors} === null ? ${t} : ${Vo.default.vErrors}.concat(${t})`).assign(Vo.default.errors,Xr._`${Vo.default.vErrors}.length`),(0,xj.extendErrors)(e)},()=>e.error())}function Ij({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}function SM(e,t,r){if(r===void 0)throw Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Xr.stringify)(r)})}function $j(e,t,r=!1){return!t.length||t.some((i)=>i==="array"?Array.isArray(e):i==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==i||r&&typeof e>"u")}xM.validSchemaType=$j;function Tj({schema:e,opts:t,self:r,errSchemaPath:i},n,o){if(Array.isArray(n.keyword)?!n.keyword.includes(o):n.keyword!==o)throw Error("ajv implementation error");let s=n.dependencies;if(s===null||s===void 0?void 0:s.some((h)=>!Object.prototype.hasOwnProperty.call(e,h)))throw Error(`parent schema must have dependencies of ${o}: ${s.join(",")}`);if(n.validateSchema){if(!n.validateSchema(e[o])){let v=`keyword "${o}" value is invalid at path "${i}": `+r.errorsText(n.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(v);else throw Error(v)}}}xM.validateKeywordUsage=Tj});var TM=Xe(function(IM){Object.defineProperty(IM,"__esModule",{value:!0});IM.extendSubschemaMode=IM.extendSubschemaData=IM.getSubschema=void 0;var ti=gt(),EM=Mt();function Cj(e,{keyword:t,schemaProp:r,schema:i,schemaPath:n,errSchemaPath:o,topSchemaRef:s}){if(t!==void 0&&i!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let h=e.schema[t];return r===void 0?{schema:h,schemaPath:ti._`${e.schemaPath}${(0,ti.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:h[r],schemaPath:ti._`${e.schemaPath}${(0,ti.getProperty)(t)}${(0,ti.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,EM.escapeFragment)(r)}`}}if(i!==void 0){if(n===void 0||o===void 0||s===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:n,topSchemaRef:s,errSchemaPath:o}}throw Error('either "keyword" or "schema" must be passed')}IM.getSubschema=Cj;function Oj(e,t,{dataProp:r,dataPropType:i,data:n,dataTypes:o,propertyName:s}){if(n!==void 0&&r!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:h}=t;if(r!==void 0){let{errorPath:b,dataPathArr:_,opts:g}=t,S=h.let("data",ti._`${t.data}${(0,ti.getProperty)(r)}`,!0);v(S),e.errorPath=ti.str`${b}${(0,EM.getErrorPath)(r,i,g.jsPropertySyntax)}`,e.parentDataProperty=ti._`${r}`,e.dataPathArr=[..._,e.parentDataProperty]}if(n!==void 0){let b=n instanceof ti.Name?n:h.let("data",n,!0);if(v(b),s!==void 0)e.propertyName=s}if(o)e.dataTypes=o;function v(b){e.data=b,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,b]}}IM.extendSubschemaData=Oj;function Dj(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:i,createErrors:n,allErrors:o}){if(i!==void 0)e.compositeRule=i;if(n!==void 0)e.createErrors=n;if(o!==void 0)e.allErrors=o;e.jtdDiscriminator=t,e.jtdMetadata=r}IM.extendSubschemaMode=Dj});var Fb=Xe(function(mbe,PM){PM.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var i,n,o;if(Array.isArray(t)){if(i=t.length,i!=r.length)return!1;for(n=i;n--!==0;)if(!e(t[n],r[n]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(o=Object.keys(t),i=o.length,i!==Object.keys(r).length)return!1;for(n=i;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[n]))return!1;for(n=i;n--!==0;){var s=o[n];if(!e(t[s],r[s]))return!1}return!0}return t!==t&&r!==r}});var RM=Xe(function(gbe,AM){var so=AM.exports=function(e,t,r){if(typeof t=="function")r=t,t={};r=t.cb||r;var i=typeof r=="function"?r:r.pre||function(){},n=r.post||function(){};Pp(t,i,n,e,"",e)};so.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};so.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};so.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};so.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Pp(e,t,r,i,n,o,s,h,v,b){if(i&&typeof i=="object"&&!Array.isArray(i)){t(i,n,o,s,h,v,b);for(var _ in i){var g=i[_];if(Array.isArray(g)){if(_ in so.arrayKeywords)for(var S=0;S<g.length;S++)Pp(e,t,r,g[S],n+"/"+_+"/"+S,o,n,_,i,S)}else if(_ in so.propsKeywords){if(g&&typeof g=="object")for(var x in g)Pp(e,t,r,g[x],n+"/"+_+"/"+jj(x),o,n,_,i,x)}else if(_ in so.keywords||e.allKeys&&!(_ in so.skipKeywords))Pp(e,t,r,g,n+"/"+_,o,n,_,i)}r(i,n,o,s,h,v,b)}}function jj(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var lc=Xe(function(NM){Object.defineProperty(NM,"__esModule",{value:!0});NM.getSchemaRefs=NM.resolveUrl=NM.normalizeId=NM._getFullPath=NM.getFullPath=NM.inlineRef=void 0;var Uj=Mt(),Lj=Fb(),Fj=RM(),qj=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Bj(e,t=!0){if(typeof e=="boolean")return!0;if(t===!0)return!qb(e);if(!t)return!1;return CM(e)<=t}NM.inlineRef=Bj;var Hj=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function qb(e){for(let t in e){if(Hj.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(qb))return!0;if(typeof r=="object"&&qb(r))return!0}return!1}function CM(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,qj.has(r))continue;if(typeof e[r]=="object")(0,Uj.eachItem)(e[r],(i)=>t+=CM(i));if(t===1/0)return 1/0}return t}function OM(e,t="",r){if(r!==!1)t=aa(t);let i=e.parse(t);return DM(e,i)}NM.getFullPath=OM;function DM(e,t){return e.serialize(t).split("#")[0]+"#"}NM._getFullPath=DM;var Zj=/#\/?$/;function aa(e){return e?e.replace(Zj,""):""}NM.normalizeId=aa;function Kj(e,t,r){return r=aa(r),e.resolve(t,r)}NM.resolveUrl=Kj;var Vj=/^[a-z_][-a-z0-9._]*$/i;function Wj(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:i}=this.opts,n=aa(e[r]||t),o={"":n},s=OM(i,n,!1),h={},v=new Set;return Fj(e,{allKeys:!0},(g,S,x,M)=>{if(M===void 0)return;let I=s+S,$=o[M];if(typeof g[r]=="string")$=T.call(this,g[r]);P.call(this,g.$anchor),P.call(this,g.$dynamicAnchor),o[S]=$;function T(R){let C=this.opts.uriResolver.resolve;if(R=aa($?C($,R):R),v.has(R))throw _(R);v.add(R);let N=this.refs[R];if(typeof N=="string")N=this.refs[N];if(typeof N=="object")b(g,N.schema,R);else if(R!==aa(I))if(R[0]==="#")b(g,h[R],R),h[R]=g;else this.refs[R]=I;return R}function P(R){if(typeof R=="string"){if(!Vj.test(R))throw Error(`invalid anchor "${R}"`);T.call(this,`#${R}`)}}}),h;function b(g,S,x){if(S!==void 0&&!Lj(g,S))throw _(x)}function _(g){return Error(`reference "${g}" resolves to more than one schema`)}}NM.getSchemaRefs=Wj});var fc=Xe(function(YM){Object.defineProperty(YM,"__esModule",{value:!0});YM.getData=YM.KeywordCxt=YM.validateFunctionCode=void 0;var qM=tM(),jM=uc(),Hb=Ob(),Ap=uc(),eU=gM(),dc=MM(),Bb=TM(),nt=gt(),ct=Mi(),tU=lc(),Ei=Mt(),cc=ac();function rU(e){if(ZM(e)){if(KM(e),HM(e)){oU(e);return}}BM(e,()=>(0,qM.topBoolOrEmptySchema)(e))}YM.validateFunctionCode=rU;function BM({gen:e,validateName:t,schema:r,schemaEnv:i,opts:n},o){if(n.code.es5)e.func(t,nt._`${ct.default.data}, ${ct.default.valCxt}`,i.$async,()=>{e.code(nt._`"use strict"; ${UM(r,n)}`),iU(e,n),e.code(o)});else e.func(t,nt._`${ct.default.data}, ${nU(n)}`,i.$async,()=>e.code(UM(r,n)).code(o))}function nU(e){return nt._`{${ct.default.instancePath}="", ${ct.default.parentData}, ${ct.default.parentDataProperty}, ${ct.default.rootData}=${ct.default.data}${e.dynamicRef?nt._`, ${ct.default.dynamicAnchors}={}`:nt.nil}}={}`}function iU(e,t){e.if(ct.default.valCxt,()=>{if(e.var(ct.default.instancePath,nt._`${ct.default.valCxt}.${ct.default.instancePath}`),e.var(ct.default.parentData,nt._`${ct.default.valCxt}.${ct.default.parentData}`),e.var(ct.default.parentDataProperty,nt._`${ct.default.valCxt}.${ct.default.parentDataProperty}`),e.var(ct.default.rootData,nt._`${ct.default.valCxt}.${ct.default.rootData}`),t.dynamicRef)e.var(ct.default.dynamicAnchors,nt._`${ct.default.valCxt}.${ct.default.dynamicAnchors}`)},()=>{if(e.var(ct.default.instancePath,nt._`""`),e.var(ct.default.parentData,nt._`undefined`),e.var(ct.default.parentDataProperty,nt._`undefined`),e.var(ct.default.rootData,ct.default.data),t.dynamicRef)e.var(ct.default.dynamicAnchors,nt._`{}`)})}function oU(e){let{schema:t,opts:r,gen:i}=e;BM(e,()=>{if(r.$comment&&t.$comment)WM(e);if(cU(e),i.let(ct.default.vErrors,null),i.let(ct.default.errors,0),r.unevaluated)sU(e);VM(e),hU(e)});return}function sU(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",nt._`${r}.evaluated`),t.if(nt._`${e.evaluated}.dynamicProps`,()=>t.assign(nt._`${e.evaluated}.props`,nt._`undefined`)),t.if(nt._`${e.evaluated}.dynamicItems`,()=>t.assign(nt._`${e.evaluated}.items`,nt._`undefined`))}function UM(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?nt._`/*# sourceURL=${r} */`:nt.nil}function aU(e,t){if(ZM(e)){if(KM(e),HM(e)){uU(e,t);return}}(0,qM.boolOrEmptySchema)(e,t)}function HM({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function ZM(e){return typeof e.schema!="boolean"}function uU(e,t){let{schema:r,gen:i,opts:n}=e;if(n.$comment&&r.$comment)WM(e);dU(e),fU(e);let o=i.const("_errs",ct.default.errors);VM(e,o),i.var(t,nt._`${o} === ${ct.default.errors}`)}function KM(e){(0,Ei.checkUnknownRules)(e),lU(e)}function VM(e,t){if(e.opts.jtd)return LM(e,[],!1,t);let r=(0,jM.getSchemaTypes)(e.schema),i=(0,jM.coerceAndCheckDataType)(e,r);LM(e,r,!i,t)}function lU(e){let{schema:t,errSchemaPath:r,opts:i,self:n}=e;if(t.$ref&&i.ignoreKeywordsWithRef&&(0,Ei.schemaHasRulesButRef)(t,n.RULES))n.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function cU(e){let{schema:t,opts:r}=e;if(t.default!==void 0&&r.useDefaults&&r.strictSchema)(0,Ei.checkStrictMode)(e,"default is ignored in the schema root")}function dU(e){let t=e.schema[e.opts.schemaId];if(t)e.baseId=(0,tU.resolveUrl)(e.opts.uriResolver,e.baseId,t)}function fU(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}function WM({gen:e,schemaEnv:t,schema:r,errSchemaPath:i,opts:n}){let o=r.$comment;if(n.$comment===!0)e.code(nt._`${ct.default.self}.logger.log(${o})`);else if(typeof n.$comment=="function"){let s=nt.str`${i}/$comment`,h=e.scopeValue("root",{ref:t.root});e.code(nt._`${ct.default.self}.opts.$comment(${o}, ${s}, ${h}.schema)`)}}function hU(e){let{gen:t,schemaEnv:r,validateName:i,ValidationError:n,opts:o}=e;if(r.$async)t.if(nt._`${ct.default.errors} === 0`,()=>t.return(ct.default.data),()=>t.throw(nt._`new ${n}(${ct.default.vErrors})`));else{if(t.assign(nt._`${i}.errors`,ct.default.vErrors),o.unevaluated)pU(e);t.return(nt._`${ct.default.errors} === 0`)}}function pU({gen:e,evaluated:t,props:r,items:i}){if(r instanceof nt.Name)e.assign(nt._`${t}.props`,r);if(i instanceof nt.Name)e.assign(nt._`${t}.items`,i)}function LM(e,t,r,i){let{gen:n,schema:o,data:s,allErrors:h,opts:v,self:b}=e,{RULES:_}=b;if(o.$ref&&(v.ignoreKeywordsWithRef||!(0,Ei.schemaHasRulesButRef)(o,_))){n.block(()=>JM(e,"$ref",_.all.$ref.definition));return}if(!v.jtd)mU(e,t);n.block(()=>{for(let S of _.rules)g(S);g(_.post)});function g(S){if(!(0,Hb.shouldUseGroup)(o,S))return;if(S.type){if(n.if((0,Ap.checkDataType)(S.type,s,v.strictNumbers)),FM(e,S),t.length===1&&t[0]===S.type&&r)n.else(),(0,Ap.reportTypeError)(e);n.endIf()}else FM(e,S);if(!h)n.if(nt._`${ct.default.errors} === ${i||0}`)}}function FM(e,t){let{gen:r,schema:i,opts:{useDefaults:n}}=e;if(n)(0,eU.assignDefaults)(e,t.type);r.block(()=>{for(let o of t.rules)if((0,Hb.shouldUseRule)(i,o))JM(e,o.keyword,o.definition,t.type)})}function mU(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;if(gU(e,t),!e.opts.allowUnionTypes)yU(e,t);vU(e,e.dataTypes)}function gU(e,t){if(!t.length)return;if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach((r)=>{if(!GM(e.dataTypes,r))Zb(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),_U(e,t)}function yU(e,t){if(t.length>1&&!(t.length===2&&t.includes("null")))Zb(e,"use allowUnionTypes to allow union type keyword")}function vU(e,t){let r=e.self.RULES.all;for(let i in r){let n=r[i];if(typeof n=="object"&&(0,Hb.shouldUseRule)(e.schema,n)){let{type:o}=n.definition;if(o.length&&!o.some((s)=>bU(t,s)))Zb(e,`missing type "${o.join(",")}" for keyword "${i}"`)}}}function bU(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function GM(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function _U(e,t){let r=[];for(let i of e.dataTypes)if(GM(t,i))r.push(i);else if(t.includes("integer")&&i==="number")r.push("integer");e.dataTypes=r}function Zb(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,Ei.checkStrictMode)(e,t,e.opts.strictTypes)}class Kb{constructor(e,t,r){if((0,dc.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Ei.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",XM(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,dc.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);if("code"in t?t.trackErrors:t.errors!==!1)this.errsCount=e.gen.const("_errs",ct.default.errors)}result(e,t,r){this.failResult((0,nt.not)(e),t,r)}failResult(e,t,r){if(this.gen.if(e),r)r();else this.error();if(t){if(this.gen.else(),t(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(e,t){this.failResult((0,nt.not)(e),void 0,t)}fail(e){if(e===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(e),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail(nt._`${t} !== undefined && (${(0,nt.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,t){(e?cc.reportExtraError:cc.reportError)(this,this.def.error,t)}$dataError(){(0,cc.reportError)(this,this.def.$dataError||cc.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,cc.resetErrorsCount)(this.gen,this.errsCount)}ok(e){if(!this.allErrors)this.gen.if(e)}setParams(e,t){if(t)Object.assign(this.params,e);else this.params=e}block$data(e,t,r=nt.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=nt.nil,t=nt.nil){if(!this.$data)return;let{gen:r,schemaCode:i,schemaType:n,def:o}=this;if(r.if((0,nt.or)(nt._`${i} === undefined`,t)),e!==nt.nil)r.assign(e,!0);if(n.length||o.validateSchema){if(r.elseIf(this.invalid$data()),this.$dataError(),e!==nt.nil)r.assign(e,!1)}r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:i,it:n}=this;return(0,nt.or)(o(),s());function o(){if(r.length){if(!(t instanceof nt.Name))throw Error("ajv implementation error");let h=Array.isArray(r)?r:[r];return nt._`${(0,Ap.checkDataTypes)(h,t,n.opts.strictNumbers,Ap.DataType.Wrong)}`}return nt.nil}function s(){if(i.validateSchema){let h=e.scopeValue("validate$data",{ref:i.validateSchema});return nt._`!${h}(${t})`}return nt.nil}}subschema(e,t){let r=(0,Bb.getSubschema)(this.it,e);(0,Bb.extendSubschemaData)(r,this.it,e),(0,Bb.extendSubschemaMode)(r,e);let i={...this.it,...r,items:void 0,props:void 0};return aU(i,t),i}mergeEvaluated(e,t){let{it:r,gen:i}=this;if(!r.opts.unevaluated)return;if(r.props!==!0&&e.props!==void 0)r.props=Ei.mergeEvaluated.props(i,e.props,r.props,t);if(r.items!==!0&&e.items!==void 0)r.items=Ei.mergeEvaluated.items(i,e.items,r.items,t)}mergeValidEvaluated(e,t){let{it:r,gen:i}=this;if(r.opts.unevaluated&&(r.props!==!0||r.items!==!0))return i.if(t,()=>this.mergeEvaluated(e,nt.Name)),!0}}YM.KeywordCxt=Kb;function JM(e,t,r,i){let n=new Kb(e,r,t);if("code"in r)r.code(n,i);else if(n.$data&&r.validate)(0,dc.funcKeywordCode)(n,r);else if("macro"in r)(0,dc.macroKeywordCode)(n,r);else if(r.compile||r.validate)(0,dc.funcKeywordCode)(n,r)}var wU=/^\/(?:[^~]|~0|~1)*$/,SU=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function XM(e,{dataLevel:t,dataNames:r,dataPathArr:i}){let n,o;if(e==="")return ct.default.rootData;if(e[0]==="/"){if(!wU.test(e))throw Error(`Invalid JSON-pointer: ${e}`);n=e,o=ct.default.rootData}else{let b=SU.exec(e);if(!b)throw Error(`Invalid JSON-pointer: ${e}`);let _=+b[1];if(n=b[2],n==="#"){if(_>=t)throw Error(v("property/index",_));return i[t-_]}if(_>t)throw Error(v("data",_));if(o=r[t-_],!n)return o}let s=o,h=n.split("/");for(let b of h)if(b)o=nt._`${o}${(0,nt.getProperty)((0,Ei.unescapeJsonPointer)(b))}`,s=nt._`${s} && ${o}`;return s;function v(b,_){return`Cannot access ${b} ${_} levels up, current level is ${t}`}}YM.getData=XM});var Rp=Xe(function(t4){Object.defineProperty(t4,"__esModule",{value:!0});class e4 extends Error{constructor(e){super("validation failed");this.errors=e,this.ajv=this.validation=!0}}t4.default=e4});var hc=Xe(function(n4){Object.defineProperty(n4,"__esModule",{value:!0});var Vb=lc();class r4 extends Error{constructor(e,t,r,i){super(i||`can't resolve reference ${r} from id ${t}`);this.missingRef=(0,Vb.resolveUrl)(e,t,r),this.missingSchema=(0,Vb.normalizeId)((0,Vb.getFullPath)(e,this.missingRef))}}n4.default=r4});var Op=Xe(function(s4){Object.defineProperty(s4,"__esModule",{value:!0});s4.resolveSchema=s4.getCompilingSchema=s4.resolveRef=s4.compileSchema=s4.SchemaEnv=void 0;var Hn=gt(),IU=Rp(),Wo=Mi(),Zn=lc(),i4=Mt(),$U=fc();class pc{constructor(e){var t;this.refs={},this.dynamicAnchors={};let r;if(typeof e.schema=="object")r=e.schema;this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(t=e.baseId)!==null&&t!==void 0?t:(0,Zn.normalizeId)(r===null||r===void 0?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=r===null||r===void 0?void 0:r.$async,this.refs={}}}s4.SchemaEnv=pc;function Gb(e){let t=o4.call(this,e);if(t)return t;let r=(0,Zn.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:i,lines:n}=this.opts.code,{ownProperties:o}=this.opts,s=new Hn.CodeGen(this.scope,{es5:i,lines:n,ownProperties:o}),h;if(e.$async)h=s.scopeValue("Error",{ref:IU.default,code:Hn._`require("ajv/dist/runtime/validation_error").default`});let v=s.scopeName("validate");e.validateName=v;let b={gen:s,allErrors:this.opts.allErrors,data:Wo.default.data,parentData:Wo.default.parentData,parentDataProperty:Wo.default.parentDataProperty,dataNames:[Wo.default.data],dataPathArr:[Hn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Hn.stringify)(e.schema)}:{ref:e.schema}),validateName:v,ValidationError:h,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Hn.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:Hn._`""`,opts:this.opts,self:this},_;try{this._compilations.add(e),(0,$U.validateFunctionCode)(b),s.optimize(this.opts.code.optimize);let g=s.toString();if(_=`${s.scopeRefs(Wo.default.scope)}return ${g}`,this.opts.code.process)_=this.opts.code.process(_,e);let x=Function(`${Wo.default.self}`,`${Wo.default.scope}`,_)(this,this.scope.get());if(this.scope.value(v,{ref:x}),x.errors=null,x.schema=e.schema,x.schemaEnv=e,e.$async)x.$async=!0;if(this.opts.code.source===!0)x.source={validateName:v,validateCode:g,scopeValues:s._values};if(this.opts.unevaluated){let{props:M,items:I}=b;if(x.evaluated={props:M instanceof Hn.Name?void 0:M,items:I instanceof Hn.Name?void 0:I,dynamicProps:M instanceof Hn.Name,dynamicItems:I instanceof Hn.Name},x.source)x.source.evaluated=(0,Hn.stringify)(x.evaluated)}return e.validate=x,e}catch(g){if(delete e.validate,delete e.validateName,_)this.logger.error("Error compiling schema, function code:",_);throw g}finally{this._compilations.delete(e)}}s4.compileSchema=Gb;function TU(e,t,r){var i;r=(0,Zn.resolveUrl)(this.opts.uriResolver,t,r);let n=e.refs[r];if(n)return n;let o=RU.call(this,e,r);if(o===void 0){let s=(i=e.localRefs)===null||i===void 0?void 0:i[r],{schemaId:h}=this.opts;if(s)o=new pc({schema:s,schemaId:h,root:e,baseId:t})}if(o===void 0)return;return e.refs[r]=PU.call(this,o)}s4.resolveRef=TU;function PU(e){if((0,Zn.inlineRef)(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:Gb.call(this,e)}function o4(e){for(let t of this._compilations)if(AU(t,e))return t}s4.getCompilingSchema=o4;function AU(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function RU(e,t){let r;while(typeof(r=this.refs[t])=="string")t=r;return r||this.schemas[t]||Cp.call(this,e,t)}function Cp(e,t){let r=this.opts.uriResolver.parse(t),i=(0,Zn._getFullPath)(this.opts.uriResolver,r),n=(0,Zn.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&i===n)return Wb.call(this,r,e);let o=(0,Zn.normalizeId)(i),s=this.refs[o]||this.schemas[o];if(typeof s=="string"){let h=Cp.call(this,e,s);if(typeof(h===null||h===void 0?void 0:h.schema)!=="object")return;return Wb.call(this,r,h)}if(typeof(s===null||s===void 0?void 0:s.schema)!=="object")return;if(!s.validate)Gb.call(this,s);if(o===(0,Zn.normalizeId)(t)){let{schema:h}=s,{schemaId:v}=this.opts,b=h[v];if(b)n=(0,Zn.resolveUrl)(this.opts.uriResolver,n,b);return new pc({schema:h,schemaId:v,root:e,baseId:n})}return Wb.call(this,r,s)}s4.resolveSchema=Cp;var CU=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Wb(e,{baseId:t,schema:r,root:i}){var n;if(((n=e.fragment)===null||n===void 0?void 0:n[0])!=="/")return;for(let h of e.fragment.slice(1).split("/")){if(typeof r==="boolean")return;let v=r[(0,i4.unescapeFragment)(h)];if(v===void 0)return;r=v;let b=typeof r==="object"&&r[this.opts.schemaId];if(!CU.has(h)&&b)t=(0,Zn.resolveUrl)(this.opts.uriResolver,t,b)}let o;if(typeof r!="boolean"&&r.$ref&&!(0,i4.schemaHasRulesButRef)(r,this.RULES)){let h=(0,Zn.resolveUrl)(this.opts.uriResolver,t,r.$ref);o=Cp.call(this,i,h)}let{schemaId:s}=this.opts;if(o=o||new pc({schema:r,schemaId:s,root:i,baseId:t}),o.schema!==o.root.schema)return o;return}});var u4=Xe(function(Sbe,jU){jU.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var Yb=Xe(function(xbe,p4){var UU=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),c4=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),Jb=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),d4=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),LU=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Xb(e){let t="",r=0,i=0;for(i=0;i<e.length;i++){if(r=e[i].charCodeAt(0),r===48)continue;if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[i];break}for(i+=1;i<e.length;i++){if(r=e[i].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[i]}return t}var FU=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function l4(e){return e.length=0,!0}function qU(e,t,r){if(e.length){let i=Xb(e);if(i!=="")t.push(i);else return r.error=!0,!1;e.length=0}return!0}function BU(e){let t=0,r={error:!1,address:"",zone:""},i=[],n=[],o=!1,s=!1,h=qU;for(let v=0;v<e.length;v++){let b=e[v];if(b==="["||b==="]")continue;if(b===":"){if(o===!0)s=!0;if(!h(n,i,r))break;if(++t>7){r.error=!0;break}if(v>0&&e[v-1]===":")o=!0;i.push(":");continue}else if(b==="%"){if(!h(n,i,r))break;h=l4}else{n.push(b);continue}}if(n.length)if(h===l4)r.zone=n.join("");else if(s)i.push(n.join(""));else i.push(Xb(n));return r.address=i.join(""),r}function f4(e){if(HU(e,":")<2)return{host:e,isIPV6:!1};let t=BU(e);if(!t.error){let{address:r,address:i}=t;if(t.zone)r+="%"+t.zone,i+="%25"+t.zone;return{host:r,isIPV6:!0,escapedHost:i}}else return{host:e,isIPV6:!1}}function HU(e,t){let r=0;for(let i=0;i<e.length;i++)if(e[i]===t)r++;return r}function ZU(e){let t=e,r=[],i=-1,n=0;while(n=t.length){if(n===1)if(t===".")break;else if(t==="/"){r.push("/");break}else{r.push(t);break}else if(n===2){if(t[0]==="."){if(t[1]===".")break;else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."||t[1]==="/"){r.push("/");break}}}else if(n===3){if(t==="/.."){if(r.length!==0)r.pop();r.push("/");break}}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."){if(t[3]==="/"){if(t=t.slice(3),r.length!==0)r.pop();continue}}}}if((i=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,i)),t=t.slice(i)}return r.join("")}var KU={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},VU=/[@/?#:]/g,WU=/[@/?#]/g;function h4(e,t){let r=t?WU:VU;return r.lastIndex=0,e.replace(r,(i)=>KU[i])}function GU(e,t=!1){if(e.indexOf("%")===-1)return e;let r="";for(let i=0;i<e.length;i++){if(e[i]==="%"&&i+2<e.length){let n=e.slice(i+1,i+3);if(Jb(n)){let o=n.toUpperCase(),s=String.fromCharCode(parseInt(o,16));if(t&&d4(s))r+=s;else r+="%"+o;i+=2;continue}}r+=e[i]}return r}function JU(e){let t="";for(let r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){let i=e.slice(r+1,r+3);if(Jb(i)){let n=i.toUpperCase(),o=String.fromCharCode(parseInt(n,16));if(o!=="."&&d4(o))t+=o;else t+="%"+n;r+=2;continue}}if(LU(e[r]))t+=e[r];else t+=escape(e[r])}return t}function XU(e){let t="";for(let r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){let i=e.slice(r+1,r+3);if(Jb(i)){t+="%"+i.toUpperCase(),r+=2;continue}}t+=escape(e[r])}return t}function YU(e){let t=[];if(e.userinfo!==void 0)t.push(e.userinfo),t.push("@");if(e.host!==void 0){let r=unescape(e.host);if(!c4(r)){let i=f4(r);if(i.isIPV6===!0)r=`[${i.escapedHost}]`;else r=h4(r,!1)}t.push(r)}if(typeof e.port==="number"||typeof e.port==="string")t.push(":"),t.push(String(e.port));return t.length?t.join(""):void 0}p4.exports={nonSimpleDomain:FU,recomposeAuthority:YU,reescapeHostDelimiters:h4,normalizePercentEncoding:GU,normalizePathEncoding:JU,escapePreservingEscapes:XU,removeDotSegments:ZU,isIPv4:c4,isUUID:UU,normalizeIPv6:f4,stringArrayToHexStripped:Xb}});var b4=Xe(function(kbe,v4){var{isUUID:QU}=Yb(),eL=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,tL=["http","https","ws","wss","urn","urn:uuid"];function rL(e){return tL.indexOf(e)!==-1}function Qb(e){if(e.secure===!0)return!0;else if(e.secure===!1)return!1;else if(e.scheme)return e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S");else return!1}function m4(e){if(!e.host)e.error=e.error||"HTTP URIs must have a host.";return e}function g4(e){let t=String(e.scheme).toLowerCase()==="https";if(e.port===(t?443:80)||e.port==="")e.port=void 0;if(!e.path)e.path="/";return e}function nL(e){return e.secure=Qb(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function iL(e){if(e.port===(Qb(e)?443:80)||e.port==="")e.port=void 0;if(typeof e.secure==="boolean")e.scheme=e.secure?"wss":"ws",e.secure=void 0;if(e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}function oL(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(eL);if(r){let i=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let n=`${i}:${t.nid||e.nid}`,o=e_(n);if(e.path=void 0,o)e=o.parse(e,t)}else e.error=e.error||"URN can not be parsed.";return e}function sL(e,t){if(e.nid===void 0)throw Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",i=e.nid.toLowerCase(),n=`${r}:${t.nid||i}`,o=e_(n);if(o)e=o.serialize(e,t);let s=e,h=e.nss;return s.path=`${i||t.nid}:${h}`,t.skipEscape=!0,s}function aL(e,t){let r=e;if(r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!QU(r.uuid)))r.error=r.error||"UUID is not valid.";return r}function uL(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var y4={scheme:"http",domainHost:!0,parse:m4,serialize:g4},lL={scheme:"https",domainHost:y4.domainHost,parse:m4,serialize:g4},Dp={scheme:"ws",domainHost:!0,parse:nL,serialize:iL},cL={scheme:"wss",domainHost:Dp.domainHost,parse:Dp.parse,serialize:Dp.serialize},dL={scheme:"urn",parse:oL,serialize:sL,skipNormalize:!0},fL={scheme:"urn:uuid",parse:aL,serialize:uL,skipNormalize:!0},Np={http:y4,https:lL,ws:Dp,wss:cL,urn:dL,"urn:uuid":fL};Object.setPrototypeOf(Np,null);function e_(e){return e&&(Np[e]||Np[e.toLowerCase()])||void 0}v4.exports={wsIsSecure:Qb,SCHEMES:Np,isValidSchemeName:rL,getSchemeHandler:e_}});var M4=Xe(function(Mbe,zp){var{normalizeIPv6:hL,removeDotSegments:mc,recomposeAuthority:pL,normalizePercentEncoding:mL,normalizePathEncoding:gL,escapePreservingEscapes:yL,reescapeHostDelimiters:vL,isIPv4:bL,nonSimpleDomain:_L}=Yb(),{SCHEMES:wL,getSchemeHandler:w4}=b4();function SL(e,t){if(typeof e==="string")e=IL(e,t);else if(typeof e==="object")e=ua(Go(e,t),t);return e}function xL(e,t,r){let i=r?Object.assign({scheme:"null"},r):{scheme:"null"},n=S4(ua(e,i),ua(t,i),i,!0);return i.skipEscape=!0,Go(n,i)}function S4(e,t,r,i){let n={};if(!i)e=ua(Go(e,r),r),t=ua(Go(t,r),r);if(r=r||{},!r.tolerant&&t.scheme)n.scheme=t.scheme,n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=mc(t.path||""),n.query=t.query;else{if(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=mc(t.path||""),n.query=t.query;else{if(!t.path)if(n.path=e.path,t.query!==void 0)n.query=t.query;else n.query=e.query;else{if(t.path[0]==="/")n.path=mc(t.path);else{if((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path)n.path="/"+t.path;else if(!e.path)n.path=t.path;else n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path;n.path=mc(n.path)}n.query=t.query}n.userinfo=e.userinfo,n.host=e.host,n.port=e.port}n.scheme=e.scheme}return n.fragment=t.fragment,n}function kL(e,t,r){let i=_4(e,r),n=_4(t,r);return i!==void 0&&n!==void 0&&i.toLowerCase()===n.toLowerCase()}function Go(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},i=Object.assign({},t),n=[],o=w4(i.scheme||r.scheme);if(o&&o.serialize)o.serialize(r,i);if(r.path!==void 0)if(!i.skipEscape){if(r.path=yL(r.path),r.scheme!==void 0)r.path=r.path.split("%3A").join(":")}else r.path=mL(r.path);if(i.reference!=="suffix"&&r.scheme)n.push(r.scheme,":");let s=pL(r);if(s!==void 0){if(i.reference!=="suffix")n.push("//");if(n.push(s),r.path&&r.path[0]!=="/")n.push("/")}if(r.path!==void 0){let h=r.path;if(!i.absolutePath&&(!o||!o.absolutePath))h=mc(h);if(s===void 0&&h[0]==="/"&&h[1]==="/")h="/%2F"+h.slice(2);n.push(h)}if(r.query!==void 0)n.push("?",r.query);if(r.fragment!==void 0)n.push("#",r.fragment);return n.join("")}var ML=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function EL(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof e.port==="number"&&(e.port<0||e.port>65535))return"URI port is malformed.";return}function x4(e,t){let r=Object.assign({},t),i={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},n=!1,o=!1;if(r.reference==="suffix")if(r.scheme)e=r.scheme+":"+e;else e="//"+e;let s=e.match(ML);if(s){if(i.scheme=s[1],i.userinfo=s[3],i.host=s[4],i.port=parseInt(s[5],10),i.path=s[6]||"",i.query=s[7],i.fragment=s[8],isNaN(i.port))i.port=s[5];let h=EL(i,s);if(h!==void 0)i.error=i.error||h,n=!0;if(i.host)if(bL(i.host)===!1){let _=hL(i.host);i.host=_.host.toLowerCase(),o=_.isIPV6}else o=!0;if(i.scheme===void 0&&i.userinfo===void 0&&i.host===void 0&&i.port===void 0&&i.query===void 0&&!i.path)i.reference="same-document";else if(i.scheme===void 0)i.reference="relative";else if(i.fragment===void 0)i.reference="absolute";else i.reference="uri";if(r.reference&&r.reference!=="suffix"&&r.reference!==i.reference)i.error=i.error||"URI is not a "+r.reference+" reference.";let v=w4(r.scheme||i.scheme);if(!r.unicodeSupport&&(!v||!v.unicodeSupport)){if(i.host&&(r.domainHost||v&&v.domainHost)&&o===!1&&_L(i.host))try{i.host=URL.domainToASCII(i.host.toLowerCase())}catch(b){i.error=i.error||"Host's domain name can not be converted to ASCII: "+b}}if(!v||v&&!v.skipNormalize){if(e.indexOf("%")!==-1){if(i.scheme!==void 0)i.scheme=unescape(i.scheme);if(i.host!==void 0)i.host=vL(unescape(i.host),o)}if(i.path)i.path=gL(i.path);if(i.fragment)try{i.fragment=encodeURI(decodeURIComponent(i.fragment))}catch{i.error=i.error||"URI malformed"}}if(v&&v.parse)v.parse(i,r)}else i.error=i.error||"URI can not be parsed.";return{parsed:i,malformedAuthorityOrPort:n}}function ua(e,t){return x4(e,t).parsed}function IL(e,t){return k4(e,t).normalized}function k4(e,t){let{parsed:r,malformedAuthorityOrPort:i}=x4(e,t);return{normalized:i?e:Go(r,t),malformedAuthorityOrPort:i}}function _4(e,t){if(typeof e==="string"){let{normalized:r,malformedAuthorityOrPort:i}=k4(e,t);return i?void 0:r}if(typeof e==="object")return Go(e,t)}var t_={SCHEMES:wL,normalize:SL,resolve:xL,resolveComponent:S4,equal:kL,serialize:Go,parse:ua};zp.exports=t_;zp.exports.default=t_;zp.exports.fastUri=t_});var $4=Xe(function(I4){Object.defineProperty(I4,"__esModule",{value:!0});var E4=M4();E4.code='require("ajv/dist/runtime/uri").default';I4.default=E4});var N4=Xe(function(Ii){Object.defineProperty(Ii,"__esModule",{value:!0});Ii.CodeGen=Ii.Name=Ii.nil=Ii.stringify=Ii.str=Ii._=Ii.KeywordCxt=void 0;var TL=fc();Object.defineProperty(Ii,"KeywordCxt",{enumerable:!0,get:function(){return TL.KeywordCxt}});var la=gt();Object.defineProperty(Ii,"_",{enumerable:!0,get:function(){return la._}});Object.defineProperty(Ii,"str",{enumerable:!0,get:function(){return la.str}});Object.defineProperty(Ii,"stringify",{enumerable:!0,get:function(){return la.stringify}});Object.defineProperty(Ii,"nil",{enumerable:!0,get:function(){return la.nil}});Object.defineProperty(Ii,"Name",{enumerable:!0,get:function(){return la.Name}});Object.defineProperty(Ii,"CodeGen",{enumerable:!0,get:function(){return la.CodeGen}});var PL=Rp(),C4=hc(),AL=Cb(),gc=Op(),RL=gt(),yc=lc(),jp=uc(),n_=Mt(),T4=u4(),CL=$4(),O4=(e,t)=>new RegExp(e,t);O4.code="new RegExp";var OL=["removeAdditional","useDefaults","coerceTypes"],DL=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),NL={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},zL={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},P4=200;function jL(e){var t,r,i,n,o,s,h,v,b,_,g,S,x,M,I,$,T,P,R,C,N,B,ie,le,ue;let F=e.strict,ee=(t=e.code)===null||t===void 0?void 0:t.optimize,a=ee===!0||ee===void 0?1:ee||0,c=(i=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&i!==void 0?i:O4,f=(n=e.uriResolver)!==null&&n!==void 0?n:CL.default;return{strictSchema:(s=(o=e.strictSchema)!==null&&o!==void 0?o:F)!==null&&s!==void 0?s:!0,strictNumbers:(v=(h=e.strictNumbers)!==null&&h!==void 0?h:F)!==null&&v!==void 0?v:!0,strictTypes:(_=(b=e.strictTypes)!==null&&b!==void 0?b:F)!==null&&_!==void 0?_:"log",strictTuples:(S=(g=e.strictTuples)!==null&&g!==void 0?g:F)!==null&&S!==void 0?S:"log",strictRequired:(M=(x=e.strictRequired)!==null&&x!==void 0?x:F)!==null&&M!==void 0?M:!1,code:e.code?{...e.code,optimize:a,regExp:c}:{optimize:a,regExp:c},loopRequired:(I=e.loopRequired)!==null&&I!==void 0?I:P4,loopEnum:($=e.loopEnum)!==null&&$!==void 0?$:P4,meta:(T=e.meta)!==null&&T!==void 0?T:!0,messages:(P=e.messages)!==null&&P!==void 0?P:!0,inlineRefs:(R=e.inlineRefs)!==null&&R!==void 0?R:!0,schemaId:(C=e.schemaId)!==null&&C!==void 0?C:"$id",addUsedSchema:(N=e.addUsedSchema)!==null&&N!==void 0?N:!0,validateSchema:(B=e.validateSchema)!==null&&B!==void 0?B:!0,validateFormats:(ie=e.validateFormats)!==null&&ie!==void 0?ie:!0,unicodeRegExp:(le=e.unicodeRegExp)!==null&&le!==void 0?le:!0,int32range:(ue=e.int32range)!==null&&ue!==void 0?ue:!0,uriResolver:f}}class Up{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...jL(e)};let{es5:t,lines:r}=this.opts.code;this.scope=new RL.ValueScope({scope:{},prefixes:DL,es5:t,lines:r}),this.logger=HL(e.logger);let i=e.validateFormats;if(e.validateFormats=!1,this.RULES=(0,AL.getRules)(),A4.call(this,NL,e,"NOT SUPPORTED"),A4.call(this,zL,e,"DEPRECATED","warn"),this._metaOpts=qL.call(this),e.formats)LL.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords)FL.call(this,e.keywords);if(typeof e.meta=="object")this.addMetaSchema(e.meta);UL.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,i=T4;if(r==="id")i={...T4},i.id=i.$id,delete i.$id;if(t&&e)this.addMetaSchema(i,i[r],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[t]||e:void 0}validate(e,t){let r;if(typeof e=="string"){if(r=this.getSchema(e),!r)throw Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let i=r(t);if(!("$async"in r))this.errors=r.errors;return i}compile(e,t){let r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return i.call(this,e,t);async function i(b,_){await n.call(this,b.$schema);let g=this._addSchema(b,_);return g.validate||o.call(this,g)}async function n(b){if(b&&!this.getSchema(b))await i.call(this,{$ref:b},!0)}async function o(b){try{return this._compileSchemaEnv(b)}catch(_){if(!(_ instanceof C4.default))throw _;return s.call(this,_),await h.call(this,_.missingSchema),o.call(this,b)}}function s({missingSchema:b,missingRef:_}){if(this.refs[b])throw Error(`AnySchema ${b} is loaded but ${_} cannot be resolved`)}async function h(b){let _=await v.call(this,b);if(!this.refs[b])await n.call(this,_.$schema);if(!this.refs[b])this.addSchema(_,b,t)}async function v(b){let _=this._loading[b];if(_)return _;try{return await(this._loading[b]=r(b))}finally{delete this._loading[b]}}}addSchema(e,t,r,i=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,r,i);return this}let n;if(typeof e==="object"){let{schemaId:o}=this.opts;if(n=e[o],n!==void 0&&typeof n!="string")throw Error(`schema ${o} must be string`)}return t=(0,yc.normalizeId)(t||n),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,i,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if(typeof e=="boolean")return!0;let r;if(r=e.$schema,r!==void 0&&typeof r!="string")throw Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(r,e);if(!i&&t){let n="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(n);else throw Error(n)}return i}getSchema(e){let t;while(typeof(t=R4.call(this,e))=="string")e=t;if(t===void 0){let{schemaId:r}=this.opts,i=new gc.SchemaEnv({schema:{},schemaId:r});if(t=gc.resolveSchema.call(this,i,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=R4.call(this,e);if(typeof t=="object")this._cache.delete(t.schema);return delete this.schemas[e],delete this.refs[e],this}case"object":{let t=e;this._cache.delete(t);let r=e[this.opts.schemaId];if(r)r=(0,yc.normalizeId)(r),delete this.schemas[r],delete this.refs[r];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if(typeof e=="string"){if(r=e,typeof t=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r}else if(typeof e=="object"&&t===void 0){if(t=e,r=t.keyword,Array.isArray(r)&&!r.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(KL.call(this,r,t),!t)return(0,n_.eachItem)(r,(n)=>r_.call(this,n)),this;WL.call(this,t);let i={...t,type:(0,jp.getJSONTypes)(t.type),schemaType:(0,jp.getJSONTypes)(t.schemaType)};return(0,n_.eachItem)(r,i.type.length===0?(n)=>r_.call(this,n,i):(n)=>i.type.forEach((o)=>r_.call(this,n,i,o))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t=="object"?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let r of t.rules){let i=r.rules.findIndex((n)=>n.keyword===e);if(i>=0)r.rules.splice(i,1)}return this}addFormat(e,t){if(typeof t=="string")t=new RegExp(t);return this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){if(!e||e.length===0)return"No errors";return e.map((i)=>`${r}${i.instancePath} ${i.message}`).reduce((i,n)=>i+t+n)}$dataMetaSchema(e,t){let r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of t){let n=i.split("/").slice(1),o=e;for(let s of n)o=o[s];for(let s in r){let h=r[s];if(typeof h!="object")continue;let{$data:v}=h.definition,b=o[s];if(v&&b)o[s]=D4(b)}}return e}_removeAllSchemas(e,t){for(let r in e){let i=e[r];if(!t||t.test(r)){if(typeof i=="string")delete e[r];else if(i&&!i.meta)this._cache.delete(i.schema),delete e[r]}}}_addSchema(e,t,r,i=this.opts.validateSchema,n=this.opts.addUsedSchema){let o,{schemaId:s}=this.opts;if(typeof e=="object")o=e[s];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof e!="boolean")throw Error("schema must be object or boolean");let h=this._cache.get(e);if(h!==void 0)return h;r=(0,yc.normalizeId)(o||r);let v=yc.getSchemaRefs.call(this,e,r);if(h=new gc.SchemaEnv({schema:e,schemaId:s,meta:t,baseId:r,localRefs:v}),this._cache.set(h.schema,h),n&&!r.startsWith("#")){if(r)this._checkUnique(r);this.refs[r]=h}if(i)this.validateSchema(e,!0);return h}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta)this._compileMetaSchema(e);else gc.compileSchema.call(this,e);if(!e.validate)throw Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{gc.compileSchema.call(this,e)}finally{this.opts=t}}}Up.ValidationError=PL.default;Up.MissingRefError=C4.default;Ii.default=Up;function A4(e,t,r,i="error"){for(let n in e){let o=n;if(o in t)this.logger[i](`${r}: option ${n}. ${e[o]}`)}}function R4(e){return e=(0,yc.normalizeId)(e),this.schemas[e]||this.refs[e]}function UL(){let e=this.opts.schemas;if(!e)return;if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function LL(){for(let e in this.opts.formats){let t=this.opts.formats[e];if(t)this.addFormat(e,t)}}function FL(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];if(!r.keyword)r.keyword=t;this.addKeyword(r)}}function qL(){let e={...this.opts};for(let t of OL)delete e[t];return e}var BL={log(){},warn(){},error(){}};function HL(e){if(e===!1)return BL;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw Error("logger must implement log, warn and error methods")}var ZL=/^[a-z_$][a-z0-9_$:-]*$/i;function KL(e,t){let{RULES:r}=this;if((0,n_.eachItem)(e,(i)=>{if(r.keywords[i])throw Error(`Keyword ${i} is already defined`);if(!ZL.test(i))throw Error(`Keyword ${i} has invalid name`)}),!t)return;if(t.$data&&!(("code"in t)||("validate"in t)))throw Error('$data keyword must have "code" or "validate" function')}function r_(e,t,r){var i;let n=t===null||t===void 0?void 0:t.post;if(r&&n)throw Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,s=n?o.post:o.rules.find(({type:v})=>v===r);if(!s)s={type:r,rules:[]},o.rules.push(s);if(o.keywords[e]=!0,!t)return;let h={keyword:e,definition:{...t,type:(0,jp.getJSONTypes)(t.type),schemaType:(0,jp.getJSONTypes)(t.schemaType)}};if(t.before)VL.call(this,s,h,t.before);else s.rules.push(h);o.all[e]=h,(i=t.implements)===null||i===void 0||i.forEach((v)=>this.addKeyword(v))}function VL(e,t,r){let i=e.rules.findIndex((n)=>n.keyword===r);if(i>=0)e.rules.splice(i,0,t);else e.rules.push(t),this.logger.warn(`rule ${r} is not defined`)}function WL(e){let{metaSchema:t}=e;if(t===void 0)return;if(e.$data&&this.opts.$data)t=D4(t);e.validateSchema=this.compile(t,!0)}var GL={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function D4(e){return{anyOf:[e,GL]}}});var j4=Xe(function(z4){Object.defineProperty(z4,"__esModule",{value:!0});var YL={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};z4.default=YL});var H4=Xe(function(q4){Object.defineProperty(q4,"__esModule",{value:!0});q4.callRef=q4.getValidate=void 0;var eF=hc(),U4=Rn(),un=gt(),ca=Mi(),L4=Op(),Lp=Mt(),tF={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:i}=e,{baseId:n,schemaEnv:o,validateName:s,opts:h,self:v}=i,{root:b}=o;if((r==="#"||r==="#/")&&n===b.baseId)return g();let _=L4.resolveRef.call(v,b,n,r);if(_===void 0)throw new eF.default(i.opts.uriResolver,n,r);if(_ instanceof L4.SchemaEnv)return S(_);return x(_);function g(){if(o===b)return Fp(e,s,o,o.$async);let M=t.scopeValue("root",{ref:b});return Fp(e,un._`${M}.validate`,b,b.$async)}function S(M){let I=F4(e,M);Fp(e,I,M,M.$async)}function x(M){let I=t.scopeValue("schema",h.code.source===!0?{ref:M,code:(0,un.stringify)(M)}:{ref:M}),$=t.name("valid"),T=e.subschema({schema:M,dataTypes:[],schemaPath:un.nil,topSchemaRef:I,errSchemaPath:r},$);e.mergeEvaluated(T),e.ok($)}}};function F4(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):un._`${r.scopeValue("wrapper",{ref:t})}.validate`}q4.getValidate=F4;function Fp(e,t,r,i){let{gen:n,it:o}=e,{allErrors:s,schemaEnv:h,opts:v}=o,b=v.passContext?ca.default.this:un.nil;if(i)_();else g();function _(){if(!h.$async)throw Error("async schema referenced by sync schema");let M=n.let("valid");n.try(()=>{if(n.code(un._`await ${(0,U4.callValidateCode)(e,t,b)}`),x(t),!s)n.assign(M,!0)},(I)=>{if(n.if(un._`!(${I} instanceof ${o.ValidationError})`,()=>n.throw(I)),S(I),!s)n.assign(M,!1)}),e.ok(M)}function g(){e.result((0,U4.callValidateCode)(e,t,b),()=>x(t),()=>S(t))}function S(M){let I=un._`${M}.errors`;n.assign(ca.default.vErrors,un._`${ca.default.vErrors} === null ? ${I} : ${ca.default.vErrors}.concat(${I})`),n.assign(ca.default.errors,un._`${ca.default.vErrors}.length`)}function x(M){var I;if(!o.opts.unevaluated)return;let $=(I=r===null||r===void 0?void 0:r.validate)===null||I===void 0?void 0:I.evaluated;if(o.props!==!0)if($&&!$.dynamicProps){if($.props!==void 0)o.props=Lp.mergeEvaluated.props(n,$.props,o.props)}else{let T=n.var("props",un._`${M}.evaluated.props`);o.props=Lp.mergeEvaluated.props(n,T,o.props,un.Name)}if(o.items!==!0)if($&&!$.dynamicItems){if($.items!==void 0)o.items=Lp.mergeEvaluated.items(n,$.items,o.items)}else{let T=n.var("items",un._`${M}.evaluated.items`);o.items=Lp.mergeEvaluated.items(n,T,o.items,un.Name)}}}q4.callRef=Fp;q4.default=tF});var K4=Xe(function(Z4){Object.defineProperty(Z4,"__esModule",{value:!0});var iF=j4(),oF=H4(),sF=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",iF.default,oF.default];Z4.default=sF});var W4=Xe(function(V4){Object.defineProperty(V4,"__esModule",{value:!0});var qp=gt(),ao=qp.operators,Bp={maximum:{okStr:"<=",ok:ao.LTE,fail:ao.GT},minimum:{okStr:">=",ok:ao.GTE,fail:ao.LT},exclusiveMaximum:{okStr:"<",ok:ao.LT,fail:ao.GTE},exclusiveMinimum:{okStr:">",ok:ao.GT,fail:ao.LTE}},uF={message:({keyword:e,schemaCode:t})=>qp.str`must be ${Bp[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>qp._`{comparison: ${Bp[e].okStr}, limit: ${t}}`},lF={keyword:Object.keys(Bp),type:"number",schemaType:"number",$data:!0,error:uF,code(e){let{keyword:t,data:r,schemaCode:i}=e;e.fail$data(qp._`${r} ${Bp[t].fail} ${i} || isNaN(${r})`)}};V4.default=lF});var J4=Xe(function(G4){Object.defineProperty(G4,"__esModule",{value:!0});var vc=gt(),dF={message:({schemaCode:e})=>vc.str`must be multiple of ${e}`,params:({schemaCode:e})=>vc._`{multipleOf: ${e}}`},fF={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:dF,code(e){let{gen:t,data:r,schemaCode:i,it:n}=e,o=n.opts.multipleOfPrecision,s=t.let("res"),h=o?vc._`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:vc._`${s} !== parseInt(${s})`;e.fail$data(vc._`(${i} === 0 || (${s} = ${r}/${i}, ${h}))`)}};G4.default=fF});var Q4=Xe(function(Y4){Object.defineProperty(Y4,"__esModule",{value:!0});function X4(e){let t=e.length,r=0,i=0,n;while(i<t)if(r++,n=e.charCodeAt(i++),n>=55296&&n<=56319&&i<t){if(n=e.charCodeAt(i),(n&64512)===56320)i++}return r}Y4.default=X4;X4.code='require("ajv/dist/runtime/ucs2length").default'});var t3=Xe(function(e3){Object.defineProperty(e3,"__esModule",{value:!0});var Jo=gt(),mF=Mt(),gF=Q4(),yF={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return Jo.str`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>Jo._`{limit: ${e}}`},vF={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:yF,code(e){let{keyword:t,data:r,schemaCode:i,it:n}=e,o=t==="maxLength"?Jo.operators.GT:Jo.operators.LT,s=n.opts.unicode===!1?Jo._`${r}.length`:Jo._`${(0,mF.useFunc)(e.gen,gF.default)}(${r})`;e.fail$data(Jo._`${s} ${o} ${i}`)}};e3.default=vF});var n3=Xe(function(r3){Object.defineProperty(r3,"__esModule",{value:!0});var _F=Rn(),wF=Mt(),da=gt(),SF={message:({schemaCode:e})=>da.str`must match pattern "${e}"`,params:({schemaCode:e})=>da._`{pattern: ${e}}`},xF={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:SF,code(e){let{gen:t,data:r,$data:i,schema:n,schemaCode:o,it:s}=e,h=s.opts.unicodeRegExp?"u":"";if(i){let{regExp:v}=s.opts.code,b=v.code==="new RegExp"?da._`new RegExp`:(0,wF.useFunc)(t,v),_=t.let("valid");t.try(()=>t.assign(_,da._`${b}(${o}, ${h}).test(${r})`),()=>t.assign(_,!1)),e.fail$data(da._`!${_}`)}else{let v=(0,_F.usePattern)(e,n);e.fail$data(da._`!${v}.test(${r})`)}}};r3.default=xF});var o3=Xe(function(i3){Object.defineProperty(i3,"__esModule",{value:!0});var bc=gt(),MF={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return bc.str`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>bc._`{limit: ${e}}`},EF={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:MF,code(e){let{keyword:t,data:r,schemaCode:i}=e,n=t==="maxProperties"?bc.operators.GT:bc.operators.LT;e.fail$data(bc._`Object.keys(${r}).length ${n} ${i}`)}};i3.default=EF});var a3=Xe(function(s3){Object.defineProperty(s3,"__esModule",{value:!0});var _c=Rn(),wc=gt(),$F=Mt(),TF={message:({params:{missingProperty:e}})=>wc.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>wc._`{missingProperty: ${e}}`},PF={keyword:"required",type:"object",schemaType:"array",$data:!0,error:TF,code(e){let{gen:t,schema:r,schemaCode:i,data:n,$data:o,it:s}=e,{opts:h}=s;if(!o&&r.length===0)return;let v=r.length>=h.loopRequired;if(s.allErrors)b();else _();if(h.strictRequired){let x=e.parentSchema.properties,{definedProperties:M}=e.it;for(let I of r)if((x===null||x===void 0?void 0:x[I])===void 0&&!M.has(I)){let $=s.schemaEnv.baseId+s.errSchemaPath,T=`required property "${I}" is not defined at "${$}" (strictRequired)`;(0,$F.checkStrictMode)(s,T,s.opts.strictRequired)}}function b(){if(v||o)e.block$data(wc.nil,g);else for(let x of r)(0,_c.checkReportMissingProp)(e,x)}function _(){let x=t.let("missing");if(v||o){let M=t.let("valid",!0);e.block$data(M,()=>S(x,M)),e.ok(M)}else t.if((0,_c.checkMissingProp)(e,r,x)),(0,_c.reportMissingProp)(e,x),t.else()}function g(){t.forOf("prop",i,(x)=>{e.setParams({missingProperty:x}),t.if((0,_c.noPropertyInData)(t,n,x,h.ownProperties),()=>e.error())})}function S(x,M){e.setParams({missingProperty:x}),t.forOf(x,i,()=>{t.assign(M,(0,_c.propertyInData)(t,n,x,h.ownProperties)),t.if((0,wc.not)(M),()=>{e.error(),t.break()})},wc.nil)}}};s3.default=PF});var l3=Xe(function(u3){Object.defineProperty(u3,"__esModule",{value:!0});var Sc=gt(),RF={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return Sc.str`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>Sc._`{limit: ${e}}`},CF={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:RF,code(e){let{keyword:t,data:r,schemaCode:i}=e,n=t==="maxItems"?Sc.operators.GT:Sc.operators.LT;e.fail$data(Sc._`${r}.length ${n} ${i}`)}};u3.default=CF});var Hp=Xe(function(d3){Object.defineProperty(d3,"__esModule",{value:!0});var c3=Fb();c3.code='require("ajv/dist/runtime/equal").default';d3.default=c3});var h3=Xe(function(f3){Object.defineProperty(f3,"__esModule",{value:!0});var i_=uc(),Nr=gt(),NF=Mt(),zF=Hp(),jF={message:({params:{i:e,j:t}})=>Nr.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>Nr._`{i: ${e}, j: ${t}}`},UF={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:jF,code(e){let{gen:t,data:r,$data:i,schema:n,parentSchema:o,schemaCode:s,it:h}=e;if(!i&&!n)return;let v=t.let("valid"),b=o.items?(0,i_.getSchemaTypes)(o.items):[];e.block$data(v,_,Nr._`${s} === false`),e.ok(v);function _(){let M=t.let("i",Nr._`${r}.length`),I=t.let("j");e.setParams({i:M,j:I}),t.assign(v,!0),t.if(Nr._`${M} > 1`,()=>(g()?S:x)(M,I))}function g(){return b.length>0&&!b.some((M)=>M==="object"||M==="array")}function S(M,I){let $=t.name("item"),T=(0,i_.checkDataTypes)(b,$,h.opts.strictNumbers,i_.DataType.Wrong),P=t.const("indices",Nr._`{}`);t.for(Nr._`;${M}--;`,()=>{if(t.let($,Nr._`${r}[${M}]`),t.if(T,Nr._`continue`),b.length>1)t.if(Nr._`typeof ${$} == "string"`,Nr._`${$} += "_"`);t.if(Nr._`typeof ${P}[${$}] == "number"`,()=>{t.assign(I,Nr._`${P}[${$}]`),e.error(),t.assign(v,!1).break()}).code(Nr._`${P}[${$}] = ${M}`)})}function x(M,I){let $=(0,NF.useFunc)(t,zF.default),T=t.name("outer");t.label(T).for(Nr._`;${M}--;`,()=>t.for(Nr._`${I} = ${M}; ${I}--;`,()=>t.if(Nr._`${$}(${r}[${M}], ${r}[${I}])`,()=>{e.error(),t.assign(v,!1).break(T)})))}}};f3.default=UF});var m3=Xe(function(p3){Object.defineProperty(p3,"__esModule",{value:!0});var o_=gt(),FF=Mt(),qF=Hp(),BF={message:"must be equal to constant",params:({schemaCode:e})=>o_._`{allowedValue: ${e}}`},HF={keyword:"const",$data:!0,error:BF,code(e){let{gen:t,data:r,$data:i,schemaCode:n,schema:o}=e;if(i||o&&typeof o=="object")e.fail$data(o_._`!${(0,FF.useFunc)(t,qF.default)}(${r}, ${n})`);else e.fail(o_._`${o} !== ${r}`)}};p3.default=HF});var y3=Xe(function(g3){Object.defineProperty(g3,"__esModule",{value:!0});var xc=gt(),KF=Mt(),VF=Hp(),WF={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>xc._`{allowedValues: ${e}}`},GF={keyword:"enum",schemaType:"array",$data:!0,error:WF,code(e){let{gen:t,data:r,$data:i,schema:n,schemaCode:o,it:s}=e;if(!i&&n.length===0)throw Error("enum must have non-empty array");let h=n.length>=s.opts.loopEnum,v,b=()=>v!==null&&v!==void 0?v:v=(0,KF.useFunc)(t,VF.default),_;if(h||i)_=t.let("valid"),e.block$data(_,g);else{if(!Array.isArray(n))throw Error("ajv implementation error");let x=t.const("vSchema",o);_=(0,xc.or)(...n.map((M,I)=>S(x,I)))}e.pass(_);function g(){t.assign(_,!1),t.forOf("v",o,(x)=>t.if(xc._`${b()}(${r}, ${x})`,()=>t.assign(_,!0).break()))}function S(x,M){let I=n[M];return typeof I==="object"&&I!==null?xc._`${b()}(${r}, ${x}[${M}])`:xc._`${r} === ${I}`}}};g3.default=GF});var b3=Xe(function(v3){Object.defineProperty(v3,"__esModule",{value:!0});var XF=W4(),YF=J4(),QF=t3(),eq=n3(),tq=o3(),rq=a3(),nq=l3(),iq=h3(),oq=m3(),sq=y3(),aq=[XF.default,YF.default,QF.default,eq.default,tq.default,rq.default,nq.default,iq.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},oq.default,sq.default];v3.default=aq});var a_=Xe(function(w3){Object.defineProperty(w3,"__esModule",{value:!0});w3.validateAdditionalItems=void 0;var Xo=gt(),s_=Mt(),lq={message:({params:{len:e}})=>Xo.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>Xo._`{limit: ${e}}`},cq={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:lq,code(e){let{parentSchema:t,it:r}=e,{items:i}=t;if(!Array.isArray(i)){(0,s_.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}_3(e,i)}};function _3(e,t){let{gen:r,schema:i,data:n,keyword:o,it:s}=e;s.items=!0;let h=r.const("len",Xo._`${n}.length`);if(i===!1)e.setParams({len:t.length}),e.pass(Xo._`${h} <= ${t.length}`);else if(typeof i=="object"&&!(0,s_.alwaysValidSchema)(s,i)){let b=r.var("valid",Xo._`${h} <= ${t.length}`);r.if((0,Xo.not)(b),()=>v(b)),e.ok(b)}function v(b){r.forRange("i",t.length,h,(_)=>{if(e.subschema({keyword:o,dataProp:_,dataPropType:s_.Type.Num},b),!s.allErrors)r.if((0,Xo.not)(b),()=>r.break())})}}w3.validateAdditionalItems=_3;w3.default=cq});var u_=Xe(function(M3){Object.defineProperty(M3,"__esModule",{value:!0});M3.validateTuple=void 0;var x3=gt(),Zp=Mt(),fq=Rn(),hq={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return k3(e,"additionalItems",t);if(r.items=!0,(0,Zp.alwaysValidSchema)(r,t))return;e.ok((0,fq.validateArray)(e))}};function k3(e,t,r=e.schema){let{gen:i,parentSchema:n,data:o,keyword:s,it:h}=e;if(_(n),h.opts.unevaluated&&r.length&&h.items!==!0)h.items=Zp.mergeEvaluated.items(i,r.length,h.items);let v=i.name("valid"),b=i.const("len",x3._`${o}.length`);r.forEach((g,S)=>{if((0,Zp.alwaysValidSchema)(h,g))return;i.if(x3._`${b} > ${S}`,()=>e.subschema({keyword:s,schemaProp:S,dataProp:S},v)),e.ok(v)});function _(g){let{opts:S,errSchemaPath:x}=h,M=r.length,I=M===g.minItems&&(M===g.maxItems||g[t]===!1);if(S.strictTuples&&!I){let $=`"${s}" is ${M}-tuple, but minItems or maxItems/${t} are not specified or different at path "${x}"`;(0,Zp.checkStrictMode)(h,$,S.strictTuples)}}}M3.validateTuple=k3;M3.default=hq});var $3=Xe(function(I3){Object.defineProperty(I3,"__esModule",{value:!0});var mq=u_(),gq={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(e)=>(0,mq.validateTuple)(e,"items")};I3.default=gq});var A3=Xe(function(P3){Object.defineProperty(P3,"__esModule",{value:!0});var T3=gt(),vq=Mt(),bq=Rn(),_q=a_(),wq={message:({params:{len:e}})=>T3.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>T3._`{limit: ${e}}`},Sq={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:wq,code(e){let{schema:t,parentSchema:r,it:i}=e,{prefixItems:n}=r;if(i.items=!0,(0,vq.alwaysValidSchema)(i,t))return;if(n)(0,_q.validateAdditionalItems)(e,n);else e.ok((0,bq.validateArray)(e))}};P3.default=Sq});var C3=Xe(function(R3){Object.defineProperty(R3,"__esModule",{value:!0});var Cn=gt(),Kp=Mt(),kq={message:({params:{min:e,max:t}})=>t===void 0?Cn.str`must contain at least ${e} valid item(s)`:Cn.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?Cn._`{minContains: ${e}}`:Cn._`{minContains: ${e}, maxContains: ${t}}`},Mq={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:kq,code(e){let{gen:t,schema:r,parentSchema:i,data:n,it:o}=e,s,h,{minContains:v,maxContains:b}=i;if(o.opts.next)s=v===void 0?1:v,h=b;else s=1;let _=t.const("len",Cn._`${n}.length`);if(e.setParams({min:s,max:h}),h===void 0&&s===0){(0,Kp.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(h!==void 0&&s>h){(0,Kp.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,Kp.alwaysValidSchema)(o,r)){let I=Cn._`${_} >= ${s}`;if(h!==void 0)I=Cn._`${I} && ${_} <= ${h}`;e.pass(I);return}o.items=!0;let g=t.name("valid");if(h===void 0&&s===1)x(g,()=>t.if(g,()=>t.break()));else if(s===0){if(t.let(g,!0),h!==void 0)t.if(Cn._`${n}.length > 0`,S)}else t.let(g,!1),S();e.result(g,()=>e.reset());function S(){let I=t.name("_valid"),$=t.let("count",0);x(I,()=>t.if(I,()=>M($)))}function x(I,$){t.forRange("i",0,_,(T)=>{e.subschema({keyword:"contains",dataProp:T,dataPropType:Kp.Type.Num,compositeRule:!0},I),$()})}function M(I){if(t.code(Cn._`${I}++`),h===void 0)t.if(Cn._`${I} >= ${s}`,()=>t.assign(g,!0).break());else if(t.if(Cn._`${I} > ${h}`,()=>t.assign(g,!1).break()),s===1)t.assign(g,!0);else t.if(Cn._`${I} >= ${s}`,()=>t.assign(g,!0))}}};R3.default=Mq});var U3=Xe(function(N3){Object.defineProperty(N3,"__esModule",{value:!0});N3.validateSchemaDeps=N3.validatePropertyDeps=N3.error=void 0;var l_=gt(),Iq=Mt(),kc=Rn();N3.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let i=t===1?"property":"properties";return l_.str`must have ${i} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:i}})=>l_._`{property: ${e},
|
|
23
|
+
|| ${s} === "boolean" || ${n} === null`).assign(h,pt._`[${n}]`)}}}function qz({gen:e,parentData:t,parentDataProperty:r},i){e.if(pt._`${t} !== undefined`,()=>e.assign(pt._`${t}[${r}]`,i))}function Db(e,t,r,i=oa.Correct){let n=i===oa.Correct?pt.operators.EQ:pt.operators.NEQ,o;switch(e){case"null":return pt._`${t} ${n} null`;case"array":o=pt._`Array.isArray(${t})`;break;case"object":o=pt._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=s(pt._`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=s();break;default:return pt._`typeof ${t} ${n} ${e}`}return i===oa.Correct?o:(0,pt.not)(o);function s(h=pt.nil){return(0,pt.and)(pt._`typeof ${t} == "number"`,h,r?pt._`isFinite(${t})`:pt.nil)}}dM.checkDataType=Db;function Nb(e,t,r,i){if(e.length===1)return Db(e[0],t,r,i);let n,o=(0,uM.toHash)(e);if(o.array&&o.object){let s=pt._`typeof ${t} != "object"`;n=o.null?s:pt._`!${t} || ${s}`,delete o.null,delete o.array,delete o.object}else n=pt.nil;if(o.number)delete o.integer;for(let s in o)n=(0,pt.and)(n,Db(s,t,r,i));return n}dM.checkDataTypes=Nb;var Bz={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?pt._`{type: ${e}}`:pt._`{type: ${t}}`};function zb(e){let t=Hz(e);(0,zz.reportError)(t,Bz)}dM.reportTypeError=zb;function Hz(e){let{gen:t,data:r,schema:i}=e,n=(0,uM.schemaRefOrVal)(e,i,"type");return{gen:t,keyword:"type",data:r,schema:i.type,schemaCode:n,schemaValue:n,parentSchema:i,params:{},it:e}}});var gM=Xe(function(pM){Object.defineProperty(pM,"__esModule",{value:!0});pM.assignDefaults=void 0;var sa=gt(),Xz=Mt();function Yz(e,t){let{properties:r,items:i}=e.schema;if(t==="object"&&r)for(let n in r)hM(e,n,r[n].default);else if(t==="array"&&Array.isArray(i))i.forEach((n,o)=>hM(e,o,n.default))}pM.assignDefaults=Yz;function hM(e,t,r){let{gen:i,compositeRule:n,data:o,opts:s}=e;if(r===void 0)return;let h=sa._`${o}${(0,sa.getProperty)(t)}`;if(n){(0,Xz.checkStrictMode)(e,`default is ignored for: ${h}`);return}let v=sa._`${h} === undefined`;if(s.useDefaults==="empty")v=sa._`${v} || ${h} === null || ${h} === ""`;i.if(v,sa._`${h} = ${(0,sa.stringify)(r)}`)}});var Rn=Xe(function(bM){Object.defineProperty(bM,"__esModule",{value:!0});bM.validateUnion=bM.validateArray=bM.usePattern=bM.callValidateCode=bM.schemaProperties=bM.allSchemaProperties=bM.noPropertyInData=bM.propertyInData=bM.isOwnProperty=bM.hasPropFunc=bM.reportMissingProp=bM.checkMissingProp=bM.checkReportMissingProp=void 0;var Bt=gt(),jb=Mt(),oo=Mi(),Qz=Mt();function ej(e,t){let{gen:r,data:i,it:n}=e;r.if(Lb(r,i,t,n.opts.ownProperties),()=>{e.setParams({missingProperty:Bt._`${t}`},!0),e.error()})}bM.checkReportMissingProp=ej;function tj({gen:e,data:t,it:{opts:r}},i,n){return(0,Bt.or)(...i.map((o)=>(0,Bt.and)(Lb(e,t,o,r.ownProperties),Bt._`${n} = ${o}`)))}bM.checkMissingProp=tj;function rj(e,t){e.setParams({missingProperty:t},!0),e.error()}bM.reportMissingProp=rj;function yM(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:Bt._`Object.prototype.hasOwnProperty`})}bM.hasPropFunc=yM;function Ub(e,t,r){return Bt._`${yM(e)}.call(${t}, ${r})`}bM.isOwnProperty=Ub;function nj(e,t,r,i){let n=Bt._`${t}${(0,Bt.getProperty)(r)} !== undefined`;return i?Bt._`${n} && ${Ub(e,t,r)}`:n}bM.propertyInData=nj;function Lb(e,t,r,i){let n=Bt._`${t}${(0,Bt.getProperty)(r)} === undefined`;return i?(0,Bt.or)(n,(0,Bt.not)(Ub(e,t,r))):n}bM.noPropertyInData=Lb;function vM(e){return e?Object.keys(e).filter((t)=>t!=="__proto__"):[]}bM.allSchemaProperties=vM;function ij(e,t){return vM(t).filter((r)=>!(0,jb.alwaysValidSchema)(e,t[r]))}bM.schemaProperties=ij;function oj({schemaCode:e,data:t,it:{gen:r,topSchemaRef:i,schemaPath:n,errorPath:o},it:s},h,v,b){let _=b?Bt._`${e}, ${t}, ${i}${n}`:t,g=[[oo.default.instancePath,(0,Bt.strConcat)(oo.default.instancePath,o)],[oo.default.parentData,s.parentData],[oo.default.parentDataProperty,s.parentDataProperty],[oo.default.rootData,oo.default.rootData]];if(s.opts.dynamicRef)g.push([oo.default.dynamicAnchors,oo.default.dynamicAnchors]);let S=Bt._`${_}, ${r.object(...g)}`;return v!==Bt.nil?Bt._`${h}.call(${v}, ${S})`:Bt._`${h}(${S})`}bM.callValidateCode=oj;var sj=Bt._`new RegExp`;function aj({gen:e,it:{opts:t}},r){let i=t.unicodeRegExp?"u":"",{regExp:n}=t.code,o=n(r,i);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:Bt._`${n.code==="new RegExp"?sj:(0,Qz.useFunc)(e,n)}(${r}, ${i})`})}bM.usePattern=aj;function uj(e){let{gen:t,data:r,keyword:i,it:n}=e,o=t.name("valid");if(n.allErrors){let h=t.let("valid",!0);return s(()=>t.assign(h,!1)),h}return t.var(o,!0),s(()=>t.break()),o;function s(h){let v=t.const("len",Bt._`${r}.length`);t.forRange("i",0,v,(b)=>{e.subschema({keyword:i,dataProp:b,dataPropType:jb.Type.Num},o),t.if((0,Bt.not)(o),h)})}}bM.validateArray=uj;function lj(e){let{gen:t,schema:r,keyword:i,it:n}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(r.some((v)=>(0,jb.alwaysValidSchema)(n,v))&&!n.opts.unevaluated)return;let s=t.let("valid",!1),h=t.name("_valid");t.block(()=>r.forEach((v,b)=>{let _=e.subschema({keyword:i,schemaProp:b,compositeRule:!0},h);if(t.assign(s,Bt._`${s} || ${h}`),!e.mergeValidEvaluated(_,h))t.if((0,Bt.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}bM.validateUnion=lj});var MM=Xe(function(xM){Object.defineProperty(xM,"__esModule",{value:!0});xM.validateKeywordUsage=xM.validSchemaType=xM.funcKeywordCode=xM.macroKeywordCode=void 0;var Xr=gt(),Vo=Mi(),Sj=Rn(),xj=ac();function kj(e,t){let{gen:r,keyword:i,schema:n,parentSchema:o,it:s}=e,h=t.macro.call(s.self,n,o,s),v=SM(r,i,h);if(s.opts.validateSchema!==!1)s.self.validateSchema(h,!0);let b=r.name("valid");e.subschema({schema:h,schemaPath:Xr.nil,errSchemaPath:`${s.errSchemaPath}/${i}`,topSchemaRef:v,compositeRule:!0},b),e.pass(b,()=>e.error(!0))}xM.macroKeywordCode=kj;function Mj(e,t){var r;let{gen:i,keyword:n,schema:o,parentSchema:s,$data:h,it:v}=e;Ij(v,t);let b=!h&&t.compile?t.compile.call(v.self,o,s,v):t.validate,_=SM(i,n,b),g=i.let("valid");e.block$data(g,S),e.ok((r=t.valid)!==null&&r!==void 0?r:g);function S(){if(t.errors===!1){if(I(),t.modifying)wM(e);$(()=>e.error())}else{let T=t.async?x():M();if(t.modifying)wM(e);$(()=>Ej(e,T))}}function x(){let T=i.let("ruleErrs",null);return i.try(()=>I(Xr._`await `),(P)=>i.assign(g,!1).if(Xr._`${P} instanceof ${v.ValidationError}`,()=>i.assign(T,Xr._`${P}.errors`),()=>i.throw(P))),T}function M(){let T=Xr._`${_}.errors`;return i.assign(T,null),I(Xr.nil),T}function I(T=t.async?Xr._`await `:Xr.nil){let P=v.opts.passContext?Vo.default.this:Vo.default.self,R=!(("compile"in t)&&!h||t.schema===!1);i.assign(g,Xr._`${T}${(0,Sj.callValidateCode)(e,_,P,R)}`,t.modifying)}function $(T){var P;i.if((0,Xr.not)((P=t.valid)!==null&&P!==void 0?P:g),T)}}xM.funcKeywordCode=Mj;function wM(e){let{gen:t,data:r,it:i}=e;t.if(i.parentData,()=>t.assign(r,Xr._`${i.parentData}[${i.parentDataProperty}]`))}function Ej(e,t){let{gen:r}=e;r.if(Xr._`Array.isArray(${t})`,()=>{r.assign(Vo.default.vErrors,Xr._`${Vo.default.vErrors} === null ? ${t} : ${Vo.default.vErrors}.concat(${t})`).assign(Vo.default.errors,Xr._`${Vo.default.vErrors}.length`),(0,xj.extendErrors)(e)},()=>e.error())}function Ij({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}function SM(e,t,r){if(r===void 0)throw Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Xr.stringify)(r)})}function $j(e,t,r=!1){return!t.length||t.some((i)=>i==="array"?Array.isArray(e):i==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==i||r&&typeof e>"u")}xM.validSchemaType=$j;function Tj({schema:e,opts:t,self:r,errSchemaPath:i},n,o){if(Array.isArray(n.keyword)?!n.keyword.includes(o):n.keyword!==o)throw Error("ajv implementation error");let s=n.dependencies;if(s===null||s===void 0?void 0:s.some((h)=>!Object.prototype.hasOwnProperty.call(e,h)))throw Error(`parent schema must have dependencies of ${o}: ${s.join(",")}`);if(n.validateSchema){if(!n.validateSchema(e[o])){let v=`keyword "${o}" value is invalid at path "${i}": `+r.errorsText(n.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(v);else throw Error(v)}}}xM.validateKeywordUsage=Tj});var TM=Xe(function(IM){Object.defineProperty(IM,"__esModule",{value:!0});IM.extendSubschemaMode=IM.extendSubschemaData=IM.getSubschema=void 0;var ti=gt(),EM=Mt();function Cj(e,{keyword:t,schemaProp:r,schema:i,schemaPath:n,errSchemaPath:o,topSchemaRef:s}){if(t!==void 0&&i!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let h=e.schema[t];return r===void 0?{schema:h,schemaPath:ti._`${e.schemaPath}${(0,ti.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:h[r],schemaPath:ti._`${e.schemaPath}${(0,ti.getProperty)(t)}${(0,ti.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,EM.escapeFragment)(r)}`}}if(i!==void 0){if(n===void 0||o===void 0||s===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:n,topSchemaRef:s,errSchemaPath:o}}throw Error('either "keyword" or "schema" must be passed')}IM.getSubschema=Cj;function Oj(e,t,{dataProp:r,dataPropType:i,data:n,dataTypes:o,propertyName:s}){if(n!==void 0&&r!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:h}=t;if(r!==void 0){let{errorPath:b,dataPathArr:_,opts:g}=t,S=h.let("data",ti._`${t.data}${(0,ti.getProperty)(r)}`,!0);v(S),e.errorPath=ti.str`${b}${(0,EM.getErrorPath)(r,i,g.jsPropertySyntax)}`,e.parentDataProperty=ti._`${r}`,e.dataPathArr=[..._,e.parentDataProperty]}if(n!==void 0){let b=n instanceof ti.Name?n:h.let("data",n,!0);if(v(b),s!==void 0)e.propertyName=s}if(o)e.dataTypes=o;function v(b){e.data=b,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,b]}}IM.extendSubschemaData=Oj;function Dj(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:i,createErrors:n,allErrors:o}){if(i!==void 0)e.compositeRule=i;if(n!==void 0)e.createErrors=n;if(o!==void 0)e.allErrors=o;e.jtdDiscriminator=t,e.jtdMetadata=r}IM.extendSubschemaMode=Dj});var Fb=Xe(function(Ebe,PM){PM.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var i,n,o;if(Array.isArray(t)){if(i=t.length,i!=r.length)return!1;for(n=i;n--!==0;)if(!e(t[n],r[n]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(o=Object.keys(t),i=o.length,i!==Object.keys(r).length)return!1;for(n=i;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[n]))return!1;for(n=i;n--!==0;){var s=o[n];if(!e(t[s],r[s]))return!1}return!0}return t!==t&&r!==r}});var RM=Xe(function(Ibe,AM){var so=AM.exports=function(e,t,r){if(typeof t=="function")r=t,t={};r=t.cb||r;var i=typeof r=="function"?r:r.pre||function(){},n=r.post||function(){};Pp(t,i,n,e,"",e)};so.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};so.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};so.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};so.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Pp(e,t,r,i,n,o,s,h,v,b){if(i&&typeof i=="object"&&!Array.isArray(i)){t(i,n,o,s,h,v,b);for(var _ in i){var g=i[_];if(Array.isArray(g)){if(_ in so.arrayKeywords)for(var S=0;S<g.length;S++)Pp(e,t,r,g[S],n+"/"+_+"/"+S,o,n,_,i,S)}else if(_ in so.propsKeywords){if(g&&typeof g=="object")for(var x in g)Pp(e,t,r,g[x],n+"/"+_+"/"+jj(x),o,n,_,i,x)}else if(_ in so.keywords||e.allKeys&&!(_ in so.skipKeywords))Pp(e,t,r,g,n+"/"+_,o,n,_,i)}r(i,n,o,s,h,v,b)}}function jj(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var lc=Xe(function(NM){Object.defineProperty(NM,"__esModule",{value:!0});NM.getSchemaRefs=NM.resolveUrl=NM.normalizeId=NM._getFullPath=NM.getFullPath=NM.inlineRef=void 0;var Uj=Mt(),Lj=Fb(),Fj=RM(),qj=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Bj(e,t=!0){if(typeof e=="boolean")return!0;if(t===!0)return!qb(e);if(!t)return!1;return CM(e)<=t}NM.inlineRef=Bj;var Hj=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function qb(e){for(let t in e){if(Hj.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(qb))return!0;if(typeof r=="object"&&qb(r))return!0}return!1}function CM(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,qj.has(r))continue;if(typeof e[r]=="object")(0,Uj.eachItem)(e[r],(i)=>t+=CM(i));if(t===1/0)return 1/0}return t}function OM(e,t="",r){if(r!==!1)t=aa(t);let i=e.parse(t);return DM(e,i)}NM.getFullPath=OM;function DM(e,t){return e.serialize(t).split("#")[0]+"#"}NM._getFullPath=DM;var Zj=/#\/?$/;function aa(e){return e?e.replace(Zj,""):""}NM.normalizeId=aa;function Kj(e,t,r){return r=aa(r),e.resolve(t,r)}NM.resolveUrl=Kj;var Vj=/^[a-z_][-a-z0-9._]*$/i;function Wj(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:i}=this.opts,n=aa(e[r]||t),o={"":n},s=OM(i,n,!1),h={},v=new Set;return Fj(e,{allKeys:!0},(g,S,x,M)=>{if(M===void 0)return;let I=s+S,$=o[M];if(typeof g[r]=="string")$=T.call(this,g[r]);P.call(this,g.$anchor),P.call(this,g.$dynamicAnchor),o[S]=$;function T(R){let C=this.opts.uriResolver.resolve;if(R=aa($?C($,R):R),v.has(R))throw _(R);v.add(R);let N=this.refs[R];if(typeof N=="string")N=this.refs[N];if(typeof N=="object")b(g,N.schema,R);else if(R!==aa(I))if(R[0]==="#")b(g,h[R],R),h[R]=g;else this.refs[R]=I;return R}function P(R){if(typeof R=="string"){if(!Vj.test(R))throw Error(`invalid anchor "${R}"`);T.call(this,`#${R}`)}}}),h;function b(g,S,x){if(S!==void 0&&!Lj(g,S))throw _(x)}function _(g){return Error(`reference "${g}" resolves to more than one schema`)}}NM.getSchemaRefs=Wj});var fc=Xe(function(YM){Object.defineProperty(YM,"__esModule",{value:!0});YM.getData=YM.KeywordCxt=YM.validateFunctionCode=void 0;var qM=tM(),jM=uc(),Hb=Ob(),Ap=uc(),eU=gM(),dc=MM(),Bb=TM(),nt=gt(),ct=Mi(),tU=lc(),Ei=Mt(),cc=ac();function rU(e){if(ZM(e)){if(KM(e),HM(e)){oU(e);return}}BM(e,()=>(0,qM.topBoolOrEmptySchema)(e))}YM.validateFunctionCode=rU;function BM({gen:e,validateName:t,schema:r,schemaEnv:i,opts:n},o){if(n.code.es5)e.func(t,nt._`${ct.default.data}, ${ct.default.valCxt}`,i.$async,()=>{e.code(nt._`"use strict"; ${UM(r,n)}`),iU(e,n),e.code(o)});else e.func(t,nt._`${ct.default.data}, ${nU(n)}`,i.$async,()=>e.code(UM(r,n)).code(o))}function nU(e){return nt._`{${ct.default.instancePath}="", ${ct.default.parentData}, ${ct.default.parentDataProperty}, ${ct.default.rootData}=${ct.default.data}${e.dynamicRef?nt._`, ${ct.default.dynamicAnchors}={}`:nt.nil}}={}`}function iU(e,t){e.if(ct.default.valCxt,()=>{if(e.var(ct.default.instancePath,nt._`${ct.default.valCxt}.${ct.default.instancePath}`),e.var(ct.default.parentData,nt._`${ct.default.valCxt}.${ct.default.parentData}`),e.var(ct.default.parentDataProperty,nt._`${ct.default.valCxt}.${ct.default.parentDataProperty}`),e.var(ct.default.rootData,nt._`${ct.default.valCxt}.${ct.default.rootData}`),t.dynamicRef)e.var(ct.default.dynamicAnchors,nt._`${ct.default.valCxt}.${ct.default.dynamicAnchors}`)},()=>{if(e.var(ct.default.instancePath,nt._`""`),e.var(ct.default.parentData,nt._`undefined`),e.var(ct.default.parentDataProperty,nt._`undefined`),e.var(ct.default.rootData,ct.default.data),t.dynamicRef)e.var(ct.default.dynamicAnchors,nt._`{}`)})}function oU(e){let{schema:t,opts:r,gen:i}=e;BM(e,()=>{if(r.$comment&&t.$comment)WM(e);if(cU(e),i.let(ct.default.vErrors,null),i.let(ct.default.errors,0),r.unevaluated)sU(e);VM(e),hU(e)});return}function sU(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",nt._`${r}.evaluated`),t.if(nt._`${e.evaluated}.dynamicProps`,()=>t.assign(nt._`${e.evaluated}.props`,nt._`undefined`)),t.if(nt._`${e.evaluated}.dynamicItems`,()=>t.assign(nt._`${e.evaluated}.items`,nt._`undefined`))}function UM(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?nt._`/*# sourceURL=${r} */`:nt.nil}function aU(e,t){if(ZM(e)){if(KM(e),HM(e)){uU(e,t);return}}(0,qM.boolOrEmptySchema)(e,t)}function HM({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function ZM(e){return typeof e.schema!="boolean"}function uU(e,t){let{schema:r,gen:i,opts:n}=e;if(n.$comment&&r.$comment)WM(e);dU(e),fU(e);let o=i.const("_errs",ct.default.errors);VM(e,o),i.var(t,nt._`${o} === ${ct.default.errors}`)}function KM(e){(0,Ei.checkUnknownRules)(e),lU(e)}function VM(e,t){if(e.opts.jtd)return LM(e,[],!1,t);let r=(0,jM.getSchemaTypes)(e.schema),i=(0,jM.coerceAndCheckDataType)(e,r);LM(e,r,!i,t)}function lU(e){let{schema:t,errSchemaPath:r,opts:i,self:n}=e;if(t.$ref&&i.ignoreKeywordsWithRef&&(0,Ei.schemaHasRulesButRef)(t,n.RULES))n.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function cU(e){let{schema:t,opts:r}=e;if(t.default!==void 0&&r.useDefaults&&r.strictSchema)(0,Ei.checkStrictMode)(e,"default is ignored in the schema root")}function dU(e){let t=e.schema[e.opts.schemaId];if(t)e.baseId=(0,tU.resolveUrl)(e.opts.uriResolver,e.baseId,t)}function fU(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}function WM({gen:e,schemaEnv:t,schema:r,errSchemaPath:i,opts:n}){let o=r.$comment;if(n.$comment===!0)e.code(nt._`${ct.default.self}.logger.log(${o})`);else if(typeof n.$comment=="function"){let s=nt.str`${i}/$comment`,h=e.scopeValue("root",{ref:t.root});e.code(nt._`${ct.default.self}.opts.$comment(${o}, ${s}, ${h}.schema)`)}}function hU(e){let{gen:t,schemaEnv:r,validateName:i,ValidationError:n,opts:o}=e;if(r.$async)t.if(nt._`${ct.default.errors} === 0`,()=>t.return(ct.default.data),()=>t.throw(nt._`new ${n}(${ct.default.vErrors})`));else{if(t.assign(nt._`${i}.errors`,ct.default.vErrors),o.unevaluated)pU(e);t.return(nt._`${ct.default.errors} === 0`)}}function pU({gen:e,evaluated:t,props:r,items:i}){if(r instanceof nt.Name)e.assign(nt._`${t}.props`,r);if(i instanceof nt.Name)e.assign(nt._`${t}.items`,i)}function LM(e,t,r,i){let{gen:n,schema:o,data:s,allErrors:h,opts:v,self:b}=e,{RULES:_}=b;if(o.$ref&&(v.ignoreKeywordsWithRef||!(0,Ei.schemaHasRulesButRef)(o,_))){n.block(()=>JM(e,"$ref",_.all.$ref.definition));return}if(!v.jtd)mU(e,t);n.block(()=>{for(let S of _.rules)g(S);g(_.post)});function g(S){if(!(0,Hb.shouldUseGroup)(o,S))return;if(S.type){if(n.if((0,Ap.checkDataType)(S.type,s,v.strictNumbers)),FM(e,S),t.length===1&&t[0]===S.type&&r)n.else(),(0,Ap.reportTypeError)(e);n.endIf()}else FM(e,S);if(!h)n.if(nt._`${ct.default.errors} === ${i||0}`)}}function FM(e,t){let{gen:r,schema:i,opts:{useDefaults:n}}=e;if(n)(0,eU.assignDefaults)(e,t.type);r.block(()=>{for(let o of t.rules)if((0,Hb.shouldUseRule)(i,o))JM(e,o.keyword,o.definition,t.type)})}function mU(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;if(gU(e,t),!e.opts.allowUnionTypes)yU(e,t);vU(e,e.dataTypes)}function gU(e,t){if(!t.length)return;if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach((r)=>{if(!GM(e.dataTypes,r))Zb(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),_U(e,t)}function yU(e,t){if(t.length>1&&!(t.length===2&&t.includes("null")))Zb(e,"use allowUnionTypes to allow union type keyword")}function vU(e,t){let r=e.self.RULES.all;for(let i in r){let n=r[i];if(typeof n=="object"&&(0,Hb.shouldUseRule)(e.schema,n)){let{type:o}=n.definition;if(o.length&&!o.some((s)=>bU(t,s)))Zb(e,`missing type "${o.join(",")}" for keyword "${i}"`)}}}function bU(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function GM(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function _U(e,t){let r=[];for(let i of e.dataTypes)if(GM(t,i))r.push(i);else if(t.includes("integer")&&i==="number")r.push("integer");e.dataTypes=r}function Zb(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,Ei.checkStrictMode)(e,t,e.opts.strictTypes)}class Kb{constructor(e,t,r){if((0,dc.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Ei.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",XM(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,dc.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);if("code"in t?t.trackErrors:t.errors!==!1)this.errsCount=e.gen.const("_errs",ct.default.errors)}result(e,t,r){this.failResult((0,nt.not)(e),t,r)}failResult(e,t,r){if(this.gen.if(e),r)r();else this.error();if(t){if(this.gen.else(),t(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(e,t){this.failResult((0,nt.not)(e),void 0,t)}fail(e){if(e===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(e),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail(nt._`${t} !== undefined && (${(0,nt.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,t){(e?cc.reportExtraError:cc.reportError)(this,this.def.error,t)}$dataError(){(0,cc.reportError)(this,this.def.$dataError||cc.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,cc.resetErrorsCount)(this.gen,this.errsCount)}ok(e){if(!this.allErrors)this.gen.if(e)}setParams(e,t){if(t)Object.assign(this.params,e);else this.params=e}block$data(e,t,r=nt.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=nt.nil,t=nt.nil){if(!this.$data)return;let{gen:r,schemaCode:i,schemaType:n,def:o}=this;if(r.if((0,nt.or)(nt._`${i} === undefined`,t)),e!==nt.nil)r.assign(e,!0);if(n.length||o.validateSchema){if(r.elseIf(this.invalid$data()),this.$dataError(),e!==nt.nil)r.assign(e,!1)}r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:i,it:n}=this;return(0,nt.or)(o(),s());function o(){if(r.length){if(!(t instanceof nt.Name))throw Error("ajv implementation error");let h=Array.isArray(r)?r:[r];return nt._`${(0,Ap.checkDataTypes)(h,t,n.opts.strictNumbers,Ap.DataType.Wrong)}`}return nt.nil}function s(){if(i.validateSchema){let h=e.scopeValue("validate$data",{ref:i.validateSchema});return nt._`!${h}(${t})`}return nt.nil}}subschema(e,t){let r=(0,Bb.getSubschema)(this.it,e);(0,Bb.extendSubschemaData)(r,this.it,e),(0,Bb.extendSubschemaMode)(r,e);let i={...this.it,...r,items:void 0,props:void 0};return aU(i,t),i}mergeEvaluated(e,t){let{it:r,gen:i}=this;if(!r.opts.unevaluated)return;if(r.props!==!0&&e.props!==void 0)r.props=Ei.mergeEvaluated.props(i,e.props,r.props,t);if(r.items!==!0&&e.items!==void 0)r.items=Ei.mergeEvaluated.items(i,e.items,r.items,t)}mergeValidEvaluated(e,t){let{it:r,gen:i}=this;if(r.opts.unevaluated&&(r.props!==!0||r.items!==!0))return i.if(t,()=>this.mergeEvaluated(e,nt.Name)),!0}}YM.KeywordCxt=Kb;function JM(e,t,r,i){let n=new Kb(e,r,t);if("code"in r)r.code(n,i);else if(n.$data&&r.validate)(0,dc.funcKeywordCode)(n,r);else if("macro"in r)(0,dc.macroKeywordCode)(n,r);else if(r.compile||r.validate)(0,dc.funcKeywordCode)(n,r)}var wU=/^\/(?:[^~]|~0|~1)*$/,SU=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function XM(e,{dataLevel:t,dataNames:r,dataPathArr:i}){let n,o;if(e==="")return ct.default.rootData;if(e[0]==="/"){if(!wU.test(e))throw Error(`Invalid JSON-pointer: ${e}`);n=e,o=ct.default.rootData}else{let b=SU.exec(e);if(!b)throw Error(`Invalid JSON-pointer: ${e}`);let _=+b[1];if(n=b[2],n==="#"){if(_>=t)throw Error(v("property/index",_));return i[t-_]}if(_>t)throw Error(v("data",_));if(o=r[t-_],!n)return o}let s=o,h=n.split("/");for(let b of h)if(b)o=nt._`${o}${(0,nt.getProperty)((0,Ei.unescapeJsonPointer)(b))}`,s=nt._`${s} && ${o}`;return s;function v(b,_){return`Cannot access ${b} ${_} levels up, current level is ${t}`}}YM.getData=XM});var Rp=Xe(function(t4){Object.defineProperty(t4,"__esModule",{value:!0});class e4 extends Error{constructor(e){super("validation failed");this.errors=e,this.ajv=this.validation=!0}}t4.default=e4});var hc=Xe(function(n4){Object.defineProperty(n4,"__esModule",{value:!0});var Vb=lc();class r4 extends Error{constructor(e,t,r,i){super(i||`can't resolve reference ${r} from id ${t}`);this.missingRef=(0,Vb.resolveUrl)(e,t,r),this.missingSchema=(0,Vb.normalizeId)((0,Vb.getFullPath)(e,this.missingRef))}}n4.default=r4});var Op=Xe(function(s4){Object.defineProperty(s4,"__esModule",{value:!0});s4.resolveSchema=s4.getCompilingSchema=s4.resolveRef=s4.compileSchema=s4.SchemaEnv=void 0;var Hn=gt(),IU=Rp(),Wo=Mi(),Zn=lc(),i4=Mt(),$U=fc();class pc{constructor(e){var t;this.refs={},this.dynamicAnchors={};let r;if(typeof e.schema=="object")r=e.schema;this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(t=e.baseId)!==null&&t!==void 0?t:(0,Zn.normalizeId)(r===null||r===void 0?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=r===null||r===void 0?void 0:r.$async,this.refs={}}}s4.SchemaEnv=pc;function Gb(e){let t=o4.call(this,e);if(t)return t;let r=(0,Zn.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:i,lines:n}=this.opts.code,{ownProperties:o}=this.opts,s=new Hn.CodeGen(this.scope,{es5:i,lines:n,ownProperties:o}),h;if(e.$async)h=s.scopeValue("Error",{ref:IU.default,code:Hn._`require("ajv/dist/runtime/validation_error").default`});let v=s.scopeName("validate");e.validateName=v;let b={gen:s,allErrors:this.opts.allErrors,data:Wo.default.data,parentData:Wo.default.parentData,parentDataProperty:Wo.default.parentDataProperty,dataNames:[Wo.default.data],dataPathArr:[Hn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Hn.stringify)(e.schema)}:{ref:e.schema}),validateName:v,ValidationError:h,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Hn.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:Hn._`""`,opts:this.opts,self:this},_;try{this._compilations.add(e),(0,$U.validateFunctionCode)(b),s.optimize(this.opts.code.optimize);let g=s.toString();if(_=`${s.scopeRefs(Wo.default.scope)}return ${g}`,this.opts.code.process)_=this.opts.code.process(_,e);let x=Function(`${Wo.default.self}`,`${Wo.default.scope}`,_)(this,this.scope.get());if(this.scope.value(v,{ref:x}),x.errors=null,x.schema=e.schema,x.schemaEnv=e,e.$async)x.$async=!0;if(this.opts.code.source===!0)x.source={validateName:v,validateCode:g,scopeValues:s._values};if(this.opts.unevaluated){let{props:M,items:I}=b;if(x.evaluated={props:M instanceof Hn.Name?void 0:M,items:I instanceof Hn.Name?void 0:I,dynamicProps:M instanceof Hn.Name,dynamicItems:I instanceof Hn.Name},x.source)x.source.evaluated=(0,Hn.stringify)(x.evaluated)}return e.validate=x,e}catch(g){if(delete e.validate,delete e.validateName,_)this.logger.error("Error compiling schema, function code:",_);throw g}finally{this._compilations.delete(e)}}s4.compileSchema=Gb;function TU(e,t,r){var i;r=(0,Zn.resolveUrl)(this.opts.uriResolver,t,r);let n=e.refs[r];if(n)return n;let o=RU.call(this,e,r);if(o===void 0){let s=(i=e.localRefs)===null||i===void 0?void 0:i[r],{schemaId:h}=this.opts;if(s)o=new pc({schema:s,schemaId:h,root:e,baseId:t})}if(o===void 0)return;return e.refs[r]=PU.call(this,o)}s4.resolveRef=TU;function PU(e){if((0,Zn.inlineRef)(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:Gb.call(this,e)}function o4(e){for(let t of this._compilations)if(AU(t,e))return t}s4.getCompilingSchema=o4;function AU(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function RU(e,t){let r;while(typeof(r=this.refs[t])=="string")t=r;return r||this.schemas[t]||Cp.call(this,e,t)}function Cp(e,t){let r=this.opts.uriResolver.parse(t),i=(0,Zn._getFullPath)(this.opts.uriResolver,r),n=(0,Zn.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&i===n)return Wb.call(this,r,e);let o=(0,Zn.normalizeId)(i),s=this.refs[o]||this.schemas[o];if(typeof s=="string"){let h=Cp.call(this,e,s);if(typeof(h===null||h===void 0?void 0:h.schema)!=="object")return;return Wb.call(this,r,h)}if(typeof(s===null||s===void 0?void 0:s.schema)!=="object")return;if(!s.validate)Gb.call(this,s);if(o===(0,Zn.normalizeId)(t)){let{schema:h}=s,{schemaId:v}=this.opts,b=h[v];if(b)n=(0,Zn.resolveUrl)(this.opts.uriResolver,n,b);return new pc({schema:h,schemaId:v,root:e,baseId:n})}return Wb.call(this,r,s)}s4.resolveSchema=Cp;var CU=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Wb(e,{baseId:t,schema:r,root:i}){var n;if(((n=e.fragment)===null||n===void 0?void 0:n[0])!=="/")return;for(let h of e.fragment.slice(1).split("/")){if(typeof r==="boolean")return;let v=r[(0,i4.unescapeFragment)(h)];if(v===void 0)return;r=v;let b=typeof r==="object"&&r[this.opts.schemaId];if(!CU.has(h)&&b)t=(0,Zn.resolveUrl)(this.opts.uriResolver,t,b)}let o;if(typeof r!="boolean"&&r.$ref&&!(0,i4.schemaHasRulesButRef)(r,this.RULES)){let h=(0,Zn.resolveUrl)(this.opts.uriResolver,t,r.$ref);o=Cp.call(this,i,h)}let{schemaId:s}=this.opts;if(o=o||new pc({schema:r,schemaId:s,root:i,baseId:t}),o.schema!==o.root.schema)return o;return}});var u4=Xe(function(Cbe,jU){jU.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var Yb=Xe(function(Obe,p4){var UU=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),c4=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),Jb=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),d4=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),LU=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Xb(e){let t="",r=0,i=0;for(i=0;i<e.length;i++){if(r=e[i].charCodeAt(0),r===48)continue;if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[i];break}for(i+=1;i<e.length;i++){if(r=e[i].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[i]}return t}var FU=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function l4(e){return e.length=0,!0}function qU(e,t,r){if(e.length){let i=Xb(e);if(i!=="")t.push(i);else return r.error=!0,!1;e.length=0}return!0}function BU(e){let t=0,r={error:!1,address:"",zone:""},i=[],n=[],o=!1,s=!1,h=qU;for(let v=0;v<e.length;v++){let b=e[v];if(b==="["||b==="]")continue;if(b===":"){if(o===!0)s=!0;if(!h(n,i,r))break;if(++t>7){r.error=!0;break}if(v>0&&e[v-1]===":")o=!0;i.push(":");continue}else if(b==="%"){if(!h(n,i,r))break;h=l4}else{n.push(b);continue}}if(n.length)if(h===l4)r.zone=n.join("");else if(s)i.push(n.join(""));else i.push(Xb(n));return r.address=i.join(""),r}function f4(e){if(HU(e,":")<2)return{host:e,isIPV6:!1};let t=BU(e);if(!t.error){let{address:r,address:i}=t;if(t.zone)r+="%"+t.zone,i+="%25"+t.zone;return{host:r,isIPV6:!0,escapedHost:i}}else return{host:e,isIPV6:!1}}function HU(e,t){let r=0;for(let i=0;i<e.length;i++)if(e[i]===t)r++;return r}function ZU(e){let t=e,r=[],i=-1,n=0;while(n=t.length){if(n===1)if(t===".")break;else if(t==="/"){r.push("/");break}else{r.push(t);break}else if(n===2){if(t[0]==="."){if(t[1]===".")break;else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."||t[1]==="/"){r.push("/");break}}}else if(n===3){if(t==="/.."){if(r.length!==0)r.pop();r.push("/");break}}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."){if(t[3]==="/"){if(t=t.slice(3),r.length!==0)r.pop();continue}}}}if((i=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,i)),t=t.slice(i)}return r.join("")}var KU={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},VU=/[@/?#:]/g,WU=/[@/?#]/g;function h4(e,t){let r=t?WU:VU;return r.lastIndex=0,e.replace(r,(i)=>KU[i])}function GU(e,t=!1){if(e.indexOf("%")===-1)return e;let r="";for(let i=0;i<e.length;i++){if(e[i]==="%"&&i+2<e.length){let n=e.slice(i+1,i+3);if(Jb(n)){let o=n.toUpperCase(),s=String.fromCharCode(parseInt(o,16));if(t&&d4(s))r+=s;else r+="%"+o;i+=2;continue}}r+=e[i]}return r}function JU(e){let t="";for(let r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){let i=e.slice(r+1,r+3);if(Jb(i)){let n=i.toUpperCase(),o=String.fromCharCode(parseInt(n,16));if(o!=="."&&d4(o))t+=o;else t+="%"+n;r+=2;continue}}if(LU(e[r]))t+=e[r];else t+=escape(e[r])}return t}function XU(e){let t="";for(let r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){let i=e.slice(r+1,r+3);if(Jb(i)){t+="%"+i.toUpperCase(),r+=2;continue}}t+=escape(e[r])}return t}function YU(e){let t=[];if(e.userinfo!==void 0)t.push(e.userinfo),t.push("@");if(e.host!==void 0){let r=unescape(e.host);if(!c4(r)){let i=f4(r);if(i.isIPV6===!0)r=`[${i.escapedHost}]`;else r=h4(r,!1)}t.push(r)}if(typeof e.port==="number"||typeof e.port==="string")t.push(":"),t.push(String(e.port));return t.length?t.join(""):void 0}p4.exports={nonSimpleDomain:FU,recomposeAuthority:YU,reescapeHostDelimiters:h4,normalizePercentEncoding:GU,normalizePathEncoding:JU,escapePreservingEscapes:XU,removeDotSegments:ZU,isIPv4:c4,isUUID:UU,normalizeIPv6:f4,stringArrayToHexStripped:Xb}});var b4=Xe(function(Dbe,v4){var{isUUID:QU}=Yb(),eL=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,tL=["http","https","ws","wss","urn","urn:uuid"];function rL(e){return tL.indexOf(e)!==-1}function Qb(e){if(e.secure===!0)return!0;else if(e.secure===!1)return!1;else if(e.scheme)return e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S");else return!1}function m4(e){if(!e.host)e.error=e.error||"HTTP URIs must have a host.";return e}function g4(e){let t=String(e.scheme).toLowerCase()==="https";if(e.port===(t?443:80)||e.port==="")e.port=void 0;if(!e.path)e.path="/";return e}function nL(e){return e.secure=Qb(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function iL(e){if(e.port===(Qb(e)?443:80)||e.port==="")e.port=void 0;if(typeof e.secure==="boolean")e.scheme=e.secure?"wss":"ws",e.secure=void 0;if(e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}function oL(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(eL);if(r){let i=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let n=`${i}:${t.nid||e.nid}`,o=e_(n);if(e.path=void 0,o)e=o.parse(e,t)}else e.error=e.error||"URN can not be parsed.";return e}function sL(e,t){if(e.nid===void 0)throw Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",i=e.nid.toLowerCase(),n=`${r}:${t.nid||i}`,o=e_(n);if(o)e=o.serialize(e,t);let s=e,h=e.nss;return s.path=`${i||t.nid}:${h}`,t.skipEscape=!0,s}function aL(e,t){let r=e;if(r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!QU(r.uuid)))r.error=r.error||"UUID is not valid.";return r}function uL(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var y4={scheme:"http",domainHost:!0,parse:m4,serialize:g4},lL={scheme:"https",domainHost:y4.domainHost,parse:m4,serialize:g4},Dp={scheme:"ws",domainHost:!0,parse:nL,serialize:iL},cL={scheme:"wss",domainHost:Dp.domainHost,parse:Dp.parse,serialize:Dp.serialize},dL={scheme:"urn",parse:oL,serialize:sL,skipNormalize:!0},fL={scheme:"urn:uuid",parse:aL,serialize:uL,skipNormalize:!0},Np={http:y4,https:lL,ws:Dp,wss:cL,urn:dL,"urn:uuid":fL};Object.setPrototypeOf(Np,null);function e_(e){return e&&(Np[e]||Np[e.toLowerCase()])||void 0}v4.exports={wsIsSecure:Qb,SCHEMES:Np,isValidSchemeName:rL,getSchemeHandler:e_}});var M4=Xe(function(Nbe,zp){var{normalizeIPv6:hL,removeDotSegments:mc,recomposeAuthority:pL,normalizePercentEncoding:mL,normalizePathEncoding:gL,escapePreservingEscapes:yL,reescapeHostDelimiters:vL,isIPv4:bL,nonSimpleDomain:_L}=Yb(),{SCHEMES:wL,getSchemeHandler:w4}=b4();function SL(e,t){if(typeof e==="string")e=IL(e,t);else if(typeof e==="object")e=ua(Go(e,t),t);return e}function xL(e,t,r){let i=r?Object.assign({scheme:"null"},r):{scheme:"null"},n=S4(ua(e,i),ua(t,i),i,!0);return i.skipEscape=!0,Go(n,i)}function S4(e,t,r,i){let n={};if(!i)e=ua(Go(e,r),r),t=ua(Go(t,r),r);if(r=r||{},!r.tolerant&&t.scheme)n.scheme=t.scheme,n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=mc(t.path||""),n.query=t.query;else{if(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=mc(t.path||""),n.query=t.query;else{if(!t.path)if(n.path=e.path,t.query!==void 0)n.query=t.query;else n.query=e.query;else{if(t.path[0]==="/")n.path=mc(t.path);else{if((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path)n.path="/"+t.path;else if(!e.path)n.path=t.path;else n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path;n.path=mc(n.path)}n.query=t.query}n.userinfo=e.userinfo,n.host=e.host,n.port=e.port}n.scheme=e.scheme}return n.fragment=t.fragment,n}function kL(e,t,r){let i=_4(e,r),n=_4(t,r);return i!==void 0&&n!==void 0&&i.toLowerCase()===n.toLowerCase()}function Go(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},i=Object.assign({},t),n=[],o=w4(i.scheme||r.scheme);if(o&&o.serialize)o.serialize(r,i);if(r.path!==void 0)if(!i.skipEscape){if(r.path=yL(r.path),r.scheme!==void 0)r.path=r.path.split("%3A").join(":")}else r.path=mL(r.path);if(i.reference!=="suffix"&&r.scheme)n.push(r.scheme,":");let s=pL(r);if(s!==void 0){if(i.reference!=="suffix")n.push("//");if(n.push(s),r.path&&r.path[0]!=="/")n.push("/")}if(r.path!==void 0){let h=r.path;if(!i.absolutePath&&(!o||!o.absolutePath))h=mc(h);if(s===void 0&&h[0]==="/"&&h[1]==="/")h="/%2F"+h.slice(2);n.push(h)}if(r.query!==void 0)n.push("?",r.query);if(r.fragment!==void 0)n.push("#",r.fragment);return n.join("")}var ML=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function EL(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof e.port==="number"&&(e.port<0||e.port>65535))return"URI port is malformed.";return}function x4(e,t){let r=Object.assign({},t),i={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},n=!1,o=!1;if(r.reference==="suffix")if(r.scheme)e=r.scheme+":"+e;else e="//"+e;let s=e.match(ML);if(s){if(i.scheme=s[1],i.userinfo=s[3],i.host=s[4],i.port=parseInt(s[5],10),i.path=s[6]||"",i.query=s[7],i.fragment=s[8],isNaN(i.port))i.port=s[5];let h=EL(i,s);if(h!==void 0)i.error=i.error||h,n=!0;if(i.host)if(bL(i.host)===!1){let _=hL(i.host);i.host=_.host.toLowerCase(),o=_.isIPV6}else o=!0;if(i.scheme===void 0&&i.userinfo===void 0&&i.host===void 0&&i.port===void 0&&i.query===void 0&&!i.path)i.reference="same-document";else if(i.scheme===void 0)i.reference="relative";else if(i.fragment===void 0)i.reference="absolute";else i.reference="uri";if(r.reference&&r.reference!=="suffix"&&r.reference!==i.reference)i.error=i.error||"URI is not a "+r.reference+" reference.";let v=w4(r.scheme||i.scheme);if(!r.unicodeSupport&&(!v||!v.unicodeSupport)){if(i.host&&(r.domainHost||v&&v.domainHost)&&o===!1&&_L(i.host))try{i.host=URL.domainToASCII(i.host.toLowerCase())}catch(b){i.error=i.error||"Host's domain name can not be converted to ASCII: "+b}}if(!v||v&&!v.skipNormalize){if(e.indexOf("%")!==-1){if(i.scheme!==void 0)i.scheme=unescape(i.scheme);if(i.host!==void 0)i.host=vL(unescape(i.host),o)}if(i.path)i.path=gL(i.path);if(i.fragment)try{i.fragment=encodeURI(decodeURIComponent(i.fragment))}catch{i.error=i.error||"URI malformed"}}if(v&&v.parse)v.parse(i,r)}else i.error=i.error||"URI can not be parsed.";return{parsed:i,malformedAuthorityOrPort:n}}function ua(e,t){return x4(e,t).parsed}function IL(e,t){return k4(e,t).normalized}function k4(e,t){let{parsed:r,malformedAuthorityOrPort:i}=x4(e,t);return{normalized:i?e:Go(r,t),malformedAuthorityOrPort:i}}function _4(e,t){if(typeof e==="string"){let{normalized:r,malformedAuthorityOrPort:i}=k4(e,t);return i?void 0:r}if(typeof e==="object")return Go(e,t)}var t_={SCHEMES:wL,normalize:SL,resolve:xL,resolveComponent:S4,equal:kL,serialize:Go,parse:ua};zp.exports=t_;zp.exports.default=t_;zp.exports.fastUri=t_});var $4=Xe(function(I4){Object.defineProperty(I4,"__esModule",{value:!0});var E4=M4();E4.code='require("ajv/dist/runtime/uri").default';I4.default=E4});var N4=Xe(function(Ii){Object.defineProperty(Ii,"__esModule",{value:!0});Ii.CodeGen=Ii.Name=Ii.nil=Ii.stringify=Ii.str=Ii._=Ii.KeywordCxt=void 0;var TL=fc();Object.defineProperty(Ii,"KeywordCxt",{enumerable:!0,get:function(){return TL.KeywordCxt}});var la=gt();Object.defineProperty(Ii,"_",{enumerable:!0,get:function(){return la._}});Object.defineProperty(Ii,"str",{enumerable:!0,get:function(){return la.str}});Object.defineProperty(Ii,"stringify",{enumerable:!0,get:function(){return la.stringify}});Object.defineProperty(Ii,"nil",{enumerable:!0,get:function(){return la.nil}});Object.defineProperty(Ii,"Name",{enumerable:!0,get:function(){return la.Name}});Object.defineProperty(Ii,"CodeGen",{enumerable:!0,get:function(){return la.CodeGen}});var PL=Rp(),C4=hc(),AL=Cb(),gc=Op(),RL=gt(),yc=lc(),jp=uc(),n_=Mt(),T4=u4(),CL=$4(),O4=(e,t)=>new RegExp(e,t);O4.code="new RegExp";var OL=["removeAdditional","useDefaults","coerceTypes"],DL=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),NL={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},zL={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},P4=200;function jL(e){var t,r,i,n,o,s,h,v,b,_,g,S,x,M,I,$,T,P,R,C,N,B,ie,le,ue;let F=e.strict,ee=(t=e.code)===null||t===void 0?void 0:t.optimize,a=ee===!0||ee===void 0?1:ee||0,c=(i=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&i!==void 0?i:O4,f=(n=e.uriResolver)!==null&&n!==void 0?n:CL.default;return{strictSchema:(s=(o=e.strictSchema)!==null&&o!==void 0?o:F)!==null&&s!==void 0?s:!0,strictNumbers:(v=(h=e.strictNumbers)!==null&&h!==void 0?h:F)!==null&&v!==void 0?v:!0,strictTypes:(_=(b=e.strictTypes)!==null&&b!==void 0?b:F)!==null&&_!==void 0?_:"log",strictTuples:(S=(g=e.strictTuples)!==null&&g!==void 0?g:F)!==null&&S!==void 0?S:"log",strictRequired:(M=(x=e.strictRequired)!==null&&x!==void 0?x:F)!==null&&M!==void 0?M:!1,code:e.code?{...e.code,optimize:a,regExp:c}:{optimize:a,regExp:c},loopRequired:(I=e.loopRequired)!==null&&I!==void 0?I:P4,loopEnum:($=e.loopEnum)!==null&&$!==void 0?$:P4,meta:(T=e.meta)!==null&&T!==void 0?T:!0,messages:(P=e.messages)!==null&&P!==void 0?P:!0,inlineRefs:(R=e.inlineRefs)!==null&&R!==void 0?R:!0,schemaId:(C=e.schemaId)!==null&&C!==void 0?C:"$id",addUsedSchema:(N=e.addUsedSchema)!==null&&N!==void 0?N:!0,validateSchema:(B=e.validateSchema)!==null&&B!==void 0?B:!0,validateFormats:(ie=e.validateFormats)!==null&&ie!==void 0?ie:!0,unicodeRegExp:(le=e.unicodeRegExp)!==null&&le!==void 0?le:!0,int32range:(ue=e.int32range)!==null&&ue!==void 0?ue:!0,uriResolver:f}}class Up{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...jL(e)};let{es5:t,lines:r}=this.opts.code;this.scope=new RL.ValueScope({scope:{},prefixes:DL,es5:t,lines:r}),this.logger=HL(e.logger);let i=e.validateFormats;if(e.validateFormats=!1,this.RULES=(0,AL.getRules)(),A4.call(this,NL,e,"NOT SUPPORTED"),A4.call(this,zL,e,"DEPRECATED","warn"),this._metaOpts=qL.call(this),e.formats)LL.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords)FL.call(this,e.keywords);if(typeof e.meta=="object")this.addMetaSchema(e.meta);UL.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,i=T4;if(r==="id")i={...T4},i.id=i.$id,delete i.$id;if(t&&e)this.addMetaSchema(i,i[r],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[t]||e:void 0}validate(e,t){let r;if(typeof e=="string"){if(r=this.getSchema(e),!r)throw Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let i=r(t);if(!("$async"in r))this.errors=r.errors;return i}compile(e,t){let r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return i.call(this,e,t);async function i(b,_){await n.call(this,b.$schema);let g=this._addSchema(b,_);return g.validate||o.call(this,g)}async function n(b){if(b&&!this.getSchema(b))await i.call(this,{$ref:b},!0)}async function o(b){try{return this._compileSchemaEnv(b)}catch(_){if(!(_ instanceof C4.default))throw _;return s.call(this,_),await h.call(this,_.missingSchema),o.call(this,b)}}function s({missingSchema:b,missingRef:_}){if(this.refs[b])throw Error(`AnySchema ${b} is loaded but ${_} cannot be resolved`)}async function h(b){let _=await v.call(this,b);if(!this.refs[b])await n.call(this,_.$schema);if(!this.refs[b])this.addSchema(_,b,t)}async function v(b){let _=this._loading[b];if(_)return _;try{return await(this._loading[b]=r(b))}finally{delete this._loading[b]}}}addSchema(e,t,r,i=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,r,i);return this}let n;if(typeof e==="object"){let{schemaId:o}=this.opts;if(n=e[o],n!==void 0&&typeof n!="string")throw Error(`schema ${o} must be string`)}return t=(0,yc.normalizeId)(t||n),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,i,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if(typeof e=="boolean")return!0;let r;if(r=e.$schema,r!==void 0&&typeof r!="string")throw Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(r,e);if(!i&&t){let n="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(n);else throw Error(n)}return i}getSchema(e){let t;while(typeof(t=R4.call(this,e))=="string")e=t;if(t===void 0){let{schemaId:r}=this.opts,i=new gc.SchemaEnv({schema:{},schemaId:r});if(t=gc.resolveSchema.call(this,i,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=R4.call(this,e);if(typeof t=="object")this._cache.delete(t.schema);return delete this.schemas[e],delete this.refs[e],this}case"object":{let t=e;this._cache.delete(t);let r=e[this.opts.schemaId];if(r)r=(0,yc.normalizeId)(r),delete this.schemas[r],delete this.refs[r];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if(typeof e=="string"){if(r=e,typeof t=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r}else if(typeof e=="object"&&t===void 0){if(t=e,r=t.keyword,Array.isArray(r)&&!r.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(KL.call(this,r,t),!t)return(0,n_.eachItem)(r,(n)=>r_.call(this,n)),this;WL.call(this,t);let i={...t,type:(0,jp.getJSONTypes)(t.type),schemaType:(0,jp.getJSONTypes)(t.schemaType)};return(0,n_.eachItem)(r,i.type.length===0?(n)=>r_.call(this,n,i):(n)=>i.type.forEach((o)=>r_.call(this,n,i,o))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t=="object"?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let r of t.rules){let i=r.rules.findIndex((n)=>n.keyword===e);if(i>=0)r.rules.splice(i,1)}return this}addFormat(e,t){if(typeof t=="string")t=new RegExp(t);return this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){if(!e||e.length===0)return"No errors";return e.map((i)=>`${r}${i.instancePath} ${i.message}`).reduce((i,n)=>i+t+n)}$dataMetaSchema(e,t){let r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of t){let n=i.split("/").slice(1),o=e;for(let s of n)o=o[s];for(let s in r){let h=r[s];if(typeof h!="object")continue;let{$data:v}=h.definition,b=o[s];if(v&&b)o[s]=D4(b)}}return e}_removeAllSchemas(e,t){for(let r in e){let i=e[r];if(!t||t.test(r)){if(typeof i=="string")delete e[r];else if(i&&!i.meta)this._cache.delete(i.schema),delete e[r]}}}_addSchema(e,t,r,i=this.opts.validateSchema,n=this.opts.addUsedSchema){let o,{schemaId:s}=this.opts;if(typeof e=="object")o=e[s];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof e!="boolean")throw Error("schema must be object or boolean");let h=this._cache.get(e);if(h!==void 0)return h;r=(0,yc.normalizeId)(o||r);let v=yc.getSchemaRefs.call(this,e,r);if(h=new gc.SchemaEnv({schema:e,schemaId:s,meta:t,baseId:r,localRefs:v}),this._cache.set(h.schema,h),n&&!r.startsWith("#")){if(r)this._checkUnique(r);this.refs[r]=h}if(i)this.validateSchema(e,!0);return h}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta)this._compileMetaSchema(e);else gc.compileSchema.call(this,e);if(!e.validate)throw Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{gc.compileSchema.call(this,e)}finally{this.opts=t}}}Up.ValidationError=PL.default;Up.MissingRefError=C4.default;Ii.default=Up;function A4(e,t,r,i="error"){for(let n in e){let o=n;if(o in t)this.logger[i](`${r}: option ${n}. ${e[o]}`)}}function R4(e){return e=(0,yc.normalizeId)(e),this.schemas[e]||this.refs[e]}function UL(){let e=this.opts.schemas;if(!e)return;if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function LL(){for(let e in this.opts.formats){let t=this.opts.formats[e];if(t)this.addFormat(e,t)}}function FL(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];if(!r.keyword)r.keyword=t;this.addKeyword(r)}}function qL(){let e={...this.opts};for(let t of OL)delete e[t];return e}var BL={log(){},warn(){},error(){}};function HL(e){if(e===!1)return BL;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw Error("logger must implement log, warn and error methods")}var ZL=/^[a-z_$][a-z0-9_$:-]*$/i;function KL(e,t){let{RULES:r}=this;if((0,n_.eachItem)(e,(i)=>{if(r.keywords[i])throw Error(`Keyword ${i} is already defined`);if(!ZL.test(i))throw Error(`Keyword ${i} has invalid name`)}),!t)return;if(t.$data&&!(("code"in t)||("validate"in t)))throw Error('$data keyword must have "code" or "validate" function')}function r_(e,t,r){var i;let n=t===null||t===void 0?void 0:t.post;if(r&&n)throw Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,s=n?o.post:o.rules.find(({type:v})=>v===r);if(!s)s={type:r,rules:[]},o.rules.push(s);if(o.keywords[e]=!0,!t)return;let h={keyword:e,definition:{...t,type:(0,jp.getJSONTypes)(t.type),schemaType:(0,jp.getJSONTypes)(t.schemaType)}};if(t.before)VL.call(this,s,h,t.before);else s.rules.push(h);o.all[e]=h,(i=t.implements)===null||i===void 0||i.forEach((v)=>this.addKeyword(v))}function VL(e,t,r){let i=e.rules.findIndex((n)=>n.keyword===r);if(i>=0)e.rules.splice(i,0,t);else e.rules.push(t),this.logger.warn(`rule ${r} is not defined`)}function WL(e){let{metaSchema:t}=e;if(t===void 0)return;if(e.$data&&this.opts.$data)t=D4(t);e.validateSchema=this.compile(t,!0)}var GL={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function D4(e){return{anyOf:[e,GL]}}});var j4=Xe(function(z4){Object.defineProperty(z4,"__esModule",{value:!0});var YL={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};z4.default=YL});var H4=Xe(function(q4){Object.defineProperty(q4,"__esModule",{value:!0});q4.callRef=q4.getValidate=void 0;var eF=hc(),U4=Rn(),un=gt(),ca=Mi(),L4=Op(),Lp=Mt(),tF={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:i}=e,{baseId:n,schemaEnv:o,validateName:s,opts:h,self:v}=i,{root:b}=o;if((r==="#"||r==="#/")&&n===b.baseId)return g();let _=L4.resolveRef.call(v,b,n,r);if(_===void 0)throw new eF.default(i.opts.uriResolver,n,r);if(_ instanceof L4.SchemaEnv)return S(_);return x(_);function g(){if(o===b)return Fp(e,s,o,o.$async);let M=t.scopeValue("root",{ref:b});return Fp(e,un._`${M}.validate`,b,b.$async)}function S(M){let I=F4(e,M);Fp(e,I,M,M.$async)}function x(M){let I=t.scopeValue("schema",h.code.source===!0?{ref:M,code:(0,un.stringify)(M)}:{ref:M}),$=t.name("valid"),T=e.subschema({schema:M,dataTypes:[],schemaPath:un.nil,topSchemaRef:I,errSchemaPath:r},$);e.mergeEvaluated(T),e.ok($)}}};function F4(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):un._`${r.scopeValue("wrapper",{ref:t})}.validate`}q4.getValidate=F4;function Fp(e,t,r,i){let{gen:n,it:o}=e,{allErrors:s,schemaEnv:h,opts:v}=o,b=v.passContext?ca.default.this:un.nil;if(i)_();else g();function _(){if(!h.$async)throw Error("async schema referenced by sync schema");let M=n.let("valid");n.try(()=>{if(n.code(un._`await ${(0,U4.callValidateCode)(e,t,b)}`),x(t),!s)n.assign(M,!0)},(I)=>{if(n.if(un._`!(${I} instanceof ${o.ValidationError})`,()=>n.throw(I)),S(I),!s)n.assign(M,!1)}),e.ok(M)}function g(){e.result((0,U4.callValidateCode)(e,t,b),()=>x(t),()=>S(t))}function S(M){let I=un._`${M}.errors`;n.assign(ca.default.vErrors,un._`${ca.default.vErrors} === null ? ${I} : ${ca.default.vErrors}.concat(${I})`),n.assign(ca.default.errors,un._`${ca.default.vErrors}.length`)}function x(M){var I;if(!o.opts.unevaluated)return;let $=(I=r===null||r===void 0?void 0:r.validate)===null||I===void 0?void 0:I.evaluated;if(o.props!==!0)if($&&!$.dynamicProps){if($.props!==void 0)o.props=Lp.mergeEvaluated.props(n,$.props,o.props)}else{let T=n.var("props",un._`${M}.evaluated.props`);o.props=Lp.mergeEvaluated.props(n,T,o.props,un.Name)}if(o.items!==!0)if($&&!$.dynamicItems){if($.items!==void 0)o.items=Lp.mergeEvaluated.items(n,$.items,o.items)}else{let T=n.var("items",un._`${M}.evaluated.items`);o.items=Lp.mergeEvaluated.items(n,T,o.items,un.Name)}}}q4.callRef=Fp;q4.default=tF});var K4=Xe(function(Z4){Object.defineProperty(Z4,"__esModule",{value:!0});var iF=j4(),oF=H4(),sF=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",iF.default,oF.default];Z4.default=sF});var W4=Xe(function(V4){Object.defineProperty(V4,"__esModule",{value:!0});var qp=gt(),ao=qp.operators,Bp={maximum:{okStr:"<=",ok:ao.LTE,fail:ao.GT},minimum:{okStr:">=",ok:ao.GTE,fail:ao.LT},exclusiveMaximum:{okStr:"<",ok:ao.LT,fail:ao.GTE},exclusiveMinimum:{okStr:">",ok:ao.GT,fail:ao.LTE}},uF={message:({keyword:e,schemaCode:t})=>qp.str`must be ${Bp[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>qp._`{comparison: ${Bp[e].okStr}, limit: ${t}}`},lF={keyword:Object.keys(Bp),type:"number",schemaType:"number",$data:!0,error:uF,code(e){let{keyword:t,data:r,schemaCode:i}=e;e.fail$data(qp._`${r} ${Bp[t].fail} ${i} || isNaN(${r})`)}};V4.default=lF});var J4=Xe(function(G4){Object.defineProperty(G4,"__esModule",{value:!0});var vc=gt(),dF={message:({schemaCode:e})=>vc.str`must be multiple of ${e}`,params:({schemaCode:e})=>vc._`{multipleOf: ${e}}`},fF={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:dF,code(e){let{gen:t,data:r,schemaCode:i,it:n}=e,o=n.opts.multipleOfPrecision,s=t.let("res"),h=o?vc._`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:vc._`${s} !== parseInt(${s})`;e.fail$data(vc._`(${i} === 0 || (${s} = ${r}/${i}, ${h}))`)}};G4.default=fF});var Q4=Xe(function(Y4){Object.defineProperty(Y4,"__esModule",{value:!0});function X4(e){let t=e.length,r=0,i=0,n;while(i<t)if(r++,n=e.charCodeAt(i++),n>=55296&&n<=56319&&i<t){if(n=e.charCodeAt(i),(n&64512)===56320)i++}return r}Y4.default=X4;X4.code='require("ajv/dist/runtime/ucs2length").default'});var t3=Xe(function(e3){Object.defineProperty(e3,"__esModule",{value:!0});var Jo=gt(),mF=Mt(),gF=Q4(),yF={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return Jo.str`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>Jo._`{limit: ${e}}`},vF={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:yF,code(e){let{keyword:t,data:r,schemaCode:i,it:n}=e,o=t==="maxLength"?Jo.operators.GT:Jo.operators.LT,s=n.opts.unicode===!1?Jo._`${r}.length`:Jo._`${(0,mF.useFunc)(e.gen,gF.default)}(${r})`;e.fail$data(Jo._`${s} ${o} ${i}`)}};e3.default=vF});var n3=Xe(function(r3){Object.defineProperty(r3,"__esModule",{value:!0});var _F=Rn(),wF=Mt(),da=gt(),SF={message:({schemaCode:e})=>da.str`must match pattern "${e}"`,params:({schemaCode:e})=>da._`{pattern: ${e}}`},xF={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:SF,code(e){let{gen:t,data:r,$data:i,schema:n,schemaCode:o,it:s}=e,h=s.opts.unicodeRegExp?"u":"";if(i){let{regExp:v}=s.opts.code,b=v.code==="new RegExp"?da._`new RegExp`:(0,wF.useFunc)(t,v),_=t.let("valid");t.try(()=>t.assign(_,da._`${b}(${o}, ${h}).test(${r})`),()=>t.assign(_,!1)),e.fail$data(da._`!${_}`)}else{let v=(0,_F.usePattern)(e,n);e.fail$data(da._`!${v}.test(${r})`)}}};r3.default=xF});var o3=Xe(function(i3){Object.defineProperty(i3,"__esModule",{value:!0});var bc=gt(),MF={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return bc.str`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>bc._`{limit: ${e}}`},EF={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:MF,code(e){let{keyword:t,data:r,schemaCode:i}=e,n=t==="maxProperties"?bc.operators.GT:bc.operators.LT;e.fail$data(bc._`Object.keys(${r}).length ${n} ${i}`)}};i3.default=EF});var a3=Xe(function(s3){Object.defineProperty(s3,"__esModule",{value:!0});var _c=Rn(),wc=gt(),$F=Mt(),TF={message:({params:{missingProperty:e}})=>wc.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>wc._`{missingProperty: ${e}}`},PF={keyword:"required",type:"object",schemaType:"array",$data:!0,error:TF,code(e){let{gen:t,schema:r,schemaCode:i,data:n,$data:o,it:s}=e,{opts:h}=s;if(!o&&r.length===0)return;let v=r.length>=h.loopRequired;if(s.allErrors)b();else _();if(h.strictRequired){let x=e.parentSchema.properties,{definedProperties:M}=e.it;for(let I of r)if((x===null||x===void 0?void 0:x[I])===void 0&&!M.has(I)){let $=s.schemaEnv.baseId+s.errSchemaPath,T=`required property "${I}" is not defined at "${$}" (strictRequired)`;(0,$F.checkStrictMode)(s,T,s.opts.strictRequired)}}function b(){if(v||o)e.block$data(wc.nil,g);else for(let x of r)(0,_c.checkReportMissingProp)(e,x)}function _(){let x=t.let("missing");if(v||o){let M=t.let("valid",!0);e.block$data(M,()=>S(x,M)),e.ok(M)}else t.if((0,_c.checkMissingProp)(e,r,x)),(0,_c.reportMissingProp)(e,x),t.else()}function g(){t.forOf("prop",i,(x)=>{e.setParams({missingProperty:x}),t.if((0,_c.noPropertyInData)(t,n,x,h.ownProperties),()=>e.error())})}function S(x,M){e.setParams({missingProperty:x}),t.forOf(x,i,()=>{t.assign(M,(0,_c.propertyInData)(t,n,x,h.ownProperties)),t.if((0,wc.not)(M),()=>{e.error(),t.break()})},wc.nil)}}};s3.default=PF});var l3=Xe(function(u3){Object.defineProperty(u3,"__esModule",{value:!0});var Sc=gt(),RF={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return Sc.str`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>Sc._`{limit: ${e}}`},CF={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:RF,code(e){let{keyword:t,data:r,schemaCode:i}=e,n=t==="maxItems"?Sc.operators.GT:Sc.operators.LT;e.fail$data(Sc._`${r}.length ${n} ${i}`)}};u3.default=CF});var Hp=Xe(function(d3){Object.defineProperty(d3,"__esModule",{value:!0});var c3=Fb();c3.code='require("ajv/dist/runtime/equal").default';d3.default=c3});var h3=Xe(function(f3){Object.defineProperty(f3,"__esModule",{value:!0});var i_=uc(),Nr=gt(),NF=Mt(),zF=Hp(),jF={message:({params:{i:e,j:t}})=>Nr.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>Nr._`{i: ${e}, j: ${t}}`},UF={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:jF,code(e){let{gen:t,data:r,$data:i,schema:n,parentSchema:o,schemaCode:s,it:h}=e;if(!i&&!n)return;let v=t.let("valid"),b=o.items?(0,i_.getSchemaTypes)(o.items):[];e.block$data(v,_,Nr._`${s} === false`),e.ok(v);function _(){let M=t.let("i",Nr._`${r}.length`),I=t.let("j");e.setParams({i:M,j:I}),t.assign(v,!0),t.if(Nr._`${M} > 1`,()=>(g()?S:x)(M,I))}function g(){return b.length>0&&!b.some((M)=>M==="object"||M==="array")}function S(M,I){let $=t.name("item"),T=(0,i_.checkDataTypes)(b,$,h.opts.strictNumbers,i_.DataType.Wrong),P=t.const("indices",Nr._`{}`);t.for(Nr._`;${M}--;`,()=>{if(t.let($,Nr._`${r}[${M}]`),t.if(T,Nr._`continue`),b.length>1)t.if(Nr._`typeof ${$} == "string"`,Nr._`${$} += "_"`);t.if(Nr._`typeof ${P}[${$}] == "number"`,()=>{t.assign(I,Nr._`${P}[${$}]`),e.error(),t.assign(v,!1).break()}).code(Nr._`${P}[${$}] = ${M}`)})}function x(M,I){let $=(0,NF.useFunc)(t,zF.default),T=t.name("outer");t.label(T).for(Nr._`;${M}--;`,()=>t.for(Nr._`${I} = ${M}; ${I}--;`,()=>t.if(Nr._`${$}(${r}[${M}], ${r}[${I}])`,()=>{e.error(),t.assign(v,!1).break(T)})))}}};f3.default=UF});var m3=Xe(function(p3){Object.defineProperty(p3,"__esModule",{value:!0});var o_=gt(),FF=Mt(),qF=Hp(),BF={message:"must be equal to constant",params:({schemaCode:e})=>o_._`{allowedValue: ${e}}`},HF={keyword:"const",$data:!0,error:BF,code(e){let{gen:t,data:r,$data:i,schemaCode:n,schema:o}=e;if(i||o&&typeof o=="object")e.fail$data(o_._`!${(0,FF.useFunc)(t,qF.default)}(${r}, ${n})`);else e.fail(o_._`${o} !== ${r}`)}};p3.default=HF});var y3=Xe(function(g3){Object.defineProperty(g3,"__esModule",{value:!0});var xc=gt(),KF=Mt(),VF=Hp(),WF={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>xc._`{allowedValues: ${e}}`},GF={keyword:"enum",schemaType:"array",$data:!0,error:WF,code(e){let{gen:t,data:r,$data:i,schema:n,schemaCode:o,it:s}=e;if(!i&&n.length===0)throw Error("enum must have non-empty array");let h=n.length>=s.opts.loopEnum,v,b=()=>v!==null&&v!==void 0?v:v=(0,KF.useFunc)(t,VF.default),_;if(h||i)_=t.let("valid"),e.block$data(_,g);else{if(!Array.isArray(n))throw Error("ajv implementation error");let x=t.const("vSchema",o);_=(0,xc.or)(...n.map((M,I)=>S(x,I)))}e.pass(_);function g(){t.assign(_,!1),t.forOf("v",o,(x)=>t.if(xc._`${b()}(${r}, ${x})`,()=>t.assign(_,!0).break()))}function S(x,M){let I=n[M];return typeof I==="object"&&I!==null?xc._`${b()}(${r}, ${x}[${M}])`:xc._`${r} === ${I}`}}};g3.default=GF});var b3=Xe(function(v3){Object.defineProperty(v3,"__esModule",{value:!0});var XF=W4(),YF=J4(),QF=t3(),eq=n3(),tq=o3(),rq=a3(),nq=l3(),iq=h3(),oq=m3(),sq=y3(),aq=[XF.default,YF.default,QF.default,eq.default,tq.default,rq.default,nq.default,iq.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},oq.default,sq.default];v3.default=aq});var a_=Xe(function(w3){Object.defineProperty(w3,"__esModule",{value:!0});w3.validateAdditionalItems=void 0;var Xo=gt(),s_=Mt(),lq={message:({params:{len:e}})=>Xo.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>Xo._`{limit: ${e}}`},cq={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:lq,code(e){let{parentSchema:t,it:r}=e,{items:i}=t;if(!Array.isArray(i)){(0,s_.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}_3(e,i)}};function _3(e,t){let{gen:r,schema:i,data:n,keyword:o,it:s}=e;s.items=!0;let h=r.const("len",Xo._`${n}.length`);if(i===!1)e.setParams({len:t.length}),e.pass(Xo._`${h} <= ${t.length}`);else if(typeof i=="object"&&!(0,s_.alwaysValidSchema)(s,i)){let b=r.var("valid",Xo._`${h} <= ${t.length}`);r.if((0,Xo.not)(b),()=>v(b)),e.ok(b)}function v(b){r.forRange("i",t.length,h,(_)=>{if(e.subschema({keyword:o,dataProp:_,dataPropType:s_.Type.Num},b),!s.allErrors)r.if((0,Xo.not)(b),()=>r.break())})}}w3.validateAdditionalItems=_3;w3.default=cq});var u_=Xe(function(M3){Object.defineProperty(M3,"__esModule",{value:!0});M3.validateTuple=void 0;var x3=gt(),Zp=Mt(),fq=Rn(),hq={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return k3(e,"additionalItems",t);if(r.items=!0,(0,Zp.alwaysValidSchema)(r,t))return;e.ok((0,fq.validateArray)(e))}};function k3(e,t,r=e.schema){let{gen:i,parentSchema:n,data:o,keyword:s,it:h}=e;if(_(n),h.opts.unevaluated&&r.length&&h.items!==!0)h.items=Zp.mergeEvaluated.items(i,r.length,h.items);let v=i.name("valid"),b=i.const("len",x3._`${o}.length`);r.forEach((g,S)=>{if((0,Zp.alwaysValidSchema)(h,g))return;i.if(x3._`${b} > ${S}`,()=>e.subschema({keyword:s,schemaProp:S,dataProp:S},v)),e.ok(v)});function _(g){let{opts:S,errSchemaPath:x}=h,M=r.length,I=M===g.minItems&&(M===g.maxItems||g[t]===!1);if(S.strictTuples&&!I){let $=`"${s}" is ${M}-tuple, but minItems or maxItems/${t} are not specified or different at path "${x}"`;(0,Zp.checkStrictMode)(h,$,S.strictTuples)}}}M3.validateTuple=k3;M3.default=hq});var $3=Xe(function(I3){Object.defineProperty(I3,"__esModule",{value:!0});var mq=u_(),gq={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(e)=>(0,mq.validateTuple)(e,"items")};I3.default=gq});var A3=Xe(function(P3){Object.defineProperty(P3,"__esModule",{value:!0});var T3=gt(),vq=Mt(),bq=Rn(),_q=a_(),wq={message:({params:{len:e}})=>T3.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>T3._`{limit: ${e}}`},Sq={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:wq,code(e){let{schema:t,parentSchema:r,it:i}=e,{prefixItems:n}=r;if(i.items=!0,(0,vq.alwaysValidSchema)(i,t))return;if(n)(0,_q.validateAdditionalItems)(e,n);else e.ok((0,bq.validateArray)(e))}};P3.default=Sq});var C3=Xe(function(R3){Object.defineProperty(R3,"__esModule",{value:!0});var Cn=gt(),Kp=Mt(),kq={message:({params:{min:e,max:t}})=>t===void 0?Cn.str`must contain at least ${e} valid item(s)`:Cn.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?Cn._`{minContains: ${e}}`:Cn._`{minContains: ${e}, maxContains: ${t}}`},Mq={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:kq,code(e){let{gen:t,schema:r,parentSchema:i,data:n,it:o}=e,s,h,{minContains:v,maxContains:b}=i;if(o.opts.next)s=v===void 0?1:v,h=b;else s=1;let _=t.const("len",Cn._`${n}.length`);if(e.setParams({min:s,max:h}),h===void 0&&s===0){(0,Kp.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(h!==void 0&&s>h){(0,Kp.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,Kp.alwaysValidSchema)(o,r)){let I=Cn._`${_} >= ${s}`;if(h!==void 0)I=Cn._`${I} && ${_} <= ${h}`;e.pass(I);return}o.items=!0;let g=t.name("valid");if(h===void 0&&s===1)x(g,()=>t.if(g,()=>t.break()));else if(s===0){if(t.let(g,!0),h!==void 0)t.if(Cn._`${n}.length > 0`,S)}else t.let(g,!1),S();e.result(g,()=>e.reset());function S(){let I=t.name("_valid"),$=t.let("count",0);x(I,()=>t.if(I,()=>M($)))}function x(I,$){t.forRange("i",0,_,(T)=>{e.subschema({keyword:"contains",dataProp:T,dataPropType:Kp.Type.Num,compositeRule:!0},I),$()})}function M(I){if(t.code(Cn._`${I}++`),h===void 0)t.if(Cn._`${I} >= ${s}`,()=>t.assign(g,!0).break());else if(t.if(Cn._`${I} > ${h}`,()=>t.assign(g,!1).break()),s===1)t.assign(g,!0);else t.if(Cn._`${I} >= ${s}`,()=>t.assign(g,!0))}}};R3.default=Mq});var U3=Xe(function(N3){Object.defineProperty(N3,"__esModule",{value:!0});N3.validateSchemaDeps=N3.validatePropertyDeps=N3.error=void 0;var l_=gt(),Iq=Mt(),kc=Rn();N3.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let i=t===1?"property":"properties";return l_.str`must have ${i} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:i}})=>l_._`{property: ${e},
|
|
24
24
|
missingProperty: ${i},
|
|
25
25
|
depsCount: ${t},
|
|
26
|
-
deps: ${r}}`};var $q={keyword:"dependencies",type:"object",schemaType:"object",error:N3.error,code(e){let[t,r]=Tq(e);O3(e,t),D3(e,r)}};function Tq({schema:e}){let t={},r={};for(let i in e){if(i==="__proto__")continue;let n=Array.isArray(e[i])?t:r;n[i]=e[i]}return[t,r]}function O3(e,t=e.schema){let{gen:r,data:i,it:n}=e;if(Object.keys(t).length===0)return;let o=r.let("missing");for(let s in t){let h=t[s];if(h.length===0)continue;let v=(0,kc.propertyInData)(r,i,s,n.opts.ownProperties);if(e.setParams({property:s,depsCount:h.length,deps:h.join(", ")}),n.allErrors)r.if(v,()=>{for(let b of h)(0,kc.checkReportMissingProp)(e,b)});else r.if(l_._`${v} && (${(0,kc.checkMissingProp)(e,h,o)})`),(0,kc.reportMissingProp)(e,o),r.else()}}N3.validatePropertyDeps=O3;function D3(e,t=e.schema){let{gen:r,data:i,keyword:n,it:o}=e,s=r.name("valid");for(let h in t){if((0,Iq.alwaysValidSchema)(o,t[h]))continue;r.if((0,kc.propertyInData)(r,i,h,o.opts.ownProperties),()=>{let v=e.subschema({keyword:n,schemaProp:h},s);e.mergeValidEvaluated(v,s)},()=>r.var(s,!0)),e.ok(s)}}N3.validateSchemaDeps=D3;N3.default=$q});var q3=Xe(function(F3){Object.defineProperty(F3,"__esModule",{value:!0});var L3=gt(),Rq=Mt(),Cq={message:"property name must be valid",params:({params:e})=>L3._`{propertyName: ${e.propertyName}}`},Oq={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Cq,code(e){let{gen:t,schema:r,data:i,it:n}=e;if((0,Rq.alwaysValidSchema)(n,r))return;let o=t.name("valid");t.forIn("key",i,(s)=>{e.setParams({propertyName:s}),e.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},o),t.if((0,L3.not)(o),()=>{if(e.error(!0),!n.allErrors)t.break()})}),e.ok(o)}};F3.default=Oq});var c_=Xe(function(B3){Object.defineProperty(B3,"__esModule",{value:!0});var Vp=Rn(),Kn=gt(),Nq=Mi(),Wp=Mt(),zq={message:"must NOT have additional properties",params:({params:e})=>Kn._`{additionalProperty: ${e.additionalProperty}}`},jq={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:zq,code(e){let{gen:t,schema:r,parentSchema:i,data:n,errsCount:o,it:s}=e;if(!o)throw Error("ajv implementation error");let{allErrors:h,opts:v}=s;if(s.props=!0,v.removeAdditional!=="all"&&(0,Wp.alwaysValidSchema)(s,r))return;let b=(0,Vp.allSchemaProperties)(i.properties),_=(0,Vp.allSchemaProperties)(i.patternProperties);g(),e.ok(Kn._`${o} === ${Nq.default.errors}`);function g(){t.forIn("key",n,($)=>{if(!b.length&&!_.length)M($);else t.if(S($),()=>M($))})}function S($){let T;if(b.length>8){let P=(0,Wp.schemaRefOrVal)(s,i.properties,"properties");T=(0,Vp.isOwnProperty)(t,P,$)}else if(b.length)T=(0,Kn.or)(...b.map((P)=>Kn._`${$} === ${P}`));else T=Kn.nil;if(_.length)T=(0,Kn.or)(T,..._.map((P)=>Kn._`${(0,Vp.usePattern)(e,P)}.test(${$})`));return(0,Kn.not)(T)}function x($){t.code(Kn._`delete ${n}[${$}]`)}function M($){if(v.removeAdditional==="all"||v.removeAdditional&&r===!1){x($);return}if(r===!1){if(e.setParams({additionalProperty:$}),e.error(),!h)t.break();return}if(typeof r=="object"&&!(0,Wp.alwaysValidSchema)(s,r)){let T=t.name("valid");if(v.removeAdditional==="failing")I($,T,!1),t.if((0,Kn.not)(T),()=>{e.reset(),x($)});else if(I($,T),!h)t.if((0,Kn.not)(T),()=>t.break())}}function I($,T,P){let R={keyword:"additionalProperties",dataProp:$,dataPropType:Wp.Type.Str};if(P===!1)Object.assign(R,{compositeRule:!0,createErrors:!1,allErrors:!1});e.subschema(R,T)}}};B3.default=jq});var V3=Xe(function(K3){Object.defineProperty(K3,"__esModule",{value:!0});var Lq=fc(),H3=Rn(),d_=Mt(),Z3=c_(),Fq={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:i,data:n,it:o}=e;if(o.opts.removeAdditional==="all"&&i.additionalProperties===void 0)Z3.default.code(new Lq.KeywordCxt(o,Z3.default,"additionalProperties"));let s=(0,H3.allSchemaProperties)(r);for(let g of s)o.definedProperties.add(g);if(o.opts.unevaluated&&s.length&&o.props!==!0)o.props=d_.mergeEvaluated.props(t,(0,d_.toHash)(s),o.props);let h=s.filter((g)=>!(0,d_.alwaysValidSchema)(o,r[g]));if(h.length===0)return;let v=t.name("valid");for(let g of h){if(b(g))_(g);else{if(t.if((0,H3.propertyInData)(t,n,g,o.opts.ownProperties)),_(g),!o.allErrors)t.else().var(v,!0);t.endIf()}e.it.definedProperties.add(g),e.ok(v)}function b(g){return o.opts.useDefaults&&!o.compositeRule&&r[g].default!==void 0}function _(g){e.subschema({keyword:"properties",schemaProp:g,dataProp:g},v)}}};K3.default=Fq});var Y3=Xe(function(X3){Object.defineProperty(X3,"__esModule",{value:!0});var W3=Rn(),Gp=gt(),G3=Mt(),J3=Mt(),Bq={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:i,parentSchema:n,it:o}=e,{opts:s}=o,h=(0,W3.allSchemaProperties)(r),v=h.filter((I)=>(0,G3.alwaysValidSchema)(o,r[I]));if(h.length===0||v.length===h.length&&(!o.opts.unevaluated||o.props===!0))return;let b=s.strictSchema&&!s.allowMatchingProperties&&n.properties,_=t.name("valid");if(o.props!==!0&&!(o.props instanceof Gp.Name))o.props=(0,J3.evaluatedPropsToName)(t,o.props);let{props:g}=o;S();function S(){for(let I of h){if(b)x(I);if(o.allErrors)M(I);else t.var(_,!0),M(I),t.if(_)}}function x(I){for(let $ in b)if(new RegExp(I).test($))(0,G3.checkStrictMode)(o,`property ${$} matches pattern ${I} (use allowMatchingProperties)`)}function M(I){t.forIn("key",i,($)=>{t.if(Gp._`${(0,W3.usePattern)(e,I)}.test(${$})`,()=>{let T=v.includes(I);if(!T)e.subschema({keyword:"patternProperties",schemaProp:I,dataProp:$,dataPropType:J3.Type.Str},_);if(o.opts.unevaluated&&g!==!0)t.assign(Gp._`${g}[${$}]`,!0);else if(!T&&!o.allErrors)t.if((0,Gp.not)(_),()=>t.break())})})}}};X3.default=Bq});var e8=Xe(function(Q3){Object.defineProperty(Q3,"__esModule",{value:!0});var Zq=Mt(),Kq={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:i}=e;if((0,Zq.alwaysValidSchema)(i,r)){e.fail();return}let n=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},n),e.failResult(n,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Q3.default=Kq});var r8=Xe(function(t8){Object.defineProperty(t8,"__esModule",{value:!0});var Wq=Rn(),Gq={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Wq.validateUnion,error:{message:"must match a schema in anyOf"}};t8.default=Gq});var i8=Xe(function(n8){Object.defineProperty(n8,"__esModule",{value:!0});var Jp=gt(),Xq=Mt(),Yq={message:"must match exactly one schema in oneOf",params:({params:e})=>Jp._`{passingSchemas: ${e.passing}}`},Qq={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Yq,code(e){let{gen:t,schema:r,parentSchema:i,it:n}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(n.opts.discriminator&&i.discriminator)return;let o=r,s=t.let("valid",!1),h=t.let("passing",null),v=t.name("_valid");e.setParams({passing:h}),t.block(b),e.result(s,()=>e.reset(),()=>e.error(!0));function b(){o.forEach((_,g)=>{let S;if((0,Xq.alwaysValidSchema)(n,_))t.var(v,!0);else S=e.subschema({keyword:"oneOf",schemaProp:g,compositeRule:!0},v);if(g>0)t.if(Jp._`${v} && ${s}`).assign(s,!1).assign(h,Jp._`[${h}, ${g}]`).else();t.if(v,()=>{if(t.assign(s,!0),t.assign(h,g),S)e.mergeEvaluated(S,Jp.Name)})})}}};n8.default=Qq});var s8=Xe(function(o8){Object.defineProperty(o8,"__esModule",{value:!0});var tB=Mt(),rB={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:i}=e;if(!Array.isArray(r))throw Error("ajv implementation error");let n=t.name("valid");r.forEach((o,s)=>{if((0,tB.alwaysValidSchema)(i,o))return;let h=e.subschema({keyword:"allOf",schemaProp:s},n);e.ok(n),e.mergeEvaluated(h)})}};o8.default=rB});var c8=Xe(function(l8){Object.defineProperty(l8,"__esModule",{value:!0});var Xp=gt(),u8=Mt(),iB={message:({params:e})=>Xp.str`must match "${e.ifClause}" schema`,params:({params:e})=>Xp._`{failingKeyword: ${e.ifClause}}`},oB={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:iB,code(e){let{gen:t,parentSchema:r,it:i}=e;if(r.then===void 0&&r.else===void 0)(0,u8.checkStrictMode)(i,'"if" without "then" and "else" is ignored');let n=a8(i,"then"),o=a8(i,"else");if(!n&&!o)return;let s=t.let("valid",!0),h=t.name("_valid");if(v(),e.reset(),n&&o){let _=t.let("ifClause");e.setParams({ifClause:_}),t.if(h,b("then",_),b("else",_))}else if(n)t.if(h,b("then"));else t.if((0,Xp.not)(h),b("else"));e.pass(s,()=>e.error(!0));function v(){let _=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},h);e.mergeEvaluated(_)}function b(_,g){return()=>{let S=e.subschema({keyword:_},h);if(t.assign(s,h),e.mergeValidEvaluated(S,s),g)t.assign(g,Xp._`${_}`);else e.setParams({ifClause:_})}}}};function a8(e,t){let r=e.schema[t];return r!==void 0&&!(0,u8.alwaysValidSchema)(e,r)}l8.default=oB});var f8=Xe(function(d8){Object.defineProperty(d8,"__esModule",{value:!0});var aB=Mt(),uB={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){if(t.if===void 0)(0,aB.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};d8.default=uB});var p8=Xe(function(h8){Object.defineProperty(h8,"__esModule",{value:!0});var cB=a_(),dB=$3(),fB=u_(),hB=A3(),pB=C3(),mB=U3(),gB=q3(),yB=c_(),vB=V3(),bB=Y3(),_B=e8(),wB=r8(),SB=i8(),xB=s8(),kB=c8(),MB=f8();function EB(e=!1){let t=[_B.default,wB.default,SB.default,xB.default,kB.default,MB.default,gB.default,yB.default,mB.default,vB.default,bB.default];if(e)t.push(dB.default,hB.default);else t.push(cB.default,fB.default);return t.push(pB.default),t}h8.default=EB});var g8=Xe(function(m8){Object.defineProperty(m8,"__esModule",{value:!0});var ir=gt(),$B={message:({schemaCode:e})=>ir.str`must match format "${e}"`,params:({schemaCode:e})=>ir._`{format: ${e}}`},TB={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:$B,code(e,t){let{gen:r,data:i,$data:n,schema:o,schemaCode:s,it:h}=e,{opts:v,errSchemaPath:b,schemaEnv:_,self:g}=h;if(!v.validateFormats)return;if(n)S();else x();function S(){let M=r.scopeValue("formats",{ref:g.formats,code:v.code.formats}),I=r.const("fDef",ir._`${M}[${s}]`),$=r.let("fType"),T=r.let("format");r.if(ir._`typeof ${I} == "object" && !(${I} instanceof RegExp)`,()=>r.assign($,ir._`${I}.type || "string"`).assign(T,ir._`${I}.validate`),()=>r.assign($,ir._`"string"`).assign(T,I)),e.fail$data((0,ir.or)(P(),R()));function P(){if(v.strictSchema===!1)return ir.nil;return ir._`${s} && !${T}`}function R(){let C=_.$async?ir._`(${I}.async ? await ${T}(${i}) : ${T}(${i}))`:ir._`${T}(${i})`,N=ir._`(typeof ${T} == "function" ? ${C} : ${T}.test(${i}))`;return ir._`${T} && ${T} !== true && ${$} === ${t} && !${N}`}}function x(){let M=g.formats[o];if(!M){P();return}if(M===!0)return;let[I,$,T]=R(M);if(I===t)e.pass(C());function P(){if(v.strictSchema===!1){g.logger.warn(N());return}throw Error(N());function N(){return`unknown format "${o}" ignored in schema at path "${b}"`}}function R(N){let B=N instanceof RegExp?(0,ir.regexpCode)(N):v.code.formats?ir._`${v.code.formats}${(0,ir.getProperty)(o)}`:void 0,ie=r.scopeValue("formats",{key:o,ref:N,code:B});if(typeof N=="object"&&!(N instanceof RegExp))return[N.type||"string",N.validate,ir._`${ie}.validate`];return["string",N,ie]}function C(){if(typeof M=="object"&&!(M instanceof RegExp)&&M.async){if(!_.$async)throw Error("async format in sync schema");return ir._`await ${T}(${i})`}return typeof $=="function"?ir._`${T}(${i})`:ir._`${T}.test(${i})`}}}};m8.default=TB});var v8=Xe(function(y8){Object.defineProperty(y8,"__esModule",{value:!0});var AB=g8(),RB=[AB.default];y8.default=RB});var w8=Xe(function(b8){Object.defineProperty(b8,"__esModule",{value:!0});b8.contentVocabulary=b8.metadataVocabulary=void 0;b8.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];b8.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var k8=Xe(function(x8){Object.defineProperty(x8,"__esModule",{value:!0});var DB=K4(),NB=b3(),zB=p8(),jB=v8(),S8=w8(),UB=[DB.default,NB.default,(0,zB.default)(),jB.default,S8.metadataVocabulary,S8.contentVocabulary];x8.default=UB});var $8=Xe(function(E8){Object.defineProperty(E8,"__esModule",{value:!0});E8.DiscrError=void 0;var M8;(function(e){e.Tag="tag",e.Mapping="mapping"})(M8||(E8.DiscrError=M8={}))});var A8=Xe(function(P8){Object.defineProperty(P8,"__esModule",{value:!0});var fa=gt(),f_=$8(),T8=Op(),FB=hc(),qB=Mt(),BB={message:({params:{discrError:e,tagName:t}})=>e===f_.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>fa._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},HB={keyword:"discriminator",type:"object",schemaType:"object",error:BB,code(e){let{gen:t,data:r,schema:i,parentSchema:n,it:o}=e,{oneOf:s}=n;if(!o.opts.discriminator)throw Error("discriminator: requires discriminator option");let h=i.propertyName;if(typeof h!="string")throw Error("discriminator: requires propertyName");if(i.mapping)throw Error("discriminator: mapping is not supported");if(!s)throw Error("discriminator: requires oneOf keyword");let v=t.let("valid",!1),b=t.const("tag",fa._`${r}${(0,fa.getProperty)(h)}`);t.if(fa._`typeof ${b} == "string"`,()=>_(),()=>e.error(!1,{discrError:f_.DiscrError.Tag,tag:b,tagName:h})),e.ok(v);function _(){let x=S();t.if(!1);for(let M in x)t.elseIf(fa._`${b} === ${M}`),t.assign(v,g(x[M]));t.else(),e.error(!1,{discrError:f_.DiscrError.Mapping,tag:b,tagName:h}),t.endIf()}function g(x){let M=t.name("valid"),I=e.subschema({keyword:"oneOf",schemaProp:x},M);return e.mergeEvaluated(I,fa.Name),M}function S(){var x;let M={},I=T(n),$=!0;for(let C=0;C<s.length;C++){let N=s[C];if((N===null||N===void 0?void 0:N.$ref)&&!(0,qB.schemaHasRulesButRef)(N,o.self.RULES)){let ie=N.$ref;if(N=T8.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,ie),N instanceof T8.SchemaEnv)N=N.schema;if(N===void 0)throw new FB.default(o.opts.uriResolver,o.baseId,ie)}let B=(x=N===null||N===void 0?void 0:N.properties)===null||x===void 0?void 0:x[h];if(typeof B!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${h}"`);$=$&&(I||T(N)),P(B,C)}if(!$)throw Error(`discriminator: "${h}" must be required`);return M;function T({required:C}){return Array.isArray(C)&&C.includes(h)}function P(C,N){if(C.const)R(C.const,N);else if(C.enum)for(let B of C.enum)R(B,N);else throw Error(`discriminator: "properties/${h}" must have "const" or "enum"`)}function R(C,N){if(typeof C!="string"||C in M)throw Error(`discriminator: "${h}" values must be unique strings`);M[C]=N}}}};P8.default=HB});var R8=Xe(function(b_e,KB){KB.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var p_=Xe(function(ln,h_){Object.defineProperty(ln,"__esModule",{value:!0});ln.MissingRefError=ln.ValidationError=ln.CodeGen=ln.Name=ln.nil=ln.stringify=ln.str=ln._=ln.KeywordCxt=ln.Ajv=void 0;var VB=N4(),WB=k8(),GB=A8(),C8=R8(),JB=["/properties"],Yp="http://json-schema.org/draft-07/schema";class Mc extends VB.default{_addVocabularies(){if(super._addVocabularies(),WB.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(GB.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(C8,JB):C8;this.addMetaSchema(e,Yp,!1),this.refs["http://json-schema.org/schema"]=Yp}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Yp)?Yp:void 0)}}ln.Ajv=Mc;h_.exports=ln=Mc;h_.exports.Ajv=Mc;Object.defineProperty(ln,"__esModule",{value:!0});ln.default=Mc;var XB=fc();Object.defineProperty(ln,"KeywordCxt",{enumerable:!0,get:function(){return XB.KeywordCxt}});var ha=gt();Object.defineProperty(ln,"_",{enumerable:!0,get:function(){return ha._}});Object.defineProperty(ln,"str",{enumerable:!0,get:function(){return ha.str}});Object.defineProperty(ln,"stringify",{enumerable:!0,get:function(){return ha.stringify}});Object.defineProperty(ln,"nil",{enumerable:!0,get:function(){return ha.nil}});Object.defineProperty(ln,"Name",{enumerable:!0,get:function(){return ha.Name}});Object.defineProperty(ln,"CodeGen",{enumerable:!0,get:function(){return ha.CodeGen}});var YB=Rp();Object.defineProperty(ln,"ValidationError",{enumerable:!0,get:function(){return YB.default}});var QB=hc();Object.defineProperty(ln,"MissingRefError",{enumerable:!0,get:function(){return QB.default}})});var B8=Xe(function(F8){Object.defineProperty(F8,"__esModule",{value:!0});F8.formatNames=F8.fastFormats=F8.fullFormats=void 0;function ri(e,t){return{validate:e,compare:t}}F8.fullFormats={date:ri(z8,v_),time:ri(g_(!0),b_),"date-time":ri(O8(!0),U8),"iso-time":ri(g_(),j8),"iso-date-time":ri(O8(),L8),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:aH,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:pH,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:uH,int32:{type:"number",validate:dH},int64:{type:"number",validate:fH},float:{type:"number",validate:N8},double:{type:"number",validate:N8},password:!0,binary:!0};F8.fastFormats={...F8.fullFormats,date:ri(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,v_),time:ri(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,b_),"date-time":ri(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,U8),"iso-time":ri(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,j8),"iso-date-time":ri(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,L8),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};F8.formatNames=Object.keys(F8.fullFormats);function rH(e){return e%4===0&&(e%100!==0||e%400===0)}var nH=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,iH=[0,31,28,31,30,31,30,31,31,30,31,30,31];function z8(e){let t=nH.exec(e);if(!t)return!1;let r=+t[1],i=+t[2],n=+t[3];return i>=1&&i<=12&&n>=1&&n<=(i===2&&rH(r)?29:iH[i])}function v_(e,t){if(!(e&&t))return;if(e>t)return 1;if(e<t)return-1;return 0}var m_=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function g_(e){return function(r){let i=m_.exec(r);if(!i)return!1;let n=+i[1],o=+i[2],s=+i[3],h=i[4],v=i[5]==="-"?-1:1,b=+(i[6]||0),_=+(i[7]||0);if(b>23||_>59||e&&!h)return!1;if(n<=23&&o<=59&&s<60)return!0;let g=o-_*v,S=n-b*v-(g<0?1:0);return(S===23||S===-1)&&(g===59||g===-1)&&s<61}}function b_(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),i=new Date("2020-01-01T"+t).valueOf();if(!(r&&i))return;return r-i}function j8(e,t){if(!(e&&t))return;let r=m_.exec(e),i=m_.exec(t);if(!(r&&i))return;if(e=r[1]+r[2]+r[3],t=i[1]+i[2]+i[3],e>t)return 1;if(e<t)return-1;return 0}var y_=/t|\s/i;function O8(e){let t=g_(e);return function(i){let n=i.split(y_);return n.length===2&&z8(n[0])&&t(n[1])}}function U8(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),i=new Date(t).valueOf();if(!(r&&i))return;return r-i}function L8(e,t){if(!(e&&t))return;let[r,i]=e.split(y_),[n,o]=t.split(y_),s=v_(r,n);if(s===void 0)return;return s||b_(i,o)}var oH=/\/|:/,sH=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function aH(e){return oH.test(e)&&sH.test(e)}var D8=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function uH(e){return D8.lastIndex=0,D8.test(e)}var lH=-2147483648,cH=2147483647;function dH(e){return Number.isInteger(e)&&e<=cH&&e>=lH}function fH(e){return Number.isInteger(e)}function N8(){return!0}var hH=/[^\\]\\Z/;function pH(e){if(hH.test(e))return!1;try{return new RegExp(e),!0}catch(t){return!1}}});var Z8=Xe(function(H8){Object.defineProperty(H8,"__esModule",{value:!0});H8.formatLimitDefinition=void 0;var gH=p_(),Vn=gt(),uo=Vn.operators,Qp={formatMaximum:{okStr:"<=",ok:uo.LTE,fail:uo.GT},formatMinimum:{okStr:">=",ok:uo.GTE,fail:uo.LT},formatExclusiveMaximum:{okStr:"<",ok:uo.LT,fail:uo.GTE},formatExclusiveMinimum:{okStr:">",ok:uo.GT,fail:uo.LTE}},yH={message:({keyword:e,schemaCode:t})=>Vn.str`should be ${Qp[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>Vn._`{comparison: ${Qp[e].okStr}, limit: ${t}}`};H8.formatLimitDefinition={keyword:Object.keys(Qp),type:"string",schemaType:"string",$data:!0,error:yH,code(e){let{gen:t,data:r,schemaCode:i,keyword:n,it:o}=e,{opts:s,self:h}=o;if(!s.validateFormats)return;let v=new gH.KeywordCxt(o,h.RULES.all.format.definition,"format");if(v.$data)b();else _();function b(){let S=t.scopeValue("formats",{ref:h.formats,code:s.code.formats}),x=t.const("fmt",Vn._`${S}[${v.schemaCode}]`);e.fail$data((0,Vn.or)(Vn._`typeof ${x} != "object"`,Vn._`${x} instanceof RegExp`,Vn._`typeof ${x}.compare != "function"`,g(x)))}function _(){let S=v.schema,x=h.formats[S];if(!x||x===!0)return;if(typeof x!="object"||x instanceof RegExp||typeof x.compare!="function")throw Error(`"${n}": format "${S}" does not define "compare" function`);let M=t.scopeValue("formats",{key:S,ref:x,code:s.code.formats?Vn._`${s.code.formats}${(0,Vn.getProperty)(S)}`:void 0});e.fail$data(g(M))}function g(S){return Vn._`${S}.compare(${r}, ${i}) ${Qp[n].fail} 0`}},dependencies:["format"]};var vH=(e)=>(e.addKeyword(H8.formatLimitDefinition),e);H8.default=vH});var G8=Xe(function(Ec,W8){Object.defineProperty(Ec,"__esModule",{value:!0});var pa=B8(),_H=Z8(),S_=gt(),K8=new S_.Name("fullFormats"),wH=new S_.Name("fastFormats"),x_=(e,t={keywords:!0})=>{if(Array.isArray(t))return V8(e,t,pa.fullFormats,K8),e;let[r,i]=t.mode==="fast"?[pa.fastFormats,wH]:[pa.fullFormats,K8],n=t.formats||pa.formatNames;if(V8(e,n,r,i),t.keywords)(0,_H.default)(e);return e};x_.get=(e,t="full")=>{let i=(t==="fast"?pa.fastFormats:pa.fullFormats)[e];if(!i)throw Error(`Unknown format "${e}"`);return i};function V8(e,t,r,i){var n,o;(n=(o=e.opts.code).formats)!==null&&n!==void 0||(o.formats=S_._`require("ajv-formats/dist/formats").${i}`);for(let s of t)e.addFormat(s,r[s])}W8.exports=Ec=x_;Object.defineProperty(Ec,"__esModule",{value:!0});Ec.default=x_});var OH=typeof String.prototype.isWellFormed==="function"?Function.prototype.call.bind(String.prototype.isWellFormed):void 0,DH=typeof String.prototype.toWellFormed==="function"?Function.prototype.call.bind(String.prototype.toWellFormed):void 0;class On extends Error{}function z_(e,t,r){return new Promise((i,n)=>{if(t?.aborted){if(r?.throwOnAbort||r?.abortError)n(r.abortError?.()??Error("aborted"));else i();return}let o=setTimeout((h,v,b)=>{h?.removeEventListener("abort",v),b()},e,t,s,i);function s(){if(clearTimeout(o),r?.throwOnAbort||r?.abortError)n(r.abortError?.()??Error("aborted"));else i()}if(t?.addEventListener("abort",s,{once:!0}),r?.unref)o.unref()})}var{writeFileSync:Rpe}=(()=>({}));function yE(){this.__data__=[],this.size=0}var j_=yE;function vE(e,t){return e===t||e!==e&&t!==t}var U_=vE;function bE(e,t){var r=e.length;while(r--)if(U_(e[r][0],t))return r;return-1}var Ti=bE;var _E=Array.prototype,wE=_E.splice;function SE(e){var t=this.__data__,r=Ti(t,e);if(r<0)return!1;var i=t.length-1;if(r==i)t.pop();else wE.call(t,r,1);return--this.size,!0}var L_=SE;function xE(e){var t=this.__data__,r=Ti(t,e);return r<0?void 0:t[r][1]}var F_=xE;function kE(e){return Ti(this.__data__,e)>-1}var q_=kE;function ME(e,t){var r=this.__data__,i=Ti(r,e);if(i<0)++this.size,r.push([e,t]);else r[i][1]=t;return this}var B_=ME;function Yo(e){var t=-1,r=e==null?0:e.length;this.clear();while(++t<r){var i=e[t];this.set(i[0],i[1])}}Yo.prototype.clear=j_;Yo.prototype.delete=L_;Yo.prototype.get=F_;Yo.prototype.has=q_;Yo.prototype.set=B_;var H_=Yo;var EE=typeof global=="object"&&global&&global.Object===Object&&global,Z_=EE;var IE=typeof self=="object"&&self&&self.Object===Object&&self,$E=Z_||IE||Function("return this")(),Qo=$E;var TE=Qo.Symbol,es=TE;var K_=Object.prototype,PE=K_.hasOwnProperty,AE=K_.toString,ya=es?es.toStringTag:void 0;function RE(e){var t=PE.call(e,ya),r=e[ya];try{e[ya]=void 0;var i=!0}catch(o){}var n=AE.call(e);if(i)if(t)e[ya]=r;else delete e[ya];return n}var V_=RE;var CE=Object.prototype,OE=CE.toString;function DE(e){return OE.call(e)}var W_=DE;var NE="[object Null]",zE="[object Undefined]",G_=es?es.toStringTag:void 0;function jE(e){if(e==null)return e===void 0?zE:NE;return G_&&G_ in Object(e)?V_(e):W_(e)}var J_=jE;function UE(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var $c=UE;var LE="[object AsyncFunction]",FE="[object Function]",qE="[object GeneratorFunction]",BE="[object Proxy]";function HE(e){if(!$c(e))return!1;var t=J_(e);return t==FE||t==qE||t==LE||t==BE}var X_=HE;var ZE=Qo["__core-js_shared__"],Tc=ZE;var Y_=function(){var e=/[^.]+$/.exec(Tc&&Tc.keys&&Tc.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function KE(e){return!!Y_&&Y_ in e}var Q_=KE;var VE=Function.prototype,WE=VE.toString;function GE(e){if(e!=null){try{return WE.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var e1=GE;var JE=/[\\^$.*+?()[\]{}|]/g,XE=/^\[object .+?Constructor\]$/,YE=Function.prototype,QE=Object.prototype,eI=YE.toString,tI=QE.hasOwnProperty,rI=RegExp("^"+eI.call(tI).replace(JE,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function nI(e){if(!$c(e)||Q_(e))return!1;var t=X_(e)?rI:XE;return t.test(e1(e))}var t1=nI;function iI(e,t){return e==null?void 0:e[t]}var r1=iI;function oI(e,t){var r=r1(e,t);return t1(r)?r:void 0}var Pc=oI;var sI=Pc(Qo,"Map"),n1=sI;var aI=Pc(Object,"create"),ni=aI;function uI(){this.__data__=ni?ni(null):{},this.size=0}var i1=uI;function lI(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var o1=lI;var cI="__lodash_hash_undefined__",dI=Object.prototype,fI=dI.hasOwnProperty;function hI(e){var t=this.__data__;if(ni){var r=t[e];return r===cI?void 0:r}return fI.call(t,e)?t[e]:void 0}var s1=hI;var pI=Object.prototype,mI=pI.hasOwnProperty;function gI(e){var t=this.__data__;return ni?t[e]!==void 0:mI.call(t,e)}var a1=gI;var yI="__lodash_hash_undefined__";function vI(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=ni&&t===void 0?yI:t,this}var u1=vI;function ts(e){var t=-1,r=e==null?0:e.length;this.clear();while(++t<r){var i=e[t];this.set(i[0],i[1])}}ts.prototype.clear=i1;ts.prototype.delete=o1;ts.prototype.get=s1;ts.prototype.has=a1;ts.prototype.set=u1;var nm=ts;function bI(){this.size=0,this.__data__={hash:new nm,map:new(n1||H_),string:new nm}}var l1=bI;function _I(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var c1=_I;function wI(e,t){var r=e.__data__;return c1(t)?r[typeof t=="string"?"string":"hash"]:r.map}var Pi=wI;function SI(e){var t=Pi(this,e).delete(e);return this.size-=t?1:0,t}var d1=SI;function xI(e){return Pi(this,e).get(e)}var f1=xI;function kI(e){return Pi(this,e).has(e)}var h1=kI;function MI(e,t){var r=Pi(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}var p1=MI;function rs(e){var t=-1,r=e==null?0:e.length;this.clear();while(++t<r){var i=e[t];this.set(i[0],i[1])}}rs.prototype.clear=l1;rs.prototype.delete=d1;rs.prototype.get=f1;rs.prototype.has=h1;rs.prototype.set=p1;var im=rs;var{realpathSync:Qw}=(()=>({}));var EI="Expected a function";function om(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw TypeError(EI);var r=function(){var i=arguments,n=t?t.apply(this,i):i[0],o=r.cache;if(o.has(n))return o.get(n);var s=e.apply(this,i);return r.cache=o.set(n,s)||o,s};return r.cache=new(om.Cache||im),r}om.Cache=im;var Er=om;var m1=function(){return"/"};var va=()=>globalThis.crypto.randomUUID();Kr();Kr();var Ww="[\\w-]{1,63}",_A=new RegExp(`^${Ww}$`),qK=new RegExp(`^a(?:${Ww}-)?[0-9a-f]{16}$`);function Gw(e,t){let r=Buffer.from(t.replace(/-/g,""),"hex"),i=Fm("sha1").update(r).update(Buffer.from(e,"utf8")).digest();i[6]=i[6]&15|80,i[8]=i[8]&63|128;let n=i.subarray(0,16).toString("hex");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20,32)}`}var wA="3ab19d7e-9f35-45c2-926e-75e271cc60b3";function Jw(){let e=process.env.CLAUDE_CODE_REMOTE_SESSION_ID?.trim();return e?Gw(e,wA):null}var Xw=globalThis.process?.getBuiltinModule?.("async_hooks"),qm=Xw?(e)=>Xw.AsyncResource.bind(e):(e)=>e;function yo(e){if(!e)return!1;if(typeof e==="boolean")return e;let t=String(e).toLowerCase().trim();return["1","true","yes","on"].includes(t)}function Di(){let e=new Set;return{subscribe(t){let r=qm(t);return e.add(r),()=>{e.delete(r)}},emit(...t){let r;for(let i of e)try{i(...t)}catch(n){(r??=[]).push(n)}if(r)throw r.length===1?r[0]:AggregateError(r,"Signal listener(s) threw")},clear(){e.clear()}}}function Yw(){return{sent:new Set,rejected:new Set}}var xA={renderTarget:"ink",workspace:"local",canDrive:!0,transcriptSource:"local-jsonl",remote:null};function kA(){let e="";if(typeof process<"u"&&typeof process.cwd==="function"&&typeof Qw==="function"){let r=m1();try{e=eS(Qw(r))}catch{e=eS(r)}}return{originalCwd:e,projectRoot:e,totalCostUSD:0,totalAPIDuration:0,totalAPIDurationWithoutRetries:0,totalToolDuration:0,startTime:Date.now(),sessionLogicalStartTime:void 0,lastInteractionTime:Date.now(),totalLinesAdded:0,totalLinesRemoved:0,hasUnknownModelCost:!1,cwd:e,modelUsage:{},mainLoopModelOverride:void 0,refusalFallbackOccurred:!1,refusalFallbackHeaderArmed:!1,refusalFallbackLatchOriginRequestId:void 0,refusalFallbackModelLatch:void 0,sdkDialogHostActive:!1,sdkSupportedDialogKinds:void 0,sdkSupportedDialogKindsSource:void 0,replConfigArgv:[],settingsEffortAtStartup:void 0,initialMainLoopModel:void 0,resolvedOrgDefault:void 0,modelStrings:null,isInteractive:!1,thinkingDisplayExplicit:!1,permissionPromptToolName:void 0,attacherCaps:null,hasStreamingInput:!1,modelOverrideOptOutForSession:!1,rendererMode:void 0,strictToolResultPairing:!1,memoryToggledOff:!1,teamMemoryServerStatus:void 0,sdkAgentProgressSummariesEnabled:!1,userMsgOptIn:!1,searchToolsOptIn:!1,clientType:"cli",sessionSource:void 0,sessionStartType:"fresh",questionPreviewFormat:void 0,sessionIngressToken:void 0,oauthTokenFromFd:void 0,oauthTokenFromBgSnapshot:!1,oauthScopesFromFd:void 0,apiKeyFromFd:void 0,gatewayAuth:null,gatewayRefreshInFlight:null,startupPolicySnapshot:void 0,flagSettingsPath:void 0,flagSettingsExpectedContent:void 0,flagSettingsInline:null,parentManagedSettings:null,allowedSettingSources:["userSettings","projectSettings","localSettings","flagSettings","policySettings"],meter:null,sessionCounter:null,locCounter:null,prCounter:null,commitCounter:null,costCounter:null,tokenCounter:null,codeEditToolDecisionCounter:null,activeTimeCounter:null,statsStore:null,sessionId:Jw()??va(),mainAgentId:null,parentSessionId:void 0,loggerProvider:null,eventLogger:null,pendingOTelEvents:[],meterProvider:null,tracerProvider:null,cachedTelemetryResource:null,cachedOtlpHttpAgentFactory:{direct:null,proxied:null},foundryDeploymentCapabilities:new Map,agentColorMap:new Map,agentColorIndex:0,lastAPIRequest:null,lastCancelledAPIMessageId:null,lastAPIRequestMessages:null,lastClassifierRequests:null,cachedClaudeMdContent:null,inMemoryErrorLog:[],inlinePlugins:[],inlinePluginsNoMcp:[],inlinePluginUrls:[],syncedPluginDirs:[],chromeFlagOverride:void 0,teammateAgentId:void 0,onboardingShownThisSession:!1,useCoworkPlugins:!1,disableSlashCommands:!1,sessionBypassPermissionsMode:!1,scheduledTasksEnabled:!1,sessionPrResolved:!1,sessionCronTasks:[],loopChainStartedAt:Object.create(null),loopTickInFlightPrompt:null,loopConsecutiveKeepalives:0,loopEnded:!1,sessionCreatedTeams:new Set,surfacedHookSpawnFailures:new Set,bareMcpServerMatchersWarned:new Set,inheritedTeamName:void 0,sessionTrustAccepted:!1,sessionPersistenceDisabled:!1,hasExitedPlanMode:!1,needsPlanModeExitAttachment:!1,needsAutoModeExitAttachment:!1,lspRecommendationShownThisSession:!1,initJsonSchema:null,registeredHooks:null,planSlugCache:new Map,teleportedSessionInfo:null,invokedSkills:new Map,slowOperations:[],sdkBetas:void 0,longContext1mCreditsBlocked:!1,fableCreditsRequired:!1,fableConsentSessionFallback:!1,fableBridgeDialogTimedOut:!1,fableConsentDialogInteracted:!1,sdkOAuthTokenRefreshCallback:null,hostAuthTokenRefreshCallback:null,mainThreadAgentType:void 0,mainThreadAgentHooks:void 0,sessionSkillAllowlist:void 0,caps:xA,replBridgeActive:!1,mainLoopBusy:!1,directConnectServerUrl:void 0,mcpConnectNonBlocking:!1,deferredToolStubGateLatch:null,strictMcpConfig:!1,cliSessionConfigCarried:!1,sessionApprovedMcpServers:[],activeRoutine:void 0,systemPromptSectionCache:new Map,lastEmittedDate:null,additionalDirectoriesForClaudeMd:[],allowedChannels:[],hasDevChannels:!1,sessionProjectDir:null,promptCache1hAllowlist:null,stickyBetas:Yw(),thinkingTypeOverrides:new Map,inferenceProfileBackingModels:new Map,promptId:null,promptIndex:0,lastMainRequestId:void 0,lastMainThreadCacheTtlMs:null,lastApiCompletionTimestamp:null,pendingPostCompaction:!1}}var MA=kA(),EA=()=>{return};function Bm(){return EA()?.sessionId??MA.sessionId}var IA=Di(),MV=IA.subscribe;function eS(e){return process.platform==="darwin"?e.normalize("NFC"):e}var $A=Di(),EV=$A.subscribe;var TA=Di(),IV=TA.subscribe;var PA=Di();var $V=PA.subscribe;var AA=Di();var TV=AA.subscribe;var{appendFile:Z2,mkdir:hC,rename:K2,stat:pC,symlink:mC,unlink:Pv}=(()=>({}));Dn();function uS({writeFn:e,flushIntervalMs:t=1000,maxBufferSize:r=100,maxBufferBytes:i=1/0,immediateMode:n=!1}){let o=[],s=0,h=null,v=null;function b(){if(h)clearTimeout(h),h=null}function _(M){try{e(M)}catch{}}function g(){if(v)_(v.join("")),v=null;if(o.length===0)return;_(o.join("")),o=[],s=0,b()}function S(){if(!h)h=setTimeout(g,t)}function x(){if(v){v.push(...o),o=[],s=0,b();return}let M=o;o=[],s=0,b(),v=M,setImmediate(()=>{let I=v;if(v=null,I)_(I.join(""))})}return{write(M){if(n){_(M);return}if(o.push(M),s+=M.length,S(),o.length>=r||s>=i)x()},flush:g,dispose(){g()}}}var{realpathSync:OV}=(()=>({}));var Wc=function(){return"/"};Dn();function Wm(e){return process.platform==="darwin"?e.normalize("NFC"):e}function cS(e){return/^[\\/]{2}/.test(e)}function dS(e){return/^[\\/]{2}wsl(\$|\.localhost)[\\/]/i.test(e)}function OA(e){if(e.startsWith("\\\\?\\UNC\\"))return"\\\\"+e.slice(8);if(e.startsWith("\\\\?\\")&&e.length>=7&&e[5]===":")return e.slice(4);return e}function fS(e){if(/^\\\\\?\\volume\{/i.test(e))return lS(e);let t=OA(e);if(t!==e&&lS(t))return!0;return cS(t)&&!dS(t)}function lS(e){return/(^|[\\/])\.{1,2}([\\/]|$)/.test(e)||e.includes("/")}function DA(e){if(typeof e==="function")return e;if(Symbol.asyncDispose in e)return()=>e[Symbol.asyncDispose]();return()=>e[Symbol.dispose]()}class Gm{#e=new Set;register(e){let t=DA(e);this.#e.add(t);let r=()=>{this.#e.delete(t)};return Object.assign(r,{[Symbol.dispose]:r})}async drain(){let e=Array.from(this.#e);this.#e.clear(),await Promise.all(e.map(async(t)=>t()))}async[Symbol.asyncDispose](){await this.drain()}get sizeForTesting(){return this.#e.size}}var NA=new Gm;function hS(e){return NA.register(e)}var jV=new Gm;var pS=Er((e)=>{if(!e||e.trim()==="")return null;let t=e.split(",").map((o)=>o.trim()).filter(Boolean);if(t.length===0)return null;let r=t.some((o)=>o.startsWith("!")),i=t.some((o)=>!o.startsWith("!"));if(r&&i)return null;let n=t.map((o)=>o.replace(/^!/,"").toLowerCase());return{include:r?[]:n,exclude:r?n:[],isExclusive:r}});function zA(e){let t=[],r=e.match(/^MCP server ["']([^"']+)["']/);if(r&&r[1])t.push("mcp"),t.push(r[1].toLowerCase());else{let o=e.match(/^([^:[]+):/);if(o&&o[1])t.push(o[1].trim().toLowerCase())}let i=e.match(/^\[([^\]]+)]/);if(i&&i[1])t.push(i[1].trim().toLowerCase());if(e.toLowerCase().includes("1p event:"))t.push("1p");let n=e.match(/:\s*([^:]+?)(?:\s+(?:type|mode|status|event))?:/);if(n&&n[1]){let o=n[1].trim().toLowerCase();if(o.length<30&&!o.includes(" "))t.push(o)}return Array.from(new Set(t))}function jA(e,t){if(!t)return!0;if(e.length===0)return!1;if(t.isExclusive)return!e.some((r)=>t.exclude.includes(r));else return e.some((r)=>t.include.includes(r))}function mS(e,t){if(!t)return!0;let r=zA(e);return jA(r,t)}Dn();var qe={};wn(qe,{xid:()=>jR,void:()=>o5,uuidv7:()=>AR,uuidv6:()=>PR,uuidv4:()=>TR,uuid:()=>$R,url:()=>RR,uppercase:()=>vu,unknown:()=>qt,union:()=>Dt,undefined:()=>n5,ulid:()=>zR,uint64:()=>t5,uint32:()=>YR,tuple:()=>l5,trim:()=>ku,treeifyError:()=>Yc,transform:()=>zy,toUpperCase:()=>Eu,toLowerCase:()=>Mu,toJSONSchema:()=>xs,templateLiteral:()=>v5,symbol:()=>r5,superRefine:()=>xx,success:()=>g5,stringbool:()=>w5,stringFormat:()=>WR,string:()=>de,strictObject:()=>u5,startsWith:()=>_u,size:()=>mu,setErrorMap:()=>k5,set:()=>f5,safeParseAsync:()=>hy,safeParse:()=>fy,registry:()=>Va,regexes:()=>Fi,regex:()=>gu,refine:()=>Sx,record:()=>Nt,readonly:()=>gx,property:()=>ny,promise:()=>b5,prettifyError:()=>Qc,preprocess:()=>Gf,prefault:()=>lx,positive:()=>Qg,pipe:()=>qf,partialRecord:()=>c5,parseAsync:()=>dy,parse:()=>cy,overwrite:()=>fi,optional:()=>Lt,object:()=>Qe,number:()=>It,nullish:()=>m5,nullable:()=>Ff,null:()=>Bf,normalize:()=>xu,nonpositive:()=>ty,nonoptional:()=>cx,nonnegative:()=>ry,never:()=>Hf,negative:()=>ey,nativeEnum:()=>h5,nanoid:()=>OR,nan:()=>y5,multipleOf:()=>Eo,minSize:()=>Io,minLength:()=>Hi,mime:()=>Su,maxSize:()=>_s,maxLength:()=>ws,map:()=>d5,lte:()=>kn,lt:()=>ci,lowercase:()=>yu,looseObject:()=>Lr,locales:()=>vs,literal:()=>tt,length:()=>Ss,lazy:()=>bx,ksuid:()=>UR,keyof:()=>a5,jwt:()=>VR,json:()=>S5,iso:()=>ks,ipv6:()=>FR,ipv4:()=>LR,intersection:()=>Cu,int64:()=>e5,int32:()=>XR,int:()=>py,instanceof:()=>_5,includes:()=>bu,guid:()=>IR,gte:()=>rn,gt:()=>di,globalRegistry:()=>tn,getErrorMap:()=>M5,function:()=>Of,formatError:()=>fs,float64:()=>JR,float32:()=>GR,flattenError:()=>ds,file:()=>p5,enum:()=>Vr,endsWith:()=>wu,emoji:()=>CR,email:()=>ER,e164:()=>KR,discriminatedUnion:()=>Vf,date:()=>s5,custom:()=>Fy,cuid2:()=>NR,cuid:()=>DR,core:()=>Nn,config:()=>rr,coerce:()=>qy,clone:()=>Ur,cidrv6:()=>BR,cidrv4:()=>qR,check:()=>wx,catch:()=>hx,boolean:()=>or,bigint:()=>QR,base64url:()=>ZR,base64:()=>HR,array:()=>_t,any:()=>i5,_default:()=>ax,_ZodString:()=>my,ZodXID:()=>xy,ZodVoid:()=>JS,ZodUnknown:()=>WS,ZodUnion:()=>Oy,ZodUndefined:()=>ZS,ZodUUID:()=>hi,ZodURL:()=>yy,ZodULID:()=>Sy,ZodType:()=>vt,ZodTuple:()=>ex,ZodTransform:()=>Ny,ZodTemplateLiteral:()=>yx,ZodSymbol:()=>HS,ZodSuccess:()=>dx,ZodStringFormat:()=>Ut,ZodString:()=>Tu,ZodSet:()=>rx,ZodRecord:()=>Dy,ZodRealError:()=>Ms,ZodReadonly:()=>mx,ZodPromise:()=>_x,ZodPrefault:()=>ux,ZodPipe:()=>Ly,ZodOptional:()=>jy,ZodObject:()=>Kf,ZodNumberFormat:()=>Es,ZodNumber:()=>Pu,ZodNullable:()=>ox,ZodNull:()=>KS,ZodNonOptional:()=>Uy,ZodNever:()=>GS,ZodNanoID:()=>by,ZodNaN:()=>px,ZodMap:()=>tx,ZodLiteral:()=>nx,ZodLazy:()=>vx,ZodKSUID:()=>ky,ZodJWT:()=>Ry,ZodIssueCode:()=>x5,ZodIntersection:()=>QS,ZodISOTime:()=>jf,ZodISODuration:()=>Uf,ZodISODateTime:()=>Nf,ZodISODate:()=>zf,ZodIPv6:()=>Ey,ZodIPv4:()=>My,ZodGUID:()=>Lf,ZodFile:()=>ix,ZodError:()=>kR,ZodEnum:()=>$u,ZodEmoji:()=>vy,ZodEmail:()=>gy,ZodE164:()=>Ay,ZodDiscriminatedUnion:()=>YS,ZodDefault:()=>sx,ZodDate:()=>Zf,ZodCustomStringFormat:()=>BS,ZodCustom:()=>Wf,ZodCatch:()=>fx,ZodCUID2:()=>wy,ZodCUID:()=>_y,ZodCIDRv6:()=>$y,ZodCIDRv4:()=>Iy,ZodBoolean:()=>Au,ZodBigIntFormat:()=>Cy,ZodBigInt:()=>Ru,ZodBase64URL:()=>Py,ZodBase64:()=>Ty,ZodArray:()=>XS,ZodAny:()=>VS,TimePrecision:()=>cf,NEVER:()=>Gc,$output:()=>af,$input:()=>uf,$brand:()=>Jc});var Nn={};wn(Nn,{version:()=>Q0,util:()=>Be,treeifyError:()=>Yc,toJSONSchema:()=>xs,toDotPath:()=>vS,safeParseAsync:()=>Li,safeParse:()=>Ui,registry:()=>Va,regexes:()=>Fi,prettifyError:()=>Qc,parseAsync:()=>So,parse:()=>wo,locales:()=>vs,isValidJWT:()=>NS,isValidBase64URL:()=>DS,isValidBase64:()=>og,globalRegistry:()=>tn,globalConfig:()=>Ra,function:()=>Of,formatError:()=>fs,flattenError:()=>ds,config:()=>rr,clone:()=>Ur,_xid:()=>ou,_void:()=>Ef,_uuidv7:()=>Ya,_uuidv6:()=>Xa,_uuidv4:()=>Ja,_uuid:()=>Ga,_url:()=>Qa,_uppercase:()=>vu,_unknown:()=>Mo,_union:()=>rR,_undefined:()=>Sf,_ulid:()=>iu,_uint64:()=>_f,_uint32:()=>gf,_tuple:()=>iy,_trim:()=>ku,_transform:()=>dR,_toUpperCase:()=>Eu,_toLowerCase:()=>Mu,_templateLiteral:()=>_R,_symbol:()=>wf,_success:()=>gR,_stringbool:()=>Rf,_stringFormat:()=>Cf,_string:()=>lf,_startsWith:()=>_u,_size:()=>mu,_set:()=>aR,_safeParseAsync:()=>nd,_safeParse:()=>rd,_regex:()=>gu,_refine:()=>Af,_record:()=>oR,_readonly:()=>bR,_property:()=>ny,_promise:()=>SR,_positive:()=>Qg,_pipe:()=>vR,_parseAsync:()=>td,_parse:()=>ed,_overwrite:()=>fi,_optional:()=>fR,_number:()=>df,_nullable:()=>hR,_null:()=>xf,_normalize:()=>xu,_nonpositive:()=>ty,_nonoptional:()=>mR,_nonnegative:()=>ry,_never:()=>Mf,_negative:()=>ey,_nativeEnum:()=>lR,_nanoid:()=>tu,_nan:()=>$f,_multipleOf:()=>Eo,_minSize:()=>Io,_minLength:()=>Hi,_min:()=>rn,_mime:()=>Su,_maxSize:()=>_s,_maxLength:()=>ws,_max:()=>kn,_map:()=>sR,_lte:()=>kn,_lt:()=>ci,_lowercase:()=>yu,_literal:()=>cR,_length:()=>Ss,_lazy:()=>wR,_ksuid:()=>su,_jwt:()=>pu,_isoTime:()=>Vg,_isoDuration:()=>Wg,_isoDateTime:()=>Zg,_isoDate:()=>Kg,_ipv6:()=>uu,_ipv4:()=>au,_intersection:()=>iR,_int64:()=>bf,_int32:()=>mf,_int:()=>ff,_includes:()=>bu,_guid:()=>bs,_gte:()=>rn,_gt:()=>di,_float64:()=>pf,_float32:()=>hf,_file:()=>Tf,_enum:()=>uR,_endsWith:()=>wu,_emoji:()=>eu,_email:()=>Wa,_e164:()=>hu,_discriminatedUnion:()=>nR,_default:()=>pR,_date:()=>If,_custom:()=>Pf,_cuid2:()=>nu,_cuid:()=>ru,_coercedString:()=>Hg,_coercedNumber:()=>Gg,_coercedDate:()=>Yg,_coercedBoolean:()=>Jg,_coercedBigint:()=>Xg,_cidrv6:()=>cu,_cidrv4:()=>lu,_catch:()=>yR,_boolean:()=>yf,_bigint:()=>vf,_base64url:()=>fu,_base64:()=>du,_array:()=>Iu,_any:()=>kf,TimePrecision:()=>cf,NEVER:()=>Gc,JSONSchemaGenerator:()=>Df,JSONSchema:()=>LS,Doc:()=>ad,$output:()=>af,$input:()=>uf,$constructor:()=>ne,$brand:()=>Jc,$ZodXID:()=>bd,$ZodVoid:()=>zd,$ZodUnknown:()=>ko,$ZodUnion:()=>Ha,$ZodUndefined:()=>Cd,$ZodUUID:()=>dd,$ZodURL:()=>hd,$ZodULID:()=>vd,$ZodType:()=>ut,$ZodTuple:()=>Bi,$ZodTransform:()=>gs,$ZodTemplateLiteral:()=>rf,$ZodSymbol:()=>Rd,$ZodSuccess:()=>Yd,$ZodStringFormat:()=>Ot,$ZodString:()=>qi,$ZodSet:()=>Bd,$ZodRegistry:()=>Ka,$ZodRecord:()=>Fd,$ZodRealError:()=>cs,$ZodReadonly:()=>tf,$ZodPromise:()=>nf,$ZodPrefault:()=>Jd,$ZodPipe:()=>ys,$ZodOptional:()=>Vd,$ZodObject:()=>Ba,$ZodNumberFormat:()=>Pd,$ZodNumber:()=>Fa,$ZodNullable:()=>Wd,$ZodNull:()=>Od,$ZodNonOptional:()=>Xd,$ZodNever:()=>Nd,$ZodNanoID:()=>md,$ZodNaN:()=>ef,$ZodMap:()=>qd,$ZodLiteral:()=>Zd,$ZodLazy:()=>of,$ZodKSUID:()=>_d,$ZodJWT:()=>$d,$ZodIntersection:()=>Ld,$ZodISOTime:()=>ng,$ZodISODuration:()=>ig,$ZodISODateTime:()=>tg,$ZodISODate:()=>rg,$ZodIPv6:()=>Sd,$ZodIPv4:()=>wd,$ZodGUID:()=>cd,$ZodFunction:()=>oy,$ZodFile:()=>Kd,$ZodError:()=>La,$ZodEnum:()=>Hd,$ZodEmoji:()=>pd,$ZodEmail:()=>fd,$ZodE164:()=>Id,$ZodDiscriminatedUnion:()=>Ud,$ZodDefault:()=>Gd,$ZodDate:()=>jd,$ZodCustomStringFormat:()=>Td,$ZodCustom:()=>sf,$ZodCheckUpperCase:()=>K0,$ZodCheckStringFormat:()=>hs,$ZodCheckStartsWith:()=>W0,$ZodCheckSizeEquals:()=>L0,$ZodCheckRegex:()=>H0,$ZodCheckProperty:()=>J0,$ZodCheckOverwrite:()=>Y0,$ZodCheckNumberFormat:()=>N0,$ZodCheckMultipleOf:()=>D0,$ZodCheckMinSize:()=>U0,$ZodCheckMinLength:()=>q0,$ZodCheckMimeType:()=>X0,$ZodCheckMaxSize:()=>j0,$ZodCheckMaxLength:()=>F0,$ZodCheckLowerCase:()=>Z0,$ZodCheckLessThan:()=>od,$ZodCheckLengthEquals:()=>B0,$ZodCheckIncludes:()=>V0,$ZodCheckGreaterThan:()=>sd,$ZodCheckEndsWith:()=>G0,$ZodCheckBigIntFormat:()=>z0,$ZodCheck:()=>Ht,$ZodCatch:()=>Qd,$ZodCUID2:()=>yd,$ZodCUID:()=>gd,$ZodCIDRv6:()=>kd,$ZodCIDRv4:()=>xd,$ZodBoolean:()=>ps,$ZodBigIntFormat:()=>Ad,$ZodBigInt:()=>qa,$ZodBase64URL:()=>Ed,$ZodBase64:()=>Md,$ZodAsyncError:()=>ui,$ZodArray:()=>ms,$ZodAny:()=>Dd});var Gc=Object.freeze({status:"aborted"});function ne(e,t,r){function i(h,v){var b;Object.defineProperty(h,"_zod",{value:h._zod??{},enumerable:!1}),(b=h._zod).traits??(b.traits=new Set),h._zod.traits.add(e),t(h,v);for(let _ in s.prototype)if(!(_ in h))Object.defineProperty(h,_,{value:s.prototype[_].bind(h)});h._zod.constr=s,h._zod.def=v}let n=r?.Parent??Object;class o extends n{}Object.defineProperty(o,"name",{value:e});function s(h){var v;let b=r?.Parent?new o:this;i(b,h),(v=b._zod).deferred??(v.deferred=[]);for(let _ of b._zod.deferred)_();return b}return Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:(h)=>{if(r?.Parent&&h instanceof r.Parent)return!0;return h?._zod?.traits?.has(e)}}),Object.defineProperty(s,"name",{value:e}),s}var Jc=Symbol("zod_brand");class ui extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}var Ra={};function rr(e){if(e)Object.assign(Ra,e);return Ra}var Be={};wn(Be,{unwrapMessage:()=>Ca,stringifyPrimitive:()=>Ve,required:()=>t9,randomString:()=>KA,propertyKeyTypes:()=>za,promiseAllObject:()=>ZA,primitiveTypes:()=>t0,prefixIssues:()=>en,pick:()=>JA,partial:()=>e9,optionalKeys:()=>r0,omit:()=>XA,numKeys:()=>VA,nullish:()=>ji,normalizeParams:()=>Fe,merge:()=>QA,jsonStringifyReplacer:()=>Xm,joinValues:()=>be,issue:()=>o0,isPlainObject:()=>ls,isObject:()=>us,getSizableOrigin:()=>ja,getParsedType:()=>WA,getLengthableOrigin:()=>Ua,getEnumValues:()=>Oa,getElementAtPath:()=>HA,floatSafeRemainder:()=>Ym,finalizeIssue:()=>fn,extend:()=>YA,escapeRegex:()=>li,esc:()=>bo,defineLazy:()=>$t,createTransparentProxy:()=>GA,clone:()=>Ur,cleanRegex:()=>Na,cleanEnum:()=>r9,captureStackTrace:()=>Xc,cached:()=>Da,assignProp:()=>Qm,assertNotEqual:()=>LA,assertNever:()=>qA,assertIs:()=>FA,assertEqual:()=>UA,assert:()=>BA,allowsEval:()=>e0,aborted:()=>_o,NUMBER_FORMAT_RANGES:()=>n0,Class:()=>gS,BIGINT_FORMAT_RANGES:()=>i0});function UA(e){return e}function LA(e){return e}function FA(e){}function qA(e){throw Error()}function BA(e){}function Oa(e){let t=Object.values(e).filter((i)=>typeof i==="number");return Object.entries(e).filter(([i,n])=>t.indexOf(+i)===-1).map(([i,n])=>n)}function be(e,t="|"){return e.map((r)=>Ve(r)).join(t)}function Xm(e,t){if(typeof t==="bigint")return t.toString();return t}function Da(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw Error("cached value already set")}}}function ji(e){return e===null||e===void 0}function Na(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Ym(e,t){let r=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,n=r>i?r:i,o=Number.parseInt(e.toFixed(n).replace(".","")),s=Number.parseInt(t.toFixed(n).replace(".",""));return o%s/10**n}function $t(e,t,r){Object.defineProperty(e,t,{get(){{let n=r();return e[t]=n,n}throw Error("cached value already set")},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Qm(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function HA(e,t){if(!t)return e;return t.reduce((r,i)=>r?.[i],e)}function ZA(e){let t=Object.keys(e),r=t.map((i)=>e[i]);return Promise.all(r).then((i)=>{let n={};for(let o=0;o<t.length;o++)n[t[o]]=i[o];return n})}function KA(e=10){let r="";for(let i=0;i<e;i++)r+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return r}function bo(e){return JSON.stringify(e)}var Xc=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function us(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var e0=Da(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function ls(e){if(us(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let r=t.prototype;if(us(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function VA(e){let t=0;for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r))t++;return t}var WA=(e)=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(e))return"array";if(e===null)return"null";if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return"promise";if(typeof Map<"u"&&e instanceof Map)return"map";if(typeof Set<"u"&&e instanceof Set)return"set";if(typeof Date<"u"&&e instanceof Date)return"date";if(typeof File<"u"&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${t}`)}},za=new Set(["string","number","symbol"]),t0=new Set(["string","number","bigint","boolean","symbol","undefined"]);function li(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ur(e,t,r){let i=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)i._zod.parent=e;return i}function Fe(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function GA(e){let t;return new Proxy({},{get(r,i,n){return t??(t=e()),Reflect.get(t,i,n)},set(r,i,n,o){return t??(t=e()),Reflect.set(t,i,n,o)},has(r,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(r,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(r,i,n){return t??(t=e()),Reflect.defineProperty(t,i,n)}})}function Ve(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function r0(e){return Object.keys(e).filter((t)=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var n0={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},i0={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function JA(e,t){let r={},i=e._zod.def;for(let n in t){if(!(n in i.shape))throw Error(`Unrecognized key: "${n}"`);if(!t[n])continue;r[n]=i.shape[n]}return Ur(e,{...e._zod.def,shape:r,checks:[]})}function XA(e,t){let r={...e._zod.def.shape},i=e._zod.def;for(let n in t){if(!(n in i.shape))throw Error(`Unrecognized key: "${n}"`);if(!t[n])continue;delete r[n]}return Ur(e,{...e._zod.def,shape:r,checks:[]})}function YA(e,t){if(!ls(t))throw Error("Invalid input to extend: expected a plain object");let r={...e._zod.def,get shape(){let i={...e._zod.def.shape,...t};return Qm(this,"shape",i),i},checks:[]};return Ur(e,r)}function QA(e,t){return Ur(e,{...e._zod.def,get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return Qm(this,"shape",r),r},catchall:t._zod.def.catchall,checks:[]})}function e9(e,t,r){let i=t._zod.def.shape,n={...i};if(r)for(let o in r){if(!(o in i))throw Error(`Unrecognized key: "${o}"`);if(!r[o])continue;n[o]=e?new e({type:"optional",innerType:i[o]}):i[o]}else for(let o in i)n[o]=e?new e({type:"optional",innerType:i[o]}):i[o];return Ur(t,{...t._zod.def,shape:n,checks:[]})}function t9(e,t,r){let i=t._zod.def.shape,n={...i};if(r)for(let o in r){if(!(o in n))throw Error(`Unrecognized key: "${o}"`);if(!r[o])continue;n[o]=new e({type:"nonoptional",innerType:i[o]})}else for(let o in i)n[o]=new e({type:"nonoptional",innerType:i[o]});return Ur(t,{...t._zod.def,shape:n,checks:[]})}function _o(e,t=0){for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function en(e,t){return t.map((r)=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}function Ca(e){return typeof e==="string"?e:e?.message}function fn(e,t,r){let i={...e,path:e.path??[]};if(!e.message){let n=Ca(e.inst?._zod.def?.error?.(e))??Ca(t?.error?.(e))??Ca(r.customError?.(e))??Ca(r.localeError?.(e))??"Invalid input";i.message=n}if(delete i.inst,delete i.continue,!t?.reportInput)delete i.input;return i}function ja(e){if(e instanceof Set)return"set";if(e instanceof Map)return"map";if(e instanceof File)return"file";return"unknown"}function Ua(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function o0(...e){let[t,r,i]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:i};return{...t}}function r9(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map((t)=>t[1])}class gS{constructor(...e){}}var yS=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,Xm,2)},enumerable:!0})},La=ne("$ZodError",yS),cs=ne("$ZodError",yS,{Parent:Error});function ds(e,t=(r)=>r.message){let r={},i=[];for(let n of e.issues)if(n.path.length>0)r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n));else i.push(t(n));return{formErrors:i,fieldErrors:r}}function fs(e,t){let r=t||function(o){return o.message},i={_errors:[]},n=(o)=>{for(let s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map((h)=>n({issues:h}));else if(s.code==="invalid_key")n({issues:s.issues});else if(s.code==="invalid_element")n({issues:s.issues});else if(s.path.length===0)i._errors.push(r(s));else{let h=i,v=0;while(v<s.path.length){let b=s.path[v];if(v!==s.path.length-1)h[b]=h[b]||{_errors:[]};else h[b]=h[b]||{_errors:[]},h[b]._errors.push(r(s));h=h[b],v++}}};return n(e),i}function Yc(e,t){let r=t||function(o){return o.message},i={errors:[]},n=(o,s=[])=>{var h,v;for(let b of o.issues)if(b.code==="invalid_union"&&b.errors.length)b.errors.map((_)=>n({issues:_},b.path));else if(b.code==="invalid_key")n({issues:b.issues},b.path);else if(b.code==="invalid_element")n({issues:b.issues},b.path);else{let _=[...s,...b.path];if(_.length===0){i.errors.push(r(b));continue}let g=i,S=0;while(S<_.length){let x=_[S],M=S===_.length-1;if(typeof x==="string")g.properties??(g.properties={}),(h=g.properties)[x]??(h[x]={errors:[]}),g=g.properties[x];else g.items??(g.items=[]),(v=g.items)[x]??(v[x]={errors:[]}),g=g.items[x];if(M)g.errors.push(r(b));S++}}};return n(e),i}function vS(e){let t=[];for(let r of e)if(typeof r==="number")t.push(`[${r}]`);else if(typeof r==="symbol")t.push(`[${JSON.stringify(String(r))}]`);else if(/[^\w$]/.test(r))t.push(`[${JSON.stringify(r)}]`);else{if(t.length)t.push(".");t.push(r)}return t.join("")}function Qc(e){let t=[],r=[...e.issues].sort((i,n)=>i.path.length-n.path.length);for(let i of r)if(t.push(`✖ ${i.message}`),i.path?.length)t.push(` → at ${vS(i.path)}`);return t.join(`
|
|
27
|
-
`)}var ed=(e)=>(t,r,i,n)=>{let o=i?Object.assign(i,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new ui;if(s.issues.length){let h=new(n?.Err??e)(s.issues.map((v)=>fn(v,o,rr())));throw Xc(h,n?.callee),h}return s.value},wo=ed(cs),td=(e)=>async(t,r,i,n)=>{let o=i?Object.assign(i,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)s=await s;if(s.issues.length){let h=new(n?.Err??e)(s.issues.map((v)=>fn(v,o,rr())));throw Xc(h,n?.callee),h}return s.value},So=td(cs),rd=(e)=>(t,r,i)=>{let n=i?{...i,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},n);if(o instanceof Promise)throw new ui;return o.issues.length?{success:!1,error:new(e??La)(o.issues.map((s)=>fn(s,n,rr())))}:{success:!0,data:o.value}},Ui=rd(cs),nd=(e)=>async(t,r,i)=>{let n=i?Object.assign(i,{async:!0}):{async:!0},o=t._zod.run({value:r,issues:[]},n);if(o instanceof Promise)o=await o;return o.issues.length?{success:!1,error:new e(o.issues.map((s)=>fn(s,n,rr())))}:{success:!0,data:o.value}},Li=nd(cs);var Fi={};wn(Fi,{xid:()=>l0,uuid7:()=>a9,uuid6:()=>s9,uuid4:()=>o9,uuid:()=>xo,uppercase:()=>O0,unicodeEmail:()=>c9,undefined:()=>R0,ulid:()=>u0,time:()=>k0,string:()=>E0,rfc5322Email:()=>l9,number:()=>T0,null:()=>A0,nanoid:()=>d0,lowercase:()=>C0,ksuid:()=>c0,ipv6:()=>y0,ipv4:()=>g0,integer:()=>$0,html5Email:()=>u9,hostname:()=>w0,guid:()=>h0,extendedDuration:()=>i9,emoji:()=>m0,email:()=>p0,e164:()=>S0,duration:()=>f0,domain:()=>h9,datetime:()=>M0,date:()=>x0,cuid2:()=>a0,cuid:()=>s0,cidrv6:()=>b0,cidrv4:()=>v0,browserEmail:()=>d9,boolean:()=>P0,bigint:()=>I0,base64url:()=>id,base64:()=>_0,_emoji:()=>f9});var s0=/^[cC][^\s-]{8,}$/,a0=/^[0-9a-z]+$/,u0=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,l0=/^[0-9a-vA-V]{20}$/,c0=/^[A-Za-z0-9]{27}$/,d0=/^[a-zA-Z0-9_-]{21}$/,f0=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,i9=/^[-+]?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)?)??$/,h0=/^([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})$/,xo=(e)=>{if(!e)return/^([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)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},o9=xo(4),s9=xo(6),a9=xo(7),p0=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,u9=/^[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])?)*$/,l9=/^(([^<>()\[\]\\.,;:\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,}))$/,c9=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,d9=/^[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])?)*$/,f9="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function m0(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}var g0=/^(?:(?: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])$/,y0=/^(([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})$/,v0=/^((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])$/,b0=/^(([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])$/,_0=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,id=/^[A-Za-z0-9_-]*$/,w0=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,h9=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,S0=/^\+(?:[0-9]){6,14}[0-9]$/,bS="(?:(?:\\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])))",x0=new RegExp(`^${bS}$`);function _S(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function k0(e){return new RegExp(`^${_S(e)}$`)}function M0(e){let t=_S({precision:e.precision}),r=["Z"];if(e.local)r.push("");if(e.offset)r.push("([+-]\\d{2}:\\d{2})");let i=`${t}(?:${r.join("|")})`;return new RegExp(`^${bS}T(?:${i})$`)}var E0=(e)=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},I0=/^\d+n?$/,$0=/^\d+$/,T0=/^-?\d+(?:\.\d+)?/i,P0=/true|false/i,A0=/null/i;var R0=/undefined/i;var C0=/^[^A-Z]*$/,O0=/^[^a-z]*$/;var Ht=ne("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),SS={number:"number",bigint:"bigint",object:"date"},od=ne("$ZodCheckLessThan",(e,t)=>{Ht.init(e,t);let r=SS[typeof t.value];e._zod.onattach.push((i)=>{let n=i._zod.bag,o=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(t.value<o)if(t.inclusive)n.maximum=t.value;else n.exclusiveMaximum=t.value}),e._zod.check=(i)=>{if(t.inclusive?i.value<=t.value:i.value<t.value)return;i.issues.push({origin:r,code:"too_big",maximum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),sd=ne("$ZodCheckGreaterThan",(e,t)=>{Ht.init(e,t);let r=SS[typeof t.value];e._zod.onattach.push((i)=>{let n=i._zod.bag,o=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(t.value>o)if(t.inclusive)n.minimum=t.value;else n.exclusiveMinimum=t.value}),e._zod.check=(i)=>{if(t.inclusive?i.value>=t.value:i.value>t.value)return;i.issues.push({origin:r,code:"too_small",minimum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),D0=ne("$ZodCheckMultipleOf",(e,t)=>{Ht.init(e,t),e._zod.onattach.push((r)=>{var i;(i=r._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=(r)=>{if(typeof r.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof r.value==="bigint"?r.value%t.value===BigInt(0):Ym(r.value,t.value)===0)return;r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),N0=ne("$ZodCheckNumberFormat",(e,t)=>{Ht.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),i=r?"int":"number",[n,o]=n0[t.format];e._zod.onattach.push((s)=>{let h=s._zod.bag;if(h.format=t.format,h.minimum=n,h.maximum=o,r)h.pattern=$0}),e._zod.check=(s)=>{let h=s.value;if(r){if(!Number.isInteger(h)){s.issues.push({expected:i,format:t.format,code:"invalid_type",input:h,inst:e});return}if(!Number.isSafeInteger(h)){if(h>0)s.issues.push({input:h,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort});else s.issues.push({input:h,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort});return}}if(h<n)s.issues.push({origin:"number",input:h,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort});if(h>o)s.issues.push({origin:"number",input:h,code:"too_big",maximum:o,inst:e})}}),z0=ne("$ZodCheckBigIntFormat",(e,t)=>{Ht.init(e,t);let[r,i]=i0[t.format];e._zod.onattach.push((n)=>{let o=n._zod.bag;o.format=t.format,o.minimum=r,o.maximum=i}),e._zod.check=(n)=>{let o=n.value;if(o<r)n.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort});if(o>i)n.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inst:e})}}),j0=ne("$ZodCheckMaxSize",(e,t)=>{Ht.init(e,t),e._zod.when=(r)=>{let i=r.value;return!ji(i)&&i.size!==void 0},e._zod.onattach.push((r)=>{let i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<i)r._zod.bag.maximum=t.maximum}),e._zod.check=(r)=>{let i=r.value;if(i.size<=t.maximum)return;r.issues.push({origin:ja(i),code:"too_big",maximum:t.maximum,input:i,inst:e,continue:!t.abort})}}),U0=ne("$ZodCheckMinSize",(e,t)=>{Ht.init(e,t),e._zod.when=(r)=>{let i=r.value;return!ji(i)&&i.size!==void 0},e._zod.onattach.push((r)=>{let i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>i)r._zod.bag.minimum=t.minimum}),e._zod.check=(r)=>{let i=r.value;if(i.size>=t.minimum)return;r.issues.push({origin:ja(i),code:"too_small",minimum:t.minimum,input:i,inst:e,continue:!t.abort})}}),L0=ne("$ZodCheckSizeEquals",(e,t)=>{Ht.init(e,t),e._zod.when=(r)=>{let i=r.value;return!ji(i)&&i.size!==void 0},e._zod.onattach.push((r)=>{let i=r._zod.bag;i.minimum=t.size,i.maximum=t.size,i.size=t.size}),e._zod.check=(r)=>{let i=r.value,n=i.size;if(n===t.size)return;let o=n>t.size;r.issues.push({origin:ja(i),...o?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),F0=ne("$ZodCheckMaxLength",(e,t)=>{Ht.init(e,t),e._zod.when=(r)=>{let i=r.value;return!ji(i)&&i.length!==void 0},e._zod.onattach.push((r)=>{let i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<i)r._zod.bag.maximum=t.maximum}),e._zod.check=(r)=>{let i=r.value;if(i.length<=t.maximum)return;let o=Ua(i);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),q0=ne("$ZodCheckMinLength",(e,t)=>{Ht.init(e,t),e._zod.when=(r)=>{let i=r.value;return!ji(i)&&i.length!==void 0},e._zod.onattach.push((r)=>{let i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>i)r._zod.bag.minimum=t.minimum}),e._zod.check=(r)=>{let i=r.value;if(i.length>=t.minimum)return;let o=Ua(i);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),B0=ne("$ZodCheckLengthEquals",(e,t)=>{Ht.init(e,t),e._zod.when=(r)=>{let i=r.value;return!ji(i)&&i.length!==void 0},e._zod.onattach.push((r)=>{let i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=(r)=>{let i=r.value,n=i.length;if(n===t.length)return;let o=Ua(i),s=n>t.length;r.issues.push({origin:o,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),hs=ne("$ZodCheckStringFormat",(e,t)=>{var r,i;if(Ht.init(e,t),e._zod.onattach.push((n)=>{let o=n._zod.bag;if(o.format=t.format,t.pattern)o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern)}),t.pattern)(r=e._zod).check??(r.check=(n)=>{if(t.pattern.lastIndex=0,t.pattern.test(n.value))return;n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(i=e._zod).check??(i.check=()=>{})}),H0=ne("$ZodCheckRegex",(e,t)=>{hs.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Z0=ne("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=C0),hs.init(e,t)}),K0=ne("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=O0),hs.init(e,t)}),V0=ne("$ZodCheckIncludes",(e,t)=>{Ht.init(e,t);let r=li(t.includes),i=new RegExp(typeof t.position==="number"?`^.{${t.position}}${r}`:r);t.pattern=i,e._zod.onattach.push((n)=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),e._zod.check=(n)=>{if(n.value.includes(t.includes,t.position))return;n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),W0=ne("$ZodCheckStartsWith",(e,t)=>{Ht.init(e,t);let r=new RegExp(`^${li(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push((i)=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=(i)=>{if(i.value.startsWith(t.prefix))return;i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),G0=ne("$ZodCheckEndsWith",(e,t)=>{Ht.init(e,t);let r=new RegExp(`.*${li(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push((i)=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=(i)=>{if(i.value.endsWith(t.suffix))return;i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});function wS(e,t,r){if(e.issues.length)t.issues.push(...en(r,e.issues))}var J0=ne("$ZodCheckProperty",(e,t)=>{Ht.init(e,t),e._zod.check=(r)=>{let i=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(i instanceof Promise)return i.then((n)=>wS(n,r,t.property));wS(i,r,t.property);return}}),X0=ne("$ZodCheckMimeType",(e,t)=>{Ht.init(e,t);let r=new Set(t.mime);e._zod.onattach.push((i)=>{i._zod.bag.mime=t.mime}),e._zod.check=(i)=>{if(r.has(i.value.type))return;i.issues.push({code:"invalid_value",values:t.mime,input:i.value.type,inst:e})}}),Y0=ne("$ZodCheckOverwrite",(e,t)=>{Ht.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class ad{constructor(e=[]){if(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 r=e.split(`
|
|
26
|
+
deps: ${r}}`};var $q={keyword:"dependencies",type:"object",schemaType:"object",error:N3.error,code(e){let[t,r]=Tq(e);O3(e,t),D3(e,r)}};function Tq({schema:e}){let t={},r={};for(let i in e){if(i==="__proto__")continue;let n=Array.isArray(e[i])?t:r;n[i]=e[i]}return[t,r]}function O3(e,t=e.schema){let{gen:r,data:i,it:n}=e;if(Object.keys(t).length===0)return;let o=r.let("missing");for(let s in t){let h=t[s];if(h.length===0)continue;let v=(0,kc.propertyInData)(r,i,s,n.opts.ownProperties);if(e.setParams({property:s,depsCount:h.length,deps:h.join(", ")}),n.allErrors)r.if(v,()=>{for(let b of h)(0,kc.checkReportMissingProp)(e,b)});else r.if(l_._`${v} && (${(0,kc.checkMissingProp)(e,h,o)})`),(0,kc.reportMissingProp)(e,o),r.else()}}N3.validatePropertyDeps=O3;function D3(e,t=e.schema){let{gen:r,data:i,keyword:n,it:o}=e,s=r.name("valid");for(let h in t){if((0,Iq.alwaysValidSchema)(o,t[h]))continue;r.if((0,kc.propertyInData)(r,i,h,o.opts.ownProperties),()=>{let v=e.subschema({keyword:n,schemaProp:h},s);e.mergeValidEvaluated(v,s)},()=>r.var(s,!0)),e.ok(s)}}N3.validateSchemaDeps=D3;N3.default=$q});var q3=Xe(function(F3){Object.defineProperty(F3,"__esModule",{value:!0});var L3=gt(),Rq=Mt(),Cq={message:"property name must be valid",params:({params:e})=>L3._`{propertyName: ${e.propertyName}}`},Oq={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Cq,code(e){let{gen:t,schema:r,data:i,it:n}=e;if((0,Rq.alwaysValidSchema)(n,r))return;let o=t.name("valid");t.forIn("key",i,(s)=>{e.setParams({propertyName:s}),e.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},o),t.if((0,L3.not)(o),()=>{if(e.error(!0),!n.allErrors)t.break()})}),e.ok(o)}};F3.default=Oq});var c_=Xe(function(B3){Object.defineProperty(B3,"__esModule",{value:!0});var Vp=Rn(),Kn=gt(),Nq=Mi(),Wp=Mt(),zq={message:"must NOT have additional properties",params:({params:e})=>Kn._`{additionalProperty: ${e.additionalProperty}}`},jq={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:zq,code(e){let{gen:t,schema:r,parentSchema:i,data:n,errsCount:o,it:s}=e;if(!o)throw Error("ajv implementation error");let{allErrors:h,opts:v}=s;if(s.props=!0,v.removeAdditional!=="all"&&(0,Wp.alwaysValidSchema)(s,r))return;let b=(0,Vp.allSchemaProperties)(i.properties),_=(0,Vp.allSchemaProperties)(i.patternProperties);g(),e.ok(Kn._`${o} === ${Nq.default.errors}`);function g(){t.forIn("key",n,($)=>{if(!b.length&&!_.length)M($);else t.if(S($),()=>M($))})}function S($){let T;if(b.length>8){let P=(0,Wp.schemaRefOrVal)(s,i.properties,"properties");T=(0,Vp.isOwnProperty)(t,P,$)}else if(b.length)T=(0,Kn.or)(...b.map((P)=>Kn._`${$} === ${P}`));else T=Kn.nil;if(_.length)T=(0,Kn.or)(T,..._.map((P)=>Kn._`${(0,Vp.usePattern)(e,P)}.test(${$})`));return(0,Kn.not)(T)}function x($){t.code(Kn._`delete ${n}[${$}]`)}function M($){if(v.removeAdditional==="all"||v.removeAdditional&&r===!1){x($);return}if(r===!1){if(e.setParams({additionalProperty:$}),e.error(),!h)t.break();return}if(typeof r=="object"&&!(0,Wp.alwaysValidSchema)(s,r)){let T=t.name("valid");if(v.removeAdditional==="failing")I($,T,!1),t.if((0,Kn.not)(T),()=>{e.reset(),x($)});else if(I($,T),!h)t.if((0,Kn.not)(T),()=>t.break())}}function I($,T,P){let R={keyword:"additionalProperties",dataProp:$,dataPropType:Wp.Type.Str};if(P===!1)Object.assign(R,{compositeRule:!0,createErrors:!1,allErrors:!1});e.subschema(R,T)}}};B3.default=jq});var V3=Xe(function(K3){Object.defineProperty(K3,"__esModule",{value:!0});var Lq=fc(),H3=Rn(),d_=Mt(),Z3=c_(),Fq={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:i,data:n,it:o}=e;if(o.opts.removeAdditional==="all"&&i.additionalProperties===void 0)Z3.default.code(new Lq.KeywordCxt(o,Z3.default,"additionalProperties"));let s=(0,H3.allSchemaProperties)(r);for(let g of s)o.definedProperties.add(g);if(o.opts.unevaluated&&s.length&&o.props!==!0)o.props=d_.mergeEvaluated.props(t,(0,d_.toHash)(s),o.props);let h=s.filter((g)=>!(0,d_.alwaysValidSchema)(o,r[g]));if(h.length===0)return;let v=t.name("valid");for(let g of h){if(b(g))_(g);else{if(t.if((0,H3.propertyInData)(t,n,g,o.opts.ownProperties)),_(g),!o.allErrors)t.else().var(v,!0);t.endIf()}e.it.definedProperties.add(g),e.ok(v)}function b(g){return o.opts.useDefaults&&!o.compositeRule&&r[g].default!==void 0}function _(g){e.subschema({keyword:"properties",schemaProp:g,dataProp:g},v)}}};K3.default=Fq});var Y3=Xe(function(X3){Object.defineProperty(X3,"__esModule",{value:!0});var W3=Rn(),Gp=gt(),G3=Mt(),J3=Mt(),Bq={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:i,parentSchema:n,it:o}=e,{opts:s}=o,h=(0,W3.allSchemaProperties)(r),v=h.filter((I)=>(0,G3.alwaysValidSchema)(o,r[I]));if(h.length===0||v.length===h.length&&(!o.opts.unevaluated||o.props===!0))return;let b=s.strictSchema&&!s.allowMatchingProperties&&n.properties,_=t.name("valid");if(o.props!==!0&&!(o.props instanceof Gp.Name))o.props=(0,J3.evaluatedPropsToName)(t,o.props);let{props:g}=o;S();function S(){for(let I of h){if(b)x(I);if(o.allErrors)M(I);else t.var(_,!0),M(I),t.if(_)}}function x(I){for(let $ in b)if(new RegExp(I).test($))(0,G3.checkStrictMode)(o,`property ${$} matches pattern ${I} (use allowMatchingProperties)`)}function M(I){t.forIn("key",i,($)=>{t.if(Gp._`${(0,W3.usePattern)(e,I)}.test(${$})`,()=>{let T=v.includes(I);if(!T)e.subschema({keyword:"patternProperties",schemaProp:I,dataProp:$,dataPropType:J3.Type.Str},_);if(o.opts.unevaluated&&g!==!0)t.assign(Gp._`${g}[${$}]`,!0);else if(!T&&!o.allErrors)t.if((0,Gp.not)(_),()=>t.break())})})}}};X3.default=Bq});var eE=Xe(function(Q3){Object.defineProperty(Q3,"__esModule",{value:!0});var Zq=Mt(),Kq={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:i}=e;if((0,Zq.alwaysValidSchema)(i,r)){e.fail();return}let n=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},n),e.failResult(n,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Q3.default=Kq});var rE=Xe(function(tE){Object.defineProperty(tE,"__esModule",{value:!0});var Wq=Rn(),Gq={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Wq.validateUnion,error:{message:"must match a schema in anyOf"}};tE.default=Gq});var iE=Xe(function(nE){Object.defineProperty(nE,"__esModule",{value:!0});var Jp=gt(),Xq=Mt(),Yq={message:"must match exactly one schema in oneOf",params:({params:e})=>Jp._`{passingSchemas: ${e.passing}}`},Qq={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Yq,code(e){let{gen:t,schema:r,parentSchema:i,it:n}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(n.opts.discriminator&&i.discriminator)return;let o=r,s=t.let("valid",!1),h=t.let("passing",null),v=t.name("_valid");e.setParams({passing:h}),t.block(b),e.result(s,()=>e.reset(),()=>e.error(!0));function b(){o.forEach((_,g)=>{let S;if((0,Xq.alwaysValidSchema)(n,_))t.var(v,!0);else S=e.subschema({keyword:"oneOf",schemaProp:g,compositeRule:!0},v);if(g>0)t.if(Jp._`${v} && ${s}`).assign(s,!1).assign(h,Jp._`[${h}, ${g}]`).else();t.if(v,()=>{if(t.assign(s,!0),t.assign(h,g),S)e.mergeEvaluated(S,Jp.Name)})})}}};nE.default=Qq});var sE=Xe(function(oE){Object.defineProperty(oE,"__esModule",{value:!0});var tB=Mt(),rB={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:i}=e;if(!Array.isArray(r))throw Error("ajv implementation error");let n=t.name("valid");r.forEach((o,s)=>{if((0,tB.alwaysValidSchema)(i,o))return;let h=e.subschema({keyword:"allOf",schemaProp:s},n);e.ok(n),e.mergeEvaluated(h)})}};oE.default=rB});var cE=Xe(function(lE){Object.defineProperty(lE,"__esModule",{value:!0});var Xp=gt(),uE=Mt(),iB={message:({params:e})=>Xp.str`must match "${e.ifClause}" schema`,params:({params:e})=>Xp._`{failingKeyword: ${e.ifClause}}`},oB={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:iB,code(e){let{gen:t,parentSchema:r,it:i}=e;if(r.then===void 0&&r.else===void 0)(0,uE.checkStrictMode)(i,'"if" without "then" and "else" is ignored');let n=aE(i,"then"),o=aE(i,"else");if(!n&&!o)return;let s=t.let("valid",!0),h=t.name("_valid");if(v(),e.reset(),n&&o){let _=t.let("ifClause");e.setParams({ifClause:_}),t.if(h,b("then",_),b("else",_))}else if(n)t.if(h,b("then"));else t.if((0,Xp.not)(h),b("else"));e.pass(s,()=>e.error(!0));function v(){let _=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},h);e.mergeEvaluated(_)}function b(_,g){return()=>{let S=e.subschema({keyword:_},h);if(t.assign(s,h),e.mergeValidEvaluated(S,s),g)t.assign(g,Xp._`${_}`);else e.setParams({ifClause:_})}}}};function aE(e,t){let r=e.schema[t];return r!==void 0&&!(0,uE.alwaysValidSchema)(e,r)}lE.default=oB});var fE=Xe(function(dE){Object.defineProperty(dE,"__esModule",{value:!0});var aB=Mt(),uB={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){if(t.if===void 0)(0,aB.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};dE.default=uB});var pE=Xe(function(hE){Object.defineProperty(hE,"__esModule",{value:!0});var cB=a_(),dB=$3(),fB=u_(),hB=A3(),pB=C3(),mB=U3(),gB=q3(),yB=c_(),vB=V3(),bB=Y3(),_B=eE(),wB=rE(),SB=iE(),xB=sE(),kB=cE(),MB=fE();function EB(e=!1){let t=[_B.default,wB.default,SB.default,xB.default,kB.default,MB.default,gB.default,yB.default,mB.default,vB.default,bB.default];if(e)t.push(dB.default,hB.default);else t.push(cB.default,fB.default);return t.push(pB.default),t}hE.default=EB});var gE=Xe(function(mE){Object.defineProperty(mE,"__esModule",{value:!0});var ir=gt(),$B={message:({schemaCode:e})=>ir.str`must match format "${e}"`,params:({schemaCode:e})=>ir._`{format: ${e}}`},TB={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:$B,code(e,t){let{gen:r,data:i,$data:n,schema:o,schemaCode:s,it:h}=e,{opts:v,errSchemaPath:b,schemaEnv:_,self:g}=h;if(!v.validateFormats)return;if(n)S();else x();function S(){let M=r.scopeValue("formats",{ref:g.formats,code:v.code.formats}),I=r.const("fDef",ir._`${M}[${s}]`),$=r.let("fType"),T=r.let("format");r.if(ir._`typeof ${I} == "object" && !(${I} instanceof RegExp)`,()=>r.assign($,ir._`${I}.type || "string"`).assign(T,ir._`${I}.validate`),()=>r.assign($,ir._`"string"`).assign(T,I)),e.fail$data((0,ir.or)(P(),R()));function P(){if(v.strictSchema===!1)return ir.nil;return ir._`${s} && !${T}`}function R(){let C=_.$async?ir._`(${I}.async ? await ${T}(${i}) : ${T}(${i}))`:ir._`${T}(${i})`,N=ir._`(typeof ${T} == "function" ? ${C} : ${T}.test(${i}))`;return ir._`${T} && ${T} !== true && ${$} === ${t} && !${N}`}}function x(){let M=g.formats[o];if(!M){P();return}if(M===!0)return;let[I,$,T]=R(M);if(I===t)e.pass(C());function P(){if(v.strictSchema===!1){g.logger.warn(N());return}throw Error(N());function N(){return`unknown format "${o}" ignored in schema at path "${b}"`}}function R(N){let B=N instanceof RegExp?(0,ir.regexpCode)(N):v.code.formats?ir._`${v.code.formats}${(0,ir.getProperty)(o)}`:void 0,ie=r.scopeValue("formats",{key:o,ref:N,code:B});if(typeof N=="object"&&!(N instanceof RegExp))return[N.type||"string",N.validate,ir._`${ie}.validate`];return["string",N,ie]}function C(){if(typeof M=="object"&&!(M instanceof RegExp)&&M.async){if(!_.$async)throw Error("async format in sync schema");return ir._`await ${T}(${i})`}return typeof $=="function"?ir._`${T}(${i})`:ir._`${T}.test(${i})`}}}};mE.default=TB});var vE=Xe(function(yE){Object.defineProperty(yE,"__esModule",{value:!0});var AB=gE(),RB=[AB.default];yE.default=RB});var wE=Xe(function(bE){Object.defineProperty(bE,"__esModule",{value:!0});bE.contentVocabulary=bE.metadataVocabulary=void 0;bE.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];bE.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var kE=Xe(function(xE){Object.defineProperty(xE,"__esModule",{value:!0});var DB=K4(),NB=b3(),zB=pE(),jB=vE(),SE=wE(),UB=[DB.default,NB.default,(0,zB.default)(),jB.default,SE.metadataVocabulary,SE.contentVocabulary];xE.default=UB});var $E=Xe(function(EE){Object.defineProperty(EE,"__esModule",{value:!0});EE.DiscrError=void 0;var ME;(function(e){e.Tag="tag",e.Mapping="mapping"})(ME||(EE.DiscrError=ME={}))});var AE=Xe(function(PE){Object.defineProperty(PE,"__esModule",{value:!0});var fa=gt(),f_=$E(),TE=Op(),FB=hc(),qB=Mt(),BB={message:({params:{discrError:e,tagName:t}})=>e===f_.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>fa._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},HB={keyword:"discriminator",type:"object",schemaType:"object",error:BB,code(e){let{gen:t,data:r,schema:i,parentSchema:n,it:o}=e,{oneOf:s}=n;if(!o.opts.discriminator)throw Error("discriminator: requires discriminator option");let h=i.propertyName;if(typeof h!="string")throw Error("discriminator: requires propertyName");if(i.mapping)throw Error("discriminator: mapping is not supported");if(!s)throw Error("discriminator: requires oneOf keyword");let v=t.let("valid",!1),b=t.const("tag",fa._`${r}${(0,fa.getProperty)(h)}`);t.if(fa._`typeof ${b} == "string"`,()=>_(),()=>e.error(!1,{discrError:f_.DiscrError.Tag,tag:b,tagName:h})),e.ok(v);function _(){let x=S();t.if(!1);for(let M in x)t.elseIf(fa._`${b} === ${M}`),t.assign(v,g(x[M]));t.else(),e.error(!1,{discrError:f_.DiscrError.Mapping,tag:b,tagName:h}),t.endIf()}function g(x){let M=t.name("valid"),I=e.subschema({keyword:"oneOf",schemaProp:x},M);return e.mergeEvaluated(I,fa.Name),M}function S(){var x;let M={},I=T(n),$=!0;for(let C=0;C<s.length;C++){let N=s[C];if((N===null||N===void 0?void 0:N.$ref)&&!(0,qB.schemaHasRulesButRef)(N,o.self.RULES)){let ie=N.$ref;if(N=TE.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,ie),N instanceof TE.SchemaEnv)N=N.schema;if(N===void 0)throw new FB.default(o.opts.uriResolver,o.baseId,ie)}let B=(x=N===null||N===void 0?void 0:N.properties)===null||x===void 0?void 0:x[h];if(typeof B!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${h}"`);$=$&&(I||T(N)),P(B,C)}if(!$)throw Error(`discriminator: "${h}" must be required`);return M;function T({required:C}){return Array.isArray(C)&&C.includes(h)}function P(C,N){if(C.const)R(C.const,N);else if(C.enum)for(let B of C.enum)R(B,N);else throw Error(`discriminator: "properties/${h}" must have "const" or "enum"`)}function R(C,N){if(typeof C!="string"||C in M)throw Error(`discriminator: "${h}" values must be unique strings`);M[C]=N}}}};PE.default=HB});var RE=Xe(function(P_e,KB){KB.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var p_=Xe(function(ln,h_){Object.defineProperty(ln,"__esModule",{value:!0});ln.MissingRefError=ln.ValidationError=ln.CodeGen=ln.Name=ln.nil=ln.stringify=ln.str=ln._=ln.KeywordCxt=ln.Ajv=void 0;var VB=N4(),WB=kE(),GB=AE(),CE=RE(),JB=["/properties"],Yp="http://json-schema.org/draft-07/schema";class Mc extends VB.default{_addVocabularies(){if(super._addVocabularies(),WB.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(GB.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(CE,JB):CE;this.addMetaSchema(e,Yp,!1),this.refs["http://json-schema.org/schema"]=Yp}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Yp)?Yp:void 0)}}ln.Ajv=Mc;h_.exports=ln=Mc;h_.exports.Ajv=Mc;Object.defineProperty(ln,"__esModule",{value:!0});ln.default=Mc;var XB=fc();Object.defineProperty(ln,"KeywordCxt",{enumerable:!0,get:function(){return XB.KeywordCxt}});var ha=gt();Object.defineProperty(ln,"_",{enumerable:!0,get:function(){return ha._}});Object.defineProperty(ln,"str",{enumerable:!0,get:function(){return ha.str}});Object.defineProperty(ln,"stringify",{enumerable:!0,get:function(){return ha.stringify}});Object.defineProperty(ln,"nil",{enumerable:!0,get:function(){return ha.nil}});Object.defineProperty(ln,"Name",{enumerable:!0,get:function(){return ha.Name}});Object.defineProperty(ln,"CodeGen",{enumerable:!0,get:function(){return ha.CodeGen}});var YB=Rp();Object.defineProperty(ln,"ValidationError",{enumerable:!0,get:function(){return YB.default}});var QB=hc();Object.defineProperty(ln,"MissingRefError",{enumerable:!0,get:function(){return QB.default}})});var BE=Xe(function(FE){Object.defineProperty(FE,"__esModule",{value:!0});FE.formatNames=FE.fastFormats=FE.fullFormats=void 0;function ri(e,t){return{validate:e,compare:t}}FE.fullFormats={date:ri(zE,v_),time:ri(g_(!0),b_),"date-time":ri(OE(!0),UE),"iso-time":ri(g_(),jE),"iso-date-time":ri(OE(),LE),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:aH,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:pH,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:uH,int32:{type:"number",validate:dH},int64:{type:"number",validate:fH},float:{type:"number",validate:NE},double:{type:"number",validate:NE},password:!0,binary:!0};FE.fastFormats={...FE.fullFormats,date:ri(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,v_),time:ri(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,b_),"date-time":ri(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,UE),"iso-time":ri(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,jE),"iso-date-time":ri(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,LE),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};FE.formatNames=Object.keys(FE.fullFormats);function rH(e){return e%4===0&&(e%100!==0||e%400===0)}var nH=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,iH=[0,31,28,31,30,31,30,31,31,30,31,30,31];function zE(e){let t=nH.exec(e);if(!t)return!1;let r=+t[1],i=+t[2],n=+t[3];return i>=1&&i<=12&&n>=1&&n<=(i===2&&rH(r)?29:iH[i])}function v_(e,t){if(!(e&&t))return;if(e>t)return 1;if(e<t)return-1;return 0}var m_=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function g_(e){return function(r){let i=m_.exec(r);if(!i)return!1;let n=+i[1],o=+i[2],s=+i[3],h=i[4],v=i[5]==="-"?-1:1,b=+(i[6]||0),_=+(i[7]||0);if(b>23||_>59||e&&!h)return!1;if(n<=23&&o<=59&&s<60)return!0;let g=o-_*v,S=n-b*v-(g<0?1:0);return(S===23||S===-1)&&(g===59||g===-1)&&s<61}}function b_(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),i=new Date("2020-01-01T"+t).valueOf();if(!(r&&i))return;return r-i}function jE(e,t){if(!(e&&t))return;let r=m_.exec(e),i=m_.exec(t);if(!(r&&i))return;if(e=r[1]+r[2]+r[3],t=i[1]+i[2]+i[3],e>t)return 1;if(e<t)return-1;return 0}var y_=/t|\s/i;function OE(e){let t=g_(e);return function(i){let n=i.split(y_);return n.length===2&&zE(n[0])&&t(n[1])}}function UE(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),i=new Date(t).valueOf();if(!(r&&i))return;return r-i}function LE(e,t){if(!(e&&t))return;let[r,i]=e.split(y_),[n,o]=t.split(y_),s=v_(r,n);if(s===void 0)return;return s||b_(i,o)}var oH=/\/|:/,sH=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function aH(e){return oH.test(e)&&sH.test(e)}var DE=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function uH(e){return DE.lastIndex=0,DE.test(e)}var lH=-2147483648,cH=2147483647;function dH(e){return Number.isInteger(e)&&e<=cH&&e>=lH}function fH(e){return Number.isInteger(e)}function NE(){return!0}var hH=/[^\\]\\Z/;function pH(e){if(hH.test(e))return!1;try{return new RegExp(e),!0}catch(t){return!1}}});var ZE=Xe(function(HE){Object.defineProperty(HE,"__esModule",{value:!0});HE.formatLimitDefinition=void 0;var gH=p_(),Vn=gt(),uo=Vn.operators,Qp={formatMaximum:{okStr:"<=",ok:uo.LTE,fail:uo.GT},formatMinimum:{okStr:">=",ok:uo.GTE,fail:uo.LT},formatExclusiveMaximum:{okStr:"<",ok:uo.LT,fail:uo.GTE},formatExclusiveMinimum:{okStr:">",ok:uo.GT,fail:uo.LTE}},yH={message:({keyword:e,schemaCode:t})=>Vn.str`should be ${Qp[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>Vn._`{comparison: ${Qp[e].okStr}, limit: ${t}}`};HE.formatLimitDefinition={keyword:Object.keys(Qp),type:"string",schemaType:"string",$data:!0,error:yH,code(e){let{gen:t,data:r,schemaCode:i,keyword:n,it:o}=e,{opts:s,self:h}=o;if(!s.validateFormats)return;let v=new gH.KeywordCxt(o,h.RULES.all.format.definition,"format");if(v.$data)b();else _();function b(){let S=t.scopeValue("formats",{ref:h.formats,code:s.code.formats}),x=t.const("fmt",Vn._`${S}[${v.schemaCode}]`);e.fail$data((0,Vn.or)(Vn._`typeof ${x} != "object"`,Vn._`${x} instanceof RegExp`,Vn._`typeof ${x}.compare != "function"`,g(x)))}function _(){let S=v.schema,x=h.formats[S];if(!x||x===!0)return;if(typeof x!="object"||x instanceof RegExp||typeof x.compare!="function")throw Error(`"${n}": format "${S}" does not define "compare" function`);let M=t.scopeValue("formats",{key:S,ref:x,code:s.code.formats?Vn._`${s.code.formats}${(0,Vn.getProperty)(S)}`:void 0});e.fail$data(g(M))}function g(S){return Vn._`${S}.compare(${r}, ${i}) ${Qp[n].fail} 0`}},dependencies:["format"]};var vH=(e)=>(e.addKeyword(HE.formatLimitDefinition),e);HE.default=vH});var GE=Xe(function(Ec,WE){Object.defineProperty(Ec,"__esModule",{value:!0});var pa=BE(),_H=ZE(),S_=gt(),KE=new S_.Name("fullFormats"),wH=new S_.Name("fastFormats"),x_=(e,t={keywords:!0})=>{if(Array.isArray(t))return VE(e,t,pa.fullFormats,KE),e;let[r,i]=t.mode==="fast"?[pa.fastFormats,wH]:[pa.fullFormats,KE],n=t.formats||pa.formatNames;if(VE(e,n,r,i),t.keywords)(0,_H.default)(e);return e};x_.get=(e,t="full")=>{let i=(t==="fast"?pa.fastFormats:pa.fullFormats)[e];if(!i)throw Error(`Unknown format "${e}"`);return i};function VE(e,t,r,i){var n,o;(n=(o=e.opts.code).formats)!==null&&n!==void 0||(o.formats=S_._`require("ajv-formats/dist/formats").${i}`);for(let s of t)e.addFormat(s,r[s])}WE.exports=Ec=x_;Object.defineProperty(Ec,"__esModule",{value:!0});Ec.default=x_});var OH=typeof String.prototype.isWellFormed==="function"?Function.prototype.call.bind(String.prototype.isWellFormed):void 0,DH=typeof String.prototype.toWellFormed==="function"?Function.prototype.call.bind(String.prototype.toWellFormed):void 0;class On extends Error{}function z_(e,t,r){return new Promise((i,n)=>{if(t?.aborted){if(r?.throwOnAbort||r?.abortError)n(r.abortError?.()??Error("aborted"));else i();return}let o=setTimeout((h,v,b)=>{h?.removeEventListener("abort",v),b()},e,t,s,i);function s(){if(clearTimeout(o),r?.throwOnAbort||r?.abortError)n(r.abortError?.()??Error("aborted"));else i()}if(t?.addEventListener("abort",s,{once:!0}),r?.unref)o.unref()})}var{writeFileSync:Bpe}=(()=>({}));var{realpathSync:Qw}=(()=>({}));function y8(){this.__data__=[],this.size=0}var j_=y8;function v8(e,t){return e===t||e!==e&&t!==t}var U_=v8;function b8(e,t){var r=e.length;while(r--)if(U_(e[r][0],t))return r;return-1}var Ti=b8;var _8=Array.prototype,w8=_8.splice;function S8(e){var t=this.__data__,r=Ti(t,e);if(r<0)return!1;var i=t.length-1;if(r==i)t.pop();else w8.call(t,r,1);return--this.size,!0}var L_=S8;function x8(e){var t=this.__data__,r=Ti(t,e);return r<0?void 0:t[r][1]}var F_=x8;function k8(e){return Ti(this.__data__,e)>-1}var q_=k8;function M8(e,t){var r=this.__data__,i=Ti(r,e);if(i<0)++this.size,r.push([e,t]);else r[i][1]=t;return this}var B_=M8;function Yo(e){var t=-1,r=e==null?0:e.length;this.clear();while(++t<r){var i=e[t];this.set(i[0],i[1])}}Yo.prototype.clear=j_;Yo.prototype.delete=L_;Yo.prototype.get=F_;Yo.prototype.has=q_;Yo.prototype.set=B_;var H_=Yo;var E8=typeof global=="object"&&global&&global.Object===Object&&global,Z_=E8;var I8=typeof self=="object"&&self&&self.Object===Object&&self,$8=Z_||I8||Function("return this")(),Qo=$8;var T8=Qo.Symbol,es=T8;var K_=Object.prototype,P8=K_.hasOwnProperty,A8=K_.toString,ya=es?es.toStringTag:void 0;function R8(e){var t=P8.call(e,ya),r=e[ya];try{e[ya]=void 0;var i=!0}catch(o){}var n=A8.call(e);if(i)if(t)e[ya]=r;else delete e[ya];return n}var V_=R8;var C8=Object.prototype,O8=C8.toString;function D8(e){return O8.call(e)}var W_=D8;var N8="[object Null]",z8="[object Undefined]",G_=es?es.toStringTag:void 0;function j8(e){if(e==null)return e===void 0?z8:N8;return G_&&G_ in Object(e)?V_(e):W_(e)}var J_=j8;function U8(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var $c=U8;var L8="[object AsyncFunction]",F8="[object Function]",q8="[object GeneratorFunction]",B8="[object Proxy]";function H8(e){if(!$c(e))return!1;var t=J_(e);return t==F8||t==q8||t==L8||t==B8}var X_=H8;var Z8=Qo["__core-js_shared__"],Tc=Z8;var Y_=function(){var e=/[^.]+$/.exec(Tc&&Tc.keys&&Tc.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function K8(e){return!!Y_&&Y_ in e}var Q_=K8;var V8=Function.prototype,W8=V8.toString;function G8(e){if(e!=null){try{return W8.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var e1=G8;var J8=/[\\^$.*+?()[\]{}|]/g,X8=/^\[object .+?Constructor\]$/,Y8=Function.prototype,Q8=Object.prototype,eI=Y8.toString,tI=Q8.hasOwnProperty,rI=RegExp("^"+eI.call(tI).replace(J8,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function nI(e){if(!$c(e)||Q_(e))return!1;var t=X_(e)?rI:X8;return t.test(e1(e))}var t1=nI;function iI(e,t){return e==null?void 0:e[t]}var r1=iI;function oI(e,t){var r=r1(e,t);return t1(r)?r:void 0}var Pc=oI;var sI=Pc(Qo,"Map"),n1=sI;var aI=Pc(Object,"create"),ni=aI;function uI(){this.__data__=ni?ni(null):{},this.size=0}var i1=uI;function lI(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var o1=lI;var cI="__lodash_hash_undefined__",dI=Object.prototype,fI=dI.hasOwnProperty;function hI(e){var t=this.__data__;if(ni){var r=t[e];return r===cI?void 0:r}return fI.call(t,e)?t[e]:void 0}var s1=hI;var pI=Object.prototype,mI=pI.hasOwnProperty;function gI(e){var t=this.__data__;return ni?t[e]!==void 0:mI.call(t,e)}var a1=gI;var yI="__lodash_hash_undefined__";function vI(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=ni&&t===void 0?yI:t,this}var u1=vI;function ts(e){var t=-1,r=e==null?0:e.length;this.clear();while(++t<r){var i=e[t];this.set(i[0],i[1])}}ts.prototype.clear=i1;ts.prototype.delete=o1;ts.prototype.get=s1;ts.prototype.has=a1;ts.prototype.set=u1;var nm=ts;function bI(){this.size=0,this.__data__={hash:new nm,map:new(n1||H_),string:new nm}}var l1=bI;function _I(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var c1=_I;function wI(e,t){var r=e.__data__;return c1(t)?r[typeof t=="string"?"string":"hash"]:r.map}var Pi=wI;function SI(e){var t=Pi(this,e).delete(e);return this.size-=t?1:0,t}var d1=SI;function xI(e){return Pi(this,e).get(e)}var f1=xI;function kI(e){return Pi(this,e).has(e)}var h1=kI;function MI(e,t){var r=Pi(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}var p1=MI;function rs(e){var t=-1,r=e==null?0:e.length;this.clear();while(++t<r){var i=e[t];this.set(i[0],i[1])}}rs.prototype.clear=l1;rs.prototype.delete=d1;rs.prototype.get=f1;rs.prototype.has=h1;rs.prototype.set=p1;var im=rs;var EI="Expected a function";function om(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw TypeError(EI);var r=function(){var i=arguments,n=t?t.apply(this,i):i[0],o=r.cache;if(o.has(n))return o.get(n);var s=e.apply(this,i);return r.cache=o.set(n,s)||o,s};return r.cache=new(om.Cache||im),r}om.Cache=im;var Er=om;var m1=function(){return"/"};var va=()=>globalThis.crypto.randomUUID();Kr();Kr();var Ww="[\\w-]{1,63}",_A=new RegExp(`^${Ww}$`),WK=new RegExp(`^a(?:${Ww}-)?[0-9a-f]{16}$`);function Gw(e,t){let r=Buffer.from(t.replace(/-/g,""),"hex"),i=Fm("sha1").update(r).update(Buffer.from(e,"utf8")).digest();i[6]=i[6]&15|80,i[8]=i[8]&63|128;let n=i.subarray(0,16).toString("hex");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20,32)}`}var wA="3ab19d7e-9f35-45c2-926e-75e271cc60b3";function Jw(){let e=process.env.CLAUDE_CODE_REMOTE_SESSION_ID?.trim();return e?Gw(e,wA):null}var Xw=globalThis.process?.getBuiltinModule?.("async_hooks"),qm=Xw?(e)=>Xw.AsyncResource.bind(e):(e)=>e;function yo(e){if(!e)return!1;if(typeof e==="boolean")return e;let t=String(e).toLowerCase().trim();return["1","true","yes","on"].includes(t)}function Di(){let e=new Set;return{subscribe(t){let r=qm(t);return e.add(r),()=>{e.delete(r)}},emit(...t){let r;for(let i of e)try{i(...t)}catch(n){(r??=[]).push(n)}if(r)throw r.length===1?r[0]:AggregateError(r,"Signal listener(s) threw")},clear(){e.clear()}}}function Yw(){return{sent:new Set,rejected:new Set}}var xA={renderTarget:"ink",workspace:"local",canDrive:!0,transcriptSource:"local-jsonl",remote:null};function kA(){let e="";if(typeof process<"u"&&typeof process.cwd==="function"&&typeof Qw==="function"){let r=m1();try{e=eS(Qw(r))}catch{e=eS(r)}}return{originalCwd:e,projectRoot:e,totalCostUSD:0,totalAPIDuration:0,totalAPIDurationWithoutRetries:0,totalToolDuration:0,startTime:Date.now(),sessionLogicalStartTime:void 0,lastInteractionTime:Date.now(),totalLinesAdded:0,totalLinesRemoved:0,hasUnknownModelCost:!1,cwd:e,modelUsage:{},mainLoopModelOverride:void 0,refusalFallbackOccurred:!1,refusalFallbackHeaderArmed:!1,refusalFallbackLatchOriginRequestId:void 0,refusalFallbackModelLatch:void 0,sdkDialogHostActive:!1,sdkSupportedDialogKinds:void 0,sdkSupportedDialogKindsSource:void 0,replConfigArgv:[],settingsEffortAtStartup:void 0,initialMainLoopModel:void 0,resolvedOrgDefault:void 0,modelStrings:null,isInteractive:!1,thinkingDisplayExplicit:!1,permissionPromptToolName:void 0,attacherCaps:null,hasStreamingInput:!1,singleShotPrintSession:!1,modelOverrideOptOutForSession:!1,rendererMode:void 0,strictToolResultPairing:!1,memoryToggledOff:!1,sdkAgentProgressSummariesEnabled:!1,userMsgOptIn:!1,searchToolsOptIn:!1,clientType:"cli",sessionSource:void 0,sessionStartType:"fresh",questionPreviewFormat:void 0,sessionIngressToken:void 0,oauthTokenFromFd:void 0,oauthTokenFromBgSnapshot:!1,oauthScopesFromFd:void 0,apiKeyFromFd:void 0,gatewayAuth:null,gatewayRefreshInFlight:null,startupPolicySnapshot:void 0,flagSettingsPath:void 0,flagSettingsExpectedContent:void 0,flagSettingsInline:null,parentManagedSettings:null,allowedSettingSources:["userSettings","projectSettings","localSettings","flagSettings","policySettings"],meter:null,sessionCounter:null,locCounter:null,prCounter:null,commitCounter:null,costCounter:null,tokenCounter:null,codeEditToolDecisionCounter:null,activeTimeCounter:null,statsStore:null,sessionId:Jw()??va(),mainAgentId:null,parentSessionId:void 0,loggerProvider:null,eventLogger:null,pendingOTelEvents:[],meterProvider:null,tracerProvider:null,cachedTelemetryResource:null,cachedOtlpHttpAgentFactory:{direct:null,proxied:null},foundryDeploymentCapabilities:new Map,agentColorMap:new Map,agentColorIndex:0,lastAPIRequest:null,lastCancelledAPIMessageId:null,lastAPIRequestMessages:null,lastClassifierRequests:null,cachedClaudeMdContent:null,inMemoryErrorLog:[],inlinePlugins:[],inlinePluginsNoMcp:[],inlinePluginUrls:[],syncedPluginDirs:[],chromeFlagOverride:void 0,teammateAgentId:void 0,onboardingShownThisSession:!1,useCoworkPlugins:!1,disableSlashCommands:!1,sessionBypassPermissionsMode:!1,scheduledTasksEnabled:!1,sessionPrResolved:!1,sessionCronTasks:[],loopChainStartedAt:Object.create(null),loopTickInFlightPrompt:null,loopConsecutiveKeepalives:0,loopEnded:!1,sessionCreatedTeams:new Set,surfacedHookSpawnFailures:new Set,humanAttachmentDigests:new Map,bareMcpServerMatchersWarned:new Set,inheritedTeamName:void 0,sessionTrustAccepted:!1,sessionPersistenceDisabled:!1,hasExitedPlanMode:!1,needsPlanModeExitAttachment:!1,needsAutoModeExitAttachment:!1,lspRecommendationShownThisSession:!1,initJsonSchema:null,registeredHooks:null,planSlugCache:new Map,teleportedSessionInfo:null,invokedSkills:new Map,slowOperations:[],sdkBetas:void 0,longContext1mCreditsBlocked:!1,fableCreditsRequired:!1,fableConsentSessionFallback:!1,fableBridgeDialogTimedOut:!1,fableConsentDialogInteracted:!1,sdkOAuthTokenRefreshCallback:null,hostAuthTokenRefreshCallback:null,mainThreadAgentType:void 0,mainThreadAgentHooks:void 0,sessionSkillAllowlist:void 0,caps:xA,replBridgeActive:!1,mainLoopBusy:!1,directConnectServerUrl:void 0,mcpConnectNonBlocking:!1,deferredToolStubGateLatch:null,strictMcpConfig:!1,cliSessionConfigCarried:!1,sessionApprovedMcpServers:[],activeRoutine:void 0,systemPromptSectionCache:new Map,lastEmittedDate:null,additionalDirectoriesForClaudeMd:[],allowedChannels:[],hasDevChannels:!1,sessionProjectDir:null,promptCache1hAllowlist:null,stickyBetas:Yw(),thinkingTypeOverrides:new Map,inferenceProfileBackingModels:new Map,promptId:null,promptIndex:0,lastMainRequestId:void 0,lastMainThreadCacheTtlMs:null,lastApiCompletionTimestamp:null,pendingPostCompaction:!1}}var MA=kA(),EA=()=>{return};function Bm(){return EA()?.sessionId??MA.sessionId}var IA=Di(),AV=IA.subscribe;function eS(e){return process.platform==="darwin"?e.normalize("NFC"):e}var $A=Di(),RV=$A.subscribe;var TA=Di(),CV=TA.subscribe;var PA=Di();var OV=PA.subscribe;var AA=Di();var DV=AA.subscribe;var{appendFile:Z2,mkdir:hC,rename:K2,stat:pC,symlink:mC,unlink:Pv}=(()=>({}));Dn();function uS({writeFn:e,flushIntervalMs:t=1000,maxBufferSize:r=100,maxBufferBytes:i=1/0,immediateMode:n=!1}){let o=[],s=0,h=null,v=null;function b(){if(h)clearTimeout(h),h=null}function _(M){try{e(M)}catch{}}function g(){if(v)_(v.join("")),v=null;if(o.length===0)return;_(o.join("")),o=[],s=0,b()}function S(){if(!h)h=setTimeout(g,t)}function x(){if(v){v.push(...o),o=[],s=0,b();return}let M=o;o=[],s=0,b(),v=M,setImmediate(()=>{let I=v;if(v=null,I)_(I.join(""))})}return{write(M){if(n){_(M);return}if(o.push(M),s+=M.length,S(),o.length>=r||s>=i)x()},flush:g,dispose(){g()}}}var{realpathSync:LV}=(()=>({}));var Wc=function(){return"/"};Dn();function Wm(e){return process.platform==="darwin"?e.normalize("NFC"):e}function cS(e){return/^[\\/]{2}/.test(e)}function dS(e){return/^[\\/]{2}wsl(\$|\.localhost)[\\/]/i.test(e)}function OA(e){if(e.startsWith("\\\\?\\UNC\\"))return"\\\\"+e.slice(8);if(e.startsWith("\\\\?\\")&&e.length>=7&&e[5]===":")return e.slice(4);return e}function fS(e){if(/^\\\\\?\\volume\{/i.test(e))return lS(e);let t=OA(e);if(t!==e&&lS(t))return!0;return cS(t)&&!dS(t)}function lS(e){return/(^|[\\/])\.{1,2}([\\/]|$)/.test(e)||e.includes("/")}function DA(e){if(typeof e==="function")return e;if(Symbol.asyncDispose in e)return()=>e[Symbol.asyncDispose]();return()=>e[Symbol.dispose]()}class Gm{#e=new Set;register(e){let t=DA(e);this.#e.add(t);let r=()=>{this.#e.delete(t)};return Object.assign(r,{[Symbol.dispose]:r})}async drain(){let e=Array.from(this.#e);this.#e.clear(),await Promise.all(e.map(async(t)=>t()))}async[Symbol.asyncDispose](){await this.drain()}get sizeForTesting(){return this.#e.size}}var NA=new Gm;function hS(e){return NA.register(e)}var HV=new Gm;var pS=Er((e)=>{if(!e||e.trim()==="")return null;let t=e.split(",").map((o)=>o.trim()).filter(Boolean);if(t.length===0)return null;let r=t.some((o)=>o.startsWith("!")),i=t.some((o)=>!o.startsWith("!"));if(r&&i)return null;let n=t.map((o)=>o.replace(/^!/,"").toLowerCase());return{include:r?[]:n,exclude:r?n:[],isExclusive:r}});function zA(e){let t=[],r=e.match(/^MCP server ["']([^"']+)["']/);if(r&&r[1])t.push("mcp"),t.push(r[1].toLowerCase());else{let o=e.match(/^([^:[]+):/);if(o&&o[1])t.push(o[1].trim().toLowerCase())}let i=e.match(/^\[([^\]]+)]/);if(i&&i[1])t.push(i[1].trim().toLowerCase());if(e.toLowerCase().includes("1p event:"))t.push("1p");let n=e.match(/:\s*([^:]+?)(?:\s+(?:type|mode|status|event))?:/);if(n&&n[1]){let o=n[1].trim().toLowerCase();if(o.length<30&&!o.includes(" "))t.push(o)}return Array.from(new Set(t))}function jA(e,t){if(!t)return!0;if(e.length===0)return!1;if(t.isExclusive)return!e.some((r)=>t.exclude.includes(r));else return e.some((r)=>t.include.includes(r))}function mS(e,t){if(!t)return!0;let r=zA(e);return jA(r,t)}Dn();var qe={};wn(qe,{xid:()=>j9,void:()=>o5,uuidv7:()=>A9,uuidv6:()=>P9,uuidv4:()=>T9,uuid:()=>$9,url:()=>R9,uppercase:()=>vu,unknown:()=>qt,union:()=>Dt,undefined:()=>n5,ulid:()=>z9,uint64:()=>t5,uint32:()=>Y9,tuple:()=>l5,trim:()=>ku,treeifyError:()=>Yc,transform:()=>zy,toUpperCase:()=>Eu,toLowerCase:()=>Mu,toJSONSchema:()=>xs,templateLiteral:()=>v5,symbol:()=>r5,superRefine:()=>xx,success:()=>g5,stringbool:()=>w5,stringFormat:()=>W9,string:()=>de,strictObject:()=>u5,startsWith:()=>_u,size:()=>mu,setErrorMap:()=>k5,set:()=>f5,safeParseAsync:()=>hy,safeParse:()=>fy,registry:()=>Va,regexes:()=>Fi,regex:()=>gu,refine:()=>Sx,record:()=>Nt,readonly:()=>gx,property:()=>ny,promise:()=>b5,prettifyError:()=>Qc,preprocess:()=>Gf,prefault:()=>lx,positive:()=>Qg,pipe:()=>qf,partialRecord:()=>c5,parseAsync:()=>dy,parse:()=>cy,overwrite:()=>fi,optional:()=>Lt,object:()=>Qe,number:()=>It,nullish:()=>m5,nullable:()=>Ff,null:()=>Bf,normalize:()=>xu,nonpositive:()=>ty,nonoptional:()=>cx,nonnegative:()=>ry,never:()=>Hf,negative:()=>ey,nativeEnum:()=>h5,nanoid:()=>O9,nan:()=>y5,multipleOf:()=>Eo,minSize:()=>Io,minLength:()=>Hi,mime:()=>Su,maxSize:()=>_s,maxLength:()=>ws,map:()=>d5,lte:()=>kn,lt:()=>ci,lowercase:()=>yu,looseObject:()=>Lr,locales:()=>vs,literal:()=>tt,length:()=>Ss,lazy:()=>bx,ksuid:()=>U9,keyof:()=>a5,jwt:()=>V9,json:()=>S5,iso:()=>ks,ipv6:()=>F9,ipv4:()=>L9,intersection:()=>Cu,int64:()=>e5,int32:()=>X9,int:()=>py,instanceof:()=>_5,includes:()=>bu,guid:()=>I9,gte:()=>rn,gt:()=>di,globalRegistry:()=>tn,getErrorMap:()=>M5,function:()=>Of,formatError:()=>fs,float64:()=>J9,float32:()=>G9,flattenError:()=>ds,file:()=>p5,enum:()=>Vr,endsWith:()=>wu,emoji:()=>C9,email:()=>E9,e164:()=>K9,discriminatedUnion:()=>Vf,date:()=>s5,custom:()=>Fy,cuid2:()=>N9,cuid:()=>D9,core:()=>Nn,config:()=>rr,coerce:()=>qy,clone:()=>Ur,cidrv6:()=>B9,cidrv4:()=>q9,check:()=>wx,catch:()=>hx,boolean:()=>or,bigint:()=>Q9,base64url:()=>Z9,base64:()=>H9,array:()=>_t,any:()=>i5,_default:()=>ax,_ZodString:()=>my,ZodXID:()=>xy,ZodVoid:()=>JS,ZodUnknown:()=>WS,ZodUnion:()=>Oy,ZodUndefined:()=>ZS,ZodUUID:()=>hi,ZodURL:()=>yy,ZodULID:()=>Sy,ZodType:()=>vt,ZodTuple:()=>ex,ZodTransform:()=>Ny,ZodTemplateLiteral:()=>yx,ZodSymbol:()=>HS,ZodSuccess:()=>dx,ZodStringFormat:()=>Ut,ZodString:()=>Tu,ZodSet:()=>rx,ZodRecord:()=>Dy,ZodRealError:()=>Ms,ZodReadonly:()=>mx,ZodPromise:()=>_x,ZodPrefault:()=>ux,ZodPipe:()=>Ly,ZodOptional:()=>jy,ZodObject:()=>Kf,ZodNumberFormat:()=>Es,ZodNumber:()=>Pu,ZodNullable:()=>ox,ZodNull:()=>KS,ZodNonOptional:()=>Uy,ZodNever:()=>GS,ZodNanoID:()=>by,ZodNaN:()=>px,ZodMap:()=>tx,ZodLiteral:()=>nx,ZodLazy:()=>vx,ZodKSUID:()=>ky,ZodJWT:()=>Ry,ZodIssueCode:()=>x5,ZodIntersection:()=>QS,ZodISOTime:()=>jf,ZodISODuration:()=>Uf,ZodISODateTime:()=>Nf,ZodISODate:()=>zf,ZodIPv6:()=>Ey,ZodIPv4:()=>My,ZodGUID:()=>Lf,ZodFile:()=>ix,ZodError:()=>k9,ZodEnum:()=>$u,ZodEmoji:()=>vy,ZodEmail:()=>gy,ZodE164:()=>Ay,ZodDiscriminatedUnion:()=>YS,ZodDefault:()=>sx,ZodDate:()=>Zf,ZodCustomStringFormat:()=>BS,ZodCustom:()=>Wf,ZodCatch:()=>fx,ZodCUID2:()=>wy,ZodCUID:()=>_y,ZodCIDRv6:()=>$y,ZodCIDRv4:()=>Iy,ZodBoolean:()=>Au,ZodBigIntFormat:()=>Cy,ZodBigInt:()=>Ru,ZodBase64URL:()=>Py,ZodBase64:()=>Ty,ZodArray:()=>XS,ZodAny:()=>VS,TimePrecision:()=>cf,NEVER:()=>Gc,$output:()=>af,$input:()=>uf,$brand:()=>Jc});var Nn={};wn(Nn,{version:()=>Q0,util:()=>Be,treeifyError:()=>Yc,toJSONSchema:()=>xs,toDotPath:()=>vS,safeParseAsync:()=>Li,safeParse:()=>Ui,registry:()=>Va,regexes:()=>Fi,prettifyError:()=>Qc,parseAsync:()=>So,parse:()=>wo,locales:()=>vs,isValidJWT:()=>NS,isValidBase64URL:()=>DS,isValidBase64:()=>og,globalRegistry:()=>tn,globalConfig:()=>Ra,function:()=>Of,formatError:()=>fs,flattenError:()=>ds,config:()=>rr,clone:()=>Ur,_xid:()=>ou,_void:()=>Ef,_uuidv7:()=>Ya,_uuidv6:()=>Xa,_uuidv4:()=>Ja,_uuid:()=>Ga,_url:()=>Qa,_uppercase:()=>vu,_unknown:()=>Mo,_union:()=>r9,_undefined:()=>Sf,_ulid:()=>iu,_uint64:()=>_f,_uint32:()=>gf,_tuple:()=>iy,_trim:()=>ku,_transform:()=>d9,_toUpperCase:()=>Eu,_toLowerCase:()=>Mu,_templateLiteral:()=>_9,_symbol:()=>wf,_success:()=>g9,_stringbool:()=>Rf,_stringFormat:()=>Cf,_string:()=>lf,_startsWith:()=>_u,_size:()=>mu,_set:()=>a9,_safeParseAsync:()=>nd,_safeParse:()=>rd,_regex:()=>gu,_refine:()=>Af,_record:()=>o9,_readonly:()=>b9,_property:()=>ny,_promise:()=>S9,_positive:()=>Qg,_pipe:()=>v9,_parseAsync:()=>td,_parse:()=>ed,_overwrite:()=>fi,_optional:()=>f9,_number:()=>df,_nullable:()=>h9,_null:()=>xf,_normalize:()=>xu,_nonpositive:()=>ty,_nonoptional:()=>m9,_nonnegative:()=>ry,_never:()=>Mf,_negative:()=>ey,_nativeEnum:()=>l9,_nanoid:()=>tu,_nan:()=>$f,_multipleOf:()=>Eo,_minSize:()=>Io,_minLength:()=>Hi,_min:()=>rn,_mime:()=>Su,_maxSize:()=>_s,_maxLength:()=>ws,_max:()=>kn,_map:()=>s9,_lte:()=>kn,_lt:()=>ci,_lowercase:()=>yu,_literal:()=>c9,_length:()=>Ss,_lazy:()=>w9,_ksuid:()=>su,_jwt:()=>pu,_isoTime:()=>Vg,_isoDuration:()=>Wg,_isoDateTime:()=>Zg,_isoDate:()=>Kg,_ipv6:()=>uu,_ipv4:()=>au,_intersection:()=>i9,_int64:()=>bf,_int32:()=>mf,_int:()=>ff,_includes:()=>bu,_guid:()=>bs,_gte:()=>rn,_gt:()=>di,_float64:()=>pf,_float32:()=>hf,_file:()=>Tf,_enum:()=>u9,_endsWith:()=>wu,_emoji:()=>eu,_email:()=>Wa,_e164:()=>hu,_discriminatedUnion:()=>n9,_default:()=>p9,_date:()=>If,_custom:()=>Pf,_cuid2:()=>nu,_cuid:()=>ru,_coercedString:()=>Hg,_coercedNumber:()=>Gg,_coercedDate:()=>Yg,_coercedBoolean:()=>Jg,_coercedBigint:()=>Xg,_cidrv6:()=>cu,_cidrv4:()=>lu,_catch:()=>y9,_boolean:()=>yf,_bigint:()=>vf,_base64url:()=>fu,_base64:()=>du,_array:()=>Iu,_any:()=>kf,TimePrecision:()=>cf,NEVER:()=>Gc,JSONSchemaGenerator:()=>Df,JSONSchema:()=>LS,Doc:()=>ad,$output:()=>af,$input:()=>uf,$constructor:()=>ne,$brand:()=>Jc,$ZodXID:()=>bd,$ZodVoid:()=>zd,$ZodUnknown:()=>ko,$ZodUnion:()=>Ha,$ZodUndefined:()=>Cd,$ZodUUID:()=>dd,$ZodURL:()=>hd,$ZodULID:()=>vd,$ZodType:()=>ut,$ZodTuple:()=>Bi,$ZodTransform:()=>gs,$ZodTemplateLiteral:()=>rf,$ZodSymbol:()=>Rd,$ZodSuccess:()=>Yd,$ZodStringFormat:()=>Ot,$ZodString:()=>qi,$ZodSet:()=>Bd,$ZodRegistry:()=>Ka,$ZodRecord:()=>Fd,$ZodRealError:()=>cs,$ZodReadonly:()=>tf,$ZodPromise:()=>nf,$ZodPrefault:()=>Jd,$ZodPipe:()=>ys,$ZodOptional:()=>Vd,$ZodObject:()=>Ba,$ZodNumberFormat:()=>Pd,$ZodNumber:()=>Fa,$ZodNullable:()=>Wd,$ZodNull:()=>Od,$ZodNonOptional:()=>Xd,$ZodNever:()=>Nd,$ZodNanoID:()=>md,$ZodNaN:()=>ef,$ZodMap:()=>qd,$ZodLiteral:()=>Zd,$ZodLazy:()=>of,$ZodKSUID:()=>_d,$ZodJWT:()=>$d,$ZodIntersection:()=>Ld,$ZodISOTime:()=>ng,$ZodISODuration:()=>ig,$ZodISODateTime:()=>tg,$ZodISODate:()=>rg,$ZodIPv6:()=>Sd,$ZodIPv4:()=>wd,$ZodGUID:()=>cd,$ZodFunction:()=>oy,$ZodFile:()=>Kd,$ZodError:()=>La,$ZodEnum:()=>Hd,$ZodEmoji:()=>pd,$ZodEmail:()=>fd,$ZodE164:()=>Id,$ZodDiscriminatedUnion:()=>Ud,$ZodDefault:()=>Gd,$ZodDate:()=>jd,$ZodCustomStringFormat:()=>Td,$ZodCustom:()=>sf,$ZodCheckUpperCase:()=>K0,$ZodCheckStringFormat:()=>hs,$ZodCheckStartsWith:()=>W0,$ZodCheckSizeEquals:()=>L0,$ZodCheckRegex:()=>H0,$ZodCheckProperty:()=>J0,$ZodCheckOverwrite:()=>Y0,$ZodCheckNumberFormat:()=>N0,$ZodCheckMultipleOf:()=>D0,$ZodCheckMinSize:()=>U0,$ZodCheckMinLength:()=>q0,$ZodCheckMimeType:()=>X0,$ZodCheckMaxSize:()=>j0,$ZodCheckMaxLength:()=>F0,$ZodCheckLowerCase:()=>Z0,$ZodCheckLessThan:()=>od,$ZodCheckLengthEquals:()=>B0,$ZodCheckIncludes:()=>V0,$ZodCheckGreaterThan:()=>sd,$ZodCheckEndsWith:()=>G0,$ZodCheckBigIntFormat:()=>z0,$ZodCheck:()=>Ht,$ZodCatch:()=>Qd,$ZodCUID2:()=>yd,$ZodCUID:()=>gd,$ZodCIDRv6:()=>kd,$ZodCIDRv4:()=>xd,$ZodBoolean:()=>ps,$ZodBigIntFormat:()=>Ad,$ZodBigInt:()=>qa,$ZodBase64URL:()=>Ed,$ZodBase64:()=>Md,$ZodAsyncError:()=>ui,$ZodArray:()=>ms,$ZodAny:()=>Dd});var Gc=Object.freeze({status:"aborted"});function ne(e,t,r){function i(h,v){var b;Object.defineProperty(h,"_zod",{value:h._zod??{},enumerable:!1}),(b=h._zod).traits??(b.traits=new Set),h._zod.traits.add(e),t(h,v);for(let _ in s.prototype)if(!(_ in h))Object.defineProperty(h,_,{value:s.prototype[_].bind(h)});h._zod.constr=s,h._zod.def=v}let n=r?.Parent??Object;class o extends n{}Object.defineProperty(o,"name",{value:e});function s(h){var v;let b=r?.Parent?new o:this;i(b,h),(v=b._zod).deferred??(v.deferred=[]);for(let _ of b._zod.deferred)_();return b}return Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:(h)=>{if(r?.Parent&&h instanceof r.Parent)return!0;return h?._zod?.traits?.has(e)}}),Object.defineProperty(s,"name",{value:e}),s}var Jc=Symbol("zod_brand");class ui extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}var Ra={};function rr(e){if(e)Object.assign(Ra,e);return Ra}var Be={};wn(Be,{unwrapMessage:()=>Ca,stringifyPrimitive:()=>Ve,required:()=>tR,randomString:()=>KA,propertyKeyTypes:()=>za,promiseAllObject:()=>ZA,primitiveTypes:()=>t0,prefixIssues:()=>en,pick:()=>JA,partial:()=>eR,optionalKeys:()=>r0,omit:()=>XA,numKeys:()=>VA,nullish:()=>ji,normalizeParams:()=>Fe,merge:()=>QA,jsonStringifyReplacer:()=>Xm,joinValues:()=>be,issue:()=>o0,isPlainObject:()=>ls,isObject:()=>us,getSizableOrigin:()=>ja,getParsedType:()=>WA,getLengthableOrigin:()=>Ua,getEnumValues:()=>Oa,getElementAtPath:()=>HA,floatSafeRemainder:()=>Ym,finalizeIssue:()=>fn,extend:()=>YA,escapeRegex:()=>li,esc:()=>bo,defineLazy:()=>$t,createTransparentProxy:()=>GA,clone:()=>Ur,cleanRegex:()=>Na,cleanEnum:()=>rR,captureStackTrace:()=>Xc,cached:()=>Da,assignProp:()=>Qm,assertNotEqual:()=>LA,assertNever:()=>qA,assertIs:()=>FA,assertEqual:()=>UA,assert:()=>BA,allowsEval:()=>e0,aborted:()=>_o,NUMBER_FORMAT_RANGES:()=>n0,Class:()=>gS,BIGINT_FORMAT_RANGES:()=>i0});function UA(e){return e}function LA(e){return e}function FA(e){}function qA(e){throw Error()}function BA(e){}function Oa(e){let t=Object.values(e).filter((i)=>typeof i==="number");return Object.entries(e).filter(([i,n])=>t.indexOf(+i)===-1).map(([i,n])=>n)}function be(e,t="|"){return e.map((r)=>Ve(r)).join(t)}function Xm(e,t){if(typeof t==="bigint")return t.toString();return t}function Da(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw Error("cached value already set")}}}function ji(e){return e===null||e===void 0}function Na(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Ym(e,t){let r=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,n=r>i?r:i,o=Number.parseInt(e.toFixed(n).replace(".","")),s=Number.parseInt(t.toFixed(n).replace(".",""));return o%s/10**n}function $t(e,t,r){Object.defineProperty(e,t,{get(){{let n=r();return e[t]=n,n}throw Error("cached value already set")},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Qm(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function HA(e,t){if(!t)return e;return t.reduce((r,i)=>r?.[i],e)}function ZA(e){let t=Object.keys(e),r=t.map((i)=>e[i]);return Promise.all(r).then((i)=>{let n={};for(let o=0;o<t.length;o++)n[t[o]]=i[o];return n})}function KA(e=10){let r="";for(let i=0;i<e;i++)r+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return r}function bo(e){return JSON.stringify(e)}var Xc=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function us(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var e0=Da(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function ls(e){if(us(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let r=t.prototype;if(us(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function VA(e){let t=0;for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r))t++;return t}var WA=(e)=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(e))return"array";if(e===null)return"null";if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return"promise";if(typeof Map<"u"&&e instanceof Map)return"map";if(typeof Set<"u"&&e instanceof Set)return"set";if(typeof Date<"u"&&e instanceof Date)return"date";if(typeof File<"u"&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${t}`)}},za=new Set(["string","number","symbol"]),t0=new Set(["string","number","bigint","boolean","symbol","undefined"]);function li(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ur(e,t,r){let i=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)i._zod.parent=e;return i}function Fe(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function GA(e){let t;return new Proxy({},{get(r,i,n){return t??(t=e()),Reflect.get(t,i,n)},set(r,i,n,o){return t??(t=e()),Reflect.set(t,i,n,o)},has(r,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(r,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(r,i,n){return t??(t=e()),Reflect.defineProperty(t,i,n)}})}function Ve(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function r0(e){return Object.keys(e).filter((t)=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var n0={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},i0={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function JA(e,t){let r={},i=e._zod.def;for(let n in t){if(!(n in i.shape))throw Error(`Unrecognized key: "${n}"`);if(!t[n])continue;r[n]=i.shape[n]}return Ur(e,{...e._zod.def,shape:r,checks:[]})}function XA(e,t){let r={...e._zod.def.shape},i=e._zod.def;for(let n in t){if(!(n in i.shape))throw Error(`Unrecognized key: "${n}"`);if(!t[n])continue;delete r[n]}return Ur(e,{...e._zod.def,shape:r,checks:[]})}function YA(e,t){if(!ls(t))throw Error("Invalid input to extend: expected a plain object");let r={...e._zod.def,get shape(){let i={...e._zod.def.shape,...t};return Qm(this,"shape",i),i},checks:[]};return Ur(e,r)}function QA(e,t){return Ur(e,{...e._zod.def,get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return Qm(this,"shape",r),r},catchall:t._zod.def.catchall,checks:[]})}function eR(e,t,r){let i=t._zod.def.shape,n={...i};if(r)for(let o in r){if(!(o in i))throw Error(`Unrecognized key: "${o}"`);if(!r[o])continue;n[o]=e?new e({type:"optional",innerType:i[o]}):i[o]}else for(let o in i)n[o]=e?new e({type:"optional",innerType:i[o]}):i[o];return Ur(t,{...t._zod.def,shape:n,checks:[]})}function tR(e,t,r){let i=t._zod.def.shape,n={...i};if(r)for(let o in r){if(!(o in n))throw Error(`Unrecognized key: "${o}"`);if(!r[o])continue;n[o]=new e({type:"nonoptional",innerType:i[o]})}else for(let o in i)n[o]=new e({type:"nonoptional",innerType:i[o]});return Ur(t,{...t._zod.def,shape:n,checks:[]})}function _o(e,t=0){for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function en(e,t){return t.map((r)=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}function Ca(e){return typeof e==="string"?e:e?.message}function fn(e,t,r){let i={...e,path:e.path??[]};if(!e.message){let n=Ca(e.inst?._zod.def?.error?.(e))??Ca(t?.error?.(e))??Ca(r.customError?.(e))??Ca(r.localeError?.(e))??"Invalid input";i.message=n}if(delete i.inst,delete i.continue,!t?.reportInput)delete i.input;return i}function ja(e){if(e instanceof Set)return"set";if(e instanceof Map)return"map";if(e instanceof File)return"file";return"unknown"}function Ua(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function o0(...e){let[t,r,i]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:i};return{...t}}function rR(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map((t)=>t[1])}class gS{constructor(...e){}}var yS=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,Xm,2)},enumerable:!0})},La=ne("$ZodError",yS),cs=ne("$ZodError",yS,{Parent:Error});function ds(e,t=(r)=>r.message){let r={},i=[];for(let n of e.issues)if(n.path.length>0)r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n));else i.push(t(n));return{formErrors:i,fieldErrors:r}}function fs(e,t){let r=t||function(o){return o.message},i={_errors:[]},n=(o)=>{for(let s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map((h)=>n({issues:h}));else if(s.code==="invalid_key")n({issues:s.issues});else if(s.code==="invalid_element")n({issues:s.issues});else if(s.path.length===0)i._errors.push(r(s));else{let h=i,v=0;while(v<s.path.length){let b=s.path[v];if(v!==s.path.length-1)h[b]=h[b]||{_errors:[]};else h[b]=h[b]||{_errors:[]},h[b]._errors.push(r(s));h=h[b],v++}}};return n(e),i}function Yc(e,t){let r=t||function(o){return o.message},i={errors:[]},n=(o,s=[])=>{var h,v;for(let b of o.issues)if(b.code==="invalid_union"&&b.errors.length)b.errors.map((_)=>n({issues:_},b.path));else if(b.code==="invalid_key")n({issues:b.issues},b.path);else if(b.code==="invalid_element")n({issues:b.issues},b.path);else{let _=[...s,...b.path];if(_.length===0){i.errors.push(r(b));continue}let g=i,S=0;while(S<_.length){let x=_[S],M=S===_.length-1;if(typeof x==="string")g.properties??(g.properties={}),(h=g.properties)[x]??(h[x]={errors:[]}),g=g.properties[x];else g.items??(g.items=[]),(v=g.items)[x]??(v[x]={errors:[]}),g=g.items[x];if(M)g.errors.push(r(b));S++}}};return n(e),i}function vS(e){let t=[];for(let r of e)if(typeof r==="number")t.push(`[${r}]`);else if(typeof r==="symbol")t.push(`[${JSON.stringify(String(r))}]`);else if(/[^\w$]/.test(r))t.push(`[${JSON.stringify(r)}]`);else{if(t.length)t.push(".");t.push(r)}return t.join("")}function Qc(e){let t=[],r=[...e.issues].sort((i,n)=>i.path.length-n.path.length);for(let i of r)if(t.push(`✖ ${i.message}`),i.path?.length)t.push(` → at ${vS(i.path)}`);return t.join(`
|
|
27
|
+
`)}var ed=(e)=>(t,r,i,n)=>{let o=i?Object.assign(i,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new ui;if(s.issues.length){let h=new(n?.Err??e)(s.issues.map((v)=>fn(v,o,rr())));throw Xc(h,n?.callee),h}return s.value},wo=ed(cs),td=(e)=>async(t,r,i,n)=>{let o=i?Object.assign(i,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)s=await s;if(s.issues.length){let h=new(n?.Err??e)(s.issues.map((v)=>fn(v,o,rr())));throw Xc(h,n?.callee),h}return s.value},So=td(cs),rd=(e)=>(t,r,i)=>{let n=i?{...i,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},n);if(o instanceof Promise)throw new ui;return o.issues.length?{success:!1,error:new(e??La)(o.issues.map((s)=>fn(s,n,rr())))}:{success:!0,data:o.value}},Ui=rd(cs),nd=(e)=>async(t,r,i)=>{let n=i?Object.assign(i,{async:!0}):{async:!0},o=t._zod.run({value:r,issues:[]},n);if(o instanceof Promise)o=await o;return o.issues.length?{success:!1,error:new e(o.issues.map((s)=>fn(s,n,rr())))}:{success:!0,data:o.value}},Li=nd(cs);var Fi={};wn(Fi,{xid:()=>l0,uuid7:()=>aR,uuid6:()=>sR,uuid4:()=>oR,uuid:()=>xo,uppercase:()=>O0,unicodeEmail:()=>cR,undefined:()=>R0,ulid:()=>u0,time:()=>k0,string:()=>E0,rfc5322Email:()=>lR,number:()=>T0,null:()=>A0,nanoid:()=>d0,lowercase:()=>C0,ksuid:()=>c0,ipv6:()=>y0,ipv4:()=>g0,integer:()=>$0,html5Email:()=>uR,hostname:()=>w0,guid:()=>h0,extendedDuration:()=>iR,emoji:()=>m0,email:()=>p0,e164:()=>S0,duration:()=>f0,domain:()=>hR,datetime:()=>M0,date:()=>x0,cuid2:()=>a0,cuid:()=>s0,cidrv6:()=>b0,cidrv4:()=>v0,browserEmail:()=>dR,boolean:()=>P0,bigint:()=>I0,base64url:()=>id,base64:()=>_0,_emoji:()=>fR});var s0=/^[cC][^\s-]{8,}$/,a0=/^[0-9a-z]+$/,u0=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,l0=/^[0-9a-vA-V]{20}$/,c0=/^[A-Za-z0-9]{27}$/,d0=/^[a-zA-Z0-9_-]{21}$/,f0=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,iR=/^[-+]?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)?)??$/,h0=/^([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})$/,xo=(e)=>{if(!e)return/^([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)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},oR=xo(4),sR=xo(6),aR=xo(7),p0=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,uR=/^[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])?)*$/,lR=/^(([^<>()\[\]\\.,;:\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,}))$/,cR=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,dR=/^[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])?)*$/,fR="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function m0(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}var g0=/^(?:(?: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])$/,y0=/^(([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})$/,v0=/^((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])$/,b0=/^(([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])$/,_0=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,id=/^[A-Za-z0-9_-]*$/,w0=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,hR=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,S0=/^\+(?:[0-9]){6,14}[0-9]$/,bS="(?:(?:\\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])))",x0=new RegExp(`^${bS}$`);function _S(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function k0(e){return new RegExp(`^${_S(e)}$`)}function M0(e){let t=_S({precision:e.precision}),r=["Z"];if(e.local)r.push("");if(e.offset)r.push("([+-]\\d{2}:\\d{2})");let i=`${t}(?:${r.join("|")})`;return new RegExp(`^${bS}T(?:${i})$`)}var E0=(e)=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},I0=/^\d+n?$/,$0=/^\d+$/,T0=/^-?\d+(?:\.\d+)?/i,P0=/true|false/i,A0=/null/i;var R0=/undefined/i;var C0=/^[^A-Z]*$/,O0=/^[^a-z]*$/;var Ht=ne("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),SS={number:"number",bigint:"bigint",object:"date"},od=ne("$ZodCheckLessThan",(e,t)=>{Ht.init(e,t);let r=SS[typeof t.value];e._zod.onattach.push((i)=>{let n=i._zod.bag,o=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(t.value<o)if(t.inclusive)n.maximum=t.value;else n.exclusiveMaximum=t.value}),e._zod.check=(i)=>{if(t.inclusive?i.value<=t.value:i.value<t.value)return;i.issues.push({origin:r,code:"too_big",maximum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),sd=ne("$ZodCheckGreaterThan",(e,t)=>{Ht.init(e,t);let r=SS[typeof t.value];e._zod.onattach.push((i)=>{let n=i._zod.bag,o=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(t.value>o)if(t.inclusive)n.minimum=t.value;else n.exclusiveMinimum=t.value}),e._zod.check=(i)=>{if(t.inclusive?i.value>=t.value:i.value>t.value)return;i.issues.push({origin:r,code:"too_small",minimum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),D0=ne("$ZodCheckMultipleOf",(e,t)=>{Ht.init(e,t),e._zod.onattach.push((r)=>{var i;(i=r._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=(r)=>{if(typeof r.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof r.value==="bigint"?r.value%t.value===BigInt(0):Ym(r.value,t.value)===0)return;r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),N0=ne("$ZodCheckNumberFormat",(e,t)=>{Ht.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),i=r?"int":"number",[n,o]=n0[t.format];e._zod.onattach.push((s)=>{let h=s._zod.bag;if(h.format=t.format,h.minimum=n,h.maximum=o,r)h.pattern=$0}),e._zod.check=(s)=>{let h=s.value;if(r){if(!Number.isInteger(h)){s.issues.push({expected:i,format:t.format,code:"invalid_type",input:h,inst:e});return}if(!Number.isSafeInteger(h)){if(h>0)s.issues.push({input:h,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort});else s.issues.push({input:h,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort});return}}if(h<n)s.issues.push({origin:"number",input:h,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort});if(h>o)s.issues.push({origin:"number",input:h,code:"too_big",maximum:o,inst:e})}}),z0=ne("$ZodCheckBigIntFormat",(e,t)=>{Ht.init(e,t);let[r,i]=i0[t.format];e._zod.onattach.push((n)=>{let o=n._zod.bag;o.format=t.format,o.minimum=r,o.maximum=i}),e._zod.check=(n)=>{let o=n.value;if(o<r)n.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort});if(o>i)n.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inst:e})}}),j0=ne("$ZodCheckMaxSize",(e,t)=>{Ht.init(e,t),e._zod.when=(r)=>{let i=r.value;return!ji(i)&&i.size!==void 0},e._zod.onattach.push((r)=>{let i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<i)r._zod.bag.maximum=t.maximum}),e._zod.check=(r)=>{let i=r.value;if(i.size<=t.maximum)return;r.issues.push({origin:ja(i),code:"too_big",maximum:t.maximum,input:i,inst:e,continue:!t.abort})}}),U0=ne("$ZodCheckMinSize",(e,t)=>{Ht.init(e,t),e._zod.when=(r)=>{let i=r.value;return!ji(i)&&i.size!==void 0},e._zod.onattach.push((r)=>{let i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>i)r._zod.bag.minimum=t.minimum}),e._zod.check=(r)=>{let i=r.value;if(i.size>=t.minimum)return;r.issues.push({origin:ja(i),code:"too_small",minimum:t.minimum,input:i,inst:e,continue:!t.abort})}}),L0=ne("$ZodCheckSizeEquals",(e,t)=>{Ht.init(e,t),e._zod.when=(r)=>{let i=r.value;return!ji(i)&&i.size!==void 0},e._zod.onattach.push((r)=>{let i=r._zod.bag;i.minimum=t.size,i.maximum=t.size,i.size=t.size}),e._zod.check=(r)=>{let i=r.value,n=i.size;if(n===t.size)return;let o=n>t.size;r.issues.push({origin:ja(i),...o?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),F0=ne("$ZodCheckMaxLength",(e,t)=>{Ht.init(e,t),e._zod.when=(r)=>{let i=r.value;return!ji(i)&&i.length!==void 0},e._zod.onattach.push((r)=>{let i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<i)r._zod.bag.maximum=t.maximum}),e._zod.check=(r)=>{let i=r.value;if(i.length<=t.maximum)return;let o=Ua(i);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),q0=ne("$ZodCheckMinLength",(e,t)=>{Ht.init(e,t),e._zod.when=(r)=>{let i=r.value;return!ji(i)&&i.length!==void 0},e._zod.onattach.push((r)=>{let i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>i)r._zod.bag.minimum=t.minimum}),e._zod.check=(r)=>{let i=r.value;if(i.length>=t.minimum)return;let o=Ua(i);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),B0=ne("$ZodCheckLengthEquals",(e,t)=>{Ht.init(e,t),e._zod.when=(r)=>{let i=r.value;return!ji(i)&&i.length!==void 0},e._zod.onattach.push((r)=>{let i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=(r)=>{let i=r.value,n=i.length;if(n===t.length)return;let o=Ua(i),s=n>t.length;r.issues.push({origin:o,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),hs=ne("$ZodCheckStringFormat",(e,t)=>{var r,i;if(Ht.init(e,t),e._zod.onattach.push((n)=>{let o=n._zod.bag;if(o.format=t.format,t.pattern)o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern)}),t.pattern)(r=e._zod).check??(r.check=(n)=>{if(t.pattern.lastIndex=0,t.pattern.test(n.value))return;n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(i=e._zod).check??(i.check=()=>{})}),H0=ne("$ZodCheckRegex",(e,t)=>{hs.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Z0=ne("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=C0),hs.init(e,t)}),K0=ne("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=O0),hs.init(e,t)}),V0=ne("$ZodCheckIncludes",(e,t)=>{Ht.init(e,t);let r=li(t.includes),i=new RegExp(typeof t.position==="number"?`^.{${t.position}}${r}`:r);t.pattern=i,e._zod.onattach.push((n)=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),e._zod.check=(n)=>{if(n.value.includes(t.includes,t.position))return;n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),W0=ne("$ZodCheckStartsWith",(e,t)=>{Ht.init(e,t);let r=new RegExp(`^${li(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push((i)=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=(i)=>{if(i.value.startsWith(t.prefix))return;i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),G0=ne("$ZodCheckEndsWith",(e,t)=>{Ht.init(e,t);let r=new RegExp(`.*${li(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push((i)=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=(i)=>{if(i.value.endsWith(t.suffix))return;i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});function wS(e,t,r){if(e.issues.length)t.issues.push(...en(r,e.issues))}var J0=ne("$ZodCheckProperty",(e,t)=>{Ht.init(e,t),e._zod.check=(r)=>{let i=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(i instanceof Promise)return i.then((n)=>wS(n,r,t.property));wS(i,r,t.property);return}}),X0=ne("$ZodCheckMimeType",(e,t)=>{Ht.init(e,t);let r=new Set(t.mime);e._zod.onattach.push((i)=>{i._zod.bag.mime=t.mime}),e._zod.check=(i)=>{if(r.has(i.value.type))return;i.issues.push({code:"invalid_value",values:t.mime,input:i.value.type,inst:e})}}),Y0=ne("$ZodCheckOverwrite",(e,t)=>{Ht.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class ad{constructor(e=[]){if(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 r=e.split(`
|
|
28
28
|
`).filter((o)=>o),i=Math.min(...r.map((o)=>o.length-o.trimStart().length)),n=r.map((o)=>o.slice(i)).map((o)=>" ".repeat(this.indent*2)+o);for(let o of n)this.content.push(o)}compile(){let e=Function,t=this?.args,i=[...(this?.content??[""]).map((n)=>` ${n}`)];return new e(...t,i.join(`
|
|
29
29
|
`))}}var Q0={major:4,minor:0,patch:0};var ut=ne("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Q0;let i=[...e._zod.def.checks??[]];if(e._zod.traits.has("$ZodCheck"))i.unshift(e);for(let n of i)for(let o of n._zod.onattach)o(e);if(i.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(o,s,h)=>{let v=_o(o),b;for(let _ of s){if(_._zod.when){if(!_._zod.when(o))continue}else if(v)continue;let g=o.issues.length,S=_._zod.check(o);if(S instanceof Promise&&h?.async===!1)throw new ui;if(b||S instanceof Promise)b=(b??Promise.resolve()).then(async()=>{if(await S,o.issues.length===g)return;if(!v)v=_o(o,g)});else{if(o.issues.length===g)continue;if(!v)v=_o(o,g)}}if(b)return b.then(()=>o);return o};e._zod.run=(o,s)=>{let h=e._zod.parse(o,s);if(h instanceof Promise){if(s.async===!1)throw new ui;return h.then((v)=>n(v,i,s))}return n(h,i,s)}}e["~standard"]={validate:(n)=>{try{let o=Ui(e,n);return o.success?{value:o.data}:{issues:o.error?.issues}}catch(o){return Li(e,n).then((s)=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}}),qi=ne("$ZodString",(e,t)=>{ut.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??E0(e._zod.bag),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=String(r.value)}catch(n){}if(typeof r.value==="string")return r;return r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Ot=ne("$ZodStringFormat",(e,t)=>{hs.init(e,t),qi.init(e,t)}),cd=ne("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=h0),Ot.init(e,t)}),dd=ne("$ZodUUID",(e,t)=>{if(t.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=xo(i))}else t.pattern??(t.pattern=xo());Ot.init(e,t)}),fd=ne("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=p0),Ot.init(e,t)}),hd=ne("$ZodURL",(e,t)=>{Ot.init(e,t),e._zod.check=(r)=>{try{let i=r.value,n=new URL(i),o=n.href;if(t.hostname){if(t.hostname.lastIndex=0,!t.hostname.test(n.hostname))r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:w0.source,input:r.value,inst:e,continue:!t.abort})}if(t.protocol){if(t.protocol.lastIndex=0,!t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol))r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})}if(!i.endsWith("/")&&o.endsWith("/"))r.value=o.slice(0,-1);else r.value=o;return}catch(i){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),pd=ne("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=m0()),Ot.init(e,t)}),md=ne("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=d0),Ot.init(e,t)}),gd=ne("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=s0),Ot.init(e,t)}),yd=ne("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=a0),Ot.init(e,t)}),vd=ne("$ZodULID",(e,t)=>{t.pattern??(t.pattern=u0),Ot.init(e,t)}),bd=ne("$ZodXID",(e,t)=>{t.pattern??(t.pattern=l0),Ot.init(e,t)}),_d=ne("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=c0),Ot.init(e,t)}),tg=ne("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=M0(t)),Ot.init(e,t)}),rg=ne("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=x0),Ot.init(e,t)}),ng=ne("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=k0(t)),Ot.init(e,t)}),ig=ne("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=f0),Ot.init(e,t)}),wd=ne("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=g0),Ot.init(e,t),e._zod.onattach.push((r)=>{let i=r._zod.bag;i.format="ipv4"})}),Sd=ne("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=y0),Ot.init(e,t),e._zod.onattach.push((r)=>{let i=r._zod.bag;i.format="ipv6"}),e._zod.check=(r)=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),xd=ne("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=v0),Ot.init(e,t)}),kd=ne("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=b0),Ot.init(e,t),e._zod.check=(r)=>{let[i,n]=r.value.split("/");try{if(!n)throw Error();let o=Number(n);if(`${o}`!==n)throw Error();if(o<0||o>128)throw Error();new URL(`http://[${i}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function og(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Md=ne("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=_0),Ot.init(e,t),e._zod.onattach.push((r)=>{r._zod.bag.contentEncoding="base64"}),e._zod.check=(r)=>{if(og(r.value))return;r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function DS(e){if(!id.test(e))return!1;let t=e.replace(/[-_]/g,(i)=>i==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return og(r)}var Ed=ne("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=id),Ot.init(e,t),e._zod.onattach.push((r)=>{r._zod.bag.contentEncoding="base64url"}),e._zod.check=(r)=>{if(DS(r.value))return;r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Id=ne("$ZodE164",(e,t)=>{t.pattern??(t.pattern=S0),Ot.init(e,t)});function NS(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[i]=r;if(!i)return!1;let n=JSON.parse(atob(i));if("typ"in n&&n?.typ!=="JWT")return!1;if(!n.alg)return!1;if(t&&(!("alg"in n)||n.alg!==t))return!1;return!0}catch{return!1}}var $d=ne("$ZodJWT",(e,t)=>{Ot.init(e,t),e._zod.check=(r)=>{if(NS(r.value,t.alg))return;r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Td=ne("$ZodCustomStringFormat",(e,t)=>{Ot.init(e,t),e._zod.check=(r)=>{if(t.fn(r.value))return;r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),Fa=ne("$ZodNumber",(e,t)=>{ut.init(e,t),e._zod.pattern=e._zod.bag.pattern??T0,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=Number(r.value)}catch(s){}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)?"Infinity":void 0:void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...o?{received:o}:{}}),r}}),Pd=ne("$ZodNumber",(e,t)=>{N0.init(e,t),Fa.init(e,t)}),ps=ne("$ZodBoolean",(e,t)=>{ut.init(e,t),e._zod.pattern=P0,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=Boolean(r.value)}catch(o){}let n=r.value;if(typeof n==="boolean")return r;return r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),qa=ne("$ZodBigInt",(e,t)=>{ut.init(e,t),e._zod.pattern=I0,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch(n){}if(typeof r.value==="bigint")return r;return r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),Ad=ne("$ZodBigInt",(e,t)=>{z0.init(e,t),qa.init(e,t)}),Rd=ne("$ZodSymbol",(e,t)=>{ut.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(typeof n==="symbol")return r;return r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),r}}),Cd=ne("$ZodUndefined",(e,t)=>{ut.init(e,t),e._zod.pattern=R0,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(r,i)=>{let n=r.value;if(typeof n>"u")return r;return r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),Od=ne("$ZodNull",(e,t)=>{ut.init(e,t),e._zod.pattern=A0,e._zod.values=new Set([null]),e._zod.parse=(r,i)=>{let n=r.value;if(n===null)return r;return r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),Dd=ne("$ZodAny",(e,t)=>{ut.init(e,t),e._zod.parse=(r)=>r}),ko=ne("$ZodUnknown",(e,t)=>{ut.init(e,t),e._zod.parse=(r)=>r}),Nd=ne("$ZodNever",(e,t)=>{ut.init(e,t),e._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),zd=ne("$ZodVoid",(e,t)=>{ut.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(typeof n>"u")return r;return r.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),r}}),jd=ne("$ZodDate",(e,t)=>{ut.init(e,t),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=new Date(r.value)}catch(h){}let n=r.value,o=n instanceof Date;if(o&&!Number.isNaN(n.getTime()))return r;return r.issues.push({expected:"date",code:"invalid_type",input:n,...o?{received:"Invalid Date"}:{},inst:e}),r}});function kS(e,t,r){if(e.issues.length)t.issues.push(...en(r,e.issues));t.value[r]=e.value}var ms=ne("$ZodArray",(e,t)=>{ut.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);let o=[];for(let s=0;s<n.length;s++){let h=n[s],v=t.element._zod.run({value:h,issues:[]},i);if(v instanceof Promise)o.push(v.then((b)=>kS(b,r,s)));else kS(v,r,s)}if(o.length)return Promise.all(o).then(()=>r);return r}});function ud(e,t,r){if(e.issues.length)t.issues.push(...en(r,e.issues));t.value[r]=e.value}function MS(e,t,r,i){if(e.issues.length)if(i[r]===void 0)if(r in i)t.value[r]=void 0;else t.value[r]=e.value;else t.issues.push(...en(r,e.issues));else if(e.value===void 0){if(r in i)t.value[r]=void 0}else t.value[r]=e.value}var Ba=ne("$ZodObject",(e,t)=>{ut.init(e,t);let r=Da(()=>{let g=Object.keys(t.shape);for(let x of g)if(!(t.shape[x]instanceof ut))throw Error(`Invalid element at key "${x}": expected a Zod schema`);let S=r0(t.shape);return{shape:t.shape,keys:g,keySet:new Set(g),numKeys:g.length,optionalKeys:new Set(S)}});$t(e._zod,"propValues",()=>{let g=t.shape,S={};for(let x in g){let M=g[x]._zod;if(M.values){S[x]??(S[x]=new Set);for(let I of M.values)S[x].add(I)}}return S});let i=(g)=>{let S=new ad(["shape","payload","ctx"]),x=r.value,M=(P)=>{let R=bo(P);return`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`};S.write("const input = payload.value;");let I=Object.create(null),$=0;for(let P of x.keys)I[P]=`key_${$++}`;S.write("const newResult = {}");for(let P of x.keys)if(x.optionalKeys.has(P)){let R=I[P];S.write(`const ${R} = ${M(P)};`);let C=bo(P);S.write(`
|
|
30
30
|
if (${R}.issues.length) {
|
|
@@ -49,9 +49,9 @@ https://github.com/browserify/crypto-browserify`)},e.constants={DH_CHECK_P_NOT_S
|
|
|
49
49
|
if (${R}.issues.length) payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
|
|
50
50
|
...iss,
|
|
51
51
|
path: iss.path ? [${bo(P)}, ...iss.path] : [${bo(P)}]
|
|
52
|
-
})));`),S.write(`newResult[${bo(P)}] = ${R}.value`)}S.write("payload.value = newResult;"),S.write("return payload;");let T=S.compile();return(P,R)=>T(g,P,R)},n,o=us,s=!Ra.jitless,v=s&&e0.value,b=t.catchall,_;e._zod.parse=(g,S)=>{_??(_=r.value);let x=g.value;if(!o(x))return g.issues.push({expected:"object",code:"invalid_type",input:x,inst:e}),g;let M=[];if(s&&v&&S?.async===!1&&S.jitless!==!0){if(!n)n=i(t.shape);g=n(g,S)}else{g.value={};let R=_.shape;for(let C of _.keys){let N=R[C],B=N._zod.run({value:x[C],issues:[]},S),ie=N._zod.optin==="optional"&&N._zod.optout==="optional";if(B instanceof Promise)M.push(B.then((le)=>ie?MS(le,g,C,x):ud(le,g,C)));else if(ie)MS(B,g,C,x);else ud(B,g,C)}}if(!b)return M.length?Promise.all(M).then(()=>g):g;let I=[],$=_.keySet,T=b._zod,P=T.def.type;for(let R of Object.keys(x)){if($.has(R))continue;if(P==="never"){I.push(R);continue}let C=T.run({value:x[R],issues:[]},S);if(C instanceof Promise)M.push(C.then((N)=>ud(N,g,R)));else ud(C,g,R)}if(I.length)g.issues.push({code:"unrecognized_keys",keys:I,input:x,inst:e});if(!M.length)return g;return Promise.all(M).then(()=>g)}});function ES(e,t,r,i){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map((n)=>n.issues.map((o)=>fn(o,i,rr())))}),t}var Ha=ne("$ZodUnion",(e,t)=>{ut.init(e,t),$t(e._zod,"optin",()=>t.options.some((r)=>r._zod.optin==="optional")?"optional":void 0),$t(e._zod,"optout",()=>t.options.some((r)=>r._zod.optout==="optional")?"optional":void 0),$t(e._zod,"values",()=>{if(t.options.every((r)=>r._zod.values))return new Set(t.options.flatMap((r)=>Array.from(r._zod.values)));return}),$t(e._zod,"pattern",()=>{if(t.options.every((r)=>r._zod.pattern)){let r=t.options.map((i)=>i._zod.pattern);return new RegExp(`^(${r.map((i)=>Na(i.source)).join("|")})$`)}return}),e._zod.parse=(r,i)=>{let n=!1,o=[];for(let s of t.options){let h=s._zod.run({value:r.value,issues:[]},i);if(h instanceof Promise)o.push(h),n=!0;else{if(h.issues.length===0)return h;o.push(h)}}if(!n)return ES(o,r,e,i);return Promise.all(o).then((s)=>ES(s,r,e,i))}}),Ud=ne("$ZodDiscriminatedUnion",(e,t)=>{Ha.init(e,t);let r=e._zod.parse;$t(e._zod,"propValues",()=>{let n={};for(let o of t.options){let s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(let[h,v]of Object.entries(s)){if(!n[h])n[h]=new Set;for(let b of v)n[h].add(b)}}return n});let i=Da(()=>{let n=t.options,o=new Map;for(let s of n){let h=s._zod.propValues[t.discriminator];if(!h||h.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let v of h){if(o.has(v))throw Error(`Duplicate discriminator value "${String(v)}"`);o.set(v,s)}}return o});e._zod.parse=(n,o)=>{let s=n.value;if(!us(s))return n.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),n;let h=i.value.get(s?.[t.discriminator]);if(h)return h._zod.run(n,o);if(t.unionFallback)return r(n,o);return n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:s,path:[t.discriminator],inst:e}),n}}),Ld=ne("$ZodIntersection",(e,t)=>{ut.init(e,t),e._zod.parse=(r,i)=>{let n=r.value,o=t.left._zod.run({value:n,issues:[]},i),s=t.right._zod.run({value:n,issues:[]},i);if(o instanceof Promise||s instanceof Promise)return Promise.all([o,s]).then(([v,b])=>IS(r,v,b));return IS(r,o,s)}});function eg(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(ls(e)&&ls(t)){let r=Object.keys(t),i=Object.keys(e).filter((o)=>r.indexOf(o)!==-1),n={...e,...t};for(let o of i){let s=eg(e[o],t[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};n[o]=s.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let i=0;i<e.length;i++){let n=e[i],o=t[i],s=eg(n,o);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function IS(e,t,r){if(t.issues.length)e.issues.push(...t.issues);if(r.issues.length)e.issues.push(...r.issues);if(_o(e))return e;let i=eg(t.value,r.value);if(!i.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}var Bi=ne("$ZodTuple",(e,t)=>{ut.init(e,t);let r=t.items,i=r.length-[...r].reverse().findIndex((n)=>n._zod.optin!=="optional");e._zod.parse=(n,o)=>{let s=n.value;if(!Array.isArray(s))return n.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),n;n.value=[];let h=[];if(!t.rest){let b=s.length>r.length,_=s.length<i-1;if(b||_)return n.issues.push({input:s,inst:e,origin:"array",...b?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length}}),n}let v=-1;for(let b of r){if(v++,v>=s.length){if(v>=i)continue}let _=b._zod.run({value:s[v],issues:[]},o);if(_ instanceof Promise)h.push(_.then((g)=>ld(g,n,v)));else ld(_,n,v)}if(t.rest){let b=s.slice(r.length);for(let _ of b){v++;let g=t.rest._zod.run({value:_,issues:[]},o);if(g instanceof Promise)h.push(g.then((S)=>ld(S,n,v)));else ld(g,n,v)}}if(h.length)return Promise.all(h).then(()=>n);return n}});function ld(e,t,r){if(e.issues.length)t.issues.push(...en(r,e.issues));t.value[r]=e.value}var Fd=ne("$ZodRecord",(e,t)=>{ut.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(!ls(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let o=[];if(t.keyType._zod.values){let s=t.keyType._zod.values;r.value={};for(let v of s)if(typeof v==="string"||typeof v==="number"||typeof v==="symbol"){let b=t.valueType._zod.run({value:n[v],issues:[]},i);if(b instanceof Promise)o.push(b.then((_)=>{if(_.issues.length)r.issues.push(...en(v,_.issues));r.value[v]=_.value}));else{if(b.issues.length)r.issues.push(...en(v,b.issues));r.value[v]=b.value}}let h;for(let v in n)if(!s.has(v))h=h??[],h.push(v);if(h&&h.length>0)r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:h})}else{r.value={};for(let s of Reflect.ownKeys(n)){if(s==="__proto__")continue;let h=t.keyType._zod.run({value:s,issues:[]},i);if(h instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(h.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:h.issues.map((b)=>fn(b,i,rr())),input:s,path:[s],inst:e}),r.value[h.value]=h.value;continue}let v=t.valueType._zod.run({value:n[s],issues:[]},i);if(v instanceof Promise)o.push(v.then((b)=>{if(b.issues.length)r.issues.push(...en(s,b.issues));r.value[h.value]=b.value}));else{if(v.issues.length)r.issues.push(...en(s,v.issues));r.value[h.value]=v.value}}}if(o.length)return Promise.all(o).then(()=>r);return r}}),qd=ne("$ZodMap",(e,t)=>{ut.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),r;let o=[];r.value=new Map;for(let[s,h]of n){let v=t.keyType._zod.run({value:s,issues:[]},i),b=t.valueType._zod.run({value:h,issues:[]},i);if(v instanceof Promise||b instanceof Promise)o.push(Promise.all([v,b]).then(([_,g])=>{$S(_,g,r,s,n,e,i)}));else $S(v,b,r,s,n,e,i)}if(o.length)return Promise.all(o).then(()=>r);return r}});function $S(e,t,r,i,n,o,s){if(e.issues.length)if(za.has(typeof i))r.issues.push(...en(i,e.issues));else r.issues.push({origin:"map",code:"invalid_key",input:n,inst:o,issues:e.issues.map((h)=>fn(h,s,rr()))});if(t.issues.length)if(za.has(typeof i))r.issues.push(...en(i,t.issues));else r.issues.push({origin:"map",code:"invalid_element",input:n,inst:o,key:i,issues:t.issues.map((h)=>fn(h,s,rr()))});r.value.set(e.value,t.value)}var Bd=ne("$ZodSet",(e,t)=>{ut.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),r;let o=[];r.value=new Set;for(let s of n){let h=t.valueType._zod.run({value:s,issues:[]},i);if(h instanceof Promise)o.push(h.then((v)=>TS(v,r)));else TS(h,r)}if(o.length)return Promise.all(o).then(()=>r);return r}});function TS(e,t){if(e.issues.length)t.issues.push(...e.issues);t.value.add(e.value)}var Hd=ne("$ZodEnum",(e,t)=>{ut.init(e,t);let r=Oa(t.entries);e._zod.values=new Set(r),e._zod.pattern=new RegExp(`^(${r.filter((i)=>za.has(typeof i)).map((i)=>typeof i==="string"?li(i):i.toString()).join("|")})$`),e._zod.parse=(i,n)=>{let o=i.value;if(e._zod.values.has(o))return i;return i.issues.push({code:"invalid_value",values:r,input:o,inst:e}),i}}),Zd=ne("$ZodLiteral",(e,t)=>{ut.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map((r)=>typeof r==="string"?li(r):r?r.toString():String(r)).join("|")})$`),e._zod.parse=(r,i)=>{let n=r.value;if(e._zod.values.has(n))return r;return r.issues.push({code:"invalid_value",values:t.values,input:n,inst:e}),r}}),Kd=ne("$ZodFile",(e,t)=>{ut.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(n instanceof File)return r;return r.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),r}}),gs=ne("$ZodTransform",(e,t)=>{ut.init(e,t),e._zod.parse=(r,i)=>{let n=t.transform(r.value,r);if(i.async)return(n instanceof Promise?n:Promise.resolve(n)).then((s)=>(r.value=s,r));if(n instanceof Promise)throw new ui;return r.value=n,r}}),Vd=ne("$ZodOptional",(e,t)=>{ut.init(e,t),e._zod.optin="optional",e._zod.optout="optional",$t(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),$t(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Na(r.source)})?$`):void 0}),e._zod.parse=(r,i)=>{if(t.innerType._zod.optin==="optional")return t.innerType._zod.run(r,i);if(r.value===void 0)return r;return t.innerType._zod.run(r,i)}}),Wd=ne("$ZodNullable",(e,t)=>{ut.init(e,t),$t(e._zod,"optin",()=>t.innerType._zod.optin),$t(e._zod,"optout",()=>t.innerType._zod.optout),$t(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Na(r.source)}|null)$`):void 0}),$t(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,i)=>{if(r.value===null)return r;return t.innerType._zod.run(r,i)}}),Gd=ne("$ZodDefault",(e,t)=>{ut.init(e,t),e._zod.optin="optional",$t(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,i);if(n instanceof Promise)return n.then((o)=>PS(o,t));return PS(n,t)}});function PS(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var Jd=ne("$ZodPrefault",(e,t)=>{ut.init(e,t),e._zod.optin="optional",$t(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(r.value===void 0)r.value=t.defaultValue;return t.innerType._zod.run(r,i)}}),Xd=ne("$ZodNonOptional",(e,t)=>{ut.init(e,t),$t(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter((i)=>i!==void 0)):void 0}),e._zod.parse=(r,i)=>{let n=t.innerType._zod.run(r,i);if(n instanceof Promise)return n.then((o)=>AS(o,e));return AS(n,e)}});function AS(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}var Yd=ne("$ZodSuccess",(e,t)=>{ut.init(e,t),e._zod.parse=(r,i)=>{let n=t.innerType._zod.run(r,i);if(n instanceof Promise)return n.then((o)=>(r.value=o.issues.length===0,r));return r.value=n.issues.length===0,r}}),Qd=ne("$ZodCatch",(e,t)=>{ut.init(e,t),e._zod.optin="optional",$t(e._zod,"optout",()=>t.innerType._zod.optout),$t(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{let n=t.innerType._zod.run(r,i);if(n instanceof Promise)return n.then((o)=>{if(r.value=o.value,o.issues.length)r.value=t.catchValue({...r,error:{issues:o.issues.map((s)=>fn(s,i,rr()))},input:r.value}),r.issues=[];return r});if(r.value=n.value,n.issues.length)r.value=t.catchValue({...r,error:{issues:n.issues.map((o)=>fn(o,i,rr()))},input:r.value}),r.issues=[];return r}}),ef=ne("$ZodNaN",(e,t)=>{ut.init(e,t),e._zod.parse=(r,i)=>{if(typeof r.value!=="number"||!Number.isNaN(r.value))return r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r;return r}}),ys=ne("$ZodPipe",(e,t)=>{ut.init(e,t),$t(e._zod,"values",()=>t.in._zod.values),$t(e._zod,"optin",()=>t.in._zod.optin),$t(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(r,i)=>{let n=t.in._zod.run(r,i);if(n instanceof Promise)return n.then((o)=>RS(o,t,i));return RS(n,t,i)}});function RS(e,t,r){if(_o(e))return e;return t.out._zod.run({value:e.value,issues:e.issues},r)}var tf=ne("$ZodReadonly",(e,t)=>{ut.init(e,t),$t(e._zod,"propValues",()=>t.innerType._zod.propValues),$t(e._zod,"values",()=>t.innerType._zod.values),$t(e._zod,"optin",()=>t.innerType._zod.optin),$t(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(r,i)=>{let n=t.innerType._zod.run(r,i);if(n instanceof Promise)return n.then(CS);return CS(n)}});function CS(e){return e.value=Object.freeze(e.value),e}var rf=ne("$ZodTemplateLiteral",(e,t)=>{ut.init(e,t);let r=[];for(let i of t.parts)if(i instanceof ut){if(!i._zod.pattern)throw 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 Error(`Invalid template literal part: ${i._zod.traits}`);let o=n.startsWith("^")?1:0,s=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(o,s))}else if(i===null||t0.has(typeof i))r.push(li(`${i}`));else throw Error(`Invalid template literal part: ${i}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(i,n)=>{if(typeof i.value!=="string")return i.issues.push({input:i.value,inst:e,expected:"template_literal",code:"invalid_type"}),i;if(e._zod.pattern.lastIndex=0,!e._zod.pattern.test(i.value))return i.issues.push({input:i.value,inst:e,code:"invalid_format",format:"template_literal",pattern:e._zod.pattern.source}),i;return i}}),nf=ne("$ZodPromise",(e,t)=>{ut.init(e,t),e._zod.parse=(r,i)=>Promise.resolve(r.value).then((n)=>t.innerType._zod.run({value:n,issues:[]},i))}),of=ne("$ZodLazy",(e,t)=>{ut.init(e,t),$t(e._zod,"innerType",()=>t.getter()),$t(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),$t(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),$t(e._zod,"optin",()=>e._zod.innerType._zod.optin),$t(e._zod,"optout",()=>e._zod.innerType._zod.optout),e._zod.parse=(r,i)=>e._zod.innerType._zod.run(r,i)}),sf=ne("$ZodCustom",(e,t)=>{Ht.init(e,t),ut.init(e,t),e._zod.parse=(r,i)=>r,e._zod.check=(r)=>{let i=r.value,n=t.fn(i);if(n instanceof Promise)return n.then((o)=>OS(o,r,i,e));OS(n,r,i,e);return}});function OS(e,t,r,i){if(!e){let n={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};if(i._zod.def.params)n.params=i._zod.def.params;t.issues.push(o0(n))}}var vs={};wn(vs,{zhTW:()=>Bg,zhCN:()=>qg,vi:()=>Fg,ur:()=>Lg,ua:()=>Ug,tr:()=>jg,th:()=>zg,ta:()=>Ng,sv:()=>Dg,sl:()=>Og,ru:()=>Cg,pt:()=>Rg,ps:()=>Pg,pl:()=>Ag,ota:()=>Tg,no:()=>$g,nl:()=>Ig,ms:()=>Eg,mk:()=>Mg,ko:()=>kg,kh:()=>xg,ja:()=>Sg,it:()=>wg,id:()=>_g,hu:()=>bg,he:()=>vg,frCA:()=>yg,fr:()=>gg,fi:()=>mg,fa:()=>pg,es:()=>hg,eo:()=>fg,en:()=>Za,de:()=>dg,cs:()=>cg,ca:()=>lg,be:()=>ug,az:()=>ag,ar:()=>sg});var p9=()=>{let e={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"};return(n)=>{switch(n.code){case"invalid_type":return`مدخلات غير مقبولة: يفترض إدخال ${n.expected}، ولكن تم إدخال ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${Ve(n.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return` أكبر من اللازم: يفترض أن تكون ${n.origin??"القيمة"} ${o} ${n.maximum.toString()} ${s.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${n.origin??"القيمة"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`أصغر من اللازم: يفترض لـ ${n.origin} أن يكون ${o} ${n.minimum.toString()} ${s.unit}`;return`أصغر من اللازم: يفترض لـ ${n.origin} أن يكون ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${n.prefix}"`;if(o.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${o.suffix}"`;if(o.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${o.includes}"`;if(o.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${o.pattern}`;return`${i[o.format]??n.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${n.divisor}`;case"unrecognized_keys":return`معرف${n.keys.length>1?"ات":""} غريب${n.keys.length>1?"ة":""}: ${be(n.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${n.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${n.origin}`;default:return"مدخل غير مقبول"}}};function sg(){return{localeError:p9()}}var m9=()=>{let e={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(n)=>{switch(n.code){case"invalid_type":return`Yanlış dəyər: gözlənilən ${n.expected}, daxil olan ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Yanlış dəyər: gözlənilən ${Ve(n.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Çox böyük: gözlənilən ${n.origin??"dəyər"} ${o}${n.maximum.toString()} ${s.unit??"element"}`;return`Çox böyük: gözlənilən ${n.origin??"dəyər"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Çox kiçik: gözlənilən ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`;return`Çox kiçik: gözlənilən ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Yanlış mətn: "${o.prefix}" ilə başlamalıdır`;if(o.format==="ends_with")return`Yanlış mətn: "${o.suffix}" ilə bitməlidir`;if(o.format==="includes")return`Yanlış mətn: "${o.includes}" daxil olmalıdır`;if(o.format==="regex")return`Yanlış mətn: ${o.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${i[o.format]??n.format}`}case"not_multiple_of":return`Yanlış ədəd: ${n.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${n.keys.length>1?"lar":""}: ${be(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${n.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function ag(){return{localeError:m9()}}function jS(e,t,r,i){let n=Math.abs(e),o=n%10,s=n%100;if(s>=11&&s<=19)return i;if(o===1)return t;if(o>=2&&o<=4)return r;return i}var g9=()=>{let e={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"лік";case"object":{if(Array.isArray(n))return"масіў";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"};return(n)=>{switch(n.code){case"invalid_type":return`Няправільны ўвод: чакаўся ${n.expected}, атрымана ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Няправільны ўвод: чакалася ${Ve(n.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s){let h=Number(n.maximum),v=jS(h,s.unit.one,s.unit.few,s.unit.many);return`Занадта вялікі: чакалася, што ${n.origin??"значэнне"} павінна ${s.verb} ${o}${n.maximum.toString()} ${v}`}return`Занадта вялікі: чакалася, што ${n.origin??"значэнне"} павінна быць ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s){let h=Number(n.minimum),v=jS(h,s.unit.one,s.unit.few,s.unit.many);return`Занадта малы: чакалася, што ${n.origin} павінна ${s.verb} ${o}${n.minimum.toString()} ${v}`}return`Занадта малы: чакалася, што ${n.origin} павінна быць ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${o.prefix}"`;if(o.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${o.suffix}"`;if(o.format==="includes")return`Няправільны радок: павінен змяшчаць "${o.includes}"`;if(o.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${o.pattern}`;return`Няправільны ${i[o.format]??n.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${n.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${n.keys.length>1?"ключы":"ключ"}: ${be(n.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${n.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${n.origin}`;default:return"Няправільны ўвод"}}};function ug(){return{localeError:g9()}}var y9=()=>{let e={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"entrada",email:"adreça electrònica",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ça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(n)=>{switch(n.code){case"invalid_type":return`Tipus invàlid: s'esperava ${n.expected}, s'ha rebut ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Valor invàlid: s'esperava ${Ve(n.values[0])}`;return`Opció invàlida: s'esperava una de ${be(n.values," o ")}`;case"too_big":{let o=n.inclusive?"com a màxim":"menys de",s=t(n.origin);if(s)return`Massa gran: s'esperava que ${n.origin??"el valor"} contingués ${o} ${n.maximum.toString()} ${s.unit??"elements"}`;return`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"com a mínim":"més de",s=t(n.origin);if(s)return`Massa petit: s'esperava que ${n.origin} contingués ${o} ${n.minimum.toString()} ${s.unit}`;return`Massa petit: s'esperava que ${n.origin} fos ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Format invàlid: ha de començar amb "${o.prefix}"`;if(o.format==="ends_with")return`Format invàlid: ha d'acabar amb "${o.suffix}"`;if(o.format==="includes")return`Format invàlid: ha d'incloure "${o.includes}"`;if(o.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${o.pattern}`;return`Format invàlid per a ${i[o.format]??n.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${be(n.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${n.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${n.origin}`;default:return"Entrada invàlida"}}};function lg(){return{localeError:y9()}}var v9=()=>{let e={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"číslo";case"string":return"řetězec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(n))return"pole";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"regulární výraz",email:"e-mailová 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 čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"};return(n)=>{switch(n.code){case"invalid_type":return`Neplatný vstup: očekáváno ${n.expected}, obdrženo ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Neplatný vstup: očekáváno ${Ve(n.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Hodnota je příliš velká: ${n.origin??"hodnota"} musí mít ${o}${n.maximum.toString()} ${s.unit??"prvků"}`;return`Hodnota je příliš velká: ${n.origin??"hodnota"} musí být ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Hodnota je příliš malá: ${n.origin??"hodnota"} musí mít ${o}${n.minimum.toString()} ${s.unit??"prvků"}`;return`Hodnota je příliš malá: ${n.origin??"hodnota"} musí být ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Neplatný řetězec: musí začínat na "${o.prefix}"`;if(o.format==="ends_with")return`Neplatný řetězec: musí končit na "${o.suffix}"`;if(o.format==="includes")return`Neplatný řetězec: musí obsahovat "${o.includes}"`;if(o.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${o.pattern}`;return`Neplatný formát ${i[o.format]??n.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${n.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${be(n.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${n.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${n.origin}`;default:return"Neplatný vstup"}}};function cg(){return{localeError:v9()}}var b9=()=>{let e={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 t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"Zahl";case"object":{if(Array.isArray(n))return"Array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return(n)=>{switch(n.code){case"invalid_type":return`Ungültige Eingabe: erwartet ${n.expected}, erhalten ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Ungültige Eingabe: erwartet ${Ve(n.values[0])}`;return`Ungültige Option: erwartet eine von ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Zu groß: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ${s.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ist`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ${s.unit} hat`;return`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ist`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Ungültiger String: muss mit "${o.prefix}" beginnen`;if(o.format==="ends_with")return`Ungültiger String: muss mit "${o.suffix}" enden`;if(o.format==="includes")return`Ungültiger String: muss "${o.includes}" enthalten`;if(o.format==="regex")return`Ungültiger String: muss dem Muster ${o.pattern} entsprechen`;return`Ungültig: ${i[o.format]??n.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${be(n.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${n.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${n.origin}`;default:return"Ungültige Eingabe"}}};function dg(){return{localeError:b9()}}var _9=(e)=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},w9=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function t(i){return e[i]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(i)=>{switch(i.code){case"invalid_type":return`Invalid input: expected ${i.expected}, received ${_9(i.input)}`;case"invalid_value":if(i.values.length===1)return`Invalid input: expected ${Ve(i.values[0])}`;return`Invalid option: expected one of ${be(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`Too big: expected ${i.origin??"value"} to have ${n}${i.maximum.toString()} ${o.unit??"elements"}`;return`Too big: expected ${i.origin??"value"} to be ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`Too small: expected ${i.origin} to have ${n}${i.minimum.toString()} ${o.unit}`;return`Too small: expected ${i.origin} to be ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Invalid string: must start with "${n.prefix}"`;if(n.format==="ends_with")return`Invalid string: must end with "${n.suffix}"`;if(n.format==="includes")return`Invalid string: must include "${n.includes}"`;if(n.format==="regex")return`Invalid string: must match pattern ${n.pattern}`;return`Invalid ${r[n.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${be(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function Za(){return{localeError:w9()}}var S9=(e)=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"nombro";case"object":{if(Array.isArray(e))return"tabelo";if(e===null)return"senvalora";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},x9=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(i){return e[i]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",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ŭro",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"};return(i)=>{switch(i.code){case"invalid_type":return`Nevalida enigo: atendiĝis ${i.expected}, riceviĝis ${S9(i.input)}`;case"invalid_value":if(i.values.length===1)return`Nevalida enigo: atendiĝis ${Ve(i.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${be(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`Tro granda: atendiĝis ke ${i.origin??"valoro"} havu ${n}${i.maximum.toString()} ${o.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${i.origin??"valoro"} havu ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`Tro malgranda: atendiĝis ke ${i.origin} havu ${n}${i.minimum.toString()} ${o.unit}`;return`Tro malgranda: atendiĝis ke ${i.origin} estu ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${n.prefix}"`;if(n.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${n.suffix}"`;if(n.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${n.includes}"`;if(n.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${n.pattern}`;return`Nevalida ${r[n.format]??i.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${i.divisor}`;case"unrecognized_keys":return`Nekonata${i.keys.length>1?"j":""} ŝlosilo${i.keys.length>1?"j":""}: ${be(i.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${i.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${i.origin}`;default:return"Nevalida enigo"}}};function fg(){return{localeError:x9()}}var k9=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"número";case"object":{if(Array.isArray(n))return"arreglo";if(n===null)return"nulo";if(Object.getPrototypeOf(n)!==Object.prototype)return n.constructor.name}}return o},i={regex:"entrada",email:"dirección de correo electrónico",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ón ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(n)=>{switch(n.code){case"invalid_type":return`Entrada inválida: se esperaba ${n.expected}, recibido ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Entrada inválida: se esperaba ${Ve(n.values[0])}`;return`Opción inválida: se esperaba una de ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Demasiado grande: se esperaba que ${n.origin??"valor"} tuviera ${o}${n.maximum.toString()} ${s.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${n.origin??"valor"} fuera ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Demasiado pequeño: se esperaba que ${n.origin} tuviera ${o}${n.minimum.toString()} ${s.unit}`;return`Demasiado pequeño: se esperaba que ${n.origin} fuera ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Cadena inválida: debe comenzar con "${o.prefix}"`;if(o.format==="ends_with")return`Cadena inválida: debe terminar en "${o.suffix}"`;if(o.format==="includes")return`Cadena inválida: debe incluir "${o.includes}"`;if(o.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${o.pattern}`;return`Inválido ${i[o.format]??n.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${be(n.keys,", ")}`;case"invalid_key":return`Llave inválida en ${n.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${n.origin}`;default:return"Entrada inválida"}}};function hg(){return{localeError:k9()}}var M9=()=>{let e={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"عدد";case"object":{if(Array.isArray(n))return"آرایه";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"};return(n)=>{switch(n.code){case"invalid_type":return`ورودی نامعتبر: میبایست ${n.expected} میبود، ${r(n.input)} دریافت شد`;case"invalid_value":if(n.values.length===1)return`ورودی نامعتبر: میبایست ${Ve(n.values[0])} میبود`;return`گزینه نامعتبر: میبایست یکی از ${be(n.values,"|")} میبود`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`خیلی بزرگ: ${n.origin??"مقدار"} باید ${o}${n.maximum.toString()} ${s.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${n.origin??"مقدار"} باید ${o}${n.maximum.toString()} باشد`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`خیلی کوچک: ${n.origin} باید ${o}${n.minimum.toString()} ${s.unit} باشد`;return`خیلی کوچک: ${n.origin} باید ${o}${n.minimum.toString()} باشد`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`رشته نامعتبر: باید با "${o.prefix}" شروع شود`;if(o.format==="ends_with")return`رشته نامعتبر: باید با "${o.suffix}" تمام شود`;if(o.format==="includes")return`رشته نامعتبر: باید شامل "${o.includes}" باشد`;if(o.format==="regex")return`رشته نامعتبر: باید با الگوی ${o.pattern} مطابقت داشته باشد`;return`${i[o.format]??n.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${n.divisor} باشد`;case"unrecognized_keys":return`کلید${n.keys.length>1?"های":""} ناشناس: ${be(n.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${n.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${n.origin}`;default:return"ورودی نامعتبر"}}};function pg(){return{localeError:M9()}}var E9=()=>{let e={string:{unit:"merkkiä",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äivämäärän"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"säännöllinen lauseke",email:"sähköpostiosoite",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äivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return(n)=>{switch(n.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${n.expected}, oli ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Virheellinen syöte: täytyy olla ${Ve(n.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Liian suuri: ${s.subject} täytyy olla ${o}${n.maximum.toString()} ${s.unit}`.trim();return`Liian suuri: arvon täytyy olla ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Liian pieni: ${s.subject} täytyy olla ${o}${n.minimum.toString()} ${s.unit}`.trim();return`Liian pieni: arvon täytyy olla ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${o.prefix}"`;if(o.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${o.suffix}"`;if(o.format==="includes")return`Virheellinen syöte: täytyy sisältää "${o.includes}"`;if(o.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${o.pattern}`;return`Virheellinen ${i[o.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${be(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öte"}}};function mg(){return{localeError:E9()}}var I9=()=>{let e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"nombre";case"object":{if(Array.isArray(n))return"tableau";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"entrée",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ée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(n)=>{switch(n.code){case"invalid_type":return`Entrée invalide : ${n.expected} attendu, ${r(n.input)} reçu`;case"invalid_value":if(n.values.length===1)return`Entrée invalide : ${Ve(n.values[0])} attendu`;return`Option invalide : une valeur parmi ${be(n.values,"|")} attendue`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Trop grand : ${n.origin??"valeur"} doit ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"élément(s)"}`;return`Trop grand : ${n.origin??"valeur"} doit être ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Trop petit : ${n.origin} doit ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`;return`Trop petit : ${n.origin} doit être ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Chaîne invalide : doit commencer par "${o.prefix}"`;if(o.format==="ends_with")return`Chaîne invalide : doit se terminer par "${o.suffix}"`;if(o.format==="includes")return`Chaîne invalide : doit inclure "${o.includes}"`;if(o.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${o.pattern}`;return`${i[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${n.divisor}`;case"unrecognized_keys":return`Clé${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${be(n.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${n.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entrée invalide"}}};function gg(){return{localeError:I9()}}var $9=()=>{let e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"entrée",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ée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(n)=>{switch(n.code){case"invalid_type":return`Entrée invalide : attendu ${n.expected}, reçu ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Entrée invalide : attendu ${Ve(n.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"≤":"<",s=t(n.origin);if(s)return`Trop grand : attendu que ${n.origin??"la valeur"} ait ${o}${n.maximum.toString()} ${s.unit}`;return`Trop grand : attendu que ${n.origin??"la valeur"} soit ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"≥":">",s=t(n.origin);if(s)return`Trop petit : attendu que ${n.origin} ait ${o}${n.minimum.toString()} ${s.unit}`;return`Trop petit : attendu que ${n.origin} soit ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Chaîne invalide : doit commencer par "${o.prefix}"`;if(o.format==="ends_with")return`Chaîne invalide : doit se terminer par "${o.suffix}"`;if(o.format==="includes")return`Chaîne invalide : doit inclure "${o.includes}"`;if(o.format==="regex")return`Chaîne invalide : doit correspondre au motif ${o.pattern}`;return`${i[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${n.divisor}`;case"unrecognized_keys":return`Clé${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${be(n.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${n.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entrée invalide"}}};function yg(){return{localeError:$9()}}var T9=()=>{let e={string:{unit:"אותיות",verb:"לכלול"},file:{unit:"בייטים",verb:"לכלול"},array:{unit:"פריטים",verb:"לכלול"},set:{unit:"פריטים",verb:"לכלול"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"קלט",email:"כתובת אימייל",url:"כתובת רשת",emoji:"אימוג'י",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"תאריך וזמן ISO",date:"תאריך ISO",time:"זמן ISO",duration:"משך זמן ISO",ipv4:"כתובת IPv4",ipv6:"כתובת IPv6",cidrv4:"טווח IPv4",cidrv6:"טווח IPv6",base64:"מחרוזת בבסיס 64",base64url:"מחרוזת בבסיס 64 לכתובות רשת",json_string:"מחרוזת JSON",e164:"מספר E.164",jwt:"JWT",template_literal:"קלט"};return(n)=>{switch(n.code){case"invalid_type":return`קלט לא תקין: צריך ${n.expected}, התקבל ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`קלט לא תקין: צריך ${Ve(n.values[0])}`;return`קלט לא תקין: צריך אחת מהאפשרויות ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`גדול מדי: ${n.origin??"value"} צריך להיות ${o}${n.maximum.toString()} ${s.unit??"elements"}`;return`גדול מדי: ${n.origin??"value"} צריך להיות ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`קטן מדי: ${n.origin} צריך להיות ${o}${n.minimum.toString()} ${s.unit}`;return`קטן מדי: ${n.origin} צריך להיות ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`מחרוזת לא תקינה: חייבת להתחיל ב"${o.prefix}"`;if(o.format==="ends_with")return`מחרוזת לא תקינה: חייבת להסתיים ב "${o.suffix}"`;if(o.format==="includes")return`מחרוזת לא תקינה: חייבת לכלול "${o.includes}"`;if(o.format==="regex")return`מחרוזת לא תקינה: חייבת להתאים לתבנית ${o.pattern}`;return`${i[o.format]??n.format} לא תקין`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${n.divisor}`;case"unrecognized_keys":return`מפתח${n.keys.length>1?"ות":""} לא מזוה${n.keys.length>1?"ים":"ה"}: ${be(n.keys,", ")}`;case"invalid_key":return`מפתח לא תקין ב${n.origin}`;case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${n.origin}`;default:return"קלט לא תקין"}}};function vg(){return{localeError:T9()}}var P9=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"szám";case"object":{if(Array.isArray(n))return"tömb";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"bemenet",email:"email cím",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őbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"};return(n)=>{switch(n.code){case"invalid_type":return`Érvénytelen bemenet: a várt érték ${n.expected}, a kapott érték ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Érvénytelen bemenet: a várt érték ${Ve(n.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Túl nagy: ${n.origin??"érték"} mérete túl nagy ${o}${n.maximum.toString()} ${s.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${n.origin??"érték"} túl nagy: ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Túl kicsi: a bemeneti érték ${n.origin} mérete túl kicsi ${o}${n.minimum.toString()} ${s.unit}`;return`Túl kicsi: a bemeneti érték ${n.origin} túl kicsi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Érvénytelen string: "${o.prefix}" értékkel kell kezdődnie`;if(o.format==="ends_with")return`Érvénytelen string: "${o.suffix}" értékkel kell végződnie`;if(o.format==="includes")return`Érvénytelen string: "${o.includes}" értéket kell tartalmaznia`;if(o.format==="regex")return`Érvénytelen string: ${o.pattern} mintának kell megfelelnie`;return`Érvénytelen ${i[o.format]??n.format}`}case"not_multiple_of":return`Érvénytelen szám: ${n.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${be(n.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${n.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${n.origin}`;default:return"Érvénytelen bemenet"}}};function bg(){return{localeError:P9()}}var A9=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return(n)=>{switch(n.code){case"invalid_type":return`Input tidak valid: diharapkan ${n.expected}, diterima ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Input tidak valid: diharapkan ${Ve(n.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${o}${n.maximum.toString()} ${s.unit??"elemen"}`;return`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Terlalu kecil: diharapkan ${n.origin} memiliki ${o}${n.minimum.toString()} ${s.unit}`;return`Terlalu kecil: diharapkan ${n.origin} menjadi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`String tidak valid: harus dimulai dengan "${o.prefix}"`;if(o.format==="ends_with")return`String tidak valid: harus berakhir dengan "${o.suffix}"`;if(o.format==="includes")return`String tidak valid: harus menyertakan "${o.includes}"`;if(o.format==="regex")return`String tidak valid: harus sesuai pola ${o.pattern}`;return`${i[o.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${be(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 _g(){return{localeError:A9()}}var R9=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"numero";case"object":{if(Array.isArray(n))return"vettore";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return(n)=>{switch(n.code){case"invalid_type":return`Input non valido: atteso ${n.expected}, ricevuto ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Input non valido: atteso ${Ve(n.values[0])}`;return`Opzione non valida: atteso uno tra ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Troppo grande: ${n.origin??"valore"} deve avere ${o}${n.maximum.toString()} ${s.unit??"elementi"}`;return`Troppo grande: ${n.origin??"valore"} deve essere ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Troppo piccolo: ${n.origin} deve avere ${o}${n.minimum.toString()} ${s.unit}`;return`Troppo piccolo: ${n.origin} deve essere ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Stringa non valida: deve iniziare con "${o.prefix}"`;if(o.format==="ends_with")return`Stringa non valida: deve terminare con "${o.suffix}"`;if(o.format==="includes")return`Stringa non valida: deve includere "${o.includes}"`;if(o.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${o.pattern}`;return`Invalid ${i[o.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${be(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 wg(){return{localeError:R9()}}var C9=()=>{let e={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"数値";case"object":{if(Array.isArray(n))return"配列";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"};return(n)=>{switch(n.code){case"invalid_type":return`無効な入力: ${n.expected}が期待されましたが、${r(n.input)}が入力されました`;case"invalid_value":if(n.values.length===1)return`無効な入力: ${Ve(n.values[0])}が期待されました`;return`無効な選択: ${be(n.values,"、")}のいずれかである必要があります`;case"too_big":{let o=n.inclusive?"以下である":"より小さい",s=t(n.origin);if(s)return`大きすぎる値: ${n.origin??"値"}は${n.maximum.toString()}${s.unit??"要素"}${o}必要があります`;return`大きすぎる値: ${n.origin??"値"}は${n.maximum.toString()}${o}必要があります`}case"too_small":{let o=n.inclusive?"以上である":"より大きい",s=t(n.origin);if(s)return`小さすぎる値: ${n.origin}は${n.minimum.toString()}${s.unit}${o}必要があります`;return`小さすぎる値: ${n.origin}は${n.minimum.toString()}${o}必要があります`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`無効な文字列: "${o.prefix}"で始まる必要があります`;if(o.format==="ends_with")return`無効な文字列: "${o.suffix}"で終わる必要があります`;if(o.format==="includes")return`無効な文字列: "${o.includes}"を含む必要があります`;if(o.format==="regex")return`無効な文字列: パターン${o.pattern}に一致する必要があります`;return`無効な${i[o.format]??n.format}`}case"not_multiple_of":return`無効な数値: ${n.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${n.keys.length>1?"群":""}: ${be(n.keys,"、")}`;case"invalid_key":return`${n.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${n.origin}内の無効な値`;default:return"無効な入力"}}};function Sg(){return{localeError:C9()}}var O9=()=>{let e={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"មិនមែនជាលេខ (NaN)":"លេខ";case"object":{if(Array.isArray(n))return"អារេ (Array)";if(n===null)return"គ្មានតម្លៃ (null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"};return(n)=>{switch(n.code){case"invalid_type":return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${n.expected} ប៉ុន្តែទទួលបាន ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${Ve(n.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`ធំពេក៖ ត្រូវការ ${n.origin??"តម្លៃ"} ${o} ${n.maximum.toString()} ${s.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${n.origin??"តម្លៃ"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`តូចពេក៖ ត្រូវការ ${n.origin} ${o} ${n.minimum.toString()} ${s.unit}`;return`តូចពេក៖ ត្រូវការ ${n.origin} ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${o.prefix}"`;if(o.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${o.suffix}"`;if(o.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${o.includes}"`;if(o.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${o.pattern}`;return`មិនត្រឹមត្រូវ៖ ${i[o.format]??n.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${n.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${be(n.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${n.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${n.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function xg(){return{localeError:O9()}}var D9=()=>{let e={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"};return(n)=>{switch(n.code){case"invalid_type":return`잘못된 입력: 예상 타입은 ${n.expected}, 받은 타입은 ${r(n.input)}입니다`;case"invalid_value":if(n.values.length===1)return`잘못된 입력: 값은 ${Ve(n.values[0])} 이어야 합니다`;return`잘못된 옵션: ${be(n.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let o=n.inclusive?"이하":"미만",s=o==="미만"?"이어야 합니다":"여야 합니다",h=t(n.origin),v=h?.unit??"요소";if(h)return`${n.origin??"값"}이 너무 큽니다: ${n.maximum.toString()}${v} ${o}${s}`;return`${n.origin??"값"}이 너무 큽니다: ${n.maximum.toString()} ${o}${s}`}case"too_small":{let o=n.inclusive?"이상":"초과",s=o==="이상"?"이어야 합니다":"여야 합니다",h=t(n.origin),v=h?.unit??"요소";if(h)return`${n.origin??"값"}이 너무 작습니다: ${n.minimum.toString()}${v} ${o}${s}`;return`${n.origin??"값"}이 너무 작습니다: ${n.minimum.toString()} ${o}${s}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`잘못된 문자열: "${o.prefix}"(으)로 시작해야 합니다`;if(o.format==="ends_with")return`잘못된 문자열: "${o.suffix}"(으)로 끝나야 합니다`;if(o.format==="includes")return`잘못된 문자열: "${o.includes}"을(를) 포함해야 합니다`;if(o.format==="regex")return`잘못된 문자열: 정규식 ${o.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${i[o.format]??n.format}`}case"not_multiple_of":return`잘못된 숫자: ${n.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${be(n.keys,", ")}`;case"invalid_key":return`잘못된 키: ${n.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${n.origin}`;default:return"잘못된 입력"}}};function kg(){return{localeError:D9()}}var N9=()=>{let e={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"број";case"object":{if(Array.isArray(n))return"низа";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"};return(n)=>{switch(n.code){case"invalid_type":return`Грешен внес: се очекува ${n.expected}, примено ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Invalid input: expected ${Ve(n.values[0])}`;return`Грешана опција: се очекува една ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Премногу голем: се очекува ${n.origin??"вредноста"} да има ${o}${n.maximum.toString()} ${s.unit??"елементи"}`;return`Премногу голем: се очекува ${n.origin??"вредноста"} да биде ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Премногу мал: се очекува ${n.origin} да има ${o}${n.minimum.toString()} ${s.unit}`;return`Премногу мал: се очекува ${n.origin} да биде ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Неважечка низа: мора да започнува со "${o.prefix}"`;if(o.format==="ends_with")return`Неважечка низа: мора да завршува со "${o.suffix}"`;if(o.format==="includes")return`Неважечка низа: мора да вклучува "${o.includes}"`;if(o.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${o.pattern}`;return`Invalid ${i[o.format]??n.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${be(n.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${n.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${n.origin}`;default:return"Грешен внес"}}};function Mg(){return{localeError:N9()}}var z9=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"nombor";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return(n)=>{switch(n.code){case"invalid_type":return`Input tidak sah: dijangka ${n.expected}, diterima ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Input tidak sah: dijangka ${Ve(n.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Terlalu besar: dijangka ${n.origin??"nilai"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"elemen"}`;return`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Terlalu kecil: dijangka ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`;return`Terlalu kecil: dijangka ${n.origin} adalah ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`String tidak sah: mesti bermula dengan "${o.prefix}"`;if(o.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${o.suffix}"`;if(o.format==="includes")return`String tidak sah: mesti mengandungi "${o.includes}"`;if(o.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${o.pattern}`;return`${i[o.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${be(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 Eg(){return{localeError:z9()}}var j9=()=>{let e={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"getal";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return(n)=>{switch(n.code){case"invalid_type":return`Ongeldige invoer: verwacht ${n.expected}, ontving ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Ongeldige invoer: verwacht ${Ve(n.values[0])}`;return`Ongeldige optie: verwacht één van ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Te lang: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} ${s.unit??"elementen"} bevat`;return`Te lang: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} is`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Te kort: verwacht dat ${n.origin} ${o}${n.minimum.toString()} ${s.unit} bevat`;return`Te kort: verwacht dat ${n.origin} ${o}${n.minimum.toString()} is`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Ongeldige tekst: moet met "${o.prefix}" beginnen`;if(o.format==="ends_with")return`Ongeldige tekst: moet op "${o.suffix}" eindigen`;if(o.format==="includes")return`Ongeldige tekst: moet "${o.includes}" bevatten`;if(o.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`;return`Ongeldig: ${i[o.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${be(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 Ig(){return{localeError:j9()}}var U9=()=>{let e={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"tall";case"object":{if(Array.isArray(n))return"liste";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return(n)=>{switch(n.code){case"invalid_type":return`Ugyldig input: forventet ${n.expected}, fikk ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Ugyldig verdi: forventet ${Ve(n.values[0])}`;return`Ugyldig valg: forventet en av ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`For stor(t): forventet ${n.origin??"value"} til å ha ${o}${n.maximum.toString()} ${s.unit??"elementer"}`;return`For stor(t): forventet ${n.origin??"value"} til å ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`For lite(n): forventet ${n.origin} til å ha ${o}${n.minimum.toString()} ${s.unit}`;return`For lite(n): forventet ${n.origin} til å ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Ugyldig streng: må starte med "${o.prefix}"`;if(o.format==="ends_with")return`Ugyldig streng: må ende med "${o.suffix}"`;if(o.format==="includes")return`Ugyldig streng: må inneholde "${o.includes}"`;if(o.format==="regex")return`Ugyldig streng: må matche mønsteret ${o.pattern}`;return`Ugyldig ${i[o.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${be(n.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};function $g(){return{localeError:U9()}}var L9=()=>{let e={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"numara";case"object":{if(Array.isArray(n))return"saf";if(n===null)return"gayb";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"giren",email:"epostagâh",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âmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"};return(n)=>{switch(n.code){case"invalid_type":return`Fâsit giren: umulan ${n.expected}, alınan ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Fâsit giren: umulan ${Ve(n.values[0])}`;return`Fâsit tercih: mûteberler ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Fazla büyük: ${n.origin??"value"}, ${o}${n.maximum.toString()} ${s.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${n.origin??"value"}, ${o}${n.maximum.toString()} olmalıydı.`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Fazla küçük: ${n.origin}, ${o}${n.minimum.toString()} ${s.unit} sahip olmalıydı.`;return`Fazla küçük: ${n.origin}, ${o}${n.minimum.toString()} olmalıydı.`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Fâsit metin: "${o.prefix}" ile başlamalı.`;if(o.format==="ends_with")return`Fâsit metin: "${o.suffix}" ile bitmeli.`;if(o.format==="includes")return`Fâsit metin: "${o.includes}" ihtivâ etmeli.`;if(o.format==="regex")return`Fâsit metin: ${o.pattern} nakşına uymalı.`;return`Fâsit ${i[o.format]??n.format}`}case"not_multiple_of":return`Fâsit sayı: ${n.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${n.keys.length>1?"s":""}: ${be(n.keys,", ")}`;case"invalid_key":return`${n.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${n.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function Tg(){return{localeError:L9()}}var F9=()=>{let e={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"عدد";case"object":{if(Array.isArray(n))return"ارې";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"};return(n)=>{switch(n.code){case"invalid_type":return`ناسم ورودي: باید ${n.expected} وای, مګر ${r(n.input)} ترلاسه شو`;case"invalid_value":if(n.values.length===1)return`ناسم ورودي: باید ${Ve(n.values[0])} وای`;return`ناسم انتخاب: باید یو له ${be(n.values,"|")} څخه وای`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`ډیر لوی: ${n.origin??"ارزښت"} باید ${o}${n.maximum.toString()} ${s.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${n.origin??"ارزښت"} باید ${o}${n.maximum.toString()} وي`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`ډیر کوچنی: ${n.origin} باید ${o}${n.minimum.toString()} ${s.unit} ولري`;return`ډیر کوچنی: ${n.origin} باید ${o}${n.minimum.toString()} وي`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`ناسم متن: باید د "${o.prefix}" سره پیل شي`;if(o.format==="ends_with")return`ناسم متن: باید د "${o.suffix}" سره پای ته ورسيږي`;if(o.format==="includes")return`ناسم متن: باید "${o.includes}" ولري`;if(o.format==="regex")return`ناسم متن: باید د ${o.pattern} سره مطابقت ولري`;return`${i[o.format]??n.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${n.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${n.keys.length>1?"کلیډونه":"کلیډ"}: ${be(n.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${n.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${n.origin} کې`;default:return"ناسمه ورودي"}}};function Pg(){return{localeError:F9()}}var q9=()=>{let e={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"liczba";case"object":{if(Array.isArray(n))return"tablica";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"wyrażenie",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ąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"};return(n)=>{switch(n.code){case"invalid_type":return`Nieprawidłowe dane wejściowe: oczekiwano ${n.expected}, otrzymano ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${Ve(n.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Za duża wartość: oczekiwano, że ${n.origin??"wartość"} będzie mieć ${o}${n.maximum.toString()} ${s.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${n.origin??"wartość"} będzie wynosić ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Za mała wartość: oczekiwano, że ${n.origin??"wartość"} będzie mieć ${o}${n.minimum.toString()} ${s.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${n.origin??"wartość"} będzie wynosić ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${o.prefix}"`;if(o.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${o.suffix}"`;if(o.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${o.includes}"`;if(o.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${o.pattern}`;return`Nieprawidłow(y/a/e) ${i[o.format]??n.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${be(n.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${n.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${n.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function Ag(){return{localeError:q9()}}var B9=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"número";case"object":{if(Array.isArray(n))return"array";if(n===null)return"nulo";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"padrão",email:"endereço 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ção ISO",ipv4:"endereço IPv4",ipv6:"endereço 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úmero E.164",jwt:"JWT",template_literal:"entrada"};return(n)=>{switch(n.code){case"invalid_type":return`Tipo inválido: esperado ${n.expected}, recebido ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Entrada inválida: esperado ${Ve(n.values[0])}`;return`Opção inválida: esperada uma das ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Muito grande: esperado que ${n.origin??"valor"} tivesse ${o}${n.maximum.toString()} ${s.unit??"elementos"}`;return`Muito grande: esperado que ${n.origin??"valor"} fosse ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Muito pequeno: esperado que ${n.origin} tivesse ${o}${n.minimum.toString()} ${s.unit}`;return`Muito pequeno: esperado que ${n.origin} fosse ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Texto inválido: deve começar com "${o.prefix}"`;if(o.format==="ends_with")return`Texto inválido: deve terminar com "${o.suffix}"`;if(o.format==="includes")return`Texto inválido: deve incluir "${o.includes}"`;if(o.format==="regex")return`Texto inválido: deve corresponder ao padrão ${o.pattern}`;return`${i[o.format]??n.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${be(n.keys,", ")}`;case"invalid_key":return`Chave inválida em ${n.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${n.origin}`;default:return"Campo inválido"}}};function Rg(){return{localeError:B9()}}function US(e,t,r,i){let n=Math.abs(e),o=n%10,s=n%100;if(s>=11&&s<=19)return i;if(o===1)return t;if(o>=2&&o<=4)return r;return i}var H9=()=>{let e={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"число";case"object":{if(Array.isArray(n))return"массив";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"};return(n)=>{switch(n.code){case"invalid_type":return`Неверный ввод: ожидалось ${n.expected}, получено ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Неверный ввод: ожидалось ${Ve(n.values[0])}`;return`Неверный вариант: ожидалось одно из ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s){let h=Number(n.maximum),v=US(h,s.unit.one,s.unit.few,s.unit.many);return`Слишком большое значение: ожидалось, что ${n.origin??"значение"} будет иметь ${o}${n.maximum.toString()} ${v}`}return`Слишком большое значение: ожидалось, что ${n.origin??"значение"} будет ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s){let h=Number(n.minimum),v=US(h,s.unit.one,s.unit.few,s.unit.many);return`Слишком маленькое значение: ожидалось, что ${n.origin} будет иметь ${o}${n.minimum.toString()} ${v}`}return`Слишком маленькое значение: ожидалось, что ${n.origin} будет ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Неверная строка: должна начинаться с "${o.prefix}"`;if(o.format==="ends_with")return`Неверная строка: должна заканчиваться на "${o.suffix}"`;if(o.format==="includes")return`Неверная строка: должна содержать "${o.includes}"`;if(o.format==="regex")return`Неверная строка: должна соответствовать шаблону ${o.pattern}`;return`Неверный ${i[o.format]??n.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${n.divisor}`;case"unrecognized_keys":return`Нераспознанн${n.keys.length>1?"ые":"ый"} ключ${n.keys.length>1?"и":""}: ${be(n.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${n.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${n.origin}`;default:return"Неверные входные данные"}}};function Cg(){return{localeError:H9()}}var Z9=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"število";case"object":{if(Array.isArray(n))return"tabela";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"vnos",email:"e-poštni 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 čas",date:"ISO datum",time:"ISO čas",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 številka",jwt:"JWT",template_literal:"vnos"};return(n)=>{switch(n.code){case"invalid_type":return`Neveljaven vnos: pričakovano ${n.expected}, prejeto ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Neveljaven vnos: pričakovano ${Ve(n.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Preveliko: pričakovano, da bo ${n.origin??"vrednost"} imelo ${o}${n.maximum.toString()} ${s.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${n.origin??"vrednost"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Premajhno: pričakovano, da bo ${n.origin} imelo ${o}${n.minimum.toString()} ${s.unit}`;return`Premajhno: pričakovano, da bo ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Neveljaven niz: mora se začeti z "${o.prefix}"`;if(o.format==="ends_with")return`Neveljaven niz: mora se končati z "${o.suffix}"`;if(o.format==="includes")return`Neveljaven niz: mora vsebovati "${o.includes}"`;if(o.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`;return`Neveljaven ${i[o.format]??n.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i ključi":" ključ"}: ${be(n.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};function Og(){return{localeError:Z9()}}var K9=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"antal";case"object":{if(Array.isArray(n))return"lista";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"reguljärt 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äng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return(n)=>{switch(n.code){case"invalid_type":return`Ogiltig inmatning: förväntat ${n.expected}, fick ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Ogiltig inmatning: förväntat ${Ve(n.values[0])}`;return`Ogiltigt val: förväntade en av ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`För stor(t): förväntade ${n.origin??"värdet"} att ha ${o}${n.maximum.toString()} ${s.unit??"element"}`;return`För stor(t): förväntat ${n.origin??"värdet"} att ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`För lite(t): förväntade ${n.origin??"värdet"} att ha ${o}${n.minimum.toString()} ${s.unit}`;return`För lite(t): förväntade ${n.origin??"värdet"} att ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Ogiltig sträng: måste börja med "${o.prefix}"`;if(o.format==="ends_with")return`Ogiltig sträng: måste sluta med "${o.suffix}"`;if(o.format==="includes")return`Ogiltig sträng: måste innehålla "${o.includes}"`;if(o.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${o.pattern}"`;return`Ogiltig(t) ${i[o.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${be(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${n.origin??"värdet"}`;default:return"Ogiltig input"}}};function Dg(){return{localeError:K9()}}var V9=()=>{let e={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"எண் அல்லாதது":"எண்";case"object":{if(Array.isArray(n))return"அணி";if(n===null)return"வெறுமை";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"உள்ளீடு",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:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"};return(n)=>{switch(n.code){case"invalid_type":return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${n.expected}, பெறப்பட்டது ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${Ve(n.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${be(n.values,"|")} இல் ஒன்று`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${n.origin??"மதிப்பு"} ${o}${n.maximum.toString()} ${s.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${n.origin??"மதிப்பு"} ${o}${n.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${n.origin} ${o}${n.minimum.toString()} ${s.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${n.origin} ${o}${n.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`தவறான சரம்: "${o.prefix}" இல் தொடங்க வேண்டும்`;if(o.format==="ends_with")return`தவறான சரம்: "${o.suffix}" இல் முடிவடைய வேண்டும்`;if(o.format==="includes")return`தவறான சரம்: "${o.includes}" ஐ உள்ளடக்க வேண்டும்`;if(o.format==="regex")return`தவறான சரம்: ${o.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${i[o.format]??n.format}`}case"not_multiple_of":return`தவறான எண்: ${n.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${n.keys.length>1?"கள்":""}: ${be(n.keys,", ")}`;case"invalid_key":return`${n.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${n.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function Ng(){return{localeError:V9()}}var W9=()=>{let e={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"ไม่ใช่ตัวเลข (NaN)":"ตัวเลข";case"object":{if(Array.isArray(n))return"อาร์เรย์ (Array)";if(n===null)return"ไม่มีค่า (null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"};return(n)=>{switch(n.code){case"invalid_type":return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${n.expected} แต่ได้รับ ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${Ve(n.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"ไม่เกิน":"น้อยกว่า",s=t(n.origin);if(s)return`เกินกำหนด: ${n.origin??"ค่า"} ควรมี${o} ${n.maximum.toString()} ${s.unit??"รายการ"}`;return`เกินกำหนด: ${n.origin??"ค่า"} ควรมี${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"อย่างน้อย":"มากกว่า",s=t(n.origin);if(s)return`น้อยกว่ากำหนด: ${n.origin} ควรมี${o} ${n.minimum.toString()} ${s.unit}`;return`น้อยกว่ากำหนด: ${n.origin} ควรมี${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${o.prefix}"`;if(o.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${o.suffix}"`;if(o.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${o.includes}" อยู่ในข้อความ`;if(o.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${o.pattern}`;return`รูปแบบไม่ถูกต้อง: ${i[o.format]??n.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${n.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${be(n.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${n.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${n.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function zg(){return{localeError:W9()}}var G9=(e)=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},J9=()=>{let e={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function t(i){return e[i]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"};return(i)=>{switch(i.code){case"invalid_type":return`Geçersiz değer: beklenen ${i.expected}, alınan ${G9(i.input)}`;case"invalid_value":if(i.values.length===1)return`Geçersiz değer: beklenen ${Ve(i.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${be(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`Çok büyük: beklenen ${i.origin??"değer"} ${n}${i.maximum.toString()} ${o.unit??"öğe"}`;return`Çok büyük: beklenen ${i.origin??"değer"} ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`Çok küçük: beklenen ${i.origin} ${n}${i.minimum.toString()} ${o.unit}`;return`Çok küçük: beklenen ${i.origin} ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Geçersiz metin: "${n.prefix}" ile başlamalı`;if(n.format==="ends_with")return`Geçersiz metin: "${n.suffix}" ile bitmeli`;if(n.format==="includes")return`Geçersiz metin: "${n.includes}" içermeli`;if(n.format==="regex")return`Geçersiz metin: ${n.pattern} desenine uymalı`;return`Geçersiz ${r[n.format]??i.format}`}case"not_multiple_of":return`Geçersiz sayı: ${i.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${i.keys.length>1?"lar":""}: ${be(i.keys,", ")}`;case"invalid_key":return`${i.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${i.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function jg(){return{localeError:J9()}}var X9=()=>{let e={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"число";case"object":{if(Array.isArray(n))return"масив";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"};return(n)=>{switch(n.code){case"invalid_type":return`Неправильні вхідні дані: очікується ${n.expected}, отримано ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Неправильні вхідні дані: очікується ${Ve(n.values[0])}`;return`Неправильна опція: очікується одне з ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Занадто велике: очікується, що ${n.origin??"значення"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"елементів"}`;return`Занадто велике: очікується, що ${n.origin??"значення"} буде ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Занадто мале: очікується, що ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`;return`Занадто мале: очікується, що ${n.origin} буде ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Неправильний рядок: повинен починатися з "${o.prefix}"`;if(o.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${o.suffix}"`;if(o.format==="includes")return`Неправильний рядок: повинен містити "${o.includes}"`;if(o.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${o.pattern}`;return`Неправильний ${i[o.format]??n.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${n.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${n.keys.length>1?"і":""}: ${be(n.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${n.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${n.origin}`;default:return"Неправильні вхідні дані"}}};function Ug(){return{localeError:X9()}}var Y9=()=>{let e={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"نمبر";case"object":{if(Array.isArray(n))return"آرے";if(n===null)return"نل";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"};return(n)=>{switch(n.code){case"invalid_type":return`غلط ان پٹ: ${n.expected} متوقع تھا، ${r(n.input)} موصول ہوا`;case"invalid_value":if(n.values.length===1)return`غلط ان پٹ: ${Ve(n.values[0])} متوقع تھا`;return`غلط آپشن: ${be(n.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`بہت بڑا: ${n.origin??"ویلیو"} کے ${o}${n.maximum.toString()} ${s.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${n.origin??"ویلیو"} کا ${o}${n.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`بہت چھوٹا: ${n.origin} کے ${o}${n.minimum.toString()} ${s.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${n.origin} کا ${o}${n.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`غلط سٹرنگ: "${o.prefix}" سے شروع ہونا چاہیے`;if(o.format==="ends_with")return`غلط سٹرنگ: "${o.suffix}" پر ختم ہونا چاہیے`;if(o.format==="includes")return`غلط سٹرنگ: "${o.includes}" شامل ہونا چاہیے`;if(o.format==="regex")return`غلط سٹرنگ: پیٹرن ${o.pattern} سے میچ ہونا چاہیے`;return`غلط ${i[o.format]??n.format}`}case"not_multiple_of":return`غلط نمبر: ${n.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${n.keys.length>1?"ز":""}: ${be(n.keys,"، ")}`;case"invalid_key":return`${n.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${n.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function Lg(){return{localeError:Y9()}}var Q9=()=>{let e={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"số";case"object":{if(Array.isArray(n))return"mảng";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"đầu vào",email:"địa chỉ 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ày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"};return(n)=>{switch(n.code){case"invalid_type":return`Đầu vào không hợp lệ: mong đợi ${n.expected}, nhận được ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${Ve(n.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Quá lớn: mong đợi ${n.origin??"giá trị"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"phần tử"}`;return`Quá lớn: mong đợi ${n.origin??"giá trị"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Quá nhỏ: mong đợi ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`;return`Quá nhỏ: mong đợi ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${o.prefix}"`;if(o.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${o.suffix}"`;if(o.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${o.includes}"`;if(o.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${o.pattern}`;return`${i[o.format]??n.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${n.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${be(n.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${n.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${n.origin}`;default:return"Đầu vào không hợp lệ"}}};function Fg(){return{localeError:Q9()}}var eR=()=>{let e={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"非数字(NaN)":"数字";case"object":{if(Array.isArray(n))return"数组";if(n===null)return"空值(null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"};return(n)=>{switch(n.code){case"invalid_type":return`无效输入:期望 ${n.expected},实际接收 ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`无效输入:期望 ${Ve(n.values[0])}`;return`无效选项:期望以下之一 ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`数值过大:期望 ${n.origin??"值"} ${o}${n.maximum.toString()} ${s.unit??"个元素"}`;return`数值过大:期望 ${n.origin??"值"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`数值过小:期望 ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`;return`数值过小:期望 ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`无效字符串:必须以 "${o.prefix}" 开头`;if(o.format==="ends_with")return`无效字符串:必须以 "${o.suffix}" 结尾`;if(o.format==="includes")return`无效字符串:必须包含 "${o.includes}"`;if(o.format==="regex")return`无效字符串:必须满足正则表达式 ${o.pattern}`;return`无效${i[o.format]??n.format}`}case"not_multiple_of":return`无效数字:必须是 ${n.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${be(n.keys,", ")}`;case"invalid_key":return`${n.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${n.origin} 中包含无效值(value)`;default:return"无效输入"}}};function qg(){return{localeError:eR()}}var tR=()=>{let e={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"輸入",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:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"};return(n)=>{switch(n.code){case"invalid_type":return`無效的輸入值:預期為 ${n.expected},但收到 ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`無效的輸入值:預期為 ${Ve(n.values[0])}`;return`無效的選項:預期為以下其中之一 ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`數值過大:預期 ${n.origin??"值"} 應為 ${o}${n.maximum.toString()} ${s.unit??"個元素"}`;return`數值過大:預期 ${n.origin??"值"} 應為 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`數值過小:預期 ${n.origin} 應為 ${o}${n.minimum.toString()} ${s.unit}`;return`數值過小:預期 ${n.origin} 應為 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`無效的字串:必須以 "${o.prefix}" 開頭`;if(o.format==="ends_with")return`無效的字串:必須以 "${o.suffix}" 結尾`;if(o.format==="includes")return`無效的字串:必須包含 "${o.includes}"`;if(o.format==="regex")return`無效的字串:必須符合格式 ${o.pattern}`;return`無效的 ${i[o.format]??n.format}`}case"not_multiple_of":return`無效的數字:必須為 ${n.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${n.keys.length>1?"們":""}:${be(n.keys,"、")}`;case"invalid_key":return`${n.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${n.origin} 中有無效的值`;default:return"無效的輸入值"}}};function Bg(){return{localeError:tR()}}var af=Symbol("ZodOutput"),uf=Symbol("ZodInput");class Ka{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&typeof r==="object"&&"id"in r){if(this._idmap.has(r.id))throw Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,e)}return this}remove(e){return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};return delete r.id,{...r,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}}function Va(){return new Ka}var tn=Va();function lf(e,t){return new e({type:"string",...Fe(t)})}function Hg(e,t){return new e({type:"string",coerce:!0,...Fe(t)})}function Wa(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Fe(t)})}function bs(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Fe(t)})}function Ga(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Fe(t)})}function Ja(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Fe(t)})}function Xa(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Fe(t)})}function Ya(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Fe(t)})}function Qa(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Fe(t)})}function eu(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Fe(t)})}function tu(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Fe(t)})}function ru(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Fe(t)})}function nu(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Fe(t)})}function iu(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Fe(t)})}function ou(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Fe(t)})}function su(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Fe(t)})}function au(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Fe(t)})}function uu(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Fe(t)})}function lu(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Fe(t)})}function cu(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Fe(t)})}function du(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Fe(t)})}function fu(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Fe(t)})}function hu(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Fe(t)})}function pu(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Fe(t)})}var cf={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Zg(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Fe(t)})}function Kg(e,t){return new e({type:"string",format:"date",check:"string_format",...Fe(t)})}function Vg(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Fe(t)})}function Wg(e,t){return new e({type:"string",format:"duration",check:"string_format",...Fe(t)})}function df(e,t){return new e({type:"number",checks:[],...Fe(t)})}function Gg(e,t){return new e({type:"number",coerce:!0,checks:[],...Fe(t)})}function ff(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Fe(t)})}function hf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...Fe(t)})}function pf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...Fe(t)})}function mf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...Fe(t)})}function gf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...Fe(t)})}function yf(e,t){return new e({type:"boolean",...Fe(t)})}function Jg(e,t){return new e({type:"boolean",coerce:!0,...Fe(t)})}function vf(e,t){return new e({type:"bigint",...Fe(t)})}function Xg(e,t){return new e({type:"bigint",coerce:!0,...Fe(t)})}function bf(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Fe(t)})}function _f(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Fe(t)})}function wf(e,t){return new e({type:"symbol",...Fe(t)})}function Sf(e,t){return new e({type:"undefined",...Fe(t)})}function xf(e,t){return new e({type:"null",...Fe(t)})}function kf(e){return new e({type:"any"})}function Mo(e){return new e({type:"unknown"})}function Mf(e,t){return new e({type:"never",...Fe(t)})}function Ef(e,t){return new e({type:"void",...Fe(t)})}function If(e,t){return new e({type:"date",...Fe(t)})}function Yg(e,t){return new e({type:"date",coerce:!0,...Fe(t)})}function $f(e,t){return new e({type:"nan",...Fe(t)})}function ci(e,t){return new od({check:"less_than",...Fe(t),value:e,inclusive:!1})}function kn(e,t){return new od({check:"less_than",...Fe(t),value:e,inclusive:!0})}function di(e,t){return new sd({check:"greater_than",...Fe(t),value:e,inclusive:!1})}function rn(e,t){return new sd({check:"greater_than",...Fe(t),value:e,inclusive:!0})}function Qg(e){return di(0,e)}function ey(e){return ci(0,e)}function ty(e){return kn(0,e)}function ry(e){return rn(0,e)}function Eo(e,t){return new D0({check:"multiple_of",...Fe(t),value:e})}function _s(e,t){return new j0({check:"max_size",...Fe(t),maximum:e})}function Io(e,t){return new U0({check:"min_size",...Fe(t),minimum:e})}function mu(e,t){return new L0({check:"size_equals",...Fe(t),size:e})}function ws(e,t){return new F0({check:"max_length",...Fe(t),maximum:e})}function Hi(e,t){return new q0({check:"min_length",...Fe(t),minimum:e})}function Ss(e,t){return new B0({check:"length_equals",...Fe(t),length:e})}function gu(e,t){return new H0({check:"string_format",format:"regex",...Fe(t),pattern:e})}function yu(e){return new Z0({check:"string_format",format:"lowercase",...Fe(e)})}function vu(e){return new K0({check:"string_format",format:"uppercase",...Fe(e)})}function bu(e,t){return new V0({check:"string_format",format:"includes",...Fe(t),includes:e})}function _u(e,t){return new W0({check:"string_format",format:"starts_with",...Fe(t),prefix:e})}function wu(e,t){return new G0({check:"string_format",format:"ends_with",...Fe(t),suffix:e})}function ny(e,t,r){return new J0({check:"property",property:e,schema:t,...Fe(r)})}function Su(e,t){return new X0({check:"mime_type",mime:e,...Fe(t)})}function fi(e){return new Y0({check:"overwrite",tx:e})}function xu(e){return fi((t)=>t.normalize(e))}function ku(){return fi((e)=>e.trim())}function Mu(){return fi((e)=>e.toLowerCase())}function Eu(){return fi((e)=>e.toUpperCase())}function Iu(e,t,r){return new e({type:"array",element:t,...Fe(r)})}function rR(e,t,r){return new e({type:"union",options:t,...Fe(r)})}function nR(e,t,r,i){return new e({type:"union",options:r,discriminator:t,...Fe(i)})}function iR(e,t,r){return new e({type:"intersection",left:t,right:r})}function iy(e,t,r,i){let n=r instanceof ut;return new e({type:"tuple",items:t,rest:n?r:null,...Fe(n?i:r)})}function oR(e,t,r,i){return new e({type:"record",keyType:t,valueType:r,...Fe(i)})}function sR(e,t,r,i){return new e({type:"map",keyType:t,valueType:r,...Fe(i)})}function aR(e,t,r){return new e({type:"set",valueType:t,...Fe(r)})}function uR(e,t,r){let i=Array.isArray(t)?Object.fromEntries(t.map((n)=>[n,n])):t;return new e({type:"enum",entries:i,...Fe(r)})}function lR(e,t,r){return new e({type:"enum",entries:t,...Fe(r)})}function cR(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...Fe(r)})}function Tf(e,t){return new e({type:"file",...Fe(t)})}function dR(e,t){return new e({type:"transform",transform:t})}function fR(e,t){return new e({type:"optional",innerType:t})}function hR(e,t){return new e({type:"nullable",innerType:t})}function pR(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r==="function"?r():r}})}function mR(e,t,r){return new e({type:"nonoptional",innerType:t,...Fe(r)})}function gR(e,t){return new e({type:"success",innerType:t})}function yR(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r==="function"?r:()=>r})}function vR(e,t,r){return new e({type:"pipe",in:t,out:r})}function bR(e,t){return new e({type:"readonly",innerType:t})}function _R(e,t,r){return new e({type:"template_literal",parts:t,...Fe(r)})}function wR(e,t){return new e({type:"lazy",getter:t})}function SR(e,t){return new e({type:"promise",innerType:t})}function Pf(e,t,r){let i=Fe(r);return i.abort??(i.abort=!0),new e({type:"custom",check:"custom",fn:t,...i})}function Af(e,t,r){return new e({type:"custom",check:"custom",fn:t,...Fe(r)})}function Rf(e,t){let r=Fe(t),i=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];if(r.case!=="sensitive")i=i.map((M)=>typeof M==="string"?M.toLowerCase():M),n=n.map((M)=>typeof M==="string"?M.toLowerCase():M);let o=new Set(i),s=new Set(n),h=e.Pipe??ys,v=e.Boolean??ps,b=e.String??qi,g=new(e.Transform??gs)({type:"transform",transform:(M,I)=>{let $=M;if(r.case!=="sensitive")$=$.toLowerCase();if(o.has($))return!0;else if(s.has($))return!1;else return I.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:I.value,inst:g}),{}},error:r.error}),S=new h({type:"pipe",in:new b({type:"string",error:r.error}),out:g,error:r.error});return new h({type:"pipe",in:S,out:new v({type:"boolean",error:r.error}),error:r.error})}function Cf(e,t,r,i={}){let n=Fe(i),o={...Fe(i),check:"string_format",type:"string",format:t,fn:typeof r==="function"?r:(h)=>r.test(h),...n};if(r instanceof RegExp)o.pattern=r;return new e(o)}class oy{constructor(e){this._def=e,this.def=e}implement(e){if(typeof e!=="function")throw Error("implement() must be called with a function");let t=(...r)=>{let i=this._def.input?wo(this._def.input,r,void 0,{callee:t}):r;if(!Array.isArray(i))throw Error("Invalid arguments schema: not an array or tuple schema.");let n=e(...i);return this._def.output?wo(this._def.output,n,void 0,{callee:t}):n};return t}implementAsync(e){if(typeof e!=="function")throw Error("implement() must be called with a function");let t=async(...r)=>{let i=this._def.input?await So(this._def.input,r,void 0,{callee:t}):r;if(!Array.isArray(i))throw Error("Invalid arguments schema: not an array or tuple schema.");let n=await e(...i);return this._def.output?So(this._def.output,n,void 0,{callee:t}):n};return t}input(...e){let t=this.constructor;if(Array.isArray(e[0]))return new t({type:"function",input:new Bi({type:"tuple",items:e[0],rest:e[1]}),output:this._def.output});return new t({type:"function",input:e[0],output:this._def.output})}output(e){return new this.constructor({type:"function",input:this._def.input,output:e})}}function Of(e){return new oy({type:"function",input:Array.isArray(e?.input)?iy(Bi,e?.input):e?.input??Iu(ms,Mo(ko)),output:e?.output??Mo(ko)})}class Df{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??tn,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,t={path:[],schemaPath:[]}){var r;let i=e._zod.def,n={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},o=this.seen.get(e);if(o){if(o.count++,t.schemaPath.includes(e))o.cycle=t.path;return o.schema}let s={schema:{},count:1,cycle:void 0,path:t.path};this.seen.set(e,s);let h=e._zod.toJSONSchema?.();if(h)s.schema=h;else{let _={...t,schemaPath:[...t.schemaPath,e],path:t.path},g=e._zod.parent;if(g)s.ref=g,this.process(g,_),this.seen.get(g).isParent=!0;else{let S=s.schema;switch(i.type){case"string":{let x=S;x.type="string";let{minimum:M,maximum:I,format:$,patterns:T,contentEncoding:P}=e._zod.bag;if(typeof M==="number")x.minLength=M;if(typeof I==="number")x.maxLength=I;if($){if(x.format=n[$]??$,x.format==="")delete x.format}if(P)x.contentEncoding=P;if(T&&T.size>0){let R=[...T];if(R.length===1)x.pattern=R[0].source;else if(R.length>1)s.schema.allOf=[...R.map((C)=>({...this.target==="draft-7"?{type:"string"}:{},pattern:C.source}))]}break}case"number":{let x=S,{minimum:M,maximum:I,format:$,multipleOf:T,exclusiveMaximum:P,exclusiveMinimum:R}=e._zod.bag;if(typeof $==="string"&&$.includes("int"))x.type="integer";else x.type="number";if(typeof R==="number")x.exclusiveMinimum=R;if(typeof M==="number"){if(x.minimum=M,typeof R==="number")if(R>=M)delete x.minimum;else delete x.exclusiveMinimum}if(typeof P==="number")x.exclusiveMaximum=P;if(typeof I==="number"){if(x.maximum=I,typeof P==="number")if(P<=I)delete x.maximum;else delete x.exclusiveMaximum}if(typeof T==="number")x.multipleOf=T;break}case"boolean":{let x=S;x.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema");break}case"null":{S.type="null";break}case"any":break;case"unknown":break;case"undefined":case"never":{S.not={};break}case"void":{if(this.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema");break}case"date":{if(this.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema");break}case"array":{let x=S,{minimum:M,maximum:I}=e._zod.bag;if(typeof M==="number")x.minItems=M;if(typeof I==="number")x.maxItems=I;x.type="array",x.items=this.process(i.element,{..._,path:[..._.path,"items"]});break}case"object":{let x=S;x.type="object",x.properties={};let M=i.shape;for(let T in M)x.properties[T]=this.process(M[T],{..._,path:[..._.path,"properties",T]});let I=new Set(Object.keys(M)),$=new Set([...I].filter((T)=>{let P=i.shape[T]._zod;if(this.io==="input")return P.optin===void 0;else return P.optout===void 0}));if($.size>0)x.required=Array.from($);if(i.catchall?._zod.def.type==="never")x.additionalProperties=!1;else if(!i.catchall){if(this.io==="output")x.additionalProperties=!1}else if(i.catchall)x.additionalProperties=this.process(i.catchall,{..._,path:[..._.path,"additionalProperties"]});break}case"union":{let x=S;x.anyOf=i.options.map((M,I)=>this.process(M,{..._,path:[..._.path,"anyOf",I]}));break}case"intersection":{let x=S,M=this.process(i.left,{..._,path:[..._.path,"allOf",0]}),I=this.process(i.right,{..._,path:[..._.path,"allOf",1]}),$=(P)=>("allOf"in P)&&Object.keys(P).length===1,T=[...$(M)?M.allOf:[M],...$(I)?I.allOf:[I]];x.allOf=T;break}case"tuple":{let x=S;x.type="array";let M=i.items.map((T,P)=>this.process(T,{..._,path:[..._.path,"prefixItems",P]}));if(this.target==="draft-2020-12")x.prefixItems=M;else x.items=M;if(i.rest){let T=this.process(i.rest,{..._,path:[..._.path,"items"]});if(this.target==="draft-2020-12")x.items=T;else x.additionalItems=T}if(i.rest)x.items=this.process(i.rest,{..._,path:[..._.path,"items"]});let{minimum:I,maximum:$}=e._zod.bag;if(typeof I==="number")x.minItems=I;if(typeof $==="number")x.maxItems=$;break}case"record":{let x=S;x.type="object",x.propertyNames=this.process(i.keyType,{..._,path:[..._.path,"propertyNames"]}),x.additionalProperties=this.process(i.valueType,{..._,path:[..._.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema");break}case"enum":{let x=S,M=Oa(i.entries);if(M.every((I)=>typeof I==="number"))x.type="number";if(M.every((I)=>typeof I==="string"))x.type="string";x.enum=M;break}case"literal":{let x=S,M=[];for(let I of i.values)if(I===void 0){if(this.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof I==="bigint")if(this.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else M.push(Number(I));else M.push(I);if(M.length===0);else if(M.length===1){let I=M[0];x.type=I===null?"null":typeof I,x.const=I}else{if(M.every((I)=>typeof I==="number"))x.type="number";if(M.every((I)=>typeof I==="string"))x.type="string";if(M.every((I)=>typeof I==="boolean"))x.type="string";if(M.every((I)=>I===null))x.type="null";x.enum=M}break}case"file":{let x=S,M={type:"string",format:"binary",contentEncoding:"binary"},{minimum:I,maximum:$,mime:T}=e._zod.bag;if(I!==void 0)M.minLength=I;if($!==void 0)M.maxLength=$;if(T)if(T.length===1)M.contentMediaType=T[0],Object.assign(x,M);else x.anyOf=T.map((P)=>({...M,contentMediaType:P}));else Object.assign(x,M);break}case"transform":{if(this.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let x=this.process(i.innerType,_);S.anyOf=[x,{type:"null"}];break}case"nonoptional":{this.process(i.innerType,_),s.ref=i.innerType;break}case"success":{let x=S;x.type="boolean";break}case"default":{this.process(i.innerType,_),s.ref=i.innerType,S.default=JSON.parse(JSON.stringify(i.defaultValue));break}case"prefault":{if(this.process(i.innerType,_),s.ref=i.innerType,this.io==="input")S._prefault=JSON.parse(JSON.stringify(i.defaultValue));break}case"catch":{this.process(i.innerType,_),s.ref=i.innerType;let x;try{x=i.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}S.default=x;break}case"nan":{if(this.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let x=S,M=e._zod.pattern;if(!M)throw Error("Pattern not found in template literal");x.type="string",x.pattern=M.source;break}case"pipe":{let x=this.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;this.process(x,_),s.ref=x;break}case"readonly":{this.process(i.innerType,_),s.ref=i.innerType,S.readOnly=!0;break}case"promise":{this.process(i.innerType,_),s.ref=i.innerType;break}case"optional":{this.process(i.innerType,_),s.ref=i.innerType;break}case"lazy":{let x=e._zod.innerType;this.process(x,_),s.ref=x;break}case"custom":{if(this.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema");break}default:}}}let v=this.metadataRegistry.get(e);if(v)Object.assign(s.schema,v);if(this.io==="input"&&_r(e))delete s.schema.examples,delete s.schema.default;if(this.io==="input"&&s.schema._prefault)(r=s.schema).default??(r.default=s.schema._prefault);return delete s.schema._prefault,this.seen.get(e).schema}emit(e,t){let r={cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0},i=this.seen.get(e);if(!i)throw Error("Unprocessed schema. This is a bug in Zod.");let n=(b)=>{let _=this.target==="draft-2020-12"?"$defs":"definitions";if(r.external){let M=r.external.registry.get(b[0])?.id;if(M)return{ref:r.external.uri(M)};let I=b[1].defId??b[1].schema.id??`schema${this.counter++}`;return b[1].defId=I,{defId:I,ref:`${r.external.uri("__shared")}#/${_}/${I}`}}if(b[1]===i)return{ref:"#"};let S=`${"#"}/${_}/`,x=b[1].schema.id??`__schema${this.counter++}`;return{defId:x,ref:S+x}},o=(b)=>{if(b[1].schema.$ref)return;let _=b[1],{ref:g,defId:S}=n(b);if(_.def={..._.schema},S)_.defId=S;let x=_.schema;for(let M in x)delete x[M];x.$ref=g};for(let b of this.seen.entries()){let _=b[1];if(e===b[0]){o(b);continue}if(r.external){let S=r.external.registry.get(b[0])?.id;if(e!==b[0]&&S){o(b);continue}}if(this.metadataRegistry.get(b[0])?.id){o(b);continue}if(_.cycle){if(r.cycles==="throw")throw Error(`Cycle detected: #/${_.cycle?.join("/")}/<root>
|
|
52
|
+
})));`),S.write(`newResult[${bo(P)}] = ${R}.value`)}S.write("payload.value = newResult;"),S.write("return payload;");let T=S.compile();return(P,R)=>T(g,P,R)},n,o=us,s=!Ra.jitless,v=s&&e0.value,b=t.catchall,_;e._zod.parse=(g,S)=>{_??(_=r.value);let x=g.value;if(!o(x))return g.issues.push({expected:"object",code:"invalid_type",input:x,inst:e}),g;let M=[];if(s&&v&&S?.async===!1&&S.jitless!==!0){if(!n)n=i(t.shape);g=n(g,S)}else{g.value={};let R=_.shape;for(let C of _.keys){let N=R[C],B=N._zod.run({value:x[C],issues:[]},S),ie=N._zod.optin==="optional"&&N._zod.optout==="optional";if(B instanceof Promise)M.push(B.then((le)=>ie?MS(le,g,C,x):ud(le,g,C)));else if(ie)MS(B,g,C,x);else ud(B,g,C)}}if(!b)return M.length?Promise.all(M).then(()=>g):g;let I=[],$=_.keySet,T=b._zod,P=T.def.type;for(let R of Object.keys(x)){if($.has(R))continue;if(P==="never"){I.push(R);continue}let C=T.run({value:x[R],issues:[]},S);if(C instanceof Promise)M.push(C.then((N)=>ud(N,g,R)));else ud(C,g,R)}if(I.length)g.issues.push({code:"unrecognized_keys",keys:I,input:x,inst:e});if(!M.length)return g;return Promise.all(M).then(()=>g)}});function ES(e,t,r,i){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map((n)=>n.issues.map((o)=>fn(o,i,rr())))}),t}var Ha=ne("$ZodUnion",(e,t)=>{ut.init(e,t),$t(e._zod,"optin",()=>t.options.some((r)=>r._zod.optin==="optional")?"optional":void 0),$t(e._zod,"optout",()=>t.options.some((r)=>r._zod.optout==="optional")?"optional":void 0),$t(e._zod,"values",()=>{if(t.options.every((r)=>r._zod.values))return new Set(t.options.flatMap((r)=>Array.from(r._zod.values)));return}),$t(e._zod,"pattern",()=>{if(t.options.every((r)=>r._zod.pattern)){let r=t.options.map((i)=>i._zod.pattern);return new RegExp(`^(${r.map((i)=>Na(i.source)).join("|")})$`)}return}),e._zod.parse=(r,i)=>{let n=!1,o=[];for(let s of t.options){let h=s._zod.run({value:r.value,issues:[]},i);if(h instanceof Promise)o.push(h),n=!0;else{if(h.issues.length===0)return h;o.push(h)}}if(!n)return ES(o,r,e,i);return Promise.all(o).then((s)=>ES(s,r,e,i))}}),Ud=ne("$ZodDiscriminatedUnion",(e,t)=>{Ha.init(e,t);let r=e._zod.parse;$t(e._zod,"propValues",()=>{let n={};for(let o of t.options){let s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(let[h,v]of Object.entries(s)){if(!n[h])n[h]=new Set;for(let b of v)n[h].add(b)}}return n});let i=Da(()=>{let n=t.options,o=new Map;for(let s of n){let h=s._zod.propValues[t.discriminator];if(!h||h.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let v of h){if(o.has(v))throw Error(`Duplicate discriminator value "${String(v)}"`);o.set(v,s)}}return o});e._zod.parse=(n,o)=>{let s=n.value;if(!us(s))return n.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),n;let h=i.value.get(s?.[t.discriminator]);if(h)return h._zod.run(n,o);if(t.unionFallback)return r(n,o);return n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:s,path:[t.discriminator],inst:e}),n}}),Ld=ne("$ZodIntersection",(e,t)=>{ut.init(e,t),e._zod.parse=(r,i)=>{let n=r.value,o=t.left._zod.run({value:n,issues:[]},i),s=t.right._zod.run({value:n,issues:[]},i);if(o instanceof Promise||s instanceof Promise)return Promise.all([o,s]).then(([v,b])=>IS(r,v,b));return IS(r,o,s)}});function eg(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(ls(e)&&ls(t)){let r=Object.keys(t),i=Object.keys(e).filter((o)=>r.indexOf(o)!==-1),n={...e,...t};for(let o of i){let s=eg(e[o],t[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};n[o]=s.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let i=0;i<e.length;i++){let n=e[i],o=t[i],s=eg(n,o);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function IS(e,t,r){if(t.issues.length)e.issues.push(...t.issues);if(r.issues.length)e.issues.push(...r.issues);if(_o(e))return e;let i=eg(t.value,r.value);if(!i.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}var Bi=ne("$ZodTuple",(e,t)=>{ut.init(e,t);let r=t.items,i=r.length-[...r].reverse().findIndex((n)=>n._zod.optin!=="optional");e._zod.parse=(n,o)=>{let s=n.value;if(!Array.isArray(s))return n.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),n;n.value=[];let h=[];if(!t.rest){let b=s.length>r.length,_=s.length<i-1;if(b||_)return n.issues.push({input:s,inst:e,origin:"array",...b?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length}}),n}let v=-1;for(let b of r){if(v++,v>=s.length){if(v>=i)continue}let _=b._zod.run({value:s[v],issues:[]},o);if(_ instanceof Promise)h.push(_.then((g)=>ld(g,n,v)));else ld(_,n,v)}if(t.rest){let b=s.slice(r.length);for(let _ of b){v++;let g=t.rest._zod.run({value:_,issues:[]},o);if(g instanceof Promise)h.push(g.then((S)=>ld(S,n,v)));else ld(g,n,v)}}if(h.length)return Promise.all(h).then(()=>n);return n}});function ld(e,t,r){if(e.issues.length)t.issues.push(...en(r,e.issues));t.value[r]=e.value}var Fd=ne("$ZodRecord",(e,t)=>{ut.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(!ls(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let o=[];if(t.keyType._zod.values){let s=t.keyType._zod.values;r.value={};for(let v of s)if(typeof v==="string"||typeof v==="number"||typeof v==="symbol"){let b=t.valueType._zod.run({value:n[v],issues:[]},i);if(b instanceof Promise)o.push(b.then((_)=>{if(_.issues.length)r.issues.push(...en(v,_.issues));r.value[v]=_.value}));else{if(b.issues.length)r.issues.push(...en(v,b.issues));r.value[v]=b.value}}let h;for(let v in n)if(!s.has(v))h=h??[],h.push(v);if(h&&h.length>0)r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:h})}else{r.value={};for(let s of Reflect.ownKeys(n)){if(s==="__proto__")continue;let h=t.keyType._zod.run({value:s,issues:[]},i);if(h instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(h.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:h.issues.map((b)=>fn(b,i,rr())),input:s,path:[s],inst:e}),r.value[h.value]=h.value;continue}let v=t.valueType._zod.run({value:n[s],issues:[]},i);if(v instanceof Promise)o.push(v.then((b)=>{if(b.issues.length)r.issues.push(...en(s,b.issues));r.value[h.value]=b.value}));else{if(v.issues.length)r.issues.push(...en(s,v.issues));r.value[h.value]=v.value}}}if(o.length)return Promise.all(o).then(()=>r);return r}}),qd=ne("$ZodMap",(e,t)=>{ut.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),r;let o=[];r.value=new Map;for(let[s,h]of n){let v=t.keyType._zod.run({value:s,issues:[]},i),b=t.valueType._zod.run({value:h,issues:[]},i);if(v instanceof Promise||b instanceof Promise)o.push(Promise.all([v,b]).then(([_,g])=>{$S(_,g,r,s,n,e,i)}));else $S(v,b,r,s,n,e,i)}if(o.length)return Promise.all(o).then(()=>r);return r}});function $S(e,t,r,i,n,o,s){if(e.issues.length)if(za.has(typeof i))r.issues.push(...en(i,e.issues));else r.issues.push({origin:"map",code:"invalid_key",input:n,inst:o,issues:e.issues.map((h)=>fn(h,s,rr()))});if(t.issues.length)if(za.has(typeof i))r.issues.push(...en(i,t.issues));else r.issues.push({origin:"map",code:"invalid_element",input:n,inst:o,key:i,issues:t.issues.map((h)=>fn(h,s,rr()))});r.value.set(e.value,t.value)}var Bd=ne("$ZodSet",(e,t)=>{ut.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),r;let o=[];r.value=new Set;for(let s of n){let h=t.valueType._zod.run({value:s,issues:[]},i);if(h instanceof Promise)o.push(h.then((v)=>TS(v,r)));else TS(h,r)}if(o.length)return Promise.all(o).then(()=>r);return r}});function TS(e,t){if(e.issues.length)t.issues.push(...e.issues);t.value.add(e.value)}var Hd=ne("$ZodEnum",(e,t)=>{ut.init(e,t);let r=Oa(t.entries);e._zod.values=new Set(r),e._zod.pattern=new RegExp(`^(${r.filter((i)=>za.has(typeof i)).map((i)=>typeof i==="string"?li(i):i.toString()).join("|")})$`),e._zod.parse=(i,n)=>{let o=i.value;if(e._zod.values.has(o))return i;return i.issues.push({code:"invalid_value",values:r,input:o,inst:e}),i}}),Zd=ne("$ZodLiteral",(e,t)=>{ut.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map((r)=>typeof r==="string"?li(r):r?r.toString():String(r)).join("|")})$`),e._zod.parse=(r,i)=>{let n=r.value;if(e._zod.values.has(n))return r;return r.issues.push({code:"invalid_value",values:t.values,input:n,inst:e}),r}}),Kd=ne("$ZodFile",(e,t)=>{ut.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(n instanceof File)return r;return r.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),r}}),gs=ne("$ZodTransform",(e,t)=>{ut.init(e,t),e._zod.parse=(r,i)=>{let n=t.transform(r.value,r);if(i.async)return(n instanceof Promise?n:Promise.resolve(n)).then((s)=>(r.value=s,r));if(n instanceof Promise)throw new ui;return r.value=n,r}}),Vd=ne("$ZodOptional",(e,t)=>{ut.init(e,t),e._zod.optin="optional",e._zod.optout="optional",$t(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),$t(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Na(r.source)})?$`):void 0}),e._zod.parse=(r,i)=>{if(t.innerType._zod.optin==="optional")return t.innerType._zod.run(r,i);if(r.value===void 0)return r;return t.innerType._zod.run(r,i)}}),Wd=ne("$ZodNullable",(e,t)=>{ut.init(e,t),$t(e._zod,"optin",()=>t.innerType._zod.optin),$t(e._zod,"optout",()=>t.innerType._zod.optout),$t(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Na(r.source)}|null)$`):void 0}),$t(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,i)=>{if(r.value===null)return r;return t.innerType._zod.run(r,i)}}),Gd=ne("$ZodDefault",(e,t)=>{ut.init(e,t),e._zod.optin="optional",$t(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,i);if(n instanceof Promise)return n.then((o)=>PS(o,t));return PS(n,t)}});function PS(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var Jd=ne("$ZodPrefault",(e,t)=>{ut.init(e,t),e._zod.optin="optional",$t(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(r.value===void 0)r.value=t.defaultValue;return t.innerType._zod.run(r,i)}}),Xd=ne("$ZodNonOptional",(e,t)=>{ut.init(e,t),$t(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter((i)=>i!==void 0)):void 0}),e._zod.parse=(r,i)=>{let n=t.innerType._zod.run(r,i);if(n instanceof Promise)return n.then((o)=>AS(o,e));return AS(n,e)}});function AS(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}var Yd=ne("$ZodSuccess",(e,t)=>{ut.init(e,t),e._zod.parse=(r,i)=>{let n=t.innerType._zod.run(r,i);if(n instanceof Promise)return n.then((o)=>(r.value=o.issues.length===0,r));return r.value=n.issues.length===0,r}}),Qd=ne("$ZodCatch",(e,t)=>{ut.init(e,t),e._zod.optin="optional",$t(e._zod,"optout",()=>t.innerType._zod.optout),$t(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{let n=t.innerType._zod.run(r,i);if(n instanceof Promise)return n.then((o)=>{if(r.value=o.value,o.issues.length)r.value=t.catchValue({...r,error:{issues:o.issues.map((s)=>fn(s,i,rr()))},input:r.value}),r.issues=[];return r});if(r.value=n.value,n.issues.length)r.value=t.catchValue({...r,error:{issues:n.issues.map((o)=>fn(o,i,rr()))},input:r.value}),r.issues=[];return r}}),ef=ne("$ZodNaN",(e,t)=>{ut.init(e,t),e._zod.parse=(r,i)=>{if(typeof r.value!=="number"||!Number.isNaN(r.value))return r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r;return r}}),ys=ne("$ZodPipe",(e,t)=>{ut.init(e,t),$t(e._zod,"values",()=>t.in._zod.values),$t(e._zod,"optin",()=>t.in._zod.optin),$t(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(r,i)=>{let n=t.in._zod.run(r,i);if(n instanceof Promise)return n.then((o)=>RS(o,t,i));return RS(n,t,i)}});function RS(e,t,r){if(_o(e))return e;return t.out._zod.run({value:e.value,issues:e.issues},r)}var tf=ne("$ZodReadonly",(e,t)=>{ut.init(e,t),$t(e._zod,"propValues",()=>t.innerType._zod.propValues),$t(e._zod,"values",()=>t.innerType._zod.values),$t(e._zod,"optin",()=>t.innerType._zod.optin),$t(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(r,i)=>{let n=t.innerType._zod.run(r,i);if(n instanceof Promise)return n.then(CS);return CS(n)}});function CS(e){return e.value=Object.freeze(e.value),e}var rf=ne("$ZodTemplateLiteral",(e,t)=>{ut.init(e,t);let r=[];for(let i of t.parts)if(i instanceof ut){if(!i._zod.pattern)throw 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 Error(`Invalid template literal part: ${i._zod.traits}`);let o=n.startsWith("^")?1:0,s=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(o,s))}else if(i===null||t0.has(typeof i))r.push(li(`${i}`));else throw Error(`Invalid template literal part: ${i}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(i,n)=>{if(typeof i.value!=="string")return i.issues.push({input:i.value,inst:e,expected:"template_literal",code:"invalid_type"}),i;if(e._zod.pattern.lastIndex=0,!e._zod.pattern.test(i.value))return i.issues.push({input:i.value,inst:e,code:"invalid_format",format:"template_literal",pattern:e._zod.pattern.source}),i;return i}}),nf=ne("$ZodPromise",(e,t)=>{ut.init(e,t),e._zod.parse=(r,i)=>Promise.resolve(r.value).then((n)=>t.innerType._zod.run({value:n,issues:[]},i))}),of=ne("$ZodLazy",(e,t)=>{ut.init(e,t),$t(e._zod,"innerType",()=>t.getter()),$t(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),$t(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),$t(e._zod,"optin",()=>e._zod.innerType._zod.optin),$t(e._zod,"optout",()=>e._zod.innerType._zod.optout),e._zod.parse=(r,i)=>e._zod.innerType._zod.run(r,i)}),sf=ne("$ZodCustom",(e,t)=>{Ht.init(e,t),ut.init(e,t),e._zod.parse=(r,i)=>r,e._zod.check=(r)=>{let i=r.value,n=t.fn(i);if(n instanceof Promise)return n.then((o)=>OS(o,r,i,e));OS(n,r,i,e);return}});function OS(e,t,r,i){if(!e){let n={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};if(i._zod.def.params)n.params=i._zod.def.params;t.issues.push(o0(n))}}var vs={};wn(vs,{zhTW:()=>Bg,zhCN:()=>qg,vi:()=>Fg,ur:()=>Lg,ua:()=>Ug,tr:()=>jg,th:()=>zg,ta:()=>Ng,sv:()=>Dg,sl:()=>Og,ru:()=>Cg,pt:()=>Rg,ps:()=>Pg,pl:()=>Ag,ota:()=>Tg,no:()=>$g,nl:()=>Ig,ms:()=>Eg,mk:()=>Mg,ko:()=>kg,kh:()=>xg,ja:()=>Sg,it:()=>wg,id:()=>_g,hu:()=>bg,he:()=>vg,frCA:()=>yg,fr:()=>gg,fi:()=>mg,fa:()=>pg,es:()=>hg,eo:()=>fg,en:()=>Za,de:()=>dg,cs:()=>cg,ca:()=>lg,be:()=>ug,az:()=>ag,ar:()=>sg});var pR=()=>{let e={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"};return(n)=>{switch(n.code){case"invalid_type":return`مدخلات غير مقبولة: يفترض إدخال ${n.expected}، ولكن تم إدخال ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${Ve(n.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return` أكبر من اللازم: يفترض أن تكون ${n.origin??"القيمة"} ${o} ${n.maximum.toString()} ${s.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${n.origin??"القيمة"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`أصغر من اللازم: يفترض لـ ${n.origin} أن يكون ${o} ${n.minimum.toString()} ${s.unit}`;return`أصغر من اللازم: يفترض لـ ${n.origin} أن يكون ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${n.prefix}"`;if(o.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${o.suffix}"`;if(o.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${o.includes}"`;if(o.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${o.pattern}`;return`${i[o.format]??n.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${n.divisor}`;case"unrecognized_keys":return`معرف${n.keys.length>1?"ات":""} غريب${n.keys.length>1?"ة":""}: ${be(n.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${n.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${n.origin}`;default:return"مدخل غير مقبول"}}};function sg(){return{localeError:pR()}}var mR=()=>{let e={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(n)=>{switch(n.code){case"invalid_type":return`Yanlış dəyər: gözlənilən ${n.expected}, daxil olan ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Yanlış dəyər: gözlənilən ${Ve(n.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Çox böyük: gözlənilən ${n.origin??"dəyər"} ${o}${n.maximum.toString()} ${s.unit??"element"}`;return`Çox böyük: gözlənilən ${n.origin??"dəyər"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Çox kiçik: gözlənilən ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`;return`Çox kiçik: gözlənilən ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Yanlış mətn: "${o.prefix}" ilə başlamalıdır`;if(o.format==="ends_with")return`Yanlış mətn: "${o.suffix}" ilə bitməlidir`;if(o.format==="includes")return`Yanlış mətn: "${o.includes}" daxil olmalıdır`;if(o.format==="regex")return`Yanlış mətn: ${o.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${i[o.format]??n.format}`}case"not_multiple_of":return`Yanlış ədəd: ${n.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${n.keys.length>1?"lar":""}: ${be(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${n.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function ag(){return{localeError:mR()}}function jS(e,t,r,i){let n=Math.abs(e),o=n%10,s=n%100;if(s>=11&&s<=19)return i;if(o===1)return t;if(o>=2&&o<=4)return r;return i}var gR=()=>{let e={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"лік";case"object":{if(Array.isArray(n))return"масіў";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"};return(n)=>{switch(n.code){case"invalid_type":return`Няправільны ўвод: чакаўся ${n.expected}, атрымана ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Няправільны ўвод: чакалася ${Ve(n.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s){let h=Number(n.maximum),v=jS(h,s.unit.one,s.unit.few,s.unit.many);return`Занадта вялікі: чакалася, што ${n.origin??"значэнне"} павінна ${s.verb} ${o}${n.maximum.toString()} ${v}`}return`Занадта вялікі: чакалася, што ${n.origin??"значэнне"} павінна быць ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s){let h=Number(n.minimum),v=jS(h,s.unit.one,s.unit.few,s.unit.many);return`Занадта малы: чакалася, што ${n.origin} павінна ${s.verb} ${o}${n.minimum.toString()} ${v}`}return`Занадта малы: чакалася, што ${n.origin} павінна быць ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${o.prefix}"`;if(o.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${o.suffix}"`;if(o.format==="includes")return`Няправільны радок: павінен змяшчаць "${o.includes}"`;if(o.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${o.pattern}`;return`Няправільны ${i[o.format]??n.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${n.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${n.keys.length>1?"ключы":"ключ"}: ${be(n.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${n.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${n.origin}`;default:return"Няправільны ўвод"}}};function ug(){return{localeError:gR()}}var yR=()=>{let e={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"entrada",email:"adreça electrònica",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ça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(n)=>{switch(n.code){case"invalid_type":return`Tipus invàlid: s'esperava ${n.expected}, s'ha rebut ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Valor invàlid: s'esperava ${Ve(n.values[0])}`;return`Opció invàlida: s'esperava una de ${be(n.values," o ")}`;case"too_big":{let o=n.inclusive?"com a màxim":"menys de",s=t(n.origin);if(s)return`Massa gran: s'esperava que ${n.origin??"el valor"} contingués ${o} ${n.maximum.toString()} ${s.unit??"elements"}`;return`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"com a mínim":"més de",s=t(n.origin);if(s)return`Massa petit: s'esperava que ${n.origin} contingués ${o} ${n.minimum.toString()} ${s.unit}`;return`Massa petit: s'esperava que ${n.origin} fos ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Format invàlid: ha de començar amb "${o.prefix}"`;if(o.format==="ends_with")return`Format invàlid: ha d'acabar amb "${o.suffix}"`;if(o.format==="includes")return`Format invàlid: ha d'incloure "${o.includes}"`;if(o.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${o.pattern}`;return`Format invàlid per a ${i[o.format]??n.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${be(n.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${n.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${n.origin}`;default:return"Entrada invàlida"}}};function lg(){return{localeError:yR()}}var vR=()=>{let e={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"číslo";case"string":return"řetězec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(n))return"pole";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"regulární výraz",email:"e-mailová 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 čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"};return(n)=>{switch(n.code){case"invalid_type":return`Neplatný vstup: očekáváno ${n.expected}, obdrženo ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Neplatný vstup: očekáváno ${Ve(n.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Hodnota je příliš velká: ${n.origin??"hodnota"} musí mít ${o}${n.maximum.toString()} ${s.unit??"prvků"}`;return`Hodnota je příliš velká: ${n.origin??"hodnota"} musí být ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Hodnota je příliš malá: ${n.origin??"hodnota"} musí mít ${o}${n.minimum.toString()} ${s.unit??"prvků"}`;return`Hodnota je příliš malá: ${n.origin??"hodnota"} musí být ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Neplatný řetězec: musí začínat na "${o.prefix}"`;if(o.format==="ends_with")return`Neplatný řetězec: musí končit na "${o.suffix}"`;if(o.format==="includes")return`Neplatný řetězec: musí obsahovat "${o.includes}"`;if(o.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${o.pattern}`;return`Neplatný formát ${i[o.format]??n.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${n.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${be(n.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${n.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${n.origin}`;default:return"Neplatný vstup"}}};function cg(){return{localeError:vR()}}var bR=()=>{let e={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 t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"Zahl";case"object":{if(Array.isArray(n))return"Array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return(n)=>{switch(n.code){case"invalid_type":return`Ungültige Eingabe: erwartet ${n.expected}, erhalten ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Ungültige Eingabe: erwartet ${Ve(n.values[0])}`;return`Ungültige Option: erwartet eine von ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Zu groß: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ${s.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ist`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ${s.unit} hat`;return`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ist`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Ungültiger String: muss mit "${o.prefix}" beginnen`;if(o.format==="ends_with")return`Ungültiger String: muss mit "${o.suffix}" enden`;if(o.format==="includes")return`Ungültiger String: muss "${o.includes}" enthalten`;if(o.format==="regex")return`Ungültiger String: muss dem Muster ${o.pattern} entsprechen`;return`Ungültig: ${i[o.format]??n.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${be(n.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${n.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${n.origin}`;default:return"Ungültige Eingabe"}}};function dg(){return{localeError:bR()}}var _R=(e)=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},wR=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function t(i){return e[i]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(i)=>{switch(i.code){case"invalid_type":return`Invalid input: expected ${i.expected}, received ${_R(i.input)}`;case"invalid_value":if(i.values.length===1)return`Invalid input: expected ${Ve(i.values[0])}`;return`Invalid option: expected one of ${be(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`Too big: expected ${i.origin??"value"} to have ${n}${i.maximum.toString()} ${o.unit??"elements"}`;return`Too big: expected ${i.origin??"value"} to be ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`Too small: expected ${i.origin} to have ${n}${i.minimum.toString()} ${o.unit}`;return`Too small: expected ${i.origin} to be ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Invalid string: must start with "${n.prefix}"`;if(n.format==="ends_with")return`Invalid string: must end with "${n.suffix}"`;if(n.format==="includes")return`Invalid string: must include "${n.includes}"`;if(n.format==="regex")return`Invalid string: must match pattern ${n.pattern}`;return`Invalid ${r[n.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${be(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function Za(){return{localeError:wR()}}var SR=(e)=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"nombro";case"object":{if(Array.isArray(e))return"tabelo";if(e===null)return"senvalora";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},xR=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(i){return e[i]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",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ŭro",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"};return(i)=>{switch(i.code){case"invalid_type":return`Nevalida enigo: atendiĝis ${i.expected}, riceviĝis ${SR(i.input)}`;case"invalid_value":if(i.values.length===1)return`Nevalida enigo: atendiĝis ${Ve(i.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${be(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`Tro granda: atendiĝis ke ${i.origin??"valoro"} havu ${n}${i.maximum.toString()} ${o.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${i.origin??"valoro"} havu ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`Tro malgranda: atendiĝis ke ${i.origin} havu ${n}${i.minimum.toString()} ${o.unit}`;return`Tro malgranda: atendiĝis ke ${i.origin} estu ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${n.prefix}"`;if(n.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${n.suffix}"`;if(n.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${n.includes}"`;if(n.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${n.pattern}`;return`Nevalida ${r[n.format]??i.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${i.divisor}`;case"unrecognized_keys":return`Nekonata${i.keys.length>1?"j":""} ŝlosilo${i.keys.length>1?"j":""}: ${be(i.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${i.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${i.origin}`;default:return"Nevalida enigo"}}};function fg(){return{localeError:xR()}}var kR=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"número";case"object":{if(Array.isArray(n))return"arreglo";if(n===null)return"nulo";if(Object.getPrototypeOf(n)!==Object.prototype)return n.constructor.name}}return o},i={regex:"entrada",email:"dirección de correo electrónico",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ón ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(n)=>{switch(n.code){case"invalid_type":return`Entrada inválida: se esperaba ${n.expected}, recibido ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Entrada inválida: se esperaba ${Ve(n.values[0])}`;return`Opción inválida: se esperaba una de ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Demasiado grande: se esperaba que ${n.origin??"valor"} tuviera ${o}${n.maximum.toString()} ${s.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${n.origin??"valor"} fuera ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Demasiado pequeño: se esperaba que ${n.origin} tuviera ${o}${n.minimum.toString()} ${s.unit}`;return`Demasiado pequeño: se esperaba que ${n.origin} fuera ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Cadena inválida: debe comenzar con "${o.prefix}"`;if(o.format==="ends_with")return`Cadena inválida: debe terminar en "${o.suffix}"`;if(o.format==="includes")return`Cadena inválida: debe incluir "${o.includes}"`;if(o.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${o.pattern}`;return`Inválido ${i[o.format]??n.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${be(n.keys,", ")}`;case"invalid_key":return`Llave inválida en ${n.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${n.origin}`;default:return"Entrada inválida"}}};function hg(){return{localeError:kR()}}var MR=()=>{let e={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"عدد";case"object":{if(Array.isArray(n))return"آرایه";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"};return(n)=>{switch(n.code){case"invalid_type":return`ورودی نامعتبر: میبایست ${n.expected} میبود، ${r(n.input)} دریافت شد`;case"invalid_value":if(n.values.length===1)return`ورودی نامعتبر: میبایست ${Ve(n.values[0])} میبود`;return`گزینه نامعتبر: میبایست یکی از ${be(n.values,"|")} میبود`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`خیلی بزرگ: ${n.origin??"مقدار"} باید ${o}${n.maximum.toString()} ${s.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${n.origin??"مقدار"} باید ${o}${n.maximum.toString()} باشد`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`خیلی کوچک: ${n.origin} باید ${o}${n.minimum.toString()} ${s.unit} باشد`;return`خیلی کوچک: ${n.origin} باید ${o}${n.minimum.toString()} باشد`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`رشته نامعتبر: باید با "${o.prefix}" شروع شود`;if(o.format==="ends_with")return`رشته نامعتبر: باید با "${o.suffix}" تمام شود`;if(o.format==="includes")return`رشته نامعتبر: باید شامل "${o.includes}" باشد`;if(o.format==="regex")return`رشته نامعتبر: باید با الگوی ${o.pattern} مطابقت داشته باشد`;return`${i[o.format]??n.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${n.divisor} باشد`;case"unrecognized_keys":return`کلید${n.keys.length>1?"های":""} ناشناس: ${be(n.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${n.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${n.origin}`;default:return"ورودی نامعتبر"}}};function pg(){return{localeError:MR()}}var ER=()=>{let e={string:{unit:"merkkiä",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äivämäärän"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"säännöllinen lauseke",email:"sähköpostiosoite",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äivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return(n)=>{switch(n.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${n.expected}, oli ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Virheellinen syöte: täytyy olla ${Ve(n.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Liian suuri: ${s.subject} täytyy olla ${o}${n.maximum.toString()} ${s.unit}`.trim();return`Liian suuri: arvon täytyy olla ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Liian pieni: ${s.subject} täytyy olla ${o}${n.minimum.toString()} ${s.unit}`.trim();return`Liian pieni: arvon täytyy olla ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${o.prefix}"`;if(o.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${o.suffix}"`;if(o.format==="includes")return`Virheellinen syöte: täytyy sisältää "${o.includes}"`;if(o.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${o.pattern}`;return`Virheellinen ${i[o.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${be(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öte"}}};function mg(){return{localeError:ER()}}var IR=()=>{let e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"nombre";case"object":{if(Array.isArray(n))return"tableau";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"entrée",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ée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(n)=>{switch(n.code){case"invalid_type":return`Entrée invalide : ${n.expected} attendu, ${r(n.input)} reçu`;case"invalid_value":if(n.values.length===1)return`Entrée invalide : ${Ve(n.values[0])} attendu`;return`Option invalide : une valeur parmi ${be(n.values,"|")} attendue`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Trop grand : ${n.origin??"valeur"} doit ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"élément(s)"}`;return`Trop grand : ${n.origin??"valeur"} doit être ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Trop petit : ${n.origin} doit ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`;return`Trop petit : ${n.origin} doit être ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Chaîne invalide : doit commencer par "${o.prefix}"`;if(o.format==="ends_with")return`Chaîne invalide : doit se terminer par "${o.suffix}"`;if(o.format==="includes")return`Chaîne invalide : doit inclure "${o.includes}"`;if(o.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${o.pattern}`;return`${i[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${n.divisor}`;case"unrecognized_keys":return`Clé${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${be(n.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${n.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entrée invalide"}}};function gg(){return{localeError:IR()}}var $R=()=>{let e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"entrée",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ée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(n)=>{switch(n.code){case"invalid_type":return`Entrée invalide : attendu ${n.expected}, reçu ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Entrée invalide : attendu ${Ve(n.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"≤":"<",s=t(n.origin);if(s)return`Trop grand : attendu que ${n.origin??"la valeur"} ait ${o}${n.maximum.toString()} ${s.unit}`;return`Trop grand : attendu que ${n.origin??"la valeur"} soit ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"≥":">",s=t(n.origin);if(s)return`Trop petit : attendu que ${n.origin} ait ${o}${n.minimum.toString()} ${s.unit}`;return`Trop petit : attendu que ${n.origin} soit ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Chaîne invalide : doit commencer par "${o.prefix}"`;if(o.format==="ends_with")return`Chaîne invalide : doit se terminer par "${o.suffix}"`;if(o.format==="includes")return`Chaîne invalide : doit inclure "${o.includes}"`;if(o.format==="regex")return`Chaîne invalide : doit correspondre au motif ${o.pattern}`;return`${i[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${n.divisor}`;case"unrecognized_keys":return`Clé${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${be(n.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${n.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entrée invalide"}}};function yg(){return{localeError:$R()}}var TR=()=>{let e={string:{unit:"אותיות",verb:"לכלול"},file:{unit:"בייטים",verb:"לכלול"},array:{unit:"פריטים",verb:"לכלול"},set:{unit:"פריטים",verb:"לכלול"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"קלט",email:"כתובת אימייל",url:"כתובת רשת",emoji:"אימוג'י",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"תאריך וזמן ISO",date:"תאריך ISO",time:"זמן ISO",duration:"משך זמן ISO",ipv4:"כתובת IPv4",ipv6:"כתובת IPv6",cidrv4:"טווח IPv4",cidrv6:"טווח IPv6",base64:"מחרוזת בבסיס 64",base64url:"מחרוזת בבסיס 64 לכתובות רשת",json_string:"מחרוזת JSON",e164:"מספר E.164",jwt:"JWT",template_literal:"קלט"};return(n)=>{switch(n.code){case"invalid_type":return`קלט לא תקין: צריך ${n.expected}, התקבל ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`קלט לא תקין: צריך ${Ve(n.values[0])}`;return`קלט לא תקין: צריך אחת מהאפשרויות ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`גדול מדי: ${n.origin??"value"} צריך להיות ${o}${n.maximum.toString()} ${s.unit??"elements"}`;return`גדול מדי: ${n.origin??"value"} צריך להיות ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`קטן מדי: ${n.origin} צריך להיות ${o}${n.minimum.toString()} ${s.unit}`;return`קטן מדי: ${n.origin} צריך להיות ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`מחרוזת לא תקינה: חייבת להתחיל ב"${o.prefix}"`;if(o.format==="ends_with")return`מחרוזת לא תקינה: חייבת להסתיים ב "${o.suffix}"`;if(o.format==="includes")return`מחרוזת לא תקינה: חייבת לכלול "${o.includes}"`;if(o.format==="regex")return`מחרוזת לא תקינה: חייבת להתאים לתבנית ${o.pattern}`;return`${i[o.format]??n.format} לא תקין`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${n.divisor}`;case"unrecognized_keys":return`מפתח${n.keys.length>1?"ות":""} לא מזוה${n.keys.length>1?"ים":"ה"}: ${be(n.keys,", ")}`;case"invalid_key":return`מפתח לא תקין ב${n.origin}`;case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${n.origin}`;default:return"קלט לא תקין"}}};function vg(){return{localeError:TR()}}var PR=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"szám";case"object":{if(Array.isArray(n))return"tömb";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"bemenet",email:"email cím",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őbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"};return(n)=>{switch(n.code){case"invalid_type":return`Érvénytelen bemenet: a várt érték ${n.expected}, a kapott érték ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Érvénytelen bemenet: a várt érték ${Ve(n.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Túl nagy: ${n.origin??"érték"} mérete túl nagy ${o}${n.maximum.toString()} ${s.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${n.origin??"érték"} túl nagy: ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Túl kicsi: a bemeneti érték ${n.origin} mérete túl kicsi ${o}${n.minimum.toString()} ${s.unit}`;return`Túl kicsi: a bemeneti érték ${n.origin} túl kicsi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Érvénytelen string: "${o.prefix}" értékkel kell kezdődnie`;if(o.format==="ends_with")return`Érvénytelen string: "${o.suffix}" értékkel kell végződnie`;if(o.format==="includes")return`Érvénytelen string: "${o.includes}" értéket kell tartalmaznia`;if(o.format==="regex")return`Érvénytelen string: ${o.pattern} mintának kell megfelelnie`;return`Érvénytelen ${i[o.format]??n.format}`}case"not_multiple_of":return`Érvénytelen szám: ${n.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${be(n.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${n.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${n.origin}`;default:return"Érvénytelen bemenet"}}};function bg(){return{localeError:PR()}}var AR=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return(n)=>{switch(n.code){case"invalid_type":return`Input tidak valid: diharapkan ${n.expected}, diterima ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Input tidak valid: diharapkan ${Ve(n.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${o}${n.maximum.toString()} ${s.unit??"elemen"}`;return`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Terlalu kecil: diharapkan ${n.origin} memiliki ${o}${n.minimum.toString()} ${s.unit}`;return`Terlalu kecil: diharapkan ${n.origin} menjadi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`String tidak valid: harus dimulai dengan "${o.prefix}"`;if(o.format==="ends_with")return`String tidak valid: harus berakhir dengan "${o.suffix}"`;if(o.format==="includes")return`String tidak valid: harus menyertakan "${o.includes}"`;if(o.format==="regex")return`String tidak valid: harus sesuai pola ${o.pattern}`;return`${i[o.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${be(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 _g(){return{localeError:AR()}}var RR=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"numero";case"object":{if(Array.isArray(n))return"vettore";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return(n)=>{switch(n.code){case"invalid_type":return`Input non valido: atteso ${n.expected}, ricevuto ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Input non valido: atteso ${Ve(n.values[0])}`;return`Opzione non valida: atteso uno tra ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Troppo grande: ${n.origin??"valore"} deve avere ${o}${n.maximum.toString()} ${s.unit??"elementi"}`;return`Troppo grande: ${n.origin??"valore"} deve essere ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Troppo piccolo: ${n.origin} deve avere ${o}${n.minimum.toString()} ${s.unit}`;return`Troppo piccolo: ${n.origin} deve essere ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Stringa non valida: deve iniziare con "${o.prefix}"`;if(o.format==="ends_with")return`Stringa non valida: deve terminare con "${o.suffix}"`;if(o.format==="includes")return`Stringa non valida: deve includere "${o.includes}"`;if(o.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${o.pattern}`;return`Invalid ${i[o.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${be(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 wg(){return{localeError:RR()}}var CR=()=>{let e={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"数値";case"object":{if(Array.isArray(n))return"配列";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"};return(n)=>{switch(n.code){case"invalid_type":return`無効な入力: ${n.expected}が期待されましたが、${r(n.input)}が入力されました`;case"invalid_value":if(n.values.length===1)return`無効な入力: ${Ve(n.values[0])}が期待されました`;return`無効な選択: ${be(n.values,"、")}のいずれかである必要があります`;case"too_big":{let o=n.inclusive?"以下である":"より小さい",s=t(n.origin);if(s)return`大きすぎる値: ${n.origin??"値"}は${n.maximum.toString()}${s.unit??"要素"}${o}必要があります`;return`大きすぎる値: ${n.origin??"値"}は${n.maximum.toString()}${o}必要があります`}case"too_small":{let o=n.inclusive?"以上である":"より大きい",s=t(n.origin);if(s)return`小さすぎる値: ${n.origin}は${n.minimum.toString()}${s.unit}${o}必要があります`;return`小さすぎる値: ${n.origin}は${n.minimum.toString()}${o}必要があります`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`無効な文字列: "${o.prefix}"で始まる必要があります`;if(o.format==="ends_with")return`無効な文字列: "${o.suffix}"で終わる必要があります`;if(o.format==="includes")return`無効な文字列: "${o.includes}"を含む必要があります`;if(o.format==="regex")return`無効な文字列: パターン${o.pattern}に一致する必要があります`;return`無効な${i[o.format]??n.format}`}case"not_multiple_of":return`無効な数値: ${n.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${n.keys.length>1?"群":""}: ${be(n.keys,"、")}`;case"invalid_key":return`${n.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${n.origin}内の無効な値`;default:return"無効な入力"}}};function Sg(){return{localeError:CR()}}var OR=()=>{let e={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"មិនមែនជាលេខ (NaN)":"លេខ";case"object":{if(Array.isArray(n))return"អារេ (Array)";if(n===null)return"គ្មានតម្លៃ (null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"};return(n)=>{switch(n.code){case"invalid_type":return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${n.expected} ប៉ុន្តែទទួលបាន ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${Ve(n.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`ធំពេក៖ ត្រូវការ ${n.origin??"តម្លៃ"} ${o} ${n.maximum.toString()} ${s.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${n.origin??"តម្លៃ"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`តូចពេក៖ ត្រូវការ ${n.origin} ${o} ${n.minimum.toString()} ${s.unit}`;return`តូចពេក៖ ត្រូវការ ${n.origin} ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${o.prefix}"`;if(o.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${o.suffix}"`;if(o.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${o.includes}"`;if(o.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${o.pattern}`;return`មិនត្រឹមត្រូវ៖ ${i[o.format]??n.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${n.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${be(n.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${n.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${n.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function xg(){return{localeError:OR()}}var DR=()=>{let e={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"};return(n)=>{switch(n.code){case"invalid_type":return`잘못된 입력: 예상 타입은 ${n.expected}, 받은 타입은 ${r(n.input)}입니다`;case"invalid_value":if(n.values.length===1)return`잘못된 입력: 값은 ${Ve(n.values[0])} 이어야 합니다`;return`잘못된 옵션: ${be(n.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let o=n.inclusive?"이하":"미만",s=o==="미만"?"이어야 합니다":"여야 합니다",h=t(n.origin),v=h?.unit??"요소";if(h)return`${n.origin??"값"}이 너무 큽니다: ${n.maximum.toString()}${v} ${o}${s}`;return`${n.origin??"값"}이 너무 큽니다: ${n.maximum.toString()} ${o}${s}`}case"too_small":{let o=n.inclusive?"이상":"초과",s=o==="이상"?"이어야 합니다":"여야 합니다",h=t(n.origin),v=h?.unit??"요소";if(h)return`${n.origin??"값"}이 너무 작습니다: ${n.minimum.toString()}${v} ${o}${s}`;return`${n.origin??"값"}이 너무 작습니다: ${n.minimum.toString()} ${o}${s}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`잘못된 문자열: "${o.prefix}"(으)로 시작해야 합니다`;if(o.format==="ends_with")return`잘못된 문자열: "${o.suffix}"(으)로 끝나야 합니다`;if(o.format==="includes")return`잘못된 문자열: "${o.includes}"을(를) 포함해야 합니다`;if(o.format==="regex")return`잘못된 문자열: 정규식 ${o.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${i[o.format]??n.format}`}case"not_multiple_of":return`잘못된 숫자: ${n.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${be(n.keys,", ")}`;case"invalid_key":return`잘못된 키: ${n.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${n.origin}`;default:return"잘못된 입력"}}};function kg(){return{localeError:DR()}}var NR=()=>{let e={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"број";case"object":{if(Array.isArray(n))return"низа";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"};return(n)=>{switch(n.code){case"invalid_type":return`Грешен внес: се очекува ${n.expected}, примено ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Invalid input: expected ${Ve(n.values[0])}`;return`Грешана опција: се очекува една ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Премногу голем: се очекува ${n.origin??"вредноста"} да има ${o}${n.maximum.toString()} ${s.unit??"елементи"}`;return`Премногу голем: се очекува ${n.origin??"вредноста"} да биде ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Премногу мал: се очекува ${n.origin} да има ${o}${n.minimum.toString()} ${s.unit}`;return`Премногу мал: се очекува ${n.origin} да биде ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Неважечка низа: мора да започнува со "${o.prefix}"`;if(o.format==="ends_with")return`Неважечка низа: мора да завршува со "${o.suffix}"`;if(o.format==="includes")return`Неважечка низа: мора да вклучува "${o.includes}"`;if(o.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${o.pattern}`;return`Invalid ${i[o.format]??n.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${be(n.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${n.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${n.origin}`;default:return"Грешен внес"}}};function Mg(){return{localeError:NR()}}var zR=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"nombor";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return(n)=>{switch(n.code){case"invalid_type":return`Input tidak sah: dijangka ${n.expected}, diterima ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Input tidak sah: dijangka ${Ve(n.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Terlalu besar: dijangka ${n.origin??"nilai"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"elemen"}`;return`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Terlalu kecil: dijangka ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`;return`Terlalu kecil: dijangka ${n.origin} adalah ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`String tidak sah: mesti bermula dengan "${o.prefix}"`;if(o.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${o.suffix}"`;if(o.format==="includes")return`String tidak sah: mesti mengandungi "${o.includes}"`;if(o.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${o.pattern}`;return`${i[o.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${be(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 Eg(){return{localeError:zR()}}var jR=()=>{let e={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"getal";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return(n)=>{switch(n.code){case"invalid_type":return`Ongeldige invoer: verwacht ${n.expected}, ontving ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Ongeldige invoer: verwacht ${Ve(n.values[0])}`;return`Ongeldige optie: verwacht één van ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Te lang: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} ${s.unit??"elementen"} bevat`;return`Te lang: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} is`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Te kort: verwacht dat ${n.origin} ${o}${n.minimum.toString()} ${s.unit} bevat`;return`Te kort: verwacht dat ${n.origin} ${o}${n.minimum.toString()} is`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Ongeldige tekst: moet met "${o.prefix}" beginnen`;if(o.format==="ends_with")return`Ongeldige tekst: moet op "${o.suffix}" eindigen`;if(o.format==="includes")return`Ongeldige tekst: moet "${o.includes}" bevatten`;if(o.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`;return`Ongeldig: ${i[o.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${be(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 Ig(){return{localeError:jR()}}var UR=()=>{let e={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"tall";case"object":{if(Array.isArray(n))return"liste";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return(n)=>{switch(n.code){case"invalid_type":return`Ugyldig input: forventet ${n.expected}, fikk ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Ugyldig verdi: forventet ${Ve(n.values[0])}`;return`Ugyldig valg: forventet en av ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`For stor(t): forventet ${n.origin??"value"} til å ha ${o}${n.maximum.toString()} ${s.unit??"elementer"}`;return`For stor(t): forventet ${n.origin??"value"} til å ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`For lite(n): forventet ${n.origin} til å ha ${o}${n.minimum.toString()} ${s.unit}`;return`For lite(n): forventet ${n.origin} til å ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Ugyldig streng: må starte med "${o.prefix}"`;if(o.format==="ends_with")return`Ugyldig streng: må ende med "${o.suffix}"`;if(o.format==="includes")return`Ugyldig streng: må inneholde "${o.includes}"`;if(o.format==="regex")return`Ugyldig streng: må matche mønsteret ${o.pattern}`;return`Ugyldig ${i[o.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${be(n.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};function $g(){return{localeError:UR()}}var LR=()=>{let e={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"numara";case"object":{if(Array.isArray(n))return"saf";if(n===null)return"gayb";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"giren",email:"epostagâh",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âmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"};return(n)=>{switch(n.code){case"invalid_type":return`Fâsit giren: umulan ${n.expected}, alınan ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Fâsit giren: umulan ${Ve(n.values[0])}`;return`Fâsit tercih: mûteberler ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Fazla büyük: ${n.origin??"value"}, ${o}${n.maximum.toString()} ${s.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${n.origin??"value"}, ${o}${n.maximum.toString()} olmalıydı.`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Fazla küçük: ${n.origin}, ${o}${n.minimum.toString()} ${s.unit} sahip olmalıydı.`;return`Fazla küçük: ${n.origin}, ${o}${n.minimum.toString()} olmalıydı.`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Fâsit metin: "${o.prefix}" ile başlamalı.`;if(o.format==="ends_with")return`Fâsit metin: "${o.suffix}" ile bitmeli.`;if(o.format==="includes")return`Fâsit metin: "${o.includes}" ihtivâ etmeli.`;if(o.format==="regex")return`Fâsit metin: ${o.pattern} nakşına uymalı.`;return`Fâsit ${i[o.format]??n.format}`}case"not_multiple_of":return`Fâsit sayı: ${n.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${n.keys.length>1?"s":""}: ${be(n.keys,", ")}`;case"invalid_key":return`${n.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${n.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function Tg(){return{localeError:LR()}}var FR=()=>{let e={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"عدد";case"object":{if(Array.isArray(n))return"ارې";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"};return(n)=>{switch(n.code){case"invalid_type":return`ناسم ورودي: باید ${n.expected} وای, مګر ${r(n.input)} ترلاسه شو`;case"invalid_value":if(n.values.length===1)return`ناسم ورودي: باید ${Ve(n.values[0])} وای`;return`ناسم انتخاب: باید یو له ${be(n.values,"|")} څخه وای`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`ډیر لوی: ${n.origin??"ارزښت"} باید ${o}${n.maximum.toString()} ${s.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${n.origin??"ارزښت"} باید ${o}${n.maximum.toString()} وي`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`ډیر کوچنی: ${n.origin} باید ${o}${n.minimum.toString()} ${s.unit} ولري`;return`ډیر کوچنی: ${n.origin} باید ${o}${n.minimum.toString()} وي`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`ناسم متن: باید د "${o.prefix}" سره پیل شي`;if(o.format==="ends_with")return`ناسم متن: باید د "${o.suffix}" سره پای ته ورسيږي`;if(o.format==="includes")return`ناسم متن: باید "${o.includes}" ولري`;if(o.format==="regex")return`ناسم متن: باید د ${o.pattern} سره مطابقت ولري`;return`${i[o.format]??n.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${n.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${n.keys.length>1?"کلیډونه":"کلیډ"}: ${be(n.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${n.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${n.origin} کې`;default:return"ناسمه ورودي"}}};function Pg(){return{localeError:FR()}}var qR=()=>{let e={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"liczba";case"object":{if(Array.isArray(n))return"tablica";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"wyrażenie",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ąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"};return(n)=>{switch(n.code){case"invalid_type":return`Nieprawidłowe dane wejściowe: oczekiwano ${n.expected}, otrzymano ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${Ve(n.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Za duża wartość: oczekiwano, że ${n.origin??"wartość"} będzie mieć ${o}${n.maximum.toString()} ${s.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${n.origin??"wartość"} będzie wynosić ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Za mała wartość: oczekiwano, że ${n.origin??"wartość"} będzie mieć ${o}${n.minimum.toString()} ${s.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${n.origin??"wartość"} będzie wynosić ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${o.prefix}"`;if(o.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${o.suffix}"`;if(o.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${o.includes}"`;if(o.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${o.pattern}`;return`Nieprawidłow(y/a/e) ${i[o.format]??n.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${be(n.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${n.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${n.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function Ag(){return{localeError:qR()}}var BR=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"número";case"object":{if(Array.isArray(n))return"array";if(n===null)return"nulo";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"padrão",email:"endereço 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ção ISO",ipv4:"endereço IPv4",ipv6:"endereço 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úmero E.164",jwt:"JWT",template_literal:"entrada"};return(n)=>{switch(n.code){case"invalid_type":return`Tipo inválido: esperado ${n.expected}, recebido ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Entrada inválida: esperado ${Ve(n.values[0])}`;return`Opção inválida: esperada uma das ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Muito grande: esperado que ${n.origin??"valor"} tivesse ${o}${n.maximum.toString()} ${s.unit??"elementos"}`;return`Muito grande: esperado que ${n.origin??"valor"} fosse ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Muito pequeno: esperado que ${n.origin} tivesse ${o}${n.minimum.toString()} ${s.unit}`;return`Muito pequeno: esperado que ${n.origin} fosse ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Texto inválido: deve começar com "${o.prefix}"`;if(o.format==="ends_with")return`Texto inválido: deve terminar com "${o.suffix}"`;if(o.format==="includes")return`Texto inválido: deve incluir "${o.includes}"`;if(o.format==="regex")return`Texto inválido: deve corresponder ao padrão ${o.pattern}`;return`${i[o.format]??n.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${be(n.keys,", ")}`;case"invalid_key":return`Chave inválida em ${n.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${n.origin}`;default:return"Campo inválido"}}};function Rg(){return{localeError:BR()}}function US(e,t,r,i){let n=Math.abs(e),o=n%10,s=n%100;if(s>=11&&s<=19)return i;if(o===1)return t;if(o>=2&&o<=4)return r;return i}var HR=()=>{let e={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"число";case"object":{if(Array.isArray(n))return"массив";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"};return(n)=>{switch(n.code){case"invalid_type":return`Неверный ввод: ожидалось ${n.expected}, получено ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Неверный ввод: ожидалось ${Ve(n.values[0])}`;return`Неверный вариант: ожидалось одно из ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s){let h=Number(n.maximum),v=US(h,s.unit.one,s.unit.few,s.unit.many);return`Слишком большое значение: ожидалось, что ${n.origin??"значение"} будет иметь ${o}${n.maximum.toString()} ${v}`}return`Слишком большое значение: ожидалось, что ${n.origin??"значение"} будет ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s){let h=Number(n.minimum),v=US(h,s.unit.one,s.unit.few,s.unit.many);return`Слишком маленькое значение: ожидалось, что ${n.origin} будет иметь ${o}${n.minimum.toString()} ${v}`}return`Слишком маленькое значение: ожидалось, что ${n.origin} будет ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Неверная строка: должна начинаться с "${o.prefix}"`;if(o.format==="ends_with")return`Неверная строка: должна заканчиваться на "${o.suffix}"`;if(o.format==="includes")return`Неверная строка: должна содержать "${o.includes}"`;if(o.format==="regex")return`Неверная строка: должна соответствовать шаблону ${o.pattern}`;return`Неверный ${i[o.format]??n.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${n.divisor}`;case"unrecognized_keys":return`Нераспознанн${n.keys.length>1?"ые":"ый"} ключ${n.keys.length>1?"и":""}: ${be(n.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${n.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${n.origin}`;default:return"Неверные входные данные"}}};function Cg(){return{localeError:HR()}}var ZR=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"število";case"object":{if(Array.isArray(n))return"tabela";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"vnos",email:"e-poštni 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 čas",date:"ISO datum",time:"ISO čas",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 številka",jwt:"JWT",template_literal:"vnos"};return(n)=>{switch(n.code){case"invalid_type":return`Neveljaven vnos: pričakovano ${n.expected}, prejeto ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Neveljaven vnos: pričakovano ${Ve(n.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Preveliko: pričakovano, da bo ${n.origin??"vrednost"} imelo ${o}${n.maximum.toString()} ${s.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${n.origin??"vrednost"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Premajhno: pričakovano, da bo ${n.origin} imelo ${o}${n.minimum.toString()} ${s.unit}`;return`Premajhno: pričakovano, da bo ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Neveljaven niz: mora se začeti z "${o.prefix}"`;if(o.format==="ends_with")return`Neveljaven niz: mora se končati z "${o.suffix}"`;if(o.format==="includes")return`Neveljaven niz: mora vsebovati "${o.includes}"`;if(o.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`;return`Neveljaven ${i[o.format]??n.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i ključi":" ključ"}: ${be(n.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};function Og(){return{localeError:ZR()}}var KR=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"antal";case"object":{if(Array.isArray(n))return"lista";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"reguljärt 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äng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return(n)=>{switch(n.code){case"invalid_type":return`Ogiltig inmatning: förväntat ${n.expected}, fick ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Ogiltig inmatning: förväntat ${Ve(n.values[0])}`;return`Ogiltigt val: förväntade en av ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`För stor(t): förväntade ${n.origin??"värdet"} att ha ${o}${n.maximum.toString()} ${s.unit??"element"}`;return`För stor(t): förväntat ${n.origin??"värdet"} att ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`För lite(t): förväntade ${n.origin??"värdet"} att ha ${o}${n.minimum.toString()} ${s.unit}`;return`För lite(t): förväntade ${n.origin??"värdet"} att ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Ogiltig sträng: måste börja med "${o.prefix}"`;if(o.format==="ends_with")return`Ogiltig sträng: måste sluta med "${o.suffix}"`;if(o.format==="includes")return`Ogiltig sträng: måste innehålla "${o.includes}"`;if(o.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${o.pattern}"`;return`Ogiltig(t) ${i[o.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${be(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${n.origin??"värdet"}`;default:return"Ogiltig input"}}};function Dg(){return{localeError:KR()}}var VR=()=>{let e={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"எண் அல்லாதது":"எண்";case"object":{if(Array.isArray(n))return"அணி";if(n===null)return"வெறுமை";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"உள்ளீடு",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:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"};return(n)=>{switch(n.code){case"invalid_type":return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${n.expected}, பெறப்பட்டது ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${Ve(n.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${be(n.values,"|")} இல் ஒன்று`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${n.origin??"மதிப்பு"} ${o}${n.maximum.toString()} ${s.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${n.origin??"மதிப்பு"} ${o}${n.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${n.origin} ${o}${n.minimum.toString()} ${s.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${n.origin} ${o}${n.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`தவறான சரம்: "${o.prefix}" இல் தொடங்க வேண்டும்`;if(o.format==="ends_with")return`தவறான சரம்: "${o.suffix}" இல் முடிவடைய வேண்டும்`;if(o.format==="includes")return`தவறான சரம்: "${o.includes}" ஐ உள்ளடக்க வேண்டும்`;if(o.format==="regex")return`தவறான சரம்: ${o.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${i[o.format]??n.format}`}case"not_multiple_of":return`தவறான எண்: ${n.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${n.keys.length>1?"கள்":""}: ${be(n.keys,", ")}`;case"invalid_key":return`${n.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${n.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function Ng(){return{localeError:VR()}}var WR=()=>{let e={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"ไม่ใช่ตัวเลข (NaN)":"ตัวเลข";case"object":{if(Array.isArray(n))return"อาร์เรย์ (Array)";if(n===null)return"ไม่มีค่า (null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"};return(n)=>{switch(n.code){case"invalid_type":return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${n.expected} แต่ได้รับ ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${Ve(n.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"ไม่เกิน":"น้อยกว่า",s=t(n.origin);if(s)return`เกินกำหนด: ${n.origin??"ค่า"} ควรมี${o} ${n.maximum.toString()} ${s.unit??"รายการ"}`;return`เกินกำหนด: ${n.origin??"ค่า"} ควรมี${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"อย่างน้อย":"มากกว่า",s=t(n.origin);if(s)return`น้อยกว่ากำหนด: ${n.origin} ควรมี${o} ${n.minimum.toString()} ${s.unit}`;return`น้อยกว่ากำหนด: ${n.origin} ควรมี${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${o.prefix}"`;if(o.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${o.suffix}"`;if(o.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${o.includes}" อยู่ในข้อความ`;if(o.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${o.pattern}`;return`รูปแบบไม่ถูกต้อง: ${i[o.format]??n.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${n.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${be(n.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${n.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${n.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function zg(){return{localeError:WR()}}var GR=(e)=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},JR=()=>{let e={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function t(i){return e[i]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"};return(i)=>{switch(i.code){case"invalid_type":return`Geçersiz değer: beklenen ${i.expected}, alınan ${GR(i.input)}`;case"invalid_value":if(i.values.length===1)return`Geçersiz değer: beklenen ${Ve(i.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${be(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`Çok büyük: beklenen ${i.origin??"değer"} ${n}${i.maximum.toString()} ${o.unit??"öğe"}`;return`Çok büyük: beklenen ${i.origin??"değer"} ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`Çok küçük: beklenen ${i.origin} ${n}${i.minimum.toString()} ${o.unit}`;return`Çok küçük: beklenen ${i.origin} ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Geçersiz metin: "${n.prefix}" ile başlamalı`;if(n.format==="ends_with")return`Geçersiz metin: "${n.suffix}" ile bitmeli`;if(n.format==="includes")return`Geçersiz metin: "${n.includes}" içermeli`;if(n.format==="regex")return`Geçersiz metin: ${n.pattern} desenine uymalı`;return`Geçersiz ${r[n.format]??i.format}`}case"not_multiple_of":return`Geçersiz sayı: ${i.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${i.keys.length>1?"lar":""}: ${be(i.keys,", ")}`;case"invalid_key":return`${i.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${i.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function jg(){return{localeError:JR()}}var XR=()=>{let e={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"число";case"object":{if(Array.isArray(n))return"масив";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"};return(n)=>{switch(n.code){case"invalid_type":return`Неправильні вхідні дані: очікується ${n.expected}, отримано ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Неправильні вхідні дані: очікується ${Ve(n.values[0])}`;return`Неправильна опція: очікується одне з ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Занадто велике: очікується, що ${n.origin??"значення"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"елементів"}`;return`Занадто велике: очікується, що ${n.origin??"значення"} буде ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Занадто мале: очікується, що ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`;return`Занадто мале: очікується, що ${n.origin} буде ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Неправильний рядок: повинен починатися з "${o.prefix}"`;if(o.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${o.suffix}"`;if(o.format==="includes")return`Неправильний рядок: повинен містити "${o.includes}"`;if(o.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${o.pattern}`;return`Неправильний ${i[o.format]??n.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${n.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${n.keys.length>1?"і":""}: ${be(n.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${n.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${n.origin}`;default:return"Неправильні вхідні дані"}}};function Ug(){return{localeError:XR()}}var YR=()=>{let e={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"نمبر";case"object":{if(Array.isArray(n))return"آرے";if(n===null)return"نل";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"};return(n)=>{switch(n.code){case"invalid_type":return`غلط ان پٹ: ${n.expected} متوقع تھا، ${r(n.input)} موصول ہوا`;case"invalid_value":if(n.values.length===1)return`غلط ان پٹ: ${Ve(n.values[0])} متوقع تھا`;return`غلط آپشن: ${be(n.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`بہت بڑا: ${n.origin??"ویلیو"} کے ${o}${n.maximum.toString()} ${s.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${n.origin??"ویلیو"} کا ${o}${n.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`بہت چھوٹا: ${n.origin} کے ${o}${n.minimum.toString()} ${s.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${n.origin} کا ${o}${n.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`غلط سٹرنگ: "${o.prefix}" سے شروع ہونا چاہیے`;if(o.format==="ends_with")return`غلط سٹرنگ: "${o.suffix}" پر ختم ہونا چاہیے`;if(o.format==="includes")return`غلط سٹرنگ: "${o.includes}" شامل ہونا چاہیے`;if(o.format==="regex")return`غلط سٹرنگ: پیٹرن ${o.pattern} سے میچ ہونا چاہیے`;return`غلط ${i[o.format]??n.format}`}case"not_multiple_of":return`غلط نمبر: ${n.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${n.keys.length>1?"ز":""}: ${be(n.keys,"، ")}`;case"invalid_key":return`${n.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${n.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function Lg(){return{localeError:YR()}}var QR=()=>{let e={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"số";case"object":{if(Array.isArray(n))return"mảng";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"đầu vào",email:"địa chỉ 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ày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"};return(n)=>{switch(n.code){case"invalid_type":return`Đầu vào không hợp lệ: mong đợi ${n.expected}, nhận được ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${Ve(n.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Quá lớn: mong đợi ${n.origin??"giá trị"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"phần tử"}`;return`Quá lớn: mong đợi ${n.origin??"giá trị"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Quá nhỏ: mong đợi ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`;return`Quá nhỏ: mong đợi ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${o.prefix}"`;if(o.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${o.suffix}"`;if(o.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${o.includes}"`;if(o.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${o.pattern}`;return`${i[o.format]??n.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${n.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${be(n.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${n.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${n.origin}`;default:return"Đầu vào không hợp lệ"}}};function Fg(){return{localeError:QR()}}var e9=()=>{let e={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"非数字(NaN)":"数字";case"object":{if(Array.isArray(n))return"数组";if(n===null)return"空值(null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"};return(n)=>{switch(n.code){case"invalid_type":return`无效输入:期望 ${n.expected},实际接收 ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`无效输入:期望 ${Ve(n.values[0])}`;return`无效选项:期望以下之一 ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`数值过大:期望 ${n.origin??"值"} ${o}${n.maximum.toString()} ${s.unit??"个元素"}`;return`数值过大:期望 ${n.origin??"值"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`数值过小:期望 ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`;return`数值过小:期望 ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`无效字符串:必须以 "${o.prefix}" 开头`;if(o.format==="ends_with")return`无效字符串:必须以 "${o.suffix}" 结尾`;if(o.format==="includes")return`无效字符串:必须包含 "${o.includes}"`;if(o.format==="regex")return`无效字符串:必须满足正则表达式 ${o.pattern}`;return`无效${i[o.format]??n.format}`}case"not_multiple_of":return`无效数字:必须是 ${n.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${be(n.keys,", ")}`;case"invalid_key":return`${n.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${n.origin} 中包含无效值(value)`;default:return"无效输入"}}};function qg(){return{localeError:e9()}}var t9=()=>{let e={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"輸入",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:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"};return(n)=>{switch(n.code){case"invalid_type":return`無效的輸入值:預期為 ${n.expected},但收到 ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`無效的輸入值:預期為 ${Ve(n.values[0])}`;return`無效的選項:預期為以下其中之一 ${be(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`數值過大:預期 ${n.origin??"值"} 應為 ${o}${n.maximum.toString()} ${s.unit??"個元素"}`;return`數值過大:預期 ${n.origin??"值"} 應為 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`數值過小:預期 ${n.origin} 應為 ${o}${n.minimum.toString()} ${s.unit}`;return`數值過小:預期 ${n.origin} 應為 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`無效的字串:必須以 "${o.prefix}" 開頭`;if(o.format==="ends_with")return`無效的字串:必須以 "${o.suffix}" 結尾`;if(o.format==="includes")return`無效的字串:必須包含 "${o.includes}"`;if(o.format==="regex")return`無效的字串:必須符合格式 ${o.pattern}`;return`無效的 ${i[o.format]??n.format}`}case"not_multiple_of":return`無效的數字:必須為 ${n.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${n.keys.length>1?"們":""}:${be(n.keys,"、")}`;case"invalid_key":return`${n.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${n.origin} 中有無效的值`;default:return"無效的輸入值"}}};function Bg(){return{localeError:t9()}}var af=Symbol("ZodOutput"),uf=Symbol("ZodInput");class Ka{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&typeof r==="object"&&"id"in r){if(this._idmap.has(r.id))throw Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,e)}return this}remove(e){return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};return delete r.id,{...r,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}}function Va(){return new Ka}var tn=Va();function lf(e,t){return new e({type:"string",...Fe(t)})}function Hg(e,t){return new e({type:"string",coerce:!0,...Fe(t)})}function Wa(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Fe(t)})}function bs(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Fe(t)})}function Ga(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Fe(t)})}function Ja(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Fe(t)})}function Xa(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Fe(t)})}function Ya(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Fe(t)})}function Qa(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Fe(t)})}function eu(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Fe(t)})}function tu(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Fe(t)})}function ru(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Fe(t)})}function nu(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Fe(t)})}function iu(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Fe(t)})}function ou(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Fe(t)})}function su(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Fe(t)})}function au(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Fe(t)})}function uu(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Fe(t)})}function lu(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Fe(t)})}function cu(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Fe(t)})}function du(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Fe(t)})}function fu(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Fe(t)})}function hu(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Fe(t)})}function pu(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Fe(t)})}var cf={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Zg(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Fe(t)})}function Kg(e,t){return new e({type:"string",format:"date",check:"string_format",...Fe(t)})}function Vg(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Fe(t)})}function Wg(e,t){return new e({type:"string",format:"duration",check:"string_format",...Fe(t)})}function df(e,t){return new e({type:"number",checks:[],...Fe(t)})}function Gg(e,t){return new e({type:"number",coerce:!0,checks:[],...Fe(t)})}function ff(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Fe(t)})}function hf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...Fe(t)})}function pf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...Fe(t)})}function mf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...Fe(t)})}function gf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...Fe(t)})}function yf(e,t){return new e({type:"boolean",...Fe(t)})}function Jg(e,t){return new e({type:"boolean",coerce:!0,...Fe(t)})}function vf(e,t){return new e({type:"bigint",...Fe(t)})}function Xg(e,t){return new e({type:"bigint",coerce:!0,...Fe(t)})}function bf(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Fe(t)})}function _f(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Fe(t)})}function wf(e,t){return new e({type:"symbol",...Fe(t)})}function Sf(e,t){return new e({type:"undefined",...Fe(t)})}function xf(e,t){return new e({type:"null",...Fe(t)})}function kf(e){return new e({type:"any"})}function Mo(e){return new e({type:"unknown"})}function Mf(e,t){return new e({type:"never",...Fe(t)})}function Ef(e,t){return new e({type:"void",...Fe(t)})}function If(e,t){return new e({type:"date",...Fe(t)})}function Yg(e,t){return new e({type:"date",coerce:!0,...Fe(t)})}function $f(e,t){return new e({type:"nan",...Fe(t)})}function ci(e,t){return new od({check:"less_than",...Fe(t),value:e,inclusive:!1})}function kn(e,t){return new od({check:"less_than",...Fe(t),value:e,inclusive:!0})}function di(e,t){return new sd({check:"greater_than",...Fe(t),value:e,inclusive:!1})}function rn(e,t){return new sd({check:"greater_than",...Fe(t),value:e,inclusive:!0})}function Qg(e){return di(0,e)}function ey(e){return ci(0,e)}function ty(e){return kn(0,e)}function ry(e){return rn(0,e)}function Eo(e,t){return new D0({check:"multiple_of",...Fe(t),value:e})}function _s(e,t){return new j0({check:"max_size",...Fe(t),maximum:e})}function Io(e,t){return new U0({check:"min_size",...Fe(t),minimum:e})}function mu(e,t){return new L0({check:"size_equals",...Fe(t),size:e})}function ws(e,t){return new F0({check:"max_length",...Fe(t),maximum:e})}function Hi(e,t){return new q0({check:"min_length",...Fe(t),minimum:e})}function Ss(e,t){return new B0({check:"length_equals",...Fe(t),length:e})}function gu(e,t){return new H0({check:"string_format",format:"regex",...Fe(t),pattern:e})}function yu(e){return new Z0({check:"string_format",format:"lowercase",...Fe(e)})}function vu(e){return new K0({check:"string_format",format:"uppercase",...Fe(e)})}function bu(e,t){return new V0({check:"string_format",format:"includes",...Fe(t),includes:e})}function _u(e,t){return new W0({check:"string_format",format:"starts_with",...Fe(t),prefix:e})}function wu(e,t){return new G0({check:"string_format",format:"ends_with",...Fe(t),suffix:e})}function ny(e,t,r){return new J0({check:"property",property:e,schema:t,...Fe(r)})}function Su(e,t){return new X0({check:"mime_type",mime:e,...Fe(t)})}function fi(e){return new Y0({check:"overwrite",tx:e})}function xu(e){return fi((t)=>t.normalize(e))}function ku(){return fi((e)=>e.trim())}function Mu(){return fi((e)=>e.toLowerCase())}function Eu(){return fi((e)=>e.toUpperCase())}function Iu(e,t,r){return new e({type:"array",element:t,...Fe(r)})}function r9(e,t,r){return new e({type:"union",options:t,...Fe(r)})}function n9(e,t,r,i){return new e({type:"union",options:r,discriminator:t,...Fe(i)})}function i9(e,t,r){return new e({type:"intersection",left:t,right:r})}function iy(e,t,r,i){let n=r instanceof ut;return new e({type:"tuple",items:t,rest:n?r:null,...Fe(n?i:r)})}function o9(e,t,r,i){return new e({type:"record",keyType:t,valueType:r,...Fe(i)})}function s9(e,t,r,i){return new e({type:"map",keyType:t,valueType:r,...Fe(i)})}function a9(e,t,r){return new e({type:"set",valueType:t,...Fe(r)})}function u9(e,t,r){let i=Array.isArray(t)?Object.fromEntries(t.map((n)=>[n,n])):t;return new e({type:"enum",entries:i,...Fe(r)})}function l9(e,t,r){return new e({type:"enum",entries:t,...Fe(r)})}function c9(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...Fe(r)})}function Tf(e,t){return new e({type:"file",...Fe(t)})}function d9(e,t){return new e({type:"transform",transform:t})}function f9(e,t){return new e({type:"optional",innerType:t})}function h9(e,t){return new e({type:"nullable",innerType:t})}function p9(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r==="function"?r():r}})}function m9(e,t,r){return new e({type:"nonoptional",innerType:t,...Fe(r)})}function g9(e,t){return new e({type:"success",innerType:t})}function y9(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r==="function"?r:()=>r})}function v9(e,t,r){return new e({type:"pipe",in:t,out:r})}function b9(e,t){return new e({type:"readonly",innerType:t})}function _9(e,t,r){return new e({type:"template_literal",parts:t,...Fe(r)})}function w9(e,t){return new e({type:"lazy",getter:t})}function S9(e,t){return new e({type:"promise",innerType:t})}function Pf(e,t,r){let i=Fe(r);return i.abort??(i.abort=!0),new e({type:"custom",check:"custom",fn:t,...i})}function Af(e,t,r){return new e({type:"custom",check:"custom",fn:t,...Fe(r)})}function Rf(e,t){let r=Fe(t),i=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];if(r.case!=="sensitive")i=i.map((M)=>typeof M==="string"?M.toLowerCase():M),n=n.map((M)=>typeof M==="string"?M.toLowerCase():M);let o=new Set(i),s=new Set(n),h=e.Pipe??ys,v=e.Boolean??ps,b=e.String??qi,g=new(e.Transform??gs)({type:"transform",transform:(M,I)=>{let $=M;if(r.case!=="sensitive")$=$.toLowerCase();if(o.has($))return!0;else if(s.has($))return!1;else return I.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:I.value,inst:g}),{}},error:r.error}),S=new h({type:"pipe",in:new b({type:"string",error:r.error}),out:g,error:r.error});return new h({type:"pipe",in:S,out:new v({type:"boolean",error:r.error}),error:r.error})}function Cf(e,t,r,i={}){let n=Fe(i),o={...Fe(i),check:"string_format",type:"string",format:t,fn:typeof r==="function"?r:(h)=>r.test(h),...n};if(r instanceof RegExp)o.pattern=r;return new e(o)}class oy{constructor(e){this._def=e,this.def=e}implement(e){if(typeof e!=="function")throw Error("implement() must be called with a function");let t=(...r)=>{let i=this._def.input?wo(this._def.input,r,void 0,{callee:t}):r;if(!Array.isArray(i))throw Error("Invalid arguments schema: not an array or tuple schema.");let n=e(...i);return this._def.output?wo(this._def.output,n,void 0,{callee:t}):n};return t}implementAsync(e){if(typeof e!=="function")throw Error("implement() must be called with a function");let t=async(...r)=>{let i=this._def.input?await So(this._def.input,r,void 0,{callee:t}):r;if(!Array.isArray(i))throw Error("Invalid arguments schema: not an array or tuple schema.");let n=await e(...i);return this._def.output?So(this._def.output,n,void 0,{callee:t}):n};return t}input(...e){let t=this.constructor;if(Array.isArray(e[0]))return new t({type:"function",input:new Bi({type:"tuple",items:e[0],rest:e[1]}),output:this._def.output});return new t({type:"function",input:e[0],output:this._def.output})}output(e){return new this.constructor({type:"function",input:this._def.input,output:e})}}function Of(e){return new oy({type:"function",input:Array.isArray(e?.input)?iy(Bi,e?.input):e?.input??Iu(ms,Mo(ko)),output:e?.output??Mo(ko)})}class Df{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??tn,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,t={path:[],schemaPath:[]}){var r;let i=e._zod.def,n={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},o=this.seen.get(e);if(o){if(o.count++,t.schemaPath.includes(e))o.cycle=t.path;return o.schema}let s={schema:{},count:1,cycle:void 0,path:t.path};this.seen.set(e,s);let h=e._zod.toJSONSchema?.();if(h)s.schema=h;else{let _={...t,schemaPath:[...t.schemaPath,e],path:t.path},g=e._zod.parent;if(g)s.ref=g,this.process(g,_),this.seen.get(g).isParent=!0;else{let S=s.schema;switch(i.type){case"string":{let x=S;x.type="string";let{minimum:M,maximum:I,format:$,patterns:T,contentEncoding:P}=e._zod.bag;if(typeof M==="number")x.minLength=M;if(typeof I==="number")x.maxLength=I;if($){if(x.format=n[$]??$,x.format==="")delete x.format}if(P)x.contentEncoding=P;if(T&&T.size>0){let R=[...T];if(R.length===1)x.pattern=R[0].source;else if(R.length>1)s.schema.allOf=[...R.map((C)=>({...this.target==="draft-7"?{type:"string"}:{},pattern:C.source}))]}break}case"number":{let x=S,{minimum:M,maximum:I,format:$,multipleOf:T,exclusiveMaximum:P,exclusiveMinimum:R}=e._zod.bag;if(typeof $==="string"&&$.includes("int"))x.type="integer";else x.type="number";if(typeof R==="number")x.exclusiveMinimum=R;if(typeof M==="number"){if(x.minimum=M,typeof R==="number")if(R>=M)delete x.minimum;else delete x.exclusiveMinimum}if(typeof P==="number")x.exclusiveMaximum=P;if(typeof I==="number"){if(x.maximum=I,typeof P==="number")if(P<=I)delete x.maximum;else delete x.exclusiveMaximum}if(typeof T==="number")x.multipleOf=T;break}case"boolean":{let x=S;x.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema");break}case"null":{S.type="null";break}case"any":break;case"unknown":break;case"undefined":case"never":{S.not={};break}case"void":{if(this.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema");break}case"date":{if(this.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema");break}case"array":{let x=S,{minimum:M,maximum:I}=e._zod.bag;if(typeof M==="number")x.minItems=M;if(typeof I==="number")x.maxItems=I;x.type="array",x.items=this.process(i.element,{..._,path:[..._.path,"items"]});break}case"object":{let x=S;x.type="object",x.properties={};let M=i.shape;for(let T in M)x.properties[T]=this.process(M[T],{..._,path:[..._.path,"properties",T]});let I=new Set(Object.keys(M)),$=new Set([...I].filter((T)=>{let P=i.shape[T]._zod;if(this.io==="input")return P.optin===void 0;else return P.optout===void 0}));if($.size>0)x.required=Array.from($);if(i.catchall?._zod.def.type==="never")x.additionalProperties=!1;else if(!i.catchall){if(this.io==="output")x.additionalProperties=!1}else if(i.catchall)x.additionalProperties=this.process(i.catchall,{..._,path:[..._.path,"additionalProperties"]});break}case"union":{let x=S;x.anyOf=i.options.map((M,I)=>this.process(M,{..._,path:[..._.path,"anyOf",I]}));break}case"intersection":{let x=S,M=this.process(i.left,{..._,path:[..._.path,"allOf",0]}),I=this.process(i.right,{..._,path:[..._.path,"allOf",1]}),$=(P)=>("allOf"in P)&&Object.keys(P).length===1,T=[...$(M)?M.allOf:[M],...$(I)?I.allOf:[I]];x.allOf=T;break}case"tuple":{let x=S;x.type="array";let M=i.items.map((T,P)=>this.process(T,{..._,path:[..._.path,"prefixItems",P]}));if(this.target==="draft-2020-12")x.prefixItems=M;else x.items=M;if(i.rest){let T=this.process(i.rest,{..._,path:[..._.path,"items"]});if(this.target==="draft-2020-12")x.items=T;else x.additionalItems=T}if(i.rest)x.items=this.process(i.rest,{..._,path:[..._.path,"items"]});let{minimum:I,maximum:$}=e._zod.bag;if(typeof I==="number")x.minItems=I;if(typeof $==="number")x.maxItems=$;break}case"record":{let x=S;x.type="object",x.propertyNames=this.process(i.keyType,{..._,path:[..._.path,"propertyNames"]}),x.additionalProperties=this.process(i.valueType,{..._,path:[..._.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema");break}case"enum":{let x=S,M=Oa(i.entries);if(M.every((I)=>typeof I==="number"))x.type="number";if(M.every((I)=>typeof I==="string"))x.type="string";x.enum=M;break}case"literal":{let x=S,M=[];for(let I of i.values)if(I===void 0){if(this.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof I==="bigint")if(this.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else M.push(Number(I));else M.push(I);if(M.length===0);else if(M.length===1){let I=M[0];x.type=I===null?"null":typeof I,x.const=I}else{if(M.every((I)=>typeof I==="number"))x.type="number";if(M.every((I)=>typeof I==="string"))x.type="string";if(M.every((I)=>typeof I==="boolean"))x.type="string";if(M.every((I)=>I===null))x.type="null";x.enum=M}break}case"file":{let x=S,M={type:"string",format:"binary",contentEncoding:"binary"},{minimum:I,maximum:$,mime:T}=e._zod.bag;if(I!==void 0)M.minLength=I;if($!==void 0)M.maxLength=$;if(T)if(T.length===1)M.contentMediaType=T[0],Object.assign(x,M);else x.anyOf=T.map((P)=>({...M,contentMediaType:P}));else Object.assign(x,M);break}case"transform":{if(this.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let x=this.process(i.innerType,_);S.anyOf=[x,{type:"null"}];break}case"nonoptional":{this.process(i.innerType,_),s.ref=i.innerType;break}case"success":{let x=S;x.type="boolean";break}case"default":{this.process(i.innerType,_),s.ref=i.innerType,S.default=JSON.parse(JSON.stringify(i.defaultValue));break}case"prefault":{if(this.process(i.innerType,_),s.ref=i.innerType,this.io==="input")S._prefault=JSON.parse(JSON.stringify(i.defaultValue));break}case"catch":{this.process(i.innerType,_),s.ref=i.innerType;let x;try{x=i.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}S.default=x;break}case"nan":{if(this.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let x=S,M=e._zod.pattern;if(!M)throw Error("Pattern not found in template literal");x.type="string",x.pattern=M.source;break}case"pipe":{let x=this.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;this.process(x,_),s.ref=x;break}case"readonly":{this.process(i.innerType,_),s.ref=i.innerType,S.readOnly=!0;break}case"promise":{this.process(i.innerType,_),s.ref=i.innerType;break}case"optional":{this.process(i.innerType,_),s.ref=i.innerType;break}case"lazy":{let x=e._zod.innerType;this.process(x,_),s.ref=x;break}case"custom":{if(this.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema");break}default:}}}let v=this.metadataRegistry.get(e);if(v)Object.assign(s.schema,v);if(this.io==="input"&&_r(e))delete s.schema.examples,delete s.schema.default;if(this.io==="input"&&s.schema._prefault)(r=s.schema).default??(r.default=s.schema._prefault);return delete s.schema._prefault,this.seen.get(e).schema}emit(e,t){let r={cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0},i=this.seen.get(e);if(!i)throw Error("Unprocessed schema. This is a bug in Zod.");let n=(b)=>{let _=this.target==="draft-2020-12"?"$defs":"definitions";if(r.external){let M=r.external.registry.get(b[0])?.id;if(M)return{ref:r.external.uri(M)};let I=b[1].defId??b[1].schema.id??`schema${this.counter++}`;return b[1].defId=I,{defId:I,ref:`${r.external.uri("__shared")}#/${_}/${I}`}}if(b[1]===i)return{ref:"#"};let S=`${"#"}/${_}/`,x=b[1].schema.id??`__schema${this.counter++}`;return{defId:x,ref:S+x}},o=(b)=>{if(b[1].schema.$ref)return;let _=b[1],{ref:g,defId:S}=n(b);if(_.def={..._.schema},S)_.defId=S;let x=_.schema;for(let M in x)delete x[M];x.$ref=g};for(let b of this.seen.entries()){let _=b[1];if(e===b[0]){o(b);continue}if(r.external){let S=r.external.registry.get(b[0])?.id;if(e!==b[0]&&S){o(b);continue}}if(this.metadataRegistry.get(b[0])?.id){o(b);continue}if(_.cycle){if(r.cycles==="throw")throw Error(`Cycle detected: #/${_.cycle?.join("/")}/<root>
|
|
53
53
|
|
|
54
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);else if(r.cycles==="ref")o(b);continue}if(_.count>1){if(r.reused==="ref"){o(b);continue}}}let s=(b,_)=>{let g=this.seen.get(b),S=g.def??g.schema,x={...S};if(g.ref===null)return;let M=g.ref;if(g.ref=null,M){s(M,_);let I=this.seen.get(M).schema;if(I.$ref&&_.target==="draft-7")S.allOf=S.allOf??[],S.allOf.push(I);else Object.assign(S,I),Object.assign(S,x)}if(!g.isParent)this.override({zodSchema:b,jsonSchema:S,path:g.path??[]})};for(let b of[...this.seen.entries()].reverse())s(b[0],{target:this.target});let h={};if(this.target==="draft-2020-12")h.$schema="https://json-schema.org/draft/2020-12/schema";else if(this.target==="draft-7")h.$schema="http://json-schema.org/draft-07/schema#";else console.warn(`Invalid target: ${this.target}`);Object.assign(h,i.def);let v=r.external?.defs??{};for(let b of this.seen.entries()){let _=b[1];if(_.def&&_.defId)v[_.defId]=_.def}if(!r.external&&Object.keys(v).length>0)if(this.target==="draft-2020-12")h.$defs=v;else h.definitions=v;try{return JSON.parse(JSON.stringify(h))}catch(b){throw Error("Error converting schema to JSON.")}}}function xs(e,t){if(e instanceof Ka){let i=new Df(t),n={};for(let h of e._idmap.entries()){let[v,b]=h;i.process(b)}let o={},s={registry:e,uri:t?.uri||((h)=>h),defs:n};for(let h of e._idmap.entries()){let[v,b]=h;o[v]=i.emit(b,{...t,external:s})}if(Object.keys(n).length>0){let h=i.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[h]:n}}return{schemas:o}}let r=new Df(t);return r.process(e),r.emit(e,t)}function _r(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;switch(n.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return _r(n.element,r);case"object":{for(let o in n.shape)if(_r(n.shape[o],r))return!0;return!1}case"union":{for(let o of n.options)if(_r(o,r))return!0;return!1}case"intersection":return _r(n.left,r)||_r(n.right,r);case"tuple":{for(let o of n.items)if(_r(o,r))return!0;if(n.rest&&_r(n.rest,r))return!0;return!1}case"record":return _r(n.keyType,r)||_r(n.valueType,r);case"map":return _r(n.keyType,r)||_r(n.valueType,r);case"set":return _r(n.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return _r(n.innerType,r);case"lazy":return _r(n.getter(),r);case"default":return _r(n.innerType,r);case"prefault":return _r(n.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return _r(n.in,r)||_r(n.out,r);case"success":return!1;case"catch":return!1;default:}throw Error(`Unknown schema type: ${n.type}`)}var LS={};var ks={};wn(ks,{time:()=>uy,duration:()=>ly,datetime:()=>sy,date:()=>ay,ZodISOTime:()=>jf,ZodISODuration:()=>Uf,ZodISODateTime:()=>Nf,ZodISODate:()=>zf});var Nf=ne("ZodISODateTime",(e,t)=>{tg.init(e,t),Ut.init(e,t)});function sy(e){return Zg(Nf,e)}var zf=ne("ZodISODate",(e,t)=>{rg.init(e,t),Ut.init(e,t)});function ay(e){return Kg(zf,e)}var jf=ne("ZodISOTime",(e,t)=>{ng.init(e,t),Ut.init(e,t)});function uy(e){return Vg(jf,e)}var Uf=ne("ZodISODuration",(e,t)=>{ig.init(e,t),Ut.init(e,t)});function ly(e){return Wg(Uf,e)}var qS=(e,t)=>{La.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:(r)=>fs(e,r)},flatten:{value:(r)=>ds(e,r)},addIssue:{value:(r)=>e.issues.push(r)},addIssues:{value:(r)=>e.issues.push(...r)},isEmpty:{get(){return e.issues.length===0}}})},kR=ne("ZodError",qS),Ms=ne("ZodError",qS,{Parent:Error});var cy=ed(Ms),dy=td(Ms),fy=rd(Ms),hy=nd(Ms);var vt=ne("ZodType",(e,t)=>(ut.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map((i)=>typeof i==="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),e.clone=(r,i)=>Ur(e,r,i),e.brand=()=>e,e.register=(r,i)=>(r.add(e,i),e),e.parse=(r,i)=>cy(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>fy(e,r,i),e.parseAsync=async(r,i)=>dy(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>hy(e,r,i),e.spa=e.safeParseAsync,e.refine=(r,i)=>e.check(Sx(r,i)),e.superRefine=(r)=>e.check(xx(r)),e.overwrite=(r)=>e.check(fi(r)),e.optional=()=>Lt(e),e.nullable=()=>Ff(e),e.nullish=()=>Lt(Ff(e)),e.nonoptional=(r)=>cx(e,r),e.array=()=>_t(e),e.or=(r)=>Dt([e,r]),e.and=(r)=>Cu(e,r),e.transform=(r)=>qf(e,zy(r)),e.default=(r)=>ax(e,r),e.prefault=(r)=>lx(e,r),e.catch=(r)=>hx(e,r),e.pipe=(r)=>qf(e,r),e.readonly=()=>gx(e),e.describe=(r)=>{let i=e.clone();return tn.add(i,{description:r}),i},Object.defineProperty(e,"description",{get(){return tn.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return tn.get(e);let i=e.clone();return tn.add(i,r[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),my=ne("_ZodString",(e,t)=>{qi.init(e,t),vt.init(e,t);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...i)=>e.check(gu(...i)),e.includes=(...i)=>e.check(bu(...i)),e.startsWith=(...i)=>e.check(_u(...i)),e.endsWith=(...i)=>e.check(wu(...i)),e.min=(...i)=>e.check(Hi(...i)),e.max=(...i)=>e.check(ws(...i)),e.length=(...i)=>e.check(Ss(...i)),e.nonempty=(...i)=>e.check(Hi(1,...i)),e.lowercase=(i)=>e.check(yu(i)),e.uppercase=(i)=>e.check(vu(i)),e.trim=()=>e.check(ku()),e.normalize=(...i)=>e.check(xu(...i)),e.toLowerCase=()=>e.check(Mu()),e.toUpperCase=()=>e.check(Eu())}),Tu=ne("ZodString",(e,t)=>{qi.init(e,t),my.init(e,t),e.email=(r)=>e.check(Wa(gy,r)),e.url=(r)=>e.check(Qa(yy,r)),e.jwt=(r)=>e.check(pu(Ry,r)),e.emoji=(r)=>e.check(eu(vy,r)),e.guid=(r)=>e.check(bs(Lf,r)),e.uuid=(r)=>e.check(Ga(hi,r)),e.uuidv4=(r)=>e.check(Ja(hi,r)),e.uuidv6=(r)=>e.check(Xa(hi,r)),e.uuidv7=(r)=>e.check(Ya(hi,r)),e.nanoid=(r)=>e.check(tu(by,r)),e.guid=(r)=>e.check(bs(Lf,r)),e.cuid=(r)=>e.check(ru(_y,r)),e.cuid2=(r)=>e.check(nu(wy,r)),e.ulid=(r)=>e.check(iu(Sy,r)),e.base64=(r)=>e.check(du(Ty,r)),e.base64url=(r)=>e.check(fu(Py,r)),e.xid=(r)=>e.check(ou(xy,r)),e.ksuid=(r)=>e.check(su(ky,r)),e.ipv4=(r)=>e.check(au(My,r)),e.ipv6=(r)=>e.check(uu(Ey,r)),e.cidrv4=(r)=>e.check(lu(Iy,r)),e.cidrv6=(r)=>e.check(cu($y,r)),e.e164=(r)=>e.check(hu(Ay,r)),e.datetime=(r)=>e.check(sy(r)),e.date=(r)=>e.check(ay(r)),e.time=(r)=>e.check(uy(r)),e.duration=(r)=>e.check(ly(r))});function de(e){return lf(Tu,e)}var Ut=ne("ZodStringFormat",(e,t)=>{Ot.init(e,t),my.init(e,t)}),gy=ne("ZodEmail",(e,t)=>{fd.init(e,t),Ut.init(e,t)});function ER(e){return Wa(gy,e)}var Lf=ne("ZodGUID",(e,t)=>{cd.init(e,t),Ut.init(e,t)});function IR(e){return bs(Lf,e)}var hi=ne("ZodUUID",(e,t)=>{dd.init(e,t),Ut.init(e,t)});function $R(e){return Ga(hi,e)}function TR(e){return Ja(hi,e)}function PR(e){return Xa(hi,e)}function AR(e){return Ya(hi,e)}var yy=ne("ZodURL",(e,t)=>{hd.init(e,t),Ut.init(e,t)});function RR(e){return Qa(yy,e)}var vy=ne("ZodEmoji",(e,t)=>{pd.init(e,t),Ut.init(e,t)});function CR(e){return eu(vy,e)}var by=ne("ZodNanoID",(e,t)=>{md.init(e,t),Ut.init(e,t)});function OR(e){return tu(by,e)}var _y=ne("ZodCUID",(e,t)=>{gd.init(e,t),Ut.init(e,t)});function DR(e){return ru(_y,e)}var wy=ne("ZodCUID2",(e,t)=>{yd.init(e,t),Ut.init(e,t)});function NR(e){return nu(wy,e)}var Sy=ne("ZodULID",(e,t)=>{vd.init(e,t),Ut.init(e,t)});function zR(e){return iu(Sy,e)}var xy=ne("ZodXID",(e,t)=>{bd.init(e,t),Ut.init(e,t)});function jR(e){return ou(xy,e)}var ky=ne("ZodKSUID",(e,t)=>{_d.init(e,t),Ut.init(e,t)});function UR(e){return su(ky,e)}var My=ne("ZodIPv4",(e,t)=>{wd.init(e,t),Ut.init(e,t)});function LR(e){return au(My,e)}var Ey=ne("ZodIPv6",(e,t)=>{Sd.init(e,t),Ut.init(e,t)});function FR(e){return uu(Ey,e)}var Iy=ne("ZodCIDRv4",(e,t)=>{xd.init(e,t),Ut.init(e,t)});function qR(e){return lu(Iy,e)}var $y=ne("ZodCIDRv6",(e,t)=>{kd.init(e,t),Ut.init(e,t)});function BR(e){return cu($y,e)}var Ty=ne("ZodBase64",(e,t)=>{Md.init(e,t),Ut.init(e,t)});function HR(e){return du(Ty,e)}var Py=ne("ZodBase64URL",(e,t)=>{Ed.init(e,t),Ut.init(e,t)});function ZR(e){return fu(Py,e)}var Ay=ne("ZodE164",(e,t)=>{Id.init(e,t),Ut.init(e,t)});function KR(e){return hu(Ay,e)}var Ry=ne("ZodJWT",(e,t)=>{$d.init(e,t),Ut.init(e,t)});function VR(e){return pu(Ry,e)}var BS=ne("ZodCustomStringFormat",(e,t)=>{Td.init(e,t),Ut.init(e,t)});function WR(e,t,r={}){return Cf(BS,e,t,r)}var Pu=ne("ZodNumber",(e,t)=>{Fa.init(e,t),vt.init(e,t),e.gt=(i,n)=>e.check(di(i,n)),e.gte=(i,n)=>e.check(rn(i,n)),e.min=(i,n)=>e.check(rn(i,n)),e.lt=(i,n)=>e.check(ci(i,n)),e.lte=(i,n)=>e.check(kn(i,n)),e.max=(i,n)=>e.check(kn(i,n)),e.int=(i)=>e.check(py(i)),e.safe=(i)=>e.check(py(i)),e.positive=(i)=>e.check(di(0,i)),e.nonnegative=(i)=>e.check(rn(0,i)),e.negative=(i)=>e.check(ci(0,i)),e.nonpositive=(i)=>e.check(kn(0,i)),e.multipleOf=(i,n)=>e.check(Eo(i,n)),e.step=(i,n)=>e.check(Eo(i,n)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??0.5),e.isFinite=!0,e.format=r.format??null});function It(e){return df(Pu,e)}var Es=ne("ZodNumberFormat",(e,t)=>{Pd.init(e,t),Pu.init(e,t)});function py(e){return ff(Es,e)}function GR(e){return hf(Es,e)}function JR(e){return pf(Es,e)}function XR(e){return mf(Es,e)}function YR(e){return gf(Es,e)}var Au=ne("ZodBoolean",(e,t)=>{ps.init(e,t),vt.init(e,t)});function or(e){return yf(Au,e)}var Ru=ne("ZodBigInt",(e,t)=>{qa.init(e,t),vt.init(e,t),e.gte=(i,n)=>e.check(rn(i,n)),e.min=(i,n)=>e.check(rn(i,n)),e.gt=(i,n)=>e.check(di(i,n)),e.gte=(i,n)=>e.check(rn(i,n)),e.min=(i,n)=>e.check(rn(i,n)),e.lt=(i,n)=>e.check(ci(i,n)),e.lte=(i,n)=>e.check(kn(i,n)),e.max=(i,n)=>e.check(kn(i,n)),e.positive=(i)=>e.check(di(BigInt(0),i)),e.negative=(i)=>e.check(ci(BigInt(0),i)),e.nonpositive=(i)=>e.check(kn(BigInt(0),i)),e.nonnegative=(i)=>e.check(rn(BigInt(0),i)),e.multipleOf=(i,n)=>e.check(Eo(i,n));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function QR(e){return vf(Ru,e)}var Cy=ne("ZodBigIntFormat",(e,t)=>{Ad.init(e,t),Ru.init(e,t)});function e5(e){return bf(Cy,e)}function t5(e){return _f(Cy,e)}var HS=ne("ZodSymbol",(e,t)=>{Rd.init(e,t),vt.init(e,t)});function r5(e){return wf(HS,e)}var ZS=ne("ZodUndefined",(e,t)=>{Cd.init(e,t),vt.init(e,t)});function n5(e){return Sf(ZS,e)}var KS=ne("ZodNull",(e,t)=>{Od.init(e,t),vt.init(e,t)});function Bf(e){return xf(KS,e)}var VS=ne("ZodAny",(e,t)=>{Dd.init(e,t),vt.init(e,t)});function i5(){return kf(VS)}var WS=ne("ZodUnknown",(e,t)=>{ko.init(e,t),vt.init(e,t)});function qt(){return Mo(WS)}var GS=ne("ZodNever",(e,t)=>{Nd.init(e,t),vt.init(e,t)});function Hf(e){return Mf(GS,e)}var JS=ne("ZodVoid",(e,t)=>{zd.init(e,t),vt.init(e,t)});function o5(e){return Ef(JS,e)}var Zf=ne("ZodDate",(e,t)=>{jd.init(e,t),vt.init(e,t),e.min=(i,n)=>e.check(rn(i,n)),e.max=(i,n)=>e.check(kn(i,n));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function s5(e){return If(Zf,e)}var XS=ne("ZodArray",(e,t)=>{ms.init(e,t),vt.init(e,t),e.element=t.element,e.min=(r,i)=>e.check(Hi(r,i)),e.nonempty=(r)=>e.check(Hi(1,r)),e.max=(r,i)=>e.check(ws(r,i)),e.length=(r,i)=>e.check(Ss(r,i)),e.unwrap=()=>e.element});function _t(e,t){return Iu(XS,e,t)}function a5(e){let t=e._zod.def.shape;return tt(Object.keys(t))}var Kf=ne("ZodObject",(e,t)=>{Ba.init(e,t),vt.init(e,t),Be.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>Vr(Object.keys(e._zod.def.shape)),e.catchall=(r)=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:qt()}),e.loose=()=>e.clone({...e._zod.def,catchall:qt()}),e.strict=()=>e.clone({...e._zod.def,catchall:Hf()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=(r)=>Be.extend(e,r),e.merge=(r)=>Be.merge(e,r),e.pick=(r)=>Be.pick(e,r),e.omit=(r)=>Be.omit(e,r),e.partial=(...r)=>Be.partial(jy,e,r[0]),e.required=(...r)=>Be.required(Uy,e,r[0])});function Qe(e,t){let r={type:"object",get shape(){return Be.assignProp(this,"shape",{...e}),this.shape},...Be.normalizeParams(t)};return new Kf(r)}function u5(e,t){return new Kf({type:"object",get shape(){return Be.assignProp(this,"shape",{...e}),this.shape},catchall:Hf(),...Be.normalizeParams(t)})}function Lr(e,t){return new Kf({type:"object",get shape(){return Be.assignProp(this,"shape",{...e}),this.shape},catchall:qt(),...Be.normalizeParams(t)})}var Oy=ne("ZodUnion",(e,t)=>{Ha.init(e,t),vt.init(e,t),e.options=t.options});function Dt(e,t){return new Oy({type:"union",options:e,...Be.normalizeParams(t)})}var YS=ne("ZodDiscriminatedUnion",(e,t)=>{Oy.init(e,t),Ud.init(e,t)});function Vf(e,t,r){return new YS({type:"union",options:t,discriminator:e,...Be.normalizeParams(r)})}var QS=ne("ZodIntersection",(e,t)=>{Ld.init(e,t),vt.init(e,t)});function Cu(e,t){return new QS({type:"intersection",left:e,right:t})}var ex=ne("ZodTuple",(e,t)=>{Bi.init(e,t),vt.init(e,t),e.rest=(r)=>e.clone({...e._zod.def,rest:r})});function l5(e,t,r){let i=t instanceof ut,n=i?r:t;return new ex({type:"tuple",items:e,rest:i?t:null,...Be.normalizeParams(n)})}var Dy=ne("ZodRecord",(e,t)=>{Fd.init(e,t),vt.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Nt(e,t,r){return new Dy({type:"record",keyType:e,valueType:t,...Be.normalizeParams(r)})}function c5(e,t,r){return new Dy({type:"record",keyType:Dt([e,Hf()]),valueType:t,...Be.normalizeParams(r)})}var tx=ne("ZodMap",(e,t)=>{qd.init(e,t),vt.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function d5(e,t,r){return new tx({type:"map",keyType:e,valueType:t,...Be.normalizeParams(r)})}var rx=ne("ZodSet",(e,t)=>{Bd.init(e,t),vt.init(e,t),e.min=(...r)=>e.check(Io(...r)),e.nonempty=(r)=>e.check(Io(1,r)),e.max=(...r)=>e.check(_s(...r)),e.size=(...r)=>e.check(mu(...r))});function f5(e,t){return new rx({type:"set",valueType:e,...Be.normalizeParams(t)})}var $u=ne("ZodEnum",(e,t)=>{Hd.init(e,t),vt.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(i,n)=>{let o={};for(let s of i)if(r.has(s))o[s]=t.entries[s];else throw Error(`Key ${s} not found in enum`);return new $u({...t,checks:[],...Be.normalizeParams(n),entries:o})},e.exclude=(i,n)=>{let o={...t.entries};for(let s of i)if(r.has(s))delete o[s];else throw Error(`Key ${s} not found in enum`);return new $u({...t,checks:[],...Be.normalizeParams(n),entries:o})}});function Vr(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((i)=>[i,i])):e;return new $u({type:"enum",entries:r,...Be.normalizeParams(t)})}function h5(e,t){return new $u({type:"enum",entries:e,...Be.normalizeParams(t)})}var nx=ne("ZodLiteral",(e,t)=>{Zd.init(e,t),vt.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function tt(e,t){return new nx({type:"literal",values:Array.isArray(e)?e:[e],...Be.normalizeParams(t)})}var ix=ne("ZodFile",(e,t)=>{Kd.init(e,t),vt.init(e,t),e.min=(r,i)=>e.check(Io(r,i)),e.max=(r,i)=>e.check(_s(r,i)),e.mime=(r,i)=>e.check(Su(Array.isArray(r)?r:[r],i))});function p5(e){return Tf(ix,e)}var Ny=ne("ZodTransform",(e,t)=>{gs.init(e,t),vt.init(e,t),e._zod.parse=(r,i)=>{r.addIssue=(o)=>{if(typeof o==="string")r.issues.push(Be.issue(o,r.value,t));else{let s=o;if(s.fatal)s.continue=!1;s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),s.continue??(s.continue=!0),r.issues.push(Be.issue(s))}};let n=t.transform(r.value,r);if(n instanceof Promise)return n.then((o)=>(r.value=o,r));return r.value=n,r}});function zy(e){return new Ny({type:"transform",transform:e})}var jy=ne("ZodOptional",(e,t)=>{Vd.init(e,t),vt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Lt(e){return new jy({type:"optional",innerType:e})}var ox=ne("ZodNullable",(e,t)=>{Wd.init(e,t),vt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ff(e){return new ox({type:"nullable",innerType:e})}function m5(e){return Lt(Ff(e))}var sx=ne("ZodDefault",(e,t)=>{Gd.init(e,t),vt.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ax(e,t){return new sx({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():t}})}var ux=ne("ZodPrefault",(e,t)=>{Jd.init(e,t),vt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function lx(e,t){return new ux({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():t}})}var Uy=ne("ZodNonOptional",(e,t)=>{Xd.init(e,t),vt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function cx(e,t){return new Uy({type:"nonoptional",innerType:e,...Be.normalizeParams(t)})}var dx=ne("ZodSuccess",(e,t)=>{Yd.init(e,t),vt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function g5(e){return new dx({type:"success",innerType:e})}var fx=ne("ZodCatch",(e,t)=>{Qd.init(e,t),vt.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function hx(e,t){return new fx({type:"catch",innerType:e,catchValue:typeof t==="function"?t:()=>t})}var px=ne("ZodNaN",(e,t)=>{ef.init(e,t),vt.init(e,t)});function y5(e){return $f(px,e)}var Ly=ne("ZodPipe",(e,t)=>{ys.init(e,t),vt.init(e,t),e.in=t.in,e.out=t.out});function qf(e,t){return new Ly({type:"pipe",in:e,out:t})}var mx=ne("ZodReadonly",(e,t)=>{tf.init(e,t),vt.init(e,t)});function gx(e){return new mx({type:"readonly",innerType:e})}var yx=ne("ZodTemplateLiteral",(e,t)=>{rf.init(e,t),vt.init(e,t)});function v5(e,t){return new yx({type:"template_literal",parts:e,...Be.normalizeParams(t)})}var vx=ne("ZodLazy",(e,t)=>{of.init(e,t),vt.init(e,t),e.unwrap=()=>e._zod.def.getter()});function bx(e){return new vx({type:"lazy",getter:e})}var _x=ne("ZodPromise",(e,t)=>{nf.init(e,t),vt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function b5(e){return new _x({type:"promise",innerType:e})}var Wf=ne("ZodCustom",(e,t)=>{sf.init(e,t),vt.init(e,t)});function wx(e,t){let r=new Ht({check:"custom",...Be.normalizeParams(t)});return r._zod.check=e,r}function Fy(e,t){return Pf(Wf,e??(()=>!0),t)}function Sx(e,t={}){return Af(Wf,e,t)}function xx(e,t){let r=wx((i)=>(i.addIssue=(n)=>{if(typeof n==="string")i.issues.push(Be.issue(n,i.value,r._zod.def));else{let o=n;if(o.fatal)o.continue=!1;o.code??(o.code="custom"),o.input??(o.input=i.value),o.inst??(o.inst=r),o.continue??(o.continue=!r._zod.def.abort),i.issues.push(Be.issue(o))}},e(i.value,i)),t);return r}function _5(e,t={error:`Input not instance of ${e.name}`}){let r=new Wf({type:"custom",check:"custom",fn:(i)=>i instanceof e,abort:!0,...Be.normalizeParams(t)});return r._zod.bag.Class=e,r}var w5=(...e)=>Rf({Pipe:Ly,Boolean:Au,String:Tu,Transform:Ny},...e);function S5(e){let t=bx(()=>Dt([de(e),It(),or(),Bf(),_t(t),Nt(de(),t)]));return t}function Gf(e,t){return qf(zy(e),t)}var x5={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 k5(e){rr({customError:e})}function M5(){return rr().customError}var qy={};wn(qy,{string:()=>E5,number:()=>I5,date:()=>P5,boolean:()=>$5,bigint:()=>T5});function E5(e){return Hg(Tu,e)}function I5(e){return Gg(Pu,e)}function $5(e){return Jg(Au,e)}function T5(e){return Xg(Ru,e)}function P5(e){return Yg(Zf,e)}rr(Za());var kx={"//":"Hand-maintained baked-in model catalog — the source of truth for per-model provider IDs and metadata. On model launch add one entry to `models` below; `bun run generate:model-catalog` validates this file against the schema and formats it.",schema_version:1,pricing_tiers:{tier_3_15:{input:3,output:15,cache_write_5m:3.75,cache_write_1h:6,cache_read:0.3,web_search:0.01},tier_5_25:{input:5,output:25,cache_write_5m:6.25,cache_write_1h:10,cache_read:0.5,web_search:0.01},tier_15_75:{input:15,output:75,cache_write_5m:18.75,cache_write_1h:30,cache_read:1.5,web_search:0.01},tier_10_50:{input:10,output:50,cache_write_5m:12.5,cache_write_1h:20,cache_read:1,web_search:0.01},haiku_35:{input:0.8,output:4,cache_write_5m:1,cache_write_1h:1.6,cache_read:0.08,web_search:0.01},haiku_45:{input:1,output:5,cache_write_5m:1.25,cache_write_1h:2,cache_read:0.1,web_search:0.01}},models:[{id:"claude-3-5-haiku",family:"haiku",display_name:"Haiku 3.5",provider_ids:{first_party:"claude-3-5-haiku-20241022",bedrock:"us.anthropic.claude-3-5-haiku-20241022-v1:0",vertex:"claude-3-5-haiku@20241022",foundry:"claude-3-5-haiku",anthropic_aws:"claude-3-5-haiku-20241022",mantle:null,gateway:"claude-3-5-haiku-20241022"},eager_input_streaming:{vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_3_5_HAIKU",max_output_tokens:{default:8192,upper:8192},pricing:"haiku_35",capabilities:[]},{id:"claude-haiku-4-5",family:"haiku",display_name:"Haiku 4.5",knowledge_cutoff:"February 2025",provider_ids:{first_party:"claude-haiku-4-5-20251001",bedrock:"us.anthropic.claude-haiku-4-5-20251001-v1:0",vertex:"claude-haiku-4-5@20251001",foundry:"claude-haiku-4-5",anthropic_aws:"claude-haiku-4-5-20251001",mantle:"anthropic.claude-haiku-4-5",gateway:"claude-haiku-4-5-20251001"},vertex_region_env_var:"VERTEX_REGION_CLAUDE_HAIKU_4_5",context:{window:200000,supports_1m_suffix:!0},max_output_tokens:{default:32000,upper:64000},pricing:"haiku_45",capabilities:["context_management"],advisor_rank:1},{id:"claude-3-5-sonnet",family:"sonnet",display_name:"Sonnet 3.5",provider_ids:{first_party:"claude-3-5-sonnet-20241022",bedrock:"us.anthropic.claude-3-5-sonnet-20241022-v2:0",vertex:"claude-3-5-sonnet-v2@20241022",foundry:"claude-3-5-sonnet",anthropic_aws:"claude-3-5-sonnet-20241022",mantle:null,gateway:"claude-3-5-sonnet-20241022"},vertex_region_env_var:"VERTEX_REGION_CLAUDE_3_5_SONNET",max_output_tokens:{default:8192,upper:8192},pricing:"tier_3_15",capabilities:[]},{id:"claude-3-7-sonnet",family:"sonnet",display_name:"Sonnet 3.7",provider_ids:{first_party:"claude-3-7-sonnet-20250219",bedrock:"us.anthropic.claude-3-7-sonnet-20250219-v1:0",vertex:"claude-3-7-sonnet@20250219",foundry:"claude-3-7-sonnet",anthropic_aws:"claude-3-7-sonnet-20250219",mantle:null,gateway:"claude-3-7-sonnet-20250219"},vertex_region_env_var:"VERTEX_REGION_CLAUDE_3_7_SONNET",max_output_tokens:{default:32000,upper:64000},pricing:"tier_3_15",capabilities:[]},{id:"claude-sonnet-4-0",family:"sonnet",display_name:"Sonnet 4",knowledge_cutoff:"January 2025",provider_ids:{first_party:"claude-sonnet-4-20250514",bedrock:"us.anthropic.claude-sonnet-4-20250514-v1:0",vertex:"claude-sonnet-4@20250514",foundry:"claude-sonnet-4",anthropic_aws:"claude-sonnet-4-20250514",mantle:null,gateway:"claude-sonnet-4-20250514"},eager_input_streaming:{vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_0_SONNET",context:{window:200000,supports_1m_beta:!0,supports_1m_suffix:!0},max_output_tokens:{default:32000,upper:64000},pricing:"tier_3_15",capabilities:["context_management"]},{id:"claude-sonnet-4-5",family:"sonnet",display_name:"Sonnet 4.5",knowledge_cutoff:"January 2025",provider_ids:{first_party:"claude-sonnet-4-5-20250929",bedrock:"us.anthropic.claude-sonnet-4-5-20250929-v1:0",vertex:"claude-sonnet-4-5@20250929",foundry:"claude-sonnet-4-5",anthropic_aws:"claude-sonnet-4-5-20250929",mantle:null,gateway:"claude-sonnet-4-5-20250929"},eager_input_streaming:{vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_5_SONNET",fallback_3p:"claude-sonnet-4-0",context:{window:200000,supports_1m_beta:!0,supports_1m_suffix:!0},max_output_tokens:{default:32000,upper:64000},pricing:"tier_3_15",capabilities:["context_management"]},{id:"claude-sonnet-4-6",family:"sonnet",display_name:"Sonnet 4.6",knowledge_cutoff:"August 2025",provider_ids:{first_party:"claude-sonnet-4-6",bedrock:"us.anthropic.claude-sonnet-4-6",vertex:"claude-sonnet-4-6",foundry:"claude-sonnet-4-6",anthropic_aws:"claude-sonnet-4-6",mantle:null,gateway:"claude-sonnet-4-6"},eager_input_streaming:{bedrock:!0,vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_6_SONNET",fallback_3p:"claude-sonnet-4-5",context:{window:200000,supports_1m_beta:!0,supports_1m_suffix:!0},max_output_tokens:{default:32000,upper:128000},pricing:"tier_3_15",capabilities:["effort","max_effort","adaptive_thinking","context_management"],advisor_rank:2},{id:"claude-sonnet-5",family:"sonnet",display_name:"Sonnet 5",knowledge_cutoff:"January 2026",provider_ids:{first_party:"claude-sonnet-5",bedrock:"us.anthropic.claude-sonnet-5",vertex:"claude-sonnet-5",foundry:"claude-sonnet-5",anthropic_aws:"claude-sonnet-5",mantle:"anthropic.claude-sonnet-5",gateway:"claude-sonnet-5"},eager_input_streaming:{bedrock:!0,vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_5_SONNET",fallback_3p:"claude-sonnet-4-6",context:{window:1e6,native_1m:!0,native_1m_3p:{bedrock:!0,vertex:!0,foundry:!0},supports_1m_beta:!0},max_output_tokens:{default:64000,upper:128000},pricing:"tier_3_15",capabilities:["effort","max_effort","xhigh_effort","adaptive_thinking","mid_conv_system","context_management"],default_effort:"high",image_limits:{maxWidth:2000,maxHeight:2000},advisor_rank:3},{id:"claude-opus-4-0",family:"opus",display_name:"Opus 4",knowledge_cutoff:"January 2025",provider_ids:{first_party:"claude-opus-4-20250514",bedrock:"us.anthropic.claude-opus-4-20250514-v1:0",vertex:"claude-opus-4@20250514",foundry:"claude-opus-4",anthropic_aws:"claude-opus-4-20250514",mantle:null,gateway:"claude-opus-4-20250514"},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_0_OPUS",context:{window:200000,supports_1m_suffix:!0},max_output_tokens:{default:32000,upper:32000},pricing:"tier_15_75",capabilities:["context_management"]},{id:"claude-opus-4-1",family:"opus",display_name:"Opus 4.1",knowledge_cutoff:"January 2025",provider_ids:{first_party:"claude-opus-4-1-20250805",bedrock:"us.anthropic.claude-opus-4-1-20250805-v1:0",vertex:"claude-opus-4-1@20250805",foundry:"claude-opus-4-1",anthropic_aws:"claude-opus-4-1-20250805",mantle:null,gateway:"claude-opus-4-1-20250805"},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_1_OPUS",context:{window:200000,supports_1m_suffix:!0},max_output_tokens:{default:32000,upper:32000},pricing:"tier_15_75",capabilities:["context_management"]},{id:"claude-opus-4-5",family:"opus",display_name:"Opus 4.5",knowledge_cutoff:"May 2025",provider_ids:{first_party:"claude-opus-4-5-20251101",bedrock:"us.anthropic.claude-opus-4-5-20251101-v1:0",vertex:"claude-opus-4-5@20251101",foundry:"claude-opus-4-5",anthropic_aws:"claude-opus-4-5-20251101",mantle:null,gateway:"claude-opus-4-5-20251101"},eager_input_streaming:{vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_5_OPUS",fallback_3p:"claude-opus-4-1",context:{window:200000,supports_1m_suffix:!0},max_output_tokens:{default:32000,upper:64000},pricing:"tier_5_25",capabilities:["context_management"]},{id:"claude-opus-4-6",family:"opus",display_name:"Opus 4.6",knowledge_cutoff:"May 2025",provider_ids:{first_party:"claude-opus-4-6",bedrock:"us.anthropic.claude-opus-4-6-v1",vertex:"claude-opus-4-6",foundry:"claude-opus-4-6",anthropic_aws:"claude-opus-4-6",mantle:null,gateway:"claude-opus-4-6"},eager_input_streaming:{vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_6_OPUS",fallback_3p:"claude-opus-4-5",context:{window:200000,supports_1m_beta:!0,supports_1m_suffix:!0},max_output_tokens:{default:64000,upper:128000},pricing:"tier_5_25",capabilities:["effort","max_effort","adaptive_thinking","context_management"],advisor_rank:3},{id:"claude-opus-4-7",family:"opus",display_name:"Opus 4.7",knowledge_cutoff:"January 2026",provider_ids:{first_party:"claude-opus-4-7",bedrock:"us.anthropic.claude-opus-4-7",vertex:"claude-opus-4-7",foundry:"claude-opus-4-7",anthropic_aws:"claude-opus-4-7",mantle:"anthropic.claude-opus-4-7",gateway:"claude-opus-4-7"},eager_input_streaming:{bedrock:!0,vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_7_OPUS",fallback_3p:"claude-opus-4-6",context:{window:1e6,native_1m:!0,supports_1m_beta:!0,supports_1m_suffix:!0},max_output_tokens:{default:64000,upper:128000},pricing:"tier_5_25",capabilities:["effort","max_effort","xhigh_effort","adaptive_thinking","context_management","fast_mode"],default_effort:"xhigh",image_limits:{maxWidth:2000,maxHeight:2000},advisor_rank:4},{id:"claude-opus-4-8",family:"opus",display_name:"Opus 4.8",knowledge_cutoff:"January 2026",provider_ids:{first_party:"claude-opus-4-8",bedrock:"us.anthropic.claude-opus-4-8",vertex:"claude-opus-4-8",foundry:"claude-opus-4-8",anthropic_aws:"claude-opus-4-8",mantle:"anthropic.claude-opus-4-8",gateway:"claude-opus-4-8"},eager_input_streaming:{bedrock:!0,vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_8_OPUS",fallback_3p:"claude-opus-4-7",context:{window:1e6,native_1m:!0,supports_1m_beta:!0,supports_1m_suffix:!0},max_output_tokens:{default:64000,upper:128000},pricing:"tier_5_25",capabilities:["effort","max_effort","xhigh_effort","adaptive_thinking","mid_conv_system","context_management","fast_mode","lean_prompt"],default_effort:"high",image_limits:{maxWidth:2000,maxHeight:2000},advisor_rank:4},{id:"claude-fable-5",family:"fable",display_name:"Fable 5",knowledge_cutoff:"January 2026",provider_ids:{first_party:"claude-fable-5",bedrock:"us.anthropic.claude-fable-5",vertex:"claude-fable-5",foundry:"claude-fable-5",anthropic_aws:"claude-fable-5",mantle:"anthropic.claude-fable-5",gateway:"claude-fable-5"},eager_input_streaming:{bedrock:!0,vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_FABLE_5",fallback_3p:"claude-opus-4-8",context:{window:1e6,native_1m:!0,supports_1m_beta:!0},max_output_tokens:{default:64000,upper:128000},pricing:"tier_10_50",capabilities:["effort","max_effort","xhigh_effort","adaptive_thinking","rejects_disabled_thinking","mid_conv_system","context_management","lean_prompt","fable_5_mitigations"],default_effort:"high",image_limits:{maxWidth:2000,maxHeight:2000},advisor_rank:5},{id:"claude-mythos-5",family:"mythos",display_name:"Mythos 5",knowledge_cutoff:"January 2026",provider_ids:{first_party:"claude-mythos-5",bedrock:null,vertex:null,foundry:null,anthropic_aws:null,mantle:null,gateway:null},context:{window:1e6,native_1m:!0,supports_1m_beta:!0},max_output_tokens:{default:64000,upper:128000},pricing:"tier_10_50",capabilities:[],image_limits:{maxWidth:2000,maxHeight:2000},advisor_rank:5}],aliases:{opus:{default:"claude-opus-4-8",per_provider:{bedrock:"claude-opus-4-8",vertex:"claude-opus-4-8",foundry:"claude-opus-4-6",mantle:"claude-opus-4-8",anthropic_aws:"claude-opus-4-8",gateway:"claude-opus-4-7"}},sonnet:{default:"claude-sonnet-5",per_provider:{bedrock:"claude-sonnet-4-5",vertex:"claude-sonnet-4-5",foundry:"claude-sonnet-4-5",mantle:"claude-sonnet-4-5",anthropic_aws:"claude-sonnet-4-6",gateway:"claude-sonnet-4-6"}},haiku:{default:"claude-haiku-4-5"},fable:{default:"claude-fable-5"}},defaults:{},best:"fable",latest_per_family:{fable:"claude-fable-5",opus:"claude-opus-4-8",sonnet:"claude-sonnet-5",haiku:"claude-haiku-4-5"},alias_migration:{}};function Is(e){let t;return()=>t??=e()}var R5=Is(()=>qe.object({first_party:qe.string(),bedrock:qe.string().nullish(),vertex:qe.string().nullish(),foundry:qe.string().nullish(),anthropic_aws:qe.string().nullish(),mantle:qe.string().nullish(),gateway:qe.string().nullish()}).loose()),Mx=Is(()=>qe.object({input:qe.number(),output:qe.number(),cache_write_5m:qe.number().optional(),cache_write_1h:qe.number().optional(),cache_read:qe.number().optional(),web_search:qe.number().optional()}).loose()),C5=Is(()=>qe.object({id:qe.string(),family:qe.string(),display_name:qe.string(),slogan:qe.string().optional(),knowledge_cutoff:qe.string().optional(),provider_ids:R5(),eager_input_streaming:qe.object({bedrock:qe.literal(!0).optional(),vertex:qe.literal(!0).optional()}).loose().optional(),vertex_region_env_var:qe.string().optional(),fallback_3p:qe.string().optional(),context:qe.object({window:qe.number(),native_1m:qe.boolean().optional(),native_1m_3p:qe.object({bedrock:qe.literal(!0).optional(),vertex:qe.literal(!0).optional(),foundry:qe.literal(!0).optional()}).loose().optional(),supports_1m_beta:qe.boolean().optional(),supports_1m_suffix:qe.boolean().optional()}).loose().optional(),max_output_tokens:qe.object({default:qe.number(),upper:qe.number()}).loose().optional(),pricing:qe.union([qe.string(),Mx()]).optional(),capabilities:qe.array(qe.string()).default([]),default_effort:qe.enum(["low","medium","high","xhigh","max"]).optional(),image_limits:qe.object({maxWidth:qe.number().optional(),maxHeight:qe.number().optional(),maxBase64Size:qe.number().optional()}).loose().optional(),advisor_rank:qe.number().optional(),fallback_chain:qe.array(qe.string()).optional(),picker:qe.object({section:qe.enum(["main","overflow","deprecated"]).optional(),badge:qe.string().optional(),disabled_reason:qe.string().optional(),tiers:qe.array(qe.string()).optional()}).loose().optional(),deprecation:qe.object({retirement_dates:qe.record(qe.string(),qe.string()).optional(),remapped_to:qe.string().optional()}).loose().optional(),min_cli_version:qe.string().optional()}).loose()),O5=Is(()=>qe.object({default:qe.string(),per_provider:qe.record(qe.string(),qe.string()).optional()}).loose()),D5=Is(()=>qe.object({schema_version:qe.number(),pricing_tiers:qe.record(qe.string(),Mx()).default({}),models:qe.array(C5()),aliases:qe.record(qe.string(),O5()).default({}),defaults:qe.record(qe.string(),qe.string()).default({}),best:qe.string().optional(),latest_per_family:qe.record(qe.string(),qe.string()).default({}),alias_migration:qe.record(qe.string(),qe.string()).default({})}).loose()),N5={schema_version:0,pricing_tiers:{},models:[],aliases:{},defaults:{},latest_per_family:{},alias_migration:{}},By=Er(()=>{let e=D5().safeParse(kx);return e.success?e.data:N5}),Ex=By;function Ix(e){return e.replace(/-0$/,"")}var oue=Er(()=>{let e=new Map;for(let t of Ex().models)e.set(t.id,t);return e}),sue=Er(()=>{let e=new Map;for(let t of Ex().models)for(let r of Object.values(t.provider_ids)){if(typeof r!=="string")continue;let i=r.toLowerCase(),n=e.get(i);if(n!==void 0&&n!==t.id)throw Error("model catalog: provider id collision across distinct entries");e.set(i,t.id)}return e});function $x(){return process.env.CLAUDE_CONFIG_DIR}var Tx=Er(()=>($x()??Yn(Wc(),".claude")).normalize("NFC"),$x);var hue=Er(()=>yo(process.env.CLAUDE_CODE_SUPERVISED));var pue=Er(()=>By().models.flatMap((e)=>e.vertex_region_env_var&&/^VERTEX_REGION_[A-Z0-9_]+$/.test(e.vertex_region_env_var)?[[Ix(e.id),e.vertex_region_env_var]]:[]).sort(([e],[t])=>t.length-e.length||(e<t?-1:e>t?1:0)));function We(e,t,r,i,n){if(i==="m")throw TypeError("Private method is not writable");if(i==="a"&&!n)throw TypeError("Private accessor was defined without a setter");if(typeof t==="function"?e!==t||!n:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(e,r):n?n.value=r:t.set(e,r),r}function oe(e,t,r,i){if(r==="a"&&!i)throw TypeError("Private accessor was defined without a getter");if(typeof t==="function"?e!==t||!i:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(e):i?i.value:t.get(e)}var Hy=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return Hy=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),r=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(i)=>(+i^r()&15>>+i/4).toString(16))};function pi(e){return typeof e==="object"&&e!==null&&(("name"in e)&&e.name==="AbortError"||("message"in e)&&String(e.message).includes("FetchRequestCanceledException"))}var Ou=(e)=>{if(e instanceof Error)return e;if(typeof e==="object"&&e!==null){try{if(Object.prototype.toString.call(e)==="[object Error]"){let t=Error(e.message,e.cause?{cause:e.cause}:{});if(e.stack)t.stack=e.stack;if(e.cause&&!t.cause)t.cause=e.cause;if(e.name)t.name=e.name;return t}}catch{}try{return Error(JSON.stringify(e))}catch{}}return Error(e)};class Ye extends Error{}class wr extends Ye{constructor(e,t,r,i,n){super(`${wr.makeMessage(e,t,r)}`);this.status=e,this.headers=i,this.requestID=i?.get("request-id"),this.error=t,this.type=n??null}static makeMessage(e,t,r){let i=t?.message?typeof t.message==="string"?t.message:JSON.stringify(t.message):t?JSON.stringify(t):r;if(e&&i)return`${e} ${i}`;if(e)return`${e} status code (no body)`;if(i)return i;return"(no status code or body)"}static generate(e,t,r,i){if(!e||!i)return new $o({message:r,cause:Ou(t)});let n=t,o=n?.error?.type;if(e===400)return new Nu(e,n,r,i,o);if(e===401)return new zu(e,n,r,i,o);if(e===403)return new ju(e,n,r,i,o);if(e===404)return new Uu(e,n,r,i,o);if(e===409)return new Lu(e,n,r,i,o);if(e===422)return new Fu(e,n,r,i,o);if(e===429)return new qu(e,n,r,i,o);if(e>=500)return new Bu(e,n,r,i,o);return new wr(e,n,r,i,o)}}class Rr extends wr{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}}class $o extends wr{constructor({message:e,cause:t}){super(void 0,void 0,e||"Connection error.",void 0);if(t)this.cause=t}}class Du extends $o{constructor({message:e}={}){super({message:e??"Request timed out."})}}class Nu extends wr{}class zu extends wr{}class ju extends wr{}class Uu extends wr{}class Lu extends wr{}class Fu extends wr{}class qu extends wr{}class Bu extends wr{}var j5=/^[a-z][a-z0-9+.-]*:/i,Px=(e)=>j5.test(e),Zy=(e)=>(Zy=Array.isArray,Zy(e)),Ky=Zy;function Jf(e){if(typeof e!=="object")return{};return e??{}}function Vy(e){if(!e)return!0;for(let t in e)return!1;return!0}function Ax(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Rx=(e,t)=>{if(typeof t!=="number"||!Number.isInteger(t))throw new Ye(`${e} must be an integer`);if(t<0)throw new Ye(`${e} must be a positive integer`);return t};var Xf=(e)=>{try{return JSON.parse(e)}catch(t){return}};var Cx=(e)=>new Promise((t)=>setTimeout(t,e));var Mn="0.94.0";var zx=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function U5(){if(typeof Deno<"u"&&Deno.build!=null)return"deno";if(typeof EdgeRuntime<"u")return"edge";if(Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]")return"node";return"unknown"}var L5=()=>{let e=U5();if(e==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Mn,"X-Stainless-OS":Dx(Deno.build.os),"X-Stainless-Arch":Ox(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version==="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Mn,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(e==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Mn,"X-Stainless-OS":Dx(globalThis.process.platform??"unknown"),"X-Stainless-Arch":Ox(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let t=F5();if(t)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Mn,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${t.browser}`,"X-Stainless-Runtime-Version":t.version};return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Mn,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function F5(){if(typeof navigator>"u"||!navigator)return null;let e=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:t,pattern:r}of e){let i=r.exec(navigator.userAgent);if(i){let n=i[1]||0,o=i[2]||0,s=i[3]||0;return{browser:t,version:`${n}.${o}.${s}`}}}return null}var Ox=(e)=>{if(e==="x32")return"x32";if(e==="x86_64"||e==="x64")return"x64";if(e==="arm")return"arm";if(e==="aarch64"||e==="arm64")return"arm64";if(e)return`other:${e}`;return"unknown"},Dx=(e)=>{if(e=e.toLowerCase(),e.includes("ios"))return"iOS";if(e==="android")return"Android";if(e==="darwin")return"MacOS";if(e==="win32")return"Windows";if(e==="freebsd")return"FreeBSD";if(e==="openbsd")return"OpenBSD";if(e==="linux")return"Linux";if(e)return`Other:${e}`;return"Unknown"},Nx,Hu=()=>Nx??(Nx=L5());function jx(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function Wy(...e){let t=globalThis.ReadableStream;if(typeof t>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function Yf(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return Wy({start(){},async pull(r){let{done:i,value:n}=await t.next();if(i)r.close();else r.enqueue(n)},async cancel(){await t.return?.()}})}function Zu(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let r=await t.read();if(r?.done)t.releaseLock();return r}catch(r){throw t.releaseLock(),r}},async return(){let r=t.cancel();return t.releaseLock(),await r,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function Ux(e){if(e===null||typeof e!=="object")return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}let t=e.getReader(),r=t.cancel();t.releaseLock(),await r}var Lx=({headers:e,body:t})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(t)});function Fx(e){return Object.entries(e).filter(([t,r])=>typeof r<"u").map(([t,r])=>{if(typeof r==="string"||typeof r==="number"||typeof r==="boolean")return`${encodeURIComponent(t)}=${encodeURIComponent(r)}`;if(r===null)return`${encodeURIComponent(t)}=`;throw new Ye(`Cannot stringify type ${typeof r}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}var Bx="urn:ietf:params:oauth:grant-type:jwt-bearer",Hx="refresh_token",Qf="/v1/oauth/token",To="oauth-2025-04-20",Zx="oidc-federation-2026-04-01",Kx=120,$s=30,Vx=5,qx=1048576;function eh(e){if(!e)return;let t;try{t=new URL(e)}catch(i){throw new Rt(`Invalid token endpoint base URL "${e}": ${i}`)}if(t.protocol==="https:")return;let r=t.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(t.protocol==="http:"&&(r==="localhost"||r==="127.0.0.1"||r==="::1"))return;throw new Rt(`Refusing to send credential over non-https token endpoint "${e}"`)}async function th(e,t){let r=await Z5(e),i;try{i=JSON.parse(r)}catch{throw new Rt(`Token endpoint returned non-JSON response (status ${e.status})`,e.status,nn(r),t)}if(!i.access_token)throw new Rt(`Token endpoint response missing access_token: ${JSON.stringify(nn(i))}`,e.status,nn(i),t);if(i.token_type&&i.token_type.toLowerCase()!=="bearer")throw new Rt(`Token endpoint response: unsupported token_type "${i.token_type}" (want Bearer)`,e.status,nn(i),t);return i}var Gy=2000,H5=new Set(["error","error_description","error_uri"]);function nn(e){if(e==null)return e;if(typeof e==="string"){let t;try{t=JSON.parse(e)}catch{if(e.length<=Gy)return e;return e.slice(0,Gy)+`... <${e.length-Gy} more chars>`}return JSON.stringify(nn(t))}if(typeof e==="object"&&!Array.isArray(e)){let t={};for(let[r,i]of Object.entries(e))if(H5.has(r))t[r]=i;return t}return null}async function rh(e,t=(r)=>console.warn(`anthropic-sdk: ${r}`)){if(typeof process>"u"||process.platform==="win32")return;let r=await import("node:fs"),i=e,n;try{i=await r.promises.realpath(e),n=await r.promises.stat(i)}catch{return}let o=n.mode&511;if(o&18)throw new Rt(`Credentials file at ${i} is group/world-writable (mode 0o${o.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${i}\`.`);if(o&36)throw new Rt(`Credentials file at ${i} is group/world-readable (mode 0o${o.toString(8)}); run \`chmod 600 ${i}\` before retrying.`);if(typeof process.getuid==="function"&&n.uid!==process.getuid())t(`credentials file at ${i} is owned by uid ${n.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function nh(e,t){let r=await import("node:fs"),n=(await Promise.resolve().then(() => (Dn(),vo))).dirname(e);await r.promises.mkdir(n,{recursive:!0,mode:448});let o=`${e}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let s=await r.promises.open(o,"w",384);try{await s.writeFile(JSON.stringify(t,null,2)),await s.sync()}finally{await s.close()}await r.promises.rename(o,e)}catch(s){throw await r.promises.unlink(o).catch(()=>{}),s}try{let s=await r.promises.open(n,"r");try{await s.sync()}finally{await s.close()}}catch{}}async function Z5(e){if(!e.body)return"";let t=e.body.getReader(),r=[],i=0;for(;;){let{done:o,value:s}=await t.read();if(o)break;if(i+s.length>qx){let h=qx-i;if(h>0)r.push(s.subarray(0,h));await t.cancel();break}r.push(s),i+=s.length}let n;if(r.length===1)n=r[0];else{n=new Uint8Array(r.reduce((s,h)=>s+h.length,0));let o=0;for(let s of r)n.set(s,o),o+=s.length}return new TextDecoder("utf-8").decode(n)}class Rt extends Ye{constructor(e,t=null,r=null,i=null){super(e);this.statusCode=t,this.body=r,this.requestId=i}}function zn(){return Math.floor(Date.now()/1000)}class Jy{constructor(e,t){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=e,this.onAdvisoryRefreshError=t}async getToken(){let e=this.nextForce;this.nextForce=!1;let t=this.cached;if(e||t==null)return(await this.refresh(e)).token;if(t.expiresAt==null)return t.token;let r=t.expiresAt-zn();if(r>Kx)return t.token;if(r>$s)return this.backgroundRefresh(),t.token;return(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(e=!1){if(this.pendingRefresh&&!e)return this.pendingRefresh;return this.doRefresh(e)}backgroundRefresh(){if(this.pendingRefresh)return;if(zn()-this.lastAdvisoryError<Vx)return;this.doRefresh().catch((e)=>{this.lastAdvisoryError=zn(),this.onAdvisoryRefreshError?.(e)})}doRefresh(e=!1){return this.pendingRefresh=this.provider(e?{forceRefresh:!0}:void 0).then((t)=>(this.cached=t,this.pendingRefresh=null,t),(t)=>{throw this.pendingRefresh=null,t}),this.pendingRefresh}}var Pt=(e)=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[e]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(e)?.trim()||void 0;return};function Jx(e){let t=0;for(let n of e)t+=n.length;let r=new Uint8Array(t),i=0;for(let n of e)r.set(n,i),i+=n.length;return r}var Wx;function Ts(e){let t;return(Wx??(t=new globalThis.TextEncoder,Wx=t.encode.bind(t)))(e)}var Gx;function Xy(e){let t;return(Gx??(t=new globalThis.TextDecoder,Gx=t.decode.bind(t)))(e)}var oh={off:0,error:200,warn:300,info:400,debug:500},Yy=(e,t,r)=>{if(!e)return;if(Ax(oh,e))return e;nr(r).warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(oh))}`);return};function Ku(){}function ih(e,t,r){if(!t||oh[e]>oh[r])return Ku;else return t[e].bind(t)}var K5={error:Ku,warn:Ku,info:Ku,debug:Ku},Xx=new WeakMap;function nr(e){let t=e.logger,r=e.logLevel??"off";if(!t)return K5;let i=Xx.get(t);if(i&&i[0]===r)return i[1];let n={error:ih("error",t,r),warn:ih("warn",t,r),info:ih("info",t,r),debug:ih("debug",t,r)};return Xx.set(t,[r,n]),n}var mi=(e)=>{if(e.options)e.options={...e.options},delete e.options.headers;if(e.headers)e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([t,r])=>[t,t.toLowerCase()==="x-api-key"||t.toLowerCase()==="authorization"||t.toLowerCase()==="cookie"||t.toLowerCase()==="set-cookie"?"***":r]));if("retryOfRequestLogID"in e){if(e.retryOfRequestLogID)e.retryOf=e.retryOfRequestLogID;delete e.retryOfRequestLogID}return e};var sh="1.0",V5=/^[A-Za-z0-9_.-]+$/;function Yx(e){if(!e)throw Error("profile name is empty");if(e==="."||e==="..")throw Error(`profile name "${e}" is not allowed`);if(e.includes("/")||e.includes("\\"))throw Error(`profile name "${e}" must not contain path separators`);if(!V5.test(e))throw Error(`profile name "${e}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var Qx=async(e)=>{var t,r;let i=await Qy();if(i===null)return null;let n=e??await t2();if(n===null)return null;Yx(n);let o=await import("node:fs"),h=(await Promise.resolve().then(() => (Dn(),vo))).join(i,"configs",`${n}.json`),v;try{v=await o.promises.readFile(h,"utf-8")}catch(g){if(g?.code!=="ENOENT")throw Error(`failed to read config file ${h}: ${g}`);v=null}if(v===null){let g=Pt("ANTHROPIC_ORGANIZATION_ID"),S=Pt("ANTHROPIC_IDENTITY_TOKEN_FILE"),x=Pt("ANTHROPIC_FEDERATION_RULE_ID");if(x&&g)return{fromFile:!1,config:{organization_id:g,workspace_id:Pt("ANTHROPIC_WORKSPACE_ID"),base_url:Pt("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:x,service_account_id:Pt("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:S?{source:"file",path:S}:void 0,scope:Pt("ANTHROPIC_SCOPE")}}};return null}let b;try{b=JSON.parse(v)}catch(g){throw Error(`failed to parse config file ${h}: ${g}`)}if(!b.authentication)throw Error(`config file ${h} is missing "authentication"`);let _=b.authentication.type;if(_!=="oidc_federation"&&_!=="user_oauth")throw Error(`authentication.type "${_}" is not a known authentication type`);if(b.organization_id??(b.organization_id=Pt("ANTHROPIC_ORGANIZATION_ID")),b.workspace_id??(b.workspace_id=Pt("ANTHROPIC_WORKSPACE_ID")),b.base_url??(b.base_url=Pt("ANTHROPIC_BASE_URL")),(t=b.authentication).scope??(t.scope=Pt("ANTHROPIC_SCOPE")),b.authentication.type==="oidc_federation"){if(!b.authentication.identity_token){let g=Pt("ANTHROPIC_IDENTITY_TOKEN_FILE");if(g)b.authentication.identity_token={source:"file",path:g}}if(!b.authentication.federation_rule_id)b.authentication.federation_rule_id=Pt("ANTHROPIC_FEDERATION_RULE_ID")??"";(r=b.authentication).service_account_id??(r.service_account_id=Pt("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:b,fromFile:!0}};var e2=async(e,t)=>{if(e?.authentication.credentials_path)return e.authentication.credentials_path;let r=await Qy();if(!r)return null;let i=t??await t2();if(!i)return null;return Yx(i),(await Promise.resolve().then(() => (Dn(),vo))).join(r,"credentials",`${i}.json`)},Qy=async()=>{if(!W5())return null;let e=await Promise.resolve().then(() => (Dn(),vo)),t=Pt("ANTHROPIC_CONFIG_DIR");if(t)return t;if(Hu()["X-Stainless-OS"]==="Windows"){let o=Pt("APPDATA");if(o)return e.join(o,"Anthropic");let s=Pt("USERPROFILE");if(s)return e.join(s,"AppData","Roaming","Anthropic");return null}let i=Pt("XDG_CONFIG_HOME");if(i)return e.join(i,"anthropic");let n=Pt("HOME");if(n)return e.join(n,".config","anthropic");return null},W5=()=>{let e=Hu()["X-Stainless-Runtime"];return e==="node"||e==="deno"},t2=async()=>{let e=await Qy();if(!e)return null;let t=Pt("ANTHROPIC_PROFILE");if(t)return t;let r=await import("node:fs"),n=(await Promise.resolve().then(() => (Dn(),vo))).join(e,"active_config");try{return(await r.promises.readFile(n,"utf-8")).trim()||"default"}catch(o){if(o?.code!=="ENOENT")throw Error(`failed to read ${n}: ${o}`);return"default"}};function ev(e){if(!e)throw new Ye("Identity token file path is empty");return async()=>{let t=await import("node:fs"),r;try{r=await t.promises.readFile(e,"utf-8")}catch(n){throw new Ye(`Failed to read identity token file at ${e}: ${n}`)}let i=r.trim();if(!i)throw new Ye(`Identity token file at ${e} is empty`);return i}}function r2(e){if(!e)throw new Ye("Identity token value is empty");return()=>e}function n2(e){return async()=>{eh(e.baseURL);let t=await e.identityTokenProvider();if(t.length>16384)throw new Rt(`Identity token is ${Math.ceil(t.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:Bx,assertion:t,federation_rule_id:e.federationRuleId,organization_id:e.organizationId};if(e.serviceAccountId)r.service_account_id=e.serviceAccountId;if(e.workspaceId)r.workspace_id=e.workspaceId;let i=`${e.baseURL}${Qf}`,n;try{n=await e.fetch(i,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${To},${Zx}`,"User-Agent":e.userAgent||`anthropic-sdk-typescript/${Mn} oidcFederationProvider`},body:JSON.stringify(r)})}catch(v){throw new Rt(`Failed to reach token endpoint ${i}: ${v}`)}let o=n.headers.get("Request-Id");if(!n.ok){let v=await n.text().catch(()=>""),b=nn(v),_="";if(n.status===401)_=` Ensure your federation rule matches your identity token. ${e.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`;throw new Rt(`Token exchange failed with status ${n.status}${o?` (request-id ${o})`:""}: ${b}${_}`,n.status,b,o)}let s=await th(n,o),h=Number(s.expires_in);if(!Number.isFinite(h))throw new Rt(`Token endpoint response missing required fields: ${JSON.stringify(nn(s))}`,n.status,nn(s),o);return{token:s.access_token,expiresAt:zn()+h}}}function i2(e){return async(t)=>{let r=await import("node:fs");await rh(e.credentialsPath,e.onSafetyWarning);let i;try{i=await r.promises.readFile(e.credentialsPath,"utf-8")}catch($){throw new Rt(`Credentials file not found at ${e.credentialsPath}: ${$}`)}let n;try{n=JSON.parse(i)}catch($){throw new Rt(`Credentials file at ${e.credentialsPath} is not valid JSON: ${$}`)}let o=n.access_token;if(!o)throw new Rt(`Credentials file at ${e.credentialsPath} must include 'access_token'`);let s=n.expires_at;if(!t?.forceRefresh&&(s==null||zn()<s-$s))return{token:o,expiresAt:s??null};let h=n.refresh_token;if(!e.clientId||!h)throw new Rt(`Access token at ${e.credentialsPath} has expired and no refresh is available (client_id ${e.clientId?"set":"empty"}, refresh_token ${h?"set":"empty"})`);eh(e.baseURL);let v={grant_type:Hx,refresh_token:h,client_id:e.clientId},b=`${e.baseURL}${Qf}`,_;try{_=await e.fetch(b,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":To,"User-Agent":e.userAgent||`anthropic-sdk-typescript/${Mn} userOAuthProvider`},body:JSON.stringify(v)})}catch($){throw new Rt(`User OAuth refresh failed to reach token endpoint: ${$}`)}let g=_.headers.get("Request-Id");if(!_.ok){let $=await _.text().catch(()=>"");throw new Rt(`User OAuth refresh failed (HTTP ${_.status}): ${nn($)}`,_.status,nn($),g)}let S=await th(_,g),x=Number(S.expires_in);if(!Number.isFinite(x))throw new Rt(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(nn(S))}`,_.status,nn(S),g);let M=zn()+x,I=S.refresh_token||h;return await nh(e.credentialsPath,{...n,version:sh,type:"oauth_token",access_token:S.access_token,expires_at:M,refresh_token:I}),{token:S.access_token,expiresAt:M}}}function tv(e,t){let r=e.authentication.credentials_path??null,i=(e.base_url||t.baseURL).replace(/\/+$/,""),n=G5(e,r,i,t),o={};if(e.workspace_id&&e.authentication.type==="user_oauth")o["anthropic-workspace-id"]=e.workspace_id;return{provider:n,extraHeaders:o,baseURL:e.base_url||void 0}}async function o2(e,t){let r=await Qx(t);if(!r)return null;let{config:i,fromFile:n}=r,o=i.authentication.credentials_path||!n?i:{...i,authentication:{...i.authentication,credentials_path:await e2(i,t)??void 0}};return tv(o,e)}function G5(e,t,r,i){switch(e.authentication.type){case"oidc_federation":{let n=e.authentication,o=J5(n);if(!o)throw new Rt("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!n.federation_rule_id)throw new Rt("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence).");if(!e.organization_id)throw new Rt("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let s=n2({identityTokenProvider:o,federationRuleId:n.federation_rule_id,organizationId:e.organization_id,serviceAccountId:n.service_account_id,workspaceId:e.workspace_id,baseURL:r,fetch:i.fetch,userAgent:i.userAgent});if(t)return X5(s,t,i.onCacheWriteError,i.onSafetyWarning);return s}case"user_oauth":{if(!t)throw new Rt("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to <config_dir>/credentials/<profile>.json)");return i2({credentialsPath:t,clientId:e.authentication.client_id,baseURL:r,fetch:i.fetch,userAgent:i.userAgent,onSafetyWarning:i.onSafetyWarning})}default:{let n=e.authentication.type;throw new Rt(`authentication.type "${n}" is not a known authentication type`)}}}function J5(e){if(e.identity_token){let i=e.identity_token.source;if(i!=="file")throw new Rt(`identity_token.source "${i}" is not supported by this SDK version (only "file")`);if(!e.identity_token.path)throw new Rt('identity_token.source "file" requires a non-empty path');return ev(e.identity_token.path)}let t=Pt("ANTHROPIC_IDENTITY_TOKEN_FILE");if(t)return ev(t);let r=Pt("ANTHROPIC_IDENTITY_TOKEN");if(r)return r2(r);return null}function X5(e,t,r,i){return async(n)=>{let o=await import("node:fs");await rh(t,i);let s;try{let v=await o.promises.readFile(t,"utf-8");s=JSON.parse(v);let b=s?.access_token;if(b&&!n?.forceRefresh){let _=s?.expires_at;if(_==null||zn()<_-$s)return{token:b,expiresAt:_??null}}}catch(v){if(v?.code!=="ENOENT"&&!(v instanceof SyntaxError))r?.(v)}let h=await e(n);try{await nh(t,{...s??{},version:sh,type:"oauth_token",access_token:h.token,expires_at:h.expiresAt})}catch(v){r?.(v)}return h}}var hn,pn;class Zi{constructor(){hn.set(this,void 0),pn.set(this,void 0),We(this,hn,new Uint8Array,"f"),We(this,pn,null,"f")}decode(e){if(e==null)return[];let t=e instanceof ArrayBuffer?new Uint8Array(e):typeof e==="string"?Ts(e):e;We(this,hn,Jx([oe(this,hn,"f"),t]),"f");let r=[],i;while((i=Y5(oe(this,hn,"f"),oe(this,pn,"f")))!=null){if(i.carriage&&oe(this,pn,"f")==null){We(this,pn,i.index,"f");continue}if(oe(this,pn,"f")!=null&&(i.index!==oe(this,pn,"f")+1||i.carriage)){r.push(Xy(oe(this,hn,"f").subarray(0,oe(this,pn,"f")-1))),We(this,hn,oe(this,hn,"f").subarray(oe(this,pn,"f")),"f"),We(this,pn,null,"f");continue}let n=oe(this,pn,"f")!==null?i.preceding-1:i.preceding,o=Xy(oe(this,hn,"f").subarray(0,n));r.push(o),We(this,hn,oe(this,hn,"f").subarray(i.index),"f"),We(this,pn,null,"f")}return r}flush(){if(!oe(this,hn,"f").length)return[];return this.decode(`
|
|
54
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);else if(r.cycles==="ref")o(b);continue}if(_.count>1){if(r.reused==="ref"){o(b);continue}}}let s=(b,_)=>{let g=this.seen.get(b),S=g.def??g.schema,x={...S};if(g.ref===null)return;let M=g.ref;if(g.ref=null,M){s(M,_);let I=this.seen.get(M).schema;if(I.$ref&&_.target==="draft-7")S.allOf=S.allOf??[],S.allOf.push(I);else Object.assign(S,I),Object.assign(S,x)}if(!g.isParent)this.override({zodSchema:b,jsonSchema:S,path:g.path??[]})};for(let b of[...this.seen.entries()].reverse())s(b[0],{target:this.target});let h={};if(this.target==="draft-2020-12")h.$schema="https://json-schema.org/draft/2020-12/schema";else if(this.target==="draft-7")h.$schema="http://json-schema.org/draft-07/schema#";else console.warn(`Invalid target: ${this.target}`);Object.assign(h,i.def);let v=r.external?.defs??{};for(let b of this.seen.entries()){let _=b[1];if(_.def&&_.defId)v[_.defId]=_.def}if(!r.external&&Object.keys(v).length>0)if(this.target==="draft-2020-12")h.$defs=v;else h.definitions=v;try{return JSON.parse(JSON.stringify(h))}catch(b){throw Error("Error converting schema to JSON.")}}}function xs(e,t){if(e instanceof Ka){let i=new Df(t),n={};for(let h of e._idmap.entries()){let[v,b]=h;i.process(b)}let o={},s={registry:e,uri:t?.uri||((h)=>h),defs:n};for(let h of e._idmap.entries()){let[v,b]=h;o[v]=i.emit(b,{...t,external:s})}if(Object.keys(n).length>0){let h=i.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[h]:n}}return{schemas:o}}let r=new Df(t);return r.process(e),r.emit(e,t)}function _r(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;switch(n.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return _r(n.element,r);case"object":{for(let o in n.shape)if(_r(n.shape[o],r))return!0;return!1}case"union":{for(let o of n.options)if(_r(o,r))return!0;return!1}case"intersection":return _r(n.left,r)||_r(n.right,r);case"tuple":{for(let o of n.items)if(_r(o,r))return!0;if(n.rest&&_r(n.rest,r))return!0;return!1}case"record":return _r(n.keyType,r)||_r(n.valueType,r);case"map":return _r(n.keyType,r)||_r(n.valueType,r);case"set":return _r(n.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return _r(n.innerType,r);case"lazy":return _r(n.getter(),r);case"default":return _r(n.innerType,r);case"prefault":return _r(n.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return _r(n.in,r)||_r(n.out,r);case"success":return!1;case"catch":return!1;default:}throw Error(`Unknown schema type: ${n.type}`)}var LS={};var ks={};wn(ks,{time:()=>uy,duration:()=>ly,datetime:()=>sy,date:()=>ay,ZodISOTime:()=>jf,ZodISODuration:()=>Uf,ZodISODateTime:()=>Nf,ZodISODate:()=>zf});var Nf=ne("ZodISODateTime",(e,t)=>{tg.init(e,t),Ut.init(e,t)});function sy(e){return Zg(Nf,e)}var zf=ne("ZodISODate",(e,t)=>{rg.init(e,t),Ut.init(e,t)});function ay(e){return Kg(zf,e)}var jf=ne("ZodISOTime",(e,t)=>{ng.init(e,t),Ut.init(e,t)});function uy(e){return Vg(jf,e)}var Uf=ne("ZodISODuration",(e,t)=>{ig.init(e,t),Ut.init(e,t)});function ly(e){return Wg(Uf,e)}var qS=(e,t)=>{La.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:(r)=>fs(e,r)},flatten:{value:(r)=>ds(e,r)},addIssue:{value:(r)=>e.issues.push(r)},addIssues:{value:(r)=>e.issues.push(...r)},isEmpty:{get(){return e.issues.length===0}}})},k9=ne("ZodError",qS),Ms=ne("ZodError",qS,{Parent:Error});var cy=ed(Ms),dy=td(Ms),fy=rd(Ms),hy=nd(Ms);var vt=ne("ZodType",(e,t)=>(ut.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map((i)=>typeof i==="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),e.clone=(r,i)=>Ur(e,r,i),e.brand=()=>e,e.register=(r,i)=>(r.add(e,i),e),e.parse=(r,i)=>cy(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>fy(e,r,i),e.parseAsync=async(r,i)=>dy(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>hy(e,r,i),e.spa=e.safeParseAsync,e.refine=(r,i)=>e.check(Sx(r,i)),e.superRefine=(r)=>e.check(xx(r)),e.overwrite=(r)=>e.check(fi(r)),e.optional=()=>Lt(e),e.nullable=()=>Ff(e),e.nullish=()=>Lt(Ff(e)),e.nonoptional=(r)=>cx(e,r),e.array=()=>_t(e),e.or=(r)=>Dt([e,r]),e.and=(r)=>Cu(e,r),e.transform=(r)=>qf(e,zy(r)),e.default=(r)=>ax(e,r),e.prefault=(r)=>lx(e,r),e.catch=(r)=>hx(e,r),e.pipe=(r)=>qf(e,r),e.readonly=()=>gx(e),e.describe=(r)=>{let i=e.clone();return tn.add(i,{description:r}),i},Object.defineProperty(e,"description",{get(){return tn.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return tn.get(e);let i=e.clone();return tn.add(i,r[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),my=ne("_ZodString",(e,t)=>{qi.init(e,t),vt.init(e,t);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...i)=>e.check(gu(...i)),e.includes=(...i)=>e.check(bu(...i)),e.startsWith=(...i)=>e.check(_u(...i)),e.endsWith=(...i)=>e.check(wu(...i)),e.min=(...i)=>e.check(Hi(...i)),e.max=(...i)=>e.check(ws(...i)),e.length=(...i)=>e.check(Ss(...i)),e.nonempty=(...i)=>e.check(Hi(1,...i)),e.lowercase=(i)=>e.check(yu(i)),e.uppercase=(i)=>e.check(vu(i)),e.trim=()=>e.check(ku()),e.normalize=(...i)=>e.check(xu(...i)),e.toLowerCase=()=>e.check(Mu()),e.toUpperCase=()=>e.check(Eu())}),Tu=ne("ZodString",(e,t)=>{qi.init(e,t),my.init(e,t),e.email=(r)=>e.check(Wa(gy,r)),e.url=(r)=>e.check(Qa(yy,r)),e.jwt=(r)=>e.check(pu(Ry,r)),e.emoji=(r)=>e.check(eu(vy,r)),e.guid=(r)=>e.check(bs(Lf,r)),e.uuid=(r)=>e.check(Ga(hi,r)),e.uuidv4=(r)=>e.check(Ja(hi,r)),e.uuidv6=(r)=>e.check(Xa(hi,r)),e.uuidv7=(r)=>e.check(Ya(hi,r)),e.nanoid=(r)=>e.check(tu(by,r)),e.guid=(r)=>e.check(bs(Lf,r)),e.cuid=(r)=>e.check(ru(_y,r)),e.cuid2=(r)=>e.check(nu(wy,r)),e.ulid=(r)=>e.check(iu(Sy,r)),e.base64=(r)=>e.check(du(Ty,r)),e.base64url=(r)=>e.check(fu(Py,r)),e.xid=(r)=>e.check(ou(xy,r)),e.ksuid=(r)=>e.check(su(ky,r)),e.ipv4=(r)=>e.check(au(My,r)),e.ipv6=(r)=>e.check(uu(Ey,r)),e.cidrv4=(r)=>e.check(lu(Iy,r)),e.cidrv6=(r)=>e.check(cu($y,r)),e.e164=(r)=>e.check(hu(Ay,r)),e.datetime=(r)=>e.check(sy(r)),e.date=(r)=>e.check(ay(r)),e.time=(r)=>e.check(uy(r)),e.duration=(r)=>e.check(ly(r))});function de(e){return lf(Tu,e)}var Ut=ne("ZodStringFormat",(e,t)=>{Ot.init(e,t),my.init(e,t)}),gy=ne("ZodEmail",(e,t)=>{fd.init(e,t),Ut.init(e,t)});function E9(e){return Wa(gy,e)}var Lf=ne("ZodGUID",(e,t)=>{cd.init(e,t),Ut.init(e,t)});function I9(e){return bs(Lf,e)}var hi=ne("ZodUUID",(e,t)=>{dd.init(e,t),Ut.init(e,t)});function $9(e){return Ga(hi,e)}function T9(e){return Ja(hi,e)}function P9(e){return Xa(hi,e)}function A9(e){return Ya(hi,e)}var yy=ne("ZodURL",(e,t)=>{hd.init(e,t),Ut.init(e,t)});function R9(e){return Qa(yy,e)}var vy=ne("ZodEmoji",(e,t)=>{pd.init(e,t),Ut.init(e,t)});function C9(e){return eu(vy,e)}var by=ne("ZodNanoID",(e,t)=>{md.init(e,t),Ut.init(e,t)});function O9(e){return tu(by,e)}var _y=ne("ZodCUID",(e,t)=>{gd.init(e,t),Ut.init(e,t)});function D9(e){return ru(_y,e)}var wy=ne("ZodCUID2",(e,t)=>{yd.init(e,t),Ut.init(e,t)});function N9(e){return nu(wy,e)}var Sy=ne("ZodULID",(e,t)=>{vd.init(e,t),Ut.init(e,t)});function z9(e){return iu(Sy,e)}var xy=ne("ZodXID",(e,t)=>{bd.init(e,t),Ut.init(e,t)});function j9(e){return ou(xy,e)}var ky=ne("ZodKSUID",(e,t)=>{_d.init(e,t),Ut.init(e,t)});function U9(e){return su(ky,e)}var My=ne("ZodIPv4",(e,t)=>{wd.init(e,t),Ut.init(e,t)});function L9(e){return au(My,e)}var Ey=ne("ZodIPv6",(e,t)=>{Sd.init(e,t),Ut.init(e,t)});function F9(e){return uu(Ey,e)}var Iy=ne("ZodCIDRv4",(e,t)=>{xd.init(e,t),Ut.init(e,t)});function q9(e){return lu(Iy,e)}var $y=ne("ZodCIDRv6",(e,t)=>{kd.init(e,t),Ut.init(e,t)});function B9(e){return cu($y,e)}var Ty=ne("ZodBase64",(e,t)=>{Md.init(e,t),Ut.init(e,t)});function H9(e){return du(Ty,e)}var Py=ne("ZodBase64URL",(e,t)=>{Ed.init(e,t),Ut.init(e,t)});function Z9(e){return fu(Py,e)}var Ay=ne("ZodE164",(e,t)=>{Id.init(e,t),Ut.init(e,t)});function K9(e){return hu(Ay,e)}var Ry=ne("ZodJWT",(e,t)=>{$d.init(e,t),Ut.init(e,t)});function V9(e){return pu(Ry,e)}var BS=ne("ZodCustomStringFormat",(e,t)=>{Td.init(e,t),Ut.init(e,t)});function W9(e,t,r={}){return Cf(BS,e,t,r)}var Pu=ne("ZodNumber",(e,t)=>{Fa.init(e,t),vt.init(e,t),e.gt=(i,n)=>e.check(di(i,n)),e.gte=(i,n)=>e.check(rn(i,n)),e.min=(i,n)=>e.check(rn(i,n)),e.lt=(i,n)=>e.check(ci(i,n)),e.lte=(i,n)=>e.check(kn(i,n)),e.max=(i,n)=>e.check(kn(i,n)),e.int=(i)=>e.check(py(i)),e.safe=(i)=>e.check(py(i)),e.positive=(i)=>e.check(di(0,i)),e.nonnegative=(i)=>e.check(rn(0,i)),e.negative=(i)=>e.check(ci(0,i)),e.nonpositive=(i)=>e.check(kn(0,i)),e.multipleOf=(i,n)=>e.check(Eo(i,n)),e.step=(i,n)=>e.check(Eo(i,n)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??0.5),e.isFinite=!0,e.format=r.format??null});function It(e){return df(Pu,e)}var Es=ne("ZodNumberFormat",(e,t)=>{Pd.init(e,t),Pu.init(e,t)});function py(e){return ff(Es,e)}function G9(e){return hf(Es,e)}function J9(e){return pf(Es,e)}function X9(e){return mf(Es,e)}function Y9(e){return gf(Es,e)}var Au=ne("ZodBoolean",(e,t)=>{ps.init(e,t),vt.init(e,t)});function or(e){return yf(Au,e)}var Ru=ne("ZodBigInt",(e,t)=>{qa.init(e,t),vt.init(e,t),e.gte=(i,n)=>e.check(rn(i,n)),e.min=(i,n)=>e.check(rn(i,n)),e.gt=(i,n)=>e.check(di(i,n)),e.gte=(i,n)=>e.check(rn(i,n)),e.min=(i,n)=>e.check(rn(i,n)),e.lt=(i,n)=>e.check(ci(i,n)),e.lte=(i,n)=>e.check(kn(i,n)),e.max=(i,n)=>e.check(kn(i,n)),e.positive=(i)=>e.check(di(BigInt(0),i)),e.negative=(i)=>e.check(ci(BigInt(0),i)),e.nonpositive=(i)=>e.check(kn(BigInt(0),i)),e.nonnegative=(i)=>e.check(rn(BigInt(0),i)),e.multipleOf=(i,n)=>e.check(Eo(i,n));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function Q9(e){return vf(Ru,e)}var Cy=ne("ZodBigIntFormat",(e,t)=>{Ad.init(e,t),Ru.init(e,t)});function e5(e){return bf(Cy,e)}function t5(e){return _f(Cy,e)}var HS=ne("ZodSymbol",(e,t)=>{Rd.init(e,t),vt.init(e,t)});function r5(e){return wf(HS,e)}var ZS=ne("ZodUndefined",(e,t)=>{Cd.init(e,t),vt.init(e,t)});function n5(e){return Sf(ZS,e)}var KS=ne("ZodNull",(e,t)=>{Od.init(e,t),vt.init(e,t)});function Bf(e){return xf(KS,e)}var VS=ne("ZodAny",(e,t)=>{Dd.init(e,t),vt.init(e,t)});function i5(){return kf(VS)}var WS=ne("ZodUnknown",(e,t)=>{ko.init(e,t),vt.init(e,t)});function qt(){return Mo(WS)}var GS=ne("ZodNever",(e,t)=>{Nd.init(e,t),vt.init(e,t)});function Hf(e){return Mf(GS,e)}var JS=ne("ZodVoid",(e,t)=>{zd.init(e,t),vt.init(e,t)});function o5(e){return Ef(JS,e)}var Zf=ne("ZodDate",(e,t)=>{jd.init(e,t),vt.init(e,t),e.min=(i,n)=>e.check(rn(i,n)),e.max=(i,n)=>e.check(kn(i,n));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function s5(e){return If(Zf,e)}var XS=ne("ZodArray",(e,t)=>{ms.init(e,t),vt.init(e,t),e.element=t.element,e.min=(r,i)=>e.check(Hi(r,i)),e.nonempty=(r)=>e.check(Hi(1,r)),e.max=(r,i)=>e.check(ws(r,i)),e.length=(r,i)=>e.check(Ss(r,i)),e.unwrap=()=>e.element});function _t(e,t){return Iu(XS,e,t)}function a5(e){let t=e._zod.def.shape;return tt(Object.keys(t))}var Kf=ne("ZodObject",(e,t)=>{Ba.init(e,t),vt.init(e,t),Be.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>Vr(Object.keys(e._zod.def.shape)),e.catchall=(r)=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:qt()}),e.loose=()=>e.clone({...e._zod.def,catchall:qt()}),e.strict=()=>e.clone({...e._zod.def,catchall:Hf()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=(r)=>Be.extend(e,r),e.merge=(r)=>Be.merge(e,r),e.pick=(r)=>Be.pick(e,r),e.omit=(r)=>Be.omit(e,r),e.partial=(...r)=>Be.partial(jy,e,r[0]),e.required=(...r)=>Be.required(Uy,e,r[0])});function Qe(e,t){let r={type:"object",get shape(){return Be.assignProp(this,"shape",{...e}),this.shape},...Be.normalizeParams(t)};return new Kf(r)}function u5(e,t){return new Kf({type:"object",get shape(){return Be.assignProp(this,"shape",{...e}),this.shape},catchall:Hf(),...Be.normalizeParams(t)})}function Lr(e,t){return new Kf({type:"object",get shape(){return Be.assignProp(this,"shape",{...e}),this.shape},catchall:qt(),...Be.normalizeParams(t)})}var Oy=ne("ZodUnion",(e,t)=>{Ha.init(e,t),vt.init(e,t),e.options=t.options});function Dt(e,t){return new Oy({type:"union",options:e,...Be.normalizeParams(t)})}var YS=ne("ZodDiscriminatedUnion",(e,t)=>{Oy.init(e,t),Ud.init(e,t)});function Vf(e,t,r){return new YS({type:"union",options:t,discriminator:e,...Be.normalizeParams(r)})}var QS=ne("ZodIntersection",(e,t)=>{Ld.init(e,t),vt.init(e,t)});function Cu(e,t){return new QS({type:"intersection",left:e,right:t})}var ex=ne("ZodTuple",(e,t)=>{Bi.init(e,t),vt.init(e,t),e.rest=(r)=>e.clone({...e._zod.def,rest:r})});function l5(e,t,r){let i=t instanceof ut,n=i?r:t;return new ex({type:"tuple",items:e,rest:i?t:null,...Be.normalizeParams(n)})}var Dy=ne("ZodRecord",(e,t)=>{Fd.init(e,t),vt.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Nt(e,t,r){return new Dy({type:"record",keyType:e,valueType:t,...Be.normalizeParams(r)})}function c5(e,t,r){return new Dy({type:"record",keyType:Dt([e,Hf()]),valueType:t,...Be.normalizeParams(r)})}var tx=ne("ZodMap",(e,t)=>{qd.init(e,t),vt.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function d5(e,t,r){return new tx({type:"map",keyType:e,valueType:t,...Be.normalizeParams(r)})}var rx=ne("ZodSet",(e,t)=>{Bd.init(e,t),vt.init(e,t),e.min=(...r)=>e.check(Io(...r)),e.nonempty=(r)=>e.check(Io(1,r)),e.max=(...r)=>e.check(_s(...r)),e.size=(...r)=>e.check(mu(...r))});function f5(e,t){return new rx({type:"set",valueType:e,...Be.normalizeParams(t)})}var $u=ne("ZodEnum",(e,t)=>{Hd.init(e,t),vt.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(i,n)=>{let o={};for(let s of i)if(r.has(s))o[s]=t.entries[s];else throw Error(`Key ${s} not found in enum`);return new $u({...t,checks:[],...Be.normalizeParams(n),entries:o})},e.exclude=(i,n)=>{let o={...t.entries};for(let s of i)if(r.has(s))delete o[s];else throw Error(`Key ${s} not found in enum`);return new $u({...t,checks:[],...Be.normalizeParams(n),entries:o})}});function Vr(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((i)=>[i,i])):e;return new $u({type:"enum",entries:r,...Be.normalizeParams(t)})}function h5(e,t){return new $u({type:"enum",entries:e,...Be.normalizeParams(t)})}var nx=ne("ZodLiteral",(e,t)=>{Zd.init(e,t),vt.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function tt(e,t){return new nx({type:"literal",values:Array.isArray(e)?e:[e],...Be.normalizeParams(t)})}var ix=ne("ZodFile",(e,t)=>{Kd.init(e,t),vt.init(e,t),e.min=(r,i)=>e.check(Io(r,i)),e.max=(r,i)=>e.check(_s(r,i)),e.mime=(r,i)=>e.check(Su(Array.isArray(r)?r:[r],i))});function p5(e){return Tf(ix,e)}var Ny=ne("ZodTransform",(e,t)=>{gs.init(e,t),vt.init(e,t),e._zod.parse=(r,i)=>{r.addIssue=(o)=>{if(typeof o==="string")r.issues.push(Be.issue(o,r.value,t));else{let s=o;if(s.fatal)s.continue=!1;s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),s.continue??(s.continue=!0),r.issues.push(Be.issue(s))}};let n=t.transform(r.value,r);if(n instanceof Promise)return n.then((o)=>(r.value=o,r));return r.value=n,r}});function zy(e){return new Ny({type:"transform",transform:e})}var jy=ne("ZodOptional",(e,t)=>{Vd.init(e,t),vt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Lt(e){return new jy({type:"optional",innerType:e})}var ox=ne("ZodNullable",(e,t)=>{Wd.init(e,t),vt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ff(e){return new ox({type:"nullable",innerType:e})}function m5(e){return Lt(Ff(e))}var sx=ne("ZodDefault",(e,t)=>{Gd.init(e,t),vt.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ax(e,t){return new sx({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():t}})}var ux=ne("ZodPrefault",(e,t)=>{Jd.init(e,t),vt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function lx(e,t){return new ux({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():t}})}var Uy=ne("ZodNonOptional",(e,t)=>{Xd.init(e,t),vt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function cx(e,t){return new Uy({type:"nonoptional",innerType:e,...Be.normalizeParams(t)})}var dx=ne("ZodSuccess",(e,t)=>{Yd.init(e,t),vt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function g5(e){return new dx({type:"success",innerType:e})}var fx=ne("ZodCatch",(e,t)=>{Qd.init(e,t),vt.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function hx(e,t){return new fx({type:"catch",innerType:e,catchValue:typeof t==="function"?t:()=>t})}var px=ne("ZodNaN",(e,t)=>{ef.init(e,t),vt.init(e,t)});function y5(e){return $f(px,e)}var Ly=ne("ZodPipe",(e,t)=>{ys.init(e,t),vt.init(e,t),e.in=t.in,e.out=t.out});function qf(e,t){return new Ly({type:"pipe",in:e,out:t})}var mx=ne("ZodReadonly",(e,t)=>{tf.init(e,t),vt.init(e,t)});function gx(e){return new mx({type:"readonly",innerType:e})}var yx=ne("ZodTemplateLiteral",(e,t)=>{rf.init(e,t),vt.init(e,t)});function v5(e,t){return new yx({type:"template_literal",parts:e,...Be.normalizeParams(t)})}var vx=ne("ZodLazy",(e,t)=>{of.init(e,t),vt.init(e,t),e.unwrap=()=>e._zod.def.getter()});function bx(e){return new vx({type:"lazy",getter:e})}var _x=ne("ZodPromise",(e,t)=>{nf.init(e,t),vt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function b5(e){return new _x({type:"promise",innerType:e})}var Wf=ne("ZodCustom",(e,t)=>{sf.init(e,t),vt.init(e,t)});function wx(e,t){let r=new Ht({check:"custom",...Be.normalizeParams(t)});return r._zod.check=e,r}function Fy(e,t){return Pf(Wf,e??(()=>!0),t)}function Sx(e,t={}){return Af(Wf,e,t)}function xx(e,t){let r=wx((i)=>(i.addIssue=(n)=>{if(typeof n==="string")i.issues.push(Be.issue(n,i.value,r._zod.def));else{let o=n;if(o.fatal)o.continue=!1;o.code??(o.code="custom"),o.input??(o.input=i.value),o.inst??(o.inst=r),o.continue??(o.continue=!r._zod.def.abort),i.issues.push(Be.issue(o))}},e(i.value,i)),t);return r}function _5(e,t={error:`Input not instance of ${e.name}`}){let r=new Wf({type:"custom",check:"custom",fn:(i)=>i instanceof e,abort:!0,...Be.normalizeParams(t)});return r._zod.bag.Class=e,r}var w5=(...e)=>Rf({Pipe:Ly,Boolean:Au,String:Tu,Transform:Ny},...e);function S5(e){let t=bx(()=>Dt([de(e),It(),or(),Bf(),_t(t),Nt(de(),t)]));return t}function Gf(e,t){return qf(zy(e),t)}var x5={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 k5(e){rr({customError:e})}function M5(){return rr().customError}var qy={};wn(qy,{string:()=>E5,number:()=>I5,date:()=>P5,boolean:()=>$5,bigint:()=>T5});function E5(e){return Hg(Tu,e)}function I5(e){return Gg(Pu,e)}function $5(e){return Jg(Au,e)}function T5(e){return Xg(Ru,e)}function P5(e){return Yg(Zf,e)}rr(Za());var kx={"//":"Hand-maintained baked-in model catalog — the source of truth for per-model provider IDs and metadata. On model launch add one entry to `models` below; `bun run generate:model-catalog` validates this file against the schema and formats it.",schema_version:1,pricing_tiers:{tier_3_15:{input:3,output:15,cache_write_5m:3.75,cache_write_1h:6,cache_read:0.3,web_search:0.01},tier_5_25:{input:5,output:25,cache_write_5m:6.25,cache_write_1h:10,cache_read:0.5,web_search:0.01},tier_15_75:{input:15,output:75,cache_write_5m:18.75,cache_write_1h:30,cache_read:1.5,web_search:0.01},tier_10_50:{input:10,output:50,cache_write_5m:12.5,cache_write_1h:20,cache_read:1,web_search:0.01},haiku_35:{input:0.8,output:4,cache_write_5m:1,cache_write_1h:1.6,cache_read:0.08,web_search:0.01},haiku_45:{input:1,output:5,cache_write_5m:1.25,cache_write_1h:2,cache_read:0.1,web_search:0.01}},models:[{id:"claude-3-5-haiku",family:"haiku",display_name:"Haiku 3.5",provider_ids:{first_party:"claude-3-5-haiku-20241022",bedrock:"us.anthropic.claude-3-5-haiku-20241022-v1:0",vertex:"claude-3-5-haiku@20241022",foundry:"claude-3-5-haiku",anthropic_aws:"claude-3-5-haiku-20241022",mantle:null,gateway:"claude-3-5-haiku-20241022"},eager_input_streaming:{vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_3_5_HAIKU",max_output_tokens:{default:8192,upper:8192},pricing:"haiku_35",capabilities:[]},{id:"claude-haiku-4-5",family:"haiku",display_name:"Haiku 4.5",knowledge_cutoff:"February 2025",provider_ids:{first_party:"claude-haiku-4-5-20251001",bedrock:"us.anthropic.claude-haiku-4-5-20251001-v1:0",vertex:"claude-haiku-4-5@20251001",foundry:"claude-haiku-4-5",anthropic_aws:"claude-haiku-4-5-20251001",mantle:"anthropic.claude-haiku-4-5",gateway:"claude-haiku-4-5-20251001"},vertex_region_env_var:"VERTEX_REGION_CLAUDE_HAIKU_4_5",context:{window:200000,supports_1m_suffix:!0},max_output_tokens:{default:32000,upper:64000},pricing:"haiku_45",capabilities:["context_management"],advisor_rank:1},{id:"claude-3-5-sonnet",family:"sonnet",display_name:"Sonnet 3.5",provider_ids:{first_party:"claude-3-5-sonnet-20241022",bedrock:"us.anthropic.claude-3-5-sonnet-20241022-v2:0",vertex:"claude-3-5-sonnet-v2@20241022",foundry:"claude-3-5-sonnet",anthropic_aws:"claude-3-5-sonnet-20241022",mantle:null,gateway:"claude-3-5-sonnet-20241022"},vertex_region_env_var:"VERTEX_REGION_CLAUDE_3_5_SONNET",max_output_tokens:{default:8192,upper:8192},pricing:"tier_3_15",capabilities:[]},{id:"claude-3-7-sonnet",family:"sonnet",display_name:"Sonnet 3.7",provider_ids:{first_party:"claude-3-7-sonnet-20250219",bedrock:"us.anthropic.claude-3-7-sonnet-20250219-v1:0",vertex:"claude-3-7-sonnet@20250219",foundry:"claude-3-7-sonnet",anthropic_aws:"claude-3-7-sonnet-20250219",mantle:null,gateway:"claude-3-7-sonnet-20250219"},vertex_region_env_var:"VERTEX_REGION_CLAUDE_3_7_SONNET",max_output_tokens:{default:32000,upper:64000},pricing:"tier_3_15",capabilities:[]},{id:"claude-sonnet-4-0",family:"sonnet",display_name:"Sonnet 4",knowledge_cutoff:"January 2025",provider_ids:{first_party:"claude-sonnet-4-20250514",bedrock:"us.anthropic.claude-sonnet-4-20250514-v1:0",vertex:"claude-sonnet-4@20250514",foundry:"claude-sonnet-4",anthropic_aws:"claude-sonnet-4-20250514",mantle:null,gateway:"claude-sonnet-4-20250514"},eager_input_streaming:{vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_0_SONNET",context:{window:200000,supports_1m_beta:!0,supports_1m_suffix:!0},max_output_tokens:{default:32000,upper:64000},pricing:"tier_3_15",capabilities:["context_management"]},{id:"claude-sonnet-4-5",family:"sonnet",display_name:"Sonnet 4.5",knowledge_cutoff:"January 2025",provider_ids:{first_party:"claude-sonnet-4-5-20250929",bedrock:"us.anthropic.claude-sonnet-4-5-20250929-v1:0",vertex:"claude-sonnet-4-5@20250929",foundry:"claude-sonnet-4-5",anthropic_aws:"claude-sonnet-4-5-20250929",mantle:null,gateway:"claude-sonnet-4-5-20250929"},eager_input_streaming:{vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_5_SONNET",fallback_3p:"claude-sonnet-4-0",context:{window:200000,supports_1m_beta:!0,supports_1m_suffix:!0},max_output_tokens:{default:32000,upper:64000},pricing:"tier_3_15",capabilities:["context_management"]},{id:"claude-sonnet-4-6",family:"sonnet",display_name:"Sonnet 4.6",knowledge_cutoff:"August 2025",provider_ids:{first_party:"claude-sonnet-4-6",bedrock:"us.anthropic.claude-sonnet-4-6",vertex:"claude-sonnet-4-6",foundry:"claude-sonnet-4-6",anthropic_aws:"claude-sonnet-4-6",mantle:null,gateway:"claude-sonnet-4-6"},eager_input_streaming:{bedrock:!0,vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_6_SONNET",fallback_3p:"claude-sonnet-4-5",context:{window:200000,supports_1m_beta:!0,supports_1m_suffix:!0},max_output_tokens:{default:32000,upper:128000},pricing:"tier_3_15",capabilities:["effort","max_effort","adaptive_thinking","context_management"],advisor_rank:2},{id:"claude-sonnet-5",family:"sonnet",display_name:"Sonnet 5",knowledge_cutoff:"January 2026",provider_ids:{first_party:"claude-sonnet-5",bedrock:"us.anthropic.claude-sonnet-5",vertex:"claude-sonnet-5",foundry:"claude-sonnet-5",anthropic_aws:"claude-sonnet-5",mantle:"anthropic.claude-sonnet-5",gateway:"claude-sonnet-5"},eager_input_streaming:{bedrock:!0,vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_5_SONNET",fallback_3p:"claude-sonnet-4-6",context:{window:1e6,native_1m:!0,native_1m_3p:{bedrock:!0,vertex:!0,foundry:!0},supports_1m_beta:!0},max_output_tokens:{default:64000,upper:128000},pricing:"tier_3_15",capabilities:["effort","max_effort","xhigh_effort","adaptive_thinking","mid_conv_system","context_management"],default_effort:"high",image_limits:{maxWidth:2000,maxHeight:2000},advisor_rank:3},{id:"claude-opus-4-0",family:"opus",display_name:"Opus 4",knowledge_cutoff:"January 2025",provider_ids:{first_party:"claude-opus-4-20250514",bedrock:"us.anthropic.claude-opus-4-20250514-v1:0",vertex:"claude-opus-4@20250514",foundry:"claude-opus-4",anthropic_aws:"claude-opus-4-20250514",mantle:null,gateway:"claude-opus-4-20250514"},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_0_OPUS",context:{window:200000,supports_1m_suffix:!0},max_output_tokens:{default:32000,upper:32000},pricing:"tier_15_75",capabilities:["context_management"]},{id:"claude-opus-4-1",family:"opus",display_name:"Opus 4.1",knowledge_cutoff:"January 2025",provider_ids:{first_party:"claude-opus-4-1-20250805",bedrock:"us.anthropic.claude-opus-4-1-20250805-v1:0",vertex:"claude-opus-4-1@20250805",foundry:"claude-opus-4-1",anthropic_aws:"claude-opus-4-1-20250805",mantle:null,gateway:"claude-opus-4-1-20250805"},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_1_OPUS",context:{window:200000,supports_1m_suffix:!0},max_output_tokens:{default:32000,upper:32000},pricing:"tier_15_75",capabilities:["context_management"]},{id:"claude-opus-4-5",family:"opus",display_name:"Opus 4.5",knowledge_cutoff:"May 2025",provider_ids:{first_party:"claude-opus-4-5-20251101",bedrock:"us.anthropic.claude-opus-4-5-20251101-v1:0",vertex:"claude-opus-4-5@20251101",foundry:"claude-opus-4-5",anthropic_aws:"claude-opus-4-5-20251101",mantle:null,gateway:"claude-opus-4-5-20251101"},eager_input_streaming:{vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_5_OPUS",fallback_3p:"claude-opus-4-1",context:{window:200000,supports_1m_suffix:!0},max_output_tokens:{default:32000,upper:64000},pricing:"tier_5_25",capabilities:["context_management"]},{id:"claude-opus-4-6",family:"opus",display_name:"Opus 4.6",knowledge_cutoff:"May 2025",provider_ids:{first_party:"claude-opus-4-6",bedrock:"us.anthropic.claude-opus-4-6-v1",vertex:"claude-opus-4-6",foundry:"claude-opus-4-6",anthropic_aws:"claude-opus-4-6",mantle:null,gateway:"claude-opus-4-6"},eager_input_streaming:{vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_6_OPUS",fallback_3p:"claude-opus-4-5",context:{window:200000,supports_1m_beta:!0,supports_1m_suffix:!0},max_output_tokens:{default:64000,upper:128000},pricing:"tier_5_25",capabilities:["effort","max_effort","adaptive_thinking","context_management"],advisor_rank:3},{id:"claude-opus-4-7",family:"opus",display_name:"Opus 4.7",knowledge_cutoff:"January 2026",provider_ids:{first_party:"claude-opus-4-7",bedrock:"us.anthropic.claude-opus-4-7",vertex:"claude-opus-4-7",foundry:"claude-opus-4-7",anthropic_aws:"claude-opus-4-7",mantle:"anthropic.claude-opus-4-7",gateway:"claude-opus-4-7"},eager_input_streaming:{bedrock:!0,vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_7_OPUS",fallback_3p:"claude-opus-4-6",context:{window:1e6,native_1m:!0,supports_1m_beta:!0,supports_1m_suffix:!0},max_output_tokens:{default:64000,upper:128000},pricing:"tier_5_25",capabilities:["effort","max_effort","xhigh_effort","adaptive_thinking","context_management","fast_mode"],default_effort:"xhigh",image_limits:{maxWidth:2000,maxHeight:2000},advisor_rank:4},{id:"claude-opus-4-8",family:"opus",display_name:"Opus 4.8",knowledge_cutoff:"January 2026",provider_ids:{first_party:"claude-opus-4-8",bedrock:"us.anthropic.claude-opus-4-8",vertex:"claude-opus-4-8",foundry:"claude-opus-4-8",anthropic_aws:"claude-opus-4-8",mantle:"anthropic.claude-opus-4-8",gateway:"claude-opus-4-8"},eager_input_streaming:{bedrock:!0,vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_8_OPUS",fallback_3p:"claude-opus-4-7",context:{window:1e6,native_1m:!0,supports_1m_beta:!0,supports_1m_suffix:!0},max_output_tokens:{default:64000,upper:128000},pricing:"tier_5_25",capabilities:["effort","max_effort","xhigh_effort","adaptive_thinking","mid_conv_system","context_management","fast_mode","lean_prompt"],default_effort:"high",image_limits:{maxWidth:2000,maxHeight:2000},advisor_rank:4},{id:"claude-fable-5",family:"fable",display_name:"Fable 5",knowledge_cutoff:"January 2026",provider_ids:{first_party:"claude-fable-5",bedrock:"us.anthropic.claude-fable-5",vertex:"claude-fable-5",foundry:"claude-fable-5",anthropic_aws:"claude-fable-5",mantle:"anthropic.claude-fable-5",gateway:"claude-fable-5"},eager_input_streaming:{bedrock:!0,vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_FABLE_5",fallback_3p:"claude-opus-4-8",context:{window:1e6,native_1m:!0,supports_1m_beta:!0},max_output_tokens:{default:64000,upper:128000},pricing:"tier_10_50",capabilities:["effort","max_effort","xhigh_effort","adaptive_thinking","rejects_disabled_thinking","mid_conv_system","context_management","lean_prompt","fable_5_mitigations"],default_effort:"high",image_limits:{maxWidth:2000,maxHeight:2000},advisor_rank:5},{id:"claude-mythos-5",family:"mythos",display_name:"Mythos 5",knowledge_cutoff:"January 2026",provider_ids:{first_party:"claude-mythos-5",bedrock:null,vertex:null,foundry:null,anthropic_aws:null,mantle:null,gateway:null},context:{window:1e6,native_1m:!0,supports_1m_beta:!0},max_output_tokens:{default:64000,upper:128000},pricing:"tier_10_50",capabilities:[],image_limits:{maxWidth:2000,maxHeight:2000},advisor_rank:5}],aliases:{opus:{default:"claude-opus-4-8",per_provider:{bedrock:"claude-opus-4-8",vertex:"claude-opus-4-8",foundry:"claude-opus-4-6",mantle:"claude-opus-4-8",anthropic_aws:"claude-opus-4-8",gateway:"claude-opus-4-7"}},sonnet:{default:"claude-sonnet-5",per_provider:{bedrock:"claude-sonnet-4-5",vertex:"claude-sonnet-4-5",foundry:"claude-sonnet-4-5",mantle:"claude-sonnet-4-5",anthropic_aws:"claude-sonnet-4-6",gateway:"claude-sonnet-4-6"}},haiku:{default:"claude-haiku-4-5"},fable:{default:"claude-fable-5"}},defaults:{},best:"fable",latest_per_family:{fable:"claude-fable-5",opus:"claude-opus-4-8",sonnet:"claude-sonnet-5",haiku:"claude-haiku-4-5"},alias_migration:{}};function Is(e){let t;return()=>t??=e()}var R5=Is(()=>qe.object({first_party:qe.string(),bedrock:qe.string().nullish(),vertex:qe.string().nullish(),foundry:qe.string().nullish(),anthropic_aws:qe.string().nullish(),mantle:qe.string().nullish(),gateway:qe.string().nullish()}).loose()),Mx=Is(()=>qe.object({input:qe.number(),output:qe.number(),cache_write_5m:qe.number().optional(),cache_write_1h:qe.number().optional(),cache_read:qe.number().optional(),web_search:qe.number().optional()}).loose()),C5=Is(()=>qe.object({id:qe.string(),family:qe.string(),display_name:qe.string(),slogan:qe.string().optional(),knowledge_cutoff:qe.string().optional(),provider_ids:R5(),eager_input_streaming:qe.object({bedrock:qe.literal(!0).optional(),vertex:qe.literal(!0).optional()}).loose().optional(),vertex_region_env_var:qe.string().optional(),fallback_3p:qe.string().optional(),context:qe.object({window:qe.number(),native_1m:qe.boolean().optional(),native_1m_3p:qe.object({bedrock:qe.literal(!0).optional(),vertex:qe.literal(!0).optional(),foundry:qe.literal(!0).optional()}).loose().optional(),supports_1m_beta:qe.boolean().optional(),supports_1m_suffix:qe.boolean().optional()}).loose().optional(),max_output_tokens:qe.object({default:qe.number(),upper:qe.number()}).loose().optional(),pricing:qe.union([qe.string(),Mx()]).optional(),capabilities:qe.array(qe.string()).default([]),default_effort:qe.enum(["low","medium","high","xhigh","max"]).optional(),image_limits:qe.object({maxWidth:qe.number().optional(),maxHeight:qe.number().optional(),maxBase64Size:qe.number().optional()}).loose().optional(),advisor_rank:qe.number().optional(),fallback_chain:qe.array(qe.string()).optional(),picker:qe.object({section:qe.enum(["main","overflow","deprecated"]).optional(),badge:qe.string().optional(),disabled_reason:qe.string().optional(),tiers:qe.array(qe.string()).optional()}).loose().optional(),deprecation:qe.object({retirement_dates:qe.record(qe.string(),qe.string()).optional(),remapped_to:qe.string().optional()}).loose().optional(),min_cli_version:qe.string().optional()}).loose()),O5=Is(()=>qe.object({default:qe.string(),per_provider:qe.record(qe.string(),qe.string()).optional()}).loose()),D5=Is(()=>qe.object({schema_version:qe.number(),pricing_tiers:qe.record(qe.string(),Mx()).default({}),models:qe.array(C5()),aliases:qe.record(qe.string(),O5()).default({}),defaults:qe.record(qe.string(),qe.string()).default({}),best:qe.string().optional(),latest_per_family:qe.record(qe.string(),qe.string()).default({}),alias_migration:qe.record(qe.string(),qe.string()).default({})}).loose()),N5={schema_version:0,pricing_tiers:{},models:[],aliases:{},defaults:{},latest_per_family:{},alias_migration:{}},By=Er(()=>{let e=D5().safeParse(kx);return e.success?e.data:N5}),Ex=By;function Ix(e){return e.replace(/-0$/,"")}var fue=Er(()=>{let e=new Map;for(let t of Ex().models)e.set(t.id,t);return e}),hue=Er(()=>{let e=new Map;for(let t of Ex().models)for(let r of Object.values(t.provider_ids)){if(typeof r!=="string")continue;let i=r.toLowerCase(),n=e.get(i);if(n!==void 0&&n!==t.id)throw Error("model catalog: provider id collision across distinct entries");e.set(i,t.id)}return e});function $x(){return process.env.CLAUDE_CONFIG_DIR}var Tx=Er(()=>($x()??Yn(Wc(),".claude")).normalize("NFC"),$x);var xue=Er(()=>yo(process.env.CLAUDE_CODE_SUPERVISED));var kue=Er(()=>By().models.flatMap((e)=>e.vertex_region_env_var&&/^VERTEX_REGION_[A-Z0-9_]+$/.test(e.vertex_region_env_var)?[[Ix(e.id),e.vertex_region_env_var]]:[]).sort(([e],[t])=>t.length-e.length||(e<t?-1:e>t?1:0)));function We(e,t,r,i,n){if(i==="m")throw TypeError("Private method is not writable");if(i==="a"&&!n)throw TypeError("Private accessor was defined without a setter");if(typeof t==="function"?e!==t||!n:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(e,r):n?n.value=r:t.set(e,r),r}function oe(e,t,r,i){if(r==="a"&&!i)throw TypeError("Private accessor was defined without a getter");if(typeof t==="function"?e!==t||!i:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(e):i?i.value:t.get(e)}var Hy=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return Hy=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),r=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(i)=>(+i^r()&15>>+i/4).toString(16))};function pi(e){return typeof e==="object"&&e!==null&&(("name"in e)&&e.name==="AbortError"||("message"in e)&&String(e.message).includes("FetchRequestCanceledException"))}var Ou=(e)=>{if(e instanceof Error)return e;if(typeof e==="object"&&e!==null){try{if(Object.prototype.toString.call(e)==="[object Error]"){let t=Error(e.message,e.cause?{cause:e.cause}:{});if(e.stack)t.stack=e.stack;if(e.cause&&!t.cause)t.cause=e.cause;if(e.name)t.name=e.name;return t}}catch{}try{return Error(JSON.stringify(e))}catch{}}return Error(e)};class Ye extends Error{}class wr extends Ye{constructor(e,t,r,i,n){super(`${wr.makeMessage(e,t,r)}`);this.status=e,this.headers=i,this.requestID=i?.get("request-id"),this.error=t,this.type=n??null}static makeMessage(e,t,r){let i=t?.message?typeof t.message==="string"?t.message:JSON.stringify(t.message):t?JSON.stringify(t):r;if(e&&i)return`${e} ${i}`;if(e)return`${e} status code (no body)`;if(i)return i;return"(no status code or body)"}static generate(e,t,r,i){if(!e||!i)return new $o({message:r,cause:Ou(t)});let n=t,o=n?.error?.type;if(e===400)return new Nu(e,n,r,i,o);if(e===401)return new zu(e,n,r,i,o);if(e===403)return new ju(e,n,r,i,o);if(e===404)return new Uu(e,n,r,i,o);if(e===409)return new Lu(e,n,r,i,o);if(e===422)return new Fu(e,n,r,i,o);if(e===429)return new qu(e,n,r,i,o);if(e>=500)return new Bu(e,n,r,i,o);return new wr(e,n,r,i,o)}}class Rr extends wr{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}}class $o extends wr{constructor({message:e,cause:t}){super(void 0,void 0,e||"Connection error.",void 0);if(t)this.cause=t}}class Du extends $o{constructor({message:e}={}){super({message:e??"Request timed out."})}}class Nu extends wr{}class zu extends wr{}class ju extends wr{}class Uu extends wr{}class Lu extends wr{}class Fu extends wr{}class qu extends wr{}class Bu extends wr{}var j5=/^[a-z][a-z0-9+.-]*:/i,Px=(e)=>j5.test(e),Zy=(e)=>(Zy=Array.isArray,Zy(e)),Ky=Zy;function Jf(e){if(typeof e!=="object")return{};return e??{}}function Vy(e){if(!e)return!0;for(let t in e)return!1;return!0}function Ax(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Rx=(e,t)=>{if(typeof t!=="number"||!Number.isInteger(t))throw new Ye(`${e} must be an integer`);if(t<0)throw new Ye(`${e} must be a positive integer`);return t};var Xf=(e)=>{try{return JSON.parse(e)}catch(t){return}};var Cx=(e)=>new Promise((t)=>setTimeout(t,e));var Mn="0.94.0";var zx=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function U5(){if(typeof Deno<"u"&&Deno.build!=null)return"deno";if(typeof EdgeRuntime<"u")return"edge";if(Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]")return"node";return"unknown"}var L5=()=>{let e=U5();if(e==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Mn,"X-Stainless-OS":Dx(Deno.build.os),"X-Stainless-Arch":Ox(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version==="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Mn,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(e==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Mn,"X-Stainless-OS":Dx(globalThis.process.platform??"unknown"),"X-Stainless-Arch":Ox(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let t=F5();if(t)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Mn,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${t.browser}`,"X-Stainless-Runtime-Version":t.version};return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Mn,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function F5(){if(typeof navigator>"u"||!navigator)return null;let e=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:t,pattern:r}of e){let i=r.exec(navigator.userAgent);if(i){let n=i[1]||0,o=i[2]||0,s=i[3]||0;return{browser:t,version:`${n}.${o}.${s}`}}}return null}var Ox=(e)=>{if(e==="x32")return"x32";if(e==="x86_64"||e==="x64")return"x64";if(e==="arm")return"arm";if(e==="aarch64"||e==="arm64")return"arm64";if(e)return`other:${e}`;return"unknown"},Dx=(e)=>{if(e=e.toLowerCase(),e.includes("ios"))return"iOS";if(e==="android")return"Android";if(e==="darwin")return"MacOS";if(e==="win32")return"Windows";if(e==="freebsd")return"FreeBSD";if(e==="openbsd")return"OpenBSD";if(e==="linux")return"Linux";if(e)return`Other:${e}`;return"Unknown"},Nx,Hu=()=>Nx??(Nx=L5());function jx(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function Wy(...e){let t=globalThis.ReadableStream;if(typeof t>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function Yf(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return Wy({start(){},async pull(r){let{done:i,value:n}=await t.next();if(i)r.close();else r.enqueue(n)},async cancel(){await t.return?.()}})}function Zu(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let r=await t.read();if(r?.done)t.releaseLock();return r}catch(r){throw t.releaseLock(),r}},async return(){let r=t.cancel();return t.releaseLock(),await r,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function Ux(e){if(e===null||typeof e!=="object")return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}let t=e.getReader(),r=t.cancel();t.releaseLock(),await r}var Lx=({headers:e,body:t})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(t)});function Fx(e){return Object.entries(e).filter(([t,r])=>typeof r<"u").map(([t,r])=>{if(typeof r==="string"||typeof r==="number"||typeof r==="boolean")return`${encodeURIComponent(t)}=${encodeURIComponent(r)}`;if(r===null)return`${encodeURIComponent(t)}=`;throw new Ye(`Cannot stringify type ${typeof r}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}var Bx="urn:ietf:params:oauth:grant-type:jwt-bearer",Hx="refresh_token",Qf="/v1/oauth/token",To="oauth-2025-04-20",Zx="oidc-federation-2026-04-01",Kx=120,$s=30,Vx=5,qx=1048576;function eh(e){if(!e)return;let t;try{t=new URL(e)}catch(i){throw new Rt(`Invalid token endpoint base URL "${e}": ${i}`)}if(t.protocol==="https:")return;let r=t.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(t.protocol==="http:"&&(r==="localhost"||r==="127.0.0.1"||r==="::1"))return;throw new Rt(`Refusing to send credential over non-https token endpoint "${e}"`)}async function th(e,t){let r=await Z5(e),i;try{i=JSON.parse(r)}catch{throw new Rt(`Token endpoint returned non-JSON response (status ${e.status})`,e.status,nn(r),t)}if(!i.access_token)throw new Rt(`Token endpoint response missing access_token: ${JSON.stringify(nn(i))}`,e.status,nn(i),t);if(i.token_type&&i.token_type.toLowerCase()!=="bearer")throw new Rt(`Token endpoint response: unsupported token_type "${i.token_type}" (want Bearer)`,e.status,nn(i),t);return i}var Gy=2000,H5=new Set(["error","error_description","error_uri"]);function nn(e){if(e==null)return e;if(typeof e==="string"){let t;try{t=JSON.parse(e)}catch{if(e.length<=Gy)return e;return e.slice(0,Gy)+`... <${e.length-Gy} more chars>`}return JSON.stringify(nn(t))}if(typeof e==="object"&&!Array.isArray(e)){let t={};for(let[r,i]of Object.entries(e))if(H5.has(r))t[r]=i;return t}return null}async function rh(e,t=(r)=>console.warn(`anthropic-sdk: ${r}`)){if(typeof process>"u"||process.platform==="win32")return;let r=await import("node:fs"),i=e,n;try{i=await r.promises.realpath(e),n=await r.promises.stat(i)}catch{return}let o=n.mode&511;if(o&18)throw new Rt(`Credentials file at ${i} is group/world-writable (mode 0o${o.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${i}\`.`);if(o&36)throw new Rt(`Credentials file at ${i} is group/world-readable (mode 0o${o.toString(8)}); run \`chmod 600 ${i}\` before retrying.`);if(typeof process.getuid==="function"&&n.uid!==process.getuid())t(`credentials file at ${i} is owned by uid ${n.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function nh(e,t){let r=await import("node:fs"),n=(await Promise.resolve().then(() => (Dn(),vo))).dirname(e);await r.promises.mkdir(n,{recursive:!0,mode:448});let o=`${e}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let s=await r.promises.open(o,"w",384);try{await s.writeFile(JSON.stringify(t,null,2)),await s.sync()}finally{await s.close()}await r.promises.rename(o,e)}catch(s){throw await r.promises.unlink(o).catch(()=>{}),s}try{let s=await r.promises.open(n,"r");try{await s.sync()}finally{await s.close()}}catch{}}async function Z5(e){if(!e.body)return"";let t=e.body.getReader(),r=[],i=0;for(;;){let{done:o,value:s}=await t.read();if(o)break;if(i+s.length>qx){let h=qx-i;if(h>0)r.push(s.subarray(0,h));await t.cancel();break}r.push(s),i+=s.length}let n;if(r.length===1)n=r[0];else{n=new Uint8Array(r.reduce((s,h)=>s+h.length,0));let o=0;for(let s of r)n.set(s,o),o+=s.length}return new TextDecoder("utf-8").decode(n)}class Rt extends Ye{constructor(e,t=null,r=null,i=null){super(e);this.statusCode=t,this.body=r,this.requestId=i}}function zn(){return Math.floor(Date.now()/1000)}class Jy{constructor(e,t){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=e,this.onAdvisoryRefreshError=t}async getToken(){let e=this.nextForce;this.nextForce=!1;let t=this.cached;if(e||t==null)return(await this.refresh(e)).token;if(t.expiresAt==null)return t.token;let r=t.expiresAt-zn();if(r>Kx)return t.token;if(r>$s)return this.backgroundRefresh(),t.token;return(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(e=!1){if(this.pendingRefresh&&!e)return this.pendingRefresh;return this.doRefresh(e)}backgroundRefresh(){if(this.pendingRefresh)return;if(zn()-this.lastAdvisoryError<Vx)return;this.doRefresh().catch((e)=>{this.lastAdvisoryError=zn(),this.onAdvisoryRefreshError?.(e)})}doRefresh(e=!1){return this.pendingRefresh=this.provider(e?{forceRefresh:!0}:void 0).then((t)=>(this.cached=t,this.pendingRefresh=null,t),(t)=>{throw this.pendingRefresh=null,t}),this.pendingRefresh}}var Pt=(e)=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[e]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(e)?.trim()||void 0;return};function Jx(e){let t=0;for(let n of e)t+=n.length;let r=new Uint8Array(t),i=0;for(let n of e)r.set(n,i),i+=n.length;return r}var Wx;function Ts(e){let t;return(Wx??(t=new globalThis.TextEncoder,Wx=t.encode.bind(t)))(e)}var Gx;function Xy(e){let t;return(Gx??(t=new globalThis.TextDecoder,Gx=t.decode.bind(t)))(e)}var oh={off:0,error:200,warn:300,info:400,debug:500},Yy=(e,t,r)=>{if(!e)return;if(Ax(oh,e))return e;nr(r).warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(oh))}`);return};function Ku(){}function ih(e,t,r){if(!t||oh[e]>oh[r])return Ku;else return t[e].bind(t)}var K5={error:Ku,warn:Ku,info:Ku,debug:Ku},Xx=new WeakMap;function nr(e){let t=e.logger,r=e.logLevel??"off";if(!t)return K5;let i=Xx.get(t);if(i&&i[0]===r)return i[1];let n={error:ih("error",t,r),warn:ih("warn",t,r),info:ih("info",t,r),debug:ih("debug",t,r)};return Xx.set(t,[r,n]),n}var mi=(e)=>{if(e.options)e.options={...e.options},delete e.options.headers;if(e.headers)e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([t,r])=>[t,t.toLowerCase()==="x-api-key"||t.toLowerCase()==="authorization"||t.toLowerCase()==="cookie"||t.toLowerCase()==="set-cookie"?"***":r]));if("retryOfRequestLogID"in e){if(e.retryOfRequestLogID)e.retryOf=e.retryOfRequestLogID;delete e.retryOfRequestLogID}return e};var sh="1.0",V5=/^[A-Za-z0-9_.-]+$/;function Yx(e){if(!e)throw Error("profile name is empty");if(e==="."||e==="..")throw Error(`profile name "${e}" is not allowed`);if(e.includes("/")||e.includes("\\"))throw Error(`profile name "${e}" must not contain path separators`);if(!V5.test(e))throw Error(`profile name "${e}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var Qx=async(e)=>{var t,r;let i=await Qy();if(i===null)return null;let n=e??await t2();if(n===null)return null;Yx(n);let o=await import("node:fs"),h=(await Promise.resolve().then(() => (Dn(),vo))).join(i,"configs",`${n}.json`),v;try{v=await o.promises.readFile(h,"utf-8")}catch(g){if(g?.code!=="ENOENT")throw Error(`failed to read config file ${h}: ${g}`);v=null}if(v===null){let g=Pt("ANTHROPIC_ORGANIZATION_ID"),S=Pt("ANTHROPIC_IDENTITY_TOKEN_FILE"),x=Pt("ANTHROPIC_FEDERATION_RULE_ID");if(x&&g)return{fromFile:!1,config:{organization_id:g,workspace_id:Pt("ANTHROPIC_WORKSPACE_ID"),base_url:Pt("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:x,service_account_id:Pt("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:S?{source:"file",path:S}:void 0,scope:Pt("ANTHROPIC_SCOPE")}}};return null}let b;try{b=JSON.parse(v)}catch(g){throw Error(`failed to parse config file ${h}: ${g}`)}if(!b.authentication)throw Error(`config file ${h} is missing "authentication"`);let _=b.authentication.type;if(_!=="oidc_federation"&&_!=="user_oauth")throw Error(`authentication.type "${_}" is not a known authentication type`);if(b.organization_id??(b.organization_id=Pt("ANTHROPIC_ORGANIZATION_ID")),b.workspace_id??(b.workspace_id=Pt("ANTHROPIC_WORKSPACE_ID")),b.base_url??(b.base_url=Pt("ANTHROPIC_BASE_URL")),(t=b.authentication).scope??(t.scope=Pt("ANTHROPIC_SCOPE")),b.authentication.type==="oidc_federation"){if(!b.authentication.identity_token){let g=Pt("ANTHROPIC_IDENTITY_TOKEN_FILE");if(g)b.authentication.identity_token={source:"file",path:g}}if(!b.authentication.federation_rule_id)b.authentication.federation_rule_id=Pt("ANTHROPIC_FEDERATION_RULE_ID")??"";(r=b.authentication).service_account_id??(r.service_account_id=Pt("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:b,fromFile:!0}};var e2=async(e,t)=>{if(e?.authentication.credentials_path)return e.authentication.credentials_path;let r=await Qy();if(!r)return null;let i=t??await t2();if(!i)return null;return Yx(i),(await Promise.resolve().then(() => (Dn(),vo))).join(r,"credentials",`${i}.json`)},Qy=async()=>{if(!W5())return null;let e=await Promise.resolve().then(() => (Dn(),vo)),t=Pt("ANTHROPIC_CONFIG_DIR");if(t)return t;if(Hu()["X-Stainless-OS"]==="Windows"){let o=Pt("APPDATA");if(o)return e.join(o,"Anthropic");let s=Pt("USERPROFILE");if(s)return e.join(s,"AppData","Roaming","Anthropic");return null}let i=Pt("XDG_CONFIG_HOME");if(i)return e.join(i,"anthropic");let n=Pt("HOME");if(n)return e.join(n,".config","anthropic");return null},W5=()=>{let e=Hu()["X-Stainless-Runtime"];return e==="node"||e==="deno"},t2=async()=>{let e=await Qy();if(!e)return null;let t=Pt("ANTHROPIC_PROFILE");if(t)return t;let r=await import("node:fs"),n=(await Promise.resolve().then(() => (Dn(),vo))).join(e,"active_config");try{return(await r.promises.readFile(n,"utf-8")).trim()||"default"}catch(o){if(o?.code!=="ENOENT")throw Error(`failed to read ${n}: ${o}`);return"default"}};function ev(e){if(!e)throw new Ye("Identity token file path is empty");return async()=>{let t=await import("node:fs"),r;try{r=await t.promises.readFile(e,"utf-8")}catch(n){throw new Ye(`Failed to read identity token file at ${e}: ${n}`)}let i=r.trim();if(!i)throw new Ye(`Identity token file at ${e} is empty`);return i}}function r2(e){if(!e)throw new Ye("Identity token value is empty");return()=>e}function n2(e){return async()=>{eh(e.baseURL);let t=await e.identityTokenProvider();if(t.length>16384)throw new Rt(`Identity token is ${Math.ceil(t.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:Bx,assertion:t,federation_rule_id:e.federationRuleId,organization_id:e.organizationId};if(e.serviceAccountId)r.service_account_id=e.serviceAccountId;if(e.workspaceId)r.workspace_id=e.workspaceId;let i=`${e.baseURL}${Qf}`,n;try{n=await e.fetch(i,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${To},${Zx}`,"User-Agent":e.userAgent||`anthropic-sdk-typescript/${Mn} oidcFederationProvider`},body:JSON.stringify(r)})}catch(v){throw new Rt(`Failed to reach token endpoint ${i}: ${v}`)}let o=n.headers.get("Request-Id");if(!n.ok){let v=await n.text().catch(()=>""),b=nn(v),_="";if(n.status===401)_=` Ensure your federation rule matches your identity token. ${e.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`;throw new Rt(`Token exchange failed with status ${n.status}${o?` (request-id ${o})`:""}: ${b}${_}`,n.status,b,o)}let s=await th(n,o),h=Number(s.expires_in);if(!Number.isFinite(h))throw new Rt(`Token endpoint response missing required fields: ${JSON.stringify(nn(s))}`,n.status,nn(s),o);return{token:s.access_token,expiresAt:zn()+h}}}function i2(e){return async(t)=>{let r=await import("node:fs");await rh(e.credentialsPath,e.onSafetyWarning);let i;try{i=await r.promises.readFile(e.credentialsPath,"utf-8")}catch($){throw new Rt(`Credentials file not found at ${e.credentialsPath}: ${$}`)}let n;try{n=JSON.parse(i)}catch($){throw new Rt(`Credentials file at ${e.credentialsPath} is not valid JSON: ${$}`)}let o=n.access_token;if(!o)throw new Rt(`Credentials file at ${e.credentialsPath} must include 'access_token'`);let s=n.expires_at;if(!t?.forceRefresh&&(s==null||zn()<s-$s))return{token:o,expiresAt:s??null};let h=n.refresh_token;if(!e.clientId||!h)throw new Rt(`Access token at ${e.credentialsPath} has expired and no refresh is available (client_id ${e.clientId?"set":"empty"}, refresh_token ${h?"set":"empty"})`);eh(e.baseURL);let v={grant_type:Hx,refresh_token:h,client_id:e.clientId},b=`${e.baseURL}${Qf}`,_;try{_=await e.fetch(b,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":To,"User-Agent":e.userAgent||`anthropic-sdk-typescript/${Mn} userOAuthProvider`},body:JSON.stringify(v)})}catch($){throw new Rt(`User OAuth refresh failed to reach token endpoint: ${$}`)}let g=_.headers.get("Request-Id");if(!_.ok){let $=await _.text().catch(()=>"");throw new Rt(`User OAuth refresh failed (HTTP ${_.status}): ${nn($)}`,_.status,nn($),g)}let S=await th(_,g),x=Number(S.expires_in);if(!Number.isFinite(x))throw new Rt(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(nn(S))}`,_.status,nn(S),g);let M=zn()+x,I=S.refresh_token||h;return await nh(e.credentialsPath,{...n,version:sh,type:"oauth_token",access_token:S.access_token,expires_at:M,refresh_token:I}),{token:S.access_token,expiresAt:M}}}function tv(e,t){let r=e.authentication.credentials_path??null,i=(e.base_url||t.baseURL).replace(/\/+$/,""),n=G5(e,r,i,t),o={};if(e.workspace_id&&e.authentication.type==="user_oauth")o["anthropic-workspace-id"]=e.workspace_id;return{provider:n,extraHeaders:o,baseURL:e.base_url||void 0}}async function o2(e,t){let r=await Qx(t);if(!r)return null;let{config:i,fromFile:n}=r,o=i.authentication.credentials_path||!n?i:{...i,authentication:{...i.authentication,credentials_path:await e2(i,t)??void 0}};return tv(o,e)}function G5(e,t,r,i){switch(e.authentication.type){case"oidc_federation":{let n=e.authentication,o=J5(n);if(!o)throw new Rt("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!n.federation_rule_id)throw new Rt("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence).");if(!e.organization_id)throw new Rt("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let s=n2({identityTokenProvider:o,federationRuleId:n.federation_rule_id,organizationId:e.organization_id,serviceAccountId:n.service_account_id,workspaceId:e.workspace_id,baseURL:r,fetch:i.fetch,userAgent:i.userAgent});if(t)return X5(s,t,i.onCacheWriteError,i.onSafetyWarning);return s}case"user_oauth":{if(!t)throw new Rt("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to <config_dir>/credentials/<profile>.json)");return i2({credentialsPath:t,clientId:e.authentication.client_id,baseURL:r,fetch:i.fetch,userAgent:i.userAgent,onSafetyWarning:i.onSafetyWarning})}default:{let n=e.authentication.type;throw new Rt(`authentication.type "${n}" is not a known authentication type`)}}}function J5(e){if(e.identity_token){let i=e.identity_token.source;if(i!=="file")throw new Rt(`identity_token.source "${i}" is not supported by this SDK version (only "file")`);if(!e.identity_token.path)throw new Rt('identity_token.source "file" requires a non-empty path');return ev(e.identity_token.path)}let t=Pt("ANTHROPIC_IDENTITY_TOKEN_FILE");if(t)return ev(t);let r=Pt("ANTHROPIC_IDENTITY_TOKEN");if(r)return r2(r);return null}function X5(e,t,r,i){return async(n)=>{let o=await import("node:fs");await rh(t,i);let s;try{let v=await o.promises.readFile(t,"utf-8");s=JSON.parse(v);let b=s?.access_token;if(b&&!n?.forceRefresh){let _=s?.expires_at;if(_==null||zn()<_-$s)return{token:b,expiresAt:_??null}}}catch(v){if(v?.code!=="ENOENT"&&!(v instanceof SyntaxError))r?.(v)}let h=await e(n);try{await nh(t,{...s??{},version:sh,type:"oauth_token",access_token:h.token,expires_at:h.expiresAt})}catch(v){r?.(v)}return h}}var hn,pn;class Zi{constructor(){hn.set(this,void 0),pn.set(this,void 0),We(this,hn,new Uint8Array,"f"),We(this,pn,null,"f")}decode(e){if(e==null)return[];let t=e instanceof ArrayBuffer?new Uint8Array(e):typeof e==="string"?Ts(e):e;We(this,hn,Jx([oe(this,hn,"f"),t]),"f");let r=[],i;while((i=Y5(oe(this,hn,"f"),oe(this,pn,"f")))!=null){if(i.carriage&&oe(this,pn,"f")==null){We(this,pn,i.index,"f");continue}if(oe(this,pn,"f")!=null&&(i.index!==oe(this,pn,"f")+1||i.carriage)){r.push(Xy(oe(this,hn,"f").subarray(0,oe(this,pn,"f")-1))),We(this,hn,oe(this,hn,"f").subarray(oe(this,pn,"f")),"f"),We(this,pn,null,"f");continue}let n=oe(this,pn,"f")!==null?i.preceding-1:i.preceding,o=Xy(oe(this,hn,"f").subarray(0,n));r.push(o),We(this,hn,oe(this,hn,"f").subarray(i.index),"f"),We(this,pn,null,"f")}return r}flush(){if(!oe(this,hn,"f").length)return[];return this.decode(`
|
|
55
55
|
`)}}hn=new WeakMap,pn=new WeakMap;Zi.NEWLINE_CHARS=new Set([`
|
|
56
56
|
`,"\r"]);Zi.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function Y5(e,t){for(let n=t??0;n<e.length;n++){if(e[n]===10)return{preceding:n,index:n+1,carriage:!1};if(e[n]===13)return{preceding:n,index:n+1,carriage:!0}}return null}function s2(e){for(let i=0;i<e.length-1;i++){if(e[i]===10&&e[i+1]===10)return i+2;if(e[i]===13&&e[i+1]===13)return i+2;if(e[i]===13&&e[i+1]===10&&i+3<e.length&&e[i+2]===13&&e[i+3]===10)return i+4}return-1}var Vu;class mn{constructor(e,t,r){this.iterator=e,Vu.set(this,void 0),this.controller=t,We(this,Vu,r,"f")}static fromSSEResponse(e,t,r){let i=!1,n=r?nr(r):console;async function*o(){if(i)throw new Ye("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");i=!0;let s=!1;try{for await(let h of Q5(e,t)){if(h.event==="completion")try{yield JSON.parse(h.data)}catch(v){throw n.error("Could not parse message into JSON:",h.data),n.error("From chunk:",h.raw),v}if(h.event==="message_start"||h.event==="message_delta"||h.event==="message_stop"||h.event==="content_block_start"||h.event==="content_block_delta"||h.event==="content_block_stop"||h.event==="message"||h.event==="user.message"||h.event==="user.interrupt"||h.event==="user.tool_confirmation"||h.event==="user.custom_tool_result"||h.event==="agent.message"||h.event==="agent.thinking"||h.event==="agent.tool_use"||h.event==="agent.tool_result"||h.event==="agent.mcp_tool_use"||h.event==="agent.mcp_tool_result"||h.event==="agent.custom_tool_use"||h.event==="agent.thread_context_compacted"||h.event==="session.status_running"||h.event==="session.status_idle"||h.event==="session.status_rescheduled"||h.event==="session.status_terminated"||h.event==="session.error"||h.event==="session.deleted"||h.event==="span.model_request_start"||h.event==="span.model_request_end")try{yield JSON.parse(h.data)}catch(v){throw n.error("Could not parse message into JSON:",h.data),n.error("From chunk:",h.raw),v}if(h.event==="ping")continue;if(h.event==="error"){let v=Xf(h.data)??h.data,b=v?.error?.type;throw new wr(void 0,v,void 0,e.headers,b)}}s=!0}catch(h){if(pi(h))return;throw h}finally{if(!s)t.abort()}}return new mn(o,t,r)}static fromReadableStream(e,t,r){let i=!1;async function*n(){let s=new Zi,h=Zu(e);for await(let v of h)for(let b of s.decode(v))yield b;for(let v of s.flush())yield v}async function*o(){if(i)throw new Ye("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");i=!0;let s=!1;try{for await(let h of n()){if(s)continue;if(h)yield JSON.parse(h)}s=!0}catch(h){if(pi(h))return;throw h}finally{if(!s)t.abort()}}return new mn(o,t,r)}[(Vu=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let e=[],t=[],r=this.iterator(),i=(n)=>({next:()=>{if(n.length===0){let o=r.next();e.push(o),t.push(o)}return n.shift()}});return[new mn(()=>i(e),this.controller,oe(this,Vu,"f")),new mn(()=>i(t),this.controller,oe(this,Vu,"f"))]}toReadableStream(){let e=this,t;return Wy({async start(){t=e[Symbol.asyncIterator]()},async pull(r){try{let{value:i,done:n}=await t.next();if(n)return r.close();let o=Ts(JSON.stringify(i)+`
|
|
57
57
|
`);r.enqueue(o)}catch(i){r.error(i)}},async cancel(){await t.return?.()}})}}async function*Q5(e,t){if(!e.body){if(t.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new Ye("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new Ye("Attempted to iterate over a response with no body")}let r=new a2,i=new Zi,n=Zu(e.body);for await(let o of e7(n))for(let s of i.decode(o)){let h=r.decode(s);if(h)yield h}for(let o of i.flush()){let s=r.decode(o);if(s)yield s}}async function*e7(e){let t=new Uint8Array;for await(let r of e){if(r==null)continue;let i=r instanceof ArrayBuffer?new Uint8Array(r):typeof r==="string"?Ts(r):r,n=new Uint8Array(t.length+i.length);n.set(t),n.set(i,t.length),t=n;let o;while((o=s2(t))!==-1)yield t.slice(0,o),t=t.slice(o)}if(t.length>0)yield t}class a2{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r"))e=e.substring(0,e.length-1);if(!e){if(!this.event&&!this.data.length)return null;let n={event:this.event,data:this.data.join(`
|
|
@@ -91,9 +91,9 @@ you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g.,
|
|
|
91
91
|
|
|
92
92
|
new Anthropic({ apiKey, dangerouslyAllowBrowser: true });
|
|
93
93
|
`);this.baseURL=n.baseURL,this._baseURLIsExplicit=i.__baseURLIsExplicit??!!e,this.timeout=n.timeout??kv.DEFAULT_TIMEOUT,this.logger=n.logger??console;let o="warn";this.logLevel=o,this.logLevel=Yy(n.logLevel,"ClientOptions.logLevel",this)??Yy(Pt("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??o,this.fetchOptions=n.fetchOptions,this.maxRetries=n.maxRetries??2,this.fetch=n.fetch??jx(),We(this,$h,Lx,"f");let s=Pt("ANTHROPIC_CUSTOM_HEADERS");if(s){let v={};for(let b of s.split(`
|
|
94
|
-
`)){let _=b.indexOf(":");if(_>=0)v[b.substring(0,_).trim()]=b.substring(_+1).trim()}n.defaultHeaders={...v,...n.defaultHeaders}}let h=i.__auth;if(delete n.__auth,delete n.__baseURLIsExplicit,this._options=n,this.apiKey=typeof t==="string"?t:null,this.authToken=r,h){if(this._authState=h,!this._baseURLIsExplicit&&h.baseURL)this.baseURL=h.baseURL}else if(this._authState={provider:null,tokenCache:null,resolution:null,error:null,extraHeaders:{}},this.apiKey==null&&this.authToken==null){let v=n.credentials??null;if(v)this._authState.provider=v,this._authState.tokenCache=this._makeTokenCache(v);else if(n.config!=null){let b=tv(n.config,this._credentialResolverOptions());this._authState.provider=b.provider,this._authState.tokenCache=this._makeTokenCache(b.provider),this._authState.extraHeaders=b.extraHeaders,this._applyCredentialBaseURL(b.baseURL)}else if(n.profile!=null)this._authState.resolution=this._resolveDefaultCredentials(n.profile);else this._authState.resolution=this._resolveDefaultCredentials()}}_applyCredentialBaseURL(e){if(!e)return;let t=e.replace(/\/+$/,"");if(this._authState.baseURL=t,!this._baseURLIsExplicit)this.baseURL=t}_credentialResolverOptions(){return{baseURL:this.baseURL,fetch:this.fetch,userAgent:this.getUserAgent(),onCacheWriteError:(e)=>{nr(this).debug("credential cache write failed (best-effort)",e)},onSafetyWarning:(e)=>{nr(this).warn(e)}}}_makeTokenCache(e){return new Jy(e,(t)=>{nr(this).debug("advisory token refresh failed; serving cached token",t)})}withOptions(e){let t="credentials"in e||"config"in e||"profile"in e,r="apiKey"in e||"authToken"in e||t,i={...this._options,...this._baseURLIsExplicit?{baseURL:this.baseURL}:{},maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,credentials:this.credentials,...t?{credentials:void 0,config:void 0,profile:void 0}:{},...e,__auth:r?void 0:this._authState,__baseURLIsExplicit:"baseURL"in e?!0:this._baseURLIsExplicit};return new this.constructor(i)}async _resolveDefaultCredentials(e){try{let t=await o2(this._credentialResolverOptions(),e);if(t)this._authState.provider=t.provider,this._authState.tokenCache=this._makeTokenCache(t.provider),this._authState.extraHeaders=t.extraHeaders,this._applyCredentialBaseURL(t.baseURL);else if(e!=null)throw new Ye(`Profile "${e}" could not be resolved (no <config_dir>/configs/${e}.json found).`)}catch(t){this._authState.error=t}finally{this._authState.resolution=null}}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:t}){if(e.get("x-api-key")||e.get("authorization"))return;if(this._authState.error)throw this._authState.error;if(this._authState.tokenCache||this._authState.resolution)return;if(this.apiKey&&e.get("x-api-key"))return;if(t.has("x-api-key"))return;if(this.authToken&&e.get("authorization"))return;if(t.has("authorization"))return;throw Error('Could not resolve authentication method. Expected one of apiKey, authToken, credentials, config, or profile to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}_authFlags(e){let t=this._requestAuthFlags.get(e);if(!t)t={usedTokenCache:!1,didRefreshFor401:!1},this._requestAuthFlags.set(e,t);return t}async authHeaders(e){if(this._authState.resolution)await this._authState.resolution;if(this._authState.error)return;if(this._authState.tokenCache&&this.apiKey==null){let t=await this._authState.tokenCache.getToken();return this._authFlags(e).usedTokenCache=!0,_e([{Authorization:`Bearer ${t}`}])}return _e([await this.apiKeyAuth(e),await this.bearerAuth(e)])}async apiKeyAuth(e){if(this.apiKey==null)return;return _e([{"X-Api-Key":this.apiKey}])}async bearerAuth(e){if(this.authToken==null)return;return _e([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(e){return Fx(e)}getUserAgent(){return`${this.constructor.name}/JS ${Mn}`}defaultIdempotencyKey(){return`stainless-node-retry-${Hy()}`}makeStatusError(e,t,r,i){return wr.generate(e,t,r,i)}buildURL(e,t,r){let i=!oe(this,xv,"m",C2).call(this)&&r||this.baseURL,n=Px(e)?new URL(e):new URL(i+(i.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),o=this.defaultQuery(),s=Object.fromEntries(n.searchParams);if(!Vy(o)||!Vy(s))t={...s,...o,...t};if(typeof t==="object"&&t&&!Array.isArray(t))n.search=this.stringifyQuery(t);return n.toString()}_calculateNonstreamingTimeout(e){if(3600*e/128000>600)throw new Ye("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600000}async prepareOptions(e){}async prepareRequest(e,{url:t,options:r}){if(this._authState.tokenCache&&this.apiKey==null){let i=e.headers instanceof Headers?e.headers:new Headers(e.headers);for(let[o,s]of Object.entries(this._authState.extraHeaders))if(!i.has(o))i.set(o,s);if(!i.get("anthropic-beta")?.split(",").map((o)=>o.trim())?.includes(To))i.append("anthropic-beta",To);e.headers=i}}get(e,t){return this.methodRequest("get",e,t)}post(e,t){return this.methodRequest("post",e,t)}patch(e,t){return this.methodRequest("patch",e,t)}put(e,t){return this.methodRequest("put",e,t)}delete(e,t){return this.methodRequest("delete",e,t)}methodRequest(e,t,r){return this.request(Promise.resolve(r).then((i)=>({method:e,path:t,...i})))}request(e,t=null){return new Po(this,this.makeRequest(e,t,void 0))}async makeRequest(e,t,r){let i=await e,n=i.maxRetries??this.maxRetries;if(t==null)t=n,this._requestAuthFlags.delete(i);await this.prepareOptions(i);let{req:o,url:s,timeout:h}=await this.buildRequest(i,{retryCount:n-t});await this.prepareRequest(o,{url:s,options:i});let v="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),b=r===void 0?"":`, retryOf: ${r}`,_=Date.now();if(nr(this).debug(`[${v}] sending request`,mi({retryOfRequestLogID:r,method:i.method,url:s,options:i,headers:o.headers})),i.signal?.aborted)throw new Rr;let g=new AbortController,S=await this.fetchWithTimeout(s,o,h,g).catch(Ou),x=Date.now();if(S instanceof globalThis.Error){let $=`retrying, ${t} attempts remaining`;if(i.signal?.aborted)throw new Rr;let T=pi(S)||/timed? ?out/i.test(String(S)+("cause"in S?String(S.cause):""));if(t)return nr(this).info(`[${v}] connection ${T?"timed out":"failed"} - ${$}`),nr(this).debug(`[${v}] connection ${T?"timed out":"failed"} (${$})`,mi({retryOfRequestLogID:r,url:s,durationMs:x-_,message:S.message})),this.retryRequest(i,t,r??v);if(nr(this).info(`[${v}] connection ${T?"timed out":"failed"} - error; no more retries left`),nr(this).debug(`[${v}] connection ${T?"timed out":"failed"} (error; no more retries left)`,mi({retryOfRequestLogID:r,url:s,durationMs:x-_,message:S.message})),T)throw new Du;throw new $o({cause:S})}let M=[...S.headers.entries()].filter(([$])=>$==="request-id").map(([$,T])=>", "+$+": "+JSON.stringify(T)).join(""),I=`[${v}${b}${M}] ${o.method} ${s} ${S.ok?"succeeded":"failed"} with status ${S.status} in ${x-_}ms`;if(!S.ok){let $=await this.shouldRetry(S,i);if(t&&$){let B=`retrying, ${t} attempts remaining`;return await Ux(S.body),nr(this).info(`${I} - ${B}`),nr(this).debug(`[${v}] response error (${B})`,mi({retryOfRequestLogID:r,url:S.url,status:S.status,headers:S.headers,durationMs:x-_})),this.retryRequest(i,t,r??v,S.headers)}let T=$?"error; no more retries left":"error; not retryable";nr(this).info(`${I} - ${T}`);let P=await S.text().catch((B)=>Ou(B).message),R=Xf(P),C=R?void 0:P;throw nr(this).debug(`[${v}] response error (${T})`,mi({retryOfRequestLogID:r,url:S.url,status:S.status,headers:S.headers,message:C,durationMs:Date.now()-_})),this.makeStatusError(S.status,R,C,S.headers)}return nr(this).info(I),nr(this).debug(`[${v}] response start`,mi({retryOfRequestLogID:r,url:S.url,status:S.status,headers:S.headers,durationMs:x-_})),{response:S,options:i,controller:g,requestLogID:v,retryOfRequestLogID:r,startTime:_}}getAPIList(e,t,r){return this.requestAPIList(t,r&&"then"in r?r.then((i)=>({method:"get",path:e,...i})):{method:"get",path:e,...r})}requestAPIList(e,t){let r=this.makeRequest(t,null,void 0);return new lh(this,r,e)}async fetchWithTimeout(e,t,r,i){let{signal:n,method:o,...s}=t||{},h=this._makeAbort(i);if(n)n.addEventListener("abort",h,{once:!0});let v=setTimeout(h,r),b=globalThis.ReadableStream&&s.body instanceof globalThis.ReadableStream||typeof s.body==="object"&&s.body!==null&&Symbol.asyncIterator in s.body,_={signal:i.signal,...b?{duplex:"half"}:{},method:"GET",...s};if(o)_.method=o.toUpperCase();try{return await this.fetch.call(void 0,e,_)}finally{clearTimeout(v)}}async shouldRetry(e,t){let r=this._authFlags(t);if(e.status===401&&this._authState.tokenCache&&r.usedTokenCache&&!r.didRefreshFor401)return r.didRefreshFor401=!0,this._authState.tokenCache.invalidate(),!0;let i=e.headers.get("x-should-retry");if(i==="true")return!0;if(i==="false")return!1;if(e.status===408)return!0;if(e.status===409)return!0;if(e.status===429)return!0;if(e.status>=500)return!0;return!1}async retryRequest(e,t,r,i){let n,o=i?.get("retry-after-ms");if(o){let h=parseFloat(o);if(!Number.isNaN(h))n=h}let s=i?.get("retry-after");if(s&&!n){let h=parseFloat(s);if(!Number.isNaN(h))n=h*1000;else n=Date.parse(s)-Date.now()}if(n===void 0){let h=e.maxRetries??this.maxRetries;n=this.calculateDefaultRetryTimeoutMillis(t,h)}return await Cx(n),this.makeRequest(e,t-1,r)}calculateDefaultRetryTimeoutMillis(e,t){let n=t-e,o=Math.min(0.5*Math.pow(2,n),8),s=1-Math.random()*0.25;return o*s*1000}calculateNonstreamingTimeout(e,t){if(3600000*e/128000>600000||t!=null&&e>t)throw new Ye("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 600000}async buildRequest(e,{retryCount:t=0}={}){let r={...e},{method:i,path:n,query:o,defaultBaseURL:s}=r;if(this._authState.resolution)await this._authState.resolution;if(!this._baseURLIsExplicit&&this._authState.baseURL&&this.baseURL!==this._authState.baseURL)this.baseURL=this._authState.baseURL;let h=this.buildURL(n,o,s);if("timeout"in r)Rx("timeout",r.timeout);r.timeout=r.timeout??this.timeout;let{bodyHeaders:v,body:b}=this.buildBody({options:r}),_=await this.buildHeaders({options:e,method:i,bodyHeaders:v,retryCount:t});return{req:{method:i,headers:_,...r.signal&&{signal:r.signal},...globalThis.ReadableStream&&b instanceof globalThis.ReadableStream&&{duplex:"half"},...b&&{body:b},...this.fetchOptions??{},...r.fetchOptions??{}},url:h,timeout:r.timeout}}async buildHeaders({options:e,method:t,bodyHeaders:r,retryCount:i}){let n={};if(this.idempotencyHeader&&t!=="get"){if(!e.idempotencyKey)e.idempotencyKey=this.defaultIdempotencyKey();n[this.idempotencyHeader]=e.idempotencyKey}let o=_e([n,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(i),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1000))}:{},...Hu(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(e),this._options.defaultHeaders,r,e.headers]);return this.validateHeaders(o),o.values}_makeAbort(e){return()=>e.abort()}buildBody({options:{body:e,headers:t}}){if(!e)return{bodyHeaders:void 0,body:void 0};let r=_e([t]);if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e==="string"&&r.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream)return{bodyHeaders:void 0,body:e};else if(typeof e==="object"&&((Symbol.asyncIterator in e)||(Symbol.iterator in e)&&("next"in e)&&typeof e.next==="function"))return{bodyHeaders:void 0,body:Yf(e)};else if(typeof e==="object"&&r.values.get("content-type")==="application/x-www-form-urlencoded")return{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(e)};else return oe(this,$h,"f").call(this,{body:e,headers:r})}}kv=Yt,$h=new WeakMap,xv=new WeakSet,C2=function(){return this.baseURL!=="https://api.anthropic.com"};Yt.Anthropic=kv;Yt.HUMAN_PROMPT=O2;Yt.AI_PROMPT=D2;Yt.DEFAULT_TIMEOUT=600000;Yt.AnthropicError=Ye;Yt.APIError=wr;Yt.APIConnectionError=$o;Yt.APIConnectionTimeoutError=Du;Yt.APIUserAbortError=Rr;Yt.NotFoundError=Uu;Yt.ConflictError=Lu;Yt.RateLimitError=qu;Yt.BadRequestError=Nu;Yt.AuthenticationError=zu;Yt.InternalServerError=Bu;Yt.PermissionDeniedError=ju;Yt.UnprocessableEntityError=Fu;Yt.toFile=ch;class jo extends Yt{constructor(){super(...arguments);this.completions=new Us(this),this.messages=new zo(this),this.models=new Fs(this),this.beta=new Fr(this)}}jo.Completions=Us;jo.Messages=zo;jo.Models=Fs;jo.Beta=Fr;function L7(e){return e}function Il(e){return L7(e)}class Mv extends Error{telemetryMessage;constructor(e,t){super(e);this.name="TelemetrySafeError",this.telemetryMessage=t??e}}function Ev(e){return e instanceof Error?e:Error(String(e))}function Th(e){return e instanceof Error?e.message:String(e)}function Uo(e){if(e&&typeof e==="object"&&"code"in e&&typeof e.code==="string")return e.code;return}function N2(e){return Uo(e)==="ENOENT"}function Iv(e){return Uo(e)==="EISDIR"}var dt=(()=>({}));var{appendFile:F7,chmod:q7,copyFile:B7,link:H7,lstat:Z7,mkdir:K7,open:z2,readdir:V7,readFile:j2,readlink:W7,realpath:G7,rename:J7,rmdir:X7,rm:Y7,stat:Q7,symlink:eC,unlink:tC}=(()=>({}));Dn();var Ph="→";var rC={cwd(){return process.cwd()},existsSync(e){let r=[];try{const t=Kt(r,Qt`fs.existsSync(${e})`,0);return dt.existsSync(e)}catch(i){var n=i,o=1}finally{Vt(r,n,o)}},async stat(e){return Q7(e)},async lstat(e){return Z7(e)},async readdir(e){return V7(e,{withFileTypes:!0})},async unlink(e){return tC(e)},async rmdir(e){return X7(e)},async rm(e,t){return Y7(e,t)},async mkdir(e,t){try{await K7(e,{recursive:!0,...t})}catch(r){if(Uo(r)!=="EEXIST")throw r}},async readFile(e,t){return j2(e,{encoding:t.encoding})},async rename(e,t){return J7(e,t)},async realpath(e){return Wm(await G7(e))},async readlink(e){return W7(e)},async copyFile(e,t){return B7(e,t)},async appendFile(e,t,r){if(r?.mode!==void 0)try{let i=await z2(e,"ax",r.mode);try{await i.appendFile(t)}finally{await i.close()}return}catch(i){if(Uo(i)!=="EEXIST")throw i}return F7(e,t)},async symlink(e,t,r){return eC(e,t,r)},async link(e,t){return H7(e,t)},async chmod(e,t){return q7(e,t)},statSync(e){let r=[];try{const t=Kt(r,Qt`fs.statSync(${e})`,0);return dt.statSync(e)}catch(i){var n=i,o=1}finally{Vt(r,n,o)}},lstatSync(e){let r=[];try{const t=Kt(r,Qt`fs.lstatSync(${e})`,0);return dt.lstatSync(e)}catch(i){var n=i,o=1}finally{Vt(r,n,o)}},readFileSync(e,t){let i=[];try{const r=Kt(i,Qt`fs.readFileSync(${e})`,0);return dt.readFileSync(e,{encoding:t.encoding})}catch(n){var o=n,s=1}finally{Vt(i,o,s)}},readFileBytesSync(e){let r=[];try{const t=Kt(r,Qt`fs.readFileBytesSync(${e})`,0);return dt.readFileSync(e)}catch(i){var n=i,o=1}finally{Vt(r,n,o)}},readSync(e,t){let n=[];try{const r=Kt(n,Qt`fs.readSync(${e}, ${t.length} bytes)`,0);let i=void 0;try{i=dt.openSync(e,"r");let v=Buffer.alloc(t.length),b=dt.readSync(i,v,0,t.length,0);return{buffer:v,bytesRead:b}}finally{if(i)dt.closeSync(i)}}catch(o){var s=o,h=1}finally{Vt(n,s,h)}},appendFileSync(e,t,r){let n=[];try{const i=Kt(n,Qt`fs.appendFileSync(${e}, ${t.length} chars)`,0);if(r?.mode!==void 0)try{let v=dt.openSync(e,"ax",r.mode);try{dt.appendFileSync(v,t)}finally{dt.closeSync(v)}return}catch(v){if(Uo(v)!=="EEXIST")throw v}dt.appendFileSync(e,t)}catch(o){var s=o,h=1}finally{Vt(n,s,h)}},copyFileSync(e,t){let i=[];try{const r=Kt(i,Qt`fs.copyFileSync(${e} ${Ph} ${t})`,0);dt.copyFileSync(e,t)}catch(n){var o=n,s=1}finally{Vt(i,o,s)}},unlinkSync(e){let r=[];try{const t=Kt(r,Qt`fs.unlinkSync(${e})`,0);dt.unlinkSync(e)}catch(i){var n=i,o=1}finally{Vt(r,n,o)}},renameSync(e,t){let i=[];try{const r=Kt(i,Qt`fs.renameSync(${e} ${Ph} ${t})`,0);dt.renameSync(e,t)}catch(n){var o=n,s=1}finally{Vt(i,o,s)}},linkSync(e,t){let i=[];try{const r=Kt(i,Qt`fs.linkSync(${e} ${Ph} ${t})`,0);dt.linkSync(e,t)}catch(n){var o=n,s=1}finally{Vt(i,o,s)}},symlinkSync(e,t,r){let n=[];try{const i=Kt(n,Qt`fs.symlinkSync(${e} ${Ph} ${t})`,0);dt.symlinkSync(e,t,r)}catch(o){var s=o,h=1}finally{Vt(n,s,h)}},readlinkSync(e){let r=[];try{const t=Kt(r,Qt`fs.readlinkSync(${e})`,0);return dt.readlinkSync(e)}catch(i){var n=i,o=1}finally{Vt(r,n,o)}},realpathSync(e){let r=[];try{const t=Kt(r,Qt`fs.realpathSync(${e})`,0);return Wm(dt.realpathSync(e))}catch(i){var n=i,o=1}finally{Vt(r,n,o)}},mkdirSync(e,t){let n=[];try{const r=Kt(n,Qt`fs.mkdirSync(${e})`,0);let i={recursive:!0};if(t?.mode!==void 0)i.mode=t.mode;try{dt.mkdirSync(e,i)}catch(v){if(Uo(v)!=="EEXIST")throw v}}catch(o){var s=o,h=1}finally{Vt(n,s,h)}},readdirSync(e){let r=[];try{const t=Kt(r,Qt`fs.readdirSync(${e})`,0);return dt.readdirSync(e,{withFileTypes:!0})}catch(i){var n=i,o=1}finally{Vt(r,n,o)}},readdirStringSync(e){let r=[];try{const t=Kt(r,Qt`fs.readdirStringSync(${e})`,0);return dt.readdirSync(e)}catch(i){var n=i,o=1}finally{Vt(r,n,o)}},rmdirSync(e){let r=[];try{const t=Kt(r,Qt`fs.rmdirSync(${e})`,0);dt.rmdirSync(e)}catch(i){var n=i,o=1}finally{Vt(r,n,o)}},rmSync(e,t){let i=[];try{const r=Kt(i,Qt`fs.rmSync(${e})`,0);dt.rmSync(e,t)}catch(n){var o=n,s=1}finally{Vt(i,o,s)}},createWriteStream(e){return dt.createWriteStream(e)},async readFileBytes(e,t){if(t===void 0)return j2(e);let r=await z2(e,"r");try{let{size:i}=await r.stat(),n=Math.min(i,t),o=Buffer.allocUnsafe(n),s=0;while(s<n){let{bytesRead:h}=await r.read(o,s,n-s,s);if(h===0)break;s+=h}return s<n?o.subarray(0,s):o}finally{await r.close()}}},nC=rC;function Ah(){return nC}Dn();var{lstatSync:Yhe,readFileSync:Qhe,rmSync:epe,unlinkSync:tpe,writeFileSync:rpe}=(()=>({}));function iC(e,t){if(e.destroyed||e.writableEnded)return;e.write(t)}function U2(e){iC(process.stderr,e)}var oC=/api[_-]?key|secret|token|password|passwd|credential|bearer|authorization|auth[_-]?header|cookie|session[_-]?(?:id|key)|connection[_-]?string|(?:private|ssh|encryption|signing|access|deploy|master|license)[_-]?key|client[_-]?secret/i,L2="[^\\s,;&}\\])]+",B2="-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----[\\s\\S-]{64,}?-----END[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----",sC=`[^\\s-]{0,4}${B2}['"\`]?`,F2=`\\[REDACTED\\]|"[^"]*"|'[^']*'|(?:Bearer|Basic)\\s+(?:\\[REDACTED\\]|${L2})|${sC}|${L2}`,aC=["sk","ant","api"].join("-"),uC=[{id:"url-userinfo",source:":\\/\\/([^/@\\s]+)@",confidence:"low"},{id:"gcp-service-account",source:"\\b([a-z0-9-]+@[a-z0-9-]+\\.iam\\.gserviceaccount\\.com)\\b",flags:"i",confidence:"low"},{id:"loose-anthropic-key",source:"\\b(sk-ant-?[\\w-]{10,})",confidence:"low"},{id:"http-auth-scheme",source:"\\b(?:Bearer|Basic)\\s+([A-Za-z0-9+/=._~-]{20,})",flags:"i",confidence:"low"},{id:"loose-jwt",source:"\\b(eyJ[A-Za-z0-9_-]{10,}\\.[A-Za-z0-9_-]{10,}\\.[A-Za-z0-9_-]{10,})",confidence:"low"},{id:"sensitive-assign",source:`(?:${oC.source})[\\w.-]*["']?\\s*[=:]\\s*(${F2})`,flags:"i",confidence:"low"},{id:"cloud-env-var",source:`\\b(?:AWS|GOOGLE|GCP|GCLOUD|AZURE)_\\w+\\s*[=:]\\s*(${F2})`,flags:"i",confidence:"low"},{id:"aws-access-token",source:"\\b((?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z2-7]{16})\\b",confidence:"high"},{id:"gcp-api-key",source:"\\b(AIza[\\w-]{35})(?![\\w-])",confidence:"high"},{id:"google-oauth-client-secret",source:"\\bGOCSPX-[\\w-]{28}(?![\\w-])",confidence:"high"},{id:"azure-ad-client-secret",source:`(?:^|[\\\\'"\\x60\\s>=:(,)])([a-zA-Z0-9_~.]{3}\\dQ~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\\\'"\\x60\\s<),])`,confidence:"high"},{id:"digitalocean-pat",source:`\\b(dop_v1_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"digitalocean-access-token",source:`\\b(doo_v1_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"anthropic-api-key",source:`\\b(${aC}03-[a-zA-Z0-9_\\-]{93}AA)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"anthropic-admin-api-key",source:`\\b(sk-ant-admin01-[a-zA-Z0-9_\\-]{93}AA)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"openai-api-key",source:"sk-[A-Za-z0-9_-]{8,200}T3BlbkFJ[A-Za-z0-9_-]{8,200}",confidence:"high"},{id:"openai-legacy-api-key",source:"\\bsk-[a-zA-Z0-9]{48}(?![a-zA-Z0-9])",confidence:"high"},{id:"huggingface-access-token",source:`\\b(hf_[a-zA-Z]{34})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"supabase-secret-key",source:"\\bsb_secret_[A-Za-z0-9_-]{20,}",confidence:"high"},{id:"supabase-access-token",source:"\\bsbp_[a-z0-9]{40,}",confidence:"high"},{id:"github-pat",source:"ghp_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-fine-grained-pat",source:"github_pat_\\w{82}",confidence:"high"},{id:"github-app-token",source:"(?:ghu|ghs)_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-oauth",source:"gho_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-refresh-token",source:"ghr_[0-9a-zA-Z]{36}",confidence:"high"},{id:"gitlab-pat",source:"glpat-[\\w-]{20}",confidence:"high"},{id:"gitlab-deploy-token",source:"gldt-[0-9a-zA-Z_\\-]{20}",confidence:"high"},{id:"slack-bot-token",source:"xoxb-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*",confidence:"high"},{id:"slack-user-token",source:"xox[pe](?:-[0-9]{10,13}){3}-[a-zA-Z0-9-]{28,34}",confidence:"high"},{id:"slack-app-token",source:"xapp-\\d-[A-Z0-9]+-\\d+-[a-z0-9]+",flags:"i",confidence:"high"},{id:"twilio-api-key",source:"SK[0-9a-fA-F]{32}",confidence:"high"},{id:"sendgrid-api-token",source:`\\b(SG\\.[a-zA-Z0-9=_\\-.]{66})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"npm-access-token",source:`\\b(npm_[a-zA-Z0-9]{36})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"pypi-upload-token",source:"pypi-AgEIcHlwaS5vcmc[\\w-]{50,1000}",confidence:"high"},{id:"databricks-api-token",source:`\\b(dapi[a-f0-9]{32}(?:-\\d)?)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"hashicorp-tf-api-token",source:"[a-zA-Z0-9]{14}\\.atlasv1\\.[a-zA-Z0-9\\-_=]{60,70}",confidence:"high"},{id:"pulumi-api-token",source:`\\b(pul-[a-f0-9]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"postman-api-token",source:`\\b(PMAK-[a-fA-F0-9]{24}-[a-fA-F0-9]{34})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-api-key",source:`\\b(eyJrIjoi[A-Za-z0-9+/]{70,400}={0,3})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-cloud-api-token",source:`\\b(glc_[A-Za-z0-9+/]{32,400}={0,3})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-service-account-token",source:`\\b(glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"sentry-user-token",source:`\\b(sntryu_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"sentry-org-token",source:"\\bsntrys_eyJpYXQiO[a-zA-Z0-9+/]{10,200}(?:LCJyZWdpb25fdXJs|InJlZ2lvbl91cmwi|cmVnaW9uX3VybCI6)[a-zA-Z0-9+/]{10,200}={0,2}_[a-zA-Z0-9+/]{43}",confidence:"high"},{id:"stripe-access-token",source:`\\b((?:sk|rk)_(?:test|live|prod)_[a-zA-Z0-9]{10,99})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"shopify-access-token",source:"shpat_[a-fA-F0-9]{32}",confidence:"high"},{id:"shopify-shared-secret",source:"shpss_[a-fA-F0-9]{32}",confidence:"high"},{id:"private-key",source:B2,flags:"i",confidence:"high"}];var q2=null;function lC(e){return uC.map((t)=>({id:t.id,confidence:t.confidence,re:new RegExp(t.source,e?(t.flags??"").replace("g","")+"g":t.flags??"")}))}function cC(e,t){if(typeof t!=="string")return"[REDACTED]";let r=t.length>=2&&(t[0]==='"'||t[0]==="'")&&t.at(-1)===t[0]?t[0]:"",i=e.lastIndexOf(t);return`${e.slice(0,i)}${r}[REDACTED]${r}${e.slice(i+t.length)}`}var dC=512,fC=512,$l=new Map;function H2(e){let t=e.length<=dC;if(t){let i=$l.get(e);if(i!==void 0)return i}q2??=lC(!0);let r=e;for(let i of q2)r=r.replace(i.re,cC);if(t){if($l.size>=fC)$l.delete($l.keys().next().value);$l.set(e,r)}return r}var Av={verbose:0,debug:1,info:2,warn:3,error:4},gC=Er(()=>{let e=process.env.CLAUDE_CODE_DEBUG_LOG_LEVEL?.toLowerCase().trim();if(e&&Object.hasOwn(Av,e))return e;return"debug"}),yC=!1;function Rh(){if(typeof process>"u"||!Array.isArray(process.argv))return[];let e=process.argv.indexOf("--");return e===-1?process.argv:process.argv.slice(0,e)}var G2=Er(()=>{let e=Rh();return yC||yo(process.env.DEBUG)||yo(process.env.DEBUG_SDK)||e.includes("--debug")||e.includes("-d")||J2()||e.some((t)=>t.startsWith("--debug="))||X2()!==null});var vC=Er(()=>{let e=Rh().find((r)=>r.startsWith("--debug="));if(!e)return null;let t=e.substring(8);return pS(t)}),J2=Er(()=>{let e=Rh();return e.includes("--debug-to-stderr")||e.includes("-d2e")}),X2=Er(()=>{let e=Rh();for(let t=0;t<e.length;t++){let r=e[t];if(r.startsWith("--debug-file="))return V2(r.substring(13));if(r==="--debug-file"&&t+1<e.length)return V2(e[t+1])}return null});function V2(e){return fS(e)?null:Ni(e)}function bC(e){if(!G2())return!1;if(typeof process>"u"||typeof process.versions>"u"||typeof process.versions.node>"u")return!1;let t=vC();return mS(e,t)}var _C=!1;var wC=10485760,Tl=null,$v=Promise.resolve(),qs=[],Al=null,W2=null;var Pl=-1,Tv=!1,Rv=null;async function SC(e,t,r=wC){if(Pl<0)Pl=await pC(e).then((i)=>i.size).catch(()=>0);else Pl+=t;if(Pl<=r||Tv)return;Tv=!0;try{let i=e.endsWith(".txt")?`${e.slice(0,-4)}.1.txt`:`${e}.1`;try{await K2(e,i)}catch(n){if(!N2(n))await Pv(i).catch(()=>{}),await K2(e,i).catch(()=>Pv(e).catch(()=>{}))}Pl=0}finally{Tv=!1}}function Y2(e){return Rv=Yn(e,`${Bm()}.txt`),Rv}async function xC(e,t,r,i){if(e)await hC(t,{recursive:!0}).catch(()=>{});let n=r;try{await Z2(r,i)}catch(o){if(!Iv(o))throw o;n=Y2(r),await Z2(n,i)}await SC(n,Buffer.byteLength(i)).catch(Q2),EC()}function Q2(){}function kC(){qs.shift()}function MC(){if(!Tl){let e=null;if(Tl=uS({writeFn:(t)=>{if(Al){qs.push(t),Al();return}let r=Cv(),i=zi(r),n=e!==i;e=i,qs.push(t),$v=$v.then(xC.bind(null,n,i,r,t)).catch(Q2).then(kC)},flushIntervalMs:1000,maxBufferSize:100,immediateMode:G2()}),hS(async()=>{Tl?.dispose(),await $v}),!W2)process.on("exit",W2=()=>{Al=()=>{if(qs.length===0)return;let t=qs.join("");qs.length=0;let r=Cv();try{Ah().mkdirSync(zi(r))}catch{}try{Ah().appendFileSync(r,t)}catch(i){if(Iv(i))try{Ah().appendFileSync(Y2(r),t)}catch{}}},Tl?.flush(),Al()})}return Tl}function Cr(e,{level:t}={level:"debug"}){if(Av[t]<Av[gC()])return;if(!bC(e))return;if(_C&&e.includes(`
|
|
94
|
+
`)){let _=b.indexOf(":");if(_>=0)v[b.substring(0,_).trim()]=b.substring(_+1).trim()}n.defaultHeaders={...v,...n.defaultHeaders}}let h=i.__auth;if(delete n.__auth,delete n.__baseURLIsExplicit,this._options=n,this.apiKey=typeof t==="string"?t:null,this.authToken=r,h){if(this._authState=h,!this._baseURLIsExplicit&&h.baseURL)this.baseURL=h.baseURL}else if(this._authState={provider:null,tokenCache:null,resolution:null,error:null,extraHeaders:{}},this.apiKey==null&&this.authToken==null){let v=n.credentials??null;if(v)this._authState.provider=v,this._authState.tokenCache=this._makeTokenCache(v);else if(n.config!=null){let b=tv(n.config,this._credentialResolverOptions());this._authState.provider=b.provider,this._authState.tokenCache=this._makeTokenCache(b.provider),this._authState.extraHeaders=b.extraHeaders,this._applyCredentialBaseURL(b.baseURL)}else if(n.profile!=null)this._authState.resolution=this._resolveDefaultCredentials(n.profile);else this._authState.resolution=this._resolveDefaultCredentials()}}_applyCredentialBaseURL(e){if(!e)return;let t=e.replace(/\/+$/,"");if(this._authState.baseURL=t,!this._baseURLIsExplicit)this.baseURL=t}_credentialResolverOptions(){return{baseURL:this.baseURL,fetch:this.fetch,userAgent:this.getUserAgent(),onCacheWriteError:(e)=>{nr(this).debug("credential cache write failed (best-effort)",e)},onSafetyWarning:(e)=>{nr(this).warn(e)}}}_makeTokenCache(e){return new Jy(e,(t)=>{nr(this).debug("advisory token refresh failed; serving cached token",t)})}withOptions(e){let t="credentials"in e||"config"in e||"profile"in e,r="apiKey"in e||"authToken"in e||t,i={...this._options,...this._baseURLIsExplicit?{baseURL:this.baseURL}:{},maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,credentials:this.credentials,...t?{credentials:void 0,config:void 0,profile:void 0}:{},...e,__auth:r?void 0:this._authState,__baseURLIsExplicit:"baseURL"in e?!0:this._baseURLIsExplicit};return new this.constructor(i)}async _resolveDefaultCredentials(e){try{let t=await o2(this._credentialResolverOptions(),e);if(t)this._authState.provider=t.provider,this._authState.tokenCache=this._makeTokenCache(t.provider),this._authState.extraHeaders=t.extraHeaders,this._applyCredentialBaseURL(t.baseURL);else if(e!=null)throw new Ye(`Profile "${e}" could not be resolved (no <config_dir>/configs/${e}.json found).`)}catch(t){this._authState.error=t}finally{this._authState.resolution=null}}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:t}){if(e.get("x-api-key")||e.get("authorization"))return;if(this._authState.error)throw this._authState.error;if(this._authState.tokenCache||this._authState.resolution)return;if(this.apiKey&&e.get("x-api-key"))return;if(t.has("x-api-key"))return;if(this.authToken&&e.get("authorization"))return;if(t.has("authorization"))return;throw Error('Could not resolve authentication method. Expected one of apiKey, authToken, credentials, config, or profile to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}_authFlags(e){let t=this._requestAuthFlags.get(e);if(!t)t={usedTokenCache:!1,didRefreshFor401:!1},this._requestAuthFlags.set(e,t);return t}async authHeaders(e){if(this._authState.resolution)await this._authState.resolution;if(this._authState.error)return;if(this._authState.tokenCache&&this.apiKey==null){let t=await this._authState.tokenCache.getToken();return this._authFlags(e).usedTokenCache=!0,_e([{Authorization:`Bearer ${t}`}])}return _e([await this.apiKeyAuth(e),await this.bearerAuth(e)])}async apiKeyAuth(e){if(this.apiKey==null)return;return _e([{"X-Api-Key":this.apiKey}])}async bearerAuth(e){if(this.authToken==null)return;return _e([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(e){return Fx(e)}getUserAgent(){return`${this.constructor.name}/JS ${Mn}`}defaultIdempotencyKey(){return`stainless-node-retry-${Hy()}`}makeStatusError(e,t,r,i){return wr.generate(e,t,r,i)}buildURL(e,t,r){let i=!oe(this,xv,"m",C2).call(this)&&r||this.baseURL,n=Px(e)?new URL(e):new URL(i+(i.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),o=this.defaultQuery(),s=Object.fromEntries(n.searchParams);if(!Vy(o)||!Vy(s))t={...s,...o,...t};if(typeof t==="object"&&t&&!Array.isArray(t))n.search=this.stringifyQuery(t);return n.toString()}_calculateNonstreamingTimeout(e){if(3600*e/128000>600)throw new Ye("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600000}async prepareOptions(e){}async prepareRequest(e,{url:t,options:r}){if(this._authState.tokenCache&&this.apiKey==null){let i=e.headers instanceof Headers?e.headers:new Headers(e.headers);for(let[o,s]of Object.entries(this._authState.extraHeaders))if(!i.has(o))i.set(o,s);if(!i.get("anthropic-beta")?.split(",").map((o)=>o.trim())?.includes(To))i.append("anthropic-beta",To);e.headers=i}}get(e,t){return this.methodRequest("get",e,t)}post(e,t){return this.methodRequest("post",e,t)}patch(e,t){return this.methodRequest("patch",e,t)}put(e,t){return this.methodRequest("put",e,t)}delete(e,t){return this.methodRequest("delete",e,t)}methodRequest(e,t,r){return this.request(Promise.resolve(r).then((i)=>({method:e,path:t,...i})))}request(e,t=null){return new Po(this,this.makeRequest(e,t,void 0))}async makeRequest(e,t,r){let i=await e,n=i.maxRetries??this.maxRetries;if(t==null)t=n,this._requestAuthFlags.delete(i);await this.prepareOptions(i);let{req:o,url:s,timeout:h}=await this.buildRequest(i,{retryCount:n-t});await this.prepareRequest(o,{url:s,options:i});let v="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),b=r===void 0?"":`, retryOf: ${r}`,_=Date.now();if(nr(this).debug(`[${v}] sending request`,mi({retryOfRequestLogID:r,method:i.method,url:s,options:i,headers:o.headers})),i.signal?.aborted)throw new Rr;let g=new AbortController,S=await this.fetchWithTimeout(s,o,h,g).catch(Ou),x=Date.now();if(S instanceof globalThis.Error){let $=`retrying, ${t} attempts remaining`;if(i.signal?.aborted)throw new Rr;let T=pi(S)||/timed? ?out/i.test(String(S)+("cause"in S?String(S.cause):""));if(t)return nr(this).info(`[${v}] connection ${T?"timed out":"failed"} - ${$}`),nr(this).debug(`[${v}] connection ${T?"timed out":"failed"} (${$})`,mi({retryOfRequestLogID:r,url:s,durationMs:x-_,message:S.message})),this.retryRequest(i,t,r??v);if(nr(this).info(`[${v}] connection ${T?"timed out":"failed"} - error; no more retries left`),nr(this).debug(`[${v}] connection ${T?"timed out":"failed"} (error; no more retries left)`,mi({retryOfRequestLogID:r,url:s,durationMs:x-_,message:S.message})),T)throw new Du;throw new $o({cause:S})}let M=[...S.headers.entries()].filter(([$])=>$==="request-id").map(([$,T])=>", "+$+": "+JSON.stringify(T)).join(""),I=`[${v}${b}${M}] ${o.method} ${s} ${S.ok?"succeeded":"failed"} with status ${S.status} in ${x-_}ms`;if(!S.ok){let $=await this.shouldRetry(S,i);if(t&&$){let B=`retrying, ${t} attempts remaining`;return await Ux(S.body),nr(this).info(`${I} - ${B}`),nr(this).debug(`[${v}] response error (${B})`,mi({retryOfRequestLogID:r,url:S.url,status:S.status,headers:S.headers,durationMs:x-_})),this.retryRequest(i,t,r??v,S.headers)}let T=$?"error; no more retries left":"error; not retryable";nr(this).info(`${I} - ${T}`);let P=await S.text().catch((B)=>Ou(B).message),R=Xf(P),C=R?void 0:P;throw nr(this).debug(`[${v}] response error (${T})`,mi({retryOfRequestLogID:r,url:S.url,status:S.status,headers:S.headers,message:C,durationMs:Date.now()-_})),this.makeStatusError(S.status,R,C,S.headers)}return nr(this).info(I),nr(this).debug(`[${v}] response start`,mi({retryOfRequestLogID:r,url:S.url,status:S.status,headers:S.headers,durationMs:x-_})),{response:S,options:i,controller:g,requestLogID:v,retryOfRequestLogID:r,startTime:_}}getAPIList(e,t,r){return this.requestAPIList(t,r&&"then"in r?r.then((i)=>({method:"get",path:e,...i})):{method:"get",path:e,...r})}requestAPIList(e,t){let r=this.makeRequest(t,null,void 0);return new lh(this,r,e)}async fetchWithTimeout(e,t,r,i){let{signal:n,method:o,...s}=t||{},h=this._makeAbort(i);if(n)n.addEventListener("abort",h,{once:!0});let v=setTimeout(h,r),b=globalThis.ReadableStream&&s.body instanceof globalThis.ReadableStream||typeof s.body==="object"&&s.body!==null&&Symbol.asyncIterator in s.body,_={signal:i.signal,...b?{duplex:"half"}:{},method:"GET",...s};if(o)_.method=o.toUpperCase();try{return await this.fetch.call(void 0,e,_)}finally{clearTimeout(v)}}async shouldRetry(e,t){let r=this._authFlags(t);if(e.status===401&&this._authState.tokenCache&&r.usedTokenCache&&!r.didRefreshFor401)return r.didRefreshFor401=!0,this._authState.tokenCache.invalidate(),!0;let i=e.headers.get("x-should-retry");if(i==="true")return!0;if(i==="false")return!1;if(e.status===408)return!0;if(e.status===409)return!0;if(e.status===429)return!0;if(e.status>=500)return!0;return!1}async retryRequest(e,t,r,i){let n,o=i?.get("retry-after-ms");if(o){let h=parseFloat(o);if(!Number.isNaN(h))n=h}let s=i?.get("retry-after");if(s&&!n){let h=parseFloat(s);if(!Number.isNaN(h))n=h*1000;else n=Date.parse(s)-Date.now()}if(n===void 0){let h=e.maxRetries??this.maxRetries;n=this.calculateDefaultRetryTimeoutMillis(t,h)}return await Cx(n),this.makeRequest(e,t-1,r)}calculateDefaultRetryTimeoutMillis(e,t){let n=t-e,o=Math.min(0.5*Math.pow(2,n),8),s=1-Math.random()*0.25;return o*s*1000}calculateNonstreamingTimeout(e,t){if(3600000*e/128000>600000||t!=null&&e>t)throw new Ye("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 600000}async buildRequest(e,{retryCount:t=0}={}){let r={...e},{method:i,path:n,query:o,defaultBaseURL:s}=r;if(this._authState.resolution)await this._authState.resolution;if(!this._baseURLIsExplicit&&this._authState.baseURL&&this.baseURL!==this._authState.baseURL)this.baseURL=this._authState.baseURL;let h=this.buildURL(n,o,s);if("timeout"in r)Rx("timeout",r.timeout);r.timeout=r.timeout??this.timeout;let{bodyHeaders:v,body:b}=this.buildBody({options:r}),_=await this.buildHeaders({options:e,method:i,bodyHeaders:v,retryCount:t});return{req:{method:i,headers:_,...r.signal&&{signal:r.signal},...globalThis.ReadableStream&&b instanceof globalThis.ReadableStream&&{duplex:"half"},...b&&{body:b},...this.fetchOptions??{},...r.fetchOptions??{}},url:h,timeout:r.timeout}}async buildHeaders({options:e,method:t,bodyHeaders:r,retryCount:i}){let n={};if(this.idempotencyHeader&&t!=="get"){if(!e.idempotencyKey)e.idempotencyKey=this.defaultIdempotencyKey();n[this.idempotencyHeader]=e.idempotencyKey}let o=_e([n,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(i),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1000))}:{},...Hu(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(e),this._options.defaultHeaders,r,e.headers]);return this.validateHeaders(o),o.values}_makeAbort(e){return()=>e.abort()}buildBody({options:{body:e,headers:t}}){if(!e)return{bodyHeaders:void 0,body:void 0};let r=_e([t]);if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e==="string"&&r.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream)return{bodyHeaders:void 0,body:e};else if(typeof e==="object"&&((Symbol.asyncIterator in e)||(Symbol.iterator in e)&&("next"in e)&&typeof e.next==="function"))return{bodyHeaders:void 0,body:Yf(e)};else if(typeof e==="object"&&r.values.get("content-type")==="application/x-www-form-urlencoded")return{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(e)};else return oe(this,$h,"f").call(this,{body:e,headers:r})}}kv=Yt,$h=new WeakMap,xv=new WeakSet,C2=function(){return this.baseURL!=="https://api.anthropic.com"};Yt.Anthropic=kv;Yt.HUMAN_PROMPT=O2;Yt.AI_PROMPT=D2;Yt.DEFAULT_TIMEOUT=600000;Yt.AnthropicError=Ye;Yt.APIError=wr;Yt.APIConnectionError=$o;Yt.APIConnectionTimeoutError=Du;Yt.APIUserAbortError=Rr;Yt.NotFoundError=Uu;Yt.ConflictError=Lu;Yt.RateLimitError=qu;Yt.BadRequestError=Nu;Yt.AuthenticationError=zu;Yt.InternalServerError=Bu;Yt.PermissionDeniedError=ju;Yt.UnprocessableEntityError=Fu;Yt.toFile=ch;class jo extends Yt{constructor(){super(...arguments);this.completions=new Us(this),this.messages=new zo(this),this.models=new Fs(this),this.beta=new Fr(this)}}jo.Completions=Us;jo.Messages=zo;jo.Models=Fs;jo.Beta=Fr;function L7(e){return e}function Il(e){return L7(e)}class Mv extends Error{telemetryMessage;constructor(e,t){super(e);this.name="TelemetrySafeError",this.telemetryMessage=t??e}}function Ev(e){return e instanceof Error?e:Error(String(e))}function Th(e){return e instanceof Error?e.message:String(e)}function Uo(e){if(e&&typeof e==="object"&&"code"in e&&typeof e.code==="string")return e.code;return}function N2(e){return Uo(e)==="ENOENT"}function Iv(e){return Uo(e)==="EISDIR"}var dt=(()=>({}));var{appendFile:F7,chmod:q7,copyFile:B7,link:H7,lstat:Z7,mkdir:K7,open:z2,readdir:V7,readFile:j2,readlink:W7,realpath:G7,rename:J7,rmdir:X7,rm:Y7,stat:Q7,symlink:eC,unlink:tC}=(()=>({}));Dn();var Ph="→",ope=process.platform==="win32"?/[\\/]+/:/\/+/;var rC={cwd(){return process.cwd()},existsSync(e){let r=[];try{const t=Kt(r,Qt`fs.existsSync(${e})`,0);return dt.existsSync(e)}catch(i){var n=i,o=1}finally{Vt(r,n,o)}},async stat(e){return Q7(e)},async lstat(e){return Z7(e)},async readdir(e){return V7(e,{withFileTypes:!0})},async unlink(e){return tC(e)},async rmdir(e){return X7(e)},async rm(e,t){return Y7(e,t)},async mkdir(e,t){try{await K7(e,{recursive:!0,...t})}catch(r){if(Uo(r)!=="EEXIST")throw r}},async readFile(e,t){return j2(e,{encoding:t.encoding})},async rename(e,t){return J7(e,t)},async realpath(e){return Wm(await G7(e))},async readlink(e){return W7(e)},async copyFile(e,t){return B7(e,t)},async appendFile(e,t,r){if(r?.mode!==void 0)try{let i=await z2(e,"ax",r.mode);try{await i.appendFile(t)}finally{await i.close()}return}catch(i){if(Uo(i)!=="EEXIST")throw i}return F7(e,t)},async symlink(e,t,r){return eC(e,t,r)},async link(e,t){return H7(e,t)},async chmod(e,t){return q7(e,t)},statSync(e){let r=[];try{const t=Kt(r,Qt`fs.statSync(${e})`,0);return dt.statSync(e)}catch(i){var n=i,o=1}finally{Vt(r,n,o)}},lstatSync(e){let r=[];try{const t=Kt(r,Qt`fs.lstatSync(${e})`,0);return dt.lstatSync(e)}catch(i){var n=i,o=1}finally{Vt(r,n,o)}},readFileSync(e,t){let i=[];try{const r=Kt(i,Qt`fs.readFileSync(${e})`,0);return dt.readFileSync(e,{encoding:t.encoding})}catch(n){var o=n,s=1}finally{Vt(i,o,s)}},readFileBytesSync(e){let r=[];try{const t=Kt(r,Qt`fs.readFileBytesSync(${e})`,0);return dt.readFileSync(e)}catch(i){var n=i,o=1}finally{Vt(r,n,o)}},readSync(e,t){let n=[];try{const r=Kt(n,Qt`fs.readSync(${e}, ${t.length} bytes)`,0);let i=void 0;try{i=dt.openSync(e,"r");let v=Buffer.alloc(t.length),b=dt.readSync(i,v,0,t.length,0);return{buffer:v,bytesRead:b}}finally{if(i)dt.closeSync(i)}}catch(o){var s=o,h=1}finally{Vt(n,s,h)}},appendFileSync(e,t,r){let n=[];try{const i=Kt(n,Qt`fs.appendFileSync(${e}, ${t.length} chars)`,0);if(r?.mode!==void 0)try{let v=dt.openSync(e,"ax",r.mode);try{dt.appendFileSync(v,t)}finally{dt.closeSync(v)}return}catch(v){if(Uo(v)!=="EEXIST")throw v}dt.appendFileSync(e,t)}catch(o){var s=o,h=1}finally{Vt(n,s,h)}},copyFileSync(e,t){let i=[];try{const r=Kt(i,Qt`fs.copyFileSync(${e} ${Ph} ${t})`,0);dt.copyFileSync(e,t)}catch(n){var o=n,s=1}finally{Vt(i,o,s)}},unlinkSync(e){let r=[];try{const t=Kt(r,Qt`fs.unlinkSync(${e})`,0);dt.unlinkSync(e)}catch(i){var n=i,o=1}finally{Vt(r,n,o)}},renameSync(e,t){let i=[];try{const r=Kt(i,Qt`fs.renameSync(${e} ${Ph} ${t})`,0);dt.renameSync(e,t)}catch(n){var o=n,s=1}finally{Vt(i,o,s)}},linkSync(e,t){let i=[];try{const r=Kt(i,Qt`fs.linkSync(${e} ${Ph} ${t})`,0);dt.linkSync(e,t)}catch(n){var o=n,s=1}finally{Vt(i,o,s)}},symlinkSync(e,t,r){let n=[];try{const i=Kt(n,Qt`fs.symlinkSync(${e} ${Ph} ${t})`,0);dt.symlinkSync(e,t,r)}catch(o){var s=o,h=1}finally{Vt(n,s,h)}},readlinkSync(e){let r=[];try{const t=Kt(r,Qt`fs.readlinkSync(${e})`,0);return dt.readlinkSync(e)}catch(i){var n=i,o=1}finally{Vt(r,n,o)}},realpathSync(e){let r=[];try{const t=Kt(r,Qt`fs.realpathSync(${e})`,0);return Wm(dt.realpathSync(e))}catch(i){var n=i,o=1}finally{Vt(r,n,o)}},mkdirSync(e,t){let n=[];try{const r=Kt(n,Qt`fs.mkdirSync(${e})`,0);let i={recursive:!0};if(t?.mode!==void 0)i.mode=t.mode;try{dt.mkdirSync(e,i)}catch(v){if(Uo(v)!=="EEXIST")throw v}}catch(o){var s=o,h=1}finally{Vt(n,s,h)}},readdirSync(e){let r=[];try{const t=Kt(r,Qt`fs.readdirSync(${e})`,0);return dt.readdirSync(e,{withFileTypes:!0})}catch(i){var n=i,o=1}finally{Vt(r,n,o)}},readdirStringSync(e){let r=[];try{const t=Kt(r,Qt`fs.readdirStringSync(${e})`,0);return dt.readdirSync(e)}catch(i){var n=i,o=1}finally{Vt(r,n,o)}},rmdirSync(e){let r=[];try{const t=Kt(r,Qt`fs.rmdirSync(${e})`,0);dt.rmdirSync(e)}catch(i){var n=i,o=1}finally{Vt(r,n,o)}},rmSync(e,t){let i=[];try{const r=Kt(i,Qt`fs.rmSync(${e})`,0);dt.rmSync(e,t)}catch(n){var o=n,s=1}finally{Vt(i,o,s)}},createWriteStream(e){return dt.createWriteStream(e)},async readFileBytes(e,t){if(t===void 0)return j2(e);let r=await z2(e,"r");try{let{size:i}=await r.stat(),n=Math.min(i,t),o=Buffer.allocUnsafe(n),s=0;while(s<n){let{bytesRead:h}=await r.read(o,s,n-s,s);if(h===0)break;s+=h}return s<n?o.subarray(0,s):o}finally{await r.close()}}},nC=rC;function Ah(){return nC}Dn();var{lstatSync:lpe,readFileSync:cpe,rmSync:dpe,unlinkSync:fpe,writeFileSync:hpe}=(()=>({}));function iC(e,t){if(e.destroyed||e.writableEnded)return;e.write(t)}function U2(e){iC(process.stderr,e)}var oC=/api[_-]?key|secret|token|password|passwd|credential|bearer|authorization|auth[_-]?header|cookie|session[_-]?(?:id|key)|connection[_-]?string|(?:private|ssh|encryption|signing|access|deploy|master|license)[_-]?key|client[_-]?secret/i,L2="[^\\s,;&}\\])]+",B2="-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----[\\s\\S-]{64,}?-----END[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----",sC=`[^\\s-]{0,4}${B2}['"\`]?`,F2=`\\[REDACTED\\]|"[^"]*"|'[^']*'|(?:Bearer|Basic)\\s+(?:\\[REDACTED\\]|${L2})|${sC}|${L2}`,aC=["sk","ant","api"].join("-"),uC=[{id:"url-userinfo",source:":\\/\\/([^/@\\s]+)@",confidence:"low"},{id:"gcp-service-account",source:"\\b([a-z0-9-]+@[a-z0-9-]+\\.iam\\.gserviceaccount\\.com)\\b",flags:"i",confidence:"low"},{id:"loose-anthropic-key",source:"\\b(sk-ant-?[\\w-]{10,})",confidence:"low"},{id:"http-auth-scheme",source:"\\b(?:Bearer|Basic)\\s+([A-Za-z0-9+/=._~-]{20,})",flags:"i",confidence:"low"},{id:"loose-jwt",source:"\\b(eyJ[A-Za-z0-9_-]{10,}\\.[A-Za-z0-9_-]{10,}\\.[A-Za-z0-9_-]{10,})",confidence:"low"},{id:"sensitive-assign",source:`(?:${oC.source})[\\w.-]*["']?\\s*[=:]\\s*(${F2})`,flags:"i",confidence:"low"},{id:"cloud-env-var",source:`\\b(?:AWS|GOOGLE|GCP|GCLOUD|AZURE)_\\w+\\s*[=:]\\s*(${F2})`,flags:"i",confidence:"low"},{id:"aws-access-token",source:"\\b((?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z2-7]{16})\\b",confidence:"high"},{id:"gcp-api-key",source:"\\b(AIza[\\w-]{35})(?![\\w-])",confidence:"high"},{id:"google-oauth-client-secret",source:"\\bGOCSPX-[\\w-]{28}(?![\\w-])",confidence:"high"},{id:"azure-ad-client-secret",source:`(?:^|[\\\\'"\\x60\\s>=:(,)])([a-zA-Z0-9_~.]{3}\\dQ~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\\\'"\\x60\\s<),])`,confidence:"high"},{id:"digitalocean-pat",source:`\\b(dop_v1_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"digitalocean-access-token",source:`\\b(doo_v1_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"anthropic-api-key",source:`\\b(${aC}03-[a-zA-Z0-9_\\-]{93}AA)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"anthropic-admin-api-key",source:`\\b(sk-ant-admin01-[a-zA-Z0-9_\\-]{93}AA)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"openai-api-key",source:"sk-[A-Za-z0-9_-]{8,200}T3BlbkFJ[A-Za-z0-9_-]{8,200}",confidence:"high"},{id:"openai-legacy-api-key",source:"\\bsk-[a-zA-Z0-9]{48}(?![a-zA-Z0-9])",confidence:"high"},{id:"huggingface-access-token",source:`\\b(hf_[a-zA-Z]{34})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"supabase-secret-key",source:"\\bsb_secret_[A-Za-z0-9_-]{20,}",confidence:"high"},{id:"supabase-access-token",source:"\\bsbp_[a-z0-9]{40,}",confidence:"high"},{id:"github-pat",source:"ghp_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-fine-grained-pat",source:"github_pat_\\w{82}",confidence:"high"},{id:"github-app-token",source:"(?:ghu|ghs)_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-oauth",source:"gho_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-refresh-token",source:"ghr_[0-9a-zA-Z]{36}",confidence:"high"},{id:"gitlab-pat",source:"glpat-[\\w-]{20}",confidence:"high"},{id:"gitlab-deploy-token",source:"gldt-[0-9a-zA-Z_\\-]{20}",confidence:"high"},{id:"slack-bot-token",source:"xoxb-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*",confidence:"high"},{id:"slack-user-token",source:"xox[pe](?:-[0-9]{10,13}){3}-[a-zA-Z0-9-]{28,34}",confidence:"high"},{id:"slack-app-token",source:"xapp-\\d-[A-Z0-9]+-\\d+-[a-z0-9]+",flags:"i",confidence:"high"},{id:"twilio-api-key",source:"SK[0-9a-fA-F]{32}",confidence:"high"},{id:"sendgrid-api-token",source:`\\b(SG\\.[a-zA-Z0-9=_\\-.]{66})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"npm-access-token",source:`\\b(npm_[a-zA-Z0-9]{36})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"pypi-upload-token",source:"pypi-AgEIcHlwaS5vcmc[\\w-]{50,1000}",confidence:"high"},{id:"databricks-api-token",source:`\\b(dapi[a-f0-9]{32}(?:-\\d)?)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"hashicorp-tf-api-token",source:"[a-zA-Z0-9]{14}\\.atlasv1\\.[a-zA-Z0-9\\-_=]{60,70}",confidence:"high"},{id:"pulumi-api-token",source:`\\b(pul-[a-f0-9]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"postman-api-token",source:`\\b(PMAK-[a-fA-F0-9]{24}-[a-fA-F0-9]{34})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-api-key",source:`\\b(eyJrIjoi[A-Za-z0-9+/]{70,400}={0,3})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-cloud-api-token",source:`\\b(glc_[A-Za-z0-9+/]{32,400}={0,3})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-service-account-token",source:`\\b(glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"sentry-user-token",source:`\\b(sntryu_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"sentry-org-token",source:"\\bsntrys_eyJpYXQiO[a-zA-Z0-9+/]{10,200}(?:LCJyZWdpb25fdXJs|InJlZ2lvbl91cmwi|cmVnaW9uX3VybCI6)[a-zA-Z0-9+/]{10,200}={0,2}_[a-zA-Z0-9+/]{43}",confidence:"high"},{id:"stripe-access-token",source:`\\b((?:sk|rk)_(?:test|live|prod)_[a-zA-Z0-9]{10,99})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"shopify-access-token",source:"shpat_[a-fA-F0-9]{32}",confidence:"high"},{id:"shopify-shared-secret",source:"shpss_[a-fA-F0-9]{32}",confidence:"high"},{id:"private-key",source:B2,flags:"i",confidence:"high"}];var q2=null;function lC(e){return uC.map((t)=>({id:t.id,confidence:t.confidence,re:new RegExp(t.source,e?(t.flags??"").replace("g","")+"g":t.flags??"")}))}function cC(e,t){if(typeof t!=="string")return"[REDACTED]";let r=t.length>=2&&(t[0]==='"'||t[0]==="'")&&t.at(-1)===t[0]?t[0]:"",i=e.lastIndexOf(t);return`${e.slice(0,i)}${r}[REDACTED]${r}${e.slice(i+t.length)}`}var dC=512,fC=512,$l=new Map;function H2(e){let t=e.length<=dC;if(t){let i=$l.get(e);if(i!==void 0)return i}q2??=lC(!0);let r=e;for(let i of q2)r=r.replace(i.re,cC);if(t){if($l.size>=fC)$l.delete($l.keys().next().value);$l.set(e,r)}return r}var Av={verbose:0,debug:1,info:2,warn:3,error:4},gC=Er(()=>{let e=process.env.CLAUDE_CODE_DEBUG_LOG_LEVEL?.toLowerCase().trim();if(e&&Object.hasOwn(Av,e))return e;return"debug"}),yC=!1;function Rh(){if(typeof process>"u"||!Array.isArray(process.argv))return[];let e=process.argv.indexOf("--");return e===-1?process.argv:process.argv.slice(0,e)}var G2=Er(()=>{let e=Rh();return yC||yo(process.env.DEBUG)||yo(process.env.DEBUG_SDK)||e.includes("--debug")||e.includes("-d")||J2()||e.some((t)=>t.startsWith("--debug="))||X2()!==null});var vC=Er(()=>{let e=Rh().find((r)=>r.startsWith("--debug="));if(!e)return null;let t=e.substring(8);return pS(t)}),J2=Er(()=>{let e=Rh();return e.includes("--debug-to-stderr")||e.includes("-d2e")}),X2=Er(()=>{let e=Rh();for(let t=0;t<e.length;t++){let r=e[t];if(r.startsWith("--debug-file="))return V2(r.substring(13));if(r==="--debug-file"&&t+1<e.length)return V2(e[t+1])}return null});function V2(e){return fS(e)?null:Ni(e)}function bC(e){if(!G2())return!1;if(typeof process>"u"||typeof process.versions>"u"||typeof process.versions.node>"u")return!1;let t=vC();return mS(e,t)}var _C=!1;var wC=10485760,Tl=null,$v=Promise.resolve(),qs=[],Al=null,W2=null;var Pl=-1,Tv=!1,Rv=null;async function SC(e,t,r=wC){if(Pl<0)Pl=await pC(e).then((i)=>i.size).catch(()=>0);else Pl+=t;if(Pl<=r||Tv)return;Tv=!0;try{let i=e.endsWith(".txt")?`${e.slice(0,-4)}.1.txt`:`${e}.1`;try{await K2(e,i)}catch(n){if(!N2(n))await Pv(i).catch(()=>{}),await K2(e,i).catch(()=>Pv(e).catch(()=>{}))}Pl=0}finally{Tv=!1}}function Y2(e){return Rv=Yn(e,`${Bm()}.txt`),Rv}async function xC(e,t,r,i){if(e)await hC(t,{recursive:!0}).catch(()=>{});let n=r;try{await Z2(r,i)}catch(o){if(!Iv(o))throw o;n=Y2(r),await Z2(n,i)}await SC(n,Buffer.byteLength(i)).catch(Q2),EC()}function Q2(){}function kC(){qs.shift()}function MC(){if(!Tl){let e=null;if(Tl=uS({writeFn:(t)=>{if(Al){qs.push(t),Al();return}let r=Cv(),i=zi(r),n=e!==i;e=i,qs.push(t),$v=$v.then(xC.bind(null,n,i,r,t)).catch(Q2).then(kC)},flushIntervalMs:1000,maxBufferSize:100,immediateMode:G2()}),hS(async()=>{Tl?.dispose(),await $v}),!W2)process.on("exit",W2=()=>{Al=()=>{if(qs.length===0)return;let t=qs.join("");qs.length=0;let r=Cv();try{Ah().mkdirSync(zi(r))}catch{}try{Ah().appendFileSync(r,t)}catch(i){if(Iv(i))try{Ah().appendFileSync(Y2(r),t)}catch{}}},Tl?.flush(),Al()})}return Tl}function Cr(e,{level:t}={level:"debug"}){if(Av[t]<Av[gC()])return;if(!bC(e))return;if(_C&&e.includes(`
|
|
95
95
|
`))e=yn(e);let i=`${new Date().toISOString()} [${t.toUpperCase()}] ${H2(e.trim())}
|
|
96
|
-
`;if(J2()){U2(i);return}let n=MC();if(n.write(i),Al)n.flush()}function Cv(){return X2()??Rv??process.env.CLAUDE_CODE_DEBUG_LOGS_DIR??Yn(Tx(),"debug",`${Bm()}.txt`)}var EC=Er(async()=>{try{let e=Cv(),t=zi(e),r=Yn(t,"latest");await Pv(r).catch(()=>{}),await mC(e,r)}catch{}});var
|
|
96
|
+
`;if(J2()){U2(i);return}let n=MC();if(n.write(i),Al)n.flush()}function Cv(){return X2()??Rv??process.env.CLAUDE_CODE_DEBUG_LOGS_DIR??Yn(Tx(),"debug",`${Bm()}.txt`)}var EC=Er(async()=>{try{let e=Cv(),t=zi(e),r=Yn(t,"latest");await Pv(r).catch(()=>{}),await mC(e,r)}catch{}});var Kpe=(()=>{let e=process.env.CLAUDE_CODE_SLOW_OPERATION_THRESHOLD_MS;if(e!==void 0){let t=Number(e);if(!Number.isNaN(t)&&t>=0)return t}return 1/0})();var IC={[Symbol.dispose](){}};function $C(){return IC}var Qt=$C;function yn(e,t,r){let n=[];try{const i=Kt(n,Qt`JSON.stringify(${e})`,0);return JSON.stringify(e,t,r)}catch(o){var s=o,h=1}finally{Vt(n,s,h)}}var Bs=(e,t)=>{let i=[];try{const r=Kt(i,Qt`JSON.parse(${e})`,0);return typeof t>"u"?JSON.parse(e):JSON.parse(e,t)}catch(n){var o=n,s=1}finally{Vt(i,o,s)}};class Lo{returned;queue=[];readResolve;readReject;isDone=!1;hasError;started=!1;constructor(e){this.returned=e}[Symbol.asyncIterator](){if(this.started)throw Error("Stream can only be iterated once");return this.started=!0,this}next(){if(this.queue.length>0)return Promise.resolve({done:!1,value:this.queue.shift()});if(this.isDone)return Promise.resolve({done:!0,value:void 0});if(this.hasError)return Promise.reject(this.hasError);return new Promise((e,t)=>{this.readResolve=e,this.readReject=t})}enqueue(e){if(this.readResolve){let t=this.readResolve;this.readResolve=void 0,this.readReject=void 0,t({done:!1,value:e})}else this.queue.push(e)}done(){if(this.isDone=!0,this.readResolve){let e=this.readResolve;this.readResolve=void 0,this.readReject=void 0,e({done:!0,value:void 0})}}error(e){if(this.hasError=e,this.readReject){let t=this.readReject;this.readResolve=void 0,this.readReject=void 0,t(e)}}return(){if(this.isDone=!0,this.returned)this.returned();return Promise.resolve({done:!0,value:void 0})}}var TC=1000;function PC(){return{eventQueue:[],sink:null,droppedEventCount:0}}function AC(e,t){if(e.eventQueue.length>=TC)e.eventQueue.shift(),e.droppedEventCount++;e.eventQueue.push(t)}var RC=PC();function Rl(e,t){let r=RC;if(r.sink===null){AC(r,{eventName:e,metadata:t,async:!1});return}r.sink.logEvent(e,t)}function CC(e,t){Rl("tengu_feature_ok",{feature_name:Il(e),...t})}function OC(e,t,r){Rl("tengu_feature_bad",{...r,feature_name:Il(e),error_code:t})}async function vn(e,t,r){try{let i=await t();return CC(e),i}catch(i){throw OC(e,r?.(i)??"error"),i}}class Ov{sendMcpMessage;isClosed=!1;constructor(e){this.sendMcpMessage=e}onclose;onerror;onmessage;async start(){}async send(e){if(this.isClosed)throw Error("Transport is closed");this.sendMcpMessage(e)}async close(){if(this.isClosed)return;this.isClosed=!0,this.onclose?.()}}var Dv=Symbol("suppressControlResponse");class Ch{transport;isSingleUserTurn;canUseTool;hooks;abortController;jsonSchema;initConfig;onElicitation;getOAuthToken;getHostAuthToken;onUserDialog;pendingControlResponses=new Map;unmatchedControlResponses=new Map;static UNMATCHED_CONTROL_RESPONSES_MAX=1024;cleanupPerformed=!1;sdkMessages;inputStream=new Lo;initialization;cancelControllers=new Map;hookCallbacks=new Map;nextCallbackId=0;initHooksPayload;sdkMcpTransports=new Map;sdkMcpServerInstances=new Map;pendingMcpResponses=new Map;firstResultReceivedResolve;firstResultReceived=!1;lastErrorResultText;transcriptMirrorBatcher;cleanupCallbacks=[];cleanupPromise;setIsSingleUserTurn(e){this.isSingleUserTurn=e}setTranscriptMirrorBatcher(e){this.transcriptMirrorBatcher=e}reportMirrorError(e,t){let r={type:"system",subtype:"mirror_error",error:t,key:e,uuid:va(),session_id:e.sessionId};this.inputStream.enqueue(r)}addCleanupCallback(e){if(this.cleanupPerformed)e();else this.cleanupCallbacks.push(e)}isClosed(){return this.cleanupPerformed}hasBidirectionalNeeds(){return this.sdkMcpTransports.size>0||this.hooks!==void 0&&Object.keys(this.hooks).length>0||this.canUseTool!==void 0||this.onElicitation!==void 0||this.onUserDialog!==void 0||this.getOAuthToken!==void 0||this.getHostAuthToken!==void 0}constructor(e,t,r,i,n,o=new Map,s,h,v,b,_,g){this.transport=e;this.isSingleUserTurn=t;this.canUseTool=r;this.hooks=i;this.abortController=n;this.jsonSchema=s;this.initConfig=h;this.onElicitation=v;this.getOAuthToken=b;this.getHostAuthToken=_;this.onUserDialog=g;for(let[S,x]of o)this.connectSdkMcpServer(S,x);this.sdkMessages=this.readSdkMessages(),this.readMessages(),this.initialization=this.initialize(),this.initialization.catch(()=>{})}setError(e){this.inputStream.error(e)}async stopTask(e){await this.request({subtype:"stop_task",task_id:e})}async backgroundTasks(e){return(await this.request({subtype:"background_tasks",tool_use_id:e})).response.backgrounded??!0}close(){this.cleanup()}cleanup(e){if(this.cleanupPromise)return this.cleanupPromise;return this.cleanupPerformed=!0,this.cleanupPromise=this.performCleanup(e),this.cleanupPromise}async performCleanup(e){for(let t of this.cleanupCallbacks)try{t()}catch{}if(this.cleanupCallbacks=[],this.transcriptMirrorBatcher)try{await this.transcriptMirrorBatcher.flush()}catch{}try{for(let r of this.cancelControllers.values())r.abort();this.cancelControllers.clear(),this.transport.close();let t=e??Error("Query closed before response received");for(let{reject:r}of this.pendingControlResponses.values())r(t);this.pendingControlResponses.clear(),this.unmatchedControlResponses.clear();for(let{reject:r}of this.pendingMcpResponses.values())r(t);this.pendingMcpResponses.clear(),this.hookCallbacks.clear();for(let r of this.sdkMcpTransports.values())r.close().catch(()=>{});if(this.sdkMcpTransports.clear(),e)this.inputStream.error(e);else this.inputStream.done()}catch(t){}if(this.transport.waitForExit){let t=new AbortController;try{await Promise.race([this.transport.waitForExit(),z_(2000,t.signal)])}catch{}finally{t.abort()}}}next(...[e]){return this.sdkMessages.next(...[e])}async return(e){return await this.cleanup(),this.sdkMessages.return(e)}async throw(e){return await this.cleanup(),this.sdkMessages.throw(e)}[Symbol.asyncIterator](){return this.sdkMessages}async[Symbol.asyncDispose](){await this.cleanup()}async readMessages(){try{for await(let e of this.transport.readMessages()){if(e.type==="control_response"){let t=this.pendingControlResponses.get(e.response.request_id);if(t)t.handler(e.response);else{if(this.unmatchedControlResponses.size>=Ch.UNMATCHED_CONTROL_RESPONSES_MAX){let r=this.unmatchedControlResponses.keys().next().value;if(r!==void 0)this.unmatchedControlResponses.delete(r)}this.unmatchedControlResponses.set(e.response.request_id,e.response)}continue}else if(e.type==="control_request"){this.handleControlRequest(e);continue}else if(e.type==="control_cancel_request"){this.handleControlCancelRequest(e);continue}else if(e.type==="keep_alive")continue;else if(e.type==="transcript_mirror"){this.transcriptMirrorBatcher?.enqueue(e.filePath,e.entries);continue}if(e.type==="system"&&(e.subtype==="post_turn_summary"||e.subtype==="task_summary")){this.inputStream.enqueue(e);continue}if(e.type==="active_goal"){this.inputStream.enqueue(e);continue}if(e.type==="result"){if(this.transcriptMirrorBatcher)await this.transcriptMirrorBatcher.flush();let t=e.is_error?e.subtype==="success"?e.result:e.errors.map((r)=>r.trim()).filter(Boolean).join("; "):void 0;if(this.lastErrorResultText=t||void 0,this.firstResultReceived=!0,this.firstResultReceivedResolve)this.firstResultReceivedResolve();if(this.isSingleUserTurn)Cr("[Query.readMessages] First result received for single-turn query, closing stdin"),this.transport.endInput()}else if(!(e.type==="system"&&e.subtype==="session_state_changed"))this.lastErrorResultText=void 0;this.inputStream.enqueue(e)}if(this.transcriptMirrorBatcher)await this.transcriptMirrorBatcher.flush();if(this.firstResultReceivedResolve)this.firstResultReceivedResolve();this.inputStream.done(),this.cleanup()}catch(e){if(this.transcriptMirrorBatcher)await this.transcriptMirrorBatcher.flush();if(this.firstResultReceivedResolve)this.firstResultReceivedResolve();if(this.lastErrorResultText!==void 0&&!(e instanceof On)&&e?.name!=="SSEHttpError"){let t=Error(`Claude Code returned an error result: ${this.lastErrorResultText}`);Cr(`[Query.readMessages] Replacing exit error with result text. Original: ${Th(e)}`),this.inputStream.error(t),this.cleanup(t);return}this.inputStream.error(e),this.cleanup(e)}}async handleControlRequest(e){if(this.cancelControllers.has(e.request_id)){Cr(`[Query.handleControlRequest] Duplicate delivery of in-flight request ${e.request_id} (${e.request.subtype}) — skipping`);return}let t=new AbortController;this.cancelControllers.set(e.request_id,t);try{let r=await this.processControlRequest(e,t.signal);if(this.cleanupPerformed)return;if(r===Dv)return;let i={type:"control_response",response:{subtype:"success",request_id:e.request_id,response:r}};await Promise.resolve(this.transport.write(yn(i)+`
|
|
97
97
|
`))}catch(r){if(this.cleanupPerformed)return;let i={type:"control_response",response:{subtype:"error",request_id:e.request_id,error:Th(r)}};try{await Promise.resolve(this.transport.write(yn(i)+`
|
|
98
98
|
`))}catch(n){Cr(`[Query.handleControlRequest] Error-response write failed: ${Th(n)}`,{level:"error"})}}finally{this.cancelControllers.delete(e.request_id)}}handleControlCancelRequest(e){let t=this.cancelControllers.get(e.request_id);if(t)t.abort(),this.cancelControllers.delete(e.request_id)}async processControlRequest(e,t){if(e.request.subtype==="can_use_tool"){if(!this.canUseTool)throw Error("canUseTool callback is not provided.");let r=await this.canUseTool(e.request.tool_name,e.request.input,{signal:t,suggestions:e.request.permission_suggestions,blockedPath:e.request.blocked_path,decisionReason:e.request.decision_reason,title:e.request.title,displayName:e.request.display_name,description:e.request.description,toolUseID:e.request.tool_use_id,agentID:e.request.agent_id,requestId:e.request_id});if(r===null)return Dv;return{...r,toolUseID:e.request.tool_use_id}}else if(e.request.subtype==="hook_callback")return await this.handleHookCallbacks(e.request.callback_id,e.request.input,e.request.tool_use_id,t);else if(e.request.subtype==="mcp_message"){let r=e.request,i=this.sdkMcpTransports.get(r.server_name);if(!i)throw Error(`SDK MCP server not found: ${r.server_name}`);if("method"in r.message&&"id"in r.message&&r.message.id!==null)return{mcp_response:await this.handleMcpControlRequest(r.server_name,r,i)};else{if(i.onmessage)i.onmessage(r.message);return{mcp_response:{jsonrpc:"2.0",result:{},id:0}}}}else if(e.request.subtype==="elicitation"){let r=e.request;if(this.onElicitation)return await this.onElicitation({serverName:r.mcp_server_name,message:r.message,mode:r.mode,url:r.url,elicitationId:r.elicitation_id,requestedSchema:r.requested_schema,title:r.title,displayName:r.display_name,description:r.description},{signal:t});return{action:"decline"}}else if(e.request.subtype==="request_user_dialog"){if(this.onUserDialog)return await this.onUserDialog({dialogKind:e.request.dialog_kind,payload:e.request.payload,toolUseID:e.request.tool_use_id},{signal:t});return Cr(`[Query] No onUserDialog handler for request_user_dialog (kind=${e.request.dialog_kind}) — staying silent so a capable client (or the worker's park deadline) settles it`),Rl("tengu_request_user_dialog_response_ignored",{shape:Il("auto_cancel")}),Dv}else if(e.request.subtype==="oauth_token_refresh"){if(!this.getOAuthToken)throw Error("getOAuthToken callback is not provided.");return{accessToken:await this.getOAuthToken({signal:t})??null}}else if(e.request.subtype==="host_auth_token_refresh"){if(!this.getHostAuthToken)throw Error("getHostAuthToken callback is not provided.");return{authToken:await this.getHostAuthToken({signal:t})??null}}throw Error("Unsupported control request subtype: "+e.request.subtype)}async*readSdkMessages(){try{for await(let e of this.inputStream)yield e}finally{await this.cleanup()}}async initialize(){if(this.hooks&&!this.initHooksPayload){this.initHooksPayload={};for(let[i,n]of Object.entries(this.hooks))if(n.length>0)this.initHooksPayload[i]=n.map((o)=>{let s=[];for(let h of o.hooks){let v=`hook_${this.nextCallbackId++}`;this.hookCallbacks.set(v,h),s.push(v)}return{matcher:o.matcher,hookCallbackIds:s,timeout:o.timeout}})}let e=this.sdkMcpTransports.size>0?Array.from(this.sdkMcpTransports.keys()):void 0,t={subtype:"initialize",hooks:this.initHooksPayload,sdkMcpServers:e,jsonSchema:this.jsonSchema,systemPrompt:typeof this.initConfig?.systemPrompt==="string"?[this.initConfig.systemPrompt]:this.initConfig?.systemPrompt,appendSystemPrompt:this.initConfig?.appendSystemPrompt,planModeInstructions:this.initConfig?.planModeInstructions,appendSubagentSystemPrompt:this.initConfig?.appendSubagentSystemPrompt,toolAliases:this.initConfig?.toolAliases,excludeDynamicSections:this.initConfig?.excludeDynamicSections,agents:this.initConfig?.agents,title:this.initConfig?.title,skills:Array.isArray(this.initConfig?.skills)?this.initConfig.skills:void 0,webSearchIsolationExemptMcpServers:this.initConfig?.webSearchIsolationExemptMcpServers,promptSuggestions:this.initConfig?.promptSuggestions,agentProgressSummaries:this.initConfig?.agentProgressSummaries,forwardSubagentText:this.initConfig?.forwardSubagentText,supportedDialogKinds:this.initConfig?.supportedDialogKinds};return(await this.request(t)).response}async interrupt(){return vn("sdk_interrupt",async()=>{let t=(await this.request({subtype:"interrupt"})).response?.still_queued;return Array.isArray(t)?{still_queued:t.filter((r)=>typeof r==="string")}:void 0})}async setPermissionMode(e){await this.request({subtype:"set_permission_mode",mode:e})}async setMcpPermissionModeOverride(e,t){return(await this.request({subtype:"set_mcp_permission_mode_override",serverName:e,mode:t})).response??{}}awaitControlResponse(e){return this.transport.expectControlResponse?.(e),new Promise((t,r)=>{let i=(o)=>{if(o.subtype==="success"){let{pending_permission_requests:s,pending_user_dialog_requests:h,...v}=o;t(v)}else r(new Mv(o.error,"awaitControlResponse: CLI error verdict"));if(o.pending_permission_requests||o.pending_user_dialog_requests)Cr("[Query] Ignoring prompt-redelivery fields on awaitControlResponse response")};if(this.cleanupPerformed){r(Error("Query closed before response received"));return}let n=this.unmatchedControlResponses.get(e);if(n){this.unmatchedControlResponses.delete(e),i(n);return}this.pendingControlResponses.set(e,{handler:(o)=>{this.pendingControlResponses.delete(e),i(o)},reject:r})})}async setModel(e){await this.request({subtype:"set_model",model:e})}async setMaxThinkingTokens(e,t){await this.request({subtype:"set_max_thinking_tokens",max_thinking_tokens:e,thinking_display:t})}async applyFlagSettings(e){return vn("sdk_apply_flag_settings",async()=>{await this.request({subtype:"apply_flag_settings",settings:e})})}async getSettings(){return(await this.request({subtype:"get_settings"})).response}async rewindFiles(e,t){return vn("sdk_rewind_files",async()=>(await this.request({subtype:"rewind_files",user_message_id:e,dry_run:t?.dryRun})).response)}async cancelAsyncMessage(e){return(await this.request({subtype:"cancel_async_message",message_uuid:e})).response.cancelled}async seedReadState(e,t){await this.request({subtype:"seed_read_state",path:e,mtime:t})}async setCwd(e,t){return vn("sdk_set_cwd",async()=>(await this.request({subtype:"set_cwd",path:e,...t?.trustAccepted!==void 0&&{trust_accepted:t.trustAccepted},...t?.trustedDirectory!==void 0&&{trusted_directory:t.trustedDirectory}})).response)}async enableRemoteControl(e,t){return(await this.request({subtype:"remote_control",enabled:e,...t!==void 0&&{name:t}})).response}async submitFeedback(e,t){return(await this.request({subtype:"submit_feedback",description:e,surface:t?.surface})).response}async generateSessionTitle(e,t){return vn("sdk_session_title_generate",async()=>(await this.request({subtype:"generate_session_title",description:e,persist:t?.persist})).response.title)}async askSideQuestion(e){return vn("sdk_side_question",async()=>{let r=(await this.request({subtype:"side_question",question:e})).response;return r.response===null?null:{response:r.response,synthetic:r.synthetic??!1}})}async launchUltrareview(e,t){return(await this.request({subtype:"ultrareview_launch",args:e,confirm:t?.confirm??!1})).response}async messageRated(e){await this.request({subtype:"message_rated",messageUuid:e.messageUuid,sentiment:e.sentiment,surface:e.surface,cleared:e.cleared??!1})}processPendingPermissionRequests(e){for(let t of e)if(t.request.subtype==="can_use_tool")this.handleControlRequest(t).catch(()=>{})}processPendingUserDialogRequests(e){for(let t of e)if(t.request.subtype==="request_user_dialog")this.handleControlRequest(t).catch(()=>{})}request(e){let t=Math.random().toString(36).substring(2,15);this.transport.expectControlResponse?.(t);let r={request_id:t,type:"control_request",request:e},i=e.subtype==="initialize";return new Promise((n,o)=>{this.pendingControlResponses.set(t,{handler:(s)=>{if(this.pendingControlResponses.delete(t),s.subtype==="success")n(s);else o(Error(s.error));if(!i&&(s.pending_permission_requests||s.pending_user_dialog_requests))Cr(`[Query] Ignoring prompt-redelivery fields on non-initialize response (subtype=${e.subtype})`);else{if(s.pending_permission_requests)this.processPendingPermissionRequests(s.pending_permission_requests);if(s.pending_user_dialog_requests)this.processPendingUserDialogRequests(s.pending_user_dialog_requests)}},reject:o}),Promise.resolve(this.transport.write(yn(r)+`
|
|
99
99
|
`)).catch((s)=>{this.pendingControlResponses.delete(t),o(s)})})}initializationResult(){return this.initialization}reinitialize(){return vn("sdk_reinitialize",()=>this.initialize())}async supportedCommands(){return(await this.initialization).commands}async supportedModels(){return(await this.initialization).models}async supportedAgents(){return(await this.initialization).agents}async reconnectMcpServer(e){await this.request({subtype:"mcp_reconnect",serverName:e})}async toggleMcpServer(e,t){return vn("sdk_mcp_toggle_server",async()=>{await this.request({subtype:"mcp_toggle",serverName:e,enabled:t})})}async enableChannel(e){return vn("sdk_mcp_enable_channel",async()=>{await this.request({subtype:"channel_enable",serverName:e})})}async mcpAuthenticate(e,t){return(await this.request({subtype:"mcp_authenticate",serverName:e,redirectUri:t})).response}async mcpClearAuth(e){return(await this.request({subtype:"mcp_clear_auth",serverName:e})).response}async mcpSubmitOAuthCallbackUrl(e,t){return(await this.request({subtype:"mcp_oauth_callback_url",serverName:e,callbackUrl:t})).response}async claudeAuthenticate(e){return(await this.request({subtype:"claude_authenticate",loginWithClaudeAi:e})).response}async claudeOAuthCallback(e,t){return(await this.request({subtype:"claude_oauth_callback",authorizationCode:e,state:t})).response}async claudeOAuthWaitForCompletion(){return(await this.request({subtype:"claude_oauth_wait_for_completion"})).response}async mcpServerStatus(){return(await this.request({subtype:"mcp_status"})).response.mcpServers}async getContextUsage(){return(await this.request({subtype:"get_context_usage"})).response}async usage_EXPERIMENTAL_MAY_CHANGE_DO_NOT_RELY_ON_THIS_API_YET(){return(await this.request({subtype:"get_usage"})).response}async readFile(e,t){try{return(await this.request({subtype:"read_file",path:e,max_bytes:t?.maxBytes,encoding:t?.encoding})).response}catch{return null}}async reloadPlugins(){return vn("sdk_reload_plugins",async()=>(await this.request({subtype:"reload_plugins"})).response)}async reloadSkills(){return vn("sdk_reload_skills",async()=>(await this.request({subtype:"reload_skills"})).response)}async setMcpServers(e){return vn("sdk_mcp_set_servers",async()=>{let t={},r={};for(let[h,v]of Object.entries(e))if(v.type==="sdk"&&"instance"in v)t[h]=v.instance;else r[h]=v;let i=new Set(this.sdkMcpServerInstances.keys()),n=new Set(Object.keys(t));for(let h of i)if(!n.has(h))await this.disconnectSdkMcpServer(h);for(let[h,v]of Object.entries(t))if(!i.has(h))this.connectSdkMcpServer(h,v);let o={};for(let h of Object.keys(t))o[h]={type:"sdk",name:h};return(await this.request({subtype:"mcp_set_servers",servers:{...r,...o}})).response})}async accountInfo(){return(await this.initialization).account}async streamInput(e){Cr("[Query.streamInput] Starting to process input stream");try{let t=0;for await(let r of e){if(t++,Cr(`[Query.streamInput] Processing message ${t}: ${r.type}`),this.abortController?.signal.aborted)break;await Promise.resolve(this.transport.write(yn(r)+`
|
|
@@ -102,8 +102,8 @@ new Anthropic({ apiKey, dangerouslyAllowBrowser: true });
|
|
|
102
102
|
`+s:s;break}}return t.data||r?t:null}class zv{decoder=new TextDecoder;pending=[];pendingLength=0;push(e){let t=typeof e==="string"?e:this.decoder.decode(e,DC);if(!t)return[];return this.drain(t)}flush(){let e=this.decoder.decode();if(e)this.pending.push(e),this.pendingLength+=e.length;let t=this.joinPending();this.pending=[],this.pendingLength=0;let r=t6(t);return r?[r]:[]}buffered(){return this.joinPending()}drain(e){let t=[],r=this.pendingLength,i=Math.min(3,r),n=this.tail(i)+e,o=r-i,s=0,h=-1;for(;;){let v=NC(n,s);if(!v)break;let b=o+v.contentEnd,_;if(h===-1){let S=this.joinPending();_=b<=r?S.slice(0,b):S+e.slice(0,b-r)}else _=e.slice(h-r,b-r);let g=t6(_);if(g)t.push(g);h=o+v.afterDelim,s=v.afterDelim}if(h===-1)this.pending.push(e),this.pendingLength=r+e.length;else{let v=e.slice(h-r);this.pending=v?[v]:[],this.pendingLength=v.length}return t}tail(e){if(e<=0)return"";let t=e,r="";for(let i=this.pending.length-1;i>=0&&t>0;i--){let n=this.pending[i];if(n.length<=t)r=n+r,t-=n.length;else r=n.slice(n.length-t)+r,t=0}return r}joinPending(){return this.pending.length===1?this.pending[0]:this.pending.join("")}}var zC=15000,r6=1000,n6=30000,i6=5,jC=45000,UC=30000,LC=3,FC=1000,o6=new Set([401,403,404]);class Lv{options;ready=!1;closed=!1;abortController;streamAbort=null;messages=new Lo;exitError;readyPromise;readyResolve;readyReject;abortHandler;livenessTimer;reconnectTimer;reconnectAttempts=0;lastEventId="";expectedControlResponseIds=new Set;uploader;constructor(e){this.options=e;if(this.abortController=e.abortController||new AbortController,this.readyPromise=new Promise((t,r)=>{this.readyResolve=t,this.readyReject=r}),this.readyPromise.catch(()=>{}),this.uploader=new Nv({maxBatchSize:1,maxQueueSize:FC,baseDelayMs:r6,maxDelayMs:n6,jitterMs:250,maxConsecutiveFailures:LC,send:(t)=>this.postOnce(t[0])}),this.abortHandler=()=>{this.exitError=new On("SSE connection aborted by user"),this.close()},this.abortController.signal.aborted)this.abortHandler();else this.abortController.signal.addEventListener("abort",this.abortHandler);this.connect()}buildHeaders(e){return{...this.options.headers??{},...e}}async connect(){if(this.closed)return;this.streamAbort=new AbortController;let e=this.streamAbort.signal,t=this.buildHeaders({Accept:"text/event-stream"});if(this.lastEventId)t["Last-Event-ID"]=this.lastEventId;let r=this.options.connectTimeoutMs??zC,i=Date.now()+r,n=setTimeout(()=>{this.streamAbort?.abort(),this.handleStreamEnd(Error("SSE connect timeout"))},r),o;try{o=await fetch(this.options.streamUrl,{method:"GET",headers:t,signal:e})}catch(s){if(clearTimeout(n),this.closed||e.aborted)return;return this.handleStreamEnd(Ev(s))}if(!o.ok||!o.body){clearTimeout(n);let s=o.status,h=setTimeout(()=>{this.streamAbort?.abort()},Math.max(0,i-Date.now())),v=await s6(o);if(clearTimeout(h),this.closed)return;let b=new Uv("SSE connect failed",s,v);if(o6.has(s))return this.fail(b);return this.handleStreamEnd(b)}if(clearTimeout(n),this.closed){o.body.cancel().catch(()=>{});return}this.ready=!0,this.reconnectAttempts=0,this.resetLivenessTimer(),this.readyResolve?.(),this.readStream(o.body,e)}async readStream(e,t){let r=e.getReader(),i=new zv;try{while(!t.aborted){let{done:n,value:o}=await r.read();if(n)break;this.resetLivenessTimer();for(let s of i.push(o)){if(s.id)this.lastEventId=s.id;if(!s.data)continue;if(s.event!=="client_event"&&s.event!=="ephemeral_event")continue;try{let h=Bs(s.data),v=h.payload;if(!v||typeof v.type!=="string")continue;if(s.event==="ephemeral_event"){if(v.type==="stream_event"){this.messages.enqueue(v);continue}if(v.type==="system"&&v.subtype==="thinking_tokens"){let b=v;this.messages.enqueue({type:"system",subtype:"thinking_tokens",estimated_tokens:b.estimated_tokens,estimated_tokens_delta:b.estimated_tokens_delta,uuid:b.uuid,session_id:b.session_id});continue}console.debug(`[BrowserSSETransport] Dropping ${v.type} on ephemeral_event (only stream_event and system:thinking_tokens ride ephemeral)`);continue}if(h.source!=="worker"&&(v.type==="control_request"||v.type==="control_cancel_request"))continue;if(v.type==="control_response"&&v.response&&typeof v.response==="object"){let b=v.response,_=b.request_id;if(typeof _==="string"&&this.expectedControlResponseIds.has(_)){if(h.source!=="worker")continue;this.expectedControlResponseIds.delete(_)}if(h.source!=="worker"&&(("pending_user_dialog_requests"in b)||("pending_permission_requests"in b))){let{pending_user_dialog_requests:g,pending_permission_requests:S,...x}=b;this.messages.enqueue({...v,response:x});continue}}this.messages.enqueue(v)}catch{}}}}catch(n){if(!this.closed&&!t.aborted)return this.handleStreamEnd(Ev(n));return}finally{r.releaseLock()}if(!this.closed&&!t.aborted)this.handleStreamEnd()}handleStreamEnd(e){if(this.ready=!1,this.clearLivenessTimer(),this.closed)return;if(this.reconnectAttempts>=i6)return this.fail(e??Error(`SSE reconnect budget exhausted (${i6} attempts)`));this.reconnectAttempts++;let t=Math.min(r6*2**(this.reconnectAttempts-1),n6);clearTimeout(this.reconnectTimer),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=void 0,this.connect()},t)}fail(e){this.exitError=this.exitError??e,this.close()}resetLivenessTimer(){this.clearLivenessTimer(),this.livenessTimer=setTimeout(()=>{this.streamAbort?.abort(),this.handleStreamEnd(Error("SSE liveness timeout"))},jC)}clearLivenessTimer(){if(this.livenessTimer)clearTimeout(this.livenessTimer),this.livenessTimer=void 0}expectControlResponse(e){if(this.expectedControlResponseIds.add(e),this.expectedControlResponseIds.size>1024){let t=this.expectedControlResponseIds.values().next().value;if(t!==void 0)this.expectedControlResponseIds.delete(t)}}async write(e){if(this.abortController.signal.aborted)throw new On("Operation aborted");if(!this.ready)await this.readyPromise;if(this.closed)throw this.exitError??Error("SSETransport is closed");let t=Bs(e),r=!t||typeof t!=="object"||Array.isArray(t)||typeof t.uuid==="string"&&t.uuid?e:JSON.stringify({...t,uuid:crypto.randomUUID()});await this.uploader.enqueue(r)}async postOnce(e){let t=this.buildHeaders({"Content-Type":"application/json"}),r=JSON.stringify({session_id:this.options.sessionId,events:[{payload:Bs(e)}]}),i=BC([this.abortController.signal,AbortSignal.timeout(UC)]);try{let n=await fetch(this.options.sendUrl,{method:"POST",headers:t,body:r,signal:i.signal});if(n.ok){n.body?.cancel();return}if(o6.has(n.status)){let h=await s6(n);throw this.fail(new Uv(`POST ${this.options.sendUrl}`,n.status,h)),Error(`permanent HTTP ${n.status}`)}n.body?.cancel();let o=n.headers.get("Retry-After"),s=o?Number(o):NaN;throw new Oh(`POST ${this.options.sendUrl}: HTTP ${n.status}`,Number.isFinite(s)?s*1000:void 0)}finally{i.detach()}}close(){if(this.closed)return;if(this.closed=!0,!this.ready)this.readyReject?.(this.exitError??new On("SSE transport closed before connect"));if(this.ready=!1,clearTimeout(this.reconnectTimer),this.reconnectTimer=void 0,this.clearLivenessTimer(),this.streamAbort?.abort(),this.uploader.close(),this.abortHandler)this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0;this.messages.done()}[Symbol.dispose](){this.close()}isReady(){return this.ready&&!this.closed}endInput(){}async*readMessages(){if(yield*this.messages,this.exitError)throw this.exitError}}var qC=128,jv=4096;class Uv extends Error{code;reason;constructor(e,t,r){super(`${e}: HTTP ${t}`);this.name="SSEHttpError",this.code=t,this.reason=r}}async function s6(e){let t=e.body?.getReader();if(!t)return;try{let r=new Uint8Array(jv),i=0;for(;;){let{done:h,value:v}=await t.read();if(h||!v)break;let b=Math.min(v.length,jv-i);if(r.set(v.subarray(0,b),i),i+=b,i>=jv)break}let n=JSON.parse(new TextDecoder().decode(r.subarray(0,i))),o=n?.error?.resource??n?.error?.type;if(typeof o!=="string")return;return o.replace(/[\p{Cc}\p{Cf}]/gu,"").slice(0,qC)||void 0}catch{return}finally{t.cancel().catch(()=>{})}}function BC(e){let t=AbortSignal;if(typeof t.any==="function")return{signal:t.any(e),detach:()=>{}};let r=new AbortController,i=[];for(let n of e){if(n.aborted){r.abort(n.reason);break}let o=()=>r.abort(n.reason);n.addEventListener("abort",o,{once:!0}),i.push([n,o])}return{signal:r.signal,detach:()=>{for(let[n,o]of i)n.removeEventListener("abort",o)}}}var a6=15000,HC=50000;class Fv{options;ws;ready=!1;abortController;messages=new Lo;exitError;readyPromise;readyResolve;readyReject;abortHandler;keepAliveTimer;partialLine="";constructor(e){this.options=e;this.abortController=e.abortController||new AbortController,this.readyPromise=new Promise((t,r)=>{this.readyResolve=t,this.readyReject=r}),this.readyPromise.catch(()=>{}),this.initialize()}initialize(){try{let{url:e}=this.options,t=new URL(e);if(!t.protocol.startsWith("ws"))throw Error("WebSocket URL must use ws:// or wss:// protocol");this.ws=new globalThis.WebSocket(t.toString());let r=setTimeout(()=>{if(!this.ready){this.ws?.close();let i=Error(`WebSocket connection timeout after ${a6}ms`);if(this.exitError=i,this.readyReject)this.readyReject(i)}},a6);if(this.ws.onopen=()=>{if(clearTimeout(r),this.ready=!0,this.readyResolve)this.readyResolve();if(this.options.authMessage&&this.ws)try{this.ws.send(yn(this.options.authMessage)+`
|
|
103
103
|
`)}catch{}this.keepAliveTimer=setInterval(()=>{if(this.ws&&this.ws.readyState===globalThis.WebSocket.OPEN)try{this.ws.send(yn({type:"keep_alive"})+`
|
|
104
104
|
`)}catch{}},HC)},this.ws.onerror=(i)=>{clearTimeout(r),this.ready=!1;let n=Error("WebSocket connection error");if(this.exitError=n,this.readyReject)this.readyReject(n);this.messages.done()},this.ws.onclose=(i)=>{if(this.ready=!1,this.keepAliveTimer)clearInterval(this.keepAliveTimer),this.keepAliveTimer=void 0;if(i.code!==1000&&i.code!==1001)this.exitError=Error(`WebSocket closed abnormally with code ${i.code}: ${i.reason}`);this.messages.done()},this.ws.onmessage=(i)=>{if(typeof i.data!=="string")return;let o=(this.partialLine+i.data).split(`
|
|
105
|
-
`);this.partialLine=o.pop()??"";for(let s of o){if(!s)continue;try{this.messages.enqueue(Bs(s))}catch(h){}}},this.abortHandler=()=>{this.close(),this.exitError=new On("WebSocket connection aborted by user")},this.abortController.signal.aborted)this.abortHandler();else this.abortController.signal.addEventListener("abort",this.abortHandler)}catch(e){if(this.ready=!1,this.exitError=e,this.readyReject)this.readyReject(e);throw e}}async write(e){if(this.abortController.signal.aborted)throw new On("Operation aborted");if(!this.ready)await this.readyPromise;if(!this.ready||!this.ws||this.ws.readyState!==globalThis.WebSocket.OPEN)throw Error("WebSocketTransport is not ready for writing");this.ws.send(e)}close(){if(this.abortHandler)this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0;if(this.keepAliveTimer)clearInterval(this.keepAliveTimer),this.keepAliveTimer=void 0;if(this.ws&&this.ws.readyState===globalThis.WebSocket.OPEN)this.ws.close(1000,"Normal closure");this.ready=!1,this.messages.done()}[Symbol.dispose](){this.close()}isReady(){return this.ready&&this.ws?.readyState===globalThis.WebSocket.OPEN}endInput(){}async*readMessages(){if(yield*this.messages,this.exitError)throw this.exitError}}function u6(e){return new AbortController}var wt;(function(e){e.assertEqual=(n)=>{};function t(n){}e.assertIs=t;function r(n){throw Error()}e.assertNever=r,e.arrayToEnum=(n)=>{let o={};for(let s of n)o[s]=s;return o},e.getValidEnumValues=(n)=>{let o=e.objectKeys(n).filter((h)=>typeof n[n[h]]!=="number"),s={};for(let h of o)s[h]=n[h];return e.objectValues(s)},e.objectValues=(n)=>e.objectKeys(n).map(function(o){return n[o]}),e.objectKeys=typeof Object.keys==="function"?(n)=>Object.keys(n):(n)=>{let o=[];for(let s in n)if(Object.prototype.hasOwnProperty.call(n,s))o.push(s);return o},e.find=(n,o)=>{for(let s of n)if(o(s))return s;return},e.isInteger=typeof Number.isInteger==="function"?(n)=>Number.isInteger(n):(n)=>typeof n==="number"&&Number.isFinite(n)&&Math.floor(n)===n;function i(n,o=" | "){return n.map((s)=>typeof s==="string"?`'${s}'`:s).join(o)}e.joinValues=i,e.jsonStringifyReplacer=(n,o)=>{if(typeof o==="bigint")return o.toString();return o}})(wt||(wt={}));var l6;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(l6||(l6={}));var Ze=wt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),bi=(e)=>{switch(typeof e){case"undefined":return Ze.undefined;case"string":return Ze.string;case"number":return Number.isNaN(e)?Ze.nan:Ze.number;case"boolean":return Ze.boolean;case"function":return Ze.function;case"bigint":return Ze.bigint;case"symbol":return Ze.symbol;case"object":if(Array.isArray(e))return Ze.array;if(e===null)return Ze.null;if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return Ze.promise;if(typeof Map<"u"&&e instanceof Map)return Ze.map;if(typeof Set<"u"&&e instanceof Set)return Ze.set;if(typeof Date<"u"&&e instanceof Date)return Ze.date;return Ze.object;default:return Ze.unknown}};var Ue=wt.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"]);class bn extends Error{get errors(){return this.issues}constructor(e){super();this.issues=[],this.addIssue=(r)=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let t=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,t);else this.__proto__=t;this.name="ZodError",this.issues=e}format(e){let t=e||function(n){return n.message},r={_errors:[]},i=(n)=>{for(let o of n.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(t(o));else{let s=r,h=0;while(h<o.path.length){let v=o.path[h];if(h!==o.path.length-1)s[v]=s[v]||{_errors:[]};else s[v]=s[v]||{_errors:[]},s[v]._errors.push(t(o));s=s[v],h++}}};return i(this),r}static assert(e){if(!(e instanceof bn))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,wt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=(t)=>t.message){let t={},r=[];for(let i of this.issues)if(i.path.length>0){let n=i.path[0];t[n]=t[n]||[],t[n].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}bn.create=(e)=>new bn(e);var ZC=(e,t)=>{let r;switch(e.code){case Ue.invalid_type:if(e.received===Ze.undefined)r="Required";else r=`Expected ${e.expected}, received ${e.received}`;break;case Ue.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,wt.jsonStringifyReplacer)}`;break;case Ue.unrecognized_keys:r=`Unrecognized key(s) in object: ${wt.joinValues(e.keys,", ")}`;break;case Ue.invalid_union:r="Invalid input";break;case Ue.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${wt.joinValues(e.options)}`;break;case Ue.invalid_enum_value:r=`Invalid enum value. Expected ${wt.joinValues(e.options)}, received '${e.received}'`;break;case Ue.invalid_arguments:r="Invalid function arguments";break;case Ue.invalid_return_type:r="Invalid function return type";break;case Ue.invalid_date:r="Invalid date";break;case Ue.invalid_string:if(typeof e.validation==="object")if("includes"in e.validation){if(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==="number")r=`${r} at one or more positions greater than or equal to ${e.validation.position}`}else if("startsWith"in e.validation)r=`Invalid input: must start with "${e.validation.startsWith}"`;else if("endsWith"in e.validation)r=`Invalid input: must end with "${e.validation.endsWith}"`;else wt.assertNever(e.validation);else if(e.validation!=="regex")r=`Invalid ${e.validation}`;else r="Invalid";break;case Ue.too_small:if(e.type==="array")r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`;else if(e.type==="string")r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`;else if(e.type==="number")r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="bigint")r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="date")r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`;else r="Invalid input";break;case Ue.too_big:if(e.type==="array")r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`;else if(e.type==="string")r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`;else if(e.type==="number")r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="bigint")r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="date")r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`;else r="Invalid input";break;case Ue.custom:r="Invalid input";break;case Ue.invalid_intersection_types:r="Intersection results could not be merged";break;case Ue.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case Ue.not_finite:r="Number must be finite";break;default:r=t.defaultError,wt.assertNever(e)}return{message:r}},Ji=ZC;var KC=Ji;function Cl(){return KC}var Dh=(e)=>{let{data:t,path:r,errorMaps:i,issueData:n}=e,o=[...r,...n.path||[]],s={...n,path:o};if(n.message!==void 0)return{...n,path:o,message:n.message};let h="",v=i.filter((b)=>!!b).slice().reverse();for(let b of v)h=b(s,{data:t,defaultError:h}).message;return{...n,path:o,message:h}};function Je(e,t){let r=Cl(),i=Dh({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Ji?void 0:Ji].filter((n)=>!!n)});e.common.issues.push(i)}class qr{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(e,t){let r=[];for(let i of t){if(i.status==="aborted")return ot;if(i.status==="dirty")e.dirty();r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let i of t){let n=await i.key,o=await i.value;r.push({key:n,value:o})}return qr.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let i of t){let{key:n,value:o}=i;if(n.status==="aborted")return ot;if(o.status==="aborted")return ot;if(n.status==="dirty")e.dirty();if(o.status==="dirty")e.dirty();if(n.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet))r[n.value]=o.value}return{status:e.value,value:r}}}var ot=Object.freeze({status:"aborted"}),Hs=(e)=>({status:"dirty",value:e}),Wr=(e)=>({status:"valid",value:e}),qv=(e)=>e.status==="aborted",Bv=(e)=>e.status==="dirty",Fo=(e)=>e.status==="valid",Ol=(e)=>typeof Promise<"u"&&e instanceof Promise;var et;(function(e){e.errToObj=(t)=>typeof t==="string"?{message:t}:t||{},e.toString=(t)=>typeof t==="string"?t:t?.message})(et||(et={}));class Un{constructor(e,t,r,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=i}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var c6=(e,t)=>{if(Fo(t))return{success:!0,data:t.value};else{if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new bn(e.common.issues);return this._error=r,this._error}}}};function ht(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:i,description:n}=e;if(t&&(r||i))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(t)return{errorMap:t,description:n};return{errorMap:(s,h)=>{let{message:v}=e;if(s.code==="invalid_enum_value")return{message:v??h.defaultError};if(typeof h.data>"u")return{message:v??i??h.defaultError};if(s.code!=="invalid_type")return{message:h.defaultError};return{message:v??r??h.defaultError}},description:n}}class bt{get description(){return this._def.description}_getType(e){return bi(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:bi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new qr,ctx:{common:e.parent.common,data:e.data,parsedType:bi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Ol(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){let r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:bi(e)},i=this._parseSync({data:e,path:r.path,parent:r});return c6(r,i)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:bi(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:t});return Fo(r)?{value:r.value}:{issues:t.common.issues}}catch(r){if(r?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((r)=>Fo(r)?{value:r.value}:{issues:t.common.issues})}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:bi(e)},i=this._parse({data:e,path:r.path,parent:r}),n=await(Ol(i)?i:Promise.resolve(i));return c6(r,n)}refine(e,t){let r=(i)=>{if(typeof t==="string"||typeof t>"u")return{message:t};else if(typeof t==="function")return t(i);else return t};return this._refinement((i,n)=>{let o=e(i),s=()=>n.addIssue({code:Ue.custom,...r(i)});if(typeof Promise<"u"&&o instanceof Promise)return o.then((h)=>{if(!h)return s(),!1;else return!0});if(!o)return s(),!1;else return!0})}refinement(e,t){return this._refinement((r,i)=>{if(!e(r))return i.addIssue(typeof t==="function"?t(r,i):t),!1;else return!0})}_refinement(e){return new ei({schema:this,typeName:Le.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 $n.create(this,this._def)}nullable(){return Xi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Qn.create(this)}promise(){return Gs.create(this,this._def)}or(e){return Ul.create([this,e],this._def)}and(e){return Ll.create(this,e,this._def)}transform(e){return new ei({...ht(this._def),schema:this,typeName:Le.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e==="function"?e:()=>e;return new Hl({...ht(this._def),innerType:this,defaultValue:t,typeName:Le.ZodDefault})}brand(){return new Vv({typeName:Le.ZodBranded,type:this,...ht(this._def)})}catch(e){let t=typeof e==="function"?e:()=>e;return new Zl({...ht(this._def),innerType:this,catchValue:t,typeName:Le.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return Bh.create(this,e)}readonly(){return Kl.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var VC=/^c[^\s-]{8,}$/i,WC=/^[0-9a-z]+$/,GC=/^[0-9A-HJKMNP-TV-Z]{26}$/i,JC=/^[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,XC=/^[a-z0-9_-]{21}$/i,YC=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,QC=/^[-+]?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)?)??$/,eO=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,tO="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Hv,rO=/^(?:(?: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])$/,nO=/^(?:(?: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])$/,iO=/^(([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]))$/,oO=/^(([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])$/,sO=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,aO=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,d6="((\\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])))",uO=new RegExp(`^${d6}$`);function f6(e){let t="[0-5]\\d";if(e.precision)t=`${t}\\.\\d{${e.precision}}`;else if(e.precision==null)t=`${t}(\\.\\d+)?`;let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function lO(e){return new RegExp(`^${f6(e)}$`)}function cO(e){let t=`${d6}T${f6(e)}`,r=[];if(r.push(e.local?"Z?":"Z"),e.offset)r.push("([+-]\\d{2}:?\\d{2})");return t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function dO(e,t){if((t==="v4"||!t)&&rO.test(e))return!0;if((t==="v6"||!t)&&iO.test(e))return!0;return!1}function fO(e,t){if(!YC.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let i=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),n=JSON.parse(atob(i));if(typeof n!=="object"||n===null)return!1;if("typ"in n&&n?.typ!=="JWT")return!1;if(!n.alg)return!1;if(t&&n.alg!==t)return!1;return!0}catch{return!1}}function hO(e,t){if((t==="v4"||!t)&&nO.test(e))return!0;if((t==="v6"||!t)&&oO.test(e))return!0;return!1}class wi extends bt{_parse(e){if(this._def.coerce)e.data=String(e.data);if(this._getType(e)!==Ze.string){let n=this._getOrReturnCtx(e);return Je(n,{code:Ue.invalid_type,expected:Ze.string,received:n.parsedType}),ot}let r=new qr,i=void 0;for(let n of this._def.checks)if(n.kind==="min"){if(e.data.length<n.value)i=this._getOrReturnCtx(e,i),Je(i,{code:Ue.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty()}else if(n.kind==="max"){if(e.data.length>n.value)i=this._getOrReturnCtx(e,i),Je(i,{code:Ue.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty()}else if(n.kind==="length"){let o=e.data.length>n.value,s=e.data.length<n.value;if(o||s){if(i=this._getOrReturnCtx(e,i),o)Je(i,{code:Ue.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message});else if(s)Je(i,{code:Ue.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message});r.dirty()}}else if(n.kind==="email"){if(!eO.test(e.data))i=this._getOrReturnCtx(e,i),Je(i,{validation:"email",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="emoji"){if(!Hv)Hv=new RegExp(tO,"u");if(!Hv.test(e.data))i=this._getOrReturnCtx(e,i),Je(i,{validation:"emoji",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="uuid"){if(!JC.test(e.data))i=this._getOrReturnCtx(e,i),Je(i,{validation:"uuid",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="nanoid"){if(!XC.test(e.data))i=this._getOrReturnCtx(e,i),Je(i,{validation:"nanoid",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="cuid"){if(!VC.test(e.data))i=this._getOrReturnCtx(e,i),Je(i,{validation:"cuid",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="cuid2"){if(!WC.test(e.data))i=this._getOrReturnCtx(e,i),Je(i,{validation:"cuid2",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="ulid"){if(!GC.test(e.data))i=this._getOrReturnCtx(e,i),Je(i,{validation:"ulid",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Je(i,{validation:"url",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="regex"){if(n.regex.lastIndex=0,!n.regex.test(e.data))i=this._getOrReturnCtx(e,i),Je(i,{validation:"regex",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="trim")e.data=e.data.trim();else if(n.kind==="includes"){if(!e.data.includes(n.value,n.position))i=this._getOrReturnCtx(e,i),Je(i,{code:Ue.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),r.dirty()}else if(n.kind==="toLowerCase")e.data=e.data.toLowerCase();else if(n.kind==="toUpperCase")e.data=e.data.toUpperCase();else if(n.kind==="startsWith"){if(!e.data.startsWith(n.value))i=this._getOrReturnCtx(e,i),Je(i,{code:Ue.invalid_string,validation:{startsWith:n.value},message:n.message}),r.dirty()}else if(n.kind==="endsWith"){if(!e.data.endsWith(n.value))i=this._getOrReturnCtx(e,i),Je(i,{code:Ue.invalid_string,validation:{endsWith:n.value},message:n.message}),r.dirty()}else if(n.kind==="datetime"){if(!cO(n).test(e.data))i=this._getOrReturnCtx(e,i),Je(i,{code:Ue.invalid_string,validation:"datetime",message:n.message}),r.dirty()}else if(n.kind==="date"){if(!uO.test(e.data))i=this._getOrReturnCtx(e,i),Je(i,{code:Ue.invalid_string,validation:"date",message:n.message}),r.dirty()}else if(n.kind==="time"){if(!lO(n).test(e.data))i=this._getOrReturnCtx(e,i),Je(i,{code:Ue.invalid_string,validation:"time",message:n.message}),r.dirty()}else if(n.kind==="duration"){if(!QC.test(e.data))i=this._getOrReturnCtx(e,i),Je(i,{validation:"duration",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="ip"){if(!dO(e.data,n.version))i=this._getOrReturnCtx(e,i),Je(i,{validation:"ip",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="jwt"){if(!fO(e.data,n.alg))i=this._getOrReturnCtx(e,i),Je(i,{validation:"jwt",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="cidr"){if(!hO(e.data,n.version))i=this._getOrReturnCtx(e,i),Je(i,{validation:"cidr",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="base64"){if(!sO.test(e.data))i=this._getOrReturnCtx(e,i),Je(i,{validation:"base64",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="base64url"){if(!aO.test(e.data))i=this._getOrReturnCtx(e,i),Je(i,{validation:"base64url",code:Ue.invalid_string,message:n.message}),r.dirty()}else wt.assertNever(n);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement((i)=>e.test(i),{validation:t,code:Ue.invalid_string,...et.errToObj(r)})}_addCheck(e){return new wi({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...et.errToObj(e)})}url(e){return this._addCheck({kind:"url",...et.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...et.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...et.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...et.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...et.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...et.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...et.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...et.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...et.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...et.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...et.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...et.errToObj(e)})}datetime(e){if(typeof e==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e});return this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...et.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){if(typeof e==="string")return this._addCheck({kind:"time",precision:null,message:e});return this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...et.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...et.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...et.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...et.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...et.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...et.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...et.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...et.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...et.errToObj(t)})}nonempty(e){return this.min(1,et.errToObj(e))}trim(){return new wi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new wi({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new wi({...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)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxLength(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}}wi.create=(e)=>new wi({checks:[],typeName:Le.ZodString,coerce:e?.coerce??!1,...ht(e)});function pO(e,t){let r=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,n=r>i?r:i,o=Number.parseInt(e.toFixed(n).replace(".","")),s=Number.parseInt(t.toFixed(n).replace(".",""));return o%s/10**n}class Ks extends bt{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);if(this._getType(e)!==Ze.number){let n=this._getOrReturnCtx(e);return Je(n,{code:Ue.invalid_type,expected:Ze.number,received:n.parsedType}),ot}let r=void 0,i=new qr;for(let n of this._def.checks)if(n.kind==="int"){if(!wt.isInteger(e.data))r=this._getOrReturnCtx(e,r),Je(r,{code:Ue.invalid_type,expected:"integer",received:"float",message:n.message}),i.dirty()}else if(n.kind==="min"){if(n.inclusive?e.data<n.value:e.data<=n.value)r=this._getOrReturnCtx(e,r),Je(r,{code:Ue.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()}else if(n.kind==="max"){if(n.inclusive?e.data>n.value:e.data>=n.value)r=this._getOrReturnCtx(e,r),Je(r,{code:Ue.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()}else if(n.kind==="multipleOf"){if(pO(e.data,n.value)!==0)r=this._getOrReturnCtx(e,r),Je(r,{code:Ue.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()}else if(n.kind==="finite"){if(!Number.isFinite(e.data))r=this._getOrReturnCtx(e,r),Je(r,{code:Ue.not_finite,message:n.message}),i.dirty()}else wt.assertNever(n);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,et.toString(t))}gt(e,t){return this.setLimit("min",e,!1,et.toString(t))}lte(e,t){return this.setLimit("max",e,!0,et.toString(t))}lt(e,t){return this.setLimit("max",e,!1,et.toString(t))}setLimit(e,t,r,i){return new Ks({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:et.toString(i)}]})}_addCheck(e){return new Ks({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:et.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:et.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:et.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:et.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:et.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:et.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:et.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:et.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:et.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxValue(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}get isInt(){return!!this._def.checks.find((e)=>e.kind==="int"||e.kind==="multipleOf"&&wt.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks)if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;else if(r.kind==="min"){if(t===null||r.value>t)t=r.value}else if(r.kind==="max"){if(e===null||r.value<e)e=r.value}return Number.isFinite(t)&&Number.isFinite(e)}}Ks.create=(e)=>new Ks({checks:[],typeName:Le.ZodNumber,coerce:e?.coerce||!1,...ht(e)});class Vs extends bt{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)!==Ze.bigint)return this._getInvalidInput(e);let r=void 0,i=new qr;for(let n of this._def.checks)if(n.kind==="min"){if(n.inclusive?e.data<n.value:e.data<=n.value)r=this._getOrReturnCtx(e,r),Je(r,{code:Ue.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()}else if(n.kind==="max"){if(n.inclusive?e.data>n.value:e.data>=n.value)r=this._getOrReturnCtx(e,r),Je(r,{code:Ue.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()}else if(n.kind==="multipleOf"){if(e.data%n.value!==BigInt(0))r=this._getOrReturnCtx(e,r),Je(r,{code:Ue.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()}else wt.assertNever(n);return{status:i.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return Je(t,{code:Ue.invalid_type,expected:Ze.bigint,received:t.parsedType}),ot}gte(e,t){return this.setLimit("min",e,!0,et.toString(t))}gt(e,t){return this.setLimit("min",e,!1,et.toString(t))}lte(e,t){return this.setLimit("max",e,!0,et.toString(t))}lt(e,t){return this.setLimit("max",e,!1,et.toString(t))}setLimit(e,t,r,i){return new Vs({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:et.toString(i)}]})}_addCheck(e){return new Vs({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:et.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:et.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:et.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:et.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:et.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxValue(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}}Vs.create=(e)=>new Vs({checks:[],typeName:Le.ZodBigInt,coerce:e?.coerce??!1,...ht(e)});class Nh extends bt{_parse(e){if(this._def.coerce)e.data=Boolean(e.data);if(this._getType(e)!==Ze.boolean){let r=this._getOrReturnCtx(e);return Je(r,{code:Ue.invalid_type,expected:Ze.boolean,received:r.parsedType}),ot}return Wr(e.data)}}Nh.create=(e)=>new Nh({typeName:Le.ZodBoolean,coerce:e?.coerce||!1,...ht(e)});class Nl extends bt{_parse(e){if(this._def.coerce)e.data=new Date(e.data);if(this._getType(e)!==Ze.date){let n=this._getOrReturnCtx(e);return Je(n,{code:Ue.invalid_type,expected:Ze.date,received:n.parsedType}),ot}if(Number.isNaN(e.data.getTime())){let n=this._getOrReturnCtx(e);return Je(n,{code:Ue.invalid_date}),ot}let r=new qr,i=void 0;for(let n of this._def.checks)if(n.kind==="min"){if(e.data.getTime()<n.value)i=this._getOrReturnCtx(e,i),Je(i,{code:Ue.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),r.dirty()}else if(n.kind==="max"){if(e.data.getTime()>n.value)i=this._getOrReturnCtx(e,i),Je(i,{code:Ue.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),r.dirty()}else wt.assertNever(n);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Nl({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:et.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:et.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(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)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e!=null?new Date(e):null}}Nl.create=(e)=>new Nl({checks:[],coerce:e?.coerce||!1,typeName:Le.ZodDate,...ht(e)});class zh extends bt{_parse(e){if(this._getType(e)!==Ze.symbol){let r=this._getOrReturnCtx(e);return Je(r,{code:Ue.invalid_type,expected:Ze.symbol,received:r.parsedType}),ot}return Wr(e.data)}}zh.create=(e)=>new zh({typeName:Le.ZodSymbol,...ht(e)});class zl extends bt{_parse(e){if(this._getType(e)!==Ze.undefined){let r=this._getOrReturnCtx(e);return Je(r,{code:Ue.invalid_type,expected:Ze.undefined,received:r.parsedType}),ot}return Wr(e.data)}}zl.create=(e)=>new zl({typeName:Le.ZodUndefined,...ht(e)});class jl extends bt{_parse(e){if(this._getType(e)!==Ze.null){let r=this._getOrReturnCtx(e);return Je(r,{code:Ue.invalid_type,expected:Ze.null,received:r.parsedType}),ot}return Wr(e.data)}}jl.create=(e)=>new jl({typeName:Le.ZodNull,...ht(e)});class jh extends bt{constructor(){super(...arguments);this._any=!0}_parse(e){return Wr(e.data)}}jh.create=(e)=>new jh({typeName:Le.ZodAny,...ht(e)});class qo extends bt{constructor(){super(...arguments);this._unknown=!0}_parse(e){return Wr(e.data)}}qo.create=(e)=>new qo({typeName:Le.ZodUnknown,...ht(e)});class Si extends bt{_parse(e){let t=this._getOrReturnCtx(e);return Je(t,{code:Ue.invalid_type,expected:Ze.never,received:t.parsedType}),ot}}Si.create=(e)=>new Si({typeName:Le.ZodNever,...ht(e)});class Uh extends bt{_parse(e){if(this._getType(e)!==Ze.undefined){let r=this._getOrReturnCtx(e);return Je(r,{code:Ue.invalid_type,expected:Ze.void,received:r.parsedType}),ot}return Wr(e.data)}}Uh.create=(e)=>new Uh({typeName:Le.ZodVoid,...ht(e)});class Qn extends bt{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),i=this._def;if(t.parsedType!==Ze.array)return Je(t,{code:Ue.invalid_type,expected:Ze.array,received:t.parsedType}),ot;if(i.exactLength!==null){let o=t.data.length>i.exactLength.value,s=t.data.length<i.exactLength.value;if(o||s)Je(t,{code:o?Ue.too_big:Ue.too_small,minimum:s?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty()}if(i.minLength!==null){if(t.data.length<i.minLength.value)Je(t,{code:Ue.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()}if(i.maxLength!==null){if(t.data.length>i.maxLength.value)Je(t,{code:Ue.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()}if(t.common.async)return Promise.all([...t.data].map((o,s)=>i.type._parseAsync(new Un(t,o,t.path,s)))).then((o)=>qr.mergeArray(r,o));let n=[...t.data].map((o,s)=>i.type._parseSync(new Un(t,o,t.path,s)));return qr.mergeArray(r,n)}get element(){return this._def.type}min(e,t){return new Qn({...this._def,minLength:{value:e,message:et.toString(t)}})}max(e,t){return new Qn({...this._def,maxLength:{value:e,message:et.toString(t)}})}length(e,t){return new Qn({...this._def,exactLength:{value:e,message:et.toString(t)}})}nonempty(e){return this.min(1,e)}}Qn.create=(e,t)=>new Qn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Le.ZodArray,...ht(t)});function Zs(e){if(e instanceof er){let t={};for(let r in e.shape){let i=e.shape[r];t[r]=$n.create(Zs(i))}return new er({...e._def,shape:()=>t})}else if(e instanceof Qn)return new Qn({...e._def,type:Zs(e.element)});else if(e instanceof $n)return $n.create(Zs(e.unwrap()));else if(e instanceof Xi)return Xi.create(Zs(e.unwrap()));else if(e instanceof xi)return xi.create(e.items.map((t)=>Zs(t)));else return e}class er extends bt{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=wt.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==Ze.object){let v=this._getOrReturnCtx(e);return Je(v,{code:Ue.invalid_type,expected:Ze.object,received:v.parsedType}),ot}let{status:r,ctx:i}=this._processInputParams(e),{shape:n,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof Si&&this._def.unknownKeys==="strip")){for(let v in i.data)if(!o.includes(v))s.push(v)}let h=[];for(let v of o){let b=n[v],_=i.data[v];h.push({key:{status:"valid",value:v},value:b._parse(new Un(i,_,i.path,v)),alwaysSet:v in i.data})}if(this._def.catchall instanceof Si){let v=this._def.unknownKeys;if(v==="passthrough")for(let b of s)h.push({key:{status:"valid",value:b},value:{status:"valid",value:i.data[b]}});else if(v==="strict"){if(s.length>0)Je(i,{code:Ue.unrecognized_keys,keys:s}),r.dirty()}else if(v==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let v=this._def.catchall;for(let b of s){let _=i.data[b];h.push({key:{status:"valid",value:b},value:v._parse(new Un(i,_,i.path,b)),alwaysSet:b in i.data})}}if(i.common.async)return Promise.resolve().then(async()=>{let v=[];for(let b of h){let _=await b.key,g=await b.value;v.push({key:_,value:g,alwaysSet:b.alwaysSet})}return v}).then((v)=>qr.mergeObjectSync(r,v));else return qr.mergeObjectSync(r,h)}get shape(){return this._def.shape()}strict(e){return et.errToObj,new er({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{let i=this._def.errorMap?.(t,r).message??r.defaultError;if(t.code==="unrecognized_keys")return{message:et.errToObj(e).message??i};return{message:i}}}:{}})}strip(){return new er({...this._def,unknownKeys:"strip"})}passthrough(){return new er({...this._def,unknownKeys:"passthrough"})}extend(e){return new er({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new er({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Le.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new er({...this._def,catchall:e})}pick(e){let t={};for(let r of wt.objectKeys(e))if(e[r]&&this.shape[r])t[r]=this.shape[r];return new er({...this._def,shape:()=>t})}omit(e){let t={};for(let r of wt.objectKeys(this.shape))if(!e[r])t[r]=this.shape[r];return new er({...this._def,shape:()=>t})}deepPartial(){return Zs(this)}partial(e){let t={};for(let r of wt.objectKeys(this.shape)){let i=this.shape[r];if(e&&!e[r])t[r]=i;else t[r]=i.optional()}return new er({...this._def,shape:()=>t})}required(e){let t={};for(let r of wt.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let n=this.shape[r];while(n instanceof $n)n=n._def.innerType;t[r]=n}return new er({...this._def,shape:()=>t})}keyof(){return h6(wt.objectKeys(this.shape))}}er.create=(e,t)=>new er({shape:()=>e,unknownKeys:"strip",catchall:Si.create(),typeName:Le.ZodObject,...ht(t)});er.strictCreate=(e,t)=>new er({shape:()=>e,unknownKeys:"strict",catchall:Si.create(),typeName:Le.ZodObject,...ht(t)});er.lazycreate=(e,t)=>new er({shape:e,unknownKeys:"strip",catchall:Si.create(),typeName:Le.ZodObject,...ht(t)});class Ul extends bt{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;function i(n){for(let s of n)if(s.result.status==="valid")return s.result;for(let s of n)if(s.result.status==="dirty")return t.common.issues.push(...s.ctx.common.issues),s.result;let o=n.map((s)=>new bn(s.ctx.common.issues));return Je(t,{code:Ue.invalid_union,unionErrors:o}),ot}if(t.common.async)return Promise.all(r.map(async(n)=>{let o={...t,common:{...t.common,issues:[]},parent:null};return{result:await n._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(i);else{let n=void 0,o=[];for(let h of r){let v={...t,common:{...t.common,issues:[]},parent:null},b=h._parseSync({data:t.data,path:t.path,parent:v});if(b.status==="valid")return b;else if(b.status==="dirty"&&!n)n={result:b,ctx:v};if(v.common.issues.length)o.push(v.common.issues)}if(n)return t.common.issues.push(...n.ctx.common.issues),n.result;let s=o.map((h)=>new bn(h));return Je(t,{code:Ue.invalid_union,unionErrors:s}),ot}}get options(){return this._def.options}}Ul.create=(e,t)=>new Ul({options:e,typeName:Le.ZodUnion,...ht(t)});var _i=(e)=>{if(e instanceof Fl)return _i(e.schema);else if(e instanceof ei)return _i(e.innerType());else if(e instanceof ql)return[e.value];else if(e instanceof Bo)return e.options;else if(e instanceof Bl)return wt.objectValues(e.enum);else if(e instanceof Hl)return _i(e._def.innerType);else if(e instanceof zl)return[void 0];else if(e instanceof jl)return[null];else if(e instanceof $n)return[void 0,..._i(e.unwrap())];else if(e instanceof Xi)return[null,..._i(e.unwrap())];else if(e instanceof Vv)return _i(e.unwrap());else if(e instanceof Kl)return _i(e.unwrap());else if(e instanceof Zl)return _i(e._def.innerType);else return[]};class Kv extends bt{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Ze.object)return Je(t,{code:Ue.invalid_type,expected:Ze.object,received:t.parsedType}),ot;let r=this.discriminator,i=t.data[r],n=this.optionsMap.get(i);if(!n)return Je(t,{code:Ue.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),ot;if(t.common.async)return n._parseAsync({data:t.data,path:t.path,parent:t});else return n._parseSync({data:t.data,path:t.path,parent:t})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let i=new Map;for(let n of t){let o=_i(n.shape[e]);if(!o.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of o){if(i.has(s))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);i.set(s,n)}}return new Kv({typeName:Le.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...ht(r)})}}function Zv(e,t){let r=bi(e),i=bi(t);if(e===t)return{valid:!0,data:e};else if(r===Ze.object&&i===Ze.object){let n=wt.objectKeys(t),o=wt.objectKeys(e).filter((h)=>n.indexOf(h)!==-1),s={...e,...t};for(let h of o){let v=Zv(e[h],t[h]);if(!v.valid)return{valid:!1};s[h]=v.data}return{valid:!0,data:s}}else if(r===Ze.array&&i===Ze.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let o=0;o<e.length;o++){let s=e[o],h=t[o],v=Zv(s,h);if(!v.valid)return{valid:!1};n.push(v.data)}return{valid:!0,data:n}}else if(r===Ze.date&&i===Ze.date&&+e===+t)return{valid:!0,data:e};else return{valid:!1}}class Ll extends bt{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),i=(n,o)=>{if(qv(n)||qv(o))return ot;let s=Zv(n.value,o.value);if(!s.valid)return Je(r,{code:Ue.invalid_intersection_types}),ot;if(Bv(n)||Bv(o))t.dirty();return{status:t.value,value:s.data}};if(r.common.async)return Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([n,o])=>i(n,o));else return i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Ll.create=(e,t,r)=>new Ll({left:e,right:t,typeName:Le.ZodIntersection,...ht(r)});class xi extends bt{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ze.array)return Je(r,{code:Ue.invalid_type,expected:Ze.array,received:r.parsedType}),ot;if(r.data.length<this._def.items.length)return Je(r,{code:Ue.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ot;if(!this._def.rest&&r.data.length>this._def.items.length)Je(r,{code:Ue.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty();let n=[...r.data].map((o,s)=>{let h=this._def.items[s]||this._def.rest;if(!h)return null;return h._parse(new Un(r,o,r.path,s))}).filter((o)=>!!o);if(r.common.async)return Promise.all(n).then((o)=>qr.mergeArray(t,o));else return qr.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new xi({...this._def,rest:e})}}xi.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new xi({items:e,typeName:Le.ZodTuple,rest:null,...ht(t)})};class Lh extends bt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ze.object)return Je(r,{code:Ue.invalid_type,expected:Ze.object,received:r.parsedType}),ot;let i=[],n=this._def.keyType,o=this._def.valueType;for(let s in r.data)i.push({key:n._parse(new Un(r,s,r.path,s)),value:o._parse(new Un(r,r.data[s],r.path,s)),alwaysSet:s in r.data});if(r.common.async)return qr.mergeObjectAsync(t,i);else return qr.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,r){if(t instanceof bt)return new Lh({keyType:e,valueType:t,typeName:Le.ZodRecord,...ht(r)});return new Lh({keyType:wi.create(),valueType:e,typeName:Le.ZodRecord,...ht(t)})}}class Fh extends bt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ze.map)return Je(r,{code:Ue.invalid_type,expected:Ze.map,received:r.parsedType}),ot;let i=this._def.keyType,n=this._def.valueType,o=[...r.data.entries()].map(([s,h],v)=>({key:i._parse(new Un(r,s,r.path,[v,"key"])),value:n._parse(new Un(r,h,r.path,[v,"value"]))}));if(r.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let h of o){let v=await h.key,b=await h.value;if(v.status==="aborted"||b.status==="aborted")return ot;if(v.status==="dirty"||b.status==="dirty")t.dirty();s.set(v.value,b.value)}return{status:t.value,value:s}})}else{let s=new Map;for(let h of o){let{key:v,value:b}=h;if(v.status==="aborted"||b.status==="aborted")return ot;if(v.status==="dirty"||b.status==="dirty")t.dirty();s.set(v.value,b.value)}return{status:t.value,value:s}}}}Fh.create=(e,t,r)=>new Fh({valueType:t,keyType:e,typeName:Le.ZodMap,...ht(r)});class Ws extends bt{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ze.set)return Je(r,{code:Ue.invalid_type,expected:Ze.set,received:r.parsedType}),ot;let i=this._def;if(i.minSize!==null){if(r.data.size<i.minSize.value)Je(r,{code:Ue.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),t.dirty()}if(i.maxSize!==null){if(r.data.size>i.maxSize.value)Je(r,{code:Ue.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty()}let n=this._def.valueType;function o(h){let v=new Set;for(let b of h){if(b.status==="aborted")return ot;if(b.status==="dirty")t.dirty();v.add(b.value)}return{status:t.value,value:v}}let s=[...r.data.values()].map((h,v)=>n._parse(new Un(r,h,r.path,v)));if(r.common.async)return Promise.all(s).then((h)=>o(h));else return o(s)}min(e,t){return new Ws({...this._def,minSize:{value:e,message:et.toString(t)}})}max(e,t){return new Ws({...this._def,maxSize:{value:e,message:et.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Ws.create=(e,t)=>new Ws({valueType:e,minSize:null,maxSize:null,typeName:Le.ZodSet,...ht(t)});class Dl extends bt{constructor(){super(...arguments);this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Ze.function)return Je(t,{code:Ue.invalid_type,expected:Ze.function,received:t.parsedType}),ot;function r(s,h){return Dh({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Cl(),Ji].filter((v)=>!!v),issueData:{code:Ue.invalid_arguments,argumentsError:h}})}function i(s,h){return Dh({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Cl(),Ji].filter((v)=>!!v),issueData:{code:Ue.invalid_return_type,returnTypeError:h}})}let n={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof Gs){let s=this;return Wr(async function(...h){let v=new bn([]),b=await s._def.args.parseAsync(h,n).catch((S)=>{throw v.addIssue(r(h,S)),v}),_=await Reflect.apply(o,this,b);return await s._def.returns._def.type.parseAsync(_,n).catch((S)=>{throw v.addIssue(i(_,S)),v})})}else{let s=this;return Wr(function(...h){let v=s._def.args.safeParse(h,n);if(!v.success)throw new bn([r(h,v.error)]);let b=Reflect.apply(o,this,v.data),_=s._def.returns.safeParse(b,n);if(!_.success)throw new bn([i(b,_.error)]);return _.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Dl({...this._def,args:xi.create(e).rest(qo.create())})}returns(e){return new Dl({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new Dl({args:e?e:xi.create([]).rest(qo.create()),returns:t||qo.create(),typeName:Le.ZodFunction,...ht(r)})}}class Fl extends bt{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})}}Fl.create=(e,t)=>new Fl({getter:e,typeName:Le.ZodLazy,...ht(t)});class ql extends bt{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return Je(t,{received:t.data,code:Ue.invalid_literal,expected:this._def.value}),ot}return{status:"valid",value:e.data}}get value(){return this._def.value}}ql.create=(e,t)=>new ql({value:e,typeName:Le.ZodLiteral,...ht(t)});function h6(e,t){return new Bo({values:e,typeName:Le.ZodEnum,...ht(t)})}class Bo extends bt{_parse(e){if(typeof e.data!=="string"){let t=this._getOrReturnCtx(e),r=this._def.values;return Je(t,{expected:wt.joinValues(r),received:t.parsedType,code:Ue.invalid_type}),ot}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),r=this._def.values;return Je(t,{received:t.data,code:Ue.invalid_enum_value,options:r}),ot}return Wr(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 Bo.create(e,{...this._def,...t})}exclude(e,t=this._def){return Bo.create(this.options.filter((r)=>!e.includes(r)),{...this._def,...t})}}Bo.create=h6;class Bl extends bt{_parse(e){let t=wt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Ze.string&&r.parsedType!==Ze.number){let i=wt.objectValues(t);return Je(r,{expected:wt.joinValues(i),received:r.parsedType,code:Ue.invalid_type}),ot}if(!this._cache)this._cache=new Set(wt.getValidEnumValues(this._def.values));if(!this._cache.has(e.data)){let i=wt.objectValues(t);return Je(r,{received:r.data,code:Ue.invalid_enum_value,options:i}),ot}return Wr(e.data)}get enum(){return this._def.values}}Bl.create=(e,t)=>new Bl({values:e,typeName:Le.ZodNativeEnum,...ht(t)});class Gs extends bt{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Ze.promise&&t.common.async===!1)return Je(t,{code:Ue.invalid_type,expected:Ze.promise,received:t.parsedType}),ot;let r=t.parsedType===Ze.promise?t.data:Promise.resolve(t.data);return Wr(r.then((i)=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Gs.create=(e,t)=>new Gs({type:e,typeName:Le.ZodPromise,...ht(t)});class ei extends bt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Le.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),i=this._def.effect||null,n={addIssue:(o)=>{if(Je(r,o),o.fatal)t.abort();else t.dirty()},get path(){return r.path}};if(n.addIssue=n.addIssue.bind(n),i.type==="preprocess"){let o=i.transform(r.data,n);if(r.common.async)return Promise.resolve(o).then(async(s)=>{if(t.value==="aborted")return ot;let h=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});if(h.status==="aborted")return ot;if(h.status==="dirty")return Hs(h.value);if(t.value==="dirty")return Hs(h.value);return h});else{if(t.value==="aborted")return ot;let s=this._def.schema._parseSync({data:o,path:r.path,parent:r});if(s.status==="aborted")return ot;if(s.status==="dirty")return Hs(s.value);if(t.value==="dirty")return Hs(s.value);return s}}if(i.type==="refinement"){let o=(s)=>{let h=i.refinement(s,n);if(r.common.async)return Promise.resolve(h);if(h instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(s.status==="aborted")return ot;if(s.status==="dirty")t.dirty();return o(s.value),{status:t.value,value:s.value}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((s)=>{if(s.status==="aborted")return ot;if(s.status==="dirty")t.dirty();return o(s.value).then(()=>({status:t.value,value:s.value}))})}if(i.type==="transform")if(r.common.async===!1){let o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Fo(o))return ot;let s=i.transform(o.value,n);if(s instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((o)=>{if(!Fo(o))return ot;return Promise.resolve(i.transform(o.value,n)).then((s)=>({status:t.value,value:s}))});wt.assertNever(i)}}ei.create=(e,t,r)=>new ei({schema:e,typeName:Le.ZodEffects,effect:t,...ht(r)});ei.createWithPreprocess=(e,t,r)=>new ei({schema:t,effect:{type:"preprocess",transform:e},typeName:Le.ZodEffects,...ht(r)});class $n extends bt{_parse(e){if(this._getType(e)===Ze.undefined)return Wr(void 0);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}$n.create=(e,t)=>new $n({innerType:e,typeName:Le.ZodOptional,...ht(t)});class Xi extends bt{_parse(e){if(this._getType(e)===Ze.null)return Wr(null);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Xi.create=(e,t)=>new Xi({innerType:e,typeName:Le.ZodNullable,...ht(t)});class Hl extends bt{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;if(t.parsedType===Ze.undefined)r=this._def.defaultValue();return this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Hl.create=(e,t)=>new Hl({innerType:e,typeName:Le.ZodDefault,defaultValue:typeof t.default==="function"?t.default:()=>t.default,...ht(t)});class Zl extends bt{_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});if(Ol(i))return i.then((n)=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new bn(r.common.issues)},input:r.data})}));else return{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new bn(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Zl.create=(e,t)=>new Zl({innerType:e,typeName:Le.ZodCatch,catchValue:typeof t.catch==="function"?t.catch:()=>t.catch,...ht(t)});class qh extends bt{_parse(e){if(this._getType(e)!==Ze.nan){let r=this._getOrReturnCtx(e);return Je(r,{code:Ue.invalid_type,expected:Ze.nan,received:r.parsedType}),ot}return{status:"valid",value:e.data}}}qh.create=(e)=>new qh({typeName:Le.ZodNaN,...ht(e)});var Dme=Symbol("zod_brand");class Vv extends bt{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class Bh extends bt{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let n=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});if(n.status==="aborted")return ot;if(n.status==="dirty")return t.dirty(),Hs(n.value);else return this._def.out._parseAsync({data:n.value,path:r.path,parent:r})})();else{let i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});if(i.status==="aborted")return ot;if(i.status==="dirty")return t.dirty(),{status:"dirty",value:i.value};else return this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,t){return new Bh({in:e,out:t,typeName:Le.ZodPipeline})}}class Kl extends bt{_parse(e){let t=this._def.innerType._parse(e),r=(i)=>{if(Fo(i))i.value=Object.freeze(i.value);return i};return Ol(t)?t.then((i)=>r(i)):r(t)}unwrap(){return this._def.innerType}}Kl.create=(e,t)=>new Kl({innerType:e,typeName:Le.ZodReadonly,...ht(t)});var Nme={object:er.lazycreate},Le;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Le||(Le={}));var zme=wi.create,jme=Ks.create,Ume=qh.create,Lme=Vs.create,Fme=Nh.create,qme=Nl.create,Bme=zh.create,Hme=zl.create,Zme=jl.create,Kme=jh.create,Vme=qo.create,Wme=Si.create,Gme=Uh.create,Jme=Qn.create,p6=er.create,Xme=er.strictCreate,Yme=Ul.create,Qme=Kv.create,e0e=Ll.create,t0e=xi.create,r0e=Lh.create,n0e=Fh.create,i0e=Ws.create,o0e=Dl.create,s0e=Fl.create,a0e=ql.create,u0e=Bo.create,l0e=Bl.create,c0e=Gs.create,d0e=ei.create,f0e=$n.create,h0e=Xi.create,p0e=ei.createWithPreprocess,m0e=Bh.create;var gO=ne("ZodMiniType",(e,t)=>{if(!e._zod)throw Error("Uninitialized schema in ZodMiniType.");ut.init(e,t),e.def=t,e.parse=(r,i)=>wo(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>Ui(e,r,i),e.parseAsync=async(r,i)=>So(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>Li(e,r,i),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map((i)=>typeof i==="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),e.clone=(r,i)=>Ur(e,r,i),e.brand=()=>e,e.register=(r,i)=>(r.add(e,i),e)});var yO=ne("ZodMiniObject",(e,t)=>{Ba.init(e,t),gO.init(e,t),Be.defineLazy(e,"shape",()=>t.shape)});function Wv(e,t){let r={type:"object",get shape(){return Be.assignProp(this,"shape",{...e}),this.shape},...Be.normalizeParams(t)};return new yO(r)}function Tn(e){return!!e._zod}function Ho(e){let t=Object.values(e);if(t.length===0)return Wv({});let r=t.every(Tn),i=t.every((n)=>!Tn(n));if(r)return Wv(e);if(i)return p6(e);throw Error("Mixed Zod versions detected in object shape.")}function Yi(e,t){if(Tn(e))return Ui(e,t);return e.safeParse(t)}async function Hh(e,t){if(Tn(e))return await Li(e,t);return await e.safeParseAsync(t)}function Qi(e){if(!e)return;let t;if(Tn(e))t=e._zod?.def?.shape;else t=e.shape;if(!t)return;if(typeof t==="function")try{return t()}catch{return}return t}function Js(e){if(!e)return;if(typeof e==="object"){let t=e,r=e;if(!t._def&&!r._zod){let i=Object.values(e);if(i.length>0&&i.every((n)=>typeof n==="object"&&n!==null&&(n._def!==void 0||n._zod!==void 0||typeof n.parse==="function")))return Ho(e)}}if(Tn(e)){let r=e._zod?.def;if(r&&(r.type==="object"||r.shape!==void 0))return e}else if(e.shape!==void 0)return e;return}function Zh(e){if(e&&typeof e==="object"){if("message"in e&&typeof e.message==="string")return e.message;if("issues"in e&&Array.isArray(e.issues)&&e.issues.length>0){let t=e.issues[0];if(t&&typeof t==="object"&&"message"in t)return String(t.message)}try{return JSON.stringify(e)}catch{return String(e)}}return String(e)}function m6(e){return e.description}function g6(e){if(Tn(e))return e._zod?.def?.type==="optional";let t=e;if(typeof e.isOptional==="function")return e.isOptional();return t._def?.typeName==="ZodOptional"}function Kh(e){if(Tn(e)){let o=e._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}let r=e._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let i=e.value;if(i!==void 0)return i;return}var Gv="2025-11-25";var y6=[Gv,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],eo="io.modelcontextprotocol/related-task",Wh="2.0",xr=Fy((e)=>e!==null&&(typeof e==="object"||typeof e==="function")),v6=Dt([de(),It().int()]),b6=de(),P0e=Lr({ttl:It().optional(),pollInterval:It().optional()}),bO=Qe({ttl:It().optional()}),_O=Qe({taskId:de()}),Jv=Lr({progressToken:v6.optional(),[eo]:_O.optional()}),_n=Qe({_meta:Jv.optional()}),Vl=_n.extend({task:bO.optional()}),_6=(e)=>Vl.safeParse(e).success,Or=Qe({method:de(),params:_n.loose().optional()}),Pn=Qe({_meta:Jv.optional()}),An=Qe({method:de(),params:Pn.loose().optional()}),Dr=Lr({_meta:Jv.optional()}),Gh=Dt([de(),It().int()]),w6=Qe({jsonrpc:tt(Wh),id:Gh,...Or.shape}).strict(),Xv=(e)=>w6.safeParse(e).success,S6=Qe({jsonrpc:tt(Wh),...An.shape}).strict(),x6=(e)=>S6.safeParse(e).success,Yv=Qe({jsonrpc:tt(Wh),id:Gh,result:Dr}).strict(),Wl=(e)=>Yv.safeParse(e).success;var it;(function(e){e[e.ConnectionClosed=-32000]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(it||(it={}));var Qv=Qe({jsonrpc:tt(Wh),id:Gh.optional(),error:Qe({code:It().int(),message:de(),data:qt().optional()})}).strict();var k6=(e)=>Qv.safeParse(e).success;var A0e=Dt([w6,S6,Yv,Qv]),R0e=Dt([Yv,Qv]),Jh=Dr.strict(),wO=Pn.extend({requestId:Gh.optional(),reason:de().optional()}),Xh=An.extend({method:tt("notifications/cancelled"),params:wO}),SO=Qe({src:de(),mimeType:de().optional(),sizes:_t(de()).optional(),theme:Vr(["light","dark"]).optional()}),Gl=Qe({icons:_t(SO).optional()}),Xs=Qe({name:de(),title:de().optional()}),M6=Xs.extend({...Xs.shape,...Gl.shape,version:de(),websiteUrl:de().optional(),description:de().optional()}),xO=Cu(Qe({applyDefaults:or().optional()}),Nt(de(),qt())),kO=Gf((e)=>{if(e&&typeof e==="object"&&!Array.isArray(e)){if(Object.keys(e).length===0)return{form:{}}}return e},Cu(Qe({form:xO.optional(),url:xr.optional()}),Nt(de(),qt()).optional())),MO=Lr({list:xr.optional(),cancel:xr.optional(),requests:Lr({sampling:Lr({createMessage:xr.optional()}).optional(),elicitation:Lr({create:xr.optional()}).optional()}).optional()}),EO=Lr({list:xr.optional(),cancel:xr.optional(),requests:Lr({tools:Lr({call:xr.optional()}).optional()}).optional()}),IO=Qe({experimental:Nt(de(),xr).optional(),sampling:Qe({context:xr.optional(),tools:xr.optional()}).optional(),elicitation:kO.optional(),roots:Qe({listChanged:or().optional()}).optional(),tasks:MO.optional(),extensions:Nt(de(),xr).optional()}),$O=_n.extend({protocolVersion:de(),capabilities:IO,clientInfo:M6}),eb=Or.extend({method:tt("initialize"),params:$O});var TO=Qe({experimental:Nt(de(),xr).optional(),logging:xr.optional(),completions:xr.optional(),prompts:Qe({listChanged:or().optional()}).optional(),resources:Qe({subscribe:or().optional(),listChanged:or().optional()}).optional(),tools:Qe({listChanged:or().optional()}).optional(),tasks:EO.optional(),extensions:Nt(de(),xr).optional()}),PO=Dr.extend({protocolVersion:de(),capabilities:TO,serverInfo:M6,instructions:de().optional()}),tb=An.extend({method:tt("notifications/initialized"),params:Pn.optional()});var Yh=Or.extend({method:tt("ping"),params:_n.optional()}),AO=Qe({progress:It(),total:Lt(It()),message:Lt(de())}),RO=Qe({...Pn.shape,...AO.shape,progressToken:v6}),Qh=An.extend({method:tt("notifications/progress"),params:RO}),CO=_n.extend({cursor:b6.optional()}),Jl=Or.extend({params:CO.optional()}),Xl=Dr.extend({nextCursor:b6.optional()}),OO=Vr(["working","input_required","completed","failed","cancelled"]),Yl=Qe({taskId:de(),status:OO,ttl:Dt([It(),Bf()]),createdAt:de(),lastUpdatedAt:de(),pollInterval:Lt(It()),statusMessage:Lt(de())}),Ys=Dr.extend({task:Yl}),DO=Pn.merge(Yl),Ql=An.extend({method:tt("notifications/tasks/status"),params:DO}),ep=Or.extend({method:tt("tasks/get"),params:_n.extend({taskId:de()})}),tp=Dr.merge(Yl),rp=Or.extend({method:tt("tasks/result"),params:_n.extend({taskId:de()})}),C0e=Dr.loose(),np=Jl.extend({method:tt("tasks/list")}),ip=Xl.extend({tasks:_t(Yl)}),op=Or.extend({method:tt("tasks/cancel"),params:_n.extend({taskId:de()})}),E6=Dr.merge(Yl),I6=Qe({uri:de(),mimeType:Lt(de()),_meta:Nt(de(),qt()).optional()}),$6=I6.extend({text:de()}),rb=de().refine((e)=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),T6=I6.extend({blob:rb}),ec=Vr(["user","assistant"]),Qs=Qe({audience:_t(ec).optional(),priority:It().min(0).max(1).optional(),lastModified:ks.datetime({offset:!0}).optional()}),P6=Qe({...Xs.shape,...Gl.shape,uri:de(),description:Lt(de()),mimeType:Lt(de()),size:Lt(It()),annotations:Qs.optional(),_meta:Lt(Lr({}))}),NO=Qe({...Xs.shape,...Gl.shape,uriTemplate:de(),description:Lt(de()),mimeType:Lt(de()),annotations:Qs.optional(),_meta:Lt(Lr({}))}),sp=Jl.extend({method:tt("resources/list")}),zO=Xl.extend({resources:_t(P6)}),ap=Jl.extend({method:tt("resources/templates/list")}),jO=Xl.extend({resourceTemplates:_t(NO)}),nb=_n.extend({uri:de()}),UO=nb,up=Or.extend({method:tt("resources/read"),params:UO}),LO=Dr.extend({contents:_t(Dt([$6,T6]))}),FO=An.extend({method:tt("notifications/resources/list_changed"),params:Pn.optional()}),qO=nb,BO=Or.extend({method:tt("resources/subscribe"),params:qO}),HO=nb,ZO=Or.extend({method:tt("resources/unsubscribe"),params:HO}),KO=Pn.extend({uri:de()}),VO=An.extend({method:tt("notifications/resources/updated"),params:KO}),WO=Qe({name:de(),description:Lt(de()),required:Lt(or())}),GO=Qe({...Xs.shape,...Gl.shape,description:Lt(de()),arguments:Lt(_t(WO)),_meta:Lt(Lr({}))}),lp=Jl.extend({method:tt("prompts/list")}),JO=Xl.extend({prompts:_t(GO)}),XO=_n.extend({name:de(),arguments:Nt(de(),de()).optional()}),cp=Or.extend({method:tt("prompts/get"),params:XO}),ib=Qe({type:tt("text"),text:de(),annotations:Qs.optional(),_meta:Nt(de(),qt()).optional()}),ob=Qe({type:tt("image"),data:rb,mimeType:de(),annotations:Qs.optional(),_meta:Nt(de(),qt()).optional()}),sb=Qe({type:tt("audio"),data:rb,mimeType:de(),annotations:Qs.optional(),_meta:Nt(de(),qt()).optional()}),YO=Qe({type:tt("tool_use"),name:de(),id:de(),input:Nt(de(),qt()),_meta:Nt(de(),qt()).optional()}),QO=Qe({type:tt("resource"),resource:Dt([$6,T6]),annotations:Qs.optional(),_meta:Nt(de(),qt()).optional()}),eD=P6.extend({type:tt("resource_link")}),ab=Dt([ib,ob,sb,eD,QO]),tD=Qe({role:ec,content:ab}),rD=Dr.extend({description:de().optional(),messages:_t(tD)}),nD=An.extend({method:tt("notifications/prompts/list_changed"),params:Pn.optional()}),iD=Qe({title:de().optional(),readOnlyHint:or().optional(),destructiveHint:or().optional(),idempotentHint:or().optional(),openWorldHint:or().optional()}),oD=Qe({taskSupport:Vr(["required","optional","forbidden"]).optional()}),A6=Qe({...Xs.shape,...Gl.shape,description:de().optional(),inputSchema:Qe({type:tt("object"),properties:Nt(de(),xr).optional(),required:_t(de()).optional()}).catchall(qt()),outputSchema:Qe({type:tt("object"),properties:Nt(de(),xr).optional(),required:_t(de()).optional()}).catchall(qt()).optional(),annotations:iD.optional(),execution:oD.optional(),_meta:Nt(de(),qt()).optional()}),dp=Jl.extend({method:tt("tools/list")}),sD=Xl.extend({tools:_t(A6)}),fp=Dr.extend({content:_t(ab).default([]),structuredContent:Nt(de(),qt()).optional(),isError:or().optional()}),O0e=fp.or(Dr.extend({toolResult:qt()})),aD=Vl.extend({name:de(),arguments:Nt(de(),qt()).optional()}),ea=Or.extend({method:tt("tools/call"),params:aD}),uD=An.extend({method:tt("notifications/tools/list_changed"),params:Pn.optional()}),D0e=Qe({autoRefresh:or().default(!0),debounceMs:It().int().nonnegative().default(300)}),tc=Vr(["debug","info","notice","warning","error","critical","alert","emergency"]),lD=_n.extend({level:tc}),ub=Or.extend({method:tt("logging/setLevel"),params:lD}),cD=Pn.extend({level:tc,logger:de().optional(),data:qt()}),dD=An.extend({method:tt("notifications/message"),params:cD}),fD=Qe({name:de().optional()}),hD=Qe({hints:_t(fD).optional(),costPriority:It().min(0).max(1).optional(),speedPriority:It().min(0).max(1).optional(),intelligencePriority:It().min(0).max(1).optional()}),pD=Qe({mode:Vr(["auto","required","none"]).optional()}),mD=Qe({type:tt("tool_result"),toolUseId:de().describe("The unique identifier for the corresponding tool call."),content:_t(ab).default([]),structuredContent:Qe({}).loose().optional(),isError:or().optional(),_meta:Nt(de(),qt()).optional()}),gD=Vf("type",[ib,ob,sb]),Vh=Vf("type",[ib,ob,sb,YO,mD]),yD=Qe({role:ec,content:Dt([Vh,_t(Vh)]),_meta:Nt(de(),qt()).optional()}),vD=Vl.extend({messages:_t(yD),modelPreferences:hD.optional(),systemPrompt:de().optional(),includeContext:Vr(["none","thisServer","allServers"]).optional(),temperature:It().optional(),maxTokens:It().int(),stopSequences:_t(de()).optional(),metadata:xr.optional(),tools:_t(A6).optional(),toolChoice:pD.optional()}),bD=Or.extend({method:tt("sampling/createMessage"),params:vD}),rc=Dr.extend({model:de(),stopReason:Lt(Vr(["endTurn","stopSequence","maxTokens"]).or(de())),role:ec,content:gD}),lb=Dr.extend({model:de(),stopReason:Lt(Vr(["endTurn","stopSequence","maxTokens","toolUse"]).or(de())),role:ec,content:Dt([Vh,_t(Vh)])}),_D=Qe({type:tt("boolean"),title:de().optional(),description:de().optional(),default:or().optional()}),wD=Qe({type:tt("string"),title:de().optional(),description:de().optional(),minLength:It().optional(),maxLength:It().optional(),format:Vr(["email","uri","date","date-time"]).optional(),default:de().optional()}),SD=Qe({type:Vr(["number","integer"]),title:de().optional(),description:de().optional(),minimum:It().optional(),maximum:It().optional(),default:It().optional()}),xD=Qe({type:tt("string"),title:de().optional(),description:de().optional(),enum:_t(de()),default:de().optional()}),kD=Qe({type:tt("string"),title:de().optional(),description:de().optional(),oneOf:_t(Qe({const:de(),title:de()})),default:de().optional()}),MD=Qe({type:tt("string"),title:de().optional(),description:de().optional(),enum:_t(de()),enumNames:_t(de()).optional(),default:de().optional()}),ED=Dt([xD,kD]),ID=Qe({type:tt("array"),title:de().optional(),description:de().optional(),minItems:It().optional(),maxItems:It().optional(),items:Qe({type:tt("string"),enum:_t(de())}),default:_t(de()).optional()}),$D=Qe({type:tt("array"),title:de().optional(),description:de().optional(),minItems:It().optional(),maxItems:It().optional(),items:Qe({anyOf:_t(Qe({const:de(),title:de()}))}),default:_t(de()).optional()}),TD=Dt([ID,$D]),PD=Dt([MD,ED,TD]),AD=Dt([PD,_D,wD,SD]),RD=Vl.extend({mode:tt("form").optional(),message:de(),requestedSchema:Qe({type:tt("object"),properties:Nt(de(),AD),required:_t(de()).optional()})}),CD=Vl.extend({mode:tt("url"),message:de(),elicitationId:de(),url:de().url()}),OD=Dt([RD,CD]),DD=Or.extend({method:tt("elicitation/create"),params:OD}),ND=Pn.extend({elicitationId:de()}),zD=An.extend({method:tt("notifications/elicitation/complete"),params:ND}),ta=Dr.extend({action:Vr(["accept","decline","cancel"]),content:Gf((e)=>e===null?void 0:e,Nt(de(),Dt([de(),It(),or(),_t(de())])).optional())}),jD=Qe({type:tt("ref/resource"),uri:de()});var UD=Qe({type:tt("ref/prompt"),name:de()}),LD=_n.extend({ref:Dt([UD,jD]),argument:Qe({name:de(),value:de()}),context:Qe({arguments:Nt(de(),de()).optional()}).optional()}),hp=Or.extend({method:tt("completion/complete"),params:LD});function R6(e){if(e.params.ref.type!=="ref/prompt")throw TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function C6(e){if(e.params.ref.type!=="ref/resource")throw TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}var FD=Dr.extend({completion:Lr({values:_t(de()).max(100),total:Lt(It().int()),hasMore:Lt(or())})}),qD=Qe({uri:de().startsWith("file://"),name:de().optional(),_meta:Nt(de(),qt()).optional()}),BD=Or.extend({method:tt("roots/list"),params:_n.optional()}),cb=Dr.extend({roots:_t(qD)}),HD=An.extend({method:tt("notifications/roots/list_changed"),params:Pn.optional()}),N0e=Dt([Yh,eb,hp,ub,cp,lp,sp,ap,up,BO,ZO,ea,dp,ep,rp,np,op]),z0e=Dt([Xh,Qh,tb,HD,Ql]),j0e=Dt([Jh,rc,lb,ta,cb,tp,ip,Ys]),U0e=Dt([Yh,bD,DD,BD,ep,rp,np,op]),L0e=Dt([Xh,Qh,dD,VO,FO,uD,nD,Ql,zD]),F0e=Dt([Jh,PO,FD,rD,JO,zO,jO,LO,fp,sD,tp,ip,Ys]);class rt extends Error{constructor(e,t,r){super(`MCP error ${e}: ${t}`);this.code=e,this.data=r,this.name="McpError"}static fromError(e,t,r){if(e===it.UrlElicitationRequired&&r){let i=r;if(i.elicitations)return new O6(i.elicitations,t)}return new rt(e,t,r)}}class O6 extends rt{constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(it.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}}function to(e){return e==="completed"||e==="failed"||e==="cancelled"}var N6=Symbol("Let zodToJsonSchema decide on which parser to use");var D6={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},z6=(e)=>typeof e==="string"?{...D6,name:e}:{...D6,...e};var j6=(e)=>{let t=z6(e),r=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([i,n])=>[n._def,{def:n._def,path:[...t.basePath,t.definitionPath,i],jsonSchema:void 0}]))}};function db(e,t,r,i){if(!i?.errorMessages)return;if(r)e.errorMessage={...e.errorMessage,[t]:r}}function St(e,t,r,i,n){e[t]=r,db(e,t,i,n)}var pp=(e,t)=>{let r=0;for(;r<e.length&&r<t.length;r++)if(e[r]!==t[r])break;return[(e.length-r).toString(),...t.slice(r)].join("/")};function Zt(e){if(e.target!=="openAi")return{};let t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:e.$refStrategy==="relative"?pp(t,e.currentPath):t.join("/")}}function U6(e,t){let r={type:"array"};if(e.type?._def&&e.type?._def?.typeName!==Le.ZodAny)r.items=st(e.type._def,{...t,currentPath:[...t.currentPath,"items"]});if(e.minLength)St(r,"minItems",e.minLength.value,e.minLength.message,t);if(e.maxLength)St(r,"maxItems",e.maxLength.value,e.maxLength.message,t);if(e.exactLength)St(r,"minItems",e.exactLength.value,e.exactLength.message,t),St(r,"maxItems",e.exactLength.value,e.exactLength.message,t);return r}function L6(e,t){let r={type:"integer",format:"int64"};if(!e.checks)return r;for(let i of e.checks)switch(i.kind){case"min":if(t.target==="jsonSchema7")if(i.inclusive)St(r,"minimum",i.value,i.message,t);else St(r,"exclusiveMinimum",i.value,i.message,t);else{if(!i.inclusive)r.exclusiveMinimum=!0;St(r,"minimum",i.value,i.message,t)}break;case"max":if(t.target==="jsonSchema7")if(i.inclusive)St(r,"maximum",i.value,i.message,t);else St(r,"exclusiveMaximum",i.value,i.message,t);else{if(!i.inclusive)r.exclusiveMaximum=!0;St(r,"maximum",i.value,i.message,t)}break;case"multipleOf":St(r,"multipleOf",i.value,i.message,t);break}return r}function F6(){return{type:"boolean"}}function mp(e,t){return st(e.type._def,t)}var q6=(e,t)=>st(e.innerType._def,t);function fb(e,t,r){let i=r??t.dateStrategy;if(Array.isArray(i))return{anyOf:i.map((n,o)=>fb(e,t,n))};switch(i){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return ZD(e,t)}}var ZD=(e,t)=>{let r={type:"integer",format:"unix-time"};if(t.target==="openApi3")return r;for(let i of e.checks)switch(i.kind){case"min":St(r,"minimum",i.value,i.message,t);break;case"max":St(r,"maximum",i.value,i.message,t);break}return r};function B6(e,t){return{...st(e.innerType._def,t),default:e.defaultValue()}}function H6(e,t){return t.effectStrategy==="input"?st(e.schema._def,t):Zt(t)}function Z6(e){return{type:"string",enum:Array.from(e.values)}}var KD=(e)=>{if("type"in e&&e.type==="string")return!1;return"allOf"in e};function K6(e,t){let r=[st(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),st(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter((o)=>!!o),i=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,n=[];return r.forEach((o)=>{if(KD(o)){if(n.push(...o.allOf),o.unevaluatedProperties===void 0)i=void 0}else{let s=o;if("additionalProperties"in o&&o.additionalProperties===!1){let{additionalProperties:h,...v}=o;s=v}else i=void 0;n.push(s)}}),n.length?{allOf:n,...i}:void 0}function V6(e,t){let r=typeof e.value;if(r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string")return{type:Array.isArray(e.value)?"array":"object"};if(t.target==="openApi3")return{type:r==="bigint"?"integer":r,enum:[e.value]};return{type:r==="bigint"?"integer":r,const:e.value}}var hb=void 0,Ln={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>{if(hb===void 0)hb=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u");return hb},uuid:/^[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}$/,ipv4:/^(?:(?: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])$/,ipv4Cidr:/^(?:(?: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])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([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])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function gp(e,t){let r={type:"string"};if(e.checks)for(let i of e.checks)switch(i.kind){case"min":St(r,"minLength",typeof r.minLength==="number"?Math.max(r.minLength,i.value):i.value,i.message,t);break;case"max":St(r,"maxLength",typeof r.maxLength==="number"?Math.min(r.maxLength,i.value):i.value,i.message,t);break;case"email":switch(t.emailStrategy){case"format:email":Fn(r,"email",i.message,t);break;case"format:idn-email":Fn(r,"idn-email",i.message,t);break;case"pattern:zod":Gr(r,Ln.email,i.message,t);break}break;case"url":Fn(r,"uri",i.message,t);break;case"uuid":Fn(r,"uuid",i.message,t);break;case"regex":Gr(r,i.regex,i.message,t);break;case"cuid":Gr(r,Ln.cuid,i.message,t);break;case"cuid2":Gr(r,Ln.cuid2,i.message,t);break;case"startsWith":Gr(r,RegExp(`^${pb(i.value,t)}`),i.message,t);break;case"endsWith":Gr(r,RegExp(`${pb(i.value,t)}$`),i.message,t);break;case"datetime":Fn(r,"date-time",i.message,t);break;case"date":Fn(r,"date",i.message,t);break;case"time":Fn(r,"time",i.message,t);break;case"duration":Fn(r,"duration",i.message,t);break;case"length":St(r,"minLength",typeof r.minLength==="number"?Math.max(r.minLength,i.value):i.value,i.message,t),St(r,"maxLength",typeof r.maxLength==="number"?Math.min(r.maxLength,i.value):i.value,i.message,t);break;case"includes":{Gr(r,RegExp(pb(i.value,t)),i.message,t);break}case"ip":{if(i.version!=="v6")Fn(r,"ipv4",i.message,t);if(i.version!=="v4")Fn(r,"ipv6",i.message,t);break}case"base64url":Gr(r,Ln.base64url,i.message,t);break;case"jwt":Gr(r,Ln.jwt,i.message,t);break;case"cidr":{if(i.version!=="v6")Gr(r,Ln.ipv4Cidr,i.message,t);if(i.version!=="v4")Gr(r,Ln.ipv6Cidr,i.message,t);break}case"emoji":Gr(r,Ln.emoji(),i.message,t);break;case"ulid":{Gr(r,Ln.ulid,i.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{Fn(r,"binary",i.message,t);break}case"contentEncoding:base64":{St(r,"contentEncoding","base64",i.message,t);break}case"pattern:zod":{Gr(r,Ln.base64,i.message,t);break}}break}case"nanoid":Gr(r,Ln.nanoid,i.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:((n)=>{})(i)}return r}function pb(e,t){return t.patternStrategy==="escape"?WD(e):e}var VD=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function WD(e){let t="";for(let r=0;r<e.length;r++){if(!VD.has(e[r]))t+="\\";t+=e[r]}return t}function Fn(e,t,r,i){if(e.format||e.anyOf?.some((n)=>n.format)){if(!e.anyOf)e.anyOf=[];if(e.format){if(e.anyOf.push({format:e.format,...e.errorMessage&&i.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage){if(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0)delete e.errorMessage}}e.anyOf.push({format:t,...r&&i.errorMessages&&{errorMessage:{format:r}}})}else St(e,"format",t,r,i)}function Gr(e,t,r,i){if(e.pattern||e.allOf?.some((n)=>n.pattern)){if(!e.allOf)e.allOf=[];if(e.pattern){if(e.allOf.push({pattern:e.pattern,...e.errorMessage&&i.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage){if(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0)delete e.errorMessage}}e.allOf.push({pattern:W6(t,i),...r&&i.errorMessages&&{errorMessage:{pattern:r}}})}else St(e,"pattern",W6(t,i),r,i)}function W6(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let r={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},i=r.i?e.source.toLowerCase():e.source,n="",o=!1,s=!1,h=!1;for(let v=0;v<i.length;v++){if(o){n+=i[v],o=!1;continue}if(r.i){if(s){if(i[v].match(/[a-z]/)){if(h)n+=i[v],n+=`${i[v-2]}-${i[v]}`.toUpperCase(),h=!1;else if(i[v+1]==="-"&&i[v+2]?.match(/[a-z]/))n+=i[v],h=!0;else n+=`${i[v]}${i[v].toUpperCase()}`;continue}}else if(i[v].match(/[a-z]/)){n+=`[${i[v]}${i[v].toUpperCase()}]`;continue}}if(r.m){if(i[v]==="^"){n+=`(^|(?<=[\r
|
|
105
|
+
`);this.partialLine=o.pop()??"";for(let s of o){if(!s)continue;try{this.messages.enqueue(Bs(s))}catch(h){}}},this.abortHandler=()=>{this.close(),this.exitError=new On("WebSocket connection aborted by user")},this.abortController.signal.aborted)this.abortHandler();else this.abortController.signal.addEventListener("abort",this.abortHandler)}catch(e){if(this.ready=!1,this.exitError=e,this.readyReject)this.readyReject(e);throw e}}async write(e){if(this.abortController.signal.aborted)throw new On("Operation aborted");if(!this.ready)await this.readyPromise;if(!this.ready||!this.ws||this.ws.readyState!==globalThis.WebSocket.OPEN)throw Error("WebSocketTransport is not ready for writing");this.ws.send(e)}close(){if(this.abortHandler)this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0;if(this.keepAliveTimer)clearInterval(this.keepAliveTimer),this.keepAliveTimer=void 0;if(this.ws&&this.ws.readyState===globalThis.WebSocket.OPEN)this.ws.close(1000,"Normal closure");this.ready=!1,this.messages.done()}[Symbol.dispose](){this.close()}isReady(){return this.ready&&this.ws?.readyState===globalThis.WebSocket.OPEN}endInput(){}async*readMessages(){if(yield*this.messages,this.exitError)throw this.exitError}}function u6(e){return new AbortController}var wt;(function(e){e.assertEqual=(n)=>{};function t(n){}e.assertIs=t;function r(n){throw Error()}e.assertNever=r,e.arrayToEnum=(n)=>{let o={};for(let s of n)o[s]=s;return o},e.getValidEnumValues=(n)=>{let o=e.objectKeys(n).filter((h)=>typeof n[n[h]]!=="number"),s={};for(let h of o)s[h]=n[h];return e.objectValues(s)},e.objectValues=(n)=>e.objectKeys(n).map(function(o){return n[o]}),e.objectKeys=typeof Object.keys==="function"?(n)=>Object.keys(n):(n)=>{let o=[];for(let s in n)if(Object.prototype.hasOwnProperty.call(n,s))o.push(s);return o},e.find=(n,o)=>{for(let s of n)if(o(s))return s;return},e.isInteger=typeof Number.isInteger==="function"?(n)=>Number.isInteger(n):(n)=>typeof n==="number"&&Number.isFinite(n)&&Math.floor(n)===n;function i(n,o=" | "){return n.map((s)=>typeof s==="string"?`'${s}'`:s).join(o)}e.joinValues=i,e.jsonStringifyReplacer=(n,o)=>{if(typeof o==="bigint")return o.toString();return o}})(wt||(wt={}));var l6;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(l6||(l6={}));var Ze=wt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),bi=(e)=>{switch(typeof e){case"undefined":return Ze.undefined;case"string":return Ze.string;case"number":return Number.isNaN(e)?Ze.nan:Ze.number;case"boolean":return Ze.boolean;case"function":return Ze.function;case"bigint":return Ze.bigint;case"symbol":return Ze.symbol;case"object":if(Array.isArray(e))return Ze.array;if(e===null)return Ze.null;if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return Ze.promise;if(typeof Map<"u"&&e instanceof Map)return Ze.map;if(typeof Set<"u"&&e instanceof Set)return Ze.set;if(typeof Date<"u"&&e instanceof Date)return Ze.date;return Ze.object;default:return Ze.unknown}};var Ue=wt.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"]);class bn extends Error{get errors(){return this.issues}constructor(e){super();this.issues=[],this.addIssue=(r)=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let t=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,t);else this.__proto__=t;this.name="ZodError",this.issues=e}format(e){let t=e||function(n){return n.message},r={_errors:[]},i=(n)=>{for(let o of n.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(t(o));else{let s=r,h=0;while(h<o.path.length){let v=o.path[h];if(h!==o.path.length-1)s[v]=s[v]||{_errors:[]};else s[v]=s[v]||{_errors:[]},s[v]._errors.push(t(o));s=s[v],h++}}};return i(this),r}static assert(e){if(!(e instanceof bn))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,wt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=(t)=>t.message){let t={},r=[];for(let i of this.issues)if(i.path.length>0){let n=i.path[0];t[n]=t[n]||[],t[n].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}bn.create=(e)=>new bn(e);var ZC=(e,t)=>{let r;switch(e.code){case Ue.invalid_type:if(e.received===Ze.undefined)r="Required";else r=`Expected ${e.expected}, received ${e.received}`;break;case Ue.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,wt.jsonStringifyReplacer)}`;break;case Ue.unrecognized_keys:r=`Unrecognized key(s) in object: ${wt.joinValues(e.keys,", ")}`;break;case Ue.invalid_union:r="Invalid input";break;case Ue.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${wt.joinValues(e.options)}`;break;case Ue.invalid_enum_value:r=`Invalid enum value. Expected ${wt.joinValues(e.options)}, received '${e.received}'`;break;case Ue.invalid_arguments:r="Invalid function arguments";break;case Ue.invalid_return_type:r="Invalid function return type";break;case Ue.invalid_date:r="Invalid date";break;case Ue.invalid_string:if(typeof e.validation==="object")if("includes"in e.validation){if(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==="number")r=`${r} at one or more positions greater than or equal to ${e.validation.position}`}else if("startsWith"in e.validation)r=`Invalid input: must start with "${e.validation.startsWith}"`;else if("endsWith"in e.validation)r=`Invalid input: must end with "${e.validation.endsWith}"`;else wt.assertNever(e.validation);else if(e.validation!=="regex")r=`Invalid ${e.validation}`;else r="Invalid";break;case Ue.too_small:if(e.type==="array")r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`;else if(e.type==="string")r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`;else if(e.type==="number")r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="bigint")r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="date")r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`;else r="Invalid input";break;case Ue.too_big:if(e.type==="array")r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`;else if(e.type==="string")r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`;else if(e.type==="number")r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="bigint")r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="date")r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`;else r="Invalid input";break;case Ue.custom:r="Invalid input";break;case Ue.invalid_intersection_types:r="Intersection results could not be merged";break;case Ue.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case Ue.not_finite:r="Number must be finite";break;default:r=t.defaultError,wt.assertNever(e)}return{message:r}},Ji=ZC;var KC=Ji;function Cl(){return KC}var Dh=(e)=>{let{data:t,path:r,errorMaps:i,issueData:n}=e,o=[...r,...n.path||[]],s={...n,path:o};if(n.message!==void 0)return{...n,path:o,message:n.message};let h="",v=i.filter((b)=>!!b).slice().reverse();for(let b of v)h=b(s,{data:t,defaultError:h}).message;return{...n,path:o,message:h}};function Je(e,t){let r=Cl(),i=Dh({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Ji?void 0:Ji].filter((n)=>!!n)});e.common.issues.push(i)}class qr{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(e,t){let r=[];for(let i of t){if(i.status==="aborted")return ot;if(i.status==="dirty")e.dirty();r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let i of t){let n=await i.key,o=await i.value;r.push({key:n,value:o})}return qr.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let i of t){let{key:n,value:o}=i;if(n.status==="aborted")return ot;if(o.status==="aborted")return ot;if(n.status==="dirty")e.dirty();if(o.status==="dirty")e.dirty();if(n.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet))r[n.value]=o.value}return{status:e.value,value:r}}}var ot=Object.freeze({status:"aborted"}),Hs=(e)=>({status:"dirty",value:e}),Wr=(e)=>({status:"valid",value:e}),qv=(e)=>e.status==="aborted",Bv=(e)=>e.status==="dirty",Fo=(e)=>e.status==="valid",Ol=(e)=>typeof Promise<"u"&&e instanceof Promise;var et;(function(e){e.errToObj=(t)=>typeof t==="string"?{message:t}:t||{},e.toString=(t)=>typeof t==="string"?t:t?.message})(et||(et={}));class Un{constructor(e,t,r,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=i}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var c6=(e,t)=>{if(Fo(t))return{success:!0,data:t.value};else{if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new bn(e.common.issues);return this._error=r,this._error}}}};function ht(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:i,description:n}=e;if(t&&(r||i))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(t)return{errorMap:t,description:n};return{errorMap:(s,h)=>{let{message:v}=e;if(s.code==="invalid_enum_value")return{message:v??h.defaultError};if(typeof h.data>"u")return{message:v??i??h.defaultError};if(s.code!=="invalid_type")return{message:h.defaultError};return{message:v??r??h.defaultError}},description:n}}class bt{get description(){return this._def.description}_getType(e){return bi(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:bi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new qr,ctx:{common:e.parent.common,data:e.data,parsedType:bi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Ol(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){let r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:bi(e)},i=this._parseSync({data:e,path:r.path,parent:r});return c6(r,i)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:bi(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:t});return Fo(r)?{value:r.value}:{issues:t.common.issues}}catch(r){if(r?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((r)=>Fo(r)?{value:r.value}:{issues:t.common.issues})}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:bi(e)},i=this._parse({data:e,path:r.path,parent:r}),n=await(Ol(i)?i:Promise.resolve(i));return c6(r,n)}refine(e,t){let r=(i)=>{if(typeof t==="string"||typeof t>"u")return{message:t};else if(typeof t==="function")return t(i);else return t};return this._refinement((i,n)=>{let o=e(i),s=()=>n.addIssue({code:Ue.custom,...r(i)});if(typeof Promise<"u"&&o instanceof Promise)return o.then((h)=>{if(!h)return s(),!1;else return!0});if(!o)return s(),!1;else return!0})}refinement(e,t){return this._refinement((r,i)=>{if(!e(r))return i.addIssue(typeof t==="function"?t(r,i):t),!1;else return!0})}_refinement(e){return new ei({schema:this,typeName:Le.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 $n.create(this,this._def)}nullable(){return Xi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Qn.create(this)}promise(){return Gs.create(this,this._def)}or(e){return Ul.create([this,e],this._def)}and(e){return Ll.create(this,e,this._def)}transform(e){return new ei({...ht(this._def),schema:this,typeName:Le.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e==="function"?e:()=>e;return new Hl({...ht(this._def),innerType:this,defaultValue:t,typeName:Le.ZodDefault})}brand(){return new Vv({typeName:Le.ZodBranded,type:this,...ht(this._def)})}catch(e){let t=typeof e==="function"?e:()=>e;return new Zl({...ht(this._def),innerType:this,catchValue:t,typeName:Le.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return Bh.create(this,e)}readonly(){return Kl.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var VC=/^c[^\s-]{8,}$/i,WC=/^[0-9a-z]+$/,GC=/^[0-9A-HJKMNP-TV-Z]{26}$/i,JC=/^[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,XC=/^[a-z0-9_-]{21}$/i,YC=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,QC=/^[-+]?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)?)??$/,eO=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,tO="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Hv,rO=/^(?:(?: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])$/,nO=/^(?:(?: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])$/,iO=/^(([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]))$/,oO=/^(([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])$/,sO=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,aO=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,d6="((\\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])))",uO=new RegExp(`^${d6}$`);function f6(e){let t="[0-5]\\d";if(e.precision)t=`${t}\\.\\d{${e.precision}}`;else if(e.precision==null)t=`${t}(\\.\\d+)?`;let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function lO(e){return new RegExp(`^${f6(e)}$`)}function cO(e){let t=`${d6}T${f6(e)}`,r=[];if(r.push(e.local?"Z?":"Z"),e.offset)r.push("([+-]\\d{2}:?\\d{2})");return t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function dO(e,t){if((t==="v4"||!t)&&rO.test(e))return!0;if((t==="v6"||!t)&&iO.test(e))return!0;return!1}function fO(e,t){if(!YC.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let i=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),n=JSON.parse(atob(i));if(typeof n!=="object"||n===null)return!1;if("typ"in n&&n?.typ!=="JWT")return!1;if(!n.alg)return!1;if(t&&n.alg!==t)return!1;return!0}catch{return!1}}function hO(e,t){if((t==="v4"||!t)&&nO.test(e))return!0;if((t==="v6"||!t)&&oO.test(e))return!0;return!1}class wi extends bt{_parse(e){if(this._def.coerce)e.data=String(e.data);if(this._getType(e)!==Ze.string){let n=this._getOrReturnCtx(e);return Je(n,{code:Ue.invalid_type,expected:Ze.string,received:n.parsedType}),ot}let r=new qr,i=void 0;for(let n of this._def.checks)if(n.kind==="min"){if(e.data.length<n.value)i=this._getOrReturnCtx(e,i),Je(i,{code:Ue.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty()}else if(n.kind==="max"){if(e.data.length>n.value)i=this._getOrReturnCtx(e,i),Je(i,{code:Ue.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty()}else if(n.kind==="length"){let o=e.data.length>n.value,s=e.data.length<n.value;if(o||s){if(i=this._getOrReturnCtx(e,i),o)Je(i,{code:Ue.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message});else if(s)Je(i,{code:Ue.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message});r.dirty()}}else if(n.kind==="email"){if(!eO.test(e.data))i=this._getOrReturnCtx(e,i),Je(i,{validation:"email",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="emoji"){if(!Hv)Hv=new RegExp(tO,"u");if(!Hv.test(e.data))i=this._getOrReturnCtx(e,i),Je(i,{validation:"emoji",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="uuid"){if(!JC.test(e.data))i=this._getOrReturnCtx(e,i),Je(i,{validation:"uuid",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="nanoid"){if(!XC.test(e.data))i=this._getOrReturnCtx(e,i),Je(i,{validation:"nanoid",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="cuid"){if(!VC.test(e.data))i=this._getOrReturnCtx(e,i),Je(i,{validation:"cuid",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="cuid2"){if(!WC.test(e.data))i=this._getOrReturnCtx(e,i),Je(i,{validation:"cuid2",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="ulid"){if(!GC.test(e.data))i=this._getOrReturnCtx(e,i),Je(i,{validation:"ulid",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Je(i,{validation:"url",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="regex"){if(n.regex.lastIndex=0,!n.regex.test(e.data))i=this._getOrReturnCtx(e,i),Je(i,{validation:"regex",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="trim")e.data=e.data.trim();else if(n.kind==="includes"){if(!e.data.includes(n.value,n.position))i=this._getOrReturnCtx(e,i),Je(i,{code:Ue.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),r.dirty()}else if(n.kind==="toLowerCase")e.data=e.data.toLowerCase();else if(n.kind==="toUpperCase")e.data=e.data.toUpperCase();else if(n.kind==="startsWith"){if(!e.data.startsWith(n.value))i=this._getOrReturnCtx(e,i),Je(i,{code:Ue.invalid_string,validation:{startsWith:n.value},message:n.message}),r.dirty()}else if(n.kind==="endsWith"){if(!e.data.endsWith(n.value))i=this._getOrReturnCtx(e,i),Je(i,{code:Ue.invalid_string,validation:{endsWith:n.value},message:n.message}),r.dirty()}else if(n.kind==="datetime"){if(!cO(n).test(e.data))i=this._getOrReturnCtx(e,i),Je(i,{code:Ue.invalid_string,validation:"datetime",message:n.message}),r.dirty()}else if(n.kind==="date"){if(!uO.test(e.data))i=this._getOrReturnCtx(e,i),Je(i,{code:Ue.invalid_string,validation:"date",message:n.message}),r.dirty()}else if(n.kind==="time"){if(!lO(n).test(e.data))i=this._getOrReturnCtx(e,i),Je(i,{code:Ue.invalid_string,validation:"time",message:n.message}),r.dirty()}else if(n.kind==="duration"){if(!QC.test(e.data))i=this._getOrReturnCtx(e,i),Je(i,{validation:"duration",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="ip"){if(!dO(e.data,n.version))i=this._getOrReturnCtx(e,i),Je(i,{validation:"ip",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="jwt"){if(!fO(e.data,n.alg))i=this._getOrReturnCtx(e,i),Je(i,{validation:"jwt",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="cidr"){if(!hO(e.data,n.version))i=this._getOrReturnCtx(e,i),Je(i,{validation:"cidr",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="base64"){if(!sO.test(e.data))i=this._getOrReturnCtx(e,i),Je(i,{validation:"base64",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="base64url"){if(!aO.test(e.data))i=this._getOrReturnCtx(e,i),Je(i,{validation:"base64url",code:Ue.invalid_string,message:n.message}),r.dirty()}else wt.assertNever(n);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement((i)=>e.test(i),{validation:t,code:Ue.invalid_string,...et.errToObj(r)})}_addCheck(e){return new wi({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...et.errToObj(e)})}url(e){return this._addCheck({kind:"url",...et.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...et.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...et.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...et.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...et.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...et.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...et.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...et.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...et.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...et.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...et.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...et.errToObj(e)})}datetime(e){if(typeof e==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e});return this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...et.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){if(typeof e==="string")return this._addCheck({kind:"time",precision:null,message:e});return this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...et.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...et.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...et.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...et.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...et.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...et.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...et.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...et.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...et.errToObj(t)})}nonempty(e){return this.min(1,et.errToObj(e))}trim(){return new wi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new wi({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new wi({...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)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxLength(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}}wi.create=(e)=>new wi({checks:[],typeName:Le.ZodString,coerce:e?.coerce??!1,...ht(e)});function pO(e,t){let r=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,n=r>i?r:i,o=Number.parseInt(e.toFixed(n).replace(".","")),s=Number.parseInt(t.toFixed(n).replace(".",""));return o%s/10**n}class Ks extends bt{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);if(this._getType(e)!==Ze.number){let n=this._getOrReturnCtx(e);return Je(n,{code:Ue.invalid_type,expected:Ze.number,received:n.parsedType}),ot}let r=void 0,i=new qr;for(let n of this._def.checks)if(n.kind==="int"){if(!wt.isInteger(e.data))r=this._getOrReturnCtx(e,r),Je(r,{code:Ue.invalid_type,expected:"integer",received:"float",message:n.message}),i.dirty()}else if(n.kind==="min"){if(n.inclusive?e.data<n.value:e.data<=n.value)r=this._getOrReturnCtx(e,r),Je(r,{code:Ue.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()}else if(n.kind==="max"){if(n.inclusive?e.data>n.value:e.data>=n.value)r=this._getOrReturnCtx(e,r),Je(r,{code:Ue.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()}else if(n.kind==="multipleOf"){if(pO(e.data,n.value)!==0)r=this._getOrReturnCtx(e,r),Je(r,{code:Ue.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()}else if(n.kind==="finite"){if(!Number.isFinite(e.data))r=this._getOrReturnCtx(e,r),Je(r,{code:Ue.not_finite,message:n.message}),i.dirty()}else wt.assertNever(n);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,et.toString(t))}gt(e,t){return this.setLimit("min",e,!1,et.toString(t))}lte(e,t){return this.setLimit("max",e,!0,et.toString(t))}lt(e,t){return this.setLimit("max",e,!1,et.toString(t))}setLimit(e,t,r,i){return new Ks({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:et.toString(i)}]})}_addCheck(e){return new Ks({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:et.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:et.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:et.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:et.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:et.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:et.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:et.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:et.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:et.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxValue(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}get isInt(){return!!this._def.checks.find((e)=>e.kind==="int"||e.kind==="multipleOf"&&wt.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks)if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;else if(r.kind==="min"){if(t===null||r.value>t)t=r.value}else if(r.kind==="max"){if(e===null||r.value<e)e=r.value}return Number.isFinite(t)&&Number.isFinite(e)}}Ks.create=(e)=>new Ks({checks:[],typeName:Le.ZodNumber,coerce:e?.coerce||!1,...ht(e)});class Vs extends bt{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)!==Ze.bigint)return this._getInvalidInput(e);let r=void 0,i=new qr;for(let n of this._def.checks)if(n.kind==="min"){if(n.inclusive?e.data<n.value:e.data<=n.value)r=this._getOrReturnCtx(e,r),Je(r,{code:Ue.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()}else if(n.kind==="max"){if(n.inclusive?e.data>n.value:e.data>=n.value)r=this._getOrReturnCtx(e,r),Je(r,{code:Ue.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()}else if(n.kind==="multipleOf"){if(e.data%n.value!==BigInt(0))r=this._getOrReturnCtx(e,r),Je(r,{code:Ue.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()}else wt.assertNever(n);return{status:i.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return Je(t,{code:Ue.invalid_type,expected:Ze.bigint,received:t.parsedType}),ot}gte(e,t){return this.setLimit("min",e,!0,et.toString(t))}gt(e,t){return this.setLimit("min",e,!1,et.toString(t))}lte(e,t){return this.setLimit("max",e,!0,et.toString(t))}lt(e,t){return this.setLimit("max",e,!1,et.toString(t))}setLimit(e,t,r,i){return new Vs({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:et.toString(i)}]})}_addCheck(e){return new Vs({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:et.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:et.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:et.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:et.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:et.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxValue(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}}Vs.create=(e)=>new Vs({checks:[],typeName:Le.ZodBigInt,coerce:e?.coerce??!1,...ht(e)});class Nh extends bt{_parse(e){if(this._def.coerce)e.data=Boolean(e.data);if(this._getType(e)!==Ze.boolean){let r=this._getOrReturnCtx(e);return Je(r,{code:Ue.invalid_type,expected:Ze.boolean,received:r.parsedType}),ot}return Wr(e.data)}}Nh.create=(e)=>new Nh({typeName:Le.ZodBoolean,coerce:e?.coerce||!1,...ht(e)});class Nl extends bt{_parse(e){if(this._def.coerce)e.data=new Date(e.data);if(this._getType(e)!==Ze.date){let n=this._getOrReturnCtx(e);return Je(n,{code:Ue.invalid_type,expected:Ze.date,received:n.parsedType}),ot}if(Number.isNaN(e.data.getTime())){let n=this._getOrReturnCtx(e);return Je(n,{code:Ue.invalid_date}),ot}let r=new qr,i=void 0;for(let n of this._def.checks)if(n.kind==="min"){if(e.data.getTime()<n.value)i=this._getOrReturnCtx(e,i),Je(i,{code:Ue.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),r.dirty()}else if(n.kind==="max"){if(e.data.getTime()>n.value)i=this._getOrReturnCtx(e,i),Je(i,{code:Ue.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),r.dirty()}else wt.assertNever(n);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Nl({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:et.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:et.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(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)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e!=null?new Date(e):null}}Nl.create=(e)=>new Nl({checks:[],coerce:e?.coerce||!1,typeName:Le.ZodDate,...ht(e)});class zh extends bt{_parse(e){if(this._getType(e)!==Ze.symbol){let r=this._getOrReturnCtx(e);return Je(r,{code:Ue.invalid_type,expected:Ze.symbol,received:r.parsedType}),ot}return Wr(e.data)}}zh.create=(e)=>new zh({typeName:Le.ZodSymbol,...ht(e)});class zl extends bt{_parse(e){if(this._getType(e)!==Ze.undefined){let r=this._getOrReturnCtx(e);return Je(r,{code:Ue.invalid_type,expected:Ze.undefined,received:r.parsedType}),ot}return Wr(e.data)}}zl.create=(e)=>new zl({typeName:Le.ZodUndefined,...ht(e)});class jl extends bt{_parse(e){if(this._getType(e)!==Ze.null){let r=this._getOrReturnCtx(e);return Je(r,{code:Ue.invalid_type,expected:Ze.null,received:r.parsedType}),ot}return Wr(e.data)}}jl.create=(e)=>new jl({typeName:Le.ZodNull,...ht(e)});class jh extends bt{constructor(){super(...arguments);this._any=!0}_parse(e){return Wr(e.data)}}jh.create=(e)=>new jh({typeName:Le.ZodAny,...ht(e)});class qo extends bt{constructor(){super(...arguments);this._unknown=!0}_parse(e){return Wr(e.data)}}qo.create=(e)=>new qo({typeName:Le.ZodUnknown,...ht(e)});class Si extends bt{_parse(e){let t=this._getOrReturnCtx(e);return Je(t,{code:Ue.invalid_type,expected:Ze.never,received:t.parsedType}),ot}}Si.create=(e)=>new Si({typeName:Le.ZodNever,...ht(e)});class Uh extends bt{_parse(e){if(this._getType(e)!==Ze.undefined){let r=this._getOrReturnCtx(e);return Je(r,{code:Ue.invalid_type,expected:Ze.void,received:r.parsedType}),ot}return Wr(e.data)}}Uh.create=(e)=>new Uh({typeName:Le.ZodVoid,...ht(e)});class Qn extends bt{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),i=this._def;if(t.parsedType!==Ze.array)return Je(t,{code:Ue.invalid_type,expected:Ze.array,received:t.parsedType}),ot;if(i.exactLength!==null){let o=t.data.length>i.exactLength.value,s=t.data.length<i.exactLength.value;if(o||s)Je(t,{code:o?Ue.too_big:Ue.too_small,minimum:s?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty()}if(i.minLength!==null){if(t.data.length<i.minLength.value)Je(t,{code:Ue.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()}if(i.maxLength!==null){if(t.data.length>i.maxLength.value)Je(t,{code:Ue.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()}if(t.common.async)return Promise.all([...t.data].map((o,s)=>i.type._parseAsync(new Un(t,o,t.path,s)))).then((o)=>qr.mergeArray(r,o));let n=[...t.data].map((o,s)=>i.type._parseSync(new Un(t,o,t.path,s)));return qr.mergeArray(r,n)}get element(){return this._def.type}min(e,t){return new Qn({...this._def,minLength:{value:e,message:et.toString(t)}})}max(e,t){return new Qn({...this._def,maxLength:{value:e,message:et.toString(t)}})}length(e,t){return new Qn({...this._def,exactLength:{value:e,message:et.toString(t)}})}nonempty(e){return this.min(1,e)}}Qn.create=(e,t)=>new Qn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Le.ZodArray,...ht(t)});function Zs(e){if(e instanceof er){let t={};for(let r in e.shape){let i=e.shape[r];t[r]=$n.create(Zs(i))}return new er({...e._def,shape:()=>t})}else if(e instanceof Qn)return new Qn({...e._def,type:Zs(e.element)});else if(e instanceof $n)return $n.create(Zs(e.unwrap()));else if(e instanceof Xi)return Xi.create(Zs(e.unwrap()));else if(e instanceof xi)return xi.create(e.items.map((t)=>Zs(t)));else return e}class er extends bt{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=wt.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==Ze.object){let v=this._getOrReturnCtx(e);return Je(v,{code:Ue.invalid_type,expected:Ze.object,received:v.parsedType}),ot}let{status:r,ctx:i}=this._processInputParams(e),{shape:n,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof Si&&this._def.unknownKeys==="strip")){for(let v in i.data)if(!o.includes(v))s.push(v)}let h=[];for(let v of o){let b=n[v],_=i.data[v];h.push({key:{status:"valid",value:v},value:b._parse(new Un(i,_,i.path,v)),alwaysSet:v in i.data})}if(this._def.catchall instanceof Si){let v=this._def.unknownKeys;if(v==="passthrough")for(let b of s)h.push({key:{status:"valid",value:b},value:{status:"valid",value:i.data[b]}});else if(v==="strict"){if(s.length>0)Je(i,{code:Ue.unrecognized_keys,keys:s}),r.dirty()}else if(v==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let v=this._def.catchall;for(let b of s){let _=i.data[b];h.push({key:{status:"valid",value:b},value:v._parse(new Un(i,_,i.path,b)),alwaysSet:b in i.data})}}if(i.common.async)return Promise.resolve().then(async()=>{let v=[];for(let b of h){let _=await b.key,g=await b.value;v.push({key:_,value:g,alwaysSet:b.alwaysSet})}return v}).then((v)=>qr.mergeObjectSync(r,v));else return qr.mergeObjectSync(r,h)}get shape(){return this._def.shape()}strict(e){return et.errToObj,new er({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{let i=this._def.errorMap?.(t,r).message??r.defaultError;if(t.code==="unrecognized_keys")return{message:et.errToObj(e).message??i};return{message:i}}}:{}})}strip(){return new er({...this._def,unknownKeys:"strip"})}passthrough(){return new er({...this._def,unknownKeys:"passthrough"})}extend(e){return new er({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new er({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Le.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new er({...this._def,catchall:e})}pick(e){let t={};for(let r of wt.objectKeys(e))if(e[r]&&this.shape[r])t[r]=this.shape[r];return new er({...this._def,shape:()=>t})}omit(e){let t={};for(let r of wt.objectKeys(this.shape))if(!e[r])t[r]=this.shape[r];return new er({...this._def,shape:()=>t})}deepPartial(){return Zs(this)}partial(e){let t={};for(let r of wt.objectKeys(this.shape)){let i=this.shape[r];if(e&&!e[r])t[r]=i;else t[r]=i.optional()}return new er({...this._def,shape:()=>t})}required(e){let t={};for(let r of wt.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let n=this.shape[r];while(n instanceof $n)n=n._def.innerType;t[r]=n}return new er({...this._def,shape:()=>t})}keyof(){return h6(wt.objectKeys(this.shape))}}er.create=(e,t)=>new er({shape:()=>e,unknownKeys:"strip",catchall:Si.create(),typeName:Le.ZodObject,...ht(t)});er.strictCreate=(e,t)=>new er({shape:()=>e,unknownKeys:"strict",catchall:Si.create(),typeName:Le.ZodObject,...ht(t)});er.lazycreate=(e,t)=>new er({shape:e,unknownKeys:"strip",catchall:Si.create(),typeName:Le.ZodObject,...ht(t)});class Ul extends bt{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;function i(n){for(let s of n)if(s.result.status==="valid")return s.result;for(let s of n)if(s.result.status==="dirty")return t.common.issues.push(...s.ctx.common.issues),s.result;let o=n.map((s)=>new bn(s.ctx.common.issues));return Je(t,{code:Ue.invalid_union,unionErrors:o}),ot}if(t.common.async)return Promise.all(r.map(async(n)=>{let o={...t,common:{...t.common,issues:[]},parent:null};return{result:await n._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(i);else{let n=void 0,o=[];for(let h of r){let v={...t,common:{...t.common,issues:[]},parent:null},b=h._parseSync({data:t.data,path:t.path,parent:v});if(b.status==="valid")return b;else if(b.status==="dirty"&&!n)n={result:b,ctx:v};if(v.common.issues.length)o.push(v.common.issues)}if(n)return t.common.issues.push(...n.ctx.common.issues),n.result;let s=o.map((h)=>new bn(h));return Je(t,{code:Ue.invalid_union,unionErrors:s}),ot}}get options(){return this._def.options}}Ul.create=(e,t)=>new Ul({options:e,typeName:Le.ZodUnion,...ht(t)});var _i=(e)=>{if(e instanceof Fl)return _i(e.schema);else if(e instanceof ei)return _i(e.innerType());else if(e instanceof ql)return[e.value];else if(e instanceof Bo)return e.options;else if(e instanceof Bl)return wt.objectValues(e.enum);else if(e instanceof Hl)return _i(e._def.innerType);else if(e instanceof zl)return[void 0];else if(e instanceof jl)return[null];else if(e instanceof $n)return[void 0,..._i(e.unwrap())];else if(e instanceof Xi)return[null,..._i(e.unwrap())];else if(e instanceof Vv)return _i(e.unwrap());else if(e instanceof Kl)return _i(e.unwrap());else if(e instanceof Zl)return _i(e._def.innerType);else return[]};class Kv extends bt{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Ze.object)return Je(t,{code:Ue.invalid_type,expected:Ze.object,received:t.parsedType}),ot;let r=this.discriminator,i=t.data[r],n=this.optionsMap.get(i);if(!n)return Je(t,{code:Ue.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),ot;if(t.common.async)return n._parseAsync({data:t.data,path:t.path,parent:t});else return n._parseSync({data:t.data,path:t.path,parent:t})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let i=new Map;for(let n of t){let o=_i(n.shape[e]);if(!o.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of o){if(i.has(s))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);i.set(s,n)}}return new Kv({typeName:Le.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...ht(r)})}}function Zv(e,t){let r=bi(e),i=bi(t);if(e===t)return{valid:!0,data:e};else if(r===Ze.object&&i===Ze.object){let n=wt.objectKeys(t),o=wt.objectKeys(e).filter((h)=>n.indexOf(h)!==-1),s={...e,...t};for(let h of o){let v=Zv(e[h],t[h]);if(!v.valid)return{valid:!1};s[h]=v.data}return{valid:!0,data:s}}else if(r===Ze.array&&i===Ze.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let o=0;o<e.length;o++){let s=e[o],h=t[o],v=Zv(s,h);if(!v.valid)return{valid:!1};n.push(v.data)}return{valid:!0,data:n}}else if(r===Ze.date&&i===Ze.date&&+e===+t)return{valid:!0,data:e};else return{valid:!1}}class Ll extends bt{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),i=(n,o)=>{if(qv(n)||qv(o))return ot;let s=Zv(n.value,o.value);if(!s.valid)return Je(r,{code:Ue.invalid_intersection_types}),ot;if(Bv(n)||Bv(o))t.dirty();return{status:t.value,value:s.data}};if(r.common.async)return Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([n,o])=>i(n,o));else return i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Ll.create=(e,t,r)=>new Ll({left:e,right:t,typeName:Le.ZodIntersection,...ht(r)});class xi extends bt{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ze.array)return Je(r,{code:Ue.invalid_type,expected:Ze.array,received:r.parsedType}),ot;if(r.data.length<this._def.items.length)return Je(r,{code:Ue.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ot;if(!this._def.rest&&r.data.length>this._def.items.length)Je(r,{code:Ue.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty();let n=[...r.data].map((o,s)=>{let h=this._def.items[s]||this._def.rest;if(!h)return null;return h._parse(new Un(r,o,r.path,s))}).filter((o)=>!!o);if(r.common.async)return Promise.all(n).then((o)=>qr.mergeArray(t,o));else return qr.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new xi({...this._def,rest:e})}}xi.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new xi({items:e,typeName:Le.ZodTuple,rest:null,...ht(t)})};class Lh extends bt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ze.object)return Je(r,{code:Ue.invalid_type,expected:Ze.object,received:r.parsedType}),ot;let i=[],n=this._def.keyType,o=this._def.valueType;for(let s in r.data)i.push({key:n._parse(new Un(r,s,r.path,s)),value:o._parse(new Un(r,r.data[s],r.path,s)),alwaysSet:s in r.data});if(r.common.async)return qr.mergeObjectAsync(t,i);else return qr.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,r){if(t instanceof bt)return new Lh({keyType:e,valueType:t,typeName:Le.ZodRecord,...ht(r)});return new Lh({keyType:wi.create(),valueType:e,typeName:Le.ZodRecord,...ht(t)})}}class Fh extends bt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ze.map)return Je(r,{code:Ue.invalid_type,expected:Ze.map,received:r.parsedType}),ot;let i=this._def.keyType,n=this._def.valueType,o=[...r.data.entries()].map(([s,h],v)=>({key:i._parse(new Un(r,s,r.path,[v,"key"])),value:n._parse(new Un(r,h,r.path,[v,"value"]))}));if(r.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let h of o){let v=await h.key,b=await h.value;if(v.status==="aborted"||b.status==="aborted")return ot;if(v.status==="dirty"||b.status==="dirty")t.dirty();s.set(v.value,b.value)}return{status:t.value,value:s}})}else{let s=new Map;for(let h of o){let{key:v,value:b}=h;if(v.status==="aborted"||b.status==="aborted")return ot;if(v.status==="dirty"||b.status==="dirty")t.dirty();s.set(v.value,b.value)}return{status:t.value,value:s}}}}Fh.create=(e,t,r)=>new Fh({valueType:t,keyType:e,typeName:Le.ZodMap,...ht(r)});class Ws extends bt{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ze.set)return Je(r,{code:Ue.invalid_type,expected:Ze.set,received:r.parsedType}),ot;let i=this._def;if(i.minSize!==null){if(r.data.size<i.minSize.value)Je(r,{code:Ue.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),t.dirty()}if(i.maxSize!==null){if(r.data.size>i.maxSize.value)Je(r,{code:Ue.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty()}let n=this._def.valueType;function o(h){let v=new Set;for(let b of h){if(b.status==="aborted")return ot;if(b.status==="dirty")t.dirty();v.add(b.value)}return{status:t.value,value:v}}let s=[...r.data.values()].map((h,v)=>n._parse(new Un(r,h,r.path,v)));if(r.common.async)return Promise.all(s).then((h)=>o(h));else return o(s)}min(e,t){return new Ws({...this._def,minSize:{value:e,message:et.toString(t)}})}max(e,t){return new Ws({...this._def,maxSize:{value:e,message:et.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Ws.create=(e,t)=>new Ws({valueType:e,minSize:null,maxSize:null,typeName:Le.ZodSet,...ht(t)});class Dl extends bt{constructor(){super(...arguments);this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Ze.function)return Je(t,{code:Ue.invalid_type,expected:Ze.function,received:t.parsedType}),ot;function r(s,h){return Dh({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Cl(),Ji].filter((v)=>!!v),issueData:{code:Ue.invalid_arguments,argumentsError:h}})}function i(s,h){return Dh({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Cl(),Ji].filter((v)=>!!v),issueData:{code:Ue.invalid_return_type,returnTypeError:h}})}let n={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof Gs){let s=this;return Wr(async function(...h){let v=new bn([]),b=await s._def.args.parseAsync(h,n).catch((S)=>{throw v.addIssue(r(h,S)),v}),_=await Reflect.apply(o,this,b);return await s._def.returns._def.type.parseAsync(_,n).catch((S)=>{throw v.addIssue(i(_,S)),v})})}else{let s=this;return Wr(function(...h){let v=s._def.args.safeParse(h,n);if(!v.success)throw new bn([r(h,v.error)]);let b=Reflect.apply(o,this,v.data),_=s._def.returns.safeParse(b,n);if(!_.success)throw new bn([i(b,_.error)]);return _.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Dl({...this._def,args:xi.create(e).rest(qo.create())})}returns(e){return new Dl({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new Dl({args:e?e:xi.create([]).rest(qo.create()),returns:t||qo.create(),typeName:Le.ZodFunction,...ht(r)})}}class Fl extends bt{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})}}Fl.create=(e,t)=>new Fl({getter:e,typeName:Le.ZodLazy,...ht(t)});class ql extends bt{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return Je(t,{received:t.data,code:Ue.invalid_literal,expected:this._def.value}),ot}return{status:"valid",value:e.data}}get value(){return this._def.value}}ql.create=(e,t)=>new ql({value:e,typeName:Le.ZodLiteral,...ht(t)});function h6(e,t){return new Bo({values:e,typeName:Le.ZodEnum,...ht(t)})}class Bo extends bt{_parse(e){if(typeof e.data!=="string"){let t=this._getOrReturnCtx(e),r=this._def.values;return Je(t,{expected:wt.joinValues(r),received:t.parsedType,code:Ue.invalid_type}),ot}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),r=this._def.values;return Je(t,{received:t.data,code:Ue.invalid_enum_value,options:r}),ot}return Wr(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 Bo.create(e,{...this._def,...t})}exclude(e,t=this._def){return Bo.create(this.options.filter((r)=>!e.includes(r)),{...this._def,...t})}}Bo.create=h6;class Bl extends bt{_parse(e){let t=wt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Ze.string&&r.parsedType!==Ze.number){let i=wt.objectValues(t);return Je(r,{expected:wt.joinValues(i),received:r.parsedType,code:Ue.invalid_type}),ot}if(!this._cache)this._cache=new Set(wt.getValidEnumValues(this._def.values));if(!this._cache.has(e.data)){let i=wt.objectValues(t);return Je(r,{received:r.data,code:Ue.invalid_enum_value,options:i}),ot}return Wr(e.data)}get enum(){return this._def.values}}Bl.create=(e,t)=>new Bl({values:e,typeName:Le.ZodNativeEnum,...ht(t)});class Gs extends bt{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Ze.promise&&t.common.async===!1)return Je(t,{code:Ue.invalid_type,expected:Ze.promise,received:t.parsedType}),ot;let r=t.parsedType===Ze.promise?t.data:Promise.resolve(t.data);return Wr(r.then((i)=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Gs.create=(e,t)=>new Gs({type:e,typeName:Le.ZodPromise,...ht(t)});class ei extends bt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Le.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),i=this._def.effect||null,n={addIssue:(o)=>{if(Je(r,o),o.fatal)t.abort();else t.dirty()},get path(){return r.path}};if(n.addIssue=n.addIssue.bind(n),i.type==="preprocess"){let o=i.transform(r.data,n);if(r.common.async)return Promise.resolve(o).then(async(s)=>{if(t.value==="aborted")return ot;let h=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});if(h.status==="aborted")return ot;if(h.status==="dirty")return Hs(h.value);if(t.value==="dirty")return Hs(h.value);return h});else{if(t.value==="aborted")return ot;let s=this._def.schema._parseSync({data:o,path:r.path,parent:r});if(s.status==="aborted")return ot;if(s.status==="dirty")return Hs(s.value);if(t.value==="dirty")return Hs(s.value);return s}}if(i.type==="refinement"){let o=(s)=>{let h=i.refinement(s,n);if(r.common.async)return Promise.resolve(h);if(h instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(s.status==="aborted")return ot;if(s.status==="dirty")t.dirty();return o(s.value),{status:t.value,value:s.value}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((s)=>{if(s.status==="aborted")return ot;if(s.status==="dirty")t.dirty();return o(s.value).then(()=>({status:t.value,value:s.value}))})}if(i.type==="transform")if(r.common.async===!1){let o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Fo(o))return ot;let s=i.transform(o.value,n);if(s instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((o)=>{if(!Fo(o))return ot;return Promise.resolve(i.transform(o.value,n)).then((s)=>({status:t.value,value:s}))});wt.assertNever(i)}}ei.create=(e,t,r)=>new ei({schema:e,typeName:Le.ZodEffects,effect:t,...ht(r)});ei.createWithPreprocess=(e,t,r)=>new ei({schema:t,effect:{type:"preprocess",transform:e},typeName:Le.ZodEffects,...ht(r)});class $n extends bt{_parse(e){if(this._getType(e)===Ze.undefined)return Wr(void 0);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}$n.create=(e,t)=>new $n({innerType:e,typeName:Le.ZodOptional,...ht(t)});class Xi extends bt{_parse(e){if(this._getType(e)===Ze.null)return Wr(null);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Xi.create=(e,t)=>new Xi({innerType:e,typeName:Le.ZodNullable,...ht(t)});class Hl extends bt{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;if(t.parsedType===Ze.undefined)r=this._def.defaultValue();return this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Hl.create=(e,t)=>new Hl({innerType:e,typeName:Le.ZodDefault,defaultValue:typeof t.default==="function"?t.default:()=>t.default,...ht(t)});class Zl extends bt{_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});if(Ol(i))return i.then((n)=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new bn(r.common.issues)},input:r.data})}));else return{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new bn(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Zl.create=(e,t)=>new Zl({innerType:e,typeName:Le.ZodCatch,catchValue:typeof t.catch==="function"?t.catch:()=>t.catch,...ht(t)});class qh extends bt{_parse(e){if(this._getType(e)!==Ze.nan){let r=this._getOrReturnCtx(e);return Je(r,{code:Ue.invalid_type,expected:Ze.nan,received:r.parsedType}),ot}return{status:"valid",value:e.data}}}qh.create=(e)=>new qh({typeName:Le.ZodNaN,...ht(e)});var Kme=Symbol("zod_brand");class Vv extends bt{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class Bh extends bt{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let n=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});if(n.status==="aborted")return ot;if(n.status==="dirty")return t.dirty(),Hs(n.value);else return this._def.out._parseAsync({data:n.value,path:r.path,parent:r})})();else{let i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});if(i.status==="aborted")return ot;if(i.status==="dirty")return t.dirty(),{status:"dirty",value:i.value};else return this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,t){return new Bh({in:e,out:t,typeName:Le.ZodPipeline})}}class Kl extends bt{_parse(e){let t=this._def.innerType._parse(e),r=(i)=>{if(Fo(i))i.value=Object.freeze(i.value);return i};return Ol(t)?t.then((i)=>r(i)):r(t)}unwrap(){return this._def.innerType}}Kl.create=(e,t)=>new Kl({innerType:e,typeName:Le.ZodReadonly,...ht(t)});var Vme={object:er.lazycreate},Le;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Le||(Le={}));var Wme=wi.create,Gme=Ks.create,Jme=qh.create,Xme=Vs.create,Yme=Nh.create,Qme=Nl.create,e0e=zh.create,t0e=zl.create,r0e=jl.create,n0e=jh.create,i0e=qo.create,o0e=Si.create,s0e=Uh.create,a0e=Qn.create,p6=er.create,u0e=er.strictCreate,l0e=Ul.create,c0e=Kv.create,d0e=Ll.create,f0e=xi.create,h0e=Lh.create,p0e=Fh.create,m0e=Ws.create,g0e=Dl.create,y0e=Fl.create,v0e=ql.create,b0e=Bo.create,_0e=Bl.create,w0e=Gs.create,S0e=ei.create,x0e=$n.create,k0e=Xi.create,M0e=ei.createWithPreprocess,E0e=Bh.create;var gO=ne("ZodMiniType",(e,t)=>{if(!e._zod)throw Error("Uninitialized schema in ZodMiniType.");ut.init(e,t),e.def=t,e.parse=(r,i)=>wo(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>Ui(e,r,i),e.parseAsync=async(r,i)=>So(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>Li(e,r,i),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map((i)=>typeof i==="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),e.clone=(r,i)=>Ur(e,r,i),e.brand=()=>e,e.register=(r,i)=>(r.add(e,i),e)});var yO=ne("ZodMiniObject",(e,t)=>{Ba.init(e,t),gO.init(e,t),Be.defineLazy(e,"shape",()=>t.shape)});function Wv(e,t){let r={type:"object",get shape(){return Be.assignProp(this,"shape",{...e}),this.shape},...Be.normalizeParams(t)};return new yO(r)}function Tn(e){return!!e._zod}function Ho(e){let t=Object.values(e);if(t.length===0)return Wv({});let r=t.every(Tn),i=t.every((n)=>!Tn(n));if(r)return Wv(e);if(i)return p6(e);throw Error("Mixed Zod versions detected in object shape.")}function Yi(e,t){if(Tn(e))return Ui(e,t);return e.safeParse(t)}async function Hh(e,t){if(Tn(e))return await Li(e,t);return await e.safeParseAsync(t)}function Qi(e){if(!e)return;let t;if(Tn(e))t=e._zod?.def?.shape;else t=e.shape;if(!t)return;if(typeof t==="function")try{return t()}catch{return}return t}function Js(e){if(!e)return;if(typeof e==="object"){let t=e,r=e;if(!t._def&&!r._zod){let i=Object.values(e);if(i.length>0&&i.every((n)=>typeof n==="object"&&n!==null&&(n._def!==void 0||n._zod!==void 0||typeof n.parse==="function")))return Ho(e)}}if(Tn(e)){let r=e._zod?.def;if(r&&(r.type==="object"||r.shape!==void 0))return e}else if(e.shape!==void 0)return e;return}function Zh(e){if(e&&typeof e==="object"){if("message"in e&&typeof e.message==="string")return e.message;if("issues"in e&&Array.isArray(e.issues)&&e.issues.length>0){let t=e.issues[0];if(t&&typeof t==="object"&&"message"in t)return String(t.message)}try{return JSON.stringify(e)}catch{return String(e)}}return String(e)}function m6(e){return e.description}function g6(e){if(Tn(e))return e._zod?.def?.type==="optional";let t=e;if(typeof e.isOptional==="function")return e.isOptional();return t._def?.typeName==="ZodOptional"}function Kh(e){if(Tn(e)){let o=e._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}let r=e._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let i=e.value;if(i!==void 0)return i;return}var Gv="2025-11-25";var y6=[Gv,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],eo="io.modelcontextprotocol/related-task",Wh="2.0",xr=Fy((e)=>e!==null&&(typeof e==="object"||typeof e==="function")),v6=Dt([de(),It().int()]),b6=de(),F0e=Lr({ttl:It().optional(),pollInterval:It().optional()}),bO=Qe({ttl:It().optional()}),_O=Qe({taskId:de()}),Jv=Lr({progressToken:v6.optional(),[eo]:_O.optional()}),_n=Qe({_meta:Jv.optional()}),Vl=_n.extend({task:bO.optional()}),_6=(e)=>Vl.safeParse(e).success,Or=Qe({method:de(),params:_n.loose().optional()}),Pn=Qe({_meta:Jv.optional()}),An=Qe({method:de(),params:Pn.loose().optional()}),Dr=Lr({_meta:Jv.optional()}),Gh=Dt([de(),It().int()]),w6=Qe({jsonrpc:tt(Wh),id:Gh,...Or.shape}).strict(),Xv=(e)=>w6.safeParse(e).success,S6=Qe({jsonrpc:tt(Wh),...An.shape}).strict(),x6=(e)=>S6.safeParse(e).success,Yv=Qe({jsonrpc:tt(Wh),id:Gh,result:Dr}).strict(),Wl=(e)=>Yv.safeParse(e).success;var it;(function(e){e[e.ConnectionClosed=-32000]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(it||(it={}));var Qv=Qe({jsonrpc:tt(Wh),id:Gh.optional(),error:Qe({code:It().int(),message:de(),data:qt().optional()})}).strict();var k6=(e)=>Qv.safeParse(e).success;var q0e=Dt([w6,S6,Yv,Qv]),B0e=Dt([Yv,Qv]),Jh=Dr.strict(),wO=Pn.extend({requestId:Gh.optional(),reason:de().optional()}),Xh=An.extend({method:tt("notifications/cancelled"),params:wO}),SO=Qe({src:de(),mimeType:de().optional(),sizes:_t(de()).optional(),theme:Vr(["light","dark"]).optional()}),Gl=Qe({icons:_t(SO).optional()}),Xs=Qe({name:de(),title:de().optional()}),M6=Xs.extend({...Xs.shape,...Gl.shape,version:de(),websiteUrl:de().optional(),description:de().optional()}),xO=Cu(Qe({applyDefaults:or().optional()}),Nt(de(),qt())),kO=Gf((e)=>{if(e&&typeof e==="object"&&!Array.isArray(e)){if(Object.keys(e).length===0)return{form:{}}}return e},Cu(Qe({form:xO.optional(),url:xr.optional()}),Nt(de(),qt()).optional())),MO=Lr({list:xr.optional(),cancel:xr.optional(),requests:Lr({sampling:Lr({createMessage:xr.optional()}).optional(),elicitation:Lr({create:xr.optional()}).optional()}).optional()}),EO=Lr({list:xr.optional(),cancel:xr.optional(),requests:Lr({tools:Lr({call:xr.optional()}).optional()}).optional()}),IO=Qe({experimental:Nt(de(),xr).optional(),sampling:Qe({context:xr.optional(),tools:xr.optional()}).optional(),elicitation:kO.optional(),roots:Qe({listChanged:or().optional()}).optional(),tasks:MO.optional(),extensions:Nt(de(),xr).optional()}),$O=_n.extend({protocolVersion:de(),capabilities:IO,clientInfo:M6}),eb=Or.extend({method:tt("initialize"),params:$O});var TO=Qe({experimental:Nt(de(),xr).optional(),logging:xr.optional(),completions:xr.optional(),prompts:Qe({listChanged:or().optional()}).optional(),resources:Qe({subscribe:or().optional(),listChanged:or().optional()}).optional(),tools:Qe({listChanged:or().optional()}).optional(),tasks:EO.optional(),extensions:Nt(de(),xr).optional()}),PO=Dr.extend({protocolVersion:de(),capabilities:TO,serverInfo:M6,instructions:de().optional()}),tb=An.extend({method:tt("notifications/initialized"),params:Pn.optional()});var Yh=Or.extend({method:tt("ping"),params:_n.optional()}),AO=Qe({progress:It(),total:Lt(It()),message:Lt(de())}),RO=Qe({...Pn.shape,...AO.shape,progressToken:v6}),Qh=An.extend({method:tt("notifications/progress"),params:RO}),CO=_n.extend({cursor:b6.optional()}),Jl=Or.extend({params:CO.optional()}),Xl=Dr.extend({nextCursor:b6.optional()}),OO=Vr(["working","input_required","completed","failed","cancelled"]),Yl=Qe({taskId:de(),status:OO,ttl:Dt([It(),Bf()]),createdAt:de(),lastUpdatedAt:de(),pollInterval:Lt(It()),statusMessage:Lt(de())}),Ys=Dr.extend({task:Yl}),DO=Pn.merge(Yl),Ql=An.extend({method:tt("notifications/tasks/status"),params:DO}),ep=Or.extend({method:tt("tasks/get"),params:_n.extend({taskId:de()})}),tp=Dr.merge(Yl),rp=Or.extend({method:tt("tasks/result"),params:_n.extend({taskId:de()})}),H0e=Dr.loose(),np=Jl.extend({method:tt("tasks/list")}),ip=Xl.extend({tasks:_t(Yl)}),op=Or.extend({method:tt("tasks/cancel"),params:_n.extend({taskId:de()})}),E6=Dr.merge(Yl),I6=Qe({uri:de(),mimeType:Lt(de()),_meta:Nt(de(),qt()).optional()}),$6=I6.extend({text:de()}),rb=de().refine((e)=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),T6=I6.extend({blob:rb}),ec=Vr(["user","assistant"]),Qs=Qe({audience:_t(ec).optional(),priority:It().min(0).max(1).optional(),lastModified:ks.datetime({offset:!0}).optional()}),P6=Qe({...Xs.shape,...Gl.shape,uri:de(),description:Lt(de()),mimeType:Lt(de()),size:Lt(It()),annotations:Qs.optional(),_meta:Lt(Lr({}))}),NO=Qe({...Xs.shape,...Gl.shape,uriTemplate:de(),description:Lt(de()),mimeType:Lt(de()),annotations:Qs.optional(),_meta:Lt(Lr({}))}),sp=Jl.extend({method:tt("resources/list")}),zO=Xl.extend({resources:_t(P6)}),ap=Jl.extend({method:tt("resources/templates/list")}),jO=Xl.extend({resourceTemplates:_t(NO)}),nb=_n.extend({uri:de()}),UO=nb,up=Or.extend({method:tt("resources/read"),params:UO}),LO=Dr.extend({contents:_t(Dt([$6,T6]))}),FO=An.extend({method:tt("notifications/resources/list_changed"),params:Pn.optional()}),qO=nb,BO=Or.extend({method:tt("resources/subscribe"),params:qO}),HO=nb,ZO=Or.extend({method:tt("resources/unsubscribe"),params:HO}),KO=Pn.extend({uri:de()}),VO=An.extend({method:tt("notifications/resources/updated"),params:KO}),WO=Qe({name:de(),description:Lt(de()),required:Lt(or())}),GO=Qe({...Xs.shape,...Gl.shape,description:Lt(de()),arguments:Lt(_t(WO)),_meta:Lt(Lr({}))}),lp=Jl.extend({method:tt("prompts/list")}),JO=Xl.extend({prompts:_t(GO)}),XO=_n.extend({name:de(),arguments:Nt(de(),de()).optional()}),cp=Or.extend({method:tt("prompts/get"),params:XO}),ib=Qe({type:tt("text"),text:de(),annotations:Qs.optional(),_meta:Nt(de(),qt()).optional()}),ob=Qe({type:tt("image"),data:rb,mimeType:de(),annotations:Qs.optional(),_meta:Nt(de(),qt()).optional()}),sb=Qe({type:tt("audio"),data:rb,mimeType:de(),annotations:Qs.optional(),_meta:Nt(de(),qt()).optional()}),YO=Qe({type:tt("tool_use"),name:de(),id:de(),input:Nt(de(),qt()),_meta:Nt(de(),qt()).optional()}),QO=Qe({type:tt("resource"),resource:Dt([$6,T6]),annotations:Qs.optional(),_meta:Nt(de(),qt()).optional()}),eD=P6.extend({type:tt("resource_link")}),ab=Dt([ib,ob,sb,eD,QO]),tD=Qe({role:ec,content:ab}),rD=Dr.extend({description:de().optional(),messages:_t(tD)}),nD=An.extend({method:tt("notifications/prompts/list_changed"),params:Pn.optional()}),iD=Qe({title:de().optional(),readOnlyHint:or().optional(),destructiveHint:or().optional(),idempotentHint:or().optional(),openWorldHint:or().optional()}),oD=Qe({taskSupport:Vr(["required","optional","forbidden"]).optional()}),A6=Qe({...Xs.shape,...Gl.shape,description:de().optional(),inputSchema:Qe({type:tt("object"),properties:Nt(de(),xr).optional(),required:_t(de()).optional()}).catchall(qt()),outputSchema:Qe({type:tt("object"),properties:Nt(de(),xr).optional(),required:_t(de()).optional()}).catchall(qt()).optional(),annotations:iD.optional(),execution:oD.optional(),_meta:Nt(de(),qt()).optional()}),dp=Jl.extend({method:tt("tools/list")}),sD=Xl.extend({tools:_t(A6)}),fp=Dr.extend({content:_t(ab).default([]),structuredContent:Nt(de(),qt()).optional(),isError:or().optional()}),Z0e=fp.or(Dr.extend({toolResult:qt()})),aD=Vl.extend({name:de(),arguments:Nt(de(),qt()).optional()}),ea=Or.extend({method:tt("tools/call"),params:aD}),uD=An.extend({method:tt("notifications/tools/list_changed"),params:Pn.optional()}),K0e=Qe({autoRefresh:or().default(!0),debounceMs:It().int().nonnegative().default(300)}),tc=Vr(["debug","info","notice","warning","error","critical","alert","emergency"]),lD=_n.extend({level:tc}),ub=Or.extend({method:tt("logging/setLevel"),params:lD}),cD=Pn.extend({level:tc,logger:de().optional(),data:qt()}),dD=An.extend({method:tt("notifications/message"),params:cD}),fD=Qe({name:de().optional()}),hD=Qe({hints:_t(fD).optional(),costPriority:It().min(0).max(1).optional(),speedPriority:It().min(0).max(1).optional(),intelligencePriority:It().min(0).max(1).optional()}),pD=Qe({mode:Vr(["auto","required","none"]).optional()}),mD=Qe({type:tt("tool_result"),toolUseId:de().describe("The unique identifier for the corresponding tool call."),content:_t(ab).default([]),structuredContent:Qe({}).loose().optional(),isError:or().optional(),_meta:Nt(de(),qt()).optional()}),gD=Vf("type",[ib,ob,sb]),Vh=Vf("type",[ib,ob,sb,YO,mD]),yD=Qe({role:ec,content:Dt([Vh,_t(Vh)]),_meta:Nt(de(),qt()).optional()}),vD=Vl.extend({messages:_t(yD),modelPreferences:hD.optional(),systemPrompt:de().optional(),includeContext:Vr(["none","thisServer","allServers"]).optional(),temperature:It().optional(),maxTokens:It().int(),stopSequences:_t(de()).optional(),metadata:xr.optional(),tools:_t(A6).optional(),toolChoice:pD.optional()}),bD=Or.extend({method:tt("sampling/createMessage"),params:vD}),rc=Dr.extend({model:de(),stopReason:Lt(Vr(["endTurn","stopSequence","maxTokens"]).or(de())),role:ec,content:gD}),lb=Dr.extend({model:de(),stopReason:Lt(Vr(["endTurn","stopSequence","maxTokens","toolUse"]).or(de())),role:ec,content:Dt([Vh,_t(Vh)])}),_D=Qe({type:tt("boolean"),title:de().optional(),description:de().optional(),default:or().optional()}),wD=Qe({type:tt("string"),title:de().optional(),description:de().optional(),minLength:It().optional(),maxLength:It().optional(),format:Vr(["email","uri","date","date-time"]).optional(),default:de().optional()}),SD=Qe({type:Vr(["number","integer"]),title:de().optional(),description:de().optional(),minimum:It().optional(),maximum:It().optional(),default:It().optional()}),xD=Qe({type:tt("string"),title:de().optional(),description:de().optional(),enum:_t(de()),default:de().optional()}),kD=Qe({type:tt("string"),title:de().optional(),description:de().optional(),oneOf:_t(Qe({const:de(),title:de()})),default:de().optional()}),MD=Qe({type:tt("string"),title:de().optional(),description:de().optional(),enum:_t(de()),enumNames:_t(de()).optional(),default:de().optional()}),ED=Dt([xD,kD]),ID=Qe({type:tt("array"),title:de().optional(),description:de().optional(),minItems:It().optional(),maxItems:It().optional(),items:Qe({type:tt("string"),enum:_t(de())}),default:_t(de()).optional()}),$D=Qe({type:tt("array"),title:de().optional(),description:de().optional(),minItems:It().optional(),maxItems:It().optional(),items:Qe({anyOf:_t(Qe({const:de(),title:de()}))}),default:_t(de()).optional()}),TD=Dt([ID,$D]),PD=Dt([MD,ED,TD]),AD=Dt([PD,_D,wD,SD]),RD=Vl.extend({mode:tt("form").optional(),message:de(),requestedSchema:Qe({type:tt("object"),properties:Nt(de(),AD),required:_t(de()).optional()})}),CD=Vl.extend({mode:tt("url"),message:de(),elicitationId:de(),url:de().url()}),OD=Dt([RD,CD]),DD=Or.extend({method:tt("elicitation/create"),params:OD}),ND=Pn.extend({elicitationId:de()}),zD=An.extend({method:tt("notifications/elicitation/complete"),params:ND}),ta=Dr.extend({action:Vr(["accept","decline","cancel"]),content:Gf((e)=>e===null?void 0:e,Nt(de(),Dt([de(),It(),or(),_t(de())])).optional())}),jD=Qe({type:tt("ref/resource"),uri:de()});var UD=Qe({type:tt("ref/prompt"),name:de()}),LD=_n.extend({ref:Dt([UD,jD]),argument:Qe({name:de(),value:de()}),context:Qe({arguments:Nt(de(),de()).optional()}).optional()}),hp=Or.extend({method:tt("completion/complete"),params:LD});function R6(e){if(e.params.ref.type!=="ref/prompt")throw TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function C6(e){if(e.params.ref.type!=="ref/resource")throw TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}var FD=Dr.extend({completion:Lr({values:_t(de()).max(100),total:Lt(It().int()),hasMore:Lt(or())})}),qD=Qe({uri:de().startsWith("file://"),name:de().optional(),_meta:Nt(de(),qt()).optional()}),BD=Or.extend({method:tt("roots/list"),params:_n.optional()}),cb=Dr.extend({roots:_t(qD)}),HD=An.extend({method:tt("notifications/roots/list_changed"),params:Pn.optional()}),V0e=Dt([Yh,eb,hp,ub,cp,lp,sp,ap,up,BO,ZO,ea,dp,ep,rp,np,op]),W0e=Dt([Xh,Qh,tb,HD,Ql]),G0e=Dt([Jh,rc,lb,ta,cb,tp,ip,Ys]),J0e=Dt([Yh,bD,DD,BD,ep,rp,np,op]),X0e=Dt([Xh,Qh,dD,VO,FO,uD,nD,Ql,zD]),Y0e=Dt([Jh,PO,FD,rD,JO,zO,jO,LO,fp,sD,tp,ip,Ys]);class rt extends Error{constructor(e,t,r){super(`MCP error ${e}: ${t}`);this.code=e,this.data=r,this.name="McpError"}static fromError(e,t,r){if(e===it.UrlElicitationRequired&&r){let i=r;if(i.elicitations)return new O6(i.elicitations,t)}return new rt(e,t,r)}}class O6 extends rt{constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(it.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}}function to(e){return e==="completed"||e==="failed"||e==="cancelled"}var N6=Symbol("Let zodToJsonSchema decide on which parser to use");var D6={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},z6=(e)=>typeof e==="string"?{...D6,name:e}:{...D6,...e};var j6=(e)=>{let t=z6(e),r=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([i,n])=>[n._def,{def:n._def,path:[...t.basePath,t.definitionPath,i],jsonSchema:void 0}]))}};function db(e,t,r,i){if(!i?.errorMessages)return;if(r)e.errorMessage={...e.errorMessage,[t]:r}}function St(e,t,r,i,n){e[t]=r,db(e,t,i,n)}var pp=(e,t)=>{let r=0;for(;r<e.length&&r<t.length;r++)if(e[r]!==t[r])break;return[(e.length-r).toString(),...t.slice(r)].join("/")};function Zt(e){if(e.target!=="openAi")return{};let t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:e.$refStrategy==="relative"?pp(t,e.currentPath):t.join("/")}}function U6(e,t){let r={type:"array"};if(e.type?._def&&e.type?._def?.typeName!==Le.ZodAny)r.items=st(e.type._def,{...t,currentPath:[...t.currentPath,"items"]});if(e.minLength)St(r,"minItems",e.minLength.value,e.minLength.message,t);if(e.maxLength)St(r,"maxItems",e.maxLength.value,e.maxLength.message,t);if(e.exactLength)St(r,"minItems",e.exactLength.value,e.exactLength.message,t),St(r,"maxItems",e.exactLength.value,e.exactLength.message,t);return r}function L6(e,t){let r={type:"integer",format:"int64"};if(!e.checks)return r;for(let i of e.checks)switch(i.kind){case"min":if(t.target==="jsonSchema7")if(i.inclusive)St(r,"minimum",i.value,i.message,t);else St(r,"exclusiveMinimum",i.value,i.message,t);else{if(!i.inclusive)r.exclusiveMinimum=!0;St(r,"minimum",i.value,i.message,t)}break;case"max":if(t.target==="jsonSchema7")if(i.inclusive)St(r,"maximum",i.value,i.message,t);else St(r,"exclusiveMaximum",i.value,i.message,t);else{if(!i.inclusive)r.exclusiveMaximum=!0;St(r,"maximum",i.value,i.message,t)}break;case"multipleOf":St(r,"multipleOf",i.value,i.message,t);break}return r}function F6(){return{type:"boolean"}}function mp(e,t){return st(e.type._def,t)}var q6=(e,t)=>st(e.innerType._def,t);function fb(e,t,r){let i=r??t.dateStrategy;if(Array.isArray(i))return{anyOf:i.map((n,o)=>fb(e,t,n))};switch(i){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return ZD(e,t)}}var ZD=(e,t)=>{let r={type:"integer",format:"unix-time"};if(t.target==="openApi3")return r;for(let i of e.checks)switch(i.kind){case"min":St(r,"minimum",i.value,i.message,t);break;case"max":St(r,"maximum",i.value,i.message,t);break}return r};function B6(e,t){return{...st(e.innerType._def,t),default:e.defaultValue()}}function H6(e,t){return t.effectStrategy==="input"?st(e.schema._def,t):Zt(t)}function Z6(e){return{type:"string",enum:Array.from(e.values)}}var KD=(e)=>{if("type"in e&&e.type==="string")return!1;return"allOf"in e};function K6(e,t){let r=[st(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),st(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter((o)=>!!o),i=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,n=[];return r.forEach((o)=>{if(KD(o)){if(n.push(...o.allOf),o.unevaluatedProperties===void 0)i=void 0}else{let s=o;if("additionalProperties"in o&&o.additionalProperties===!1){let{additionalProperties:h,...v}=o;s=v}else i=void 0;n.push(s)}}),n.length?{allOf:n,...i}:void 0}function V6(e,t){let r=typeof e.value;if(r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string")return{type:Array.isArray(e.value)?"array":"object"};if(t.target==="openApi3")return{type:r==="bigint"?"integer":r,enum:[e.value]};return{type:r==="bigint"?"integer":r,const:e.value}}var hb=void 0,Ln={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>{if(hb===void 0)hb=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u");return hb},uuid:/^[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}$/,ipv4:/^(?:(?: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])$/,ipv4Cidr:/^(?:(?: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])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([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])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function gp(e,t){let r={type:"string"};if(e.checks)for(let i of e.checks)switch(i.kind){case"min":St(r,"minLength",typeof r.minLength==="number"?Math.max(r.minLength,i.value):i.value,i.message,t);break;case"max":St(r,"maxLength",typeof r.maxLength==="number"?Math.min(r.maxLength,i.value):i.value,i.message,t);break;case"email":switch(t.emailStrategy){case"format:email":Fn(r,"email",i.message,t);break;case"format:idn-email":Fn(r,"idn-email",i.message,t);break;case"pattern:zod":Gr(r,Ln.email,i.message,t);break}break;case"url":Fn(r,"uri",i.message,t);break;case"uuid":Fn(r,"uuid",i.message,t);break;case"regex":Gr(r,i.regex,i.message,t);break;case"cuid":Gr(r,Ln.cuid,i.message,t);break;case"cuid2":Gr(r,Ln.cuid2,i.message,t);break;case"startsWith":Gr(r,RegExp(`^${pb(i.value,t)}`),i.message,t);break;case"endsWith":Gr(r,RegExp(`${pb(i.value,t)}$`),i.message,t);break;case"datetime":Fn(r,"date-time",i.message,t);break;case"date":Fn(r,"date",i.message,t);break;case"time":Fn(r,"time",i.message,t);break;case"duration":Fn(r,"duration",i.message,t);break;case"length":St(r,"minLength",typeof r.minLength==="number"?Math.max(r.minLength,i.value):i.value,i.message,t),St(r,"maxLength",typeof r.maxLength==="number"?Math.min(r.maxLength,i.value):i.value,i.message,t);break;case"includes":{Gr(r,RegExp(pb(i.value,t)),i.message,t);break}case"ip":{if(i.version!=="v6")Fn(r,"ipv4",i.message,t);if(i.version!=="v4")Fn(r,"ipv6",i.message,t);break}case"base64url":Gr(r,Ln.base64url,i.message,t);break;case"jwt":Gr(r,Ln.jwt,i.message,t);break;case"cidr":{if(i.version!=="v6")Gr(r,Ln.ipv4Cidr,i.message,t);if(i.version!=="v4")Gr(r,Ln.ipv6Cidr,i.message,t);break}case"emoji":Gr(r,Ln.emoji(),i.message,t);break;case"ulid":{Gr(r,Ln.ulid,i.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{Fn(r,"binary",i.message,t);break}case"contentEncoding:base64":{St(r,"contentEncoding","base64",i.message,t);break}case"pattern:zod":{Gr(r,Ln.base64,i.message,t);break}}break}case"nanoid":Gr(r,Ln.nanoid,i.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:((n)=>{})(i)}return r}function pb(e,t){return t.patternStrategy==="escape"?WD(e):e}var VD=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function WD(e){let t="";for(let r=0;r<e.length;r++){if(!VD.has(e[r]))t+="\\";t+=e[r]}return t}function Fn(e,t,r,i){if(e.format||e.anyOf?.some((n)=>n.format)){if(!e.anyOf)e.anyOf=[];if(e.format){if(e.anyOf.push({format:e.format,...e.errorMessage&&i.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage){if(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0)delete e.errorMessage}}e.anyOf.push({format:t,...r&&i.errorMessages&&{errorMessage:{format:r}}})}else St(e,"format",t,r,i)}function Gr(e,t,r,i){if(e.pattern||e.allOf?.some((n)=>n.pattern)){if(!e.allOf)e.allOf=[];if(e.pattern){if(e.allOf.push({pattern:e.pattern,...e.errorMessage&&i.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage){if(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0)delete e.errorMessage}}e.allOf.push({pattern:W6(t,i),...r&&i.errorMessages&&{errorMessage:{pattern:r}}})}else St(e,"pattern",W6(t,i),r,i)}function W6(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let r={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},i=r.i?e.source.toLowerCase():e.source,n="",o=!1,s=!1,h=!1;for(let v=0;v<i.length;v++){if(o){n+=i[v],o=!1;continue}if(r.i){if(s){if(i[v].match(/[a-z]/)){if(h)n+=i[v],n+=`${i[v-2]}-${i[v]}`.toUpperCase(),h=!1;else if(i[v+1]==="-"&&i[v+2]?.match(/[a-z]/))n+=i[v],h=!0;else n+=`${i[v]}${i[v].toUpperCase()}`;continue}}else if(i[v].match(/[a-z]/)){n+=`[${i[v]}${i[v].toUpperCase()}]`;continue}}if(r.m){if(i[v]==="^"){n+=`(^|(?<=[\r
|
|
106
106
|
]))`;continue}else if(i[v]==="$"){n+=`($|(?=[\r
|
|
107
107
|
]))`;continue}}if(r.s&&i[v]==="."){n+=s?`${i[v]}\r
|
|
108
108
|
`:`[${i[v]}\r
|
|
109
|
-
]`;continue}if(n+=i[v],i[v]==="\\")o=!0;else if(s&&i[v]==="]")s=!1;else if(!s&&i[v]==="[")s=!0}try{new RegExp(n)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return n}function yp(e,t){if(t.target==="openAi")console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");if(t.target==="openApi3"&&e.keyType?._def.typeName===Le.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((i,n)=>({...i,[n]:st(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",n]})??Zt(t)}),{}),additionalProperties:t.rejectedAdditionalProperties};let r={type:"object",additionalProperties:st(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return r;if(e.keyType?._def.typeName===Le.ZodString&&e.keyType._def.checks?.length){let{type:i,...n}=gp(e.keyType._def,t);return{...r,propertyNames:n}}else if(e.keyType?._def.typeName===Le.ZodEnum)return{...r,propertyNames:{enum:e.keyType._def.values}};else if(e.keyType?._def.typeName===Le.ZodBranded&&e.keyType._def.type._def.typeName===Le.ZodString&&e.keyType._def.type._def.checks?.length){let{type:i,...n}=mp(e.keyType._def,t);return{...r,propertyNames:n}}return r}function G6(e,t){if(t.mapStrategy==="record")return yp(e,t);let r=st(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Zt(t),i=st(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Zt(t);return{type:"array",maxItems:125,items:{type:"array",items:[r,i],minItems:2,maxItems:2}}}function J6(e){let t=e.values,i=Object.keys(e.values).filter((o)=>typeof t[t[o]]!=="number").map((o)=>t[o]),n=Array.from(new Set(i.map((o)=>typeof o)));return{type:n.length===1?n[0]==="string"?"string":"number":["string","number"],enum:i}}function X6(e){return e.target==="openAi"?void 0:{not:Zt({...e,currentPath:[...e.currentPath,"not"]})}}function Y6(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var nc={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function ek(e,t){if(t.target==="openApi3")return Q6(e,t);let r=e.options instanceof Map?Array.from(e.options.values()):e.options;if(r.every((i)=>(i._def.typeName in nc)&&(!i._def.checks||!i._def.checks.length))){let i=r.reduce((n,o)=>{let s=nc[o._def.typeName];return s&&!n.includes(s)?[...n,s]:n},[]);return{type:i.length>1?i:i[0]}}else if(r.every((i)=>i._def.typeName==="ZodLiteral"&&!i.description)){let i=r.reduce((n,o)=>{let s=typeof o._def.value;switch(s){case"string":case"number":case"boolean":return[...n,s];case"bigint":return[...n,"integer"];case"object":if(o._def.value===null)return[...n,"null"];case"symbol":case"undefined":case"function":default:return n}},[]);if(i.length===r.length){let n=i.filter((o,s,h)=>h.indexOf(o)===s);return{type:n.length>1?n:n[0],enum:r.reduce((o,s)=>o.includes(s._def.value)?o:[...o,s._def.value],[])}}}else if(r.every((i)=>i._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((i,n)=>[...i,...n._def.values.filter((o)=>!i.includes(o))],[])};return Q6(e,t)}var Q6=(e,t)=>{let r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((i,n)=>st(i._def,{...t,currentPath:[...t.currentPath,"anyOf",`${n}`]})).filter((i)=>!!i&&(!t.strictUnions||typeof i==="object"&&Object.keys(i).length>0));return r.length?{anyOf:r}:void 0};function tk(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length)){if(t.target==="openApi3")return{type:nc[e.innerType._def.typeName],nullable:!0};return{type:[nc[e.innerType._def.typeName],"null"]}}if(t.target==="openApi3"){let i=st(e.innerType._def,{...t,currentPath:[...t.currentPath]});if(i&&"$ref"in i)return{allOf:[i],nullable:!0};return i&&{...i,nullable:!0}}let r=st(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function rk(e,t){let r={type:"number"};if(!e.checks)return r;for(let i of e.checks)switch(i.kind){case"int":r.type="integer",db(r,"type",i.message,t);break;case"min":if(t.target==="jsonSchema7")if(i.inclusive)St(r,"minimum",i.value,i.message,t);else St(r,"exclusiveMinimum",i.value,i.message,t);else{if(!i.inclusive)r.exclusiveMinimum=!0;St(r,"minimum",i.value,i.message,t)}break;case"max":if(t.target==="jsonSchema7")if(i.inclusive)St(r,"maximum",i.value,i.message,t);else St(r,"exclusiveMaximum",i.value,i.message,t);else{if(!i.inclusive)r.exclusiveMaximum=!0;St(r,"maximum",i.value,i.message,t)}break;case"multipleOf":St(r,"multipleOf",i.value,i.message,t);break}return r}function nk(e,t){let r=t.target==="openAi",i={type:"object",properties:{}},n=[],o=e.shape();for(let h in o){let v=o[h];if(v===void 0||v._def===void 0)continue;let b=JD(v);if(b&&r){if(v._def.typeName==="ZodOptional")v=v._def.innerType;if(!v.isNullable())v=v.nullable();b=!1}let _=st(v._def,{...t,currentPath:[...t.currentPath,"properties",h],propertyPath:[...t.currentPath,"properties",h]});if(_===void 0)continue;if(i.properties[h]=_,!b)n.push(h)}if(n.length)i.required=n;let s=GD(e,t);if(s!==void 0)i.additionalProperties=s;return i}function GD(e,t){if(e.catchall._def.typeName!=="ZodNever")return st(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function JD(e){try{return e.isOptional()}catch{return!0}}var ik=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return st(e.innerType._def,t);let r=st(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:Zt(t)},r]}:Zt(t)};var ok=(e,t)=>{if(t.pipeStrategy==="input")return st(e.in._def,t);else if(t.pipeStrategy==="output")return st(e.out._def,t);let r=st(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),i=st(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,i].filter((n)=>n!==void 0)}};function sk(e,t){return st(e.type._def,t)}function ak(e,t){let i={type:"array",uniqueItems:!0,items:st(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};if(e.minSize)St(i,"minItems",e.minSize.value,e.minSize.message,t);if(e.maxSize)St(i,"maxItems",e.maxSize.value,e.maxSize.message,t);return i}function uk(e,t){if(e.rest)return{type:"array",minItems:e.items.length,items:e.items.map((r,i)=>st(r._def,{...t,currentPath:[...t.currentPath,"items",`${i}`]})).reduce((r,i)=>i===void 0?r:[...r,i],[]),additionalItems:st(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})};else return{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((r,i)=>st(r._def,{...t,currentPath:[...t.currentPath,"items",`${i}`]})).reduce((r,i)=>i===void 0?r:[...r,i],[])}}function lk(e){return{not:Zt(e)}}function ck(e){return Zt(e)}var dk=(e,t)=>st(e.innerType._def,t);var fk=(e,t,r)=>{switch(t){case Le.ZodString:return gp(e,r);case Le.ZodNumber:return rk(e,r);case Le.ZodObject:return nk(e,r);case Le.ZodBigInt:return L6(e,r);case Le.ZodBoolean:return F6();case Le.ZodDate:return fb(e,r);case Le.ZodUndefined:return lk(r);case Le.ZodNull:return Y6(r);case Le.ZodArray:return U6(e,r);case Le.ZodUnion:case Le.ZodDiscriminatedUnion:return ek(e,r);case Le.ZodIntersection:return K6(e,r);case Le.ZodTuple:return uk(e,r);case Le.ZodRecord:return yp(e,r);case Le.ZodLiteral:return V6(e,r);case Le.ZodEnum:return Z6(e);case Le.ZodNativeEnum:return J6(e);case Le.ZodNullable:return tk(e,r);case Le.ZodOptional:return ik(e,r);case Le.ZodMap:return G6(e,r);case Le.ZodSet:return ak(e,r);case Le.ZodLazy:return()=>e.getter()._def;case Le.ZodPromise:return sk(e,r);case Le.ZodNaN:case Le.ZodNever:return X6(r);case Le.ZodEffects:return H6(e,r);case Le.ZodAny:return Zt(r);case Le.ZodUnknown:return ck(r);case Le.ZodDefault:return B6(e,r);case Le.ZodBranded:return mp(e,r);case Le.ZodReadonly:return dk(e,r);case Le.ZodCatch:return q6(e,r);case Le.ZodPipeline:return ok(e,r);case Le.ZodFunction:case Le.ZodVoid:case Le.ZodSymbol:return;default:return((i)=>{return})(t)}};function st(e,t,r=!1){let i=t.seen.get(e);if(t.override){let h=t.override?.(e,t,i,r);if(h!==N6)return h}if(i&&!r){let h=XD(i,t);if(h!==void 0)return h}let n={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,n);let o=fk(e,e.typeName,t),s=typeof o==="function"?st(o(),t):o;if(s)YD(e,t,s);if(t.postProcess){let h=t.postProcess(s,e,t);return n.jsonSchema=s,h}return n.jsonSchema=s,s}var XD=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:pp(t.currentPath,e.path)};case"none":case"seen":{if(e.path.length<t.currentPath.length&&e.path.every((r,i)=>t.currentPath[i]===r))return console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),Zt(t);return t.$refStrategy==="seen"?Zt(t):void 0}}},YD=(e,t,r)=>{if(e.description){if(r.description=e.description,t.markdownDescription)r.markdownDescription=e.description}return r};var mb=(e,t)=>{let r=j6(t),i=typeof t==="object"&&t.definitions?Object.entries(t.definitions).reduce((v,[b,_])=>({...v,[b]:st(_._def,{...r,currentPath:[...r.basePath,r.definitionPath,b]},!0)??Zt(r)}),{}):void 0,n=typeof t==="string"?t:t?.nameStrategy==="title"?void 0:t?.name,o=st(e._def,n===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,n]},!1)??Zt(r),s=typeof t==="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;if(s!==void 0)o.title=s;if(r.flags.hasReferencedOpenAiAnyType){if(!i)i={};if(!i[r.openAiAnyTypeName])i[r.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:r.$refStrategy==="relative"?"1":[...r.basePath,r.definitionPath,r.openAiAnyTypeName].join("/")}}}let h=n===void 0?i?{...o,[r.definitionPath]:i}:o:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,n].join("/"),[r.definitionPath]:{...i,[n]:o}};if(r.target==="jsonSchema7")h.$schema="http://json-schema.org/draft-07/schema#";else if(r.target==="jsonSchema2019-09"||r.target==="openAi")h.$schema="https://json-schema.org/draft/2019-09/schema#";if(r.target==="openAi"&&(("anyOf"in h)||("oneOf"in h)||("allOf"in h)||("type"in h)&&Array.isArray(h.type)))console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.");return h};function QD(e){if(!e)return"draft-7";if(e==="jsonSchema7"||e==="draft-7")return"draft-7";if(e==="jsonSchema2019-09"||e==="draft-2020-12")return"draft-2020-12";return"draft-7"}function gb(e,t){if(Tn(e))return xs(e,{target:QD(t?.target),io:t?.pipeStrategy??"input"});return mb(e,{strictUnions:t?.strictUnions??!0,pipeStrategy:t?.pipeStrategy??"input"})}function yb(e){let r=Qi(e)?.method;if(!r)throw Error("Schema is missing a method literal");let i=Kh(r);if(typeof i!=="string")throw Error("Schema method literal must be a string");return i}function vb(e,t){let r=Yi(e,t);if(!r.success)throw r.error;return r.data}var eN=60000;class bb{constructor(e){if(this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Xh,(t)=>{this._oncancel(t)}),this.setNotificationHandler(Qh,(t)=>{this._onprogress(t)}),this.setRequestHandler(Yh,(t)=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore)this.setRequestHandler(ep,async(t,r)=>{let i=await this._taskStore.getTask(t.params.taskId,r.sessionId);if(!i)throw new rt(it.InvalidParams,"Failed to retrieve task: Task not found");return{...i}}),this.setRequestHandler(rp,async(t,r)=>{let i=async()=>{let n=t.params.taskId;if(this._taskMessageQueue){let s;while(s=await this._taskMessageQueue.dequeue(n,r.sessionId)){if(s.type==="response"||s.type==="error"){let h=s.message,v=h.id,b=this._requestResolvers.get(v);if(b)if(this._requestResolvers.delete(v),s.type==="response")b(h);else{let _=h,g=new rt(_.error.code,_.error.message,_.error.data);b(g)}else{let _=s.type==="response"?"Response":"Error";this._onerror(Error(`${_} handler missing for request ${v}`))}continue}await this._transport?.send(s.message,{relatedRequestId:r.requestId})}}let o=await this._taskStore.getTask(n,r.sessionId);if(!o)throw new rt(it.InvalidParams,`Task not found: ${n}`);if(!to(o.status))return await this._waitForTaskUpdate(n,r.signal),await i();if(to(o.status)){let s=await this._taskStore.getTaskResult(n,r.sessionId);return this._clearTaskQueue(n),{...s,_meta:{...s._meta,[eo]:{taskId:n}}}}return await i()};return await i()}),this.setRequestHandler(np,async(t,r)=>{try{let{tasks:i,nextCursor:n}=await this._taskStore.listTasks(t.params?.cursor,r.sessionId);return{tasks:i,nextCursor:n,_meta:{}}}catch(i){throw new rt(it.InvalidParams,`Failed to list tasks: ${i instanceof Error?i.message:String(i)}`)}}),this.setRequestHandler(op,async(t,r)=>{try{let i=await this._taskStore.getTask(t.params.taskId,r.sessionId);if(!i)throw new rt(it.InvalidParams,`Task not found: ${t.params.taskId}`);if(to(i.status))throw new rt(it.InvalidParams,`Cannot cancel task in terminal status: ${i.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",r.sessionId),this._clearTaskQueue(t.params.taskId);let n=await this._taskStore.getTask(t.params.taskId,r.sessionId);if(!n)throw new rt(it.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...n}}catch(i){if(i instanceof rt)throw i;throw new rt(it.InvalidRequest,`Failed to cancel task: ${i instanceof Error?i.message:String(i)}`)}})}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,r,i,n=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(i,t),startTime:Date.now(),timeout:t,maxTotalTimeout:r,resetTimeoutOnProgress:n,onTimeout:i})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let r=Date.now()-t.startTime;if(t.maxTotalTimeout&&r>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),rt.fromError(it.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:r});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);if(t)clearTimeout(t.timeoutId),this._timeoutInfo.delete(e)}async connect(e){if(this._transport)throw Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};let r=this.transport?.onerror;this._transport.onerror=(n)=>{r?.(n),this._onerror(n)};let i=this._transport?.onmessage;this._transport.onmessage=(n,o)=>{if(i?.(n,o),Wl(n)||k6(n))this._onresponse(n);else if(Xv(n))this._onrequest(n,o);else if(x6(n))this._onnotification(n);else this._onerror(Error(`Unknown message type: ${JSON.stringify(n)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let r of this._timeoutInfo.values())clearTimeout(r.timeoutId);this._timeoutInfo.clear();for(let r of this._requestHandlerAbortControllers.values())r.abort();this._requestHandlerAbortControllers.clear();let t=rt.fromError(it.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let r of e.values())r(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){let t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;if(t===void 0)return;Promise.resolve().then(()=>t(e)).catch((r)=>this._onerror(Error(`Uncaught error in notification handler: ${r}`)))}_onrequest(e,t){let r=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,i=this._transport,n=e.params?._meta?.[eo]?.taskId;if(r===void 0){let b={jsonrpc:"2.0",id:e.id,error:{code:it.MethodNotFound,message:"Method not found"}};if(n&&this._taskMessageQueue)this._enqueueTaskMessage(n,{type:"error",message:b,timestamp:Date.now()},i?.sessionId).catch((_)=>this._onerror(Error(`Failed to enqueue error response: ${_}`)));else i?.send(b).catch((_)=>this._onerror(Error(`Failed to send an error response: ${_}`)));return}let o=new AbortController;this._requestHandlerAbortControllers.set(e.id,o);let s=_6(e.params)?e.params.task:void 0,h=this._taskStore?this.requestTaskStore(e,i?.sessionId):void 0,v={signal:o.signal,sessionId:i?.sessionId,_meta:e.params?._meta,sendNotification:async(b)=>{if(o.signal.aborted)return;let _={relatedRequestId:e.id};if(n)_.relatedTask={taskId:n};await this.notification(b,_)},sendRequest:async(b,_,g)=>{if(o.signal.aborted)throw new rt(it.ConnectionClosed,"Request was cancelled");let S={...g,relatedRequestId:e.id};if(n&&!S.relatedTask)S.relatedTask={taskId:n};let x=S.relatedTask?.taskId??n;if(x&&h)await h.updateTaskStatus(x,"input_required");return await this.request(b,_,S)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:n,taskStore:h,taskRequestedTtl:s?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{if(s)this.assertTaskHandlerCapability(e.method)}).then(()=>r(e,v)).then(async(b)=>{if(o.signal.aborted)return;let _={result:b,jsonrpc:"2.0",id:e.id};if(n&&this._taskMessageQueue)await this._enqueueTaskMessage(n,{type:"response",message:_,timestamp:Date.now()},i?.sessionId);else await i?.send(_)},async(b)=>{if(o.signal.aborted)return;let _={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(b.code)?b.code:it.InternalError,message:b.message??"Internal error",...b.data!==void 0&&{data:b.data}}};if(n&&this._taskMessageQueue)await this._enqueueTaskMessage(n,{type:"error",message:_,timestamp:Date.now()},i?.sessionId);else await i?.send(_)}).catch((b)=>this._onerror(Error(`Failed to send response: ${b}`))).finally(()=>{if(this._requestHandlerAbortControllers.get(e.id)===o)this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:t,...r}=e.params,i=Number(t),n=this._progressHandlers.get(i);if(!n){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let o=this._responseHandlers.get(i),s=this._timeoutInfo.get(i);if(s&&o&&s.resetTimeoutOnProgress)try{this._resetTimeout(i)}catch(h){this._responseHandlers.delete(i),this._progressHandlers.delete(i),this._cleanupTimeout(i),o(h);return}n(r)}_onresponse(e){let t=Number(e.id),r=this._requestResolvers.get(t);if(r){if(this._requestResolvers.delete(t),Wl(e))r(e);else{let o=new rt(e.error.code,e.error.message,e.error.data);r(o)}return}let i=this._responseHandlers.get(t);if(i===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let n=!1;if(Wl(e)&&e.result&&typeof e.result==="object"){let o=e.result;if(o.task&&typeof o.task==="object"){let s=o.task;if(typeof s.taskId==="string")n=!0,this._taskProgressTokens.set(s.taskId,t)}}if(!n)this._progressHandlers.delete(t);if(Wl(e))i(e);else{let o=rt.fromError(e.error.code,e.error.message,e.error.data);i(o)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,r){let{task:i}=r??{};if(!i){try{yield{type:"result",result:await this.request(e,t,r)}}catch(o){yield{type:"error",error:o instanceof rt?o:new rt(it.InternalError,String(o))}}return}let n;try{let o=await this.request(e,Ys,r);if(o.task)n=o.task.taskId,yield{type:"taskCreated",task:o.task};else throw new rt(it.InternalError,"Task creation did not return a task");while(!0){let s=await this.getTask({taskId:n},r);if(yield{type:"taskStatus",task:s},to(s.status)){if(s.status==="completed")yield{type:"result",result:await this.getTaskResult({taskId:n},t,r)};else if(s.status==="failed")yield{type:"error",error:new rt(it.InternalError,`Task ${n} failed`)};else if(s.status==="cancelled")yield{type:"error",error:new rt(it.InternalError,`Task ${n} was cancelled`)};return}if(s.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:n},t,r)};return}let h=s.pollInterval??this._options?.defaultTaskPollInterval??1000;await new Promise((v)=>setTimeout(v,h)),r?.signal?.throwIfAborted()}}catch(o){yield{type:"error",error:o instanceof rt?o:new rt(it.InternalError,String(o))}}}request(e,t,r){let{relatedRequestId:i,resumptionToken:n,onresumptiontoken:o,task:s,relatedTask:h}=r??{};return new Promise((v,b)=>{let _=(T)=>{b(T)};if(!this._transport){_(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{if(this.assertCapabilityForMethod(e.method),s)this.assertTaskCapability(e.method)}catch(T){_(T);return}r?.signal?.throwIfAborted();let g=this._requestMessageId++,S={...e,jsonrpc:"2.0",id:g};if(r?.onprogress)this._progressHandlers.set(g,r.onprogress),S.params={...e.params,_meta:{...e.params?._meta||{},progressToken:g}};if(s)S.params={...S.params,task:s};if(h)S.params={...S.params,_meta:{...S.params?._meta||{},[eo]:h}};let x=(T)=>{this._responseHandlers.delete(g),this._progressHandlers.delete(g),this._cleanupTimeout(g),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:g,reason:String(T)}},{relatedRequestId:i,resumptionToken:n,onresumptiontoken:o}).catch((R)=>this._onerror(Error(`Failed to send cancellation: ${R}`)));let P=T instanceof rt?T:new rt(it.RequestTimeout,String(T));b(P)};this._responseHandlers.set(g,(T)=>{if(r?.signal?.aborted)return;if(T instanceof Error)return b(T);try{let P=Yi(t,T.result);if(!P.success)b(P.error);else v(P.data)}catch(P){b(P)}}),r?.signal?.addEventListener("abort",()=>{x(r?.signal?.reason)});let M=r?.timeout??eN,I=()=>x(rt.fromError(it.RequestTimeout,"Request timed out",{timeout:M}));this._setupTimeout(g,M,r?.maxTotalTimeout,I,r?.resetTimeoutOnProgress??!1);let $=h?.taskId;if($){let T=(P)=>{let R=this._responseHandlers.get(g);if(R)R(P);else this._onerror(Error(`Response handler missing for side-channeled request ${g}`))};this._requestResolvers.set(g,T),this._enqueueTaskMessage($,{type:"request",message:S,timestamp:Date.now()}).catch((P)=>{this._cleanupTimeout(g),b(P)})}else this._transport.send(S,{relatedRequestId:i,resumptionToken:n,onresumptiontoken:o}).catch((T)=>{this._cleanupTimeout(g),b(T)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},tp,t)}async getTaskResult(e,t,r){return this.request({method:"tasks/result",params:e},t,r)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},ip,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},E6,t)}async notification(e,t){if(!this._transport)throw Error("Not connected");this.assertNotificationCapability(e.method);let r=t?.relatedTask?.taskId;if(r){let s={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[eo]:t.relatedTask}}};await this._enqueueTaskMessage(r,{type:"notification",message:s,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let s={...e,jsonrpc:"2.0"};if(t?.relatedTask)s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[eo]:t.relatedTask}}};this._transport?.send(s,t).catch((h)=>this._onerror(h))});return}let o={...e,jsonrpc:"2.0"};if(t?.relatedTask)o={...o,params:{...o.params,_meta:{...o.params?._meta||{},[eo]:t.relatedTask}}};await this._transport.send(o,t)}setRequestHandler(e,t){let r=yb(e);this.assertRequestHandlerCapability(r),this._requestHandlers.set(r,(i,n)=>{let o=vb(e,i);return Promise.resolve(t(o,n))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){let r=yb(e);this._notificationHandlers.set(r,(i)=>{let n=vb(e,i);return Promise.resolve(t(n))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let t=this._taskProgressTokens.get(e);if(t!==void 0)this._progressHandlers.delete(t),this._taskProgressTokens.delete(e)}async _enqueueTaskMessage(e,t,r){if(!this._taskStore||!this._taskMessageQueue)throw Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let i=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,r,i)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){let r=await this._taskMessageQueue.dequeueAll(e,t);for(let i of r)if(i.type==="request"&&Xv(i.message)){let n=i.message.id,o=this._requestResolvers.get(n);if(o)o(new rt(it.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(n);else this._onerror(Error(`Resolver missing for request ${n} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let r=this._options?.defaultTaskPollInterval??1000;try{let i=await this._taskStore?.getTask(e);if(i?.pollInterval)r=i.pollInterval}catch{}return new Promise((i,n)=>{if(t.aborted){n(new rt(it.InvalidRequest,"Request cancelled"));return}let o=setTimeout(i,r);t.addEventListener("abort",()=>{clearTimeout(o),n(new rt(it.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){let r=this._taskStore;if(!r)throw Error("No task store configured");return{createTask:async(i)=>{if(!e)throw Error("No request provided");return await r.createTask(i,e.id,{method:e.method,params:e.params},t)},getTask:async(i)=>{let n=await r.getTask(i,t);if(!n)throw new rt(it.InvalidParams,"Failed to retrieve task: Task not found");return n},storeTaskResult:async(i,n,o)=>{await r.storeTaskResult(i,n,o,t);let s=await r.getTask(i,t);if(s){let h=Ql.parse({method:"notifications/tasks/status",params:s});if(await this.notification(h),to(s.status))this._cleanupTaskProgressHandler(i)}},getTaskResult:(i)=>r.getTaskResult(i,t),updateTaskStatus:async(i,n,o)=>{let s=await r.getTask(i,t);if(!s)throw new rt(it.InvalidParams,`Task "${i}" not found - it may have been cleaned up`);if(to(s.status))throw new rt(it.InvalidParams,`Cannot update task "${i}" from terminal status "${s.status}" to "${n}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await r.updateTaskStatus(i,n,o,t);let h=await r.getTask(i,t);if(h){let v=Ql.parse({method:"notifications/tasks/status",params:h});if(await this.notification(v),to(h.status))this._cleanupTaskProgressHandler(i)}},listTasks:(i)=>r.listTasks(i,t)}}}function hk(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function pk(e,t){let r={...e};for(let i in t){let n=i,o=t[n];if(o===void 0)continue;let s=r[n];if(hk(s)&&hk(o))r[n]={...s,...o};else r[n]=o}return r}var J8=N_(p_(),1),X8=N_(G8(),1);function SH(){let e=new J8.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return X8.default(e),e}class k_{constructor(e){this._ajv=e??SH()}getValidator(e){let t="$id"in e&&typeof e.$id==="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return(r)=>{if(t(r))return{valid:!0,data:r,errorMessage:void 0};else return{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}}class M_{constructor(e){this._server=e}requestStream(e,t,r){return this._server.requestStream(e,t,r)}createMessageStream(e,t){let r=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!r?.sampling?.tools)throw Error("Client does not support sampling tools capability.");if(e.messages.length>0){let i=e.messages[e.messages.length-1],n=Array.isArray(i.content)?i.content:[i.content],o=n.some((b)=>b.type==="tool_result"),s=e.messages.length>1?e.messages[e.messages.length-2]:void 0,h=s?Array.isArray(s.content)?s.content:[s.content]:[],v=h.some((b)=>b.type==="tool_use");if(o){if(n.some((b)=>b.type!=="tool_result"))throw Error("The last message must contain only tool_result content if any is present");if(!v)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(v){let b=new Set(h.filter((g)=>g.type==="tool_use").map((g)=>g.id)),_=new Set(n.filter((g)=>g.type==="tool_result").map((g)=>g.toolUseId));if(b.size!==_.size||![...b].every((g)=>_.has(g)))throw Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:e},rc,t)}elicitInputStream(e,t){let r=this._server.getClientCapabilities(),i=e.mode??"form";switch(i){case"url":{if(!r?.elicitation?.url)throw Error("Client does not support url elicitation.");break}case"form":{if(!r?.elicitation?.form)throw Error("Client does not support form elicitation.");break}}let n=i==="form"&&e.mode===void 0?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:n},ta,t)}async getTask(e,t){return this._server.getTask({taskId:e},t)}async getTaskResult(e,t,r){return this._server.getTaskResult({taskId:e},t,r)}async listTasks(e,t){return this._server.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._server.cancelTask({taskId:e},t)}}function Y8(e,t,r){if(!e)throw Error(`${r} does not support task creation (required for ${t})`);switch(t){case"tools/call":if(!e.tools?.call)throw Error(`${r} does not support task creation for tools/call (required for ${t})`);break;default:break}}function Q8(e,t,r){if(!e)throw Error(`${r} does not support task creation (required for ${t})`);switch(t){case"sampling/createMessage":if(!e.sampling?.createMessage)throw Error(`${r} does not support task creation for sampling/createMessage (required for ${t})`);break;case"elicitation/create":if(!e.elicitation?.create)throw Error(`${r} does not support task creation for elicitation/create (required for ${t})`);break;default:break}}class E_ extends bb{constructor(e,t){super(t);if(this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(tc.options.map((r,i)=>[r,i])),this.isMessageIgnored=(r,i)=>{let n=this._loggingLevels.get(i);return n?this.LOG_LEVEL_SEVERITY.get(r)<this.LOG_LEVEL_SEVERITY.get(n):!1},this._capabilities=t?.capabilities??{},this._instructions=t?.instructions,this._jsonSchemaValidator=t?.jsonSchemaValidator??new k_,this.setRequestHandler(eb,(r)=>this._oninitialize(r)),this.setNotificationHandler(tb,()=>this.oninitialized?.()),this._capabilities.logging)this.setRequestHandler(ub,async(r,i)=>{let n=i.sessionId||i.requestInfo?.headers["mcp-session-id"]||void 0,{level:o}=r.params,s=tc.safeParse(o);if(s.success)this._loggingLevels.set(n,s.data);return{}})}get experimental(){if(!this._experimental)this._experimental={tasks:new M_(this)};return this._experimental}registerCapabilities(e){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=pk(this._capabilities,e)}setRequestHandler(e,t){let i=Qi(e)?.method;if(!i)throw Error("Schema is missing a method literal");let n;if(Tn(i)){let s=i;n=s._zod?.def?.value??s.value}else{let s=i;n=s._def?.value??s.value}if(typeof n!=="string")throw Error("Schema method literal must be a string");if(n==="tools/call"){let s=async(h,v)=>{let b=Yi(ea,h);if(!b.success){let x=b.error instanceof Error?b.error.message:String(b.error);throw new rt(it.InvalidParams,`Invalid tools/call request: ${x}`)}let{params:_}=b.data,g=await Promise.resolve(t(h,v));if(_.task){let x=Yi(Ys,g);if(!x.success){let M=x.error instanceof Error?x.error.message:String(x.error);throw new rt(it.InvalidParams,`Invalid task creation result: ${M}`)}return x.data}let S=Yi(fp,g);if(!S.success){let x=S.error instanceof Error?S.error.message:String(S.error);throw new rt(it.InvalidParams,`Invalid tools/call result: ${x}`)}return S.data};return super.setRequestHandler(e,s)}return super.setRequestHandler(e,t)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(!this._capabilities)return;switch(e){case"completion/complete":if(!this._capabilities.completions)throw Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw Error(`Server does not support tasks capability (required for ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){Q8(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){if(!this._capabilities)return;Y8(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let t=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:y6.includes(t)?t:Gv,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},Jh)}async createMessage(e,t){if(e.tools||e.toolChoice){if(!this._clientCapabilities?.sampling?.tools)throw Error("Client does not support sampling tools capability.")}if(e.messages.length>0){let r=e.messages[e.messages.length-1],i=Array.isArray(r.content)?r.content:[r.content],n=i.some((v)=>v.type==="tool_result"),o=e.messages.length>1?e.messages[e.messages.length-2]:void 0,s=o?Array.isArray(o.content)?o.content:[o.content]:[],h=s.some((v)=>v.type==="tool_use");if(n){if(i.some((v)=>v.type!=="tool_result"))throw Error("The last message must contain only tool_result content if any is present");if(!h)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(h){let v=new Set(s.filter((_)=>_.type==="tool_use").map((_)=>_.id)),b=new Set(i.filter((_)=>_.type==="tool_result").map((_)=>_.toolUseId));if(v.size!==b.size||![...v].every((_)=>b.has(_)))throw Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}if(e.tools)return this.request({method:"sampling/createMessage",params:e},lb,t);return this.request({method:"sampling/createMessage",params:e},rc,t)}async elicitInput(e,t){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw Error("Client does not support url elicitation.");let i=e;return this.request({method:"elicitation/create",params:i},ta,t)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw Error("Client does not support form elicitation.");let i=e.mode==="form"?e:{...e,mode:"form"},n=await this.request({method:"elicitation/create",params:i},ta,t);if(n.action==="accept"&&n.content&&i.requestedSchema)try{let s=this._jsonSchemaValidator.getValidator(i.requestedSchema)(n.content);if(!s.valid)throw new rt(it.InvalidParams,`Elicitation response content does not match requested schema: ${s.errorMessage}`)}catch(o){if(o instanceof rt)throw o;throw new rt(it.InternalError,`Error validating elicitation response: ${o instanceof Error?o.message:String(o)}`)}return n}}}createElicitationCompletionNotifier(e,t){if(!this._clientCapabilities?.elicitation?.url)throw Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},t)}async listRoots(e,t){return this.request({method:"roots/list",params:e},cb,t)}async sendLoggingMessage(e,t){if(this._capabilities.logging){if(!this.isMessageIgnored(e.level,t))return this.notification({method:"notifications/message",params:e})}}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}var tE=Symbol.for("mcp.completable");function I_(e){return!!e&&typeof e==="object"&&tE in e}function rE(e){return e[tE]?.complete}var eE;(function(e){e.Completable="McpCompletable"})(eE||(eE={}));var xH=/^[A-Za-z0-9._-]{1,128}$/;function kH(e){let t=[];if(e.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(e.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${e.length})`]};if(e.includes(" "))t.push("Tool name contains spaces, which may cause parsing issues");if(e.includes(","))t.push("Tool name contains commas, which may cause parsing issues");if(e.startsWith("-")||e.endsWith("-"))t.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts");if(e.startsWith(".")||e.endsWith("."))t.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts");if(!xH.test(e)){let r=e.split("").filter((i)=>!/[A-Za-z0-9._-]/.test(i)).filter((i,n,o)=>o.indexOf(i)===n);return t.push(`Tool name contains invalid characters: ${r.map((i)=>`"${i}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:t}}return{isValid:!0,warnings:t}}function MH(e,t){if(t.length>0){console.warn(`Tool name validation warning for "${e}":`);for(let r of t)console.warn(` - ${r}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function $_(e){let t=kH(e);return MH(e,t.warnings),t.isValid}class T_{constructor(e){this._mcpServer=e}registerToolTask(e,t,r){let i={taskSupport:"required",...t.execution};if(i.taskSupport==="forbidden")throw Error(`Cannot register task-based tool '${e}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(e,t.title,t.description,t.inputSchema,t.outputSchema,t.annotations,i,t._meta,r)}}class A_{constructor(e,t){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new E_(e,t)}get experimental(){if(!this._experimental)this._experimental={tasks:new T_(this)};return this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){if(this._toolHandlersInitialized)return;this.server.assertCanSetRequestHandler(lo(dp)),this.server.assertCanSetRequestHandler(lo(ea)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(dp,()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,t])=>{let r={name:e,title:t.title,description:t.description,inputSchema:(()=>{let i=Js(t.inputSchema);return i?gb(i,{strictUnions:!0,pipeStrategy:"input"}):EH})(),annotations:t.annotations,execution:t.execution,_meta:t._meta};if(t.outputSchema){let i=Js(t.outputSchema);if(i)r.outputSchema=gb(i,{strictUnions:!0,pipeStrategy:"output"})}return r})})),this.server.setRequestHandler(ea,async(e,t)=>{try{let r=this._registeredTools[e.params.name];if(!r)throw new rt(it.InvalidParams,`Tool ${e.params.name} not found`);if(!r.enabled)throw new rt(it.InvalidParams,`Tool ${e.params.name} disabled`);let i=!!e.params.task,n=r.execution?.taskSupport,o="createTask"in r.handler;if((n==="required"||n==="optional")&&!o)throw new rt(it.InternalError,`Tool ${e.params.name} has taskSupport '${n}' but was not registered with registerToolTask`);if(n==="required"&&!i)throw new rt(it.MethodNotFound,`Tool ${e.params.name} requires task augmentation (taskSupport: 'required')`);if(n==="optional"&&!i&&o)return await this.handleAutomaticTaskPolling(r,e,t);let s=await this.validateToolInput(r,e.params.arguments,e.params.name),h=await this.executeToolHandler(r,s,t);if(i)return h;return await this.validateToolOutput(r,h,e.params.name),h}catch(r){if(r instanceof rt){if(r.code===it.UrlElicitationRequired)throw r}return this.createToolError(r instanceof Error?r.message:String(r))}}),this._toolHandlersInitialized=!0}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,t,r){if(!e.inputSchema)return;let n=Js(e.inputSchema)??e.inputSchema,o=await Hh(n,t);if(!o.success){let s="error"in o?o.error:"Unknown error",h=Zh(s);throw new rt(it.InvalidParams,`Input validation error: Invalid arguments for tool ${r}: ${h}`)}return o.data}async validateToolOutput(e,t,r){if(!e.outputSchema)return;if(!("content"in t))return;if(t.isError)return;if(!t.structuredContent)throw new rt(it.InvalidParams,`Output validation error: Tool ${r} has an output schema but no structured content was provided`);let i=Js(e.outputSchema),n=await Hh(i,t.structuredContent);if(!n.success){let o="error"in n?n.error:"Unknown error",s=Zh(o);throw new rt(it.InvalidParams,`Output validation error: Invalid structured content for tool ${r}: ${s}`)}}async executeToolHandler(e,t,r){let i=e.handler;if("createTask"in i){if(!r.taskStore)throw Error("No task store provided.");let o={...r,taskStore:r.taskStore};if(e.inputSchema)return await Promise.resolve(i.createTask(t,o));else return await Promise.resolve(i.createTask(o))}if(e.inputSchema)return await Promise.resolve(i(t,r));else return await Promise.resolve(i(r))}async handleAutomaticTaskPolling(e,t,r){if(!r.taskStore)throw Error("No task store provided for task-capable tool.");let i=await this.validateToolInput(e,t.params.arguments,t.params.name),n=e.handler,o={...r,taskStore:r.taskStore},s=i?await Promise.resolve(n.createTask(i,o)):await Promise.resolve(n.createTask(o)),h=s.task.taskId,v=s.task,b=v.pollInterval??5000;while(v.status!=="completed"&&v.status!=="failed"&&v.status!=="cancelled"){await new Promise((g)=>setTimeout(g,b));let _=await r.taskStore.getTask(h);if(!_)throw new rt(it.InternalError,`Task ${h} not found during polling`);v=_}return await r.taskStore.getTaskResult(h)}setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler(lo(hp)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(hp,async(e)=>{switch(e.params.ref.type){case"ref/prompt":return R6(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return C6(e),this.handleResourceCompletion(e,e.params.ref);default:throw new rt(it.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion(e,t){let r=this._registeredPrompts[t.name];if(!r)throw new rt(it.InvalidParams,`Prompt ${t.name} not found`);if(!r.enabled)throw new rt(it.InvalidParams,`Prompt ${t.name} disabled`);if(!r.argsSchema)return Ic;let n=Qi(r.argsSchema)?.[e.params.argument.name];if(!I_(n))return Ic;let o=rE(n);if(!o)return Ic;let s=await o(e.params.argument.value,e.params.context);return iE(s)}async handleResourceCompletion(e,t){let r=Object.values(this._registeredResourceTemplates).find((o)=>o.resourceTemplate.uriTemplate.toString()===t.uri);if(!r){if(this._registeredResources[t.uri])return Ic;throw new rt(it.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let i=r.resourceTemplate.completeCallback(e.params.argument.name);if(!i)return Ic;let n=await i(e.params.argument.value,e.params.context);return iE(n)}setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler(lo(sp)),this.server.assertCanSetRequestHandler(lo(ap)),this.server.assertCanSetRequestHandler(lo(up)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(sp,async(e,t)=>{let r=Object.entries(this._registeredResources).filter(([n,o])=>o.enabled).map(([n,o])=>({uri:n,name:o.name,...o.metadata})),i=[];for(let n of Object.values(this._registeredResourceTemplates)){if(!n.resourceTemplate.listCallback)continue;let o=await n.resourceTemplate.listCallback(t);for(let s of o.resources)i.push({...n.metadata,...s})}return{resources:[...r,...i]}}),this.server.setRequestHandler(ap,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([t,r])=>({name:t,uriTemplate:r.resourceTemplate.uriTemplate.toString(),...r.metadata}))})),this.server.setRequestHandler(up,async(e,t)=>{let r=new URL(e.params.uri),i=this._registeredResources[r.toString()];if(i){if(!i.enabled)throw new rt(it.InvalidParams,`Resource ${r} disabled`);return i.readCallback(r,t)}for(let n of Object.values(this._registeredResourceTemplates)){let o=n.resourceTemplate.uriTemplate.match(r.toString());if(o)return n.readCallback(r,o,t)}throw new rt(it.InvalidParams,`Resource ${r} not found`)}),this._resourceHandlersInitialized=!0}setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;this.server.assertCanSetRequestHandler(lo(lp)),this.server.assertCanSetRequestHandler(lo(cp)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(lp,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,t])=>({name:e,title:t.title,description:t.description,arguments:t.argsSchema?IH(t.argsSchema):void 0}))})),this.server.setRequestHandler(cp,async(e,t)=>{let r=this._registeredPrompts[e.params.name];if(!r)throw new rt(it.InvalidParams,`Prompt ${e.params.name} not found`);if(!r.enabled)throw new rt(it.InvalidParams,`Prompt ${e.params.name} disabled`);if(r.argsSchema){let i=Js(r.argsSchema),n=await Hh(i,e.params.arguments);if(!n.success){let h="error"in n?n.error:"Unknown error",v=Zh(h);throw new rt(it.InvalidParams,`Invalid arguments for prompt ${e.params.name}: ${v}`)}let o=n.data,s=r.callback;return await Promise.resolve(s(o,t))}else{let i=r.callback;return await Promise.resolve(i(t))}}),this._promptHandlersInitialized=!0}resource(e,t,...r){let i;if(typeof r[0]==="object")i=r.shift();let n=r[0];if(typeof t==="string"){if(this._registeredResources[t])throw Error(`Resource ${t} is already registered`);let o=this._createRegisteredResource(e,void 0,t,i,n);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}else{if(this._registeredResourceTemplates[e])throw Error(`Resource template ${e} is already registered`);let o=this._createRegisteredResourceTemplate(e,void 0,t,i,n);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}}registerResource(e,t,r,i){if(typeof t==="string"){if(this._registeredResources[t])throw Error(`Resource ${t} is already registered`);let n=this._createRegisteredResource(e,r.title,t,r,i);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),n}else{if(this._registeredResourceTemplates[e])throw Error(`Resource template ${e} is already registered`);let n=this._createRegisteredResourceTemplate(e,r.title,t,r,i);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),n}}_createRegisteredResource(e,t,r,i,n){let o={name:e,title:t,metadata:i,readCallback:n,enabled:!0,disable:()=>o.update({enabled:!1}),enable:()=>o.update({enabled:!0}),remove:()=>o.update({uri:null}),update:(s)=>{if(typeof s.uri<"u"&&s.uri!==r){if(delete this._registeredResources[r],s.uri)this._registeredResources[s.uri]=o}if(typeof s.name<"u")o.name=s.name;if(typeof s.title<"u")o.title=s.title;if(typeof s.metadata<"u")o.metadata=s.metadata;if(typeof s.callback<"u")o.readCallback=s.callback;if(typeof s.enabled<"u")o.enabled=s.enabled;this.sendResourceListChanged()}};return this._registeredResources[r]=o,o}_createRegisteredResourceTemplate(e,t,r,i,n){let o={resourceTemplate:r,title:t,metadata:i,readCallback:n,enabled:!0,disable:()=>o.update({enabled:!1}),enable:()=>o.update({enabled:!0}),remove:()=>o.update({name:null}),update:(v)=>{if(typeof v.name<"u"&&v.name!==e){if(delete this._registeredResourceTemplates[e],v.name)this._registeredResourceTemplates[v.name]=o}if(typeof v.title<"u")o.title=v.title;if(typeof v.template<"u")o.resourceTemplate=v.template;if(typeof v.metadata<"u")o.metadata=v.metadata;if(typeof v.callback<"u")o.readCallback=v.callback;if(typeof v.enabled<"u")o.enabled=v.enabled;this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=o;let s=r.uriTemplate.variableNames;if(Array.isArray(s)&&s.some((v)=>!!r.completeCallback(v)))this.setCompletionRequestHandler();return o}_createRegisteredPrompt(e,t,r,i,n){let o={title:t,description:r,argsSchema:i===void 0?void 0:Ho(i),callback:n,enabled:!0,disable:()=>o.update({enabled:!1}),enable:()=>o.update({enabled:!0}),remove:()=>o.update({name:null}),update:(s)=>{if(typeof s.name<"u"&&s.name!==e){if(delete this._registeredPrompts[e],s.name)this._registeredPrompts[s.name]=o}if(typeof s.title<"u")o.title=s.title;if(typeof s.description<"u")o.description=s.description;if(typeof s.argsSchema<"u")o.argsSchema=Ho(s.argsSchema);if(typeof s.callback<"u")o.callback=s.callback;if(typeof s.enabled<"u")o.enabled=s.enabled;this.sendPromptListChanged()}};if(this._registeredPrompts[e]=o,i){if(Object.values(i).some((h)=>{let v=h instanceof $n?h._def?.innerType:h;return I_(v)}))this.setCompletionRequestHandler()}return o}_createRegisteredTool(e,t,r,i,n,o,s,h,v){$_(e);let b={title:t,description:r,inputSchema:nE(i),outputSchema:nE(n),annotations:o,execution:s,_meta:h,handler:v,enabled:!0,disable:()=>b.update({enabled:!1}),enable:()=>b.update({enabled:!0}),remove:()=>b.update({name:null}),update:(_)=>{if(typeof _.name<"u"&&_.name!==e){if(typeof _.name==="string")$_(_.name);if(delete this._registeredTools[e],_.name)this._registeredTools[_.name]=b}if(typeof _.title<"u")b.title=_.title;if(typeof _.description<"u")b.description=_.description;if(typeof _.paramsSchema<"u")b.inputSchema=Ho(_.paramsSchema);if(typeof _.outputSchema<"u")b.outputSchema=Ho(_.outputSchema);if(typeof _.callback<"u")b.handler=_.callback;if(typeof _.annotations<"u")b.annotations=_.annotations;if(typeof _._meta<"u")b._meta=_._meta;if(typeof _.enabled<"u")b.enabled=_.enabled;this.sendToolListChanged()}};return this._registeredTools[e]=b,this.setToolRequestHandlers(),this.sendToolListChanged(),b}tool(e,...t){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let r,i,n,o;if(typeof t[0]==="string")r=t.shift();if(t.length>1){let h=t[0];if(P_(h)){if(i=t.shift(),t.length>1&&typeof t[0]==="object"&&t[0]!==null&&!P_(t[0]))o=t.shift()}else if(typeof h==="object"&&h!==null){if(Object.values(h).some((v)=>typeof v==="object"&&v!==null))throw Error(`Tool ${e} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);o=t.shift()}}let s=t[0];return this._createRegisteredTool(e,void 0,r,i,n,o,{taskSupport:"forbidden"},void 0,s)}registerTool(e,t,r){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let{title:i,description:n,inputSchema:o,outputSchema:s,annotations:h,_meta:v}=t;return this._createRegisteredTool(e,i,n,o,s,h,{taskSupport:"forbidden"},v,r)}prompt(e,...t){if(this._registeredPrompts[e])throw Error(`Prompt ${e} is already registered`);let r;if(typeof t[0]==="string")r=t.shift();let i;if(t.length>1)i=t.shift();let n=t[0],o=this._createRegisteredPrompt(e,void 0,r,i,n);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),o}registerPrompt(e,t,r){if(this._registeredPrompts[e])throw Error(`Prompt ${e} is already registered`);let{title:i,description:n,argsSchema:o}=t,s=this._createRegisteredPrompt(e,i,n,o,r);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),s}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,t){return this.server.sendLoggingMessage(e,t)}sendResourceListChanged(){if(this.isConnected())this.server.sendResourceListChanged()}sendToolListChanged(){if(this.isConnected())this.server.sendToolListChanged()}sendPromptListChanged(){if(this.isConnected())this.server.sendPromptListChanged()}}var EH={type:"object",properties:{}};function oE(e){return e!==null&&typeof e==="object"&&"parse"in e&&typeof e.parse==="function"&&"safeParse"in e&&typeof e.safeParse==="function"}function sE(e){return"_def"in e||"_zod"in e||oE(e)}function P_(e){if(typeof e!=="object"||e===null)return!1;if(sE(e))return!1;if(Object.keys(e).length===0)return!0;return Object.values(e).some(oE)}function nE(e){if(!e)return;if(P_(e))return Ho(e);if(!sE(e))throw Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return e}function IH(e){let t=Qi(e);if(!t)return[];return Object.entries(t).map(([r,i])=>{let n=m6(i),o=g6(i);return{name:r,description:n,required:!o}})}function lo(e){let r=Qi(e)?.method;if(!r)throw Error("Schema is missing a method literal");let i=Kh(r);if(typeof i==="string")return i;throw Error("Schema method literal must be a string")}function iE(e){return{completion:{values:e.slice(0,100),total:e.length,hasMore:e.length>100}}}var Ic={completion:{values:[],hasMore:!1}};function $H(e,t,r,i,n){let o={};if(n?.searchHint)o["anthropic/searchHint"]=n.searchHint;if(n?.alwaysLoad)o["anthropic/alwaysLoad"]=!0;return{name:e,description:t,inputSchema:r,handler:i,annotations:n?.annotations,_meta:Object.keys(o).length>0?o:void 0}}function TH(e){let t=new A_({name:e.name,version:e.version??"1.0.0"},{capabilities:{tools:e.tools?{}:void 0},instructions:e.instructions});if(e.tools)e.tools.forEach((r)=>{for(let i of Object.values(r.inputSchema)){if(!PH(i))continue;let n=i.description;if(n&&!tn.has(i))tn.add(i,{description:n})}t.registerTool(r.name,{description:r.description,inputSchema:r.inputSchema,annotations:r.annotations,_meta:e.alwaysLoad?{"anthropic/alwaysLoad":!0,...r._meta}:r._meta},r.handler)});return{type:"sdk",name:e.name,instance:t}}function PH(e){return typeof e==="object"&&e!==null&&"_zod"in e}function l1e(e){let t=e.abortController||u6(),r=new Map;if(e.mcpServers)for(let[o,s]of Object.entries(e.mcpServers))if(s.type==="sdk"&&s.instance)r.set(o,s.instance);else throw Error("Browser SDK only supports SDK MCP servers for now");let i;if(e.sse)i=new Lv({streamUrl:e.sse.streamUrl,sendUrl:e.sse.sendUrl,sessionId:e.sse.sessionId,headers:e.sse.headers,abortController:t});else i=new Fv({url:e.websocket.url,headers:e.websocket.headers,authMessage:e.websocket.authMessage,abortController:t});let n=new Ch(i,!1,e.canUseTool,e.hooks,t,r,e.jsonSchema,e.promptSuggestions!==void 0?{promptSuggestions:e.promptSuggestions}:void 0,e.onElicitation,void 0,void 0,e.onUserDialog);return n.streamInput(e.prompt).catch((o)=>t.abort(o)),n}export{qe as z,$H as tool,l1e as query,TH as createSdkMcpServer};
|
|
109
|
+
]`;continue}if(n+=i[v],i[v]==="\\")o=!0;else if(s&&i[v]==="]")s=!1;else if(!s&&i[v]==="[")s=!0}try{new RegExp(n)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return n}function yp(e,t){if(t.target==="openAi")console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");if(t.target==="openApi3"&&e.keyType?._def.typeName===Le.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((i,n)=>({...i,[n]:st(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",n]})??Zt(t)}),{}),additionalProperties:t.rejectedAdditionalProperties};let r={type:"object",additionalProperties:st(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return r;if(e.keyType?._def.typeName===Le.ZodString&&e.keyType._def.checks?.length){let{type:i,...n}=gp(e.keyType._def,t);return{...r,propertyNames:n}}else if(e.keyType?._def.typeName===Le.ZodEnum)return{...r,propertyNames:{enum:e.keyType._def.values}};else if(e.keyType?._def.typeName===Le.ZodBranded&&e.keyType._def.type._def.typeName===Le.ZodString&&e.keyType._def.type._def.checks?.length){let{type:i,...n}=mp(e.keyType._def,t);return{...r,propertyNames:n}}return r}function G6(e,t){if(t.mapStrategy==="record")return yp(e,t);let r=st(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Zt(t),i=st(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Zt(t);return{type:"array",maxItems:125,items:{type:"array",items:[r,i],minItems:2,maxItems:2}}}function J6(e){let t=e.values,i=Object.keys(e.values).filter((o)=>typeof t[t[o]]!=="number").map((o)=>t[o]),n=Array.from(new Set(i.map((o)=>typeof o)));return{type:n.length===1?n[0]==="string"?"string":"number":["string","number"],enum:i}}function X6(e){return e.target==="openAi"?void 0:{not:Zt({...e,currentPath:[...e.currentPath,"not"]})}}function Y6(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var nc={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function ek(e,t){if(t.target==="openApi3")return Q6(e,t);let r=e.options instanceof Map?Array.from(e.options.values()):e.options;if(r.every((i)=>(i._def.typeName in nc)&&(!i._def.checks||!i._def.checks.length))){let i=r.reduce((n,o)=>{let s=nc[o._def.typeName];return s&&!n.includes(s)?[...n,s]:n},[]);return{type:i.length>1?i:i[0]}}else if(r.every((i)=>i._def.typeName==="ZodLiteral"&&!i.description)){let i=r.reduce((n,o)=>{let s=typeof o._def.value;switch(s){case"string":case"number":case"boolean":return[...n,s];case"bigint":return[...n,"integer"];case"object":if(o._def.value===null)return[...n,"null"];case"symbol":case"undefined":case"function":default:return n}},[]);if(i.length===r.length){let n=i.filter((o,s,h)=>h.indexOf(o)===s);return{type:n.length>1?n:n[0],enum:r.reduce((o,s)=>o.includes(s._def.value)?o:[...o,s._def.value],[])}}}else if(r.every((i)=>i._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((i,n)=>[...i,...n._def.values.filter((o)=>!i.includes(o))],[])};return Q6(e,t)}var Q6=(e,t)=>{let r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((i,n)=>st(i._def,{...t,currentPath:[...t.currentPath,"anyOf",`${n}`]})).filter((i)=>!!i&&(!t.strictUnions||typeof i==="object"&&Object.keys(i).length>0));return r.length?{anyOf:r}:void 0};function tk(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length)){if(t.target==="openApi3")return{type:nc[e.innerType._def.typeName],nullable:!0};return{type:[nc[e.innerType._def.typeName],"null"]}}if(t.target==="openApi3"){let i=st(e.innerType._def,{...t,currentPath:[...t.currentPath]});if(i&&"$ref"in i)return{allOf:[i],nullable:!0};return i&&{...i,nullable:!0}}let r=st(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function rk(e,t){let r={type:"number"};if(!e.checks)return r;for(let i of e.checks)switch(i.kind){case"int":r.type="integer",db(r,"type",i.message,t);break;case"min":if(t.target==="jsonSchema7")if(i.inclusive)St(r,"minimum",i.value,i.message,t);else St(r,"exclusiveMinimum",i.value,i.message,t);else{if(!i.inclusive)r.exclusiveMinimum=!0;St(r,"minimum",i.value,i.message,t)}break;case"max":if(t.target==="jsonSchema7")if(i.inclusive)St(r,"maximum",i.value,i.message,t);else St(r,"exclusiveMaximum",i.value,i.message,t);else{if(!i.inclusive)r.exclusiveMaximum=!0;St(r,"maximum",i.value,i.message,t)}break;case"multipleOf":St(r,"multipleOf",i.value,i.message,t);break}return r}function nk(e,t){let r=t.target==="openAi",i={type:"object",properties:{}},n=[],o=e.shape();for(let h in o){let v=o[h];if(v===void 0||v._def===void 0)continue;let b=JD(v);if(b&&r){if(v._def.typeName==="ZodOptional")v=v._def.innerType;if(!v.isNullable())v=v.nullable();b=!1}let _=st(v._def,{...t,currentPath:[...t.currentPath,"properties",h],propertyPath:[...t.currentPath,"properties",h]});if(_===void 0)continue;if(i.properties[h]=_,!b)n.push(h)}if(n.length)i.required=n;let s=GD(e,t);if(s!==void 0)i.additionalProperties=s;return i}function GD(e,t){if(e.catchall._def.typeName!=="ZodNever")return st(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function JD(e){try{return e.isOptional()}catch{return!0}}var ik=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return st(e.innerType._def,t);let r=st(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:Zt(t)},r]}:Zt(t)};var ok=(e,t)=>{if(t.pipeStrategy==="input")return st(e.in._def,t);else if(t.pipeStrategy==="output")return st(e.out._def,t);let r=st(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),i=st(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,i].filter((n)=>n!==void 0)}};function sk(e,t){return st(e.type._def,t)}function ak(e,t){let i={type:"array",uniqueItems:!0,items:st(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};if(e.minSize)St(i,"minItems",e.minSize.value,e.minSize.message,t);if(e.maxSize)St(i,"maxItems",e.maxSize.value,e.maxSize.message,t);return i}function uk(e,t){if(e.rest)return{type:"array",minItems:e.items.length,items:e.items.map((r,i)=>st(r._def,{...t,currentPath:[...t.currentPath,"items",`${i}`]})).reduce((r,i)=>i===void 0?r:[...r,i],[]),additionalItems:st(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})};else return{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((r,i)=>st(r._def,{...t,currentPath:[...t.currentPath,"items",`${i}`]})).reduce((r,i)=>i===void 0?r:[...r,i],[])}}function lk(e){return{not:Zt(e)}}function ck(e){return Zt(e)}var dk=(e,t)=>st(e.innerType._def,t);var fk=(e,t,r)=>{switch(t){case Le.ZodString:return gp(e,r);case Le.ZodNumber:return rk(e,r);case Le.ZodObject:return nk(e,r);case Le.ZodBigInt:return L6(e,r);case Le.ZodBoolean:return F6();case Le.ZodDate:return fb(e,r);case Le.ZodUndefined:return lk(r);case Le.ZodNull:return Y6(r);case Le.ZodArray:return U6(e,r);case Le.ZodUnion:case Le.ZodDiscriminatedUnion:return ek(e,r);case Le.ZodIntersection:return K6(e,r);case Le.ZodTuple:return uk(e,r);case Le.ZodRecord:return yp(e,r);case Le.ZodLiteral:return V6(e,r);case Le.ZodEnum:return Z6(e);case Le.ZodNativeEnum:return J6(e);case Le.ZodNullable:return tk(e,r);case Le.ZodOptional:return ik(e,r);case Le.ZodMap:return G6(e,r);case Le.ZodSet:return ak(e,r);case Le.ZodLazy:return()=>e.getter()._def;case Le.ZodPromise:return sk(e,r);case Le.ZodNaN:case Le.ZodNever:return X6(r);case Le.ZodEffects:return H6(e,r);case Le.ZodAny:return Zt(r);case Le.ZodUnknown:return ck(r);case Le.ZodDefault:return B6(e,r);case Le.ZodBranded:return mp(e,r);case Le.ZodReadonly:return dk(e,r);case Le.ZodCatch:return q6(e,r);case Le.ZodPipeline:return ok(e,r);case Le.ZodFunction:case Le.ZodVoid:case Le.ZodSymbol:return;default:return((i)=>{return})(t)}};function st(e,t,r=!1){let i=t.seen.get(e);if(t.override){let h=t.override?.(e,t,i,r);if(h!==N6)return h}if(i&&!r){let h=XD(i,t);if(h!==void 0)return h}let n={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,n);let o=fk(e,e.typeName,t),s=typeof o==="function"?st(o(),t):o;if(s)YD(e,t,s);if(t.postProcess){let h=t.postProcess(s,e,t);return n.jsonSchema=s,h}return n.jsonSchema=s,s}var XD=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:pp(t.currentPath,e.path)};case"none":case"seen":{if(e.path.length<t.currentPath.length&&e.path.every((r,i)=>t.currentPath[i]===r))return console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),Zt(t);return t.$refStrategy==="seen"?Zt(t):void 0}}},YD=(e,t,r)=>{if(e.description){if(r.description=e.description,t.markdownDescription)r.markdownDescription=e.description}return r};var mb=(e,t)=>{let r=j6(t),i=typeof t==="object"&&t.definitions?Object.entries(t.definitions).reduce((v,[b,_])=>({...v,[b]:st(_._def,{...r,currentPath:[...r.basePath,r.definitionPath,b]},!0)??Zt(r)}),{}):void 0,n=typeof t==="string"?t:t?.nameStrategy==="title"?void 0:t?.name,o=st(e._def,n===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,n]},!1)??Zt(r),s=typeof t==="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;if(s!==void 0)o.title=s;if(r.flags.hasReferencedOpenAiAnyType){if(!i)i={};if(!i[r.openAiAnyTypeName])i[r.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:r.$refStrategy==="relative"?"1":[...r.basePath,r.definitionPath,r.openAiAnyTypeName].join("/")}}}let h=n===void 0?i?{...o,[r.definitionPath]:i}:o:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,n].join("/"),[r.definitionPath]:{...i,[n]:o}};if(r.target==="jsonSchema7")h.$schema="http://json-schema.org/draft-07/schema#";else if(r.target==="jsonSchema2019-09"||r.target==="openAi")h.$schema="https://json-schema.org/draft/2019-09/schema#";if(r.target==="openAi"&&(("anyOf"in h)||("oneOf"in h)||("allOf"in h)||("type"in h)&&Array.isArray(h.type)))console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.");return h};function QD(e){if(!e)return"draft-7";if(e==="jsonSchema7"||e==="draft-7")return"draft-7";if(e==="jsonSchema2019-09"||e==="draft-2020-12")return"draft-2020-12";return"draft-7"}function gb(e,t){if(Tn(e))return xs(e,{target:QD(t?.target),io:t?.pipeStrategy??"input"});return mb(e,{strictUnions:t?.strictUnions??!0,pipeStrategy:t?.pipeStrategy??"input"})}function yb(e){let r=Qi(e)?.method;if(!r)throw Error("Schema is missing a method literal");let i=Kh(r);if(typeof i!=="string")throw Error("Schema method literal must be a string");return i}function vb(e,t){let r=Yi(e,t);if(!r.success)throw r.error;return r.data}var eN=60000;class bb{constructor(e){if(this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Xh,(t)=>{this._oncancel(t)}),this.setNotificationHandler(Qh,(t)=>{this._onprogress(t)}),this.setRequestHandler(Yh,(t)=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore)this.setRequestHandler(ep,async(t,r)=>{let i=await this._taskStore.getTask(t.params.taskId,r.sessionId);if(!i)throw new rt(it.InvalidParams,"Failed to retrieve task: Task not found");return{...i}}),this.setRequestHandler(rp,async(t,r)=>{let i=async()=>{let n=t.params.taskId;if(this._taskMessageQueue){let s;while(s=await this._taskMessageQueue.dequeue(n,r.sessionId)){if(s.type==="response"||s.type==="error"){let h=s.message,v=h.id,b=this._requestResolvers.get(v);if(b)if(this._requestResolvers.delete(v),s.type==="response")b(h);else{let _=h,g=new rt(_.error.code,_.error.message,_.error.data);b(g)}else{let _=s.type==="response"?"Response":"Error";this._onerror(Error(`${_} handler missing for request ${v}`))}continue}await this._transport?.send(s.message,{relatedRequestId:r.requestId})}}let o=await this._taskStore.getTask(n,r.sessionId);if(!o)throw new rt(it.InvalidParams,`Task not found: ${n}`);if(!to(o.status))return await this._waitForTaskUpdate(n,r.signal),await i();if(to(o.status)){let s=await this._taskStore.getTaskResult(n,r.sessionId);return this._clearTaskQueue(n),{...s,_meta:{...s._meta,[eo]:{taskId:n}}}}return await i()};return await i()}),this.setRequestHandler(np,async(t,r)=>{try{let{tasks:i,nextCursor:n}=await this._taskStore.listTasks(t.params?.cursor,r.sessionId);return{tasks:i,nextCursor:n,_meta:{}}}catch(i){throw new rt(it.InvalidParams,`Failed to list tasks: ${i instanceof Error?i.message:String(i)}`)}}),this.setRequestHandler(op,async(t,r)=>{try{let i=await this._taskStore.getTask(t.params.taskId,r.sessionId);if(!i)throw new rt(it.InvalidParams,`Task not found: ${t.params.taskId}`);if(to(i.status))throw new rt(it.InvalidParams,`Cannot cancel task in terminal status: ${i.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",r.sessionId),this._clearTaskQueue(t.params.taskId);let n=await this._taskStore.getTask(t.params.taskId,r.sessionId);if(!n)throw new rt(it.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...n}}catch(i){if(i instanceof rt)throw i;throw new rt(it.InvalidRequest,`Failed to cancel task: ${i instanceof Error?i.message:String(i)}`)}})}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,r,i,n=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(i,t),startTime:Date.now(),timeout:t,maxTotalTimeout:r,resetTimeoutOnProgress:n,onTimeout:i})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let r=Date.now()-t.startTime;if(t.maxTotalTimeout&&r>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),rt.fromError(it.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:r});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);if(t)clearTimeout(t.timeoutId),this._timeoutInfo.delete(e)}async connect(e){if(this._transport)throw Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};let r=this.transport?.onerror;this._transport.onerror=(n)=>{r?.(n),this._onerror(n)};let i=this._transport?.onmessage;this._transport.onmessage=(n,o)=>{if(i?.(n,o),Wl(n)||k6(n))this._onresponse(n);else if(Xv(n))this._onrequest(n,o);else if(x6(n))this._onnotification(n);else this._onerror(Error(`Unknown message type: ${JSON.stringify(n)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let r of this._timeoutInfo.values())clearTimeout(r.timeoutId);this._timeoutInfo.clear();for(let r of this._requestHandlerAbortControllers.values())r.abort();this._requestHandlerAbortControllers.clear();let t=rt.fromError(it.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let r of e.values())r(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){let t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;if(t===void 0)return;Promise.resolve().then(()=>t(e)).catch((r)=>this._onerror(Error(`Uncaught error in notification handler: ${r}`)))}_onrequest(e,t){let r=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,i=this._transport,n=e.params?._meta?.[eo]?.taskId;if(r===void 0){let b={jsonrpc:"2.0",id:e.id,error:{code:it.MethodNotFound,message:"Method not found"}};if(n&&this._taskMessageQueue)this._enqueueTaskMessage(n,{type:"error",message:b,timestamp:Date.now()},i?.sessionId).catch((_)=>this._onerror(Error(`Failed to enqueue error response: ${_}`)));else i?.send(b).catch((_)=>this._onerror(Error(`Failed to send an error response: ${_}`)));return}let o=new AbortController;this._requestHandlerAbortControllers.set(e.id,o);let s=_6(e.params)?e.params.task:void 0,h=this._taskStore?this.requestTaskStore(e,i?.sessionId):void 0,v={signal:o.signal,sessionId:i?.sessionId,_meta:e.params?._meta,sendNotification:async(b)=>{if(o.signal.aborted)return;let _={relatedRequestId:e.id};if(n)_.relatedTask={taskId:n};await this.notification(b,_)},sendRequest:async(b,_,g)=>{if(o.signal.aborted)throw new rt(it.ConnectionClosed,"Request was cancelled");let S={...g,relatedRequestId:e.id};if(n&&!S.relatedTask)S.relatedTask={taskId:n};let x=S.relatedTask?.taskId??n;if(x&&h)await h.updateTaskStatus(x,"input_required");return await this.request(b,_,S)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:n,taskStore:h,taskRequestedTtl:s?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{if(s)this.assertTaskHandlerCapability(e.method)}).then(()=>r(e,v)).then(async(b)=>{if(o.signal.aborted)return;let _={result:b,jsonrpc:"2.0",id:e.id};if(n&&this._taskMessageQueue)await this._enqueueTaskMessage(n,{type:"response",message:_,timestamp:Date.now()},i?.sessionId);else await i?.send(_)},async(b)=>{if(o.signal.aborted)return;let _={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(b.code)?b.code:it.InternalError,message:b.message??"Internal error",...b.data!==void 0&&{data:b.data}}};if(n&&this._taskMessageQueue)await this._enqueueTaskMessage(n,{type:"error",message:_,timestamp:Date.now()},i?.sessionId);else await i?.send(_)}).catch((b)=>this._onerror(Error(`Failed to send response: ${b}`))).finally(()=>{if(this._requestHandlerAbortControllers.get(e.id)===o)this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:t,...r}=e.params,i=Number(t),n=this._progressHandlers.get(i);if(!n){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let o=this._responseHandlers.get(i),s=this._timeoutInfo.get(i);if(s&&o&&s.resetTimeoutOnProgress)try{this._resetTimeout(i)}catch(h){this._responseHandlers.delete(i),this._progressHandlers.delete(i),this._cleanupTimeout(i),o(h);return}n(r)}_onresponse(e){let t=Number(e.id),r=this._requestResolvers.get(t);if(r){if(this._requestResolvers.delete(t),Wl(e))r(e);else{let o=new rt(e.error.code,e.error.message,e.error.data);r(o)}return}let i=this._responseHandlers.get(t);if(i===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let n=!1;if(Wl(e)&&e.result&&typeof e.result==="object"){let o=e.result;if(o.task&&typeof o.task==="object"){let s=o.task;if(typeof s.taskId==="string")n=!0,this._taskProgressTokens.set(s.taskId,t)}}if(!n)this._progressHandlers.delete(t);if(Wl(e))i(e);else{let o=rt.fromError(e.error.code,e.error.message,e.error.data);i(o)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,r){let{task:i}=r??{};if(!i){try{yield{type:"result",result:await this.request(e,t,r)}}catch(o){yield{type:"error",error:o instanceof rt?o:new rt(it.InternalError,String(o))}}return}let n;try{let o=await this.request(e,Ys,r);if(o.task)n=o.task.taskId,yield{type:"taskCreated",task:o.task};else throw new rt(it.InternalError,"Task creation did not return a task");while(!0){let s=await this.getTask({taskId:n},r);if(yield{type:"taskStatus",task:s},to(s.status)){if(s.status==="completed")yield{type:"result",result:await this.getTaskResult({taskId:n},t,r)};else if(s.status==="failed")yield{type:"error",error:new rt(it.InternalError,`Task ${n} failed`)};else if(s.status==="cancelled")yield{type:"error",error:new rt(it.InternalError,`Task ${n} was cancelled`)};return}if(s.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:n},t,r)};return}let h=s.pollInterval??this._options?.defaultTaskPollInterval??1000;await new Promise((v)=>setTimeout(v,h)),r?.signal?.throwIfAborted()}}catch(o){yield{type:"error",error:o instanceof rt?o:new rt(it.InternalError,String(o))}}}request(e,t,r){let{relatedRequestId:i,resumptionToken:n,onresumptiontoken:o,task:s,relatedTask:h}=r??{};return new Promise((v,b)=>{let _=(T)=>{b(T)};if(!this._transport){_(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{if(this.assertCapabilityForMethod(e.method),s)this.assertTaskCapability(e.method)}catch(T){_(T);return}r?.signal?.throwIfAborted();let g=this._requestMessageId++,S={...e,jsonrpc:"2.0",id:g};if(r?.onprogress)this._progressHandlers.set(g,r.onprogress),S.params={...e.params,_meta:{...e.params?._meta||{},progressToken:g}};if(s)S.params={...S.params,task:s};if(h)S.params={...S.params,_meta:{...S.params?._meta||{},[eo]:h}};let x=(T)=>{this._responseHandlers.delete(g),this._progressHandlers.delete(g),this._cleanupTimeout(g),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:g,reason:String(T)}},{relatedRequestId:i,resumptionToken:n,onresumptiontoken:o}).catch((R)=>this._onerror(Error(`Failed to send cancellation: ${R}`)));let P=T instanceof rt?T:new rt(it.RequestTimeout,String(T));b(P)};this._responseHandlers.set(g,(T)=>{if(r?.signal?.aborted)return;if(T instanceof Error)return b(T);try{let P=Yi(t,T.result);if(!P.success)b(P.error);else v(P.data)}catch(P){b(P)}}),r?.signal?.addEventListener("abort",()=>{x(r?.signal?.reason)});let M=r?.timeout??eN,I=()=>x(rt.fromError(it.RequestTimeout,"Request timed out",{timeout:M}));this._setupTimeout(g,M,r?.maxTotalTimeout,I,r?.resetTimeoutOnProgress??!1);let $=h?.taskId;if($){let T=(P)=>{let R=this._responseHandlers.get(g);if(R)R(P);else this._onerror(Error(`Response handler missing for side-channeled request ${g}`))};this._requestResolvers.set(g,T),this._enqueueTaskMessage($,{type:"request",message:S,timestamp:Date.now()}).catch((P)=>{this._cleanupTimeout(g),b(P)})}else this._transport.send(S,{relatedRequestId:i,resumptionToken:n,onresumptiontoken:o}).catch((T)=>{this._cleanupTimeout(g),b(T)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},tp,t)}async getTaskResult(e,t,r){return this.request({method:"tasks/result",params:e},t,r)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},ip,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},E6,t)}async notification(e,t){if(!this._transport)throw Error("Not connected");this.assertNotificationCapability(e.method);let r=t?.relatedTask?.taskId;if(r){let s={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[eo]:t.relatedTask}}};await this._enqueueTaskMessage(r,{type:"notification",message:s,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let s={...e,jsonrpc:"2.0"};if(t?.relatedTask)s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[eo]:t.relatedTask}}};this._transport?.send(s,t).catch((h)=>this._onerror(h))});return}let o={...e,jsonrpc:"2.0"};if(t?.relatedTask)o={...o,params:{...o.params,_meta:{...o.params?._meta||{},[eo]:t.relatedTask}}};await this._transport.send(o,t)}setRequestHandler(e,t){let r=yb(e);this.assertRequestHandlerCapability(r),this._requestHandlers.set(r,(i,n)=>{let o=vb(e,i);return Promise.resolve(t(o,n))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){let r=yb(e);this._notificationHandlers.set(r,(i)=>{let n=vb(e,i);return Promise.resolve(t(n))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let t=this._taskProgressTokens.get(e);if(t!==void 0)this._progressHandlers.delete(t),this._taskProgressTokens.delete(e)}async _enqueueTaskMessage(e,t,r){if(!this._taskStore||!this._taskMessageQueue)throw Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let i=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,r,i)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){let r=await this._taskMessageQueue.dequeueAll(e,t);for(let i of r)if(i.type==="request"&&Xv(i.message)){let n=i.message.id,o=this._requestResolvers.get(n);if(o)o(new rt(it.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(n);else this._onerror(Error(`Resolver missing for request ${n} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let r=this._options?.defaultTaskPollInterval??1000;try{let i=await this._taskStore?.getTask(e);if(i?.pollInterval)r=i.pollInterval}catch{}return new Promise((i,n)=>{if(t.aborted){n(new rt(it.InvalidRequest,"Request cancelled"));return}let o=setTimeout(i,r);t.addEventListener("abort",()=>{clearTimeout(o),n(new rt(it.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){let r=this._taskStore;if(!r)throw Error("No task store configured");return{createTask:async(i)=>{if(!e)throw Error("No request provided");return await r.createTask(i,e.id,{method:e.method,params:e.params},t)},getTask:async(i)=>{let n=await r.getTask(i,t);if(!n)throw new rt(it.InvalidParams,"Failed to retrieve task: Task not found");return n},storeTaskResult:async(i,n,o)=>{await r.storeTaskResult(i,n,o,t);let s=await r.getTask(i,t);if(s){let h=Ql.parse({method:"notifications/tasks/status",params:s});if(await this.notification(h),to(s.status))this._cleanupTaskProgressHandler(i)}},getTaskResult:(i)=>r.getTaskResult(i,t),updateTaskStatus:async(i,n,o)=>{let s=await r.getTask(i,t);if(!s)throw new rt(it.InvalidParams,`Task "${i}" not found - it may have been cleaned up`);if(to(s.status))throw new rt(it.InvalidParams,`Cannot update task "${i}" from terminal status "${s.status}" to "${n}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await r.updateTaskStatus(i,n,o,t);let h=await r.getTask(i,t);if(h){let v=Ql.parse({method:"notifications/tasks/status",params:h});if(await this.notification(v),to(h.status))this._cleanupTaskProgressHandler(i)}},listTasks:(i)=>r.listTasks(i,t)}}}function hk(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function pk(e,t){let r={...e};for(let i in t){let n=i,o=t[n];if(o===void 0)continue;let s=r[n];if(hk(s)&&hk(o))r[n]={...s,...o};else r[n]=o}return r}var JE=N_(p_(),1),XE=N_(GE(),1);function SH(){let e=new JE.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return XE.default(e),e}class k_{constructor(e){this._ajv=e??SH()}getValidator(e){let t="$id"in e&&typeof e.$id==="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return(r)=>{if(t(r))return{valid:!0,data:r,errorMessage:void 0};else return{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}}class M_{constructor(e){this._server=e}requestStream(e,t,r){return this._server.requestStream(e,t,r)}createMessageStream(e,t){let r=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!r?.sampling?.tools)throw Error("Client does not support sampling tools capability.");if(e.messages.length>0){let i=e.messages[e.messages.length-1],n=Array.isArray(i.content)?i.content:[i.content],o=n.some((b)=>b.type==="tool_result"),s=e.messages.length>1?e.messages[e.messages.length-2]:void 0,h=s?Array.isArray(s.content)?s.content:[s.content]:[],v=h.some((b)=>b.type==="tool_use");if(o){if(n.some((b)=>b.type!=="tool_result"))throw Error("The last message must contain only tool_result content if any is present");if(!v)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(v){let b=new Set(h.filter((g)=>g.type==="tool_use").map((g)=>g.id)),_=new Set(n.filter((g)=>g.type==="tool_result").map((g)=>g.toolUseId));if(b.size!==_.size||![...b].every((g)=>_.has(g)))throw Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:e},rc,t)}elicitInputStream(e,t){let r=this._server.getClientCapabilities(),i=e.mode??"form";switch(i){case"url":{if(!r?.elicitation?.url)throw Error("Client does not support url elicitation.");break}case"form":{if(!r?.elicitation?.form)throw Error("Client does not support form elicitation.");break}}let n=i==="form"&&e.mode===void 0?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:n},ta,t)}async getTask(e,t){return this._server.getTask({taskId:e},t)}async getTaskResult(e,t,r){return this._server.getTaskResult({taskId:e},t,r)}async listTasks(e,t){return this._server.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._server.cancelTask({taskId:e},t)}}function YE(e,t,r){if(!e)throw Error(`${r} does not support task creation (required for ${t})`);switch(t){case"tools/call":if(!e.tools?.call)throw Error(`${r} does not support task creation for tools/call (required for ${t})`);break;default:break}}function QE(e,t,r){if(!e)throw Error(`${r} does not support task creation (required for ${t})`);switch(t){case"sampling/createMessage":if(!e.sampling?.createMessage)throw Error(`${r} does not support task creation for sampling/createMessage (required for ${t})`);break;case"elicitation/create":if(!e.elicitation?.create)throw Error(`${r} does not support task creation for elicitation/create (required for ${t})`);break;default:break}}class E_ extends bb{constructor(e,t){super(t);if(this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(tc.options.map((r,i)=>[r,i])),this.isMessageIgnored=(r,i)=>{let n=this._loggingLevels.get(i);return n?this.LOG_LEVEL_SEVERITY.get(r)<this.LOG_LEVEL_SEVERITY.get(n):!1},this._capabilities=t?.capabilities??{},this._instructions=t?.instructions,this._jsonSchemaValidator=t?.jsonSchemaValidator??new k_,this.setRequestHandler(eb,(r)=>this._oninitialize(r)),this.setNotificationHandler(tb,()=>this.oninitialized?.()),this._capabilities.logging)this.setRequestHandler(ub,async(r,i)=>{let n=i.sessionId||i.requestInfo?.headers["mcp-session-id"]||void 0,{level:o}=r.params,s=tc.safeParse(o);if(s.success)this._loggingLevels.set(n,s.data);return{}})}get experimental(){if(!this._experimental)this._experimental={tasks:new M_(this)};return this._experimental}registerCapabilities(e){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=pk(this._capabilities,e)}setRequestHandler(e,t){let i=Qi(e)?.method;if(!i)throw Error("Schema is missing a method literal");let n;if(Tn(i)){let s=i;n=s._zod?.def?.value??s.value}else{let s=i;n=s._def?.value??s.value}if(typeof n!=="string")throw Error("Schema method literal must be a string");if(n==="tools/call"){let s=async(h,v)=>{let b=Yi(ea,h);if(!b.success){let x=b.error instanceof Error?b.error.message:String(b.error);throw new rt(it.InvalidParams,`Invalid tools/call request: ${x}`)}let{params:_}=b.data,g=await Promise.resolve(t(h,v));if(_.task){let x=Yi(Ys,g);if(!x.success){let M=x.error instanceof Error?x.error.message:String(x.error);throw new rt(it.InvalidParams,`Invalid task creation result: ${M}`)}return x.data}let S=Yi(fp,g);if(!S.success){let x=S.error instanceof Error?S.error.message:String(S.error);throw new rt(it.InvalidParams,`Invalid tools/call result: ${x}`)}return S.data};return super.setRequestHandler(e,s)}return super.setRequestHandler(e,t)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(!this._capabilities)return;switch(e){case"completion/complete":if(!this._capabilities.completions)throw Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw Error(`Server does not support tasks capability (required for ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){QE(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){if(!this._capabilities)return;YE(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let t=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:y6.includes(t)?t:Gv,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},Jh)}async createMessage(e,t){if(e.tools||e.toolChoice){if(!this._clientCapabilities?.sampling?.tools)throw Error("Client does not support sampling tools capability.")}if(e.messages.length>0){let r=e.messages[e.messages.length-1],i=Array.isArray(r.content)?r.content:[r.content],n=i.some((v)=>v.type==="tool_result"),o=e.messages.length>1?e.messages[e.messages.length-2]:void 0,s=o?Array.isArray(o.content)?o.content:[o.content]:[],h=s.some((v)=>v.type==="tool_use");if(n){if(i.some((v)=>v.type!=="tool_result"))throw Error("The last message must contain only tool_result content if any is present");if(!h)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(h){let v=new Set(s.filter((_)=>_.type==="tool_use").map((_)=>_.id)),b=new Set(i.filter((_)=>_.type==="tool_result").map((_)=>_.toolUseId));if(v.size!==b.size||![...v].every((_)=>b.has(_)))throw Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}if(e.tools)return this.request({method:"sampling/createMessage",params:e},lb,t);return this.request({method:"sampling/createMessage",params:e},rc,t)}async elicitInput(e,t){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw Error("Client does not support url elicitation.");let i=e;return this.request({method:"elicitation/create",params:i},ta,t)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw Error("Client does not support form elicitation.");let i=e.mode==="form"?e:{...e,mode:"form"},n=await this.request({method:"elicitation/create",params:i},ta,t);if(n.action==="accept"&&n.content&&i.requestedSchema)try{let s=this._jsonSchemaValidator.getValidator(i.requestedSchema)(n.content);if(!s.valid)throw new rt(it.InvalidParams,`Elicitation response content does not match requested schema: ${s.errorMessage}`)}catch(o){if(o instanceof rt)throw o;throw new rt(it.InternalError,`Error validating elicitation response: ${o instanceof Error?o.message:String(o)}`)}return n}}}createElicitationCompletionNotifier(e,t){if(!this._clientCapabilities?.elicitation?.url)throw Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},t)}async listRoots(e,t){return this.request({method:"roots/list",params:e},cb,t)}async sendLoggingMessage(e,t){if(this._capabilities.logging){if(!this.isMessageIgnored(e.level,t))return this.notification({method:"notifications/message",params:e})}}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}var t8=Symbol.for("mcp.completable");function I_(e){return!!e&&typeof e==="object"&&t8 in e}function r8(e){return e[t8]?.complete}var e8;(function(e){e.Completable="McpCompletable"})(e8||(e8={}));var xH=/^[A-Za-z0-9._-]{1,128}$/;function kH(e){let t=[];if(e.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(e.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${e.length})`]};if(e.includes(" "))t.push("Tool name contains spaces, which may cause parsing issues");if(e.includes(","))t.push("Tool name contains commas, which may cause parsing issues");if(e.startsWith("-")||e.endsWith("-"))t.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts");if(e.startsWith(".")||e.endsWith("."))t.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts");if(!xH.test(e)){let r=e.split("").filter((i)=>!/[A-Za-z0-9._-]/.test(i)).filter((i,n,o)=>o.indexOf(i)===n);return t.push(`Tool name contains invalid characters: ${r.map((i)=>`"${i}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:t}}return{isValid:!0,warnings:t}}function MH(e,t){if(t.length>0){console.warn(`Tool name validation warning for "${e}":`);for(let r of t)console.warn(` - ${r}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function $_(e){let t=kH(e);return MH(e,t.warnings),t.isValid}class T_{constructor(e){this._mcpServer=e}registerToolTask(e,t,r){let i={taskSupport:"required",...t.execution};if(i.taskSupport==="forbidden")throw Error(`Cannot register task-based tool '${e}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(e,t.title,t.description,t.inputSchema,t.outputSchema,t.annotations,i,t._meta,r)}}class A_{constructor(e,t){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new E_(e,t)}get experimental(){if(!this._experimental)this._experimental={tasks:new T_(this)};return this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){if(this._toolHandlersInitialized)return;this.server.assertCanSetRequestHandler(lo(dp)),this.server.assertCanSetRequestHandler(lo(ea)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(dp,()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,t])=>{let r={name:e,title:t.title,description:t.description,inputSchema:(()=>{let i=Js(t.inputSchema);return i?gb(i,{strictUnions:!0,pipeStrategy:"input"}):EH})(),annotations:t.annotations,execution:t.execution,_meta:t._meta};if(t.outputSchema){let i=Js(t.outputSchema);if(i)r.outputSchema=gb(i,{strictUnions:!0,pipeStrategy:"output"})}return r})})),this.server.setRequestHandler(ea,async(e,t)=>{try{let r=this._registeredTools[e.params.name];if(!r)throw new rt(it.InvalidParams,`Tool ${e.params.name} not found`);if(!r.enabled)throw new rt(it.InvalidParams,`Tool ${e.params.name} disabled`);let i=!!e.params.task,n=r.execution?.taskSupport,o="createTask"in r.handler;if((n==="required"||n==="optional")&&!o)throw new rt(it.InternalError,`Tool ${e.params.name} has taskSupport '${n}' but was not registered with registerToolTask`);if(n==="required"&&!i)throw new rt(it.MethodNotFound,`Tool ${e.params.name} requires task augmentation (taskSupport: 'required')`);if(n==="optional"&&!i&&o)return await this.handleAutomaticTaskPolling(r,e,t);let s=await this.validateToolInput(r,e.params.arguments,e.params.name),h=await this.executeToolHandler(r,s,t);if(i)return h;return await this.validateToolOutput(r,h,e.params.name),h}catch(r){if(r instanceof rt){if(r.code===it.UrlElicitationRequired)throw r}return this.createToolError(r instanceof Error?r.message:String(r))}}),this._toolHandlersInitialized=!0}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,t,r){if(!e.inputSchema)return;let n=Js(e.inputSchema)??e.inputSchema,o=await Hh(n,t);if(!o.success){let s="error"in o?o.error:"Unknown error",h=Zh(s);throw new rt(it.InvalidParams,`Input validation error: Invalid arguments for tool ${r}: ${h}`)}return o.data}async validateToolOutput(e,t,r){if(!e.outputSchema)return;if(!("content"in t))return;if(t.isError)return;if(!t.structuredContent)throw new rt(it.InvalidParams,`Output validation error: Tool ${r} has an output schema but no structured content was provided`);let i=Js(e.outputSchema),n=await Hh(i,t.structuredContent);if(!n.success){let o="error"in n?n.error:"Unknown error",s=Zh(o);throw new rt(it.InvalidParams,`Output validation error: Invalid structured content for tool ${r}: ${s}`)}}async executeToolHandler(e,t,r){let i=e.handler;if("createTask"in i){if(!r.taskStore)throw Error("No task store provided.");let o={...r,taskStore:r.taskStore};if(e.inputSchema)return await Promise.resolve(i.createTask(t,o));else return await Promise.resolve(i.createTask(o))}if(e.inputSchema)return await Promise.resolve(i(t,r));else return await Promise.resolve(i(r))}async handleAutomaticTaskPolling(e,t,r){if(!r.taskStore)throw Error("No task store provided for task-capable tool.");let i=await this.validateToolInput(e,t.params.arguments,t.params.name),n=e.handler,o={...r,taskStore:r.taskStore},s=i?await Promise.resolve(n.createTask(i,o)):await Promise.resolve(n.createTask(o)),h=s.task.taskId,v=s.task,b=v.pollInterval??5000;while(v.status!=="completed"&&v.status!=="failed"&&v.status!=="cancelled"){await new Promise((g)=>setTimeout(g,b));let _=await r.taskStore.getTask(h);if(!_)throw new rt(it.InternalError,`Task ${h} not found during polling`);v=_}return await r.taskStore.getTaskResult(h)}setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler(lo(hp)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(hp,async(e)=>{switch(e.params.ref.type){case"ref/prompt":return R6(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return C6(e),this.handleResourceCompletion(e,e.params.ref);default:throw new rt(it.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion(e,t){let r=this._registeredPrompts[t.name];if(!r)throw new rt(it.InvalidParams,`Prompt ${t.name} not found`);if(!r.enabled)throw new rt(it.InvalidParams,`Prompt ${t.name} disabled`);if(!r.argsSchema)return Ic;let n=Qi(r.argsSchema)?.[e.params.argument.name];if(!I_(n))return Ic;let o=r8(n);if(!o)return Ic;let s=await o(e.params.argument.value,e.params.context);return i8(s)}async handleResourceCompletion(e,t){let r=Object.values(this._registeredResourceTemplates).find((o)=>o.resourceTemplate.uriTemplate.toString()===t.uri);if(!r){if(this._registeredResources[t.uri])return Ic;throw new rt(it.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let i=r.resourceTemplate.completeCallback(e.params.argument.name);if(!i)return Ic;let n=await i(e.params.argument.value,e.params.context);return i8(n)}setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler(lo(sp)),this.server.assertCanSetRequestHandler(lo(ap)),this.server.assertCanSetRequestHandler(lo(up)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(sp,async(e,t)=>{let r=Object.entries(this._registeredResources).filter(([n,o])=>o.enabled).map(([n,o])=>({uri:n,name:o.name,...o.metadata})),i=[];for(let n of Object.values(this._registeredResourceTemplates)){if(!n.resourceTemplate.listCallback)continue;let o=await n.resourceTemplate.listCallback(t);for(let s of o.resources)i.push({...n.metadata,...s})}return{resources:[...r,...i]}}),this.server.setRequestHandler(ap,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([t,r])=>({name:t,uriTemplate:r.resourceTemplate.uriTemplate.toString(),...r.metadata}))})),this.server.setRequestHandler(up,async(e,t)=>{let r=new URL(e.params.uri),i=this._registeredResources[r.toString()];if(i){if(!i.enabled)throw new rt(it.InvalidParams,`Resource ${r} disabled`);return i.readCallback(r,t)}for(let n of Object.values(this._registeredResourceTemplates)){let o=n.resourceTemplate.uriTemplate.match(r.toString());if(o)return n.readCallback(r,o,t)}throw new rt(it.InvalidParams,`Resource ${r} not found`)}),this._resourceHandlersInitialized=!0}setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;this.server.assertCanSetRequestHandler(lo(lp)),this.server.assertCanSetRequestHandler(lo(cp)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(lp,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,t])=>({name:e,title:t.title,description:t.description,arguments:t.argsSchema?IH(t.argsSchema):void 0}))})),this.server.setRequestHandler(cp,async(e,t)=>{let r=this._registeredPrompts[e.params.name];if(!r)throw new rt(it.InvalidParams,`Prompt ${e.params.name} not found`);if(!r.enabled)throw new rt(it.InvalidParams,`Prompt ${e.params.name} disabled`);if(r.argsSchema){let i=Js(r.argsSchema),n=await Hh(i,e.params.arguments);if(!n.success){let h="error"in n?n.error:"Unknown error",v=Zh(h);throw new rt(it.InvalidParams,`Invalid arguments for prompt ${e.params.name}: ${v}`)}let o=n.data,s=r.callback;return await Promise.resolve(s(o,t))}else{let i=r.callback;return await Promise.resolve(i(t))}}),this._promptHandlersInitialized=!0}resource(e,t,...r){let i;if(typeof r[0]==="object")i=r.shift();let n=r[0];if(typeof t==="string"){if(this._registeredResources[t])throw Error(`Resource ${t} is already registered`);let o=this._createRegisteredResource(e,void 0,t,i,n);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}else{if(this._registeredResourceTemplates[e])throw Error(`Resource template ${e} is already registered`);let o=this._createRegisteredResourceTemplate(e,void 0,t,i,n);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}}registerResource(e,t,r,i){if(typeof t==="string"){if(this._registeredResources[t])throw Error(`Resource ${t} is already registered`);let n=this._createRegisteredResource(e,r.title,t,r,i);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),n}else{if(this._registeredResourceTemplates[e])throw Error(`Resource template ${e} is already registered`);let n=this._createRegisteredResourceTemplate(e,r.title,t,r,i);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),n}}_createRegisteredResource(e,t,r,i,n){let o={name:e,title:t,metadata:i,readCallback:n,enabled:!0,disable:()=>o.update({enabled:!1}),enable:()=>o.update({enabled:!0}),remove:()=>o.update({uri:null}),update:(s)=>{if(typeof s.uri<"u"&&s.uri!==r){if(delete this._registeredResources[r],s.uri)this._registeredResources[s.uri]=o}if(typeof s.name<"u")o.name=s.name;if(typeof s.title<"u")o.title=s.title;if(typeof s.metadata<"u")o.metadata=s.metadata;if(typeof s.callback<"u")o.readCallback=s.callback;if(typeof s.enabled<"u")o.enabled=s.enabled;this.sendResourceListChanged()}};return this._registeredResources[r]=o,o}_createRegisteredResourceTemplate(e,t,r,i,n){let o={resourceTemplate:r,title:t,metadata:i,readCallback:n,enabled:!0,disable:()=>o.update({enabled:!1}),enable:()=>o.update({enabled:!0}),remove:()=>o.update({name:null}),update:(v)=>{if(typeof v.name<"u"&&v.name!==e){if(delete this._registeredResourceTemplates[e],v.name)this._registeredResourceTemplates[v.name]=o}if(typeof v.title<"u")o.title=v.title;if(typeof v.template<"u")o.resourceTemplate=v.template;if(typeof v.metadata<"u")o.metadata=v.metadata;if(typeof v.callback<"u")o.readCallback=v.callback;if(typeof v.enabled<"u")o.enabled=v.enabled;this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=o;let s=r.uriTemplate.variableNames;if(Array.isArray(s)&&s.some((v)=>!!r.completeCallback(v)))this.setCompletionRequestHandler();return o}_createRegisteredPrompt(e,t,r,i,n){let o={title:t,description:r,argsSchema:i===void 0?void 0:Ho(i),callback:n,enabled:!0,disable:()=>o.update({enabled:!1}),enable:()=>o.update({enabled:!0}),remove:()=>o.update({name:null}),update:(s)=>{if(typeof s.name<"u"&&s.name!==e){if(delete this._registeredPrompts[e],s.name)this._registeredPrompts[s.name]=o}if(typeof s.title<"u")o.title=s.title;if(typeof s.description<"u")o.description=s.description;if(typeof s.argsSchema<"u")o.argsSchema=Ho(s.argsSchema);if(typeof s.callback<"u")o.callback=s.callback;if(typeof s.enabled<"u")o.enabled=s.enabled;this.sendPromptListChanged()}};if(this._registeredPrompts[e]=o,i){if(Object.values(i).some((h)=>{let v=h instanceof $n?h._def?.innerType:h;return I_(v)}))this.setCompletionRequestHandler()}return o}_createRegisteredTool(e,t,r,i,n,o,s,h,v){$_(e);let b={title:t,description:r,inputSchema:n8(i),outputSchema:n8(n),annotations:o,execution:s,_meta:h,handler:v,enabled:!0,disable:()=>b.update({enabled:!1}),enable:()=>b.update({enabled:!0}),remove:()=>b.update({name:null}),update:(_)=>{if(typeof _.name<"u"&&_.name!==e){if(typeof _.name==="string")$_(_.name);if(delete this._registeredTools[e],_.name)this._registeredTools[_.name]=b}if(typeof _.title<"u")b.title=_.title;if(typeof _.description<"u")b.description=_.description;if(typeof _.paramsSchema<"u")b.inputSchema=Ho(_.paramsSchema);if(typeof _.outputSchema<"u")b.outputSchema=Ho(_.outputSchema);if(typeof _.callback<"u")b.handler=_.callback;if(typeof _.annotations<"u")b.annotations=_.annotations;if(typeof _._meta<"u")b._meta=_._meta;if(typeof _.enabled<"u")b.enabled=_.enabled;this.sendToolListChanged()}};return this._registeredTools[e]=b,this.setToolRequestHandlers(),this.sendToolListChanged(),b}tool(e,...t){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let r,i,n,o;if(typeof t[0]==="string")r=t.shift();if(t.length>1){let h=t[0];if(P_(h)){if(i=t.shift(),t.length>1&&typeof t[0]==="object"&&t[0]!==null&&!P_(t[0]))o=t.shift()}else if(typeof h==="object"&&h!==null){if(Object.values(h).some((v)=>typeof v==="object"&&v!==null))throw Error(`Tool ${e} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);o=t.shift()}}let s=t[0];return this._createRegisteredTool(e,void 0,r,i,n,o,{taskSupport:"forbidden"},void 0,s)}registerTool(e,t,r){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let{title:i,description:n,inputSchema:o,outputSchema:s,annotations:h,_meta:v}=t;return this._createRegisteredTool(e,i,n,o,s,h,{taskSupport:"forbidden"},v,r)}prompt(e,...t){if(this._registeredPrompts[e])throw Error(`Prompt ${e} is already registered`);let r;if(typeof t[0]==="string")r=t.shift();let i;if(t.length>1)i=t.shift();let n=t[0],o=this._createRegisteredPrompt(e,void 0,r,i,n);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),o}registerPrompt(e,t,r){if(this._registeredPrompts[e])throw Error(`Prompt ${e} is already registered`);let{title:i,description:n,argsSchema:o}=t,s=this._createRegisteredPrompt(e,i,n,o,r);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),s}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,t){return this.server.sendLoggingMessage(e,t)}sendResourceListChanged(){if(this.isConnected())this.server.sendResourceListChanged()}sendToolListChanged(){if(this.isConnected())this.server.sendToolListChanged()}sendPromptListChanged(){if(this.isConnected())this.server.sendPromptListChanged()}}var EH={type:"object",properties:{}};function o8(e){return e!==null&&typeof e==="object"&&"parse"in e&&typeof e.parse==="function"&&"safeParse"in e&&typeof e.safeParse==="function"}function s8(e){return"_def"in e||"_zod"in e||o8(e)}function P_(e){if(typeof e!=="object"||e===null)return!1;if(s8(e))return!1;if(Object.keys(e).length===0)return!0;return Object.values(e).some(o8)}function n8(e){if(!e)return;if(P_(e))return Ho(e);if(!s8(e))throw Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return e}function IH(e){let t=Qi(e);if(!t)return[];return Object.entries(t).map(([r,i])=>{let n=m6(i),o=g6(i);return{name:r,description:n,required:!o}})}function lo(e){let r=Qi(e)?.method;if(!r)throw Error("Schema is missing a method literal");let i=Kh(r);if(typeof i==="string")return i;throw Error("Schema method literal must be a string")}function i8(e){return{completion:{values:e.slice(0,100),total:e.length,hasMore:e.length>100}}}var Ic={completion:{values:[],hasMore:!1}};function $H(e,t,r,i,n){let o={};if(n?.searchHint)o["anthropic/searchHint"]=n.searchHint;if(n?.alwaysLoad)o["anthropic/alwaysLoad"]=!0;return{name:e,description:t,inputSchema:r,handler:i,annotations:n?.annotations,_meta:Object.keys(o).length>0?o:void 0}}function TH(e){let t=new A_({name:e.name,version:e.version??"1.0.0"},{capabilities:{tools:e.tools?{}:void 0},instructions:e.instructions});if(e.tools)e.tools.forEach((r)=>{for(let i of Object.values(r.inputSchema)){if(!PH(i))continue;let n=i.description;if(n&&!tn.has(i))tn.add(i,{description:n})}t.registerTool(r.name,{description:r.description,inputSchema:r.inputSchema,annotations:r.annotations,_meta:e.alwaysLoad?{"anthropic/alwaysLoad":!0,...r._meta}:r._meta},r.handler)});return{type:"sdk",name:e.name,instance:t}}function PH(e){return typeof e==="object"&&e!==null&&"_zod"in e}function _1e(e){let t=e.abortController||u6(),r=new Map;if(e.mcpServers)for(let[o,s]of Object.entries(e.mcpServers))if(s.type==="sdk"&&s.instance)r.set(o,s.instance);else throw Error("Browser SDK only supports SDK MCP servers for now");let i;if(e.sse)i=new Lv({streamUrl:e.sse.streamUrl,sendUrl:e.sse.sendUrl,sessionId:e.sse.sessionId,headers:e.sse.headers,abortController:t});else i=new Fv({url:e.websocket.url,headers:e.websocket.headers,authMessage:e.websocket.authMessage,abortController:t});let n=new Ch(i,!1,e.canUseTool,e.hooks,t,r,e.jsonSchema,e.promptSuggestions!==void 0?{promptSuggestions:e.promptSuggestions}:void 0,e.onElicitation,void 0,void 0,e.onUserDialog);return n.streamInput(e.prompt).catch((o)=>t.abort(o)),n}export{qe as z,$H as tool,_1e as query,TH as createSdkMcpServer};
|