@gmo-internet/conoha-vps-mcp 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +116 -0
  3. package/README.md +249 -0
  4. package/dist/index.js +234 -0
  5. package/package.json +73 -0
package/dist/index.js ADDED
@@ -0,0 +1,234 @@
1
+ #!/usr/bin/env node
2
+ var uc=Object.create;var qa=Object.defineProperty;var dc=Object.getOwnPropertyDescriptor;var fc=Object.getOwnPropertyNames;var pc=Object.getPrototypeOf,hc=Object.prototype.hasOwnProperty;var J=(a,e)=>()=>(e||a((e={exports:{}}).exports,e),e.exports),mc=(a,e)=>{for(var t in e)qa(a,t,{get:e[t],enumerable:!0})},vc=(a,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of fc(e))!hc.call(a,r)&&r!==t&&qa(a,r,{get:()=>e[r],enumerable:!(s=dc(e,r))||s.enumerable});return a};var gc=(a,e,t)=>(t=a!=null?uc(pc(a)):{},vc(e||!a||!a.__esModule?qa(t,"default",{value:a,enumerable:!0}):t,a));var On=J((na,An)=>{"use strict";(function(a,e){typeof na=="object"&&typeof An<"u"?e(na):typeof define=="function"&&define.amd?define(["exports"],e):e(a.URI=a.URI||{})})(na,(function(a){"use strict";function e(){for(var h=arguments.length,d=Array(h),v=0;v<h;v++)d[v]=arguments[v];if(d.length>1){d[0]=d[0].slice(0,-1);for(var P=d.length-1,x=1;x<P;++x)d[x]=d[x].slice(1,-1);return d[P]=d[P].slice(1),d.join("")}else return d[0]}function t(h){return"(?:"+h+")"}function s(h){return h===void 0?"undefined":h===null?"null":Object.prototype.toString.call(h).split(" ").pop().split("]").shift().toLowerCase()}function r(h){return h.toUpperCase()}function n(h){return h!=null?h instanceof Array?h:typeof h.length!="number"||h.split||h.setInterval||h.call?[h]:Array.prototype.slice.call(h):[]}function l(h,d){var v=h;if(d)for(var P in d)v[P]=d[P];return v}function i(h){var d="[A-Za-z]",v="[\\x0D]",P="[0-9]",x="[\\x22]",N=e(P,"[A-Fa-f]"),K="[\\x0A]",ae="[\\x20]",ie=t(t("%[EFef]"+N+"%"+N+N+"%"+N+N)+"|"+t("%[89A-Fa-f]"+N+"%"+N+N)+"|"+t("%"+N+N)),xe="[\\:\\/\\?\\#\\[\\]\\@]",te="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",me=e(xe,te),Ee=h?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",pe=h?"[\\uE000-\\uF8FF]":"[]",ne=e(d,P,"[\\-\\.\\_\\~]",Ee),ve=t(d+e(d,P,"[\\+\\-\\.]")+"*"),ce=t(t(ie+"|"+e(ne,te,"[\\:]"))+"*"),Or=t(t("25[0-5]")+"|"+t("2[0-4]"+P)+"|"+t("1"+P+P)+"|"+t("[1-9]"+P)+"|"+P),ze=t(t("25[0-5]")+"|"+t("2[0-4]"+P)+"|"+t("1"+P+P)+"|"+t("0?[1-9]"+P)+"|0?0?"+P),Ve=t(ze+"\\."+ze+"\\."+ze+"\\."+ze),ue=t(N+"{1,4}"),He=t(t(ue+"\\:"+ue)+"|"+Ve),Ze=t(t(ue+"\\:")+"{6}"+He),ar=t("\\:\\:"+t(ue+"\\:")+"{5}"+He),$r=t(t(ue)+"?\\:\\:"+t(ue+"\\:")+"{4}"+He),ur=t(t(t(ue+"\\:")+"{0,1}"+ue)+"?\\:\\:"+t(ue+"\\:")+"{3}"+He),yt=t(t(t(ue+"\\:")+"{0,2}"+ue)+"?\\:\\:"+t(ue+"\\:")+"{2}"+He),Dt=t(t(t(ue+"\\:")+"{0,3}"+ue)+"?\\:\\:"+ue+"\\:"+He),Ct=t(t(t(ue+"\\:")+"{0,4}"+ue)+"?\\:\\:"+He),Xr=t(t(t(ue+"\\:")+"{0,5}"+ue)+"?\\:\\:"+ue),et=t(t(t(ue+"\\:")+"{0,6}"+ue)+"?\\:\\:"),dr=t([Ze,ar,$r,ur,yt,Dt,Ct,Xr,et].join("|")),rt=t(t(ne+"|"+ie)+"+"),La=t(dr+"\\%25"+rt),kr=t(dr+t("\\%25|\\%(?!"+N+"{2})")+rt),ac=t("[vV]"+N+"+\\."+e(ne,te,"[\\:]")+"+"),sc=t("\\["+t(kr+"|"+dr+"|"+ac)+"\\]"),Js=t(t(ie+"|"+e(ne,te))+"*"),_t=t(sc+"|"+Ve+"(?!"+Js+")|"+Js),bt=t(P+"*"),Qs=t(t(ce+"@")+"?"+_t+t("\\:"+bt)+"?"),Pt=t(ie+"|"+e(ne,te,"[\\:\\@]")),nc=t(Pt+"*"),Gs=t(Pt+"+"),oc=t(t(ie+"|"+e(ne,te,"[\\@]"))+"+"),fr=t(t("\\/"+nc)+"*"),tt=t("\\/"+t(Gs+fr)+"?"),Fa=t(oc+fr),jt=t(Gs+fr),at="(?!"+Pt+")",mp=t(fr+"|"+tt+"|"+Fa+"|"+jt+"|"+at),st=t(t(Pt+"|"+e("[\\/\\?]",pe))+"*"),xt=t(t(Pt+"|[\\/\\?]")+"*"),Ks=t(t("\\/\\/"+Qs+fr)+"|"+tt+"|"+jt+"|"+at),ic=t(ve+"\\:"+Ks+t("\\?"+st)+"?"+t("\\#"+xt)+"?"),lc=t(t("\\/\\/"+Qs+fr)+"|"+tt+"|"+Fa+"|"+at),cc=t(lc+t("\\?"+st)+"?"+t("\\#"+xt)+"?"),vp=t(ic+"|"+cc),gp=t(ve+"\\:"+Ks+t("\\?"+st)+"?"),yp="^("+ve+")\\:"+t(t("\\/\\/("+t("("+ce+")@")+"?("+_t+")"+t("\\:("+bt+")")+"?)")+"?("+fr+"|"+tt+"|"+jt+"|"+at+")")+t("\\?("+st+")")+"?"+t("\\#("+xt+")")+"?$",_p="^(){0}"+t(t("\\/\\/("+t("("+ce+")@")+"?("+_t+")"+t("\\:("+bt+")")+"?)")+"?("+fr+"|"+tt+"|"+Fa+"|"+at+")")+t("\\?("+st+")")+"?"+t("\\#("+xt+")")+"?$",bp="^("+ve+")\\:"+t(t("\\/\\/("+t("("+ce+")@")+"?("+_t+")"+t("\\:("+bt+")")+"?)")+"?("+fr+"|"+tt+"|"+jt+"|"+at+")")+t("\\?("+st+")")+"?$",Pp="^"+t("\\#("+xt+")")+"?$",xp="^"+t("("+ce+")@")+"?("+_t+")"+t("\\:("+bt+")")+"?$";return{NOT_SCHEME:new RegExp(e("[^]",d,P,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(e("[^\\%\\:]",ne,te),"g"),NOT_HOST:new RegExp(e("[^\\%\\[\\]\\:]",ne,te),"g"),NOT_PATH:new RegExp(e("[^\\%\\/\\:\\@]",ne,te),"g"),NOT_PATH_NOSCHEME:new RegExp(e("[^\\%\\/\\@]",ne,te),"g"),NOT_QUERY:new RegExp(e("[^\\%]",ne,te,"[\\:\\@\\/\\?]",pe),"g"),NOT_FRAGMENT:new RegExp(e("[^\\%]",ne,te,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(e("[^]",ne,te),"g"),UNRESERVED:new RegExp(ne,"g"),OTHER_CHARS:new RegExp(e("[^\\%]",ne,me),"g"),PCT_ENCODED:new RegExp(ie,"g"),IPV4ADDRESS:new RegExp("^("+Ve+")$"),IPV6ADDRESS:new RegExp("^\\[?("+dr+")"+t(t("\\%25|\\%(?!"+N+"{2})")+"("+rt+")")+"?\\]?$")}}var c=i(!1),f=i(!0),p=(function(){function h(d,v){var P=[],x=!0,N=!1,K=void 0;try{for(var ae=d[Symbol.iterator](),ie;!(x=(ie=ae.next()).done)&&(P.push(ie.value),!(v&&P.length===v));x=!0);}catch(xe){N=!0,K=xe}finally{try{!x&&ae.return&&ae.return()}finally{if(N)throw K}}return P}return function(d,v){if(Array.isArray(d))return d;if(Symbol.iterator in Object(d))return h(d,v);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),m=function(h){if(Array.isArray(h)){for(var d=0,v=Array(h.length);d<h.length;d++)v[d]=h[d];return v}else return Array.from(h)},b=2147483647,u=36,y=1,_=26,g=38,E=700,O=72,S=128,w="-",$=/^xn--/,k=/[^\0-\x7E]/,U=/[\x2E\u3002\uFF0E\uFF61]/g,M={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},I=u-y,z=Math.floor,q=String.fromCharCode;function L(h){throw new RangeError(M[h])}function A(h,d){for(var v=[],P=h.length;P--;)v[P]=d(h[P]);return v}function D(h,d){var v=h.split("@"),P="";v.length>1&&(P=v[0]+"@",h=v[1]),h=h.replace(U,".");var x=h.split("."),N=A(x,d).join(".");return P+N}function F(h){for(var d=[],v=0,P=h.length;v<P;){var x=h.charCodeAt(v++);if(x>=55296&&x<=56319&&v<P){var N=h.charCodeAt(v++);(N&64512)==56320?d.push(((x&1023)<<10)+(N&1023)+65536):(d.push(x),v--)}else d.push(x)}return d}var le=function(d){return String.fromCodePoint.apply(String,m(d))},Y=function(d){return d-48<10?d-22:d-65<26?d-65:d-97<26?d-97:u},re=function(d,v){return d+22+75*(d<26)-((v!=0)<<5)},W=function(d,v,P){var x=0;for(d=P?z(d/E):d>>1,d+=z(d/v);d>I*_>>1;x+=u)d=z(d/I);return z(x+(I+1)*d/(d+g))},V=function(d){var v=[],P=d.length,x=0,N=S,K=O,ae=d.lastIndexOf(w);ae<0&&(ae=0);for(var ie=0;ie<ae;++ie)d.charCodeAt(ie)>=128&&L("not-basic"),v.push(d.charCodeAt(ie));for(var xe=ae>0?ae+1:0;xe<P;){for(var te=x,me=1,Ee=u;;Ee+=u){xe>=P&&L("invalid-input");var pe=Y(d.charCodeAt(xe++));(pe>=u||pe>z((b-x)/me))&&L("overflow"),x+=pe*me;var ne=Ee<=K?y:Ee>=K+_?_:Ee-K;if(pe<ne)break;var ve=u-ne;me>z(b/ve)&&L("overflow"),me*=ve}var ce=v.length+1;K=W(x-te,ce,te==0),z(x/ce)>b-N&&L("overflow"),N+=z(x/ce),x%=ce,v.splice(x++,0,N)}return String.fromCodePoint.apply(String,v)},ge=function(d){var v=[];d=F(d);var P=d.length,x=S,N=0,K=O,ae=!0,ie=!1,xe=void 0;try{for(var te=d[Symbol.iterator](),me;!(ae=(me=te.next()).done);ae=!0){var Ee=me.value;Ee<128&&v.push(q(Ee))}}catch(kr){ie=!0,xe=kr}finally{try{!ae&&te.return&&te.return()}finally{if(ie)throw xe}}var pe=v.length,ne=pe;for(pe&&v.push(w);ne<P;){var ve=b,ce=!0,Or=!1,ze=void 0;try{for(var Ve=d[Symbol.iterator](),ue;!(ce=(ue=Ve.next()).done);ce=!0){var He=ue.value;He>=x&&He<ve&&(ve=He)}}catch(kr){Or=!0,ze=kr}finally{try{!ce&&Ve.return&&Ve.return()}finally{if(Or)throw ze}}var Ze=ne+1;ve-x>z((b-N)/Ze)&&L("overflow"),N+=(ve-x)*Ze,x=ve;var ar=!0,$r=!1,ur=void 0;try{for(var yt=d[Symbol.iterator](),Dt;!(ar=(Dt=yt.next()).done);ar=!0){var Ct=Dt.value;if(Ct<x&&++N>b&&L("overflow"),Ct==x){for(var Xr=N,et=u;;et+=u){var dr=et<=K?y:et>=K+_?_:et-K;if(Xr<dr)break;var rt=Xr-dr,La=u-dr;v.push(q(re(dr+rt%La,0))),Xr=z(rt/La)}v.push(q(re(Xr,0))),K=W(N,Ze,ne==pe),N=0,++ne}}}catch(kr){$r=!0,ur=kr}finally{try{!ar&&yt.return&&yt.return()}finally{if($r)throw ur}}++N,++x}return v.join("")},Oe=function(d){return D(d,function(v){return $.test(v)?V(v.slice(4).toLowerCase()):v})},Ie=function(d){return D(d,function(v){return k.test(v)?"xn--"+ge(v):v})},se={version:"2.1.0",ucs2:{decode:F,encode:le},decode:V,encode:ge,toASCII:Ie,toUnicode:Oe},be={};function Re(h){var d=h.charCodeAt(0),v=void 0;return d<16?v="%0"+d.toString(16).toUpperCase():d<128?v="%"+d.toString(16).toUpperCase():d<2048?v="%"+(d>>6|192).toString(16).toUpperCase()+"%"+(d&63|128).toString(16).toUpperCase():v="%"+(d>>12|224).toString(16).toUpperCase()+"%"+(d>>6&63|128).toString(16).toUpperCase()+"%"+(d&63|128).toString(16).toUpperCase(),v}function De(h){for(var d="",v=0,P=h.length;v<P;){var x=parseInt(h.substr(v+1,2),16);if(x<128)d+=String.fromCharCode(x),v+=3;else if(x>=194&&x<224){if(P-v>=6){var N=parseInt(h.substr(v+4,2),16);d+=String.fromCharCode((x&31)<<6|N&63)}else d+=h.substr(v,6);v+=6}else if(x>=224){if(P-v>=9){var K=parseInt(h.substr(v+4,2),16),ae=parseInt(h.substr(v+7,2),16);d+=String.fromCharCode((x&15)<<12|(K&63)<<6|ae&63)}else d+=h.substr(v,9);v+=9}else d+=h.substr(v,3),v+=3}return d}function gr(h,d){function v(P){var x=De(P);return x.match(d.UNRESERVED)?x:P}return h.scheme&&(h.scheme=String(h.scheme).replace(d.PCT_ENCODED,v).toLowerCase().replace(d.NOT_SCHEME,"")),h.userinfo!==void 0&&(h.userinfo=String(h.userinfo).replace(d.PCT_ENCODED,v).replace(d.NOT_USERINFO,Re).replace(d.PCT_ENCODED,r)),h.host!==void 0&&(h.host=String(h.host).replace(d.PCT_ENCODED,v).toLowerCase().replace(d.NOT_HOST,Re).replace(d.PCT_ENCODED,r)),h.path!==void 0&&(h.path=String(h.path).replace(d.PCT_ENCODED,v).replace(h.scheme?d.NOT_PATH:d.NOT_PATH_NOSCHEME,Re).replace(d.PCT_ENCODED,r)),h.query!==void 0&&(h.query=String(h.query).replace(d.PCT_ENCODED,v).replace(d.NOT_QUERY,Re).replace(d.PCT_ENCODED,r)),h.fragment!==void 0&&(h.fragment=String(h.fragment).replace(d.PCT_ENCODED,v).replace(d.NOT_FRAGMENT,Re).replace(d.PCT_ENCODED,r)),h}function lr(h){return h.replace(/^0*(.*)/,"$1")||"0"}function Pe(h,d){var v=h.match(d.IPV4ADDRESS)||[],P=p(v,2),x=P[1];return x?x.split(".").map(lr).join("."):h}function ye(h,d){var v=h.match(d.IPV6ADDRESS)||[],P=p(v,3),x=P[1],N=P[2];if(x){for(var K=x.toLowerCase().split("::").reverse(),ae=p(K,2),ie=ae[0],xe=ae[1],te=xe?xe.split(":").map(lr):[],me=ie.split(":").map(lr),Ee=d.IPV4ADDRESS.test(me[me.length-1]),pe=Ee?7:8,ne=me.length-pe,ve=Array(pe),ce=0;ce<pe;++ce)ve[ce]=te[ce]||me[ne+ce]||"";Ee&&(ve[pe-1]=Pe(ve[pe-1],d));var Or=ve.reduce(function(Ze,ar,$r){if(!ar||ar==="0"){var ur=Ze[Ze.length-1];ur&&ur.index+ur.length===$r?ur.length++:Ze.push({index:$r,length:1})}return Ze},[]),ze=Or.sort(function(Ze,ar){return ar.length-Ze.length})[0],Ve=void 0;if(ze&&ze.length>1){var ue=ve.slice(0,ze.index),He=ve.slice(ze.index+ze.length);Ve=ue.join(":")+"::"+He.join(":")}else Ve=ve.join(":");return N&&(Ve+="%"+N),Ve}else return h}var wr=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,$e="".match(/(){0}/)[1]===void 0;function oe(h){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},v={},P=d.iri!==!1?f:c;d.reference==="suffix"&&(h=(d.scheme?d.scheme+":":"")+"//"+h);var x=h.match(wr);if(x){$e?(v.scheme=x[1],v.userinfo=x[3],v.host=x[4],v.port=parseInt(x[5],10),v.path=x[6]||"",v.query=x[7],v.fragment=x[8],isNaN(v.port)&&(v.port=x[5])):(v.scheme=x[1]||void 0,v.userinfo=h.indexOf("@")!==-1?x[3]:void 0,v.host=h.indexOf("//")!==-1?x[4]:void 0,v.port=parseInt(x[5],10),v.path=x[6]||"",v.query=h.indexOf("?")!==-1?x[7]:void 0,v.fragment=h.indexOf("#")!==-1?x[8]:void 0,isNaN(v.port)&&(v.port=h.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?x[4]:void 0)),v.host&&(v.host=ye(Pe(v.host,P),P)),v.scheme===void 0&&v.userinfo===void 0&&v.host===void 0&&v.port===void 0&&!v.path&&v.query===void 0?v.reference="same-document":v.scheme===void 0?v.reference="relative":v.fragment===void 0?v.reference="absolute":v.reference="uri",d.reference&&d.reference!=="suffix"&&d.reference!==v.reference&&(v.error=v.error||"URI is not a "+d.reference+" reference.");var N=be[(d.scheme||v.scheme||"").toLowerCase()];if(!d.unicodeSupport&&(!N||!N.unicodeSupport)){if(v.host&&(d.domainHost||N&&N.domainHost))try{v.host=se.toASCII(v.host.replace(P.PCT_ENCODED,De).toLowerCase())}catch(K){v.error=v.error||"Host's domain name can not be converted to ASCII via punycode: "+K}gr(v,c)}else gr(v,P);N&&N.parse&&N.parse(v,d)}else v.error=v.error||"URI can not be parsed.";return v}function yr(h,d){var v=d.iri!==!1?f:c,P=[];return h.userinfo!==void 0&&(P.push(h.userinfo),P.push("@")),h.host!==void 0&&P.push(ye(Pe(String(h.host),v),v).replace(v.IPV6ADDRESS,function(x,N,K){return"["+N+(K?"%25"+K:"")+"]"})),(typeof h.port=="number"||typeof h.port=="string")&&(P.push(":"),P.push(String(h.port))),P.length?P.join(""):void 0}var cr=/^\.\.?\//,Tr=/^\/\.(\/|$)/,Ar=/^\/\.\.(\/|$)/,we=/^\/?(?:.|\n)*?(?=\/|$)/;function Ue(h){for(var d=[];h.length;)if(h.match(cr))h=h.replace(cr,"");else if(h.match(Tr))h=h.replace(Tr,"/");else if(h.match(Ar))h=h.replace(Ar,"/"),d.pop();else if(h==="."||h==="..")h="";else{var v=h.match(we);if(v){var P=v[0];h=h.slice(P.length),d.push(P)}else throw new Error("Unexpected dot segment condition")}return d.join("")}function Ne(h){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},v=d.iri?f:c,P=[],x=be[(d.scheme||h.scheme||"").toLowerCase()];if(x&&x.serialize&&x.serialize(h,d),h.host&&!v.IPV6ADDRESS.test(h.host)){if(d.domainHost||x&&x.domainHost)try{h.host=d.iri?se.toUnicode(h.host):se.toASCII(h.host.replace(v.PCT_ENCODED,De).toLowerCase())}catch(ae){h.error=h.error||"Host's domain name can not be converted to "+(d.iri?"Unicode":"ASCII")+" via punycode: "+ae}}gr(h,v),d.reference!=="suffix"&&h.scheme&&(P.push(h.scheme),P.push(":"));var N=yr(h,d);if(N!==void 0&&(d.reference!=="suffix"&&P.push("//"),P.push(N),h.path&&h.path.charAt(0)!=="/"&&P.push("/")),h.path!==void 0){var K=h.path;!d.absolutePath&&(!x||!x.absolutePath)&&(K=Ue(K)),N===void 0&&(K=K.replace(/^\/\//,"/%2F")),P.push(K)}return h.query!==void 0&&(P.push("?"),P.push(h.query)),h.fragment!==void 0&&(P.push("#"),P.push(h.fragment)),P.join("")}function Ce(h,d){var v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},P=arguments[3],x={};return P||(h=oe(Ne(h,v),v),d=oe(Ne(d,v),v)),v=v||{},!v.tolerant&&d.scheme?(x.scheme=d.scheme,x.userinfo=d.userinfo,x.host=d.host,x.port=d.port,x.path=Ue(d.path||""),x.query=d.query):(d.userinfo!==void 0||d.host!==void 0||d.port!==void 0?(x.userinfo=d.userinfo,x.host=d.host,x.port=d.port,x.path=Ue(d.path||""),x.query=d.query):(d.path?(d.path.charAt(0)==="/"?x.path=Ue(d.path):((h.userinfo!==void 0||h.host!==void 0||h.port!==void 0)&&!h.path?x.path="/"+d.path:h.path?x.path=h.path.slice(0,h.path.lastIndexOf("/")+1)+d.path:x.path=d.path,x.path=Ue(x.path)),x.query=d.query):(x.path=h.path,d.query!==void 0?x.query=d.query:x.query=h.query),x.userinfo=h.userinfo,x.host=h.host,x.port=h.port),x.scheme=h.scheme),x.fragment=d.fragment,x}function rr(h,d,v){var P=l({scheme:"null"},v);return Ne(Ce(oe(h,P),oe(d,P),P,!0),P)}function Me(h,d){return typeof h=="string"?h=Ne(oe(h,d),d):s(h)==="object"&&(h=oe(Ne(h,d),d)),h}function It(h,d,v){return typeof h=="string"?h=Ne(oe(h,v),v):s(h)==="object"&&(h=Ne(h,v)),typeof d=="string"?d=Ne(oe(d,v),v):s(d)==="object"&&(d=Ne(d,v)),h===d}function ja(h,d){return h&&h.toString().replace(!d||!d.iri?c.ESCAPE:f.ESCAPE,Re)}function We(h,d){return h&&h.toString().replace(!d||!d.iri?c.PCT_ENCODED:f.PCT_ENCODED,De)}var vt={scheme:"http",domainHost:!0,parse:function(d,v){return d.host||(d.error=d.error||"HTTP URIs must have a host."),d},serialize:function(d,v){var P=String(d.scheme).toLowerCase()==="https";return(d.port===(P?443:80)||d.port==="")&&(d.port=void 0),d.path||(d.path="/"),d}},qs={scheme:"https",domainHost:vt.domainHost,parse:vt.parse,serialize:vt.serialize};function Ms(h){return typeof h.secure=="boolean"?h.secure:String(h.scheme).toLowerCase()==="wss"}var gt={scheme:"ws",domainHost:!0,parse:function(d,v){var P=d;return P.secure=Ms(P),P.resourceName=(P.path||"/")+(P.query?"?"+P.query:""),P.path=void 0,P.query=void 0,P},serialize:function(d,v){if((d.port===(Ms(d)?443:80)||d.port==="")&&(d.port=void 0),typeof d.secure=="boolean"&&(d.scheme=d.secure?"wss":"ws",d.secure=void 0),d.resourceName){var P=d.resourceName.split("?"),x=p(P,2),N=x[0],K=x[1];d.path=N&&N!=="/"?N:void 0,d.query=K,d.resourceName=void 0}return d.fragment=void 0,d}},zs={scheme:"wss",domainHost:gt.domainHost,parse:gt.parse,serialize:gt.serialize},Zl={},Bl=!0,Hs="[A-Za-z0-9\\-\\.\\_\\~"+(Bl?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]",tr="[0-9A-Fa-f]",Jl=t(t("%[EFef]"+tr+"%"+tr+tr+"%"+tr+tr)+"|"+t("%[89A-Fa-f]"+tr+"%"+tr+tr)+"|"+t("%"+tr+tr)),Ql="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",Gl="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",Kl=e(Gl,'[\\"\\\\]'),Wl="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Yl=new RegExp(Hs,"g"),Yr=new RegExp(Jl,"g"),Xl=new RegExp(e("[^]",Ql,"[\\.]",'[\\"]',Kl),"g"),Us=new RegExp(e("[^]",Hs,Wl),"g"),ec=Us;function Na(h){var d=De(h);return d.match(Yl)?d:h}var Vs={scheme:"mailto",parse:function(d,v){var P=d,x=P.to=P.path?P.path.split(","):[];if(P.path=void 0,P.query){for(var N=!1,K={},ae=P.query.split("&"),ie=0,xe=ae.length;ie<xe;++ie){var te=ae[ie].split("=");switch(te[0]){case"to":for(var me=te[1].split(","),Ee=0,pe=me.length;Ee<pe;++Ee)x.push(me[Ee]);break;case"subject":P.subject=We(te[1],v);break;case"body":P.body=We(te[1],v);break;default:N=!0,K[We(te[0],v)]=We(te[1],v);break}}N&&(P.headers=K)}P.query=void 0;for(var ne=0,ve=x.length;ne<ve;++ne){var ce=x[ne].split("@");if(ce[0]=We(ce[0]),v.unicodeSupport)ce[1]=We(ce[1],v).toLowerCase();else try{ce[1]=se.toASCII(We(ce[1],v).toLowerCase())}catch(Or){P.error=P.error||"Email address's domain name can not be converted to ASCII via punycode: "+Or}x[ne]=ce.join("@")}return P},serialize:function(d,v){var P=d,x=n(d.to);if(x){for(var N=0,K=x.length;N<K;++N){var ae=String(x[N]),ie=ae.lastIndexOf("@"),xe=ae.slice(0,ie).replace(Yr,Na).replace(Yr,r).replace(Xl,Re),te=ae.slice(ie+1);try{te=v.iri?se.toUnicode(te):se.toASCII(We(te,v).toLowerCase())}catch(ne){P.error=P.error||"Email address's domain name can not be converted to "+(v.iri?"Unicode":"ASCII")+" via punycode: "+ne}x[N]=xe+"@"+te}P.path=x.join(",")}var me=d.headers=d.headers||{};d.subject&&(me.subject=d.subject),d.body&&(me.body=d.body);var Ee=[];for(var pe in me)me[pe]!==Zl[pe]&&Ee.push(pe.replace(Yr,Na).replace(Yr,r).replace(Us,Re)+"="+me[pe].replace(Yr,Na).replace(Yr,r).replace(ec,Re));return Ee.length&&(P.query=Ee.join("&")),P}},rc=/^([^\:]+)\:(.*)/,Zs={scheme:"urn",parse:function(d,v){var P=d.path&&d.path.match(rc),x=d;if(P){var N=v.scheme||x.scheme||"urn",K=P[1].toLowerCase(),ae=P[2],ie=N+":"+(v.nid||K),xe=be[ie];x.nid=K,x.nss=ae,x.path=void 0,xe&&(x=xe.parse(x,v))}else x.error=x.error||"URN can not be parsed.";return x},serialize:function(d,v){var P=v.scheme||d.scheme||"urn",x=d.nid,N=P+":"+(v.nid||x),K=be[N];K&&(d=K.serialize(d,v));var ae=d,ie=d.nss;return ae.path=(x||v.nid)+":"+ie,ae}},tc=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Bs={scheme:"urn:uuid",parse:function(d,v){var P=d;return P.uuid=P.nss,P.nss=void 0,!v.tolerant&&(!P.uuid||!P.uuid.match(tc))&&(P.error=P.error||"UUID is not valid."),P},serialize:function(d,v){var P=d;return P.nss=(d.uuid||"").toLowerCase(),P}};be[vt.scheme]=vt,be[qs.scheme]=qs,be[gt.scheme]=gt,be[zs.scheme]=zs,be[Vs.scheme]=Vs,be[Zs.scheme]=Zs,be[Bs.scheme]=Bs,a.SCHEMES=be,a.pctEncChar=Re,a.pctDecChars=De,a.parse=oe,a.removeDotSegments=Ue,a.serialize=Ne,a.resolveComponents=Ce,a.resolve=rr,a.normalize=Me,a.equal=It,a.escapeComponent=ja,a.unescapeComponent=We,Object.defineProperty(a,"__esModule",{value:!0})}))});var oa=J((ih,$n)=>{"use strict";$n.exports=function a(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var s,r,n;if(Array.isArray(e)){if(s=e.length,s!=t.length)return!1;for(r=s;r--!==0;)if(!a(e[r],t[r]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(n=Object.keys(e),s=n.length,s!==Object.keys(t).length)return!1;for(r=s;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,n[r]))return!1;for(r=s;r--!==0;){var l=n[r];if(!a(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}});var In=J((lh,kn)=>{"use strict";kn.exports=function(e){for(var t=0,s=e.length,r=0,n;r<s;)t++,n=e.charCodeAt(r++),n>=55296&&n<=56319&&r<s&&(n=e.charCodeAt(r),(n&64512)==56320&&r++);return t}});var Qr=J((ch,jn)=>{"use strict";jn.exports={copy:gd,checkDataType:rs,checkDataTypes:yd,coerceToTypes:_d,toHash:as,getProperty:ss,escapeQuotes:ns,equal:oa(),ucs2length:In(),varOccurences:xd,varReplace:Ed,schemaHasRules:Sd,schemaHasRulesExcept:Rd,schemaUnknownRules:wd,toQuotedString:ts,getPathExpr:Td,getPath:Ad,getData:kd,unescapeFragment:Id,unescapeJsonPointer:is,escapeFragment:Dd,escapeJsonPointer:os};function gd(a,e){e=e||{};for(var t in a)e[t]=a[t];return e}function rs(a,e,t,s){var r=s?" !== ":" === ",n=s?" || ":" && ",l=s?"!":"",i=s?"":"!";switch(a){case"null":return e+r+"null";case"array":return l+"Array.isArray("+e+")";case"object":return"("+l+e+n+"typeof "+e+r+'"object"'+n+i+"Array.isArray("+e+"))";case"integer":return"(typeof "+e+r+'"number"'+n+i+"("+e+" % 1)"+n+e+r+e+(t?n+l+"isFinite("+e+")":"")+")";case"number":return"(typeof "+e+r+'"'+a+'"'+(t?n+l+"isFinite("+e+")":"")+")";default:return"typeof "+e+r+'"'+a+'"'}}function yd(a,e,t){switch(a.length){case 1:return rs(a[0],e,t,!0);default:var s="",r=as(a);r.array&&r.object&&(s=r.null?"(":"(!"+e+" || ",s+="typeof "+e+' !== "object")',delete r.null,delete r.array,delete r.object),r.number&&delete r.integer;for(var n in r)s+=(s?" && ":"")+rs(n,e,t,!0);return s}}var Dn=as(["string","number","integer","boolean","null"]);function _d(a,e){if(Array.isArray(e)){for(var t=[],s=0;s<e.length;s++){var r=e[s];(Dn[r]||a==="array"&&r==="array")&&(t[t.length]=r)}if(t.length)return t}else{if(Dn[e])return[e];if(a==="array"&&e==="array")return["array"]}}function as(a){for(var e={},t=0;t<a.length;t++)e[a[t]]=!0;return e}var bd=/^[a-z$_][a-z$_0-9]*$/i,Pd=/'|\\/g;function ss(a){return typeof a=="number"?"["+a+"]":bd.test(a)?"."+a:"['"+ns(a)+"']"}function ns(a){return a.replace(Pd,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function xd(a,e){e+="[^0-9]";var t=a.match(new RegExp(e,"g"));return t?t.length:0}function Ed(a,e,t){return e+="([^0-9])",t=t.replace(/\$/g,"$$$$"),a.replace(new RegExp(e,"g"),t+"$1")}function Sd(a,e){if(typeof a=="boolean")return!a;for(var t in a)if(e[t])return!0}function Rd(a,e,t){if(typeof a=="boolean")return!a&&t!="not";for(var s in a)if(s!=t&&e[s])return!0}function wd(a,e){if(typeof a!="boolean"){for(var t in a)if(!e[t])return t}}function ts(a){return"'"+ns(a)+"'"}function Td(a,e,t,s){var r=t?"'/' + "+e+(s?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):s?"'[' + "+e+" + ']'":"'[\\'' + "+e+" + '\\']'";return Cn(a,r)}function Ad(a,e,t){var s=ts(t?"/"+os(e):ss(e));return Cn(a,s)}var Od=/^\/(?:[^~]|~0|~1)*$/,$d=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function kd(a,e,t){var s,r,n,l;if(a==="")return"rootData";if(a[0]=="/"){if(!Od.test(a))throw new Error("Invalid JSON-pointer: "+a);r=a,n="rootData"}else{if(l=a.match($d),!l)throw new Error("Invalid JSON-pointer: "+a);if(s=+l[1],r=l[2],r=="#"){if(s>=e)throw new Error("Cannot access property/index "+s+" levels up, current level is "+e);return t[e-s]}if(s>e)throw new Error("Cannot access data "+s+" levels up, current level is "+e);if(n="data"+(e-s||""),!r)return n}for(var i=n,c=r.split("/"),f=0;f<c.length;f++){var p=c[f];p&&(n+=ss(is(p)),i+=" && "+n)}return i}function Cn(a,e){return a=='""'?e:(a+" + "+e).replace(/([^\\])' \+ '/g,"$1")}function Id(a){return is(decodeURIComponent(a))}function Dd(a){return encodeURIComponent(os(a))}function os(a){return a.replace(/~/g,"~0").replace(/\//g,"~1")}function is(a){return a.replace(/~1/g,"/").replace(/~0/g,"~")}});var ls=J((uh,Nn)=>{"use strict";var Cd=Qr();Nn.exports=jd;function jd(a){Cd.copy(a,this)}});var Fn=J((dh,Ln)=>{"use strict";var Er=Ln.exports=function(a,e,t){typeof e=="function"&&(t=e,e={}),t=e.cb||t;var s=typeof t=="function"?t:t.pre||function(){},r=t.post||function(){};ia(e,s,r,a,"",a)};Er.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0};Er.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Er.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Er.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 ia(a,e,t,s,r,n,l,i,c,f){if(s&&typeof s=="object"&&!Array.isArray(s)){e(s,r,n,l,i,c,f);for(var p in s){var m=s[p];if(Array.isArray(m)){if(p in Er.arrayKeywords)for(var b=0;b<m.length;b++)ia(a,e,t,m[b],r+"/"+p+"/"+b,n,r,p,s,b)}else if(p in Er.propsKeywords){if(m&&typeof m=="object")for(var u in m)ia(a,e,t,m[u],r+"/"+p+"/"+Nd(u),n,r,p,s,u)}else(p in Er.keywords||a.allKeys&&!(p in Er.skipKeywords))&&ia(a,e,t,m,r+"/"+p,n,r,p,s)}t(s,r,n,l,i,c,f)}}function Nd(a){return a.replace(/~/g,"~0").replace(/\//g,"~1")}});var pa=J((fh,Hn)=>{"use strict";var Ot=On(),qn=oa(),da=Qr(),la=ls(),Ld=Fn();Hn.exports=Rr;Rr.normalizeId=Sr;Rr.fullPath=ca;Rr.url=ua;Rr.ids=Hd;Rr.inlineRef=cs;Rr.schema=fa;function Rr(a,e,t){var s=this._refs[t];if(typeof s=="string")if(this._refs[s])s=this._refs[s];else return Rr.call(this,a,e,s);if(s=s||this._schemas[t],s instanceof la)return cs(s.schema,this._opts.inlineRefs)?s.schema:s.validate||this._compile(s);var r=fa.call(this,e,t),n,l,i;return r&&(n=r.schema,e=r.root,i=r.baseId),n instanceof la?l=n.validate||a.call(this,n.schema,e,void 0,i):n!==void 0&&(l=cs(n,this._opts.inlineRefs)?n:a.call(this,n,e,void 0,i)),l}function fa(a,e){var t=Ot.parse(e),s=zn(t),r=ca(this._getId(a.schema));if(Object.keys(a.schema).length===0||s!==r){var n=Sr(s),l=this._refs[n];if(typeof l=="string")return Fd.call(this,a,l,t);if(l instanceof la)l.validate||this._compile(l),a=l;else if(l=this._schemas[n],l instanceof la){if(l.validate||this._compile(l),n==Sr(e))return{schema:l,root:a,baseId:r};a=l}else return;if(!a.schema)return;r=ca(this._getId(a.schema))}return Mn.call(this,t,r,a.schema,a)}function Fd(a,e,t){var s=fa.call(this,a,e);if(s){var r=s.schema,n=s.baseId;a=s.root;var l=this._getId(r);return l&&(n=ua(n,l)),Mn.call(this,t,n,r,a)}}var qd=da.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function Mn(a,e,t,s){if(a.fragment=a.fragment||"",a.fragment.slice(0,1)=="/"){for(var r=a.fragment.split("/"),n=1;n<r.length;n++){var l=r[n];if(l){if(l=da.unescapeFragment(l),t=t[l],t===void 0)break;var i;if(!qd[l]&&(i=this._getId(t),i&&(e=ua(e,i)),t.$ref)){var c=ua(e,t.$ref),f=fa.call(this,s,c);f&&(t=f.schema,s=f.root,e=f.baseId)}}}if(t!==void 0&&t!==s.schema)return{schema:t,root:s,baseId:e}}}var Md=da.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function cs(a,e){if(e===!1)return!1;if(e===void 0||e===!0)return us(a);if(e)return ds(a)<=e}function us(a){var e;if(Array.isArray(a)){for(var t=0;t<a.length;t++)if(e=a[t],typeof e=="object"&&!us(e))return!1}else for(var s in a)if(s=="$ref"||(e=a[s],typeof e=="object"&&!us(e)))return!1;return!0}function ds(a){var e=0,t;if(Array.isArray(a)){for(var s=0;s<a.length;s++)if(t=a[s],typeof t=="object"&&(e+=ds(t)),e==1/0)return 1/0}else for(var r in a){if(r=="$ref")return 1/0;if(Md[r])e++;else if(t=a[r],typeof t=="object"&&(e+=ds(t)+1),e==1/0)return 1/0}return e}function ca(a,e){e!==!1&&(a=Sr(a));var t=Ot.parse(a);return zn(t)}function zn(a){return Ot.serialize(a).split("#")[0]+"#"}var zd=/#\/?$/;function Sr(a){return a?a.replace(zd,""):""}function ua(a,e){return e=Sr(e),Ot.resolve(a,e)}function Hd(a){var e=Sr(this._getId(a)),t={"":e},s={"":ca(e,!1)},r={},n=this;return Ld(a,{allKeys:!0},function(l,i,c,f,p,m,b){if(i!==""){var u=n._getId(l),y=t[f],_=s[f]+"/"+p;if(b!==void 0&&(_+="/"+(typeof b=="number"?b:da.escapeFragment(b))),typeof u=="string"){u=y=Sr(y?Ot.resolve(y,u):u);var g=n._refs[u];if(typeof g=="string"&&(g=n._refs[g]),g&&g.schema){if(!qn(l,g.schema))throw new Error('id "'+u+'" resolves to more than one schema')}else if(u!=Sr(_))if(u[0]=="#"){if(r[u]&&!qn(l,r[u]))throw new Error('id "'+u+'" resolves to more than one schema');r[u]=l}else n._refs[u]=_}t[i]=y,s[i]=_}}),r}});var ha=J((ph,Vn)=>{"use strict";var fs=pa();Vn.exports={Validation:Un(Ud),MissingRef:Un(ps)};function Ud(a){this.message="validation failed",this.errors=a,this.ajv=this.validation=!0}ps.message=function(a,e){return"can't resolve reference "+e+" from id "+a};function ps(a,e,t){this.message=t||ps.message(a,e),this.missingRef=fs.url(a,e),this.missingSchema=fs.normalizeId(fs.fullPath(this.missingRef))}function Un(a){return a.prototype=Object.create(Error.prototype),a.prototype.constructor=a,a}});var hs=J((hh,Zn)=>{"use strict";Zn.exports=function(a,e){e||(e={}),typeof e=="function"&&(e={cmp:e});var t=typeof e.cycles=="boolean"?e.cycles:!1,s=e.cmp&&(function(n){return function(l){return function(i,c){var f={key:i,value:l[i]},p={key:c,value:l[c]};return n(f,p)}}})(e.cmp),r=[];return(function n(l){if(l&&l.toJSON&&typeof l.toJSON=="function"&&(l=l.toJSON()),l!==void 0){if(typeof l=="number")return isFinite(l)?""+l:"null";if(typeof l!="object")return JSON.stringify(l);var i,c;if(Array.isArray(l)){for(c="[",i=0;i<l.length;i++)i&&(c+=","),c+=n(l[i])||"null";return c+"]"}if(l===null)return"null";if(r.indexOf(l)!==-1){if(t)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var f=r.push(l)-1,p=Object.keys(l).sort(s&&s(l));for(c="",i=0;i<p.length;i++){var m=p[i],b=n(l[m]);b&&(c&&(c+=","),c+=JSON.stringify(m)+":"+b)}return r.splice(f,1),"{"+c+"}"}})(a)}});var ms=J((mh,Bn)=>{"use strict";Bn.exports=function(e,t,s){var r="",n=e.schema.$async===!0,l=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),i=e.self._getId(e.schema);if(e.opts.strictKeywords){var c=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(c){var f="unknown keyword: "+c;if(e.opts.strictKeywords==="log")e.logger.warn(f);else throw new Error(f)}}if(e.isTop&&(r+=" var validate = ",n&&(e.async=!0,r+="async "),r+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",i&&(e.opts.sourceCode||e.opts.processCode)&&(r+=" "+("/*# sourceURL="+i+" */")+" ")),typeof e.schema=="boolean"||!(l||e.schema.$ref)){var t="false schema",p=e.level,m=e.dataLevel,b=e.schema[t],u=e.schemaPath+e.util.getProperty(t),y=e.errSchemaPath+"/"+t,$=!e.opts.allErrors,M,_="data"+(m||""),w="valid"+p;if(e.schema===!1){e.isTop?$=!0:r+=" var "+w+" = false; ";var g=g||[];g.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(M||"false schema")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(y)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'boolean schema is false' "),e.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+_+" "),r+=" } "):r+=" {} ";var E=r;r=g.pop(),!e.compositeRule&&$?e.async?r+=" throw new ValidationError(["+E+"]); ":r+=" validate.errors = ["+E+"]; return false; ":r+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?n?r+=" return data; ":r+=" validate.errors = null; return true; ":r+=" var "+w+" = true; ";return e.isTop&&(r+=" }; return validate; "),r}if(e.isTop){var O=e.isTop,p=e.level=0,m=e.dataLevel=0,_="data";if(e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[""],e.schema.default!==void 0&&e.opts.useDefaults&&e.opts.strictDefaults){var S="default is ignored in the schema root";if(e.opts.strictDefaults==="log")e.logger.warn(S);else throw new Error(S)}r+=" var vErrors = null; ",r+=" var errors = 0; ",r+=" if (rootData === undefined) rootData = data; "}else{var p=e.level,m=e.dataLevel,_="data"+(m||"");if(i&&(e.baseId=e.resolve.url(e.baseId,i)),n&&!e.async)throw new Error("async schema in sync schema");r+=" var errs_"+p+" = errors;"}var w="valid"+p,$=!e.opts.allErrors,k="",U="",M,I=e.schema.type,z=Array.isArray(I);if(I&&e.opts.nullable&&e.schema.nullable===!0&&(z?I.indexOf("null")==-1&&(I=I.concat("null")):I!="null"&&(I=[I,"null"],z=!0)),z&&I.length==1&&(I=I[0],z=!1),e.schema.$ref&&l){if(e.opts.extendRefs=="fail")throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');e.opts.extendRefs!==!0&&(l=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(r+=" "+e.RULES.all.$comment.code(e,"$comment")),I){if(e.opts.coerceTypes)var q=e.util.coerceToTypes(e.opts.coerceTypes,I);var L=e.RULES.types[I];if(q||z||L===!0||L&&!we(L)){var u=e.schemaPath+".type",y=e.errSchemaPath+"/type",u=e.schemaPath+".type",y=e.errSchemaPath+"/type",A=z?"checkDataTypes":"checkDataType";if(r+=" if ("+e.util[A](I,_,e.opts.strictNumbers,!0)+") { ",q){var D="dataType"+p,F="coerced"+p;r+=" var "+D+" = typeof "+_+"; var "+F+" = undefined; ",e.opts.coerceTypes=="array"&&(r+=" if ("+D+" == 'object' && Array.isArray("+_+") && "+_+".length == 1) { "+_+" = "+_+"[0]; "+D+" = typeof "+_+"; if ("+e.util.checkDataType(e.schema.type,_,e.opts.strictNumbers)+") "+F+" = "+_+"; } "),r+=" if ("+F+" !== undefined) ; ";var le=q;if(le)for(var Y,re=-1,W=le.length-1;re<W;)Y=le[re+=1],Y=="string"?r+=" else if ("+D+" == 'number' || "+D+" == 'boolean') "+F+" = '' + "+_+"; else if ("+_+" === null) "+F+" = ''; ":Y=="number"||Y=="integer"?(r+=" else if ("+D+" == 'boolean' || "+_+" === null || ("+D+" == 'string' && "+_+" && "+_+" == +"+_+" ",Y=="integer"&&(r+=" && !("+_+" % 1)"),r+=")) "+F+" = +"+_+"; "):Y=="boolean"?r+=" else if ("+_+" === 'false' || "+_+" === 0 || "+_+" === null) "+F+" = false; else if ("+_+" === 'true' || "+_+" === 1) "+F+" = true; ":Y=="null"?r+=" else if ("+_+" === '' || "+_+" === 0 || "+_+" === false) "+F+" = null; ":e.opts.coerceTypes=="array"&&Y=="array"&&(r+=" else if ("+D+" == 'string' || "+D+" == 'number' || "+D+" == 'boolean' || "+_+" == null) "+F+" = ["+_+"]; ");r+=" else { ";var g=g||[];g.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(M||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(y)+" , params: { type: '",z?r+=""+I.join(","):r+=""+I,r+="' } ",e.opts.messages!==!1&&(r+=" , message: 'should be ",z?r+=""+I.join(","):r+=""+I,r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+_+" "),r+=" } "):r+=" {} ";var E=r;r=g.pop(),!e.compositeRule&&$?e.async?r+=" throw new ValidationError(["+E+"]); ":r+=" validate.errors = ["+E+"]; return false; ":r+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } if ("+F+" !== undefined) { ";var V=m?"data"+(m-1||""):"parentData",ge=m?e.dataPathArr[m]:"parentDataProperty";r+=" "+_+" = "+F+"; ",m||(r+="if ("+V+" !== undefined)"),r+=" "+V+"["+ge+"] = "+F+"; } "}else{var g=g||[];g.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(M||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(y)+" , params: { type: '",z?r+=""+I.join(","):r+=""+I,r+="' } ",e.opts.messages!==!1&&(r+=" , message: 'should be ",z?r+=""+I.join(","):r+=""+I,r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+_+" "),r+=" } "):r+=" {} ";var E=r;r=g.pop(),!e.compositeRule&&$?e.async?r+=" throw new ValidationError(["+E+"]); ":r+=" validate.errors = ["+E+"]; return false; ":r+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}r+=" } "}}if(e.schema.$ref&&!l)r+=" "+e.RULES.all.$ref.code(e,"$ref")+" ",$&&(r+=" } if (errors === ",O?r+="0":r+="errs_"+p,r+=") { ",U+="}");else{var Oe=e.RULES;if(Oe){for(var L,Ie=-1,se=Oe.length-1;Ie<se;)if(L=Oe[Ie+=1],we(L)){if(L.type&&(r+=" if ("+e.util.checkDataType(L.type,_,e.opts.strictNumbers)+") { "),e.opts.useDefaults){if(L.type=="object"&&e.schema.properties){var b=e.schema.properties,be=Object.keys(b),Re=be;if(Re)for(var De,gr=-1,lr=Re.length-1;gr<lr;){De=Re[gr+=1];var Pe=b[De];if(Pe.default!==void 0){var ye=_+e.util.getProperty(De);if(e.compositeRule){if(e.opts.strictDefaults){var S="default is ignored for: "+ye;if(e.opts.strictDefaults==="log")e.logger.warn(S);else throw new Error(S)}}else r+=" if ("+ye+" === undefined ",e.opts.useDefaults=="empty"&&(r+=" || "+ye+" === null || "+ye+" === '' "),r+=" ) "+ye+" = ",e.opts.useDefaults=="shared"?r+=" "+e.useDefault(Pe.default)+" ":r+=" "+JSON.stringify(Pe.default)+" ",r+="; "}}}else if(L.type=="array"&&Array.isArray(e.schema.items)){var wr=e.schema.items;if(wr){for(var Pe,re=-1,$e=wr.length-1;re<$e;)if(Pe=wr[re+=1],Pe.default!==void 0){var ye=_+"["+re+"]";if(e.compositeRule){if(e.opts.strictDefaults){var S="default is ignored for: "+ye;if(e.opts.strictDefaults==="log")e.logger.warn(S);else throw new Error(S)}}else r+=" if ("+ye+" === undefined ",e.opts.useDefaults=="empty"&&(r+=" || "+ye+" === null || "+ye+" === '' "),r+=" ) "+ye+" = ",e.opts.useDefaults=="shared"?r+=" "+e.useDefault(Pe.default)+" ":r+=" "+JSON.stringify(Pe.default)+" ",r+="; "}}}}var oe=L.rules;if(oe){for(var yr,cr=-1,Tr=oe.length-1;cr<Tr;)if(yr=oe[cr+=1],Ue(yr)){var Ar=yr.code(e,yr.keyword,L.type);Ar&&(r+=" "+Ar+" ",$&&(k+="}"))}}if($&&(r+=" "+k+" ",k=""),L.type&&(r+=" } ",I&&I===L.type&&!q)){r+=" else { ";var u=e.schemaPath+".type",y=e.errSchemaPath+"/type",g=g||[];g.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(M||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(y)+" , params: { type: '",z?r+=""+I.join(","):r+=""+I,r+="' } ",e.opts.messages!==!1&&(r+=" , message: 'should be ",z?r+=""+I.join(","):r+=""+I,r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+_+" "),r+=" } "):r+=" {} ";var E=r;r=g.pop(),!e.compositeRule&&$?e.async?r+=" throw new ValidationError(["+E+"]); ":r+=" validate.errors = ["+E+"]; return false; ":r+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } "}$&&(r+=" if (errors === ",O?r+="0":r+="errs_"+p,r+=") { ",U+="}")}}}$&&(r+=" "+U+" "),O?(n?(r+=" if (errors === 0) return data; ",r+=" else throw new ValidationError(vErrors); "):(r+=" validate.errors = vErrors; ",r+=" return errors === 0; "),r+=" }; return validate;"):r+=" var "+w+" = errors === errs_"+p+";";function we(Ce){for(var rr=Ce.rules,Me=0;Me<rr.length;Me++)if(Ue(rr[Me]))return!0}function Ue(Ce){return e.schema[Ce.keyword]!==void 0||Ce.implements&&Ne(Ce)}function Ne(Ce){for(var rr=Ce.implements,Me=0;Me<rr.length;Me++)if(e.schema[rr[Me]]!==void 0)return!0}return r}});var Wn=J((vh,Kn)=>{"use strict";var ma=pa(),ga=Qr(),Qn=ha(),Vd=hs(),Jn=ms(),Zd=ga.ucs2length,Bd=oa(),Jd=Qn.Validation;Kn.exports=vs;function vs(a,e,t,s){var r=this,n=this._opts,l=[void 0],i={},c=[],f={},p=[],m={},b=[];e=e||{schema:a,refVal:l,refs:i};var u=Qd.call(this,a,e,s),y=this._compilations[u.index];if(u.compiling)return y.callValidate=S;var _=this._formats,g=this.RULES;try{var E=w(a,e,t,s);y.validate=E;var O=y.callValidate;return O&&(O.schema=E.schema,O.errors=null,O.refs=E.refs,O.refVal=E.refVal,O.root=E.root,O.$async=E.$async,n.sourceCode&&(O.source=E.source)),E}finally{Gd.call(this,a,e,s)}function S(){var A=y.validate,D=A.apply(this,arguments);return S.errors=A.errors,D}function w(A,D,F,le){var Y=!D||D&&D.schema==A;if(D.schema!=e.schema)return vs.call(r,A,D,F,le);var re=A.$async===!0,W=Jn({isTop:!0,schema:A,isRoot:Y,baseId:le,root:D,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:Qn.MissingRef,RULES:g,validate:Jn,util:ga,resolve:ma,resolveRef:$,usePattern:z,useDefault:q,useCustomRule:L,opts:n,formats:_,logger:r.logger,self:r});W=va(l,Yd)+va(c,Kd)+va(p,Wd)+va(b,Xd)+W,n.processCode&&(W=n.processCode(W,A));var V;try{var ge=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",W);V=ge(r,g,_,e,l,p,b,Bd,Zd,Jd),l[0]=V}catch(Oe){throw r.logger.error("Error compiling schema, function code:",W),Oe}return V.schema=A,V.errors=null,V.refs=i,V.refVal=l,V.root=Y?V:D,re&&(V.$async=!0),n.sourceCode===!0&&(V.source={code:W,patterns:c,defaults:p}),V}function $(A,D,F){D=ma.url(A,D);var le=i[D],Y,re;if(le!==void 0)return Y=l[le],re="refVal["+le+"]",I(Y,re);if(!F&&e.refs){var W=e.refs[D];if(W!==void 0)return Y=e.refVal[W],re=k(D,Y),I(Y,re)}re=k(D);var V=ma.call(r,w,e,D);if(V===void 0){var ge=t&&t[D];ge&&(V=ma.inlineRef(ge,n.inlineRefs)?ge:vs.call(r,ge,e,t,A))}if(V===void 0)U(D);else return M(D,V),I(V,re)}function k(A,D){var F=l.length;return l[F]=D,i[A]=F,"refVal"+F}function U(A){delete i[A]}function M(A,D){var F=i[A];l[F]=D}function I(A,D){return typeof A=="object"||typeof A=="boolean"?{code:D,schema:A,inline:!0}:{code:D,$async:A&&!!A.$async}}function z(A){var D=f[A];return D===void 0&&(D=f[A]=c.length,c[D]=A),"pattern"+D}function q(A){switch(typeof A){case"boolean":case"number":return""+A;case"string":return ga.toQuotedString(A);case"object":if(A===null)return"null";var D=Vd(A),F=m[D];return F===void 0&&(F=m[D]=p.length,p[F]=A),"default"+F}}function L(A,D,F,le){if(r._opts.validateSchema!==!1){var Y=A.definition.dependencies;if(Y&&!Y.every(function(Re){return Object.prototype.hasOwnProperty.call(F,Re)}))throw new Error("parent schema must have all required keywords: "+Y.join(","));var re=A.definition.validateSchema;if(re){var W=re(D);if(!W){var V="keyword schema is invalid: "+r.errorsText(re.errors);if(r._opts.validateSchema=="log")r.logger.error(V);else throw new Error(V)}}}var ge=A.definition.compile,Oe=A.definition.inline,Ie=A.definition.macro,se;if(ge)se=ge.call(r,D,F,le);else if(Ie)se=Ie.call(r,D,F,le),n.validateSchema!==!1&&r.validateSchema(se,!0);else if(Oe)se=Oe.call(r,le,A.keyword,D,F);else if(se=A.definition.validate,!se)return;if(se===void 0)throw new Error('custom keyword "'+A.keyword+'"failed to compile');var be=b.length;return b[be]=se,{code:"customRule"+be,validate:se}}}function Qd(a,e,t){var s=Gn.call(this,a,e,t);return s>=0?{index:s,compiling:!0}:(s=this._compilations.length,this._compilations[s]={schema:a,root:e,baseId:t},{index:s,compiling:!1})}function Gd(a,e,t){var s=Gn.call(this,a,e,t);s>=0&&this._compilations.splice(s,1)}function Gn(a,e,t){for(var s=0;s<this._compilations.length;s++){var r=this._compilations[s];if(r.schema==a&&r.root==e&&r.baseId==t)return s}return-1}function Kd(a,e){return"var pattern"+a+" = new RegExp("+ga.toQuotedString(e[a])+");"}function Wd(a){return"var default"+a+" = defaults["+a+"];"}function Yd(a,e){return e[a]===void 0?"":"var refVal"+a+" = refVal["+a+"];"}function Xd(a){return"var customRule"+a+" = customRules["+a+"];"}function va(a,e){if(!a.length)return"";for(var t="",s=0;s<a.length;s++)t+=e(s,a);return t}});var Xn=J((gh,Yn)=>{"use strict";var ya=Yn.exports=function(){this._cache={}};ya.prototype.put=function(e,t){this._cache[e]=t};ya.prototype.get=function(e){return this._cache[e]};ya.prototype.del=function(e){delete this._cache[e]};ya.prototype.clear=function(){this._cache={}}});var fo=J((yh,uo)=>{"use strict";var ef=Qr(),rf=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,tf=[0,31,28,31,30,31,30,31,31,30,31,30,31],af=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,eo=/^(?=.{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,sf=/^(?:[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,nf=/^(?:[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,ro=/^(?:(?:[^\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,to=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,ao=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,so=/^(?:\/(?:[^~/]|~0|~1)*)*$/,no=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,oo=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;uo.exports=_a;function _a(a){return a=a=="full"?"full":"fast",ef.copy(_a[a])}_a.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\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,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":ro,url:to,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,hostname:eo,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[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}))|:)))(?:%.+)?\s*$/i,regex:co,uuid:ao,"json-pointer":so,"json-pointer-uri-fragment":no,"relative-json-pointer":oo};_a.full={date:io,time:lo,"date-time":cf,uri:df,"uri-reference":nf,"uri-template":ro,url:to,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:eo,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[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}))|:)))(?:%.+)?\s*$/i,regex:co,uuid:ao,"json-pointer":so,"json-pointer-uri-fragment":no,"relative-json-pointer":oo};function of(a){return a%4===0&&(a%100!==0||a%400===0)}function io(a){var e=a.match(rf);if(!e)return!1;var t=+e[1],s=+e[2],r=+e[3];return s>=1&&s<=12&&r>=1&&r<=(s==2&&of(t)?29:tf[s])}function lo(a,e){var t=a.match(af);if(!t)return!1;var s=t[1],r=t[2],n=t[3],l=t[5];return(s<=23&&r<=59&&n<=59||s==23&&r==59&&n==60)&&(!e||l)}var lf=/t|\s/i;function cf(a){var e=a.split(lf);return e.length==2&&io(e[0])&&lo(e[1],!0)}var uf=/\/|:/;function df(a){return uf.test(a)&&sf.test(a)}var ff=/[^\\]\\Z/;function co(a){if(ff.test(a))return!1;try{return new RegExp(a),!0}catch{return!1}}});var ho=J((_h,po)=>{"use strict";po.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(l||""),m="valid"+n,b,u;if(i=="#"||i=="#/")e.isRoot?(b=e.async,u="validate"):(b=e.root.schema.$async===!0,u="root.refVal[0]");else{var y=e.resolveRef(e.baseId,i,e.isRoot);if(y===void 0){var _=e.MissingRefError.message(e.baseId,i);if(e.opts.missingRefs=="fail"){e.logger.error(_);var g=g||[];g.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { ref: '"+e.util.escapeQuotes(i)+"' } ",e.opts.messages!==!1&&(r+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(i)+"' "),e.opts.verbose&&(r+=" , schema: "+e.util.toQuotedString(i)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var E=r;r=g.pop(),!e.compositeRule&&f?e.async?r+=" throw new ValidationError(["+E+"]); ":r+=" validate.errors = ["+E+"]; return false; ":r+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",f&&(r+=" if (false) { ")}else if(e.opts.missingRefs=="ignore")e.logger.warn(_),f&&(r+=" if (true) { ");else throw new e.MissingRefError(e.baseId,i,_)}else if(y.inline){var O=e.util.copy(e);O.level++;var S="valid"+O.level;O.schema=y.schema,O.schemaPath="",O.errSchemaPath=i;var w=e.validate(O).replace(/validate\.schema/g,y.code);r+=" "+w+" ",f&&(r+=" if ("+S+") { ")}else b=y.$async===!0||e.async&&y.$async!==!1,u=y.code}if(u){var g=g||[];g.push(r),r="",e.opts.passContext?r+=" "+u+".call(this, ":r+=" "+u+"( ",r+=" "+p+", (dataPath || '')",e.errorPath!='""'&&(r+=" + "+e.errorPath);var $=l?"data"+(l-1||""):"parentData",k=l?e.dataPathArr[l]:"parentDataProperty";r+=" , "+$+" , "+k+", rootData) ";var U=r;if(r=g.pop(),b){if(!e.async)throw new Error("async schema referenced by sync schema");f&&(r+=" var "+m+"; "),r+=" try { await "+U+"; ",f&&(r+=" "+m+" = true; "),r+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",f&&(r+=" "+m+" = false; "),r+=" } ",f&&(r+=" if ("+m+") { ")}else r+=" if (!"+U+") { if (vErrors === null) vErrors = "+u+".errors; else vErrors = vErrors.concat("+u+".errors); errors = vErrors.length; } ",f&&(r+=" else { ")}return r}});var vo=J((bh,mo)=>{"use strict";mo.exports=function(e,t,s){var r=" ",n=e.schema[t],l=e.schemaPath+e.util.getProperty(t),i=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f=e.util.copy(e),p="";f.level++;var m="valid"+f.level,b=f.baseId,u=!0,y=n;if(y)for(var _,g=-1,E=y.length-1;g<E;)_=y[g+=1],(e.opts.strictKeywords?typeof _=="object"&&Object.keys(_).length>0||_===!1:e.util.schemaHasRules(_,e.RULES.all))&&(u=!1,f.schema=_,f.schemaPath=l+"["+g+"]",f.errSchemaPath=i+"/"+g,r+=" "+e.validate(f)+" ",f.baseId=b,c&&(r+=" if ("+m+") { ",p+="}"));return c&&(u?r+=" if (true) { ":r+=" "+p.slice(0,-1)+" "),r}});var yo=J((Ph,go)=>{"use strict";go.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m="data"+(l||""),b="valid"+n,u="errs__"+n,y=e.util.copy(e),_="";y.level++;var g="valid"+y.level,E=i.every(function(M){return e.opts.strictKeywords?typeof M=="object"&&Object.keys(M).length>0||M===!1:e.util.schemaHasRules(M,e.RULES.all)});if(E){var O=y.baseId;r+=" var "+u+" = errors; var "+b+" = false; ";var S=e.compositeRule;e.compositeRule=y.compositeRule=!0;var w=i;if(w)for(var $,k=-1,U=w.length-1;k<U;)$=w[k+=1],y.schema=$,y.schemaPath=c+"["+k+"]",y.errSchemaPath=f+"/"+k,r+=" "+e.validate(y)+" ",y.baseId=O,r+=" "+b+" = "+b+" || "+g+"; if (!"+b+") { ",_+="}";e.compositeRule=y.compositeRule=S,r+=" "+_+" if (!"+b+") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'should match some schema in anyOf' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&p&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+=" } else { errors = "+u+"; if (vErrors !== null) { if ("+u+") vErrors.length = "+u+"; else vErrors = null; } ",e.opts.allErrors&&(r+=" } ")}else p&&(r+=" if (true) { ");return r}});var bo=J((xh,_o)=>{"use strict";_o.exports=function(e,t,s){var r=" ",n=e.schema[t],l=e.errSchemaPath+"/"+t,i=!e.opts.allErrors,c=e.util.toQuotedString(n);return e.opts.$comment===!0?r+=" console.log("+c+");":typeof e.opts.$comment=="function"&&(r+=" self._opts.$comment("+c+", "+e.util.toQuotedString(l)+", validate.root.schema);"),r}});var xo=J((Eh,Po)=>{"use strict";Po.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m="data"+(l||""),b="valid"+n,u=e.opts.$data&&i&&i.$data,y;u?(r+=" var schema"+n+" = "+e.util.getData(i.$data,l,e.dataPathArr)+"; ",y="schema"+n):y=i,u||(r+=" var schema"+n+" = validate.schema"+c+";"),r+="var "+b+" = equal("+m+", schema"+n+"); if (!"+b+") { ";var _=_||[];_.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { allowedValue: schema"+n+" } ",e.opts.messages!==!1&&(r+=" , message: 'should be equal to constant' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var g=r;return r=_.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+g+"]); ":r+=" validate.errors = ["+g+"]; return false; ":r+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" }",p&&(r+=" else { "),r}});var So=J((Sh,Eo)=>{"use strict";Eo.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m="data"+(l||""),b="valid"+n,u="errs__"+n,y=e.util.copy(e),_="";y.level++;var g="valid"+y.level,E="i"+n,O=y.dataLevel=e.dataLevel+1,S="data"+O,w=e.baseId,$=e.opts.strictKeywords?typeof i=="object"&&Object.keys(i).length>0||i===!1:e.util.schemaHasRules(i,e.RULES.all);if(r+="var "+u+" = errors;var "+b+";",$){var k=e.compositeRule;e.compositeRule=y.compositeRule=!0,y.schema=i,y.schemaPath=c,y.errSchemaPath=f,r+=" var "+g+" = false; for (var "+E+" = 0; "+E+" < "+m+".length; "+E+"++) { ",y.errorPath=e.util.getPathExpr(e.errorPath,E,e.opts.jsonPointers,!0);var U=m+"["+E+"]";y.dataPathArr[O]=E;var M=e.validate(y);y.baseId=w,e.util.varOccurences(M,S)<2?r+=" "+e.util.varReplace(M,S,U)+" ":r+=" var "+S+" = "+U+"; "+M+" ",r+=" if ("+g+") break; } ",e.compositeRule=y.compositeRule=k,r+=" "+_+" if (!"+g+") {"}else r+=" if ("+m+".length == 0) {";var I=I||[];I.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'should contain a valid item' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var z=r;return r=I.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+z+"]); ":r+=" validate.errors = ["+z+"]; return false; ":r+=" var err = "+z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { ",$&&(r+=" errors = "+u+"; if (vErrors !== null) { if ("+u+") vErrors.length = "+u+"; else vErrors = null; } "),e.opts.allErrors&&(r+=" } "),r}});var wo=J((Rh,Ro)=>{"use strict";Ro.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m="data"+(l||""),b="errs__"+n,u=e.util.copy(e),y="";u.level++;var _="valid"+u.level,g={},E={},O=e.opts.ownProperties;for(k in i)if(k!="__proto__"){var S=i[k],w=Array.isArray(S)?E:g;w[k]=S}r+="var "+b+" = errors;";var $=e.errorPath;r+="var missing"+n+";";for(var k in E)if(w=E[k],w.length){if(r+=" if ( "+m+e.util.getProperty(k)+" !== undefined ",O&&(r+=" && Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes(k)+"') "),p){r+=" && ( ";var U=w;if(U)for(var M,I=-1,z=U.length-1;I<z;){M=U[I+=1],I&&(r+=" || ");var q=e.util.getProperty(M),L=m+q;r+=" ( ( "+L+" === undefined ",O&&(r+=" || ! Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes(M)+"') "),r+=") && (missing"+n+" = "+e.util.toQuotedString(e.opts.jsonPointers?M:q)+") ) "}r+=")) { ";var A="missing"+n,D="' + "+A+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr($,A,!0):$+" + "+A);var F=F||[];F.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { property: '"+e.util.escapeQuotes(k)+"', missingProperty: '"+D+"', depsCount: "+w.length+", deps: '"+e.util.escapeQuotes(w.length==1?w[0]:w.join(", "))+"' } ",e.opts.messages!==!1&&(r+=" , message: 'should have ",w.length==1?r+="property "+e.util.escapeQuotes(w[0]):r+="properties "+e.util.escapeQuotes(w.join(", ")),r+=" when property "+e.util.escapeQuotes(k)+" is present' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var le=r;r=F.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+le+"]); ":r+=" validate.errors = ["+le+"]; return false; ":r+=" var err = "+le+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{r+=" ) { ";var Y=w;if(Y)for(var M,re=-1,W=Y.length-1;re<W;){M=Y[re+=1];var q=e.util.getProperty(M),D=e.util.escapeQuotes(M),L=m+q;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath($,M,e.opts.jsonPointers)),r+=" if ( "+L+" === undefined ",O&&(r+=" || ! Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes(M)+"') "),r+=") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { property: '"+e.util.escapeQuotes(k)+"', missingProperty: '"+D+"', depsCount: "+w.length+", deps: '"+e.util.escapeQuotes(w.length==1?w[0]:w.join(", "))+"' } ",e.opts.messages!==!1&&(r+=" , message: 'should have ",w.length==1?r+="property "+e.util.escapeQuotes(w[0]):r+="properties "+e.util.escapeQuotes(w.join(", ")),r+=" when property "+e.util.escapeQuotes(k)+" is present' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}r+=" } ",p&&(y+="}",r+=" else { ")}e.errorPath=$;var V=u.baseId;for(var k in g){var S=g[k];(e.opts.strictKeywords?typeof S=="object"&&Object.keys(S).length>0||S===!1:e.util.schemaHasRules(S,e.RULES.all))&&(r+=" "+_+" = true; if ( "+m+e.util.getProperty(k)+" !== undefined ",O&&(r+=" && Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes(k)+"') "),r+=") { ",u.schema=S,u.schemaPath=c+e.util.getProperty(k),u.errSchemaPath=f+"/"+e.util.escapeFragment(k),r+=" "+e.validate(u)+" ",u.baseId=V,r+=" } ",p&&(r+=" if ("+_+") { ",y+="}"))}return p&&(r+=" "+y+" if ("+b+" == errors) {"),r}});var Ao=J((wh,To)=>{"use strict";To.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m="data"+(l||""),b="valid"+n,u=e.opts.$data&&i&&i.$data,y;u?(r+=" var schema"+n+" = "+e.util.getData(i.$data,l,e.dataPathArr)+"; ",y="schema"+n):y=i;var _="i"+n,g="schema"+n;u||(r+=" var "+g+" = validate.schema"+c+";"),r+="var "+b+";",u&&(r+=" if (schema"+n+" === undefined) "+b+" = true; else if (!Array.isArray(schema"+n+")) "+b+" = false; else {"),r+=""+b+" = false;for (var "+_+"=0; "+_+"<"+g+".length; "+_+"++) if (equal("+m+", "+g+"["+_+"])) { "+b+" = true; break; }",u&&(r+=" } "),r+=" if (!"+b+") { ";var E=E||[];E.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { allowedValues: schema"+n+" } ",e.opts.messages!==!1&&(r+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var O=r;return r=E.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+O+"]); ":r+=" validate.errors = ["+O+"]; return false; ":r+=" var err = "+O+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" }",p&&(r+=" else { "),r}});var $o=J((Th,Oo)=>{"use strict";Oo.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m="data"+(l||"");if(e.opts.format===!1)return p&&(r+=" if (true) { "),r;var b=e.opts.$data&&i&&i.$data,u;b?(r+=" var schema"+n+" = "+e.util.getData(i.$data,l,e.dataPathArr)+"; ",u="schema"+n):u=i;var y=e.opts.unknownFormats,_=Array.isArray(y);if(b){var g="format"+n,E="isObject"+n,O="formatType"+n;r+=" var "+g+" = formats["+u+"]; var "+E+" = typeof "+g+" == 'object' && !("+g+" instanceof RegExp) && "+g+".validate; var "+O+" = "+E+" && "+g+".type || 'string'; if ("+E+") { ",e.async&&(r+=" var async"+n+" = "+g+".async; "),r+=" "+g+" = "+g+".validate; } if ( ",b&&(r+=" ("+u+" !== undefined && typeof "+u+" != 'string') || "),r+=" (",y!="ignore"&&(r+=" ("+u+" && !"+g+" ",_&&(r+=" && self._opts.unknownFormats.indexOf("+u+") == -1 "),r+=") || "),r+=" ("+g+" && "+O+" == '"+s+"' && !(typeof "+g+" == 'function' ? ",e.async?r+=" (async"+n+" ? await "+g+"("+m+") : "+g+"("+m+")) ":r+=" "+g+"("+m+") ",r+=" : "+g+".test("+m+"))))) {"}else{var g=e.formats[i];if(!g){if(y=="ignore")return e.logger.warn('unknown format "'+i+'" ignored in schema at path "'+e.errSchemaPath+'"'),p&&(r+=" if (true) { "),r;if(_&&y.indexOf(i)>=0)return p&&(r+=" if (true) { "),r;throw new Error('unknown format "'+i+'" is used in schema at path "'+e.errSchemaPath+'"')}var E=typeof g=="object"&&!(g instanceof RegExp)&&g.validate,O=E&&g.type||"string";if(E){var S=g.async===!0;g=g.validate}if(O!=s)return p&&(r+=" if (true) { "),r;if(S){if(!e.async)throw new Error("async format in sync schema");var w="formats"+e.util.getProperty(i)+".validate";r+=" if (!(await "+w+"("+m+"))) { "}else{r+=" if (! ";var w="formats"+e.util.getProperty(i);E&&(w+=".validate"),typeof g=="function"?r+=" "+w+"("+m+") ":r+=" "+w+".test("+m+") ",r+=") { "}}var $=$||[];$.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { format: ",b?r+=""+u:r+=""+e.util.toQuotedString(i),r+=" } ",e.opts.messages!==!1&&(r+=` , message: 'should match format "`,b?r+="' + "+u+" + '":r+=""+e.util.escapeQuotes(i),r+=`"' `),e.opts.verbose&&(r+=" , schema: ",b?r+="validate.schema"+c:r+=""+e.util.toQuotedString(i),r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var k=r;return r=$.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+k+"]); ":r+=" validate.errors = ["+k+"]; return false; ":r+=" var err = "+k+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",p&&(r+=" else { "),r}});var Io=J((Ah,ko)=>{"use strict";ko.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m="data"+(l||""),b="valid"+n,u="errs__"+n,y=e.util.copy(e);y.level++;var _="valid"+y.level,g=e.schema.then,E=e.schema.else,O=g!==void 0&&(e.opts.strictKeywords?typeof g=="object"&&Object.keys(g).length>0||g===!1:e.util.schemaHasRules(g,e.RULES.all)),S=E!==void 0&&(e.opts.strictKeywords?typeof E=="object"&&Object.keys(E).length>0||E===!1:e.util.schemaHasRules(E,e.RULES.all)),w=y.baseId;if(O||S){var $;y.createErrors=!1,y.schema=i,y.schemaPath=c,y.errSchemaPath=f,r+=" var "+u+" = errors; var "+b+" = true; ";var k=e.compositeRule;e.compositeRule=y.compositeRule=!0,r+=" "+e.validate(y)+" ",y.baseId=w,y.createErrors=!0,r+=" errors = "+u+"; if (vErrors !== null) { if ("+u+") vErrors.length = "+u+"; else vErrors = null; } ",e.compositeRule=y.compositeRule=k,O?(r+=" if ("+_+") { ",y.schema=e.schema.then,y.schemaPath=e.schemaPath+".then",y.errSchemaPath=e.errSchemaPath+"/then",r+=" "+e.validate(y)+" ",y.baseId=w,r+=" "+b+" = "+_+"; ",O&&S?($="ifClause"+n,r+=" var "+$+" = 'then'; "):$="'then'",r+=" } ",S&&(r+=" else { ")):r+=" if (!"+_+") { ",S&&(y.schema=e.schema.else,y.schemaPath=e.schemaPath+".else",y.errSchemaPath=e.errSchemaPath+"/else",r+=" "+e.validate(y)+" ",y.baseId=w,r+=" "+b+" = "+_+"; ",O&&S?($="ifClause"+n,r+=" var "+$+" = 'else'; "):$="'else'",r+=" } "),r+=" if (!"+b+") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { failingKeyword: "+$+" } ",e.opts.messages!==!1&&(r+=` , message: 'should match "' + `+$+` + '" schema' `),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&p&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+=" } ",p&&(r+=" else { ")}else p&&(r+=" if (true) { ");return r}});var Co=J((Oh,Do)=>{"use strict";Do.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m="data"+(l||""),b="valid"+n,u="errs__"+n,y=e.util.copy(e),_="";y.level++;var g="valid"+y.level,E="i"+n,O=y.dataLevel=e.dataLevel+1,S="data"+O,w=e.baseId;if(r+="var "+u+" = errors;var "+b+";",Array.isArray(i)){var $=e.schema.additionalItems;if($===!1){r+=" "+b+" = "+m+".length <= "+i.length+"; ";var k=f;f=e.errSchemaPath+"/additionalItems",r+=" if (!"+b+") { ";var U=U||[];U.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { limit: "+i.length+" } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT have more than "+i.length+" items' "),e.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var M=r;r=U.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+M+"]); ":r+=" validate.errors = ["+M+"]; return false; ":r+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",f=k,p&&(_+="}",r+=" else { ")}var I=i;if(I){for(var z,q=-1,L=I.length-1;q<L;)if(z=I[q+=1],e.opts.strictKeywords?typeof z=="object"&&Object.keys(z).length>0||z===!1:e.util.schemaHasRules(z,e.RULES.all)){r+=" "+g+" = true; if ("+m+".length > "+q+") { ";var A=m+"["+q+"]";y.schema=z,y.schemaPath=c+"["+q+"]",y.errSchemaPath=f+"/"+q,y.errorPath=e.util.getPathExpr(e.errorPath,q,e.opts.jsonPointers,!0),y.dataPathArr[O]=q;var D=e.validate(y);y.baseId=w,e.util.varOccurences(D,S)<2?r+=" "+e.util.varReplace(D,S,A)+" ":r+=" var "+S+" = "+A+"; "+D+" ",r+=" } ",p&&(r+=" if ("+g+") { ",_+="}")}}if(typeof $=="object"&&(e.opts.strictKeywords?typeof $=="object"&&Object.keys($).length>0||$===!1:e.util.schemaHasRules($,e.RULES.all))){y.schema=$,y.schemaPath=e.schemaPath+".additionalItems",y.errSchemaPath=e.errSchemaPath+"/additionalItems",r+=" "+g+" = true; if ("+m+".length > "+i.length+") { for (var "+E+" = "+i.length+"; "+E+" < "+m+".length; "+E+"++) { ",y.errorPath=e.util.getPathExpr(e.errorPath,E,e.opts.jsonPointers,!0);var A=m+"["+E+"]";y.dataPathArr[O]=E;var D=e.validate(y);y.baseId=w,e.util.varOccurences(D,S)<2?r+=" "+e.util.varReplace(D,S,A)+" ":r+=" var "+S+" = "+A+"; "+D+" ",p&&(r+=" if (!"+g+") break; "),r+=" } } ",p&&(r+=" if ("+g+") { ",_+="}")}}else if(e.opts.strictKeywords?typeof i=="object"&&Object.keys(i).length>0||i===!1:e.util.schemaHasRules(i,e.RULES.all)){y.schema=i,y.schemaPath=c,y.errSchemaPath=f,r+=" for (var "+E+" = 0; "+E+" < "+m+".length; "+E+"++) { ",y.errorPath=e.util.getPathExpr(e.errorPath,E,e.opts.jsonPointers,!0);var A=m+"["+E+"]";y.dataPathArr[O]=E;var D=e.validate(y);y.baseId=w,e.util.varOccurences(D,S)<2?r+=" "+e.util.varReplace(D,S,A)+" ":r+=" var "+S+" = "+A+"; "+D+" ",p&&(r+=" if (!"+g+") break; "),r+=" }"}return p&&(r+=" "+_+" if ("+u+" == errors) {"),r}});var gs=J(($h,jo)=>{"use strict";jo.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,w,m="data"+(l||""),b=e.opts.$data&&i&&i.$data,u;b?(r+=" var schema"+n+" = "+e.util.getData(i.$data,l,e.dataPathArr)+"; ",u="schema"+n):u=i;var y=t=="maximum",_=y?"exclusiveMaximum":"exclusiveMinimum",g=e.schema[_],E=e.opts.$data&&g&&g.$data,O=y?"<":">",S=y?">":"<",w=void 0;if(!(b||typeof i=="number"||i===void 0))throw new Error(t+" must be number");if(!(E||g===void 0||typeof g=="number"||typeof g=="boolean"))throw new Error(_+" must be number or boolean");if(E){var $=e.util.getData(g.$data,l,e.dataPathArr),k="exclusive"+n,U="exclType"+n,M="exclIsNumber"+n,I="op"+n,z="' + "+I+" + '";r+=" var schemaExcl"+n+" = "+$+"; ",$="schemaExcl"+n,r+=" var "+k+"; var "+U+" = typeof "+$+"; if ("+U+" != 'boolean' && "+U+" != 'undefined' && "+U+" != 'number') { ";var w=_,q=q||[];q.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(w||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: '"+_+" should be boolean' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var L=r;r=q.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+L+"]); ":r+=" validate.errors = ["+L+"]; return false; ":r+=" var err = "+L+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else if ( ",b&&(r+=" ("+u+" !== undefined && typeof "+u+" != 'number') || "),r+=" "+U+" == 'number' ? ( ("+k+" = "+u+" === undefined || "+$+" "+O+"= "+u+") ? "+m+" "+S+"= "+$+" : "+m+" "+S+" "+u+" ) : ( ("+k+" = "+$+" === true) ? "+m+" "+S+"= "+u+" : "+m+" "+S+" "+u+" ) || "+m+" !== "+m+") { var op"+n+" = "+k+" ? '"+O+"' : '"+O+"='; ",i===void 0&&(w=_,f=e.errSchemaPath+"/"+_,u=$,b=E)}else{var M=typeof g=="number",z=O;if(M&&b){var I="'"+z+"'";r+=" if ( ",b&&(r+=" ("+u+" !== undefined && typeof "+u+" != 'number') || "),r+=" ( "+u+" === undefined || "+g+" "+O+"= "+u+" ? "+m+" "+S+"= "+g+" : "+m+" "+S+" "+u+" ) || "+m+" !== "+m+") { "}else{M&&i===void 0?(k=!0,w=_,f=e.errSchemaPath+"/"+_,u=g,S+="="):(M&&(u=Math[y?"min":"max"](g,i)),g===(M?u:!0)?(k=!0,w=_,f=e.errSchemaPath+"/"+_,S+="="):(k=!1,z+="="));var I="'"+z+"'";r+=" if ( ",b&&(r+=" ("+u+" !== undefined && typeof "+u+" != 'number') || "),r+=" "+m+" "+S+" "+u+" || "+m+" !== "+m+") { "}}w=w||t;var q=q||[];q.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(w||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { comparison: "+I+", limit: "+u+", exclusive: "+k+" } ",e.opts.messages!==!1&&(r+=" , message: 'should be "+z+" ",b?r+="' + "+u:r+=""+u+"'"),e.opts.verbose&&(r+=" , schema: ",b?r+="validate.schema"+c:r+=""+i,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var L=r;return r=q.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+L+"]); ":r+=" validate.errors = ["+L+"]; return false; ":r+=" var err = "+L+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",p&&(r+=" else { "),r}});var ys=J((kh,No)=>{"use strict";No.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,_,m="data"+(l||""),b=e.opts.$data&&i&&i.$data,u;if(b?(r+=" var schema"+n+" = "+e.util.getData(i.$data,l,e.dataPathArr)+"; ",u="schema"+n):u=i,!(b||typeof i=="number"))throw new Error(t+" must be number");var y=t=="maxItems"?">":"<";r+="if ( ",b&&(r+=" ("+u+" !== undefined && typeof "+u+" != 'number') || "),r+=" "+m+".length "+y+" "+u+") { ";var _=t,g=g||[];g.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(_||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { limit: "+u+" } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT have ",t=="maxItems"?r+="more":r+="fewer",r+=" than ",b?r+="' + "+u+" + '":r+=""+i,r+=" items' "),e.opts.verbose&&(r+=" , schema: ",b?r+="validate.schema"+c:r+=""+i,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var E=r;return r=g.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+E+"]); ":r+=" validate.errors = ["+E+"]; return false; ":r+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",p&&(r+=" else { "),r}});var _s=J((Ih,Lo)=>{"use strict";Lo.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,_,m="data"+(l||""),b=e.opts.$data&&i&&i.$data,u;if(b?(r+=" var schema"+n+" = "+e.util.getData(i.$data,l,e.dataPathArr)+"; ",u="schema"+n):u=i,!(b||typeof i=="number"))throw new Error(t+" must be number");var y=t=="maxLength"?">":"<";r+="if ( ",b&&(r+=" ("+u+" !== undefined && typeof "+u+" != 'number') || "),e.opts.unicode===!1?r+=" "+m+".length ":r+=" ucs2length("+m+") ",r+=" "+y+" "+u+") { ";var _=t,g=g||[];g.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(_||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { limit: "+u+" } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT be ",t=="maxLength"?r+="longer":r+="shorter",r+=" than ",b?r+="' + "+u+" + '":r+=""+i,r+=" characters' "),e.opts.verbose&&(r+=" , schema: ",b?r+="validate.schema"+c:r+=""+i,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var E=r;return r=g.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+E+"]); ":r+=" validate.errors = ["+E+"]; return false; ":r+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",p&&(r+=" else { "),r}});var bs=J((Dh,Fo)=>{"use strict";Fo.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,_,m="data"+(l||""),b=e.opts.$data&&i&&i.$data,u;if(b?(r+=" var schema"+n+" = "+e.util.getData(i.$data,l,e.dataPathArr)+"; ",u="schema"+n):u=i,!(b||typeof i=="number"))throw new Error(t+" must be number");var y=t=="maxProperties"?">":"<";r+="if ( ",b&&(r+=" ("+u+" !== undefined && typeof "+u+" != 'number') || "),r+=" Object.keys("+m+").length "+y+" "+u+") { ";var _=t,g=g||[];g.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(_||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { limit: "+u+" } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT have ",t=="maxProperties"?r+="more":r+="fewer",r+=" than ",b?r+="' + "+u+" + '":r+=""+i,r+=" properties' "),e.opts.verbose&&(r+=" , schema: ",b?r+="validate.schema"+c:r+=""+i,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var E=r;return r=g.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+E+"]); ":r+=" validate.errors = ["+E+"]; return false; ":r+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",p&&(r+=" else { "),r}});var Mo=J((Ch,qo)=>{"use strict";qo.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m="data"+(l||""),b=e.opts.$data&&i&&i.$data,u;if(b?(r+=" var schema"+n+" = "+e.util.getData(i.$data,l,e.dataPathArr)+"; ",u="schema"+n):u=i,!(b||typeof i=="number"))throw new Error(t+" must be number");r+="var division"+n+";if (",b&&(r+=" "+u+" !== undefined && ( typeof "+u+" != 'number' || "),r+=" (division"+n+" = "+m+" / "+u+", ",e.opts.multipleOfPrecision?r+=" Math.abs(Math.round(division"+n+") - division"+n+") > 1e-"+e.opts.multipleOfPrecision+" ":r+=" division"+n+" !== parseInt(division"+n+") ",r+=" ) ",b&&(r+=" ) "),r+=" ) { ";var y=y||[];y.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { multipleOf: "+u+" } ",e.opts.messages!==!1&&(r+=" , message: 'should be multiple of ",b?r+="' + "+u:r+=""+u+"'"),e.opts.verbose&&(r+=" , schema: ",b?r+="validate.schema"+c:r+=""+i,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var _=r;return r=y.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+_+"]); ":r+=" validate.errors = ["+_+"]; return false; ":r+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",p&&(r+=" else { "),r}});var Ho=J((jh,zo)=>{"use strict";zo.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m="data"+(l||""),b="errs__"+n,u=e.util.copy(e);u.level++;var y="valid"+u.level;if(e.opts.strictKeywords?typeof i=="object"&&Object.keys(i).length>0||i===!1:e.util.schemaHasRules(i,e.RULES.all)){u.schema=i,u.schemaPath=c,u.errSchemaPath=f,r+=" var "+b+" = errors; ";var _=e.compositeRule;e.compositeRule=u.compositeRule=!0,u.createErrors=!1;var g;u.opts.allErrors&&(g=u.opts.allErrors,u.opts.allErrors=!1),r+=" "+e.validate(u)+" ",u.createErrors=!0,g&&(u.opts.allErrors=g),e.compositeRule=u.compositeRule=_,r+=" if ("+y+") { ";var E=E||[];E.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'should NOT be valid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var O=r;r=E.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+O+"]); ":r+=" validate.errors = ["+O+"]; return false; ":r+=" var err = "+O+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { errors = "+b+"; if (vErrors !== null) { if ("+b+") vErrors.length = "+b+"; else vErrors = null; } ",e.opts.allErrors&&(r+=" } ")}else r+=" var err = ",e.createErrors!==!1?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'should NOT be valid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",p&&(r+=" if (false) { ");return r}});var Vo=J((Nh,Uo)=>{"use strict";Uo.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m="data"+(l||""),b="valid"+n,u="errs__"+n,y=e.util.copy(e),_="";y.level++;var g="valid"+y.level,E=y.baseId,O="prevValid"+n,S="passingSchemas"+n;r+="var "+u+" = errors , "+O+" = false , "+b+" = false , "+S+" = null; ";var w=e.compositeRule;e.compositeRule=y.compositeRule=!0;var $=i;if($)for(var k,U=-1,M=$.length-1;U<M;)k=$[U+=1],(e.opts.strictKeywords?typeof k=="object"&&Object.keys(k).length>0||k===!1:e.util.schemaHasRules(k,e.RULES.all))?(y.schema=k,y.schemaPath=c+"["+U+"]",y.errSchemaPath=f+"/"+U,r+=" "+e.validate(y)+" ",y.baseId=E):r+=" var "+g+" = true; ",U&&(r+=" if ("+g+" && "+O+") { "+b+" = false; "+S+" = ["+S+", "+U+"]; } else { ",_+="}"),r+=" if ("+g+") { "+b+" = "+O+" = true; "+S+" = "+U+"; }";return e.compositeRule=y.compositeRule=w,r+=""+_+"if (!"+b+") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { passingSchemas: "+S+" } ",e.opts.messages!==!1&&(r+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&p&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+="} else { errors = "+u+"; if (vErrors !== null) { if ("+u+") vErrors.length = "+u+"; else vErrors = null; }",e.opts.allErrors&&(r+=" } "),r}});var Bo=J((Lh,Zo)=>{"use strict";Zo.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m="data"+(l||""),b=e.opts.$data&&i&&i.$data,u;b?(r+=" var schema"+n+" = "+e.util.getData(i.$data,l,e.dataPathArr)+"; ",u="schema"+n):u=i;var y=b?"(new RegExp("+u+"))":e.usePattern(i);r+="if ( ",b&&(r+=" ("+u+" !== undefined && typeof "+u+" != 'string') || "),r+=" !"+y+".test("+m+") ) { ";var _=_||[];_.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { pattern: ",b?r+=""+u:r+=""+e.util.toQuotedString(i),r+=" } ",e.opts.messages!==!1&&(r+=` , message: 'should match pattern "`,b?r+="' + "+u+" + '":r+=""+e.util.escapeQuotes(i),r+=`"' `),e.opts.verbose&&(r+=" , schema: ",b?r+="validate.schema"+c:r+=""+e.util.toQuotedString(i),r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var g=r;return r=_.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+g+"]); ":r+=" validate.errors = ["+g+"]; return false; ":r+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",p&&(r+=" else { "),r}});var Qo=J((Fh,Jo)=>{"use strict";Jo.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m="data"+(l||""),b="errs__"+n,u=e.util.copy(e),y="";u.level++;var _="valid"+u.level,g="key"+n,E="idx"+n,O=u.dataLevel=e.dataLevel+1,S="data"+O,w="dataProperties"+n,$=Object.keys(i||{}).filter(re),k=e.schema.patternProperties||{},U=Object.keys(k).filter(re),M=e.schema.additionalProperties,I=$.length||U.length,z=M===!1,q=typeof M=="object"&&Object.keys(M).length,L=e.opts.removeAdditional,A=z||q||L,D=e.opts.ownProperties,F=e.baseId,le=e.schema.required;if(le&&!(e.opts.$data&&le.$data)&&le.length<e.opts.loopRequired)var Y=e.util.toHash(le);function re(We){return We!=="__proto__"}if(r+="var "+b+" = errors;var "+_+" = true;",D&&(r+=" var "+w+" = undefined;"),A){if(D?r+=" "+w+" = "+w+" || Object.keys("+m+"); for (var "+E+"=0; "+E+"<"+w+".length; "+E+"++) { var "+g+" = "+w+"["+E+"]; ":r+=" for (var "+g+" in "+m+") { ",I){if(r+=" var isAdditional"+n+" = !(false ",$.length)if($.length>8)r+=" || validate.schema"+c+".hasOwnProperty("+g+") ";else{var W=$;if(W)for(var V,ge=-1,Oe=W.length-1;ge<Oe;)V=W[ge+=1],r+=" || "+g+" == "+e.util.toQuotedString(V)+" "}if(U.length){var Ie=U;if(Ie)for(var se,be=-1,Re=Ie.length-1;be<Re;)se=Ie[be+=1],r+=" || "+e.usePattern(se)+".test("+g+") "}r+=" ); if (isAdditional"+n+") { "}if(L=="all")r+=" delete "+m+"["+g+"]; ";else{var De=e.errorPath,gr="' + "+g+" + '";if(e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers)),z)if(L)r+=" delete "+m+"["+g+"]; ";else{r+=" "+_+" = false; ";var lr=f;f=e.errSchemaPath+"/additionalProperties";var Pe=Pe||[];Pe.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { additionalProperty: '"+gr+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is an invalid additional property":r+="should NOT have additional properties",r+="' "),e.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var ye=r;r=Pe.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+ye+"]); ":r+=" validate.errors = ["+ye+"]; return false; ":r+=" var err = "+ye+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",f=lr,p&&(r+=" break; ")}else if(q)if(L=="failing"){r+=" var "+b+" = errors; ";var wr=e.compositeRule;e.compositeRule=u.compositeRule=!0,u.schema=M,u.schemaPath=e.schemaPath+".additionalProperties",u.errSchemaPath=e.errSchemaPath+"/additionalProperties",u.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers);var $e=m+"["+g+"]";u.dataPathArr[O]=g;var oe=e.validate(u);u.baseId=F,e.util.varOccurences(oe,S)<2?r+=" "+e.util.varReplace(oe,S,$e)+" ":r+=" var "+S+" = "+$e+"; "+oe+" ",r+=" if (!"+_+") { errors = "+b+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+m+"["+g+"]; } ",e.compositeRule=u.compositeRule=wr}else{u.schema=M,u.schemaPath=e.schemaPath+".additionalProperties",u.errSchemaPath=e.errSchemaPath+"/additionalProperties",u.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers);var $e=m+"["+g+"]";u.dataPathArr[O]=g;var oe=e.validate(u);u.baseId=F,e.util.varOccurences(oe,S)<2?r+=" "+e.util.varReplace(oe,S,$e)+" ":r+=" var "+S+" = "+$e+"; "+oe+" ",p&&(r+=" if (!"+_+") break; ")}e.errorPath=De}I&&(r+=" } "),r+=" } ",p&&(r+=" if ("+_+") { ",y+="}")}var yr=e.opts.useDefaults&&!e.compositeRule;if($.length){var cr=$;if(cr)for(var V,Tr=-1,Ar=cr.length-1;Tr<Ar;){V=cr[Tr+=1];var we=i[V];if(e.opts.strictKeywords?typeof we=="object"&&Object.keys(we).length>0||we===!1:e.util.schemaHasRules(we,e.RULES.all)){var Ue=e.util.getProperty(V),$e=m+Ue,Ne=yr&&we.default!==void 0;u.schema=we,u.schemaPath=c+Ue,u.errSchemaPath=f+"/"+e.util.escapeFragment(V),u.errorPath=e.util.getPath(e.errorPath,V,e.opts.jsonPointers),u.dataPathArr[O]=e.util.toQuotedString(V);var oe=e.validate(u);if(u.baseId=F,e.util.varOccurences(oe,S)<2){oe=e.util.varReplace(oe,S,$e);var Ce=$e}else{var Ce=S;r+=" var "+S+" = "+$e+"; "}if(Ne)r+=" "+oe+" ";else{if(Y&&Y[V]){r+=" if ( "+Ce+" === undefined ",D&&(r+=" || ! Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes(V)+"') "),r+=") { "+_+" = false; ";var De=e.errorPath,lr=f,rr=e.util.escapeQuotes(V);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(De,V,e.opts.jsonPointers)),f=e.errSchemaPath+"/required";var Pe=Pe||[];Pe.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { missingProperty: '"+rr+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+rr+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var ye=r;r=Pe.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+ye+"]); ":r+=" validate.errors = ["+ye+"]; return false; ":r+=" var err = "+ye+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",f=lr,e.errorPath=De,r+=" } else { "}else p?(r+=" if ( "+Ce+" === undefined ",D&&(r+=" || ! Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes(V)+"') "),r+=") { "+_+" = true; } else { "):(r+=" if ("+Ce+" !== undefined ",D&&(r+=" && Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes(V)+"') "),r+=" ) { ");r+=" "+oe+" } "}}p&&(r+=" if ("+_+") { ",y+="}")}}if(U.length){var Me=U;if(Me)for(var se,It=-1,ja=Me.length-1;It<ja;){se=Me[It+=1];var we=k[se];if(e.opts.strictKeywords?typeof we=="object"&&Object.keys(we).length>0||we===!1:e.util.schemaHasRules(we,e.RULES.all)){u.schema=we,u.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(se),u.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(se),D?r+=" "+w+" = "+w+" || Object.keys("+m+"); for (var "+E+"=0; "+E+"<"+w+".length; "+E+"++) { var "+g+" = "+w+"["+E+"]; ":r+=" for (var "+g+" in "+m+") { ",r+=" if ("+e.usePattern(se)+".test("+g+")) { ",u.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers);var $e=m+"["+g+"]";u.dataPathArr[O]=g;var oe=e.validate(u);u.baseId=F,e.util.varOccurences(oe,S)<2?r+=" "+e.util.varReplace(oe,S,$e)+" ":r+=" var "+S+" = "+$e+"; "+oe+" ",p&&(r+=" if (!"+_+") break; "),r+=" } ",p&&(r+=" else "+_+" = true; "),r+=" } ",p&&(r+=" if ("+_+") { ",y+="}")}}}return p&&(r+=" "+y+" if ("+b+" == errors) {"),r}});var Ko=J((qh,Go)=>{"use strict";Go.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m="data"+(l||""),b="errs__"+n,u=e.util.copy(e),y="";u.level++;var _="valid"+u.level;if(r+="var "+b+" = errors;",e.opts.strictKeywords?typeof i=="object"&&Object.keys(i).length>0||i===!1:e.util.schemaHasRules(i,e.RULES.all)){u.schema=i,u.schemaPath=c,u.errSchemaPath=f;var g="key"+n,E="idx"+n,O="i"+n,S="' + "+g+" + '",w=u.dataLevel=e.dataLevel+1,$="data"+w,k="dataProperties"+n,U=e.opts.ownProperties,M=e.baseId;U&&(r+=" var "+k+" = undefined; "),U?r+=" "+k+" = "+k+" || Object.keys("+m+"); for (var "+E+"=0; "+E+"<"+k+".length; "+E+"++) { var "+g+" = "+k+"["+E+"]; ":r+=" for (var "+g+" in "+m+") { ",r+=" var startErrs"+n+" = errors; ";var I=g,z=e.compositeRule;e.compositeRule=u.compositeRule=!0;var q=e.validate(u);u.baseId=M,e.util.varOccurences(q,$)<2?r+=" "+e.util.varReplace(q,$,I)+" ":r+=" var "+$+" = "+I+"; "+q+" ",e.compositeRule=u.compositeRule=z,r+=" if (!"+_+") { for (var "+O+"=startErrs"+n+"; "+O+"<errors; "+O+"++) { vErrors["+O+"].propertyName = "+g+"; } var err = ",e.createErrors!==!1?(r+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { propertyName: '"+S+"' } ",e.opts.messages!==!1&&(r+=" , message: 'property name \\'"+S+"\\' is invalid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&p&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),p&&(r+=" break; "),r+=" } }"}return p&&(r+=" "+y+" if ("+b+" == errors) {"),r}});var Yo=J((Mh,Wo)=>{"use strict";Wo.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m="data"+(l||""),b="valid"+n,u=e.opts.$data&&i&&i.$data,y;u?(r+=" var schema"+n+" = "+e.util.getData(i.$data,l,e.dataPathArr)+"; ",y="schema"+n):y=i;var _="schema"+n;if(!u)if(i.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var g=[],E=i;if(E)for(var O,S=-1,w=E.length-1;S<w;){O=E[S+=1];var $=e.schema.properties[O];$&&(e.opts.strictKeywords?typeof $=="object"&&Object.keys($).length>0||$===!1:e.util.schemaHasRules($,e.RULES.all))||(g[g.length]=O)}}else var g=i;if(u||g.length){var k=e.errorPath,U=u||g.length>=e.opts.loopRequired,M=e.opts.ownProperties;if(p)if(r+=" var missing"+n+"; ",U){u||(r+=" var "+_+" = validate.schema"+c+"; ");var I="i"+n,z="schema"+n+"["+I+"]",q="' + "+z+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(k,z,e.opts.jsonPointers)),r+=" var "+b+" = true; ",u&&(r+=" if (schema"+n+" === undefined) "+b+" = true; else if (!Array.isArray(schema"+n+")) "+b+" = false; else {"),r+=" for (var "+I+" = 0; "+I+" < "+_+".length; "+I+"++) { "+b+" = "+m+"["+_+"["+I+"]] !== undefined ",M&&(r+=" && Object.prototype.hasOwnProperty.call("+m+", "+_+"["+I+"]) "),r+="; if (!"+b+") break; } ",u&&(r+=" } "),r+=" if (!"+b+") { ";var L=L||[];L.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { missingProperty: '"+q+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+q+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var A=r;r=L.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+A+"]); ":r+=" validate.errors = ["+A+"]; return false; ":r+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { "}else{r+=" if ( ";var D=g;if(D)for(var F,I=-1,le=D.length-1;I<le;){F=D[I+=1],I&&(r+=" || ");var Y=e.util.getProperty(F),re=m+Y;r+=" ( ( "+re+" === undefined ",M&&(r+=" || ! Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes(F)+"') "),r+=") && (missing"+n+" = "+e.util.toQuotedString(e.opts.jsonPointers?F:Y)+") ) "}r+=") { ";var z="missing"+n,q="' + "+z+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(k,z,!0):k+" + "+z);var L=L||[];L.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { missingProperty: '"+q+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+q+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var A=r;r=L.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+A+"]); ":r+=" validate.errors = ["+A+"]; return false; ":r+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { "}else if(U){u||(r+=" var "+_+" = validate.schema"+c+"; ");var I="i"+n,z="schema"+n+"["+I+"]",q="' + "+z+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(k,z,e.opts.jsonPointers)),u&&(r+=" if ("+_+" && !Array.isArray("+_+")) { var err = ",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { missingProperty: '"+q+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+q+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+_+" !== undefined) { "),r+=" for (var "+I+" = 0; "+I+" < "+_+".length; "+I+"++) { if ("+m+"["+_+"["+I+"]] === undefined ",M&&(r+=" || ! Object.prototype.hasOwnProperty.call("+m+", "+_+"["+I+"]) "),r+=") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { missingProperty: '"+q+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+q+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",u&&(r+=" } ")}else{var W=g;if(W)for(var F,V=-1,ge=W.length-1;V<ge;){F=W[V+=1];var Y=e.util.getProperty(F),q=e.util.escapeQuotes(F),re=m+Y;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(k,F,e.opts.jsonPointers)),r+=" if ( "+re+" === undefined ",M&&(r+=" || ! Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes(F)+"') "),r+=") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { missingProperty: '"+q+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+q+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=k}else p&&(r+=" if (true) {");return r}});var ei=J((zh,Xo)=>{"use strict";Xo.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m="data"+(l||""),b="valid"+n,u=e.opts.$data&&i&&i.$data,y;if(u?(r+=" var schema"+n+" = "+e.util.getData(i.$data,l,e.dataPathArr)+"; ",y="schema"+n):y=i,(i||u)&&e.opts.uniqueItems!==!1){u&&(r+=" var "+b+"; if ("+y+" === false || "+y+" === undefined) "+b+" = true; else if (typeof "+y+" != 'boolean') "+b+" = false; else { "),r+=" var i = "+m+".length , "+b+" = true , j; if (i > 1) { ";var _=e.schema.items&&e.schema.items.type,g=Array.isArray(_);if(!_||_=="object"||_=="array"||g&&(_.indexOf("object")>=0||_.indexOf("array")>=0))r+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+m+"[i], "+m+"[j])) { "+b+" = false; break outer; } } } ";else{r+=" var itemIndices = {}, item; for (;i--;) { var item = "+m+"[i]; ";var E="checkDataType"+(g?"s":"");r+=" if ("+e.util[E](_,"item",e.opts.strictNumbers,!0)+") continue; ",g&&(r+=` if (typeof item == 'string') item = '"' + item; `),r+=" if (typeof itemIndices[item] == 'number') { "+b+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}r+=" } ",u&&(r+=" } "),r+=" if (!"+b+") { ";var O=O||[];O.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { i: i, j: j } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(r+=" , schema: ",u?r+="validate.schema"+c:r+=""+i,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var S=r;r=O.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+S+"]); ":r+=" validate.errors = ["+S+"]; return false; ":r+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",p&&(r+=" else { ")}else p&&(r+=" if (true) { ");return r}});var ti=J((Hh,ri)=>{"use strict";ri.exports={$ref:ho(),allOf:vo(),anyOf:yo(),$comment:bo(),const:xo(),contains:So(),dependencies:wo(),enum:Ao(),format:$o(),if:Io(),items:Co(),maximum:gs(),minimum:gs(),maxItems:ys(),minItems:ys(),maxLength:_s(),minLength:_s(),maxProperties:bs(),minProperties:bs(),multipleOf:Mo(),not:Ho(),oneOf:Vo(),pattern:Bo(),properties:Qo(),propertyNames:Ko(),required:Yo(),uniqueItems:ei(),validate:ms()}});var ni=J((Uh,si)=>{"use strict";var ai=ti(),Ps=Qr().toHash;si.exports=function(){var e=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],t=["type","$comment"],s=["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"],r=["number","integer","string","array","object","boolean","null"];return e.all=Ps(t),e.types=Ps(r),e.forEach(function(n){n.rules=n.rules.map(function(l){var i;if(typeof l=="object"){var c=Object.keys(l)[0];i=l[c],l=c,i.forEach(function(p){t.push(p),e.all[p]=!0})}t.push(l);var f=e.all[l]={keyword:l,code:ai[l],implements:i};return f}),e.all.$comment={keyword:"$comment",code:ai.$comment},n.type&&(e.types[n.type]=n)}),e.keywords=Ps(t.concat(s)),e.custom={},e}});var li=J((Vh,ii)=>{"use strict";var oi=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];ii.exports=function(a,e){for(var t=0;t<e.length;t++){a=JSON.parse(JSON.stringify(a));var s=e[t].split("/"),r=a,n;for(n=1;n<s.length;n++)r=r[s[n]];for(n=0;n<oi.length;n++){var l=oi[n],i=r[l];i&&(r[l]={anyOf:[i,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]})}}return a}});var di=J((Zh,ui)=>{"use strict";var pf=ha().MissingRef;ui.exports=ci;function ci(a,e,t){var s=this;if(typeof this._opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");typeof e=="function"&&(t=e,e=void 0);var r=n(a).then(function(){var i=s._addSchema(a,void 0,e);return i.validate||l(i)});return t&&r.then(function(i){t(null,i)},t),r;function n(i){var c=i.$schema;return c&&!s.getSchema(c)?ci.call(s,{$ref:c},!0):Promise.resolve()}function l(i){try{return s._compile(i)}catch(f){if(f instanceof pf)return c(f);throw f}function c(f){var p=f.missingSchema;if(u(p))throw new Error("Schema "+p+" is loaded but "+f.missingRef+" cannot be resolved");var m=s._loadingSchemas[p];return m||(m=s._loadingSchemas[p]=s._opts.loadSchema(p),m.then(b,b)),m.then(function(y){if(!u(p))return n(y).then(function(){u(p)||s.addSchema(y,p,void 0,e)})}).then(function(){return l(i)});function b(){delete s._loadingSchemas[p]}function u(y){return s._refs[y]||s._schemas[y]}}}}});var pi=J((Bh,fi)=>{"use strict";fi.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m,b="data"+(l||""),u="valid"+n,y="errs__"+n,_=e.opts.$data&&i&&i.$data,g;_?(r+=" var schema"+n+" = "+e.util.getData(i.$data,l,e.dataPathArr)+"; ",g="schema"+n):g=i;var E=this,O="definition"+n,S=E.definition,w="",$,k,U,M,I;if(_&&S.$data){I="keywordValidate"+n;var z=S.validateSchema;r+=" var "+O+" = RULES.custom['"+t+"'].definition; var "+I+" = "+O+".validate;"}else{if(M=e.useCustomRule(E,i,e.schema,e),!M)return;g="validate.schema"+c,I=M.code,$=S.compile,k=S.inline,U=S.macro}var q=I+".errors",L="i"+n,A="ruleErr"+n,D=S.async;if(D&&!e.async)throw new Error("async keyword in sync schema");if(k||U||(r+=""+q+" = null;"),r+="var "+y+" = errors;var "+u+";",_&&S.$data&&(w+="}",r+=" if ("+g+" === undefined) { "+u+" = true; } else { ",z&&(w+="}",r+=" "+u+" = "+O+".validateSchema("+g+"); if ("+u+") { ")),k)S.statements?r+=" "+M.validate+" ":r+=" "+u+" = "+M.validate+"; ";else if(U){var F=e.util.copy(e),w="";F.level++;var le="valid"+F.level;F.schema=M.validate,F.schemaPath="";var Y=e.compositeRule;e.compositeRule=F.compositeRule=!0;var re=e.validate(F).replace(/validate\.schema/g,I);e.compositeRule=F.compositeRule=Y,r+=" "+re}else{var W=W||[];W.push(r),r="",r+=" "+I+".call( ",e.opts.passContext?r+="this":r+="self",$||S.schema===!1?r+=" , "+b+" ":r+=" , "+g+" , "+b+" , validate.schema"+e.schemaPath+" ",r+=" , (dataPath || '')",e.errorPath!='""'&&(r+=" + "+e.errorPath);var V=l?"data"+(l-1||""):"parentData",ge=l?e.dataPathArr[l]:"parentDataProperty";r+=" , "+V+" , "+ge+" , rootData ) ";var Oe=r;r=W.pop(),S.errors===!1?(r+=" "+u+" = ",D&&(r+="await "),r+=""+Oe+"; "):D?(q="customErrors"+n,r+=" var "+q+" = null; try { "+u+" = await "+Oe+"; } catch (e) { "+u+" = false; if (e instanceof ValidationError) "+q+" = e.errors; else throw e; } "):r+=" "+q+" = null; "+u+" = "+Oe+"; "}if(S.modifying&&(r+=" if ("+V+") "+b+" = "+V+"["+ge+"];"),r+=""+w,S.valid)p&&(r+=" if (true) { ");else{r+=" if ( ",S.valid===void 0?(r+=" !",U?r+=""+le:r+=""+u):r+=" "+!S.valid+" ",r+=") { ",m=E.keyword;var W=W||[];W.push(r),r="";var W=W||[];W.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(m||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { keyword: '"+E.keyword+"' } ",e.opts.messages!==!1&&(r+=` , message: 'should pass "`+E.keyword+`" keyword validation' `),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+b+" "),r+=" } "):r+=" {} ";var Ie=r;r=W.pop(),!e.compositeRule&&p?e.async?r+=" throw new ValidationError(["+Ie+"]); ":r+=" validate.errors = ["+Ie+"]; return false; ":r+=" var err = "+Ie+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var se=r;r=W.pop(),k?S.errors?S.errors!="full"&&(r+=" for (var "+L+"="+y+"; "+L+"<errors; "+L+"++) { var "+A+" = vErrors["+L+"]; if ("+A+".dataPath === undefined) "+A+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+A+".schemaPath === undefined) { "+A+'.schemaPath = "'+f+'"; } ',e.opts.verbose&&(r+=" "+A+".schema = "+g+"; "+A+".data = "+b+"; "),r+=" } "):S.errors===!1?r+=" "+se+" ":(r+=" if ("+y+" == errors) { "+se+" } else { for (var "+L+"="+y+"; "+L+"<errors; "+L+"++) { var "+A+" = vErrors["+L+"]; if ("+A+".dataPath === undefined) "+A+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+A+".schemaPath === undefined) { "+A+'.schemaPath = "'+f+'"; } ',e.opts.verbose&&(r+=" "+A+".schema = "+g+"; "+A+".data = "+b+"; "),r+=" } } "):U?(r+=" var err = ",e.createErrors!==!1?(r+=" { keyword: '"+(m||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { keyword: '"+E.keyword+"' } ",e.opts.messages!==!1&&(r+=` , message: 'should pass "`+E.keyword+`" keyword validation' `),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+b+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&p&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; ")):S.errors===!1?r+=" "+se+" ":(r+=" if (Array.isArray("+q+")) { if (vErrors === null) vErrors = "+q+"; else vErrors = vErrors.concat("+q+"); errors = vErrors.length; for (var "+L+"="+y+"; "+L+"<errors; "+L+"++) { var "+A+" = vErrors["+L+"]; if ("+A+".dataPath === undefined) "+A+".dataPath = (dataPath || '') + "+e.errorPath+"; "+A+'.schemaPath = "'+f+'"; ',e.opts.verbose&&(r+=" "+A+".schema = "+g+"; "+A+".data = "+b+"; "),r+=" } } else { "+se+" } "),r+=" } ",p&&(r+=" else { ")}return r}});var xs=J((Jh,hf)=>{hf.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 vi=J((Qh,mi)=>{"use strict";var hi=xs();mi.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:hi.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:hi.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}});var yi=J((Gh,gi)=>{"use strict";var mf=/^[a-z_$][a-z0-9_$-]*$/i,vf=pi(),gf=vi();gi.exports={add:yf,get:_f,remove:bf,validate:Es};function yf(a,e){var t=this.RULES;if(t.keywords[a])throw new Error("Keyword "+a+" is already defined");if(!mf.test(a))throw new Error("Keyword "+a+" is not a valid identifier");if(e){this.validateKeyword(e,!0);var s=e.type;if(Array.isArray(s))for(var r=0;r<s.length;r++)l(a,s[r],e);else l(a,s,e);var n=e.metaSchema;n&&(e.$data&&this._opts.$data&&(n={anyOf:[n,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}),e.validateSchema=this.compile(n,!0))}t.keywords[a]=t.all[a]=!0;function l(i,c,f){for(var p,m=0;m<t.length;m++){var b=t[m];if(b.type==c){p=b;break}}p||(p={type:c,rules:[]},t.push(p));var u={keyword:i,definition:f,custom:!0,code:vf,implements:f.implements};p.rules.push(u),t.custom[i]=u}return this}function _f(a){var e=this.RULES.custom[a];return e?e.definition:this.RULES.keywords[a]||!1}function bf(a){var e=this.RULES;delete e.keywords[a],delete e.all[a],delete e.custom[a];for(var t=0;t<e.length;t++)for(var s=e[t].rules,r=0;r<s.length;r++)if(s[r].keyword==a){s.splice(r,1);break}return this}function Es(a,e){Es.errors=null;var t=this._validateKeyword=this._validateKeyword||this.compile(gf,!0);if(t(a))return!0;if(Es.errors=t.errors,e)throw new Error("custom keyword definition is invalid: "+this.errorsText(t.errors));return!1}});var _i=J((Kh,Pf)=>{Pf.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON Schema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var Oi=J((Wh,Ai)=>{"use strict";var Pi=Wn(),Gr=pa(),xf=Xn(),xi=ls(),Ef=hs(),Sf=fo(),Rf=ni(),Ei=li(),Si=Qr();Ai.exports=_e;_e.prototype.validate=Tf;_e.prototype.compile=Af;_e.prototype.addSchema=Of;_e.prototype.addMetaSchema=$f;_e.prototype.validateSchema=kf;_e.prototype.getSchema=Df;_e.prototype.removeSchema=jf;_e.prototype.addFormat=Uf;_e.prototype.errorsText=Hf;_e.prototype._addSchema=Nf;_e.prototype._compile=Lf;_e.prototype.compileAsync=di();var xa=yi();_e.prototype.addKeyword=xa.add;_e.prototype.getKeyword=xa.get;_e.prototype.removeKeyword=xa.remove;_e.prototype.validateKeyword=xa.validate;var Ri=ha();_e.ValidationError=Ri.Validation;_e.MissingRefError=Ri.MissingRef;_e.$dataMetaSchema=Ei;var Pa="http://json-schema.org/draft-07/schema",bi=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],wf=["/properties"];function _e(a){if(!(this instanceof _e))return new _e(a);a=this._opts=Si.copy(a)||{},Gf(this),this._schemas={},this._refs={},this._fragments={},this._formats=Sf(a.format),this._cache=a.cache||new xf,this._loadingSchemas={},this._compilations=[],this.RULES=Rf(),this._getId=Ff(a),a.loopRequired=a.loopRequired||1/0,a.errorDataPath=="property"&&(a._errorDataPathProperty=!0),a.serialize===void 0&&(a.serialize=Ef),this._metaOpts=Qf(this),a.formats&&Bf(this),a.keywords&&Jf(this),Vf(this),typeof a.meta=="object"&&this.addMetaSchema(a.meta),a.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),Zf(this)}function Tf(a,e){var t;if(typeof a=="string"){if(t=this.getSchema(a),!t)throw new Error('no schema with key or ref "'+a+'"')}else{var s=this._addSchema(a);t=s.validate||this._compile(s)}var r=t(e);return t.$async!==!0&&(this.errors=t.errors),r}function Af(a,e){var t=this._addSchema(a,void 0,e);return t.validate||this._compile(t)}function Of(a,e,t,s){if(Array.isArray(a)){for(var r=0;r<a.length;r++)this.addSchema(a[r],void 0,t,s);return this}var n=this._getId(a);if(n!==void 0&&typeof n!="string")throw new Error("schema id must be string");return e=Gr.normalizeId(e||n),Ti(this,e),this._schemas[e]=this._addSchema(a,t,s,!0),this}function $f(a,e,t){return this.addSchema(a,e,t,!0),this}function kf(a,e){var t=a.$schema;if(t!==void 0&&typeof t!="string")throw new Error("$schema must be a string");if(t=t||this._opts.defaultMeta||If(this),!t)return this.logger.warn("meta-schema not available"),this.errors=null,!0;var s=this.validate(t,a);if(!s&&e){var r="schema is invalid: "+this.errorsText();if(this._opts.validateSchema=="log")this.logger.error(r);else throw new Error(r)}return s}function If(a){var e=a._opts.meta;return a._opts.defaultMeta=typeof e=="object"?a._getId(e)||e:a.getSchema(Pa)?Pa:void 0,a._opts.defaultMeta}function Df(a){var e=wi(this,a);switch(typeof e){case"object":return e.validate||this._compile(e);case"string":return this.getSchema(e);case"undefined":return Cf(this,a)}}function Cf(a,e){var t=Gr.schema.call(a,{schema:{}},e);if(t){var s=t.schema,r=t.root,n=t.baseId,l=Pi.call(a,s,r,void 0,n);return a._fragments[e]=new xi({ref:e,fragment:!0,schema:s,root:r,baseId:n,validate:l}),l}}function wi(a,e){return e=Gr.normalizeId(e),a._schemas[e]||a._refs[e]||a._fragments[e]}function jf(a){if(a instanceof RegExp)return ba(this,this._schemas,a),ba(this,this._refs,a),this;switch(typeof a){case"undefined":return ba(this,this._schemas),ba(this,this._refs),this._cache.clear(),this;case"string":var e=wi(this,a);return e&&this._cache.del(e.cacheKey),delete this._schemas[a],delete this._refs[a],this;case"object":var t=this._opts.serialize,s=t?t(a):a;this._cache.del(s);var r=this._getId(a);r&&(r=Gr.normalizeId(r),delete this._schemas[r],delete this._refs[r])}return this}function ba(a,e,t){for(var s in e){var r=e[s];!r.meta&&(!t||t.test(s))&&(a._cache.del(r.cacheKey),delete e[s])}}function Nf(a,e,t,s){if(typeof a!="object"&&typeof a!="boolean")throw new Error("schema should be object or boolean");var r=this._opts.serialize,n=r?r(a):a,l=this._cache.get(n);if(l)return l;s=s||this._opts.addUsedSchema!==!1;var i=Gr.normalizeId(this._getId(a));i&&s&&Ti(this,i);var c=this._opts.validateSchema!==!1&&!e,f;c&&!(f=i&&i==Gr.normalizeId(a.$schema))&&this.validateSchema(a,!0);var p=Gr.ids.call(this,a),m=new xi({id:i,schema:a,localRefs:p,cacheKey:n,meta:t});return i[0]!="#"&&s&&(this._refs[i]=m),this._cache.put(n,m),c&&f&&this.validateSchema(a,!0),m}function Lf(a,e){if(a.compiling)return a.validate=r,r.schema=a.schema,r.errors=null,r.root=e||r,a.schema.$async===!0&&(r.$async=!0),r;a.compiling=!0;var t;a.meta&&(t=this._opts,this._opts=this._metaOpts);var s;try{s=Pi.call(this,a.schema,e,a.localRefs)}catch(n){throw delete a.validate,n}finally{a.compiling=!1,a.meta&&(this._opts=t)}return a.validate=s,a.refs=s.refs,a.refVal=s.refVal,a.root=s.root,s;function r(){var n=a.validate,l=n.apply(this,arguments);return r.errors=n.errors,l}}function Ff(a){switch(a.schemaId){case"auto":return zf;case"id":return qf;default:return Mf}}function qf(a){return a.$id&&this.logger.warn("schema $id ignored",a.$id),a.id}function Mf(a){return a.id&&this.logger.warn("schema id ignored",a.id),a.$id}function zf(a){if(a.$id&&a.id&&a.$id!=a.id)throw new Error("schema $id is different from id");return a.$id||a.id}function Hf(a,e){if(a=a||this.errors,!a)return"No errors";e=e||{};for(var t=e.separator===void 0?", ":e.separator,s=e.dataVar===void 0?"data":e.dataVar,r="",n=0;n<a.length;n++){var l=a[n];l&&(r+=s+l.dataPath+" "+l.message+t)}return r.slice(0,-t.length)}function Uf(a,e){return typeof e=="string"&&(e=new RegExp(e)),this._formats[a]=e,this}function Vf(a){var e;if(a._opts.$data&&(e=_i(),a.addMetaSchema(e,e.$id,!0)),a._opts.meta!==!1){var t=xs();a._opts.$data&&(t=Ei(t,wf)),a.addMetaSchema(t,Pa,!0),a._refs["http://json-schema.org/schema"]=Pa}}function Zf(a){var e=a._opts.schemas;if(e)if(Array.isArray(e))a.addSchema(e);else for(var t in e)a.addSchema(e[t],t)}function Bf(a){for(var e in a._opts.formats){var t=a._opts.formats[e];a.addFormat(e,t)}}function Jf(a){for(var e in a._opts.keywords){var t=a._opts.keywords[e];a.addKeyword(e,t)}}function Ti(a,e){if(a._schemas[e]||a._refs[e])throw new Error('schema with key or id "'+e+'" already exists')}function Qf(a){for(var e=Si.copy(a._opts),t=0;t<bi.length;t++)delete e[bi[t]];return e}function Gf(a){var e=a._opts.logger;if(e===!1)a.logger={log:Ss,warn:Ss,error:Ss};else{if(e===void 0&&(e=console),!(typeof e=="object"&&e.log&&e.warn&&e.error))throw new Error("logger must implement log, warn and error methods");a.logger=e}}function Ss(){}});import{createRequire as dp}from"node:module";var o={};mc(o,{BRAND:()=>Uc,DIRTY:()=>Ir,EMPTY_PATH:()=>Pc,INVALID:()=>Z,NEVER:()=>Tu,OK:()=>ke,ParseStatus:()=>Te,Schema:()=>G,ZodAny:()=>Pr,ZodArray:()=>vr,ZodBigInt:()=>Cr,ZodBoolean:()=>jr,ZodBranded:()=>St,ZodCatch:()=>Br,ZodDate:()=>Nr,ZodDefault:()=>Zr,ZodDiscriminatedUnion:()=>Ft,ZodEffects:()=>Qe,ZodEnum:()=>Ur,ZodError:()=>Le,ZodFirstPartyTypeKind:()=>T,ZodFunction:()=>Mt,ZodIntersection:()=>Mr,ZodIssueCode:()=>R,ZodLazy:()=>zr,ZodLiteral:()=>Hr,ZodMap:()=>ut,ZodNaN:()=>ft,ZodNativeEnum:()=>Vr,ZodNever:()=>Ye,ZodNull:()=>Fr,ZodNullable:()=>or,ZodNumber:()=>Dr,ZodObject:()=>Fe,ZodOptional:()=>Be,ZodParsedType:()=>j,ZodPipeline:()=>Rt,ZodPromise:()=>xr,ZodReadonly:()=>Jr,ZodRecord:()=>qt,ZodSchema:()=>G,ZodSet:()=>dt,ZodString:()=>br,ZodSymbol:()=>lt,ZodTransformer:()=>Qe,ZodTuple:()=>nr,ZodType:()=>G,ZodUndefined:()=>Lr,ZodUnion:()=>qr,ZodUnknown:()=>mr,ZodVoid:()=>ct,addIssueToContext:()=>C,any:()=>Yc,array:()=>tu,bigint:()=>Jc,boolean:()=>ln,coerce:()=>wu,custom:()=>sn,date:()=>Qc,datetimeRegex:()=>tn,defaultErrorMap:()=>pr,discriminatedUnion:()=>ou,effect:()=>yu,enum:()=>mu,function:()=>fu,getErrorMap:()=>nt,getParsedType:()=>sr,instanceof:()=>Zc,intersection:()=>iu,isAborted:()=>Nt,isAsync:()=>ot,isDirty:()=>Lt,isValid:()=>_r,late:()=>Vc,lazy:()=>pu,literal:()=>hu,makeIssue:()=>Et,map:()=>uu,nan:()=>Bc,nativeEnum:()=>vu,never:()=>eu,null:()=>Wc,nullable:()=>bu,number:()=>on,object:()=>au,objectUtil:()=>Ma,oboolean:()=>Ru,onumber:()=>Su,optional:()=>_u,ostring:()=>Eu,pipeline:()=>xu,preprocess:()=>Pu,promise:()=>gu,quotelessJson:()=>yc,record:()=>cu,set:()=>du,setErrorMap:()=>bc,strictObject:()=>su,string:()=>nn,symbol:()=>Gc,transformer:()=>yu,tuple:()=>lu,undefined:()=>Kc,union:()=>nu,unknown:()=>Xc,util:()=>X,void:()=>ru});var X;(function(a){a.assertEqual=r=>{};function e(r){}a.assertIs=e;function t(r){throw new Error}a.assertNever=t,a.arrayToEnum=r=>{let n={};for(let l of r)n[l]=l;return n},a.getValidEnumValues=r=>{let n=a.objectKeys(r).filter(i=>typeof r[r[i]]!="number"),l={};for(let i of n)l[i]=r[i];return a.objectValues(l)},a.objectValues=r=>a.objectKeys(r).map(function(n){return r[n]}),a.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let n=[];for(let l in r)Object.prototype.hasOwnProperty.call(r,l)&&n.push(l);return n},a.find=(r,n)=>{for(let l of r)if(n(l))return l},a.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function s(r,n=" | "){return r.map(l=>typeof l=="string"?`'${l}'`:l).join(n)}a.joinValues=s,a.jsonStringifyReplacer=(r,n)=>typeof n=="bigint"?n.toString():n})(X||(X={}));var Ma;(function(a){a.mergeShapes=(e,t)=>({...e,...t})})(Ma||(Ma={}));var j=X.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),sr=a=>{switch(typeof a){case"undefined":return j.undefined;case"string":return j.string;case"number":return Number.isNaN(a)?j.nan:j.number;case"boolean":return j.boolean;case"function":return j.function;case"bigint":return j.bigint;case"symbol":return j.symbol;case"object":return Array.isArray(a)?j.array:a===null?j.null:a.then&&typeof a.then=="function"&&a.catch&&typeof a.catch=="function"?j.promise:typeof Map<"u"&&a instanceof Map?j.map:typeof Set<"u"&&a instanceof Set?j.set:typeof Date<"u"&&a instanceof Date?j.date:j.object;default:return j.unknown}};var R=X.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"]),yc=a=>JSON.stringify(a,null,2).replace(/"([^"]+)":/g,"$1:"),Le=class a extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(n){return n.message},s={_errors:[]},r=n=>{for(let l of n.issues)if(l.code==="invalid_union")l.unionErrors.map(r);else if(l.code==="invalid_return_type")r(l.returnTypeError);else if(l.code==="invalid_arguments")r(l.argumentsError);else if(l.path.length===0)s._errors.push(t(l));else{let i=s,c=0;for(;c<l.path.length;){let f=l.path[c];c===l.path.length-1?(i[f]=i[f]||{_errors:[]},i[f]._errors.push(t(l))):i[f]=i[f]||{_errors:[]},i=i[f],c++}}};return r(this),s}static assert(e){if(!(e instanceof a))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,X.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},s=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else s.push(e(r));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}};Le.create=a=>new Le(a);var _c=(a,e)=>{let t;switch(a.code){case R.invalid_type:a.received===j.undefined?t="Required":t=`Expected ${a.expected}, received ${a.received}`;break;case R.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(a.expected,X.jsonStringifyReplacer)}`;break;case R.unrecognized_keys:t=`Unrecognized key(s) in object: ${X.joinValues(a.keys,", ")}`;break;case R.invalid_union:t="Invalid input";break;case R.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${X.joinValues(a.options)}`;break;case R.invalid_enum_value:t=`Invalid enum value. Expected ${X.joinValues(a.options)}, received '${a.received}'`;break;case R.invalid_arguments:t="Invalid function arguments";break;case R.invalid_return_type:t="Invalid function return type";break;case R.invalid_date:t="Invalid date";break;case R.invalid_string:typeof a.validation=="object"?"includes"in a.validation?(t=`Invalid input: must include "${a.validation.includes}"`,typeof a.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${a.validation.position}`)):"startsWith"in a.validation?t=`Invalid input: must start with "${a.validation.startsWith}"`:"endsWith"in a.validation?t=`Invalid input: must end with "${a.validation.endsWith}"`:X.assertNever(a.validation):a.validation!=="regex"?t=`Invalid ${a.validation}`:t="Invalid";break;case R.too_small:a.type==="array"?t=`Array must contain ${a.exact?"exactly":a.inclusive?"at least":"more than"} ${a.minimum} element(s)`:a.type==="string"?t=`String must contain ${a.exact?"exactly":a.inclusive?"at least":"over"} ${a.minimum} character(s)`:a.type==="number"?t=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="bigint"?t=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="date"?t=`Date must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(a.minimum))}`:t="Invalid input";break;case R.too_big:a.type==="array"?t=`Array must contain ${a.exact?"exactly":a.inclusive?"at most":"less than"} ${a.maximum} element(s)`:a.type==="string"?t=`String must contain ${a.exact?"exactly":a.inclusive?"at most":"under"} ${a.maximum} character(s)`:a.type==="number"?t=`Number must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="bigint"?t=`BigInt must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="date"?t=`Date must be ${a.exact?"exactly":a.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(a.maximum))}`:t="Invalid input";break;case R.custom:t="Invalid input";break;case R.invalid_intersection_types:t="Intersection results could not be merged";break;case R.not_multiple_of:t=`Number must be a multiple of ${a.multipleOf}`;break;case R.not_finite:t="Number must be finite";break;default:t=e.defaultError,X.assertNever(a)}return{message:t}},pr=_c;var Ws=pr;function bc(a){Ws=a}function nt(){return Ws}var Et=a=>{let{data:e,path:t,errorMaps:s,issueData:r}=a,n=[...t,...r.path||[]],l={...r,path:n};if(r.message!==void 0)return{...r,path:n,message:r.message};let i="",c=s.filter(f=>!!f).slice().reverse();for(let f of c)i=f(l,{data:e,defaultError:i}).message;return{...r,path:n,message:i}},Pc=[];function C(a,e){let t=nt(),s=Et({issueData:e,data:a.data,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,t,t===pr?void 0:pr].filter(r=>!!r)});a.common.issues.push(s)}var Te=class a{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let s=[];for(let r of t){if(r.status==="aborted")return Z;r.status==="dirty"&&e.dirty(),s.push(r.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){let s=[];for(let r of t){let n=await r.key,l=await r.value;s.push({key:n,value:l})}return a.mergeObjectSync(e,s)}static mergeObjectSync(e,t){let s={};for(let r of t){let{key:n,value:l}=r;if(n.status==="aborted"||l.status==="aborted")return Z;n.status==="dirty"&&e.dirty(),l.status==="dirty"&&e.dirty(),n.value!=="__proto__"&&(typeof l.value<"u"||r.alwaysSet)&&(s[n.value]=l.value)}return{status:e.value,value:s}}},Z=Object.freeze({status:"aborted"}),Ir=a=>({status:"dirty",value:a}),ke=a=>({status:"valid",value:a}),Nt=a=>a.status==="aborted",Lt=a=>a.status==="dirty",_r=a=>a.status==="valid",ot=a=>typeof Promise<"u"&&a instanceof Promise;var H;(function(a){a.errToObj=e=>typeof e=="string"?{message:e}:e||{},a.toString=e=>typeof e=="string"?e:e?.message})(H||(H={}));var Je=class{constructor(e,t,s,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Ys=(a,e)=>{if(_r(e))return{success:!0,data:e.value};if(!a.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new Le(a.common.issues);return this._error=t,this._error}}};function Q(a){if(!a)return{};let{errorMap:e,invalid_type_error:t,required_error:s,description:r}=a;if(e&&(t||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(l,i)=>{let{message:c}=a;return l.code==="invalid_enum_value"?{message:c??i.defaultError}:typeof i.data>"u"?{message:c??s??i.defaultError}:l.code!=="invalid_type"?{message:i.defaultError}:{message:c??t??i.defaultError}},description:r}}var G=class{get description(){return this._def.description}_getType(e){return sr(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:sr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Te,ctx:{common:e.parent.common,data:e.data,parsedType:sr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(ot(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){let s={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:sr(e)},r=this._parseSync({data:e,path:s.path,parent:s});return Ys(s,r)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:sr(e)};if(!this["~standard"].async)try{let s=this._parseSync({data:e,path:[],parent:t});return _r(s)?{value:s.value}:{issues:t.common.issues}}catch(s){s?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(s=>_r(s)?{value:s.value}:{issues:t.common.issues})}async parseAsync(e,t){let s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){let s={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:sr(e)},r=this._parse({data:e,path:s.path,parent:s}),n=await(ot(r)?r:Promise.resolve(r));return Ys(s,n)}refine(e,t){let s=r=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(r):t;return this._refinement((r,n)=>{let l=e(r),i=()=>n.addIssue({code:R.custom,...s(r)});return typeof Promise<"u"&&l instanceof Promise?l.then(c=>c?!0:(i(),!1)):l?!0:(i(),!1)})}refinement(e,t){return this._refinement((s,r)=>e(s)?!0:(r.addIssue(typeof t=="function"?t(s,r):t),!1))}_refinement(e){return new Qe({schema:this,typeName:T.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 Be.create(this,this._def)}nullable(){return or.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return vr.create(this)}promise(){return xr.create(this,this._def)}or(e){return qr.create([this,e],this._def)}and(e){return Mr.create(this,e,this._def)}transform(e){return new Qe({...Q(this._def),schema:this,typeName:T.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new Zr({...Q(this._def),innerType:this,defaultValue:t,typeName:T.ZodDefault})}brand(){return new St({typeName:T.ZodBranded,type:this,...Q(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new Br({...Q(this._def),innerType:this,catchValue:t,typeName:T.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Rt.create(this,e)}readonly(){return Jr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},xc=/^c[^\s-]{8,}$/i,Ec=/^[0-9a-z]+$/,Sc=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Rc=/^[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,wc=/^[a-z0-9_-]{21}$/i,Tc=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ac=/^[-+]?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)?)??$/,Oc=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,$c="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",za,kc=/^(?:(?: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])$/,Ic=/^(?:(?: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])$/,Dc=/^(([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]))$/,Cc=/^(([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])$/,jc=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Nc=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,en="((\\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])))",Lc=new RegExp(`^${en}$`);function rn(a){let e="[0-5]\\d";a.precision?e=`${e}\\.\\d{${a.precision}}`:a.precision==null&&(e=`${e}(\\.\\d+)?`);let t=a.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function Fc(a){return new RegExp(`^${rn(a)}$`)}function tn(a){let e=`${en}T${rn(a)}`,t=[];return t.push(a.local?"Z?":"Z"),a.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function qc(a,e){return!!((e==="v4"||!e)&&kc.test(a)||(e==="v6"||!e)&&Dc.test(a))}function Mc(a,e){if(!Tc.test(a))return!1;try{let[t]=a.split(".");if(!t)return!1;let s=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),r=JSON.parse(atob(s));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function zc(a,e){return!!((e==="v4"||!e)&&Ic.test(a)||(e==="v6"||!e)&&Cc.test(a))}var br=class a extends G{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==j.string){let n=this._getOrReturnCtx(e);return C(n,{code:R.invalid_type,expected:j.string,received:n.parsedType}),Z}let s=new Te,r;for(let n of this._def.checks)if(n.kind==="min")e.data.length<n.value&&(r=this._getOrReturnCtx(e,r),C(r,{code:R.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),s.dirty());else if(n.kind==="max")e.data.length>n.value&&(r=this._getOrReturnCtx(e,r),C(r,{code:R.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),s.dirty());else if(n.kind==="length"){let l=e.data.length>n.value,i=e.data.length<n.value;(l||i)&&(r=this._getOrReturnCtx(e,r),l?C(r,{code:R.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):i&&C(r,{code:R.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),s.dirty())}else if(n.kind==="email")Oc.test(e.data)||(r=this._getOrReturnCtx(e,r),C(r,{validation:"email",code:R.invalid_string,message:n.message}),s.dirty());else if(n.kind==="emoji")za||(za=new RegExp($c,"u")),za.test(e.data)||(r=this._getOrReturnCtx(e,r),C(r,{validation:"emoji",code:R.invalid_string,message:n.message}),s.dirty());else if(n.kind==="uuid")Rc.test(e.data)||(r=this._getOrReturnCtx(e,r),C(r,{validation:"uuid",code:R.invalid_string,message:n.message}),s.dirty());else if(n.kind==="nanoid")wc.test(e.data)||(r=this._getOrReturnCtx(e,r),C(r,{validation:"nanoid",code:R.invalid_string,message:n.message}),s.dirty());else if(n.kind==="cuid")xc.test(e.data)||(r=this._getOrReturnCtx(e,r),C(r,{validation:"cuid",code:R.invalid_string,message:n.message}),s.dirty());else if(n.kind==="cuid2")Ec.test(e.data)||(r=this._getOrReturnCtx(e,r),C(r,{validation:"cuid2",code:R.invalid_string,message:n.message}),s.dirty());else if(n.kind==="ulid")Sc.test(e.data)||(r=this._getOrReturnCtx(e,r),C(r,{validation:"ulid",code:R.invalid_string,message:n.message}),s.dirty());else if(n.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),C(r,{validation:"url",code:R.invalid_string,message:n.message}),s.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),C(r,{validation:"regex",code:R.invalid_string,message:n.message}),s.dirty())):n.kind==="trim"?e.data=e.data.trim():n.kind==="includes"?e.data.includes(n.value,n.position)||(r=this._getOrReturnCtx(e,r),C(r,{code:R.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),s.dirty()):n.kind==="toLowerCase"?e.data=e.data.toLowerCase():n.kind==="toUpperCase"?e.data=e.data.toUpperCase():n.kind==="startsWith"?e.data.startsWith(n.value)||(r=this._getOrReturnCtx(e,r),C(r,{code:R.invalid_string,validation:{startsWith:n.value},message:n.message}),s.dirty()):n.kind==="endsWith"?e.data.endsWith(n.value)||(r=this._getOrReturnCtx(e,r),C(r,{code:R.invalid_string,validation:{endsWith:n.value},message:n.message}),s.dirty()):n.kind==="datetime"?tn(n).test(e.data)||(r=this._getOrReturnCtx(e,r),C(r,{code:R.invalid_string,validation:"datetime",message:n.message}),s.dirty()):n.kind==="date"?Lc.test(e.data)||(r=this._getOrReturnCtx(e,r),C(r,{code:R.invalid_string,validation:"date",message:n.message}),s.dirty()):n.kind==="time"?Fc(n).test(e.data)||(r=this._getOrReturnCtx(e,r),C(r,{code:R.invalid_string,validation:"time",message:n.message}),s.dirty()):n.kind==="duration"?Ac.test(e.data)||(r=this._getOrReturnCtx(e,r),C(r,{validation:"duration",code:R.invalid_string,message:n.message}),s.dirty()):n.kind==="ip"?qc(e.data,n.version)||(r=this._getOrReturnCtx(e,r),C(r,{validation:"ip",code:R.invalid_string,message:n.message}),s.dirty()):n.kind==="jwt"?Mc(e.data,n.alg)||(r=this._getOrReturnCtx(e,r),C(r,{validation:"jwt",code:R.invalid_string,message:n.message}),s.dirty()):n.kind==="cidr"?zc(e.data,n.version)||(r=this._getOrReturnCtx(e,r),C(r,{validation:"cidr",code:R.invalid_string,message:n.message}),s.dirty()):n.kind==="base64"?jc.test(e.data)||(r=this._getOrReturnCtx(e,r),C(r,{validation:"base64",code:R.invalid_string,message:n.message}),s.dirty()):n.kind==="base64url"?Nc.test(e.data)||(r=this._getOrReturnCtx(e,r),C(r,{validation:"base64url",code:R.invalid_string,message:n.message}),s.dirty()):X.assertNever(n);return{status:s.value,value:e.data}}_regex(e,t,s){return this.refinement(r=>e.test(r),{validation:t,code:R.invalid_string,...H.errToObj(s)})}_addCheck(e){return new a({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...H.errToObj(e)})}url(e){return this._addCheck({kind:"url",...H.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...H.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...H.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...H.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...H.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...H.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...H.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...H.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...H.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...H.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...H.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...H.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...H.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...H.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...H.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...H.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...H.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...H.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...H.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...H.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...H.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...H.errToObj(t)})}nonempty(e){return this.min(1,H.errToObj(e))}trim(){return new a({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new a({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new a({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};br.create=a=>new br({checks:[],typeName:T.ZodString,coerce:a?.coerce??!1,...Q(a)});function Hc(a,e){let t=(a.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,r=t>s?t:s,n=Number.parseInt(a.toFixed(r).replace(".","")),l=Number.parseInt(e.toFixed(r).replace(".",""));return n%l/10**r}var Dr=class a extends G{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==j.number){let n=this._getOrReturnCtx(e);return C(n,{code:R.invalid_type,expected:j.number,received:n.parsedType}),Z}let s,r=new Te;for(let n of this._def.checks)n.kind==="int"?X.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),C(s,{code:R.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty()):n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(s=this._getOrReturnCtx(e,s),C(s,{code:R.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(s=this._getOrReturnCtx(e,s),C(s,{code:R.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):n.kind==="multipleOf"?Hc(e.data,n.value)!==0&&(s=this._getOrReturnCtx(e,s),C(s,{code:R.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):n.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),C(s,{code:R.not_finite,message:n.message}),r.dirty()):X.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,H.toString(t))}gt(e,t){return this.setLimit("min",e,!1,H.toString(t))}lte(e,t){return this.setLimit("max",e,!0,H.toString(t))}lt(e,t){return this.setLimit("max",e,!1,H.toString(t))}setLimit(e,t,s,r){return new a({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:H.toString(r)}]})}_addCheck(e){return new a({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:H.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:H.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:H.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:H.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:H.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:H.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:H.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:H.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:H.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&X.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}};Dr.create=a=>new Dr({checks:[],typeName:T.ZodNumber,coerce:a?.coerce||!1,...Q(a)});var Cr=class a extends G{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)!==j.bigint)return this._getInvalidInput(e);let s,r=new Te;for(let n of this._def.checks)n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(s=this._getOrReturnCtx(e,s),C(s,{code:R.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(s=this._getOrReturnCtx(e,s),C(s,{code:R.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):n.kind==="multipleOf"?e.data%n.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),C(s,{code:R.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):X.assertNever(n);return{status:r.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return C(t,{code:R.invalid_type,expected:j.bigint,received:t.parsedType}),Z}gte(e,t){return this.setLimit("min",e,!0,H.toString(t))}gt(e,t){return this.setLimit("min",e,!1,H.toString(t))}lte(e,t){return this.setLimit("max",e,!0,H.toString(t))}lt(e,t){return this.setLimit("max",e,!1,H.toString(t))}setLimit(e,t,s,r){return new a({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:H.toString(r)}]})}_addCheck(e){return new a({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:H.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:H.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:H.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:H.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:H.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};Cr.create=a=>new Cr({checks:[],typeName:T.ZodBigInt,coerce:a?.coerce??!1,...Q(a)});var jr=class extends G{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==j.boolean){let s=this._getOrReturnCtx(e);return C(s,{code:R.invalid_type,expected:j.boolean,received:s.parsedType}),Z}return ke(e.data)}};jr.create=a=>new jr({typeName:T.ZodBoolean,coerce:a?.coerce||!1,...Q(a)});var Nr=class a extends G{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==j.date){let n=this._getOrReturnCtx(e);return C(n,{code:R.invalid_type,expected:j.date,received:n.parsedType}),Z}if(Number.isNaN(e.data.getTime())){let n=this._getOrReturnCtx(e);return C(n,{code:R.invalid_date}),Z}let s=new Te,r;for(let n of this._def.checks)n.kind==="min"?e.data.getTime()<n.value&&(r=this._getOrReturnCtx(e,r),C(r,{code:R.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),s.dirty()):n.kind==="max"?e.data.getTime()>n.value&&(r=this._getOrReturnCtx(e,r),C(r,{code:R.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),s.dirty()):X.assertNever(n);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new a({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:H.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:H.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};Nr.create=a=>new Nr({checks:[],coerce:a?.coerce||!1,typeName:T.ZodDate,...Q(a)});var lt=class extends G{_parse(e){if(this._getType(e)!==j.symbol){let s=this._getOrReturnCtx(e);return C(s,{code:R.invalid_type,expected:j.symbol,received:s.parsedType}),Z}return ke(e.data)}};lt.create=a=>new lt({typeName:T.ZodSymbol,...Q(a)});var Lr=class extends G{_parse(e){if(this._getType(e)!==j.undefined){let s=this._getOrReturnCtx(e);return C(s,{code:R.invalid_type,expected:j.undefined,received:s.parsedType}),Z}return ke(e.data)}};Lr.create=a=>new Lr({typeName:T.ZodUndefined,...Q(a)});var Fr=class extends G{_parse(e){if(this._getType(e)!==j.null){let s=this._getOrReturnCtx(e);return C(s,{code:R.invalid_type,expected:j.null,received:s.parsedType}),Z}return ke(e.data)}};Fr.create=a=>new Fr({typeName:T.ZodNull,...Q(a)});var Pr=class extends G{constructor(){super(...arguments),this._any=!0}_parse(e){return ke(e.data)}};Pr.create=a=>new Pr({typeName:T.ZodAny,...Q(a)});var mr=class extends G{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ke(e.data)}};mr.create=a=>new mr({typeName:T.ZodUnknown,...Q(a)});var Ye=class extends G{_parse(e){let t=this._getOrReturnCtx(e);return C(t,{code:R.invalid_type,expected:j.never,received:t.parsedType}),Z}};Ye.create=a=>new Ye({typeName:T.ZodNever,...Q(a)});var ct=class extends G{_parse(e){if(this._getType(e)!==j.undefined){let s=this._getOrReturnCtx(e);return C(s,{code:R.invalid_type,expected:j.void,received:s.parsedType}),Z}return ke(e.data)}};ct.create=a=>new ct({typeName:T.ZodVoid,...Q(a)});var vr=class a extends G{_parse(e){let{ctx:t,status:s}=this._processInputParams(e),r=this._def;if(t.parsedType!==j.array)return C(t,{code:R.invalid_type,expected:j.array,received:t.parsedType}),Z;if(r.exactLength!==null){let l=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(l||i)&&(C(t,{code:l?R.too_big:R.too_small,minimum:i?r.exactLength.value:void 0,maximum:l?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),s.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(C(t,{code:R.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),s.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(C(t,{code:R.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((l,i)=>r.type._parseAsync(new Je(t,l,t.path,i)))).then(l=>Te.mergeArray(s,l));let n=[...t.data].map((l,i)=>r.type._parseSync(new Je(t,l,t.path,i)));return Te.mergeArray(s,n)}get element(){return this._def.type}min(e,t){return new a({...this._def,minLength:{value:e,message:H.toString(t)}})}max(e,t){return new a({...this._def,maxLength:{value:e,message:H.toString(t)}})}length(e,t){return new a({...this._def,exactLength:{value:e,message:H.toString(t)}})}nonempty(e){return this.min(1,e)}};vr.create=(a,e)=>new vr({type:a,minLength:null,maxLength:null,exactLength:null,typeName:T.ZodArray,...Q(e)});function it(a){if(a instanceof Fe){let e={};for(let t in a.shape){let s=a.shape[t];e[t]=Be.create(it(s))}return new Fe({...a._def,shape:()=>e})}else return a instanceof vr?new vr({...a._def,type:it(a.element)}):a instanceof Be?Be.create(it(a.unwrap())):a instanceof or?or.create(it(a.unwrap())):a instanceof nr?nr.create(a.items.map(e=>it(e))):a}var Fe=class a extends G{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=X.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==j.object){let f=this._getOrReturnCtx(e);return C(f,{code:R.invalid_type,expected:j.object,received:f.parsedType}),Z}let{status:s,ctx:r}=this._processInputParams(e),{shape:n,keys:l}=this._getCached(),i=[];if(!(this._def.catchall instanceof Ye&&this._def.unknownKeys==="strip"))for(let f in r.data)l.includes(f)||i.push(f);let c=[];for(let f of l){let p=n[f],m=r.data[f];c.push({key:{status:"valid",value:f},value:p._parse(new Je(r,m,r.path,f)),alwaysSet:f in r.data})}if(this._def.catchall instanceof Ye){let f=this._def.unknownKeys;if(f==="passthrough")for(let p of i)c.push({key:{status:"valid",value:p},value:{status:"valid",value:r.data[p]}});else if(f==="strict")i.length>0&&(C(r,{code:R.unrecognized_keys,keys:i}),s.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let f=this._def.catchall;for(let p of i){let m=r.data[p];c.push({key:{status:"valid",value:p},value:f._parse(new Je(r,m,r.path,p)),alwaysSet:p in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let f=[];for(let p of c){let m=await p.key,b=await p.value;f.push({key:m,value:b,alwaysSet:p.alwaysSet})}return f}).then(f=>Te.mergeObjectSync(s,f)):Te.mergeObjectSync(s,c)}get shape(){return this._def.shape()}strict(e){return H.errToObj,new a({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{let r=this._def.errorMap?.(t,s).message??s.defaultError;return t.code==="unrecognized_keys"?{message:H.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new a({...this._def,unknownKeys:"strip"})}passthrough(){return new a({...this._def,unknownKeys:"passthrough"})}extend(e){return new a({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new a({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:T.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new a({...this._def,catchall:e})}pick(e){let t={};for(let s of X.objectKeys(e))e[s]&&this.shape[s]&&(t[s]=this.shape[s]);return new a({...this._def,shape:()=>t})}omit(e){let t={};for(let s of X.objectKeys(this.shape))e[s]||(t[s]=this.shape[s]);return new a({...this._def,shape:()=>t})}deepPartial(){return it(this)}partial(e){let t={};for(let s of X.objectKeys(this.shape)){let r=this.shape[s];e&&!e[s]?t[s]=r:t[s]=r.optional()}return new a({...this._def,shape:()=>t})}required(e){let t={};for(let s of X.objectKeys(this.shape))if(e&&!e[s])t[s]=this.shape[s];else{let n=this.shape[s];for(;n instanceof Be;)n=n._def.innerType;t[s]=n}return new a({...this._def,shape:()=>t})}keyof(){return an(X.objectKeys(this.shape))}};Fe.create=(a,e)=>new Fe({shape:()=>a,unknownKeys:"strip",catchall:Ye.create(),typeName:T.ZodObject,...Q(e)});Fe.strictCreate=(a,e)=>new Fe({shape:()=>a,unknownKeys:"strict",catchall:Ye.create(),typeName:T.ZodObject,...Q(e)});Fe.lazycreate=(a,e)=>new Fe({shape:a,unknownKeys:"strip",catchall:Ye.create(),typeName:T.ZodObject,...Q(e)});var qr=class extends G{_parse(e){let{ctx:t}=this._processInputParams(e),s=this._def.options;function r(n){for(let i of n)if(i.result.status==="valid")return i.result;for(let i of n)if(i.result.status==="dirty")return t.common.issues.push(...i.ctx.common.issues),i.result;let l=n.map(i=>new Le(i.ctx.common.issues));return C(t,{code:R.invalid_union,unionErrors:l}),Z}if(t.common.async)return Promise.all(s.map(async n=>{let l={...t,common:{...t.common,issues:[]},parent:null};return{result:await n._parseAsync({data:t.data,path:t.path,parent:l}),ctx:l}})).then(r);{let n,l=[];for(let c of s){let f={...t,common:{...t.common,issues:[]},parent:null},p=c._parseSync({data:t.data,path:t.path,parent:f});if(p.status==="valid")return p;p.status==="dirty"&&!n&&(n={result:p,ctx:f}),f.common.issues.length&&l.push(f.common.issues)}if(n)return t.common.issues.push(...n.ctx.common.issues),n.result;let i=l.map(c=>new Le(c));return C(t,{code:R.invalid_union,unionErrors:i}),Z}}get options(){return this._def.options}};qr.create=(a,e)=>new qr({options:a,typeName:T.ZodUnion,...Q(e)});var hr=a=>a instanceof zr?hr(a.schema):a instanceof Qe?hr(a.innerType()):a instanceof Hr?[a.value]:a instanceof Ur?a.options:a instanceof Vr?X.objectValues(a.enum):a instanceof Zr?hr(a._def.innerType):a instanceof Lr?[void 0]:a instanceof Fr?[null]:a instanceof Be?[void 0,...hr(a.unwrap())]:a instanceof or?[null,...hr(a.unwrap())]:a instanceof St||a instanceof Jr?hr(a.unwrap()):a instanceof Br?hr(a._def.innerType):[],Ft=class a extends G{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==j.object)return C(t,{code:R.invalid_type,expected:j.object,received:t.parsedType}),Z;let s=this.discriminator,r=t.data[s],n=this.optionsMap.get(r);return n?t.common.async?n._parseAsync({data:t.data,path:t.path,parent:t}):n._parseSync({data:t.data,path:t.path,parent:t}):(C(t,{code:R.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),Z)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){let r=new Map;for(let n of t){let l=hr(n.shape[e]);if(!l.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of l){if(r.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);r.set(i,n)}}return new a({typeName:T.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...Q(s)})}};function Ha(a,e){let t=sr(a),s=sr(e);if(a===e)return{valid:!0,data:a};if(t===j.object&&s===j.object){let r=X.objectKeys(e),n=X.objectKeys(a).filter(i=>r.indexOf(i)!==-1),l={...a,...e};for(let i of n){let c=Ha(a[i],e[i]);if(!c.valid)return{valid:!1};l[i]=c.data}return{valid:!0,data:l}}else if(t===j.array&&s===j.array){if(a.length!==e.length)return{valid:!1};let r=[];for(let n=0;n<a.length;n++){let l=a[n],i=e[n],c=Ha(l,i);if(!c.valid)return{valid:!1};r.push(c.data)}return{valid:!0,data:r}}else return t===j.date&&s===j.date&&+a==+e?{valid:!0,data:a}:{valid:!1}}var Mr=class extends G{_parse(e){let{status:t,ctx:s}=this._processInputParams(e),r=(n,l)=>{if(Nt(n)||Nt(l))return Z;let i=Ha(n.value,l.value);return i.valid?((Lt(n)||Lt(l))&&t.dirty(),{status:t.value,value:i.data}):(C(s,{code:R.invalid_intersection_types}),Z)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([n,l])=>r(n,l)):r(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}};Mr.create=(a,e,t)=>new Mr({left:a,right:e,typeName:T.ZodIntersection,...Q(t)});var nr=class a extends G{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==j.array)return C(s,{code:R.invalid_type,expected:j.array,received:s.parsedType}),Z;if(s.data.length<this._def.items.length)return C(s,{code:R.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Z;!this._def.rest&&s.data.length>this._def.items.length&&(C(s,{code:R.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let n=[...s.data].map((l,i)=>{let c=this._def.items[i]||this._def.rest;return c?c._parse(new Je(s,l,s.path,i)):null}).filter(l=>!!l);return s.common.async?Promise.all(n).then(l=>Te.mergeArray(t,l)):Te.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new a({...this._def,rest:e})}};nr.create=(a,e)=>{if(!Array.isArray(a))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new nr({items:a,typeName:T.ZodTuple,rest:null,...Q(e)})};var qt=class a extends G{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==j.object)return C(s,{code:R.invalid_type,expected:j.object,received:s.parsedType}),Z;let r=[],n=this._def.keyType,l=this._def.valueType;for(let i in s.data)r.push({key:n._parse(new Je(s,i,s.path,i)),value:l._parse(new Je(s,s.data[i],s.path,i)),alwaysSet:i in s.data});return s.common.async?Te.mergeObjectAsync(t,r):Te.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,s){return t instanceof G?new a({keyType:e,valueType:t,typeName:T.ZodRecord,...Q(s)}):new a({keyType:br.create(),valueType:e,typeName:T.ZodRecord,...Q(t)})}},ut=class extends G{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==j.map)return C(s,{code:R.invalid_type,expected:j.map,received:s.parsedType}),Z;let r=this._def.keyType,n=this._def.valueType,l=[...s.data.entries()].map(([i,c],f)=>({key:r._parse(new Je(s,i,s.path,[f,"key"])),value:n._parse(new Je(s,c,s.path,[f,"value"]))}));if(s.common.async){let i=new Map;return Promise.resolve().then(async()=>{for(let c of l){let f=await c.key,p=await c.value;if(f.status==="aborted"||p.status==="aborted")return Z;(f.status==="dirty"||p.status==="dirty")&&t.dirty(),i.set(f.value,p.value)}return{status:t.value,value:i}})}else{let i=new Map;for(let c of l){let f=c.key,p=c.value;if(f.status==="aborted"||p.status==="aborted")return Z;(f.status==="dirty"||p.status==="dirty")&&t.dirty(),i.set(f.value,p.value)}return{status:t.value,value:i}}}};ut.create=(a,e,t)=>new ut({valueType:e,keyType:a,typeName:T.ZodMap,...Q(t)});var dt=class a extends G{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==j.set)return C(s,{code:R.invalid_type,expected:j.set,received:s.parsedType}),Z;let r=this._def;r.minSize!==null&&s.data.size<r.minSize.value&&(C(s,{code:R.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&s.data.size>r.maxSize.value&&(C(s,{code:R.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let n=this._def.valueType;function l(c){let f=new Set;for(let p of c){if(p.status==="aborted")return Z;p.status==="dirty"&&t.dirty(),f.add(p.value)}return{status:t.value,value:f}}let i=[...s.data.values()].map((c,f)=>n._parse(new Je(s,c,s.path,f)));return s.common.async?Promise.all(i).then(c=>l(c)):l(i)}min(e,t){return new a({...this._def,minSize:{value:e,message:H.toString(t)}})}max(e,t){return new a({...this._def,maxSize:{value:e,message:H.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};dt.create=(a,e)=>new dt({valueType:a,minSize:null,maxSize:null,typeName:T.ZodSet,...Q(e)});var Mt=class a extends G{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==j.function)return C(t,{code:R.invalid_type,expected:j.function,received:t.parsedType}),Z;function s(i,c){return Et({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,nt(),pr].filter(f=>!!f),issueData:{code:R.invalid_arguments,argumentsError:c}})}function r(i,c){return Et({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,nt(),pr].filter(f=>!!f),issueData:{code:R.invalid_return_type,returnTypeError:c}})}let n={errorMap:t.common.contextualErrorMap},l=t.data;if(this._def.returns instanceof xr){let i=this;return ke(async function(...c){let f=new Le([]),p=await i._def.args.parseAsync(c,n).catch(u=>{throw f.addIssue(s(c,u)),f}),m=await Reflect.apply(l,this,p);return await i._def.returns._def.type.parseAsync(m,n).catch(u=>{throw f.addIssue(r(m,u)),f})})}else{let i=this;return ke(function(...c){let f=i._def.args.safeParse(c,n);if(!f.success)throw new Le([s(c,f.error)]);let p=Reflect.apply(l,this,f.data),m=i._def.returns.safeParse(p,n);if(!m.success)throw new Le([r(p,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new a({...this._def,args:nr.create(e).rest(mr.create())})}returns(e){return new a({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new a({args:e||nr.create([]).rest(mr.create()),returns:t||mr.create(),typeName:T.ZodFunction,...Q(s)})}},zr=class extends G{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})}};zr.create=(a,e)=>new zr({getter:a,typeName:T.ZodLazy,...Q(e)});var Hr=class extends G{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return C(t,{received:t.data,code:R.invalid_literal,expected:this._def.value}),Z}return{status:"valid",value:e.data}}get value(){return this._def.value}};Hr.create=(a,e)=>new Hr({value:a,typeName:T.ZodLiteral,...Q(e)});function an(a,e){return new Ur({values:a,typeName:T.ZodEnum,...Q(e)})}var Ur=class a extends G{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),s=this._def.values;return C(t,{expected:X.joinValues(s),received:t.parsedType,code:R.invalid_type}),Z}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),s=this._def.values;return C(t,{received:t.data,code:R.invalid_enum_value,options:s}),Z}return ke(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 a.create(e,{...this._def,...t})}exclude(e,t=this._def){return a.create(this.options.filter(s=>!e.includes(s)),{...this._def,...t})}};Ur.create=an;var Vr=class extends G{_parse(e){let t=X.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==j.string&&s.parsedType!==j.number){let r=X.objectValues(t);return C(s,{expected:X.joinValues(r),received:s.parsedType,code:R.invalid_type}),Z}if(this._cache||(this._cache=new Set(X.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let r=X.objectValues(t);return C(s,{received:s.data,code:R.invalid_enum_value,options:r}),Z}return ke(e.data)}get enum(){return this._def.values}};Vr.create=(a,e)=>new Vr({values:a,typeName:T.ZodNativeEnum,...Q(e)});var xr=class extends G{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==j.promise&&t.common.async===!1)return C(t,{code:R.invalid_type,expected:j.promise,received:t.parsedType}),Z;let s=t.parsedType===j.promise?t.data:Promise.resolve(t.data);return ke(s.then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}};xr.create=(a,e)=>new xr({type:a,typeName:T.ZodPromise,...Q(e)});var Qe=class extends G{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===T.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:s}=this._processInputParams(e),r=this._def.effect||null,n={addIssue:l=>{C(s,l),l.fatal?t.abort():t.dirty()},get path(){return s.path}};if(n.addIssue=n.addIssue.bind(n),r.type==="preprocess"){let l=r.transform(s.data,n);if(s.common.async)return Promise.resolve(l).then(async i=>{if(t.value==="aborted")return Z;let c=await this._def.schema._parseAsync({data:i,path:s.path,parent:s});return c.status==="aborted"?Z:c.status==="dirty"?Ir(c.value):t.value==="dirty"?Ir(c.value):c});{if(t.value==="aborted")return Z;let i=this._def.schema._parseSync({data:l,path:s.path,parent:s});return i.status==="aborted"?Z:i.status==="dirty"?Ir(i.value):t.value==="dirty"?Ir(i.value):i}}if(r.type==="refinement"){let l=i=>{let c=r.refinement(i,n);if(s.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(s.common.async===!1){let i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return i.status==="aborted"?Z:(i.status==="dirty"&&t.dirty(),l(i.value),{status:t.value,value:i.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(i=>i.status==="aborted"?Z:(i.status==="dirty"&&t.dirty(),l(i.value).then(()=>({status:t.value,value:i.value}))))}if(r.type==="transform")if(s.common.async===!1){let l=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!_r(l))return Z;let i=r.transform(l.value,n);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(l=>_r(l)?Promise.resolve(r.transform(l.value,n)).then(i=>({status:t.value,value:i})):Z);X.assertNever(r)}};Qe.create=(a,e,t)=>new Qe({schema:a,typeName:T.ZodEffects,effect:e,...Q(t)});Qe.createWithPreprocess=(a,e,t)=>new Qe({schema:e,effect:{type:"preprocess",transform:a},typeName:T.ZodEffects,...Q(t)});var Be=class extends G{_parse(e){return this._getType(e)===j.undefined?ke(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Be.create=(a,e)=>new Be({innerType:a,typeName:T.ZodOptional,...Q(e)});var or=class extends G{_parse(e){return this._getType(e)===j.null?ke(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};or.create=(a,e)=>new or({innerType:a,typeName:T.ZodNullable,...Q(e)});var Zr=class extends G{_parse(e){let{ctx:t}=this._processInputParams(e),s=t.data;return t.parsedType===j.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Zr.create=(a,e)=>new Zr({innerType:a,typeName:T.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Q(e)});var Br=class extends G{_parse(e){let{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return ot(r)?r.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Le(s.common.issues)},input:s.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Le(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}};Br.create=(a,e)=>new Br({innerType:a,typeName:T.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Q(e)});var ft=class extends G{_parse(e){if(this._getType(e)!==j.nan){let s=this._getOrReturnCtx(e);return C(s,{code:R.invalid_type,expected:j.nan,received:s.parsedType}),Z}return{status:"valid",value:e.data}}};ft.create=a=>new ft({typeName:T.ZodNaN,...Q(a)});var Uc=Symbol("zod_brand"),St=class extends G{_parse(e){let{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}},Rt=class a extends G{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{let n=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?Z:n.status==="dirty"?(t.dirty(),Ir(n.value)):this._def.out._parseAsync({data:n.value,path:s.path,parent:s})})();{let r=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return r.status==="aborted"?Z:r.status==="dirty"?(t.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:s.path,parent:s})}}static create(e,t){return new a({in:e,out:t,typeName:T.ZodPipeline})}},Jr=class extends G{_parse(e){let t=this._def.innerType._parse(e),s=r=>(_r(r)&&(r.value=Object.freeze(r.value)),r);return ot(t)?t.then(r=>s(r)):s(t)}unwrap(){return this._def.innerType}};Jr.create=(a,e)=>new Jr({innerType:a,typeName:T.ZodReadonly,...Q(e)});function Xs(a,e){let t=typeof a=="function"?a(e):typeof a=="string"?{message:a}:a;return typeof t=="string"?{message:t}:t}function sn(a,e={},t){return a?Pr.create().superRefine((s,r)=>{let n=a(s);if(n instanceof Promise)return n.then(l=>{if(!l){let i=Xs(e,s),c=i.fatal??t??!0;r.addIssue({code:"custom",...i,fatal:c})}});if(!n){let l=Xs(e,s),i=l.fatal??t??!0;r.addIssue({code:"custom",...l,fatal:i})}}):Pr.create()}var Vc={object:Fe.lazycreate},T;(function(a){a.ZodString="ZodString",a.ZodNumber="ZodNumber",a.ZodNaN="ZodNaN",a.ZodBigInt="ZodBigInt",a.ZodBoolean="ZodBoolean",a.ZodDate="ZodDate",a.ZodSymbol="ZodSymbol",a.ZodUndefined="ZodUndefined",a.ZodNull="ZodNull",a.ZodAny="ZodAny",a.ZodUnknown="ZodUnknown",a.ZodNever="ZodNever",a.ZodVoid="ZodVoid",a.ZodArray="ZodArray",a.ZodObject="ZodObject",a.ZodUnion="ZodUnion",a.ZodDiscriminatedUnion="ZodDiscriminatedUnion",a.ZodIntersection="ZodIntersection",a.ZodTuple="ZodTuple",a.ZodRecord="ZodRecord",a.ZodMap="ZodMap",a.ZodSet="ZodSet",a.ZodFunction="ZodFunction",a.ZodLazy="ZodLazy",a.ZodLiteral="ZodLiteral",a.ZodEnum="ZodEnum",a.ZodEffects="ZodEffects",a.ZodNativeEnum="ZodNativeEnum",a.ZodOptional="ZodOptional",a.ZodNullable="ZodNullable",a.ZodDefault="ZodDefault",a.ZodCatch="ZodCatch",a.ZodPromise="ZodPromise",a.ZodBranded="ZodBranded",a.ZodPipeline="ZodPipeline",a.ZodReadonly="ZodReadonly"})(T||(T={}));var Zc=(a,e={message:`Input not instance of ${a.name}`})=>sn(t=>t instanceof a,e),nn=br.create,on=Dr.create,Bc=ft.create,Jc=Cr.create,ln=jr.create,Qc=Nr.create,Gc=lt.create,Kc=Lr.create,Wc=Fr.create,Yc=Pr.create,Xc=mr.create,eu=Ye.create,ru=ct.create,tu=vr.create,au=Fe.create,su=Fe.strictCreate,nu=qr.create,ou=Ft.create,iu=Mr.create,lu=nr.create,cu=qt.create,uu=ut.create,du=dt.create,fu=Mt.create,pu=zr.create,hu=Hr.create,mu=Ur.create,vu=Vr.create,gu=xr.create,yu=Qe.create,_u=Be.create,bu=or.create,Pu=Qe.createWithPreprocess,xu=Rt.create,Eu=()=>nn().optional(),Su=()=>on().optional(),Ru=()=>ln().optional(),wu={string:(a=>br.create({...a,coerce:!0})),number:(a=>Dr.create({...a,coerce:!0})),boolean:(a=>jr.create({...a,coerce:!0})),bigint:(a=>Cr.create({...a,coerce:!0})),date:(a=>Nr.create({...a,coerce:!0}))};var Tu=Z;var Ua="2025-06-18";var cn=[Ua,"2025-03-26","2024-11-05","2024-10-07"],zt="2.0",un=o.union([o.string(),o.number().int()]),dn=o.string(),Au=o.object({progressToken:o.optional(un)}).passthrough(),Ge=o.object({_meta:o.optional(Au)}).passthrough(),qe=o.object({method:o.string(),params:o.optional(Ge)}),wt=o.object({_meta:o.optional(o.object({}).passthrough())}).passthrough(),ir=o.object({method:o.string(),params:o.optional(wt)}),Ke=o.object({_meta:o.optional(o.object({}).passthrough())}).passthrough(),Ht=o.union([o.string(),o.number().int()]),fn=o.object({jsonrpc:o.literal(zt),id:Ht}).merge(qe).strict(),pn=a=>fn.safeParse(a).success,hn=o.object({jsonrpc:o.literal(zt)}).merge(ir).strict(),mn=a=>hn.safeParse(a).success,vn=o.object({jsonrpc:o.literal(zt),id:Ht,result:Ke}).strict(),Va=a=>vn.safeParse(a).success,de;(function(a){a[a.ConnectionClosed=-32e3]="ConnectionClosed",a[a.RequestTimeout=-32001]="RequestTimeout",a[a.ParseError=-32700]="ParseError",a[a.InvalidRequest=-32600]="InvalidRequest",a[a.MethodNotFound=-32601]="MethodNotFound",a[a.InvalidParams=-32602]="InvalidParams",a[a.InternalError=-32603]="InternalError"})(de||(de={}));var gn=o.object({jsonrpc:o.literal(zt),id:Ht,error:o.object({code:o.number().int(),message:o.string(),data:o.optional(o.unknown())})}).strict(),yn=a=>gn.safeParse(a).success,_n=o.union([fn,hn,vn,gn]),Ut=Ke.strict(),Vt=ir.extend({method:o.literal("notifications/cancelled"),params:wt.extend({requestId:Ht,reason:o.string().optional()})}),Zt=o.object({src:o.string(),mimeType:o.optional(o.string()),sizes:o.optional(o.string())}).passthrough(),Tt=o.object({name:o.string(),title:o.optional(o.string())}).passthrough(),bn=Tt.extend({version:o.string(),websiteUrl:o.optional(o.string()),icons:o.optional(o.array(Zt))}),Ou=o.object({experimental:o.optional(o.object({}).passthrough()),sampling:o.optional(o.object({}).passthrough()),elicitation:o.optional(o.object({}).passthrough()),roots:o.optional(o.object({listChanged:o.optional(o.boolean())}).passthrough())}).passthrough(),Za=qe.extend({method:o.literal("initialize"),params:Ge.extend({protocolVersion:o.string(),capabilities:Ou,clientInfo:bn})});var $u=o.object({experimental:o.optional(o.object({}).passthrough()),logging:o.optional(o.object({}).passthrough()),completions:o.optional(o.object({}).passthrough()),prompts:o.optional(o.object({listChanged:o.optional(o.boolean())}).passthrough()),resources:o.optional(o.object({subscribe:o.optional(o.boolean()),listChanged:o.optional(o.boolean())}).passthrough()),tools:o.optional(o.object({listChanged:o.optional(o.boolean())}).passthrough())}).passthrough(),ku=Ke.extend({protocolVersion:o.string(),capabilities:$u,serverInfo:bn,instructions:o.optional(o.string())}),Ba=ir.extend({method:o.literal("notifications/initialized")});var Bt=qe.extend({method:o.literal("ping")}),Iu=o.object({progress:o.number(),total:o.optional(o.number()),message:o.optional(o.string())}).passthrough(),Jt=ir.extend({method:o.literal("notifications/progress"),params:wt.merge(Iu).extend({progressToken:un})}),Qt=qe.extend({params:Ge.extend({cursor:o.optional(dn)}).optional()}),Gt=Ke.extend({nextCursor:o.optional(dn)}),Pn=o.object({uri:o.string(),mimeType:o.optional(o.string()),_meta:o.optional(o.object({}).passthrough())}).passthrough(),xn=Pn.extend({text:o.string()}),Ja=o.string().refine(a=>{try{return atob(a),!0}catch{return!1}},{message:"Invalid Base64 string"}),En=Pn.extend({blob:Ja}),Sn=Tt.extend({uri:o.string(),description:o.optional(o.string()),mimeType:o.optional(o.string()),icons:o.optional(o.array(Zt)),_meta:o.optional(o.object({}).passthrough())}),Du=Tt.extend({uriTemplate:o.string(),description:o.optional(o.string()),mimeType:o.optional(o.string()),_meta:o.optional(o.object({}).passthrough())}),Kt=Qt.extend({method:o.literal("resources/list")}),Cu=Gt.extend({resources:o.array(Sn)}),Wt=Qt.extend({method:o.literal("resources/templates/list")}),ju=Gt.extend({resourceTemplates:o.array(Du)}),Yt=qe.extend({method:o.literal("resources/read"),params:Ge.extend({uri:o.string()})}),Nu=Ke.extend({contents:o.array(o.union([xn,En]))}),Lu=ir.extend({method:o.literal("notifications/resources/list_changed")}),Fu=qe.extend({method:o.literal("resources/subscribe"),params:Ge.extend({uri:o.string()})}),qu=qe.extend({method:o.literal("resources/unsubscribe"),params:Ge.extend({uri:o.string()})}),Mu=ir.extend({method:o.literal("notifications/resources/updated"),params:wt.extend({uri:o.string()})}),zu=o.object({name:o.string(),description:o.optional(o.string()),required:o.optional(o.boolean())}).passthrough(),Hu=Tt.extend({description:o.optional(o.string()),arguments:o.optional(o.array(zu)),icons:o.optional(o.array(Zt)),_meta:o.optional(o.object({}).passthrough())}),Xt=Qt.extend({method:o.literal("prompts/list")}),Uu=Gt.extend({prompts:o.array(Hu)}),ea=qe.extend({method:o.literal("prompts/get"),params:Ge.extend({name:o.string(),arguments:o.optional(o.record(o.string()))})}),Qa=o.object({type:o.literal("text"),text:o.string(),_meta:o.optional(o.object({}).passthrough())}).passthrough(),Ga=o.object({type:o.literal("image"),data:Ja,mimeType:o.string(),_meta:o.optional(o.object({}).passthrough())}).passthrough(),Ka=o.object({type:o.literal("audio"),data:Ja,mimeType:o.string(),_meta:o.optional(o.object({}).passthrough())}).passthrough(),Vu=o.object({type:o.literal("resource"),resource:o.union([xn,En]),_meta:o.optional(o.object({}).passthrough())}).passthrough(),Zu=Sn.extend({type:o.literal("resource_link")}),Rn=o.union([Qa,Ga,Ka,Zu,Vu]),Bu=o.object({role:o.enum(["user","assistant"]),content:Rn}).passthrough(),Ju=Ke.extend({description:o.optional(o.string()),messages:o.array(Bu)}),Qu=ir.extend({method:o.literal("notifications/prompts/list_changed")}),Gu=o.object({title:o.optional(o.string()),readOnlyHint:o.optional(o.boolean()),destructiveHint:o.optional(o.boolean()),idempotentHint:o.optional(o.boolean()),openWorldHint:o.optional(o.boolean())}).passthrough(),Ku=Tt.extend({description:o.optional(o.string()),inputSchema:o.object({type:o.literal("object"),properties:o.optional(o.object({}).passthrough()),required:o.optional(o.array(o.string()))}).passthrough(),outputSchema:o.optional(o.object({type:o.literal("object"),properties:o.optional(o.object({}).passthrough()),required:o.optional(o.array(o.string()))}).passthrough()),annotations:o.optional(Gu),icons:o.optional(o.array(Zt)),_meta:o.optional(o.object({}).passthrough())}),ra=Qt.extend({method:o.literal("tools/list")}),Wu=Gt.extend({tools:o.array(Ku)}),wn=Ke.extend({content:o.array(Rn).default([]),structuredContent:o.object({}).passthrough().optional(),isError:o.optional(o.boolean())}),Wp=wn.or(Ke.extend({toolResult:o.unknown()})),ta=qe.extend({method:o.literal("tools/call"),params:Ge.extend({name:o.string(),arguments:o.optional(o.record(o.unknown()))})}),Yu=ir.extend({method:o.literal("notifications/tools/list_changed")}),At=o.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),Wa=qe.extend({method:o.literal("logging/setLevel"),params:Ge.extend({level:At})}),Xu=ir.extend({method:o.literal("notifications/message"),params:wt.extend({level:At,logger:o.optional(o.string()),data:o.unknown()})}),ed=o.object({name:o.string().optional()}).passthrough(),rd=o.object({hints:o.optional(o.array(ed)),costPriority:o.optional(o.number().min(0).max(1)),speedPriority:o.optional(o.number().min(0).max(1)),intelligencePriority:o.optional(o.number().min(0).max(1))}).passthrough(),td=o.object({role:o.enum(["user","assistant"]),content:o.union([Qa,Ga,Ka])}).passthrough(),ad=qe.extend({method:o.literal("sampling/createMessage"),params:Ge.extend({messages:o.array(td),systemPrompt:o.optional(o.string()),includeContext:o.optional(o.enum(["none","thisServer","allServers"])),temperature:o.optional(o.number()),maxTokens:o.number().int(),stopSequences:o.optional(o.array(o.string())),metadata:o.optional(o.object({}).passthrough()),modelPreferences:o.optional(rd)})}),Ya=Ke.extend({model:o.string(),stopReason:o.optional(o.enum(["endTurn","stopSequence","maxTokens"]).or(o.string())),role:o.enum(["user","assistant"]),content:o.discriminatedUnion("type",[Qa,Ga,Ka])}),sd=o.object({type:o.literal("boolean"),title:o.optional(o.string()),description:o.optional(o.string()),default:o.optional(o.boolean())}).passthrough(),nd=o.object({type:o.literal("string"),title:o.optional(o.string()),description:o.optional(o.string()),minLength:o.optional(o.number()),maxLength:o.optional(o.number()),format:o.optional(o.enum(["email","uri","date","date-time"]))}).passthrough(),od=o.object({type:o.enum(["number","integer"]),title:o.optional(o.string()),description:o.optional(o.string()),minimum:o.optional(o.number()),maximum:o.optional(o.number())}).passthrough(),id=o.object({type:o.literal("string"),title:o.optional(o.string()),description:o.optional(o.string()),enum:o.array(o.string()),enumNames:o.optional(o.array(o.string()))}).passthrough(),ld=o.union([sd,nd,od,id]),cd=qe.extend({method:o.literal("elicitation/create"),params:Ge.extend({message:o.string(),requestedSchema:o.object({type:o.literal("object"),properties:o.record(o.string(),ld),required:o.optional(o.array(o.string()))}).passthrough()})}),Xa=Ke.extend({action:o.enum(["accept","decline","cancel"]),content:o.optional(o.record(o.string(),o.unknown()))}),ud=o.object({type:o.literal("ref/resource"),uri:o.string()}).passthrough();var dd=o.object({type:o.literal("ref/prompt"),name:o.string()}).passthrough(),aa=qe.extend({method:o.literal("completion/complete"),params:Ge.extend({ref:o.union([dd,ud]),argument:o.object({name:o.string(),value:o.string()}).passthrough(),context:o.optional(o.object({arguments:o.optional(o.record(o.string(),o.string()))}))})}),fd=Ke.extend({completion:o.object({values:o.array(o.string()).max(100),total:o.optional(o.number().int()),hasMore:o.optional(o.boolean())}).passthrough()}),pd=o.object({uri:o.string().startsWith("file://"),name:o.optional(o.string()),_meta:o.optional(o.object({}).passthrough())}).passthrough(),hd=qe.extend({method:o.literal("roots/list")}),es=Ke.extend({roots:o.array(pd)}),md=ir.extend({method:o.literal("notifications/roots/list_changed")}),Yp=o.union([Bt,Za,aa,Wa,ea,Xt,Kt,Wt,Yt,Fu,qu,ta,ra]),Xp=o.union([Vt,Jt,Ba,md]),eh=o.union([Ut,Ya,Xa,es]),rh=o.union([Bt,ad,cd,hd]),th=o.union([Vt,Jt,Xu,Mu,Lu,Yu,Qu]),ah=o.union([Ut,ku,fd,Ju,Uu,Cu,ju,Nu,wn,Wu]),fe=class extends Error{constructor(e,t,s){super(`MCP error ${e}: ${t}`),this.code=e,this.data=s,this.name="McpError"}};var vd=6e4,sa=class{constructor(e){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.setNotificationHandler(Vt,t=>{let s=this._requestHandlerAbortControllers.get(t.params.requestId);s?.abort(t.params.reason)}),this.setNotificationHandler(Jt,t=>{this._onprogress(t)}),this.setRequestHandler(Bt,t=>({}))}_setupTimeout(e,t,s,r,n=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:n,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new fe(de.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:s});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){var t,s,r;this._transport=e;let n=(t=this.transport)===null||t===void 0?void 0:t.onclose;this._transport.onclose=()=>{n?.(),this._onclose()};let l=(s=this.transport)===null||s===void 0?void 0:s.onerror;this._transport.onerror=c=>{l?.(c),this._onerror(c)};let i=(r=this._transport)===null||r===void 0?void 0:r.onmessage;this._transport.onmessage=(c,f)=>{i?.(c,f),Va(c)||yn(c)?this._onresponse(c):pn(c)?this._onrequest(c,f):mn(c)?this._onnotification(c):this._onerror(new Error(`Unknown message type: ${JSON.stringify(c)}`))},await this._transport.start()}_onclose(){var e;let t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear(),this._transport=void 0,(e=this.onclose)===null||e===void 0||e.call(this);let s=new fe(de.ConnectionClosed,"Connection closed");for(let r of t.values())r(s)}_onerror(e){var t;(t=this.onerror)===null||t===void 0||t.call(this,e)}_onnotification(e){var t;let s=(t=this._notificationHandlers.get(e.method))!==null&&t!==void 0?t:this.fallbackNotificationHandler;s!==void 0&&Promise.resolve().then(()=>s(e)).catch(r=>this._onerror(new Error(`Uncaught error in notification handler: ${r}`)))}_onrequest(e,t){var s,r;let n=(s=this._requestHandlers.get(e.method))!==null&&s!==void 0?s:this.fallbackRequestHandler,l=this._transport;if(n===void 0){l?.send({jsonrpc:"2.0",id:e.id,error:{code:de.MethodNotFound,message:"Method not found"}}).catch(f=>this._onerror(new Error(`Failed to send an error response: ${f}`)));return}let i=new AbortController;this._requestHandlerAbortControllers.set(e.id,i);let c={signal:i.signal,sessionId:l?.sessionId,_meta:(r=e.params)===null||r===void 0?void 0:r._meta,sendNotification:f=>this.notification(f,{relatedRequestId:e.id}),sendRequest:(f,p,m)=>this.request(f,p,{...m,relatedRequestId:e.id}),authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo};Promise.resolve().then(()=>n(e,c)).then(f=>{if(!i.signal.aborted)return l?.send({result:f,jsonrpc:"2.0",id:e.id})},f=>{var p;if(!i.signal.aborted)return l?.send({jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(f.code)?f.code:de.InternalError,message:(p=f.message)!==null&&p!==void 0?p:"Internal error"}})}).catch(f=>this._onerror(new Error(`Failed to send response: ${f}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:t,...s}=e.params,r=Number(t),n=this._progressHandlers.get(r);if(!n){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let l=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&l&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(c){l(c);return}n(s)}_onresponse(e){let t=Number(e.id),s=this._responseHandlers.get(t);if(s===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}if(this._responseHandlers.delete(t),this._progressHandlers.delete(t),this._cleanupTimeout(t),Va(e))s(e);else{let r=new fe(e.error.code,e.error.message,e.error.data);s(r)}}get transport(){return this._transport}async close(){var e;await((e=this._transport)===null||e===void 0?void 0:e.close())}request(e,t,s){let{relatedRequestId:r,resumptionToken:n,onresumptiontoken:l}=s??{};return new Promise((i,c)=>{var f,p,m,b,u,y;if(!this._transport){c(new Error("Not connected"));return}((f=this._options)===null||f===void 0?void 0:f.enforceStrictCapabilities)===!0&&this.assertCapabilityForMethod(e.method),(p=s?.signal)===null||p===void 0||p.throwIfAborted();let _=this._requestMessageId++,g={...e,jsonrpc:"2.0",id:_};s?.onprogress&&(this._progressHandlers.set(_,s.onprogress),g.params={...e.params,_meta:{...((m=e.params)===null||m===void 0?void 0:m._meta)||{},progressToken:_}});let E=w=>{var $;this._responseHandlers.delete(_),this._progressHandlers.delete(_),this._cleanupTimeout(_),($=this._transport)===null||$===void 0||$.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:_,reason:String(w)}},{relatedRequestId:r,resumptionToken:n,onresumptiontoken:l}).catch(k=>this._onerror(new Error(`Failed to send cancellation: ${k}`))),c(w)};this._responseHandlers.set(_,w=>{var $;if(!(!(($=s?.signal)===null||$===void 0)&&$.aborted)){if(w instanceof Error)return c(w);try{let k=t.parse(w.result);i(k)}catch(k){c(k)}}}),(b=s?.signal)===null||b===void 0||b.addEventListener("abort",()=>{var w;E((w=s?.signal)===null||w===void 0?void 0:w.reason)});let O=(u=s?.timeout)!==null&&u!==void 0?u:vd,S=()=>E(new fe(de.RequestTimeout,"Request timed out",{timeout:O}));this._setupTimeout(_,O,s?.maxTotalTimeout,S,(y=s?.resetTimeoutOnProgress)!==null&&y!==void 0?y:!1),this._transport.send(g,{relatedRequestId:r,resumptionToken:n,onresumptiontoken:l}).catch(w=>{this._cleanupTimeout(_),c(w)})})}async notification(e,t){var s,r;if(!this._transport)throw new Error("Not connected");if(this.assertNotificationCapability(e.method),((r=(s=this._options)===null||s===void 0?void 0:s.debouncedNotificationMethods)!==null&&r!==void 0?r:[]).includes(e.method)&&!e.params&&!t?.relatedRequestId){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{var c;if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let f={...e,jsonrpc:"2.0"};(c=this._transport)===null||c===void 0||c.send(f,t).catch(p=>this._onerror(p))});return}let i={...e,jsonrpc:"2.0"};await this._transport.send(i,t)}setRequestHandler(e,t){let s=e.shape.method.value;this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,n)=>Promise.resolve(t(e.parse(r),n)))}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){this._notificationHandlers.set(e.shape.method.value,s=>Promise.resolve(t(e.parse(s))))}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function Tn(a,e){return Object.entries(e).reduce((t,[s,r])=>(r&&typeof r=="object"?t[s]=t[s]?{...t[s],...r}:r:t[s]=r,t),{...a})}var $i=gc(Oi(),1),Ea=class extends sa{constructor(e,t){var s;super(t),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(At.options.map((r,n)=>[r,n])),this.isMessageIgnored=(r,n)=>{let l=this._loggingLevels.get(n);return l?this.LOG_LEVEL_SEVERITY.get(r)<this.LOG_LEVEL_SEVERITY.get(l):!1},this._capabilities=(s=t?.capabilities)!==null&&s!==void 0?s:{},this._instructions=t?.instructions,this.setRequestHandler(Za,r=>this._oninitialize(r)),this.setNotificationHandler(Ba,()=>{var r;return(r=this.oninitialized)===null||r===void 0?void 0:r.call(this)}),this._capabilities.logging&&this.setRequestHandler(Wa,async(r,n)=>{var l;let i=n.sessionId||((l=n.requestInfo)===null||l===void 0?void 0:l.headers["mcp-session-id"])||void 0,{level:c}=r.params,f=At.safeParse(c);return f.success&&this._loggingLevels.set(i,f.data),{}})}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Tn(this._capabilities,e)}assertCapabilityForMethod(e){var t,s,r;switch(e){case"sampling/createMessage":if(!(!((t=this._clientCapabilities)===null||t===void 0)&&t.sampling))throw new Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!(!((s=this._clientCapabilities)===null||s===void 0)&&s.elicitation))throw new Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!(!((r=this._clientCapabilities)===null||r===void 0)&&r.roots))throw new 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 new Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Server does not support sampling (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new 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 new Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"ping":case"initialize":break}}async _oninitialize(e){let t=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:cn.includes(t)?t:Ua,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"},Ut)}async createMessage(e,t){return this.request({method:"sampling/createMessage",params:e},Ya,t)}async elicitInput(e,t){let s=await this.request({method:"elicitation/create",params:e},Xa,t);if(s.action==="accept"&&s.content)try{let r=new $i.default,n=r.compile(e.requestedSchema);if(!n(s.content))throw new fe(de.InvalidParams,`Elicitation response content does not match requested schema: ${r.errorsText(n.errors)}`)}catch(r){throw r instanceof fe?r:new fe(de.InternalError,`Error validating elicitation response: ${r}`)}return s}async listRoots(e,t){return this.request({method:"roots/list",params:e},es,t)}async sendLoggingMessage(e,t){if(this._capabilities.logging&&!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 Ii=Symbol("Let zodToJsonSchema decide on which parser to use");var ki={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"},Di=a=>typeof a=="string"?{...ki,name:a}:{...ki,...a};var Ci=a=>{let e=Di(a),t=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,flags:{hasReferencedOpenAiAnyType:!1},currentPath:t,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([s,r])=>[r._def,{def:r._def,path:[...e.basePath,e.definitionPath,s],jsonSchema:void 0}]))}};function Rs(a,e,t,s){s?.errorMessages&&t&&(a.errorMessage={...a.errorMessage,[e]:t})}function ee(a,e,t,s,r){a[e]=t,Rs(a,e,s,r)}var Sa=(a,e)=>{let t=0;for(;t<a.length&&t<e.length&&a[t]===e[t];t++);return[(a.length-t).toString(),...e.slice(t)].join("/")};function he(a){if(a.target!=="openAi")return{};let e=[...a.basePath,a.definitionPath,a.openAiAnyTypeName];return a.flags.hasReferencedOpenAiAnyType=!0,{$ref:a.$refStrategy==="relative"?Sa(e,a.currentPath):e.join("/")}}function ji(a,e){let t={type:"array"};return a.type?._def&&a.type?._def?.typeName!==T.ZodAny&&(t.items=B(a.type._def,{...e,currentPath:[...e.currentPath,"items"]})),a.minLength&&ee(t,"minItems",a.minLength.value,a.minLength.message,e),a.maxLength&&ee(t,"maxItems",a.maxLength.value,a.maxLength.message,e),a.exactLength&&(ee(t,"minItems",a.exactLength.value,a.exactLength.message,e),ee(t,"maxItems",a.exactLength.value,a.exactLength.message,e)),t}function Ni(a,e){let t={type:"integer",format:"int64"};if(!a.checks)return t;for(let s of a.checks)switch(s.kind){case"min":e.target==="jsonSchema7"?s.inclusive?ee(t,"minimum",s.value,s.message,e):ee(t,"exclusiveMinimum",s.value,s.message,e):(s.inclusive||(t.exclusiveMinimum=!0),ee(t,"minimum",s.value,s.message,e));break;case"max":e.target==="jsonSchema7"?s.inclusive?ee(t,"maximum",s.value,s.message,e):ee(t,"exclusiveMaximum",s.value,s.message,e):(s.inclusive||(t.exclusiveMaximum=!0),ee(t,"maximum",s.value,s.message,e));break;case"multipleOf":ee(t,"multipleOf",s.value,s.message,e);break}return t}function Li(){return{type:"boolean"}}function Ra(a,e){return B(a.type._def,e)}var Fi=(a,e)=>B(a.innerType._def,e);function ws(a,e,t){let s=t??e.dateStrategy;if(Array.isArray(s))return{anyOf:s.map((r,n)=>ws(a,e,r))};switch(s){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Kf(a,e)}}var Kf=(a,e)=>{let t={type:"integer",format:"unix-time"};if(e.target==="openApi3")return t;for(let s of a.checks)switch(s.kind){case"min":ee(t,"minimum",s.value,s.message,e);break;case"max":ee(t,"maximum",s.value,s.message,e);break}return t};function qi(a,e){return{...B(a.innerType._def,e),default:a.defaultValue()}}function Mi(a,e){return e.effectStrategy==="input"?B(a.schema._def,e):he(e)}function zi(a){return{type:"string",enum:Array.from(a.values)}}var Wf=a=>"type"in a&&a.type==="string"?!1:"allOf"in a;function Hi(a,e){let t=[B(a.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),B(a.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(n=>!!n),s=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,r=[];return t.forEach(n=>{if(Wf(n))r.push(...n.allOf),n.unevaluatedProperties===void 0&&(s=void 0);else{let l=n;if("additionalProperties"in n&&n.additionalProperties===!1){let{additionalProperties:i,...c}=n;l=c}else s=void 0;r.push(l)}}),r.length?{allOf:r,...s}:void 0}function Ui(a,e){let t=typeof a.value;return t!=="bigint"&&t!=="number"&&t!=="boolean"&&t!=="string"?{type:Array.isArray(a.value)?"array":"object"}:e.target==="openApi3"?{type:t==="bigint"?"integer":t,enum:[a.value]}:{type:t==="bigint"?"integer":t,const:a.value}}var Ts,Xe={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:()=>(Ts===void 0&&(Ts=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Ts),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 wa(a,e){let t={type:"string"};if(a.checks)for(let s of a.checks)switch(s.kind){case"min":ee(t,"minLength",typeof t.minLength=="number"?Math.max(t.minLength,s.value):s.value,s.message,e);break;case"max":ee(t,"maxLength",typeof t.maxLength=="number"?Math.min(t.maxLength,s.value):s.value,s.message,e);break;case"email":switch(e.emailStrategy){case"format:email":er(t,"email",s.message,e);break;case"format:idn-email":er(t,"idn-email",s.message,e);break;case"pattern:zod":je(t,Xe.email,s.message,e);break}break;case"url":er(t,"uri",s.message,e);break;case"uuid":er(t,"uuid",s.message,e);break;case"regex":je(t,s.regex,s.message,e);break;case"cuid":je(t,Xe.cuid,s.message,e);break;case"cuid2":je(t,Xe.cuid2,s.message,e);break;case"startsWith":je(t,RegExp(`^${As(s.value,e)}`),s.message,e);break;case"endsWith":je(t,RegExp(`${As(s.value,e)}$`),s.message,e);break;case"datetime":er(t,"date-time",s.message,e);break;case"date":er(t,"date",s.message,e);break;case"time":er(t,"time",s.message,e);break;case"duration":er(t,"duration",s.message,e);break;case"length":ee(t,"minLength",typeof t.minLength=="number"?Math.max(t.minLength,s.value):s.value,s.message,e),ee(t,"maxLength",typeof t.maxLength=="number"?Math.min(t.maxLength,s.value):s.value,s.message,e);break;case"includes":{je(t,RegExp(As(s.value,e)),s.message,e);break}case"ip":{s.version!=="v6"&&er(t,"ipv4",s.message,e),s.version!=="v4"&&er(t,"ipv6",s.message,e);break}case"base64url":je(t,Xe.base64url,s.message,e);break;case"jwt":je(t,Xe.jwt,s.message,e);break;case"cidr":{s.version!=="v6"&&je(t,Xe.ipv4Cidr,s.message,e),s.version!=="v4"&&je(t,Xe.ipv6Cidr,s.message,e);break}case"emoji":je(t,Xe.emoji(),s.message,e);break;case"ulid":{je(t,Xe.ulid,s.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{er(t,"binary",s.message,e);break}case"contentEncoding:base64":{ee(t,"contentEncoding","base64",s.message,e);break}case"pattern:zod":{je(t,Xe.base64,s.message,e);break}}break}case"nanoid":je(t,Xe.nanoid,s.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return t}function As(a,e){return e.patternStrategy==="escape"?Xf(a):a}var Yf=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Xf(a){let e="";for(let t=0;t<a.length;t++)Yf.has(a[t])||(e+="\\"),e+=a[t];return e}function er(a,e,t,s){a.format||a.anyOf?.some(r=>r.format)?(a.anyOf||(a.anyOf=[]),a.format&&(a.anyOf.push({format:a.format,...a.errorMessage&&s.errorMessages&&{errorMessage:{format:a.errorMessage.format}}}),delete a.format,a.errorMessage&&(delete a.errorMessage.format,Object.keys(a.errorMessage).length===0&&delete a.errorMessage)),a.anyOf.push({format:e,...t&&s.errorMessages&&{errorMessage:{format:t}}})):ee(a,"format",e,t,s)}function je(a,e,t,s){a.pattern||a.allOf?.some(r=>r.pattern)?(a.allOf||(a.allOf=[]),a.pattern&&(a.allOf.push({pattern:a.pattern,...a.errorMessage&&s.errorMessages&&{errorMessage:{pattern:a.errorMessage.pattern}}}),delete a.pattern,a.errorMessage&&(delete a.errorMessage.pattern,Object.keys(a.errorMessage).length===0&&delete a.errorMessage)),a.allOf.push({pattern:Vi(e,s),...t&&s.errorMessages&&{errorMessage:{pattern:t}}})):ee(a,"pattern",Vi(e,s),t,s)}function Vi(a,e){if(!e.applyRegexFlags||!a.flags)return a.source;let t={i:a.flags.includes("i"),m:a.flags.includes("m"),s:a.flags.includes("s")},s=t.i?a.source.toLowerCase():a.source,r="",n=!1,l=!1,i=!1;for(let c=0;c<s.length;c++){if(n){r+=s[c],n=!1;continue}if(t.i){if(l){if(s[c].match(/[a-z]/)){i?(r+=s[c],r+=`${s[c-2]}-${s[c]}`.toUpperCase(),i=!1):s[c+1]==="-"&&s[c+2]?.match(/[a-z]/)?(r+=s[c],i=!0):r+=`${s[c]}${s[c].toUpperCase()}`;continue}}else if(s[c].match(/[a-z]/)){r+=`[${s[c]}${s[c].toUpperCase()}]`;continue}}if(t.m){if(s[c]==="^"){r+=`(^|(?<=[\r
3
+ ]))`;continue}else if(s[c]==="$"){r+=`($|(?=[\r
4
+ ]))`;continue}}if(t.s&&s[c]==="."){r+=l?`${s[c]}\r
5
+ `:`[${s[c]}\r
6
+ ]`;continue}r+=s[c],s[c]==="\\"?n=!0:l&&s[c]==="]"?l=!1:!l&&s[c]==="["&&(l=!0)}try{new RegExp(r)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),a.source}return r}function Ta(a,e){if(e.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),e.target==="openApi3"&&a.keyType?._def.typeName===T.ZodEnum)return{type:"object",required:a.keyType._def.values,properties:a.keyType._def.values.reduce((s,r)=>({...s,[r]:B(a.valueType._def,{...e,currentPath:[...e.currentPath,"properties",r]})??he(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let t={type:"object",additionalProperties:B(a.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return t;if(a.keyType?._def.typeName===T.ZodString&&a.keyType._def.checks?.length){let{type:s,...r}=wa(a.keyType._def,e);return{...t,propertyNames:r}}else{if(a.keyType?._def.typeName===T.ZodEnum)return{...t,propertyNames:{enum:a.keyType._def.values}};if(a.keyType?._def.typeName===T.ZodBranded&&a.keyType._def.type._def.typeName===T.ZodString&&a.keyType._def.type._def.checks?.length){let{type:s,...r}=Ra(a.keyType._def,e);return{...t,propertyNames:r}}}return t}function Zi(a,e){if(e.mapStrategy==="record")return Ta(a,e);let t=B(a.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||he(e),s=B(a.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||he(e);return{type:"array",maxItems:125,items:{type:"array",items:[t,s],minItems:2,maxItems:2}}}function Bi(a){let e=a.values,s=Object.keys(a.values).filter(n=>typeof e[e[n]]!="number").map(n=>e[n]),r=Array.from(new Set(s.map(n=>typeof n)));return{type:r.length===1?r[0]==="string"?"string":"number":["string","number"],enum:s}}function Ji(a){return a.target==="openAi"?void 0:{not:he({...a,currentPath:[...a.currentPath,"not"]})}}function Qi(a){return a.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var $t={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Ki(a,e){if(e.target==="openApi3")return Gi(a,e);let t=a.options instanceof Map?Array.from(a.options.values()):a.options;if(t.every(s=>s._def.typeName in $t&&(!s._def.checks||!s._def.checks.length))){let s=t.reduce((r,n)=>{let l=$t[n._def.typeName];return l&&!r.includes(l)?[...r,l]:r},[]);return{type:s.length>1?s:s[0]}}else if(t.every(s=>s._def.typeName==="ZodLiteral"&&!s.description)){let s=t.reduce((r,n)=>{let l=typeof n._def.value;switch(l){case"string":case"number":case"boolean":return[...r,l];case"bigint":return[...r,"integer"];case"object":if(n._def.value===null)return[...r,"null"];case"symbol":case"undefined":case"function":default:return r}},[]);if(s.length===t.length){let r=s.filter((n,l,i)=>i.indexOf(n)===l);return{type:r.length>1?r:r[0],enum:t.reduce((n,l)=>n.includes(l._def.value)?n:[...n,l._def.value],[])}}}else if(t.every(s=>s._def.typeName==="ZodEnum"))return{type:"string",enum:t.reduce((s,r)=>[...s,...r._def.values.filter(n=>!s.includes(n))],[])};return Gi(a,e)}var Gi=(a,e)=>{let t=(a.options instanceof Map?Array.from(a.options.values()):a.options).map((s,r)=>B(s._def,{...e,currentPath:[...e.currentPath,"anyOf",`${r}`]})).filter(s=>!!s&&(!e.strictUnions||typeof s=="object"&&Object.keys(s).length>0));return t.length?{anyOf:t}:void 0};function Wi(a,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(a.innerType._def.typeName)&&(!a.innerType._def.checks||!a.innerType._def.checks.length))return e.target==="openApi3"?{type:$t[a.innerType._def.typeName],nullable:!0}:{type:[$t[a.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let s=B(a.innerType._def,{...e,currentPath:[...e.currentPath]});return s&&"$ref"in s?{allOf:[s],nullable:!0}:s&&{...s,nullable:!0}}let t=B(a.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return t&&{anyOf:[t,{type:"null"}]}}function Yi(a,e){let t={type:"number"};if(!a.checks)return t;for(let s of a.checks)switch(s.kind){case"int":t.type="integer",Rs(t,"type",s.message,e);break;case"min":e.target==="jsonSchema7"?s.inclusive?ee(t,"minimum",s.value,s.message,e):ee(t,"exclusiveMinimum",s.value,s.message,e):(s.inclusive||(t.exclusiveMinimum=!0),ee(t,"minimum",s.value,s.message,e));break;case"max":e.target==="jsonSchema7"?s.inclusive?ee(t,"maximum",s.value,s.message,e):ee(t,"exclusiveMaximum",s.value,s.message,e):(s.inclusive||(t.exclusiveMaximum=!0),ee(t,"maximum",s.value,s.message,e));break;case"multipleOf":ee(t,"multipleOf",s.value,s.message,e);break}return t}function Xi(a,e){let t=e.target==="openAi",s={type:"object",properties:{}},r=[],n=a.shape();for(let i in n){let c=n[i];if(c===void 0||c._def===void 0)continue;let f=rp(c);f&&t&&(c._def.typeName==="ZodOptional"&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),f=!1);let p=B(c._def,{...e,currentPath:[...e.currentPath,"properties",i],propertyPath:[...e.currentPath,"properties",i]});p!==void 0&&(s.properties[i]=p,f||r.push(i))}r.length&&(s.required=r);let l=ep(a,e);return l!==void 0&&(s.additionalProperties=l),s}function ep(a,e){if(a.catchall._def.typeName!=="ZodNever")return B(a.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(a.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function rp(a){try{return a.isOptional()}catch{return!0}}var el=(a,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return B(a.innerType._def,e);let t=B(a.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return t?{anyOf:[{not:he(e)},t]}:he(e)};var rl=(a,e)=>{if(e.pipeStrategy==="input")return B(a.in._def,e);if(e.pipeStrategy==="output")return B(a.out._def,e);let t=B(a.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),s=B(a.out._def,{...e,currentPath:[...e.currentPath,"allOf",t?"1":"0"]});return{allOf:[t,s].filter(r=>r!==void 0)}};function tl(a,e){return B(a.type._def,e)}function al(a,e){let s={type:"array",uniqueItems:!0,items:B(a.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return a.minSize&&ee(s,"minItems",a.minSize.value,a.minSize.message,e),a.maxSize&&ee(s,"maxItems",a.maxSize.value,a.maxSize.message,e),s}function sl(a,e){return a.rest?{type:"array",minItems:a.items.length,items:a.items.map((t,s)=>B(t._def,{...e,currentPath:[...e.currentPath,"items",`${s}`]})).reduce((t,s)=>s===void 0?t:[...t,s],[]),additionalItems:B(a.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:a.items.length,maxItems:a.items.length,items:a.items.map((t,s)=>B(t._def,{...e,currentPath:[...e.currentPath,"items",`${s}`]})).reduce((t,s)=>s===void 0?t:[...t,s],[])}}function nl(a){return{not:he(a)}}function ol(a){return he(a)}var il=(a,e)=>B(a.innerType._def,e);var ll=(a,e,t)=>{switch(e){case T.ZodString:return wa(a,t);case T.ZodNumber:return Yi(a,t);case T.ZodObject:return Xi(a,t);case T.ZodBigInt:return Ni(a,t);case T.ZodBoolean:return Li();case T.ZodDate:return ws(a,t);case T.ZodUndefined:return nl(t);case T.ZodNull:return Qi(t);case T.ZodArray:return ji(a,t);case T.ZodUnion:case T.ZodDiscriminatedUnion:return Ki(a,t);case T.ZodIntersection:return Hi(a,t);case T.ZodTuple:return sl(a,t);case T.ZodRecord:return Ta(a,t);case T.ZodLiteral:return Ui(a,t);case T.ZodEnum:return zi(a);case T.ZodNativeEnum:return Bi(a);case T.ZodNullable:return Wi(a,t);case T.ZodOptional:return el(a,t);case T.ZodMap:return Zi(a,t);case T.ZodSet:return al(a,t);case T.ZodLazy:return()=>a.getter()._def;case T.ZodPromise:return tl(a,t);case T.ZodNaN:case T.ZodNever:return Ji(t);case T.ZodEffects:return Mi(a,t);case T.ZodAny:return he(t);case T.ZodUnknown:return ol(t);case T.ZodDefault:return qi(a,t);case T.ZodBranded:return Ra(a,t);case T.ZodReadonly:return il(a,t);case T.ZodCatch:return Fi(a,t);case T.ZodPipeline:return rl(a,t);case T.ZodFunction:case T.ZodVoid:case T.ZodSymbol:return;default:return(s=>{})(e)}};function B(a,e,t=!1){let s=e.seen.get(a);if(e.override){let i=e.override?.(a,e,s,t);if(i!==Ii)return i}if(s&&!t){let i=tp(s,e);if(i!==void 0)return i}let r={def:a,path:e.currentPath,jsonSchema:void 0};e.seen.set(a,r);let n=ll(a,a.typeName,e),l=typeof n=="function"?B(n(),e):n;if(l&&ap(a,e,l),e.postProcess){let i=e.postProcess(l,a,e);return r.jsonSchema=l,i}return r.jsonSchema=l,l}var tp=(a,e)=>{switch(e.$refStrategy){case"root":return{$ref:a.path.join("/")};case"relative":return{$ref:Sa(e.currentPath,a.path)};case"none":case"seen":return a.path.length<e.currentPath.length&&a.path.every((t,s)=>e.currentPath[s]===t)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),he(e)):e.$refStrategy==="seen"?he(e):void 0}},ap=(a,e,t)=>(a.description&&(t.description=a.description,e.markdownDescription&&(t.markdownDescription=a.description)),t);var Aa=(a,e)=>{let t=Ci(e),s=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((c,[f,p])=>({...c,[f]:B(p._def,{...t,currentPath:[...t.basePath,t.definitionPath,f]},!0)??he(t)}),{}):void 0,r=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,n=B(a._def,r===void 0?t:{...t,currentPath:[...t.basePath,t.definitionPath,r]},!1)??he(t),l=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;l!==void 0&&(n.title=l),t.flags.hasReferencedOpenAiAnyType&&(s||(s={}),s[t.openAiAnyTypeName]||(s[t.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:t.$refStrategy==="relative"?"1":[...t.basePath,t.definitionPath,t.openAiAnyTypeName].join("/")}}));let i=r===void 0?s?{...n,[t.definitionPath]:s}:n:{$ref:[...t.$refStrategy==="relative"?[]:t.basePath,t.definitionPath,r].join("/"),[t.definitionPath]:{...s,[r]:n}};return t.target==="jsonSchema7"?i.$schema="http://json-schema.org/draft-07/schema#":(t.target==="jsonSchema2019-09"||t.target==="openAi")&&(i.$schema="https://json-schema.org/draft/2019-09/schema#"),t.target==="openAi"&&("anyOf"in i||"oneOf"in i||"allOf"in i||"type"in i&&Array.isArray(i.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),i};var Os;(function(a){a.Completable="McpCompletable"})(Os||(Os={}));var pt=class extends G{_parse(e){let{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}};pt.create=(a,e)=>new pt({type:a,typeName:Os.Completable,complete:e.complete,...sp(e)});function sp(a){if(!a)return{};let{errorMap:e,invalid_type_error:t,required_error:s,description:r}=a;if(e&&(t||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(l,i)=>{var c,f;let{message:p}=a;return l.code==="invalid_enum_value"?{message:p??i.defaultError}:typeof i.data>"u"?{message:(c=p??s)!==null&&c!==void 0?c:i.defaultError}:l.code!=="invalid_type"?{message:i.defaultError}:{message:(f=p??t)!==null&&f!==void 0?f:i.defaultError}},description:r}}var $a=class{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 Ea(e,t)}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(ra.shape.method.value),this.server.assertCanSetRequestHandler(ta.shape.method.value),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(ra,()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,t])=>{let s={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?Aa(t.inputSchema,{strictUnions:!0}):np,annotations:t.annotations,_meta:t._meta};return t.outputSchema&&(s.outputSchema=Aa(t.outputSchema,{strictUnions:!0})),s})})),this.server.setRequestHandler(ta,async(e,t)=>{let s=this._registeredTools[e.params.name];if(!s)throw new fe(de.InvalidParams,`Tool ${e.params.name} not found`);if(!s.enabled)throw new fe(de.InvalidParams,`Tool ${e.params.name} disabled`);let r;if(s.inputSchema){let n=await s.inputSchema.safeParseAsync(e.params.arguments);if(!n.success)throw new fe(de.InvalidParams,`Invalid arguments for tool ${e.params.name}: ${n.error.message}`);let l=n.data,i=s.callback;try{r=await Promise.resolve(i(l,t))}catch(c){r={content:[{type:"text",text:c instanceof Error?c.message:String(c)}],isError:!0}}}else{let n=s.callback;try{r=await Promise.resolve(n(t))}catch(l){r={content:[{type:"text",text:l instanceof Error?l.message:String(l)}],isError:!0}}}if(s.outputSchema&&!r.isError){if(!r.structuredContent)throw new fe(de.InvalidParams,`Tool ${e.params.name} has an output schema but no structured content was provided`);let n=await s.outputSchema.safeParseAsync(r.structuredContent);if(!n.success)throw new fe(de.InvalidParams,`Invalid structured content for tool ${e.params.name}: ${n.error.message}`)}return r}),this._toolHandlersInitialized=!0)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(aa.shape.method.value),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(aa,async e=>{switch(e.params.ref.type){case"ref/prompt":return this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return this.handleResourceCompletion(e,e.params.ref);default:throw new fe(de.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,t){let s=this._registeredPrompts[t.name];if(!s)throw new fe(de.InvalidParams,`Prompt ${t.name} not found`);if(!s.enabled)throw new fe(de.InvalidParams,`Prompt ${t.name} disabled`);if(!s.argsSchema)return Oa;let r=s.argsSchema.shape[e.params.argument.name];if(!(r instanceof pt))return Oa;let l=await r._def.complete(e.params.argument.value,e.params.context);return ul(l)}async handleResourceCompletion(e,t){let s=Object.values(this._registeredResourceTemplates).find(l=>l.resourceTemplate.uriTemplate.toString()===t.uri);if(!s){if(this._registeredResources[t.uri])return Oa;throw new fe(de.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let r=s.resourceTemplate.completeCallback(e.params.argument.name);if(!r)return Oa;let n=await r(e.params.argument.value,e.params.context);return ul(n)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(Kt.shape.method.value),this.server.assertCanSetRequestHandler(Wt.shape.method.value),this.server.assertCanSetRequestHandler(Yt.shape.method.value),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(Kt,async(e,t)=>{let s=Object.entries(this._registeredResources).filter(([n,l])=>l.enabled).map(([n,l])=>({uri:n,name:l.name,...l.metadata})),r=[];for(let n of Object.values(this._registeredResourceTemplates)){if(!n.resourceTemplate.listCallback)continue;let l=await n.resourceTemplate.listCallback(t);for(let i of l.resources)r.push({...n.metadata,...i})}return{resources:[...s,...r]}}),this.server.setRequestHandler(Wt,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([t,s])=>({name:t,uriTemplate:s.resourceTemplate.uriTemplate.toString(),...s.metadata}))})),this.server.setRequestHandler(Yt,async(e,t)=>{let s=new URL(e.params.uri),r=this._registeredResources[s.toString()];if(r){if(!r.enabled)throw new fe(de.InvalidParams,`Resource ${s} disabled`);return r.readCallback(s,t)}for(let n of Object.values(this._registeredResourceTemplates)){let l=n.resourceTemplate.uriTemplate.match(s.toString());if(l)return n.readCallback(s,l,t)}throw new fe(de.InvalidParams,`Resource ${s} not found`)}),this.setCompletionRequestHandler(),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(Xt.shape.method.value),this.server.assertCanSetRequestHandler(ea.shape.method.value),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(Xt,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,t])=>({name:e,title:t.title,description:t.description,arguments:t.argsSchema?ip(t.argsSchema):void 0}))})),this.server.setRequestHandler(ea,async(e,t)=>{let s=this._registeredPrompts[e.params.name];if(!s)throw new fe(de.InvalidParams,`Prompt ${e.params.name} not found`);if(!s.enabled)throw new fe(de.InvalidParams,`Prompt ${e.params.name} disabled`);if(s.argsSchema){let r=await s.argsSchema.safeParseAsync(e.params.arguments);if(!r.success)throw new fe(de.InvalidParams,`Invalid arguments for prompt ${e.params.name}: ${r.error.message}`);let n=r.data,l=s.callback;return await Promise.resolve(l(n,t))}else{let r=s.callback;return await Promise.resolve(r(t))}}),this.setCompletionRequestHandler(),this._promptHandlersInitialized=!0)}resource(e,t,...s){let r;typeof s[0]=="object"&&(r=s.shift());let n=s[0];if(typeof t=="string"){if(this._registeredResources[t])throw new Error(`Resource ${t} is already registered`);let l=this._createRegisteredResource(e,void 0,t,r,n);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),l}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let l=this._createRegisteredResourceTemplate(e,void 0,t,r,n);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),l}}registerResource(e,t,s,r){if(typeof t=="string"){if(this._registeredResources[t])throw new Error(`Resource ${t} is already registered`);let n=this._createRegisteredResource(e,s.title,t,s,r);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),n}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let n=this._createRegisteredResourceTemplate(e,s.title,t,s,r);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),n}}_createRegisteredResource(e,t,s,r,n){let l={name:e,title:t,metadata:r,readCallback:n,enabled:!0,disable:()=>l.update({enabled:!1}),enable:()=>l.update({enabled:!0}),remove:()=>l.update({uri:null}),update:i=>{typeof i.uri<"u"&&i.uri!==s&&(delete this._registeredResources[s],i.uri&&(this._registeredResources[i.uri]=l)),typeof i.name<"u"&&(l.name=i.name),typeof i.title<"u"&&(l.title=i.title),typeof i.metadata<"u"&&(l.metadata=i.metadata),typeof i.callback<"u"&&(l.readCallback=i.callback),typeof i.enabled<"u"&&(l.enabled=i.enabled),this.sendResourceListChanged()}};return this._registeredResources[s]=l,l}_createRegisteredResourceTemplate(e,t,s,r,n){let l={resourceTemplate:s,title:t,metadata:r,readCallback:n,enabled:!0,disable:()=>l.update({enabled:!1}),enable:()=>l.update({enabled:!0}),remove:()=>l.update({name:null}),update:i=>{typeof i.name<"u"&&i.name!==e&&(delete this._registeredResourceTemplates[e],i.name&&(this._registeredResourceTemplates[i.name]=l)),typeof i.title<"u"&&(l.title=i.title),typeof i.template<"u"&&(l.resourceTemplate=i.template),typeof i.metadata<"u"&&(l.metadata=i.metadata),typeof i.callback<"u"&&(l.readCallback=i.callback),typeof i.enabled<"u"&&(l.enabled=i.enabled),this.sendResourceListChanged()}};return this._registeredResourceTemplates[e]=l,l}_createRegisteredPrompt(e,t,s,r,n){let l={title:t,description:s,argsSchema:r===void 0?void 0:o.object(r),callback:n,enabled:!0,disable:()=>l.update({enabled:!1}),enable:()=>l.update({enabled:!0}),remove:()=>l.update({name:null}),update:i=>{typeof i.name<"u"&&i.name!==e&&(delete this._registeredPrompts[e],i.name&&(this._registeredPrompts[i.name]=l)),typeof i.title<"u"&&(l.title=i.title),typeof i.description<"u"&&(l.description=i.description),typeof i.argsSchema<"u"&&(l.argsSchema=o.object(i.argsSchema)),typeof i.callback<"u"&&(l.callback=i.callback),typeof i.enabled<"u"&&(l.enabled=i.enabled),this.sendPromptListChanged()}};return this._registeredPrompts[e]=l,l}_createRegisteredTool(e,t,s,r,n,l,i,c){let f={title:t,description:s,inputSchema:r===void 0?void 0:o.object(r),outputSchema:n===void 0?void 0:o.object(n),annotations:l,_meta:i,callback:c,enabled:!0,disable:()=>f.update({enabled:!1}),enable:()=>f.update({enabled:!0}),remove:()=>f.update({name:null}),update:p=>{typeof p.name<"u"&&p.name!==e&&(delete this._registeredTools[e],p.name&&(this._registeredTools[p.name]=f)),typeof p.title<"u"&&(f.title=p.title),typeof p.description<"u"&&(f.description=p.description),typeof p.paramsSchema<"u"&&(f.inputSchema=o.object(p.paramsSchema)),typeof p.callback<"u"&&(f.callback=p.callback),typeof p.annotations<"u"&&(f.annotations=p.annotations),typeof p._meta<"u"&&(f._meta=p._meta),typeof p.enabled<"u"&&(f.enabled=p.enabled),this.sendToolListChanged()}};return this._registeredTools[e]=f,this.setToolRequestHandlers(),this.sendToolListChanged(),f}tool(e,...t){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let s,r,n,l;if(typeof t[0]=="string"&&(s=t.shift()),t.length>1){let c=t[0];cl(c)?(r=t.shift(),t.length>1&&typeof t[0]=="object"&&t[0]!==null&&!cl(t[0])&&(l=t.shift())):typeof c=="object"&&c!==null&&(l=t.shift())}let i=t[0];return this._createRegisteredTool(e,void 0,s,r,n,l,void 0,i)}registerTool(e,t,s){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let{title:r,description:n,inputSchema:l,outputSchema:i,annotations:c,_meta:f}=t;return this._createRegisteredTool(e,r,n,l,i,c,f,s)}prompt(e,...t){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let s;typeof t[0]=="string"&&(s=t.shift());let r;t.length>1&&(r=t.shift());let n=t[0],l=this._createRegisteredPrompt(e,void 0,s,r,n);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),l}registerPrompt(e,t,s){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let{title:r,description:n,argsSchema:l}=t,i=this._createRegisteredPrompt(e,r,n,l,s);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),i}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,t){return this.server.sendLoggingMessage(e,t)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}};var np={type:"object",properties:{}};function cl(a){return typeof a!="object"||a===null?!1:Object.keys(a).length===0||Object.values(a).some(op)}function op(a){return a!==null&&typeof a=="object"&&"parse"in a&&typeof a.parse=="function"&&"safeParse"in a&&typeof a.safeParse=="function"}function ip(a){return Object.entries(a.shape).map(([e,t])=>({name:e,description:t.description,required:!t.isOptional()}))}function ul(a){return{completion:{values:a.slice(0,100),total:a.length,hasMore:a.length>100}}}var Oa={completion:{values:[],hasMore:!1}};import fl from"node:process";var ka=class{append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
7
+ `);if(e===-1)return null;let t=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),lp(t)}clear(){this._buffer=void 0}};function lp(a){return _n.parse(JSON.parse(a))}function dl(a){return JSON.stringify(a)+`
8
+ `}var Ia=class{constructor(e=fl.stdin,t=fl.stdout){this._stdin=e,this._stdout=t,this._readBuffer=new ka,this._started=!1,this._ondata=s=>{this._readBuffer.append(s),this.processReadBuffer()},this._onerror=s=>{var r;(r=this.onerror)===null||r===void 0||r.call(this,s)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(var e,t;;)try{let s=this._readBuffer.readMessage();if(s===null)break;(e=this.onmessage)===null||e===void 0||e.call(this,s)}catch(s){(t=this.onerror)===null||t===void 0||t.call(this,s)}}async close(){var e;this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),(e=this.onclose)===null||e===void 0||e.call(this)}send(e){return new Promise(t=>{let s=dl(e);this._stdout.write(s)?t():this._stdout.once("drain",t)})}};function ht(a){return a instanceof Error?`API Error: ${a.message}`:"Unexpected error occurred."}var pl=o.object({server:o.object({flavorRef:o.string(),adminPass:o.string().regex(/^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[\\^$+\-*/|()[\]{}.,?!_=&@~%#:;'"])[A-Za-z0-9\\^$+\-*/|()[\]{}.,?!_=&@~%#:;'"]{9,70}$/),block_device_mapping_v2:o.array(o.object({uuid:o.string()}).strict()),metadata:o.object({instance_name_tag:o.string().regex(/^[A-Za-z0-9_-]{1,255}$/).optional()}).strict(),security_groups:o.array(o.object({name:o.string()}).strict()).optional(),key_name:o.string().optional()}).strict()}).strict(),hl=o.object({keypair:o.object({name:o.string().regex(/^[A-Za-z0-9_-]+$/),public_key:o.string()}).strict()}).strict(),ml=o.union([o.object({"os-start":o.null()}).strict(),o.object({"os-stop":o.null()}).strict(),o.object({"os-stop":o.object({force_shutdown:o.boolean()}).strict()}).strict(),o.object({reboot:o.object({type:o.enum(["SOFT","HARD"])}).strict()}).strict(),o.object({resize:o.object({flavorRef:o.string()}).strict()}).strict(),o.object({confirmResize:o.null()}).strict(),o.object({revertResize:o.null()}).strict()]),vl=o.object({remote_console:o.object({protocol:o.enum(["vnc","serial","web"],{message:"protocol \u306F 'vnc', 'serial', 'web' \u306E\u3044\u305A\u308C\u304B\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"}),type:o.enum(["novnc","serial"],{message:"type \u306F 'novnc' \u307E\u305F\u306F 'serial' \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"})}).strict()}).strict();var gl=o.object({security_group_rule:o.object({security_group_id:o.string(),direction:o.enum(["ingress","egress"],{message:"\u901A\u4FE1\u306E\u5411\u304D\u306F 'ingress' \u307E\u305F\u306F 'egress' \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"}),ethertype:o.enum(["IPv4","IPv6"],{message:"\u30A4\u30FC\u30B5\u30BF\u30A4\u30D7\u306F 'IPv4' \u307E\u305F\u306F 'IPv6' \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"}),port_range_min:o.number({message:"\u30DD\u30FC\u30C8\u756A\u53F7\u306F\u6570\u5024\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"}).int({message:"\u30DD\u30FC\u30C8\u756A\u53F7\u306F\u6574\u6570\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"}).nonnegative({message:"\u30DD\u30FC\u30C8\u756A\u53F7\u306F0\u4EE5\u4E0A\u306E\u5024\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"}).max(65535,{message:"\u30DD\u30FC\u30C8\u756A\u53F7\u306F65535\u4EE5\u4E0B\u306E\u5024\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"}).optional(),port_range_max:o.number({message:"\u30DD\u30FC\u30C8\u756A\u53F7\u306F\u6570\u5024\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"}).int({message:"\u30DD\u30FC\u30C8\u756A\u53F7\u306F\u6574\u6570\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"}).nonnegative({message:"\u30DD\u30FC\u30C8\u756A\u53F7\u306F0\u4EE5\u4E0A\u306E\u5024\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"}).max(65535,{message:"\u30DD\u30FC\u30C8\u756A\u53F7\u306F65535\u4EE5\u4E0B\u306E\u5024\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"}).optional(),protocol:o.union([o.enum(["tcp","udp","icmp"]),o.null()]).optional(),remote_ip_prefix:o.string().optional(),remote_group_id:o.string().optional()}).strict()}).strict(),yl=o.object({security_group:o.object({name:o.string(),description:o.string().optional()}).strict()}).strict(),_l=o.object({security_group:o.object({name:o.string().optional(),description:o.string().optional()}).strict()}).strict(),bl=o.object({port:o.object({security_groups:o.array(o.string()).optional()}).strict()}).strict();var Pl=o.object({volume:o.object({size:o.number().int().gt(0),description:o.string().nullable().optional(),name:o.string().regex(/^[A-Za-z0-9_-]{1,255}$/),volume_type:o.string(),imageRef:o.string()}).strict()}).strict(),xl=o.object({volume:o.object({name:o.string().regex(/^[A-Za-z0-9_-]{1,255}$/).optional(),description:o.string().optional()}).strict()}).strict();var El=`
9
+ JA: ConoHa \u306E OpenStack API \u3092\u5229\u7528\u3057\u3066\u30B5\u30FC\u30D0\u30FC\u64CD\u4F5C\u3092\u884C\u3044\u307E\u3059\u3002
10
+
11
+ \u2022 \u5F15\u6570 \u2018path\u2019 \u3067\u30A2\u30AF\u30BB\u30B9\u5148\u30EA\u30BD\u30FC\u30B9\u3092\u6307\u5B9A
12
+
13
+ \u2022 \u5229\u7528\u53EF\u80FD\u30D1\u30B9:
14
+ /servers/detail (\u30B5\u30FC\u30D0\u30FC\u4E00\u89A7\u53D6\u5F97)
15
+ /flavors/detail (\u30D5\u30EC\u30FC\u30D0\u30FC\u4E00\u89A7\u53D6\u5F97)
16
+ /types (\u30DC\u30EA\u30E5\u30FC\u30E0\u30BF\u30A4\u30D7\u4E00\u89A7\u53D6\u5F97)
17
+ /volumes/detail (\u30DC\u30EA\u30E5\u30FC\u30E0\u4E00\u89A7\u53D6\u5F97)
18
+ /v2/images?limit=200 (\u30A4\u30E1\u30FC\u30B8\u4E00\u89A7\u53D6\u5F97)
19
+ /v2.0/security-groups (\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u30B0\u30EB\u30FC\u30D7\u4E00\u89A7\u53D6\u5F97)
20
+ /v2.0/security-group-rules (\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u30B0\u30EB\u30FC\u30D7\u30EB\u30FC\u30EB\u4E00\u89A7\u53D6\u5F97)
21
+ /v2.0/ports (\u30DD\u30FC\u30C8\u4E00\u89A7\u53D6\u5F97)
22
+
23
+ \u2022 \u5951\u7D04\u306B\u7D10\u3065\u304F\u30B5\u30FC\u30D0\u30FC\u7BA1\u7406\u7528\u9014\u306B\u306E\u307F\u4F7F\u7528\u53EF
24
+ `,Sl=`
25
+ JA: ConoHa \u306E OpenStack API \u3092\u5229\u7528\u3057\u3066\u30B5\u30FC\u30D0\u30FC\u64CD\u4F5C\u3092\u884C\u3044\u307E\u3059\u3002
26
+
27
+ \u2022 \u5F15\u6570 \u2018path\u2019 \u3067\u30A2\u30AF\u30BB\u30B9\u5148\u30EA\u30BD\u30FC\u30B9\u3092\u6307\u5B9A
28
+
29
+ \u2022 \u5229\u7528\u53EF\u80FD\u30D1\u30B9:
30
+ /ips (\u30B5\u30FC\u30D0\u30FC\u306B\u7D10\u3065\u304FIP\u30A2\u30C9\u30EC\u30B9\u4E00\u89A7\u53D6\u5F97)
31
+ /os-security-groups (\u30B5\u30FC\u30D0\u30FC\u306B\u7D10\u3065\u304F\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u30B0\u30EB\u30FC\u30D7\u4E00\u89A7\u53D6\u5F97)
32
+ /rrd/cpu (\u30B5\u30FC\u30D0\u30FC\u306ECPU\u4F7F\u7528\u7387\u7D71\u8A08\u53D6\u5F97)
33
+ /rrd/disk (\u30B5\u30FC\u30D0\u30FC\u306E\u30C7\u30A3\u30B9\u30AF\u4F7F\u7528\u7387\u7D71\u8A08\u53D6\u5F97)
34
+ /v2.0/security-groups (\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u30B0\u30EB\u30FC\u30D7\u8A73\u7D30\u53D6\u5F97)
35
+ /v2.0/security-group-rules (\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u30B0\u30EB\u30FC\u30D7\u30EB\u30FC\u30EB\u8A73\u7D30\u53D6\u5F97)
36
+
37
+ \u2022 \u5F15\u6570 \u2018param\u2019 \u3067\u5FC5\u8981\u306A\u5024\u3092\u6307\u5B9A
38
+ /ips, /os-security-groups, /rrd/cpu, /rrd/disk: \u30B5\u30FC\u30D0\u30FCID
39
+ /v2.0/security-groups: \u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u30B0\u30EB\u30FC\u30D7ID
40
+ /v2.0/security-group-rules: \u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u30B0\u30EB\u30FC\u30D7\u30EB\u30FC\u30EBID
41
+
42
+ \u2022 \u5951\u7D04\u306B\u7D10\u3065\u304F\u30B5\u30FC\u30D0\u30FC\u7BA1\u7406\u7528\u9014\u306B\u306E\u307F\u4F7F\u7528\u53EF
43
+ `,Rl=`
44
+ JA: ConoHa \u306E OpenStack API \u3092\u5229\u7528\u3057\u3066\u30B5\u30FC\u30D0\u30FC\u64CD\u4F5C\u3092\u884C\u3044\u307E\u3059\u3002
45
+
46
+ \u2022 input\u306B\u2018path\u2019\u3068\u2018requestBody\u2019\u3092\u6307\u5B9A
47
+
48
+ { "input": {
49
+ "path": <path>,
50
+ "requestBody": <requestBody>
51
+ }
52
+ }
53
+
54
+ \u2022 \u5F15\u6570 \u2018path\u2019 \u3067\u30A2\u30AF\u30BB\u30B9\u5148\u30EA\u30BD\u30FC\u30B9\u3092\u6307\u5B9A
55
+
56
+ \u2022 \u5229\u7528\u53EF\u80FD\u30D1\u30B9:
57
+ /volumes (\u30DC\u30EA\u30E5\u30FC\u30E0\u4F5C\u6210)
58
+ /servers (\u30B5\u30FC\u30D0\u30FC\u4F5C\u6210 \u203BadminPass \u306F\u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059)
59
+ /os-keypairs (SSH\u30AD\u30FC\u30DA\u30A2\u4F5C\u6210)
60
+ /v2.0/security-groups (\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u30B0\u30EB\u30FC\u30D7\u4F5C\u6210)
61
+ /v2.0/security-group-rules (\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u30B0\u30EB\u30FC\u30D7\u30EB\u30FC\u30EB\u4F5C\u6210 \u203Bport_range_min \u3068 port_range_max \u306F\u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059)
62
+
63
+ \u2022 \u30B5\u30FC\u30D0\u30FC\u4F5C\u6210\u6642\u306E adminPass \u306F\u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u81EA\u52D5\u8A2D\u5B9A\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002
64
+
65
+ \u2022 \u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u30B0\u30EB\u30FC\u30D7\u30EB\u30FC\u30EB\u306E tcp \u307E\u305F\u306F udp \u30D7\u30ED\u30C8\u30B3\u30EB\u3092\u4F7F\u7528\u3059\u308B\u5834\u5408\u3001port_range_min \u3068 port_range_max \u306E\u5024\u306F\u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u81EA\u52D5\u8A2D\u5B9A\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002
66
+
67
+ \u2022 \u5F15\u6570 \u2018requestBody\u2019 \u3067\u30EA\u30AF\u30A8\u30B9\u30C8\u30DC\u30C7\u30A3\u3092\u6307\u5B9A
68
+ /servers:
69
+ { "server": {
70
+ "flavorRef": string, // Flavor ID
71
+ "adminPass": string, // Admin/root password for the server: Must be specified by the user. Do not set automatically. (9-70 characters, must include uppercase letters, lowercase letters, numbers, and symbols, available symbols are ^$+-*/|()[]{}.,?!_=&@~%#:;'" )
72
+ "block_device_mapping_v2": [ // One or more volume mappings
73
+ { "uuid": string } // Volume UUID to boot from
74
+ ],
75
+ "metadata": {
76
+ "instance_name_tag": string // Display name of the server (1-255 alphanumeric characters, underscores, or hyphens) (optional)
77
+ },
78
+ "security_groups": [ // List of security groups (optional)
79
+ { "name": string } // Name of the security group
80
+ ],
81
+ "key_name": string // Name of the SSH key pair (optional)
82
+ }
83
+ }
84
+
85
+ /os-keypairs:
86
+ { "keypair": {
87
+ "name": string, // Name of the the ssh key pair (alphanumeric characters, underscores, or hyphens)
88
+ "public_key": string // Public key of the ssh key pair
89
+ }
90
+ }
91
+
92
+ /volumes:
93
+ { "volume": {
94
+ "size": number, // Size of the volume in GB (30, 100, 200, 500, 1000, 5000, 10000)
95
+ "description": string, // Description of the volume (nullable)
96
+ "name": string, // Name of the volume (1-255 alphanumeric characters, underscores, or hyphens)
97
+ "volume_type": string, // Type of the volume (name or ID)
98
+ "imageRef": string // Image ID to create the volume from
99
+ }
100
+ }
101
+
102
+ /v2.0/security-groups:
103
+ { "security_group": {
104
+ "name": string, // Name of the security group
105
+ "description": string // Description of the security group (optional)
106
+ }
107
+ }
108
+
109
+ /v2.0/security-group-rules:
110
+ { "security_group_rule": {
111
+ "security_group_id": string, // ID of the security group
112
+ "direction": "ingress" | "egress", // Direction of the rule (ingress or egress)
113
+ "ethertype": "IPv4" | "IPv6", // Ethertype (IPv4 or IPv6) (optional, default is IPv4)
114
+ "port_range_min": number, // Minimum port range (optional): Must be specified by the user. Do not set automatically.
115
+ "port_range_max": number, // Maximum port range (optional): Must be specified by the user. Do not set automatically.
116
+ "protocol": "tcp" | "udp" | "icmp" | null, // Protocol (optional)
117
+ "remote_ip_prefix": string, // CIDR for remote IP (optional)
118
+ "remote_group_id": string // ID of the remote security group (optional)
119
+ }
120
+ }
121
+
122
+ \u2022 \u5951\u7D04\u306B\u7D10\u3065\u304F\u30B5\u30FC\u30D0\u30FC\u7BA1\u7406\u7528\u9014\u306B\u306E\u307F\u4F7F\u7528\u53EF
123
+ `,wl=`
124
+ JA: ConoHa \u306E OpenStack API \u3092\u5229\u7528\u3057\u3066\u30B5\u30FC\u30D0\u30FC\u64CD\u4F5C\u3092\u884C\u3044\u307E\u3059\u3002
125
+
126
+ \u2022 input\u306B\u2018path\u2019, \u2018param\u2019, \u2018requestBody\u2019\u3092\u6307\u5B9A
127
+
128
+ { "input": {
129
+ "path": <path>,
130
+ "param": <param>,
131
+ "requestBody": <requestBody>
132
+ }
133
+ }
134
+
135
+ \u2022 \u5F15\u6570 \u2018path\u2019 \u3067\u30A2\u30AF\u30BB\u30B9\u5148\u30EA\u30BD\u30FC\u30B9\u3092\u6307\u5B9A
136
+
137
+ \u2022 \u5229\u7528\u53EF\u80FD\u30D1\u30B9:
138
+ /action (\u30B5\u30FC\u30D0\u30FC\u64CD\u4F5C)
139
+ /remote-consoles (\u30EA\u30E2\u30FC\u30C8\u30B3\u30F3\u30BD\u30FC\u30EBURL\u53D6\u5F97)
140
+ /v2.0/security-groups (\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u30B0\u30EB\u30FC\u30D7\u66F4\u65B0)
141
+ /volumes (\u30DC\u30EA\u30E5\u30FC\u30E0\u66F4\u65B0)
142
+ /v2.0/ports (\u30DD\u30FC\u30C8\u66F4\u65B0)
143
+
144
+ \u2022 \u5F15\u6570 \u2018param\u2019 \u3067\u5FC5\u8981\u306A\u5024\u3092\u6307\u5B9A
145
+ /action, /remote-consoles: \u30B5\u30FC\u30D0\u30FCID
146
+ /v2.0/security-groups: \u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u30B0\u30EB\u30FC\u30D7ID
147
+ /volumes: \u30DC\u30EA\u30E5\u30FC\u30E0ID
148
+ /v2.0/ports: \u30DD\u30FC\u30C8ID
149
+
150
+ \u2022 \u5F15\u6570 \u2018requestBody\u2019 \u3067\u30EA\u30AF\u30A8\u30B9\u30C8\u30DC\u30C7\u30A3\u3092\u6307\u5B9A
151
+ /action:
152
+ { "os-start": null } // Start the server
153
+ or
154
+ { "os-stop": null } // Stop the server
155
+ or
156
+ { "os-stop": { // Stop the server
157
+ "force_shutdown": true | false // Force shutdown
158
+ }
159
+ }
160
+ or
161
+ { "os-reboot": { // Reboot the server
162
+ "type": "SOFT" | "HARD" // Reboot type (soft or hard)
163
+ }
164
+ }
165
+ or
166
+ { "resize": { // Resize the server
167
+ "flavorRef": string // Flavor ID to resize to
168
+ }
169
+ }
170
+ or
171
+ { "confirmResize": null } // Confirm the resize
172
+ or
173
+ { "revertResize": null } // Revert the resize
174
+
175
+ /remote-consoles:
176
+ { "remote_console": {
177
+ "protocol": "vnc" | "spice" | "serial", // Protocol for the remote console
178
+ "type": "novnc" | "serial" // Type of the remote console
179
+ }
180
+ }
181
+
182
+ /v2.0/security-groups:
183
+ { "security_group": {
184
+ "name": string, // Name of the security group (optional)
185
+ "description": string // Description of the security group (optional)
186
+ }
187
+ }
188
+
189
+ /volumes:
190
+ { "volume": {
191
+ "name": string, // Name of the volume (optional) (1-255 alphanumeric characters, underscores, or hyphens)
192
+ "description": string // Description of the volume (optional)
193
+ }
194
+ }
195
+
196
+ /v2.0/ports:
197
+ { "port": {
198
+ "security_groups": [string] // List of security group IDs to associate with the port (optional)
199
+ }
200
+ }
201
+
202
+ \u2022 \u5951\u7D04\u306B\u7D10\u3065\u304F\u30B5\u30FC\u30D0\u30FC\u7BA1\u7406\u7528\u9014\u306B\u306E\u307F\u4F7F\u7528\u53EF
203
+ `,Tl=`
204
+ JA: ConoHa \u306E OpenStack API \u3092\u5229\u7528\u3057\u3066\u30B5\u30FC\u30D0\u30FC\u64CD\u4F5C\u3092\u884C\u3044\u307E\u3059\u3002
205
+
206
+ \u2022 \u5F15\u6570 \u2018path\u2019 \u3067\u30A2\u30AF\u30BB\u30B9\u5148\u30EA\u30BD\u30FC\u30B9\u3092\u6307\u5B9A
207
+
208
+ \u2022 \u5229\u7528\u53EF\u80FD\u30D1\u30B9:
209
+ /servers (\u30B5\u30FC\u30D0\u30FC\u524A\u9664)
210
+ /os-keypairs (SSH\u30AD\u30FC\u30DA\u30A2\u524A\u9664)
211
+ /v2.0/security-groups (\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u30B0\u30EB\u30FC\u30D7\u524A\u9664)
212
+ /v2.0/security-group-rules (\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u30B0\u30EB\u30FC\u30D7\u30EB\u30FC\u30EB\u524A\u9664)
213
+ /volumes (\u30DC\u30EA\u30E5\u30FC\u30E0\u524A\u9664)
214
+
215
+ \u2022 \u5F15\u6570 \u2018param\u2019 \u3067\u5FC5\u8981\u306A\u5024\u3092\u6307\u5B9A
216
+ /servers: \u30B5\u30FC\u30D0\u30FCID
217
+ /os-keypairs: SSH\u30AD\u30FC\u30DA\u30A2\u540D
218
+ /v2.0/security-groups: \u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u30B0\u30EB\u30FC\u30D7ID
219
+ /v2.0/security-group-rules: \u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u30B0\u30EB\u30FC\u30D7\u30EB\u30FC\u30EBID
220
+ /volumes: \u30DC\u30EA\u30E5\u30FC\u30E0ID
221
+
222
+ \u2022 \u5951\u7D04\u306B\u7D10\u3065\u304F\u30B5\u30FC\u30D0\u30FC\u7BA1\u7406\u7528\u9014\u306B\u306E\u307F\u4F7F\u7528\u53EF
223
+ `,Al=`
224
+ JA: ConoHa \u306E OpenStack API \u3092\u5229\u7528\u3057\u3066\u65B0\u3057\u3044\u30B5\u30FC\u30D0\u30FC\u3092\u4F5C\u6210\u3057\u307E\u3059\u3002
225
+ \u2022 root\u30D1\u30B9\u30EF\u30FC\u30C9\u306F\u5FC5\u305A\u30E6\u30FC\u30B6\u30FC\u81EA\u8EAB\u304C\u6307\u5B9A\u3057\u305F\u3082\u306E\u3092\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002
226
+ \u2022 root\u30D1\u30B9\u30EF\u30FC\u30C9\u306F9~70\u6587\u5B57\u306E\u534A\u89D2\u82F1\u6570\u8A18\u53F7\u306E\u7D44\u307F\u5408\u308F\u305B\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002
227
+ \u2022 root\u30D1\u30B9\u30EF\u30FC\u30C9\u306B\u306F\u30A2\u30EB\u30D5\u30A1\u30D9\u30C3\u30C8\u5927\u6587\u5B57\u3001\u5C0F\u6587\u5B57\u3001\u6570\u5B57\u3001\u8A18\u53F7\u3092\u305D\u308C\u305E\u308C\u542B\u3081\u3066\u304F\u3060\u3055\u3044\u3002(\u5229\u7528\u53EF\u80FD\u306A\u8A18\u53F7\u306F ^$+-*/|()[]{}.,?!_=&@~%#:;'" \u3067\u3059)
228
+ \u2022 root\u30D1\u30B9\u30EF\u30FC\u30C9\u306E\u4F5C\u6210\u6761\u4EF6\u306B\u8AA4\u308A\u304C\u3042\u3063\u305F\u5834\u5408\u3067\u3082\u3001\u5FC5\u305A\u30E6\u30FC\u30B6\u30FC\u81EA\u8EAB\u306B\u30D1\u30B9\u30EF\u30FC\u30C9\u306E\u518D\u5165\u529B\u3092\u4F9D\u983C\u3057\u3001\u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3057\u305F\u5024\u306E\u307F\u3092adminPass\u306B\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002
229
+ `;var Ol="https://identity.c3j1.conoha.io/v3",Kr="https://compute.c3j1.conoha.io/v2.1",$l="https://block-storage.c3j1.conoha.io/v3",kl="https://image-service.c3j1.conoha.io",mt="https://networking.c3j1.conoha.io";async function cp(a){let e=process.env.OPENSTACK_USER_ID,t=process.env.OPENSTACK_PASSWORD,s=process.env.OPENSTACK_TENANT_ID;if(!e||!t||!s)throw new Error("USER_ID, PASSWORD, or TENANT_ID envs are not defined");return(await fetch(`${Ol}${a}`,{method:"POST",headers:{Accept:"application/json"},body:JSON.stringify({auth:{identity:{methods:["password"],password:{user:{id:e,password:t}}},scope:{project:{id:s}}}})})).headers}async function Il(){return(await cp("/auth/tokens")).get("x-subject-token")}async function Se(a,e,t,s){let r=await Il(),n=t.startsWith("/")?t:`/${t}`,l=`${e}${n}`;return await fetch(l,{method:a,headers:{Accept:"application/json","X-Auth-Token":r,...s?{"Content-Type":"application/json"}:{}},...s?{body:JSON.stringify(s)}:{}})}async function Ae(a){let e=await a.text();try{return JSON.stringify({status:a.status,statusText:a.statusText,body:JSON.parse(e)})}catch(t){return console.error("Failed to parse response body as JSON:",t),JSON.stringify({status:a.status,statusText:a.statusText,body:e})}}async function Dl(a){try{let e=await a.json();if(!e?.flavors||!Array.isArray(e.flavors))return JSON.stringify({status:a.status,statusText:a.statusText,body:e});let t={flavors:e.flavors.map(s=>({id:s?.id,name:s?.name,ram:s?.ram,vcpus:s?.vcpus,disk:s?.disk}))};return JSON.stringify({status:a.status,statusText:a.statusText,body:t})}catch(e){return console.error("Error formatting response:",e),JSON.stringify({status:a.status,statusText:a.statusText,body:"<error>"})}}async function $s(a){let e=await Se("GET",Kr,a);return await Ae(e)}async function Cl(a){let e=await Se("GET",Kr,a);return await Dl(e)}async function kt(a,e){let t=await Se("GET",Kr,`/servers/${e}${a}`);return await Ae(t)}async function ks(a,e){let t=await Se("POST",Kr,a,e);return await Ae(t)}async function Is(a,e,t){let s=await Se("POST",Kr,`/servers/${e}${a}`,t);return await Ae(s)}async function Ds(a,e){let t=await Se("DELETE",Kr,`${a}/${e}`);return await Ae(t)}async function jl(a){try{let e=await a.json();if(!e?.images||!Array.isArray(e.images))return JSON.stringify({status:a.status,statusText:a.statusText,body:e});let t={images:e.images.map(s=>({id:s?.id,name:s?.name,osType:s?.os_type,arch:s?.architecture,tags:s?.tags,minDisk:s?.min_disk,minRam:s?.min_ram}))};return JSON.stringify({status:a.status,statusText:a.statusText,body:t})}catch(e){return console.error("Error formatting response:",e),JSON.stringify({status:a.status,statusText:a.statusText,body:"<error>"})}}async function Nl(a){let e=await Se("GET",kl,a);return await jl(e)}async function Da(a){let e=await Se("GET",mt,a);return await Ae(e)}async function Cs(a,e){let t=await Se("GET",mt,`${a}/${e}`);return await Ae(t)}async function js(a,e){let t=await Se("POST",mt,a,e);return await Ae(t)}async function Ns(a,e,t){let s=await Se("PUT",mt,`${a}/${e}`,t);return await Ae(s)}async function Ls(a,e){let t=await Se("DELETE",mt,`${a}/${e}`);return await Ae(t)}var up=process.env.OPENSTACK_TENANT_ID,Ca=`${$l}/${up}`;async function Fs(a){let e=await Se("GET",Ca,a);return await Ae(e)}async function Ll(a,e){let t=await Se("POST",Ca,a,e);return await Ae(t)}async function Fl(a,e,t){let s=await Se("PUT",Ca,`${a}/${e}`,t);return await Ae(s)}async function ql(a,e){let t=await Se("DELETE",Ca,`${a}/${e}`);return await Ae(t)}var Ml={"/servers/detail":()=>$s("/servers/detail"),"/flavors/detail":()=>Cl("/flavors/detail"),"/os-keypairs":()=>$s("/os-keypairs"),"/types":()=>Fs("/types"),"/volumes/detail":()=>Fs("/volumes/detail"),"/v2/images?limit=200":()=>Nl("/v2/images?limit=200"),"/v2.0/security-groups":()=>Da("/v2.0/security-groups"),"/v2.0/security-group-rules":()=>Da("/v2.0/security-group-rules"),"/v2.0/ports":()=>Da("/v2.0/ports")},zl={"/ips":a=>kt("/ips",a),"/os-security-groups":a=>kt("/os-security-groups",a),"/rrd/cpu":a=>kt("/rrd/cpu",a),"/rrd/disk":a=>kt("/rrd/disk",a),"/v2.0/security-groups":a=>Cs("/v2.0/security-groups",a),"/v2.0/security-group-rules":a=>Cs("/v2.0/security-group-rules",a)},Hl={"/servers":a=>ks("/servers",a),"/os-keypairs":a=>ks("/os-keypairs",a),"/volumes":a=>Ll("/volumes",a),"/v2.0/security-groups":a=>js("/v2.0/security-groups",a),"/v2.0/security-group-rules":a=>js("/v2.0/security-group-rules",a)},Ul={"/action":(a,e)=>Is("/action",a,e),"/remote-consoles":(a,e)=>Is("/remote-consoles",a,e),"/v2.0/security-groups":(a,e)=>Ns("/v2.0/security-groups",a,e),"/v2.0/ports":(a,e)=>Ns("/v2.0/ports",a,e),"/volumes":(a,e)=>Fl("/volumes",a,e)},Vl={"/servers":a=>Ds("/servers",a),"/os-keypairs":a=>Ds("/os-keypairs",a),"/v2.0/security-groups":a=>Ls("/v2.0/security-groups",a),"/v2.0/security-group-rules":a=>Ls("/v2.0/security-group-rules",a),"/volumes":a=>ql("/volumes",a)};var fp=dp(import.meta.url),pp=fp("../package.json"),Wr=new $a({name:"ConoHa VPS MCP",version:pp.version});Wr.tool("conoha_get",El,{path:o.enum(["/servers/detail","/flavors/detail","/os-keypairs","/types","/volumes/detail","/v2/images?limit=200","/v2.0/security-groups","/v2.0/security-group-rules","/v2.0/ports"])},async({path:a})=>{try{let e=Ml[a];return{content:[{type:"text",text:await e()}]}}catch(e){return{content:[{type:"text",text:ht(e)}],isError:!0}}});Wr.tool("conoha_get_by_param",Sl,{path:o.enum(["/ips","/os-security-groups","/rrd/cpu","/rrd/disk","/v2.0/security-groups","/v2.0/security-group-rules"]),param:o.string()},async({path:a,param:e})=>{try{let t=zl[a];return{content:[{type:"text",text:await t(e)}]}}catch(t){return{content:[{type:"text",text:ht(t)}],isError:!0}}});Wr.tool("conoha_post",Rl,{input:o.discriminatedUnion("path",[o.object({path:o.literal("/servers"),requestBody:pl}),o.object({path:o.literal("/os-keypairs"),requestBody:hl}),o.object({path:o.literal("/volumes"),requestBody:Pl}),o.object({path:o.literal("/v2.0/security-groups"),requestBody:yl}),o.object({path:o.literal("/v2.0/security-group-rules"),requestBody:gl})])},async({input:a})=>{try{let{path:e,requestBody:t}=a,s=Hl[e];return{content:[{type:"text",text:await s(t)}]}}catch(e){return{content:[{type:"text",text:ht(e)}],isError:!0}}});Wr.tool("conoha_post_put_by_param",wl,{input:o.discriminatedUnion("path",[o.object({path:o.literal("/action"),param:o.string(),requestBody:ml}),o.object({path:o.literal("/remote-consoles"),param:o.string(),requestBody:vl}),o.object({path:o.literal("/v2.0/security-groups"),param:o.string(),requestBody:_l}),o.object({path:o.literal("/v2.0/ports"),param:o.string(),requestBody:bl}),o.object({path:o.literal("/volumes"),param:o.string(),requestBody:xl})])},async({input:a})=>{try{let{path:e,param:t,requestBody:s}=a,r=Ul[e];return{content:[{type:"text",text:await r(t,s)}]}}catch(e){return{content:[{type:"text",text:ht(e)}],isError:!0}}});Wr.tool("conoha_delete_by_param",Tl,{path:o.enum(["/servers","/os-keypairs","/v2.0/security-groups","/v2.0/security-group-rules","/volumes"]),param:o.string()},async({path:a,param:e})=>{try{let t=Vl[a];return{content:[{type:"text",text:await t(e)}]}}catch(t){return{content:[{type:"text",text:ht(t)}],isError:!0}}});Wr.prompt("create_server",Al,{rootPassword:o.string().regex(/^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[\\^$+\-*/|()[\]{}.,?!_=&@~%#:;'"])[A-Za-z0-9\\^$+\-*/|()[\]{}.,?!_=&@~%#:;'"]{9,70}$/)},({rootPassword:a})=>({messages:[{role:"user",content:{type:"text",text:`root\u30D1\u30B9\u30EF\u30FC\u30C9\u3092${a}\u3068\u3057\u3066\u3001\u65B0\u3057\u3044\u30B5\u30FC\u30D0\u30FC\u3092\u4F5C\u6210\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u307E\u305F\u3001\u958B\u653E\u3059\u308B\u30DD\u30FC\u30C8\u306A\u3069\u3001\u5FC5\u8981\u306A\u60C5\u5831\u306F\u90FD\u5EA6\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`}}]}));var hp=new Ia;await Wr.connect(hp);
230
+ /*! Bundled license information:
231
+
232
+ uri-js/dist/es5/uri.all.js:
233
+ (** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js *)
234
+ */