playwright 1.56.0-alpha-1756945786000 → 1.56.0-alpha-1757023974000
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/common/expectBundleImpl.js +13 -13
- package/lib/matchers/matcherHint.js +0 -3
- package/lib/matchers/toBeTruthy.js +3 -7
- package/lib/matchers/toEqual.js +5 -5
- package/lib/matchers/toMatchAriaSnapshot.js +5 -8
- package/lib/matchers/toMatchText.js +9 -16
- package/lib/mcp/browser/browserContextFactory.js +28 -21
- package/lib/mcp/browser/config.js +23 -1
- package/lib/mcp/browser/context.js +19 -0
- package/lib/mcp/browser/processUtils.js +87 -0
- package/lib/mcp/browser/response.js +11 -0
- package/lib/mcp/browser/tools/form.js +6 -5
- package/lib/mcp/browser/tools/keyboard.js +5 -15
- package/lib/mcp/program.js +1 -1
- package/lib/mcpBundleImpl.js +1 -1
- package/lib/transform/babelBundleImpl.js +10 -10
- package/lib/utilsBundleImpl.js +1 -1
- package/lib/worker/fixtureRunner.js +13 -7
- package/package.json +2 -2
- package/types/test.d.ts +4 -4
package/lib/mcpBundleImpl.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Du=Object.create;var ua=Object.defineProperty;var ju=Object.getOwnPropertyDescriptor;var Nu=Object.getOwnPropertyNames;var Lu=Object.getPrototypeOf,Fu=Object.prototype.hasOwnProperty;var z=(a,e)=>()=>(e||a((e={exports:{}}).exports,e),e.exports),zn=(a,e)=>{for(var t in e)ua(a,t,{get:e[t],enumerable:!0})},Vn=(a,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Nu(e))!Fu.call(a,r)&&r!==t&&ua(a,r,{get:()=>e[r],enumerable:!(s=ju(e,r))||s.enumerable});return a};var pr=(a,e,t)=>(t=a!=null?Du(Lu(a)):{},Vn(e||!a||!a.__esModule?ua(t,"default",{value:a,enumerable:!0}):t,a)),Mu=a=>Vn(ua({},"__esModule",{value:!0}),a);var _o=z((Ra,yo)=>{(function(a,e){typeof Ra=="object"&&typeof yo!="undefined"?e(Ra):typeof define=="function"&&define.amd?define(["exports"],e):e(a.URI=a.URI||{})})(Ra,function(a){"use strict";function e(){for(var _=arguments.length,h=Array(_),b=0;b<_;b++)h[b]=arguments[b];if(h.length>1){h[0]=h[0].slice(0,-1);for(var w=h.length-1,E=1;E<w;++E)h[E]=h[E].slice(1,-1);return h[w]=h[w].slice(1),h.join("")}else return h[0]}function t(_){return"(?:"+_+")"}function s(_){return _===void 0?"undefined":_===null?"null":Object.prototype.toString.call(_).split(" ").pop().split("]").shift().toLowerCase()}function r(_){return _.toUpperCase()}function n(_){return _!=null?_ instanceof Array?_:typeof _.length!="number"||_.split||_.setInterval||_.call?[_]:Array.prototype.slice.call(_):[]}function o(_,h){var b=_;if(h)for(var w in h)b[w]=h[w];return b}function i(_){var h="[A-Za-z]",b="[\\x0D]",w="[0-9]",E="[\\x22]",N=e(w,"[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)),be="[\\:\\/\\?\\#\\[\\]\\@]",te="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",he=e(be,te),xe=_?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",de=_?"[\\uE000-\\uF8FF]":"[]",ne=e(h,w,"[\\-\\.\\_\\~]",xe),pe=t(h+e(h,w,"[\\+\\-\\.]")+"*"),ce=t(t(ie+"|"+e(ne,te,"[\\:]"))+"*"),Lr=t(t("25[0-5]")+"|"+t("2[0-4]"+w)+"|"+t("1"+w+w)+"|"+t("[1-9]"+w)+"|"+w),Ue=t(t("25[0-5]")+"|"+t("2[0-4]"+w)+"|"+t("1"+w+w)+"|"+t("0?[1-9]"+w)+"|0?0?"+w),He=t(Ue+"\\."+Ue+"\\."+Ue+"\\."+Ue),ue=t(N+"{1,4}"),ze=t(t(ue+"\\:"+ue)+"|"+He),Ze=t(t(ue+"\\:")+"{6}"+ze),sr=t("\\:\\:"+t(ue+"\\:")+"{5}"+ze),Fr=t(t(ue)+"?\\:\\:"+t(ue+"\\:")+"{4}"+ze),dr=t(t(t(ue+"\\:")+"{0,1}"+ue)+"?\\:\\:"+t(ue+"\\:")+"{3}"+ze),Ct=t(t(t(ue+"\\:")+"{0,2}"+ue)+"?\\:\\:"+t(ue+"\\:")+"{2}"+ze),ia=t(t(t(ue+"\\:")+"{0,3}"+ue)+"?\\:\\:"+ue+"\\:"+ze),la=t(t(t(ue+"\\:")+"{0,4}"+ue)+"?\\:\\:"+ze),ut=t(t(t(ue+"\\:")+"{0,5}"+ue)+"?\\:\\:"+ue),dt=t(t(t(ue+"\\:")+"{0,6}"+ue)+"?\\:\\:"),fr=t([Ze,sr,Fr,dr,Ct,ia,la,ut,dt].join("|")),ft=t(t(ne+"|"+ie)+"+"),cs=t(fr+"\\%25"+ft),Mr=t(fr+t("\\%25|\\%(?!"+N+"{2})")+ft),Ou=t("[vV]"+N+"+\\."+e(ne,te,"[\\:]")+"+"),Tu=t("\\["+t(Mr+"|"+fr+"|"+Ou)+"\\]"),Fn=t(t(ie+"|"+e(ne,te))+"*"),kt=t(Tu+"|"+He+"(?!"+Fn+")|"+Fn),Dt=t(w+"*"),Mn=t(t(ce+"@")+"?"+kt+t("\\:"+Dt)+"?"),jt=t(ie+"|"+e(ne,te,"[\\:\\@]")),$u=t(jt+"*"),qn=t(jt+"+"),Au=t(t(ie+"|"+e(ne,te,"[\\@]"))+"+"),hr=t(t("\\/"+$u)+"*"),ht=t("\\/"+t(qn+hr)+"?"),us=t(Au+hr),ca=t(qn+hr),pt="(?!"+jt+")",Lm=t(hr+"|"+ht+"|"+us+"|"+ca+"|"+pt),mt=t(t(jt+"|"+e("[\\/\\?]",de))+"*"),Nt=t(t(jt+"|[\\/\\?]")+"*"),Un=t(t("\\/\\/"+Mn+hr)+"|"+ht+"|"+ca+"|"+pt),Iu=t(pe+"\\:"+Un+t("\\?"+mt)+"?"+t("\\#"+Nt)+"?"),Cu=t(t("\\/\\/"+Mn+hr)+"|"+ht+"|"+us+"|"+pt),ku=t(Cu+t("\\?"+mt)+"?"+t("\\#"+Nt)+"?"),Fm=t(Iu+"|"+ku),Mm=t(pe+"\\:"+Un+t("\\?"+mt)+"?"),qm="^("+pe+")\\:"+t(t("\\/\\/("+t("("+ce+")@")+"?("+kt+")"+t("\\:("+Dt+")")+"?)")+"?("+hr+"|"+ht+"|"+ca+"|"+pt+")")+t("\\?("+mt+")")+"?"+t("\\#("+Nt+")")+"?$",Um="^(){0}"+t(t("\\/\\/("+t("("+ce+")@")+"?("+kt+")"+t("\\:("+Dt+")")+"?)")+"?("+hr+"|"+ht+"|"+us+"|"+pt+")")+t("\\?("+mt+")")+"?"+t("\\#("+Nt+")")+"?$",zm="^("+pe+")\\:"+t(t("\\/\\/("+t("("+ce+")@")+"?("+kt+")"+t("\\:("+Dt+")")+"?)")+"?("+hr+"|"+ht+"|"+ca+"|"+pt+")")+t("\\?("+mt+")")+"?$",Vm="^"+t("\\#("+Nt+")")+"?$",Hm="^"+t("("+ce+")@")+"?("+kt+")"+t("\\:("+Dt+")")+"?$";return{NOT_SCHEME:new RegExp(e("[^]",h,w,"[\\+\\-\\.]"),"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,"[\\:\\@\\/\\?]",de),"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,he),"g"),PCT_ENCODED:new RegExp(ie,"g"),IPV4ADDRESS:new RegExp("^("+He+")$"),IPV6ADDRESS:new RegExp("^\\[?("+fr+")"+t(t("\\%25|\\%(?!"+N+"{2})")+"("+ft+")")+"?\\]?$")}}var u=i(!1),c=i(!0),f=function(){function _(h,b){var w=[],E=!0,N=!1,K=void 0;try{for(var ae=h[Symbol.iterator](),ie;!(E=(ie=ae.next()).done)&&(w.push(ie.value),!(b&&w.length===b));E=!0);}catch(be){N=!0,K=be}finally{try{!E&&ae.return&&ae.return()}finally{if(N)throw K}}return w}return function(h,b){if(Array.isArray(h))return h;if(Symbol.iterator in Object(h))return _(h,b);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(_){if(Array.isArray(_)){for(var h=0,b=Array(_.length);h<_.length;h++)b[h]=_[h];return b}else return Array.from(_)},g=2147483647,d=36,y=1,m=26,v=38,x=700,S=72,P=128,O="-",A=/^xn--/,I=/[^\0-\x7E]/,H=/[\x2E\u3002\uFF0E\uFF61]/g,q={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},C=d-y,U=Math.floor,M=String.fromCharCode;function L(_){throw new RangeError(q[_])}function $(_,h){for(var b=[],w=_.length;w--;)b[w]=h(_[w]);return b}function k(_,h){var b=_.split("@"),w="";b.length>1&&(w=b[0]+"@",_=b[1]),_=_.replace(H,".");var E=_.split("."),N=$(E,h).join(".");return w+N}function F(_){for(var h=[],b=0,w=_.length;b<w;){var E=_.charCodeAt(b++);if(E>=55296&&E<=56319&&b<w){var N=_.charCodeAt(b++);(N&64512)==56320?h.push(((E&1023)<<10)+(N&1023)+65536):(h.push(E),b--)}else h.push(E)}return h}var le=function(h){return String.fromCodePoint.apply(String,p(h))},Y=function(h){return h-48<10?h-22:h-65<26?h-65:h-97<26?h-97:d},re=function(h,b){return h+22+75*(h<26)-((b!=0)<<5)},W=function(h,b,w){var E=0;for(h=w?U(h/x):h>>1,h+=U(h/b);h>C*m>>1;E+=d)h=U(h/C);return U(E+(C+1)*h/(h+v))},Z=function(h){var b=[],w=h.length,E=0,N=P,K=S,ae=h.lastIndexOf(O);ae<0&&(ae=0);for(var ie=0;ie<ae;++ie)h.charCodeAt(ie)>=128&&L("not-basic"),b.push(h.charCodeAt(ie));for(var be=ae>0?ae+1:0;be<w;){for(var te=E,he=1,xe=d;;xe+=d){be>=w&&L("invalid-input");var de=Y(h.charCodeAt(be++));(de>=d||de>U((g-E)/he))&&L("overflow"),E+=de*he;var ne=xe<=K?y:xe>=K+m?m:xe-K;if(de<ne)break;var pe=d-ne;he>U(g/pe)&&L("overflow"),he*=pe}var ce=b.length+1;K=W(E-te,ce,te==0),U(E/ce)>g-N&&L("overflow"),N+=U(E/ce),E%=ce,b.splice(E++,0,N)}return String.fromCodePoint.apply(String,b)},me=function(h){var b=[];h=F(h);var w=h.length,E=P,N=0,K=S,ae=!0,ie=!1,be=void 0;try{for(var te=h[Symbol.iterator](),he;!(ae=(he=te.next()).done);ae=!0){var xe=he.value;xe<128&&b.push(M(xe))}}catch(Mr){ie=!0,be=Mr}finally{try{!ae&&te.return&&te.return()}finally{if(ie)throw be}}var de=b.length,ne=de;for(de&&b.push(O);ne<w;){var pe=g,ce=!0,Lr=!1,Ue=void 0;try{for(var He=h[Symbol.iterator](),ue;!(ce=(ue=He.next()).done);ce=!0){var ze=ue.value;ze>=E&&ze<pe&&(pe=ze)}}catch(Mr){Lr=!0,Ue=Mr}finally{try{!ce&&He.return&&He.return()}finally{if(Lr)throw Ue}}var Ze=ne+1;pe-E>U((g-N)/Ze)&&L("overflow"),N+=(pe-E)*Ze,E=pe;var sr=!0,Fr=!1,dr=void 0;try{for(var Ct=h[Symbol.iterator](),ia;!(sr=(ia=Ct.next()).done);sr=!0){var la=ia.value;if(la<E&&++N>g&&L("overflow"),la==E){for(var ut=N,dt=d;;dt+=d){var fr=dt<=K?y:dt>=K+m?m:dt-K;if(ut<fr)break;var ft=ut-fr,cs=d-fr;b.push(M(re(fr+ft%cs,0))),ut=U(ft/cs)}b.push(M(re(ut,0))),K=W(N,Ze,ne==de),N=0,++ne}}}catch(Mr){Fr=!0,dr=Mr}finally{try{!sr&&Ct.return&&Ct.return()}finally{if(Fr)throw dr}}++N,++E}return b.join("")},Oe=function(h){return k(h,function(b){return A.test(b)?Z(b.slice(4).toLowerCase()):b})},Ie=function(h){return k(h,function(b){return I.test(b)?"xn--"+me(b):b})},se={version:"2.1.0",ucs2:{decode:F,encode:le},decode:Z,encode:me,toASCII:Ie,toUnicode:Oe},ye={};function Ee(_){var h=_.charCodeAt(0),b=void 0;return h<16?b="%0"+h.toString(16).toUpperCase():h<128?b="%"+h.toString(16).toUpperCase():h<2048?b="%"+(h>>6|192).toString(16).toUpperCase()+"%"+(h&63|128).toString(16).toUpperCase():b="%"+(h>>12|224).toString(16).toUpperCase()+"%"+(h>>6&63|128).toString(16).toUpperCase()+"%"+(h&63|128).toString(16).toUpperCase(),b}function Ce(_){for(var h="",b=0,w=_.length;b<w;){var E=parseInt(_.substr(b+1,2),16);if(E<128)h+=String.fromCharCode(E),b+=3;else if(E>=194&&E<224){if(w-b>=6){var N=parseInt(_.substr(b+4,2),16);h+=String.fromCharCode((E&31)<<6|N&63)}else h+=_.substr(b,6);b+=6}else if(E>=224){if(w-b>=9){var K=parseInt(_.substr(b+4,2),16),ae=parseInt(_.substr(b+7,2),16);h+=String.fromCharCode((E&15)<<12|(K&63)<<6|ae&63)}else h+=_.substr(b,9);b+=9}else h+=_.substr(b,3),b+=3}return h}function wr(_,h){function b(w){var E=Ce(w);return E.match(h.UNRESERVED)?E:w}return _.scheme&&(_.scheme=String(_.scheme).replace(h.PCT_ENCODED,b).toLowerCase().replace(h.NOT_SCHEME,"")),_.userinfo!==void 0&&(_.userinfo=String(_.userinfo).replace(h.PCT_ENCODED,b).replace(h.NOT_USERINFO,Ee).replace(h.PCT_ENCODED,r)),_.host!==void 0&&(_.host=String(_.host).replace(h.PCT_ENCODED,b).toLowerCase().replace(h.NOT_HOST,Ee).replace(h.PCT_ENCODED,r)),_.path!==void 0&&(_.path=String(_.path).replace(h.PCT_ENCODED,b).replace(_.scheme?h.NOT_PATH:h.NOT_PATH_NOSCHEME,Ee).replace(h.PCT_ENCODED,r)),_.query!==void 0&&(_.query=String(_.query).replace(h.PCT_ENCODED,b).replace(h.NOT_QUERY,Ee).replace(h.PCT_ENCODED,r)),_.fragment!==void 0&&(_.fragment=String(_.fragment).replace(h.PCT_ENCODED,b).replace(h.NOT_FRAGMENT,Ee).replace(h.PCT_ENCODED,r)),_}function cr(_){return _.replace(/^0*(.*)/,"$1")||"0"}function _e(_,h){var b=_.match(h.IPV4ADDRESS)||[],w=f(b,2),E=w[1];return E?E.split(".").map(cr).join("."):_}function ve(_,h){var b=_.match(h.IPV6ADDRESS)||[],w=f(b,3),E=w[1],N=w[2];if(E){for(var K=E.toLowerCase().split("::").reverse(),ae=f(K,2),ie=ae[0],be=ae[1],te=be?be.split(":").map(cr):[],he=ie.split(":").map(cr),xe=h.IPV4ADDRESS.test(he[he.length-1]),de=xe?7:8,ne=he.length-de,pe=Array(de),ce=0;ce<de;++ce)pe[ce]=te[ce]||he[ne+ce]||"";xe&&(pe[de-1]=_e(pe[de-1],h));var Lr=pe.reduce(function(Ze,sr,Fr){if(!sr||sr==="0"){var dr=Ze[Ze.length-1];dr&&dr.index+dr.length===Fr?dr.length++:Ze.push({index:Fr,length:1})}return Ze},[]),Ue=Lr.sort(function(Ze,sr){return sr.length-Ze.length})[0],He=void 0;if(Ue&&Ue.length>1){var ue=pe.slice(0,Ue.index),ze=pe.slice(Ue.index+Ue.length);He=ue.join(":")+"::"+ze.join(":")}else He=pe.join(":");return N&&(He+="%"+N),He}else return _}var Dr=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,Te="".match(/(){0}/)[1]===void 0;function oe(_){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},b={},w=h.iri!==!1?c:u;h.reference==="suffix"&&(_=(h.scheme?h.scheme+":":"")+"//"+_);var E=_.match(Dr);if(E){Te?(b.scheme=E[1],b.userinfo=E[3],b.host=E[4],b.port=parseInt(E[5],10),b.path=E[6]||"",b.query=E[7],b.fragment=E[8],isNaN(b.port)&&(b.port=E[5])):(b.scheme=E[1]||void 0,b.userinfo=_.indexOf("@")!==-1?E[3]:void 0,b.host=_.indexOf("//")!==-1?E[4]:void 0,b.port=parseInt(E[5],10),b.path=E[6]||"",b.query=_.indexOf("?")!==-1?E[7]:void 0,b.fragment=_.indexOf("#")!==-1?E[8]:void 0,isNaN(b.port)&&(b.port=_.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?E[4]:void 0)),b.host&&(b.host=ve(_e(b.host,w),w)),b.scheme===void 0&&b.userinfo===void 0&&b.host===void 0&&b.port===void 0&&!b.path&&b.query===void 0?b.reference="same-document":b.scheme===void 0?b.reference="relative":b.fragment===void 0?b.reference="absolute":b.reference="uri",h.reference&&h.reference!=="suffix"&&h.reference!==b.reference&&(b.error=b.error||"URI is not a "+h.reference+" reference.");var N=ye[(h.scheme||b.scheme||"").toLowerCase()];if(!h.unicodeSupport&&(!N||!N.unicodeSupport)){if(b.host&&(h.domainHost||N&&N.domainHost))try{b.host=se.toASCII(b.host.replace(w.PCT_ENCODED,Ce).toLowerCase())}catch(K){b.error=b.error||"Host's domain name can not be converted to ASCII via punycode: "+K}wr(b,u)}else wr(b,w);N&&N.parse&&N.parse(b,h)}else b.error=b.error||"URI can not be parsed.";return b}function Er(_,h){var b=h.iri!==!1?c:u,w=[];return _.userinfo!==void 0&&(w.push(_.userinfo),w.push("@")),_.host!==void 0&&w.push(ve(_e(String(_.host),b),b).replace(b.IPV6ADDRESS,function(E,N,K){return"["+N+(K?"%25"+K:"")+"]"})),(typeof _.port=="number"||typeof _.port=="string")&&(w.push(":"),w.push(String(_.port))),w.length?w.join(""):void 0}var ur=/^\.\.?\//,jr=/^\/\.(\/|$)/,Nr=/^\/\.\.(\/|$)/,Se=/^\/?(?:.|\n)*?(?=\/|$)/;function Ve(_){for(var h=[];_.length;)if(_.match(ur))_=_.replace(ur,"");else if(_.match(jr))_=_.replace(jr,"/");else if(_.match(Nr))_=_.replace(Nr,"/"),h.pop();else if(_==="."||_==="..")_="";else{var b=_.match(Se);if(b){var w=b[0];_=_.slice(w.length),h.push(w)}else throw new Error("Unexpected dot segment condition")}return h.join("")}function Ne(_){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},b=h.iri?c:u,w=[],E=ye[(h.scheme||_.scheme||"").toLowerCase()];if(E&&E.serialize&&E.serialize(_,h),_.host&&!b.IPV6ADDRESS.test(_.host)){if(h.domainHost||E&&E.domainHost)try{_.host=h.iri?se.toUnicode(_.host):se.toASCII(_.host.replace(b.PCT_ENCODED,Ce).toLowerCase())}catch(ae){_.error=_.error||"Host's domain name can not be converted to "+(h.iri?"Unicode":"ASCII")+" via punycode: "+ae}}wr(_,b),h.reference!=="suffix"&&_.scheme&&(w.push(_.scheme),w.push(":"));var N=Er(_,h);if(N!==void 0&&(h.reference!=="suffix"&&w.push("//"),w.push(N),_.path&&_.path.charAt(0)!=="/"&&w.push("/")),_.path!==void 0){var K=_.path;!h.absolutePath&&(!E||!E.absolutePath)&&(K=Ve(K)),N===void 0&&(K=K.replace(/^\/\//,"/%2F")),w.push(K)}return _.query!==void 0&&(w.push("?"),w.push(_.query)),_.fragment!==void 0&&(w.push("#"),w.push(_.fragment)),w.join("")}function ke(_,h){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},w=arguments[3],E={};return w||(_=oe(Ne(_,b),b),h=oe(Ne(h,b),b)),b=b||{},!b.tolerant&&h.scheme?(E.scheme=h.scheme,E.userinfo=h.userinfo,E.host=h.host,E.port=h.port,E.path=Ve(h.path||""),E.query=h.query):(h.userinfo!==void 0||h.host!==void 0||h.port!==void 0?(E.userinfo=h.userinfo,E.host=h.host,E.port=h.port,E.path=Ve(h.path||""),E.query=h.query):(h.path?(h.path.charAt(0)==="/"?E.path=Ve(h.path):((_.userinfo!==void 0||_.host!==void 0||_.port!==void 0)&&!_.path?E.path="/"+h.path:_.path?E.path=_.path.slice(0,_.path.lastIndexOf("/")+1)+h.path:E.path=h.path,E.path=Ve(E.path)),E.query=h.query):(E.path=_.path,h.query!==void 0?E.query=h.query:E.query=_.query),E.userinfo=_.userinfo,E.host=_.host,E.port=_.port),E.scheme=_.scheme),E.fragment=h.fragment,E}function tr(_,h,b){var w=o({scheme:"null"},b);return Ne(ke(oe(_,w),oe(h,w),w,!0),w)}function qe(_,h){return typeof _=="string"?_=Ne(oe(_,h),h):s(_)==="object"&&(_=oe(Ne(_,h),h)),_}function oa(_,h,b){return typeof _=="string"?_=Ne(oe(_,b),b):s(_)==="object"&&(_=Ne(_,b)),typeof h=="string"?h=Ne(oe(h,b),b):s(h)==="object"&&(h=Ne(h,b)),_===h}function is(_,h){return _&&_.toString().replace(!h||!h.iri?u.ESCAPE:c.ESCAPE,Ee)}function We(_,h){return _&&_.toString().replace(!h||!h.iri?u.PCT_ENCODED:c.PCT_ENCODED,Ce)}var At={scheme:"http",domainHost:!0,parse:function(h,b){return h.host||(h.error=h.error||"HTTP URIs must have a host."),h},serialize:function(h,b){var w=String(h.scheme).toLowerCase()==="https";return(h.port===(w?443:80)||h.port==="")&&(h.port=void 0),h.path||(h.path="/"),h}},An={scheme:"https",domainHost:At.domainHost,parse:At.parse,serialize:At.serialize};function In(_){return typeof _.secure=="boolean"?_.secure:String(_.scheme).toLowerCase()==="wss"}var It={scheme:"ws",domainHost:!0,parse:function(h,b){var w=h;return w.secure=In(w),w.resourceName=(w.path||"/")+(w.query?"?"+w.query:""),w.path=void 0,w.query=void 0,w},serialize:function(h,b){if((h.port===(In(h)?443:80)||h.port==="")&&(h.port=void 0),typeof h.secure=="boolean"&&(h.scheme=h.secure?"wss":"ws",h.secure=void 0),h.resourceName){var w=h.resourceName.split("?"),E=f(w,2),N=E[0],K=E[1];h.path=N&&N!=="/"?N:void 0,h.query=K,h.resourceName=void 0}return h.fragment=void 0,h}},Cn={scheme:"wss",domainHost:It.domainHost,parse:It.parse,serialize:It.serialize},mu={},vu=!0,kn="[A-Za-z0-9\\-\\.\\_\\~"+(vu?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]",ar="[0-9A-Fa-f]",gu=t(t("%[EFef]"+ar+"%"+ar+ar+"%"+ar+ar)+"|"+t("%[89A-Fa-f]"+ar+"%"+ar+ar)+"|"+t("%"+ar+ar)),yu="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",_u="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",bu=e(_u,'[\\"\\\\]'),xu="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",wu=new RegExp(kn,"g"),ct=new RegExp(gu,"g"),Eu=new RegExp(e("[^]",yu,"[\\.]",'[\\"]',bu),"g"),Dn=new RegExp(e("[^]",kn,xu),"g"),Pu=Dn;function ls(_){var h=Ce(_);return h.match(wu)?h:_}var jn={scheme:"mailto",parse:function(h,b){var w=h,E=w.to=w.path?w.path.split(","):[];if(w.path=void 0,w.query){for(var N=!1,K={},ae=w.query.split("&"),ie=0,be=ae.length;ie<be;++ie){var te=ae[ie].split("=");switch(te[0]){case"to":for(var he=te[1].split(","),xe=0,de=he.length;xe<de;++xe)E.push(he[xe]);break;case"subject":w.subject=We(te[1],b);break;case"body":w.body=We(te[1],b);break;default:N=!0,K[We(te[0],b)]=We(te[1],b);break}}N&&(w.headers=K)}w.query=void 0;for(var ne=0,pe=E.length;ne<pe;++ne){var ce=E[ne].split("@");if(ce[0]=We(ce[0]),b.unicodeSupport)ce[1]=We(ce[1],b).toLowerCase();else try{ce[1]=se.toASCII(We(ce[1],b).toLowerCase())}catch(Lr){w.error=w.error||"Email address's domain name can not be converted to ASCII via punycode: "+Lr}E[ne]=ce.join("@")}return w},serialize:function(h,b){var w=h,E=n(h.to);if(E){for(var N=0,K=E.length;N<K;++N){var ae=String(E[N]),ie=ae.lastIndexOf("@"),be=ae.slice(0,ie).replace(ct,ls).replace(ct,r).replace(Eu,Ee),te=ae.slice(ie+1);try{te=b.iri?se.toUnicode(te):se.toASCII(We(te,b).toLowerCase())}catch(ne){w.error=w.error||"Email address's domain name can not be converted to "+(b.iri?"Unicode":"ASCII")+" via punycode: "+ne}E[N]=be+"@"+te}w.path=E.join(",")}var he=h.headers=h.headers||{};h.subject&&(he.subject=h.subject),h.body&&(he.body=h.body);var xe=[];for(var de in he)he[de]!==mu[de]&&xe.push(de.replace(ct,ls).replace(ct,r).replace(Dn,Ee)+"="+he[de].replace(ct,ls).replace(ct,r).replace(Pu,Ee));return xe.length&&(w.query=xe.join("&")),w}},Su=/^([^\:]+)\:(.*)/,Nn={scheme:"urn",parse:function(h,b){var w=h.path&&h.path.match(Su),E=h;if(w){var N=b.scheme||E.scheme||"urn",K=w[1].toLowerCase(),ae=w[2],ie=N+":"+(b.nid||K),be=ye[ie];E.nid=K,E.nss=ae,E.path=void 0,be&&(E=be.parse(E,b))}else E.error=E.error||"URN can not be parsed.";return E},serialize:function(h,b){var w=b.scheme||h.scheme||"urn",E=h.nid,N=w+":"+(b.nid||E),K=ye[N];K&&(h=K.serialize(h,b));var ae=h,ie=h.nss;return ae.path=(E||b.nid)+":"+ie,ae}},Ru=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Ln={scheme:"urn:uuid",parse:function(h,b){var w=h;return w.uuid=w.nss,w.nss=void 0,!b.tolerant&&(!w.uuid||!w.uuid.match(Ru))&&(w.error=w.error||"UUID is not valid."),w},serialize:function(h,b){var w=h;return w.nss=(h.uuid||"").toLowerCase(),w}};ye[At.scheme]=At,ye[An.scheme]=An,ye[It.scheme]=It,ye[Cn.scheme]=Cn,ye[jn.scheme]=jn,ye[Nn.scheme]=Nn,ye[Ln.scheme]=Ln,a.SCHEMES=ye,a.pctEncChar=Ee,a.pctDecChars=Ce,a.parse=oe,a.removeDotSegments=Ve,a.serialize=Ne,a.resolveComponents=ke,a.resolve=tr,a.normalize=qe,a.equal=oa,a.escapeComponent=is,a.unescapeComponent=We,Object.defineProperty(a,"__esModule",{value:!0})})});var Oa=z(($v,bo)=>{"use strict";bo.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 o=n[r];if(!a(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}});var wo=z((Av,xo)=>{"use strict";xo.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 st=z((Iv,So)=>{"use strict";So.exports={copy:Lf,checkDataType:ks,checkDataTypes:Ff,coerceToTypes:Mf,toHash:js,getProperty:Ns,escapeQuotes:Ls,equal:Oa(),ucs2length:wo(),varOccurences:zf,varReplace:Vf,schemaHasRules:Hf,schemaHasRulesExcept:Zf,schemaUnknownRules:Bf,toQuotedString:Ds,getPathExpr:Jf,getPath:Qf,getData:Wf,unescapeFragment:Yf,unescapeJsonPointer:Ms,escapeFragment:Xf,escapeJsonPointer:Fs};function Lf(a,e){e=e||{};for(var t in a)e[t]=a[t];return e}function ks(a,e,t,s){var r=s?" !== ":" === ",n=s?" || ":" && ",o=s?"!":"",i=s?"":"!";switch(a){case"null":return e+r+"null";case"array":return o+"Array.isArray("+e+")";case"object":return"("+o+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+o+"isFinite("+e+")":"")+")";case"number":return"(typeof "+e+r+'"'+a+'"'+(t?n+o+"isFinite("+e+")":"")+")";default:return"typeof "+e+r+'"'+a+'"'}}function Ff(a,e,t){switch(a.length){case 1:return ks(a[0],e,t,!0);default:var s="",r=js(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?" && ":"")+ks(n,e,t,!0);return s}}var Eo=js(["string","number","integer","boolean","null"]);function Mf(a,e){if(Array.isArray(e)){for(var t=[],s=0;s<e.length;s++){var r=e[s];(Eo[r]||a==="array"&&r==="array")&&(t[t.length]=r)}if(t.length)return t}else{if(Eo[e])return[e];if(a==="array"&&e==="array")return["array"]}}function js(a){for(var e={},t=0;t<a.length;t++)e[a[t]]=!0;return e}var qf=/^[a-z$_][a-z$_0-9]*$/i,Uf=/'|\\/g;function Ns(a){return typeof a=="number"?"["+a+"]":qf.test(a)?"."+a:"['"+Ls(a)+"']"}function Ls(a){return a.replace(Uf,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function zf(a,e){e+="[^0-9]";var t=a.match(new RegExp(e,"g"));return t?t.length:0}function Vf(a,e,t){return e+="([^0-9])",t=t.replace(/\$/g,"$$$$"),a.replace(new RegExp(e,"g"),t+"$1")}function Hf(a,e){if(typeof a=="boolean")return!a;for(var t in a)if(e[t])return!0}function Zf(a,e,t){if(typeof a=="boolean")return!a&&t!="not";for(var s in a)if(s!=t&&e[s])return!0}function Bf(a,e){if(typeof a!="boolean"){for(var t in a)if(!e[t])return t}}function Ds(a){return"'"+Ls(a)+"'"}function Jf(a,e,t,s){var r=t?"'/' + "+e+(s?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):s?"'[' + "+e+" + ']'":"'[\\'' + "+e+" + '\\']'";return Po(a,r)}function Qf(a,e,t){var s=Ds(t?"/"+Fs(e):Ns(e));return Po(a,s)}var Kf=/^\/(?:[^~]|~0|~1)*$/,Gf=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Wf(a,e,t){var s,r,n,o;if(a==="")return"rootData";if(a[0]=="/"){if(!Kf.test(a))throw new Error("Invalid JSON-pointer: "+a);r=a,n="rootData"}else{if(o=a.match(Gf),!o)throw new Error("Invalid JSON-pointer: "+a);if(s=+o[1],r=o[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,u=r.split("/"),c=0;c<u.length;c++){var f=u[c];f&&(n+=Ns(Ms(f)),i+=" && "+n)}return i}function Po(a,e){return a=='""'?e:(a+" + "+e).replace(/([^\\])' \+ '/g,"$1")}function Yf(a){return Ms(decodeURIComponent(a))}function Xf(a){return encodeURIComponent(Fs(a))}function Fs(a){return a.replace(/~/g,"~0").replace(/\//g,"~1")}function Ms(a){return a.replace(/~1/g,"/").replace(/~0/g,"~")}});var qs=z((Cv,Ro)=>{"use strict";var eh=st();Ro.exports=rh;function rh(a){eh.copy(a,this)}});var To=z((kv,Oo)=>{"use strict";var $r=Oo.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(){};Ta(e,s,r,a,"",a)};$r.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0};$r.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};$r.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};$r.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 Ta(a,e,t,s,r,n,o,i,u,c){if(s&&typeof s=="object"&&!Array.isArray(s)){e(s,r,n,o,i,u,c);for(var f in s){var p=s[f];if(Array.isArray(p)){if(f in $r.arrayKeywords)for(var g=0;g<p.length;g++)Ta(a,e,t,p[g],r+"/"+f+"/"+g,n,r,f,s,g)}else if(f in $r.propsKeywords){if(p&&typeof p=="object")for(var d in p)Ta(a,e,t,p[d],r+"/"+f+"/"+th(d),n,r,f,s,d)}else(f in $r.keywords||a.allKeys&&!(f in $r.skipKeywords))&&Ta(a,e,t,p,r+"/"+f,n,r,f,s)}t(s,r,n,o,i,u,c)}}function th(a){return a.replace(/~/g,"~0").replace(/\//g,"~1")}});var Da=z((Dv,Co)=>{"use strict";var Vt=_o(),$o=Oa(),Ca=st(),$a=qs(),ah=To();Co.exports=Ir;Ir.normalizeId=Ar;Ir.fullPath=Aa;Ir.url=Ia;Ir.ids=lh;Ir.inlineRef=Us;Ir.schema=ka;function Ir(a,e,t){var s=this._refs[t];if(typeof s=="string")if(this._refs[s])s=this._refs[s];else return Ir.call(this,a,e,s);if(s=s||this._schemas[t],s instanceof $a)return Us(s.schema,this._opts.inlineRefs)?s.schema:s.validate||this._compile(s);var r=ka.call(this,e,t),n,o,i;return r&&(n=r.schema,e=r.root,i=r.baseId),n instanceof $a?o=n.validate||a.call(this,n.schema,e,void 0,i):n!==void 0&&(o=Us(n,this._opts.inlineRefs)?n:a.call(this,n,e,void 0,i)),o}function ka(a,e){var t=Vt.parse(e),s=Io(t),r=Aa(this._getId(a.schema));if(Object.keys(a.schema).length===0||s!==r){var n=Ar(s),o=this._refs[n];if(typeof o=="string")return sh.call(this,a,o,t);if(o instanceof $a)o.validate||this._compile(o),a=o;else if(o=this._schemas[n],o instanceof $a){if(o.validate||this._compile(o),n==Ar(e))return{schema:o,root:a,baseId:r};a=o}else return;if(!a.schema)return;r=Aa(this._getId(a.schema))}return Ao.call(this,t,r,a.schema,a)}function sh(a,e,t){var s=ka.call(this,a,e);if(s){var r=s.schema,n=s.baseId;a=s.root;var o=this._getId(r);return o&&(n=Ia(n,o)),Ao.call(this,t,n,r,a)}}var nh=Ca.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function Ao(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 o=r[n];if(o){if(o=Ca.unescapeFragment(o),t=t[o],t===void 0)break;var i;if(!nh[o]&&(i=this._getId(t),i&&(e=Ia(e,i)),t.$ref)){var u=Ia(e,t.$ref),c=ka.call(this,s,u);c&&(t=c.schema,s=c.root,e=c.baseId)}}}if(t!==void 0&&t!==s.schema)return{schema:t,root:s,baseId:e}}}var oh=Ca.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function Us(a,e){if(e===!1)return!1;if(e===void 0||e===!0)return zs(a);if(e)return Vs(a)<=e}function zs(a){var e;if(Array.isArray(a)){for(var t=0;t<a.length;t++)if(e=a[t],typeof e=="object"&&!zs(e))return!1}else for(var s in a)if(s=="$ref"||(e=a[s],typeof e=="object"&&!zs(e)))return!1;return!0}function Vs(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+=Vs(t)),e==1/0)return 1/0}else for(var r in a){if(r=="$ref")return 1/0;if(oh[r])e++;else if(t=a[r],typeof t=="object"&&(e+=Vs(t)+1),e==1/0)return 1/0}return e}function Aa(a,e){e!==!1&&(a=Ar(a));var t=Vt.parse(a);return Io(t)}function Io(a){return Vt.serialize(a).split("#")[0]+"#"}var ih=/#\/?$/;function Ar(a){return a?a.replace(ih,""):""}function Ia(a,e){return e=Ar(e),Vt.resolve(a,e)}function lh(a){var e=Ar(this._getId(a)),t={"":e},s={"":Aa(e,!1)},r={},n=this;return ah(a,{allKeys:!0},function(o,i,u,c,f,p,g){if(i!==""){var d=n._getId(o),y=t[c],m=s[c]+"/"+f;if(g!==void 0&&(m+="/"+(typeof g=="number"?g:Ca.escapeFragment(g))),typeof d=="string"){d=y=Ar(y?Vt.resolve(y,d):d);var v=n._refs[d];if(typeof v=="string"&&(v=n._refs[v]),v&&v.schema){if(!$o(o,v.schema))throw new Error('id "'+d+'" resolves to more than one schema')}else if(d!=Ar(m))if(d[0]=="#"){if(r[d]&&!$o(o,r[d]))throw new Error('id "'+d+'" resolves to more than one schema');r[d]=o}else n._refs[d]=m}t[i]=y,s[i]=m}}),r}});var ja=z((jv,Do)=>{"use strict";var Hs=Da();Do.exports={Validation:ko(ch),MissingRef:ko(Zs)};function ch(a){this.message="validation failed",this.errors=a,this.ajv=this.validation=!0}Zs.message=function(a,e){return"can't resolve reference "+e+" from id "+a};function Zs(a,e,t){this.message=t||Zs.message(a,e),this.missingRef=Hs.url(a,e),this.missingSchema=Hs.normalizeId(Hs.fullPath(this.missingRef))}function ko(a){return a.prototype=Object.create(Error.prototype),a.prototype.constructor=a,a}});var Bs=z((Nv,jo)=>{"use strict";jo.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(o){return function(i,u){var c={key:i,value:o[i]},f={key:u,value:o[u]};return n(c,f)}}}(e.cmp),r=[];return function n(o){if(o&&o.toJSON&&typeof o.toJSON=="function"&&(o=o.toJSON()),o!==void 0){if(typeof o=="number")return isFinite(o)?""+o:"null";if(typeof o!="object")return JSON.stringify(o);var i,u;if(Array.isArray(o)){for(u="[",i=0;i<o.length;i++)i&&(u+=","),u+=n(o[i])||"null";return u+"]"}if(o===null)return"null";if(r.indexOf(o)!==-1){if(t)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var c=r.push(o)-1,f=Object.keys(o).sort(s&&s(o));for(u="",i=0;i<f.length;i++){var p=f[i],g=n(o[p]);g&&(u&&(u+=","),u+=JSON.stringify(p)+":"+g)}return r.splice(c,1),"{"+u+"}"}}(a)}});var Js=z((Lv,No)=>{"use strict";No.exports=function(e,t,s){var r="",n=e.schema.$async===!0,o=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),i=e.self._getId(e.schema);if(e.opts.strictKeywords){var u=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(u){var c="unknown keyword: "+u;if(e.opts.strictKeywords==="log")e.logger.warn(c);else throw new Error(c)}}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"||!(o||e.schema.$ref)){var t="false schema",f=e.level,p=e.dataLevel,g=e.schema[t],d=e.schemaPath+e.util.getProperty(t),y=e.errSchemaPath+"/"+t,A=!e.opts.allErrors,q,m="data"+(p||""),O="valid"+f;if(e.schema===!1){e.isTop?A=!0:r+=" var "+O+" = false; ";var v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(q||"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: "+m+" "),r+=" } "):r+=" {} ";var x=r;r=v.pop(),!e.compositeRule&&A?e.async?r+=" throw new ValidationError(["+x+"]); ":r+=" validate.errors = ["+x+"]; return false; ":r+=" var err = "+x+"; 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 "+O+" = true; ";return e.isTop&&(r+=" }; return validate; "),r}if(e.isTop){var S=e.isTop,f=e.level=0,p=e.dataLevel=0,m="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 P="default is ignored in the schema root";if(e.opts.strictDefaults==="log")e.logger.warn(P);else throw new Error(P)}r+=" var vErrors = null; ",r+=" var errors = 0; ",r+=" if (rootData === undefined) rootData = data; "}else{var f=e.level,p=e.dataLevel,m="data"+(p||"");if(i&&(e.baseId=e.resolve.url(e.baseId,i)),n&&!e.async)throw new Error("async schema in sync schema");r+=" var errs_"+f+" = errors;"}var O="valid"+f,A=!e.opts.allErrors,I="",H="",q,C=e.schema.type,U=Array.isArray(C);if(C&&e.opts.nullable&&e.schema.nullable===!0&&(U?C.indexOf("null")==-1&&(C=C.concat("null")):C!="null"&&(C=[C,"null"],U=!0)),U&&C.length==1&&(C=C[0],U=!1),e.schema.$ref&&o){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&&(o=!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")),C){if(e.opts.coerceTypes)var M=e.util.coerceToTypes(e.opts.coerceTypes,C);var L=e.RULES.types[C];if(M||U||L===!0||L&&!Se(L)){var d=e.schemaPath+".type",y=e.errSchemaPath+"/type",d=e.schemaPath+".type",y=e.errSchemaPath+"/type",$=U?"checkDataTypes":"checkDataType";if(r+=" if ("+e.util[$](C,m,e.opts.strictNumbers,!0)+") { ",M){var k="dataType"+f,F="coerced"+f;r+=" var "+k+" = typeof "+m+"; var "+F+" = undefined; ",e.opts.coerceTypes=="array"&&(r+=" if ("+k+" == 'object' && Array.isArray("+m+") && "+m+".length == 1) { "+m+" = "+m+"[0]; "+k+" = typeof "+m+"; if ("+e.util.checkDataType(e.schema.type,m,e.opts.strictNumbers)+") "+F+" = "+m+"; } "),r+=" if ("+F+" !== undefined) ; ";var le=M;if(le)for(var Y,re=-1,W=le.length-1;re<W;)Y=le[re+=1],Y=="string"?r+=" else if ("+k+" == 'number' || "+k+" == 'boolean') "+F+" = '' + "+m+"; else if ("+m+" === null) "+F+" = ''; ":Y=="number"||Y=="integer"?(r+=" else if ("+k+" == 'boolean' || "+m+" === null || ("+k+" == 'string' && "+m+" && "+m+" == +"+m+" ",Y=="integer"&&(r+=" && !("+m+" % 1)"),r+=")) "+F+" = +"+m+"; "):Y=="boolean"?r+=" else if ("+m+" === 'false' || "+m+" === 0 || "+m+" === null) "+F+" = false; else if ("+m+" === 'true' || "+m+" === 1) "+F+" = true; ":Y=="null"?r+=" else if ("+m+" === '' || "+m+" === 0 || "+m+" === false) "+F+" = null; ":e.opts.coerceTypes=="array"&&Y=="array"&&(r+=" else if ("+k+" == 'string' || "+k+" == 'number' || "+k+" == 'boolean' || "+m+" == null) "+F+" = ["+m+"]; ");r+=" else { ";var v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(q||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(y)+" , params: { type: '",U?r+=""+C.join(","):r+=""+C,r+="' } ",e.opts.messages!==!1&&(r+=" , message: 'should be ",U?r+=""+C.join(","):r+=""+C,r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var x=r;r=v.pop(),!e.compositeRule&&A?e.async?r+=" throw new ValidationError(["+x+"]); ":r+=" validate.errors = ["+x+"]; return false; ":r+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } if ("+F+" !== undefined) { ";var Z=p?"data"+(p-1||""):"parentData",me=p?e.dataPathArr[p]:"parentDataProperty";r+=" "+m+" = "+F+"; ",p||(r+="if ("+Z+" !== undefined)"),r+=" "+Z+"["+me+"] = "+F+"; } "}else{var v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(q||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(y)+" , params: { type: '",U?r+=""+C.join(","):r+=""+C,r+="' } ",e.opts.messages!==!1&&(r+=" , message: 'should be ",U?r+=""+C.join(","):r+=""+C,r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var x=r;r=v.pop(),!e.compositeRule&&A?e.async?r+=" throw new ValidationError(["+x+"]); ":r+=" validate.errors = ["+x+"]; return false; ":r+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}r+=" } "}}if(e.schema.$ref&&!o)r+=" "+e.RULES.all.$ref.code(e,"$ref")+" ",A&&(r+=" } if (errors === ",S?r+="0":r+="errs_"+f,r+=") { ",H+="}");else{var Oe=e.RULES;if(Oe){for(var L,Ie=-1,se=Oe.length-1;Ie<se;)if(L=Oe[Ie+=1],Se(L)){if(L.type&&(r+=" if ("+e.util.checkDataType(L.type,m,e.opts.strictNumbers)+") { "),e.opts.useDefaults){if(L.type=="object"&&e.schema.properties){var g=e.schema.properties,ye=Object.keys(g),Ee=ye;if(Ee)for(var Ce,wr=-1,cr=Ee.length-1;wr<cr;){Ce=Ee[wr+=1];var _e=g[Ce];if(_e.default!==void 0){var ve=m+e.util.getProperty(Ce);if(e.compositeRule){if(e.opts.strictDefaults){var P="default is ignored for: "+ve;if(e.opts.strictDefaults==="log")e.logger.warn(P);else throw new Error(P)}}else r+=" if ("+ve+" === undefined ",e.opts.useDefaults=="empty"&&(r+=" || "+ve+" === null || "+ve+" === '' "),r+=" ) "+ve+" = ",e.opts.useDefaults=="shared"?r+=" "+e.useDefault(_e.default)+" ":r+=" "+JSON.stringify(_e.default)+" ",r+="; "}}}else if(L.type=="array"&&Array.isArray(e.schema.items)){var Dr=e.schema.items;if(Dr){for(var _e,re=-1,Te=Dr.length-1;re<Te;)if(_e=Dr[re+=1],_e.default!==void 0){var ve=m+"["+re+"]";if(e.compositeRule){if(e.opts.strictDefaults){var P="default is ignored for: "+ve;if(e.opts.strictDefaults==="log")e.logger.warn(P);else throw new Error(P)}}else r+=" if ("+ve+" === undefined ",e.opts.useDefaults=="empty"&&(r+=" || "+ve+" === null || "+ve+" === '' "),r+=" ) "+ve+" = ",e.opts.useDefaults=="shared"?r+=" "+e.useDefault(_e.default)+" ":r+=" "+JSON.stringify(_e.default)+" ",r+="; "}}}}var oe=L.rules;if(oe){for(var Er,ur=-1,jr=oe.length-1;ur<jr;)if(Er=oe[ur+=1],Ve(Er)){var Nr=Er.code(e,Er.keyword,L.type);Nr&&(r+=" "+Nr+" ",A&&(I+="}"))}}if(A&&(r+=" "+I+" ",I=""),L.type&&(r+=" } ",C&&C===L.type&&!M)){r+=" else { ";var d=e.schemaPath+".type",y=e.errSchemaPath+"/type",v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(q||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(y)+" , params: { type: '",U?r+=""+C.join(","):r+=""+C,r+="' } ",e.opts.messages!==!1&&(r+=" , message: 'should be ",U?r+=""+C.join(","):r+=""+C,r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var x=r;r=v.pop(),!e.compositeRule&&A?e.async?r+=" throw new ValidationError(["+x+"]); ":r+=" validate.errors = ["+x+"]; return false; ":r+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } "}A&&(r+=" if (errors === ",S?r+="0":r+="errs_"+f,r+=") { ",H+="}")}}}A&&(r+=" "+H+" "),S?(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 "+O+" = errors === errs_"+f+";";function Se(ke){for(var tr=ke.rules,qe=0;qe<tr.length;qe++)if(Ve(tr[qe]))return!0}function Ve(ke){return e.schema[ke.keyword]!==void 0||ke.implements&&Ne(ke)}function Ne(ke){for(var tr=ke.implements,qe=0;qe<tr.length;qe++)if(e.schema[tr[qe]]!==void 0)return!0}return r}});var Uo=z((Fv,qo)=>{"use strict";var Na=Da(),Fa=st(),Fo=ja(),uh=Bs(),Lo=Js(),dh=Fa.ucs2length,fh=Oa(),hh=Fo.Validation;qo.exports=Qs;function Qs(a,e,t,s){var r=this,n=this._opts,o=[void 0],i={},u=[],c={},f=[],p={},g=[];e=e||{schema:a,refVal:o,refs:i};var d=ph.call(this,a,e,s),y=this._compilations[d.index];if(d.compiling)return y.callValidate=P;var m=this._formats,v=this.RULES;try{var x=O(a,e,t,s);y.validate=x;var S=y.callValidate;return S&&(S.schema=x.schema,S.errors=null,S.refs=x.refs,S.refVal=x.refVal,S.root=x.root,S.$async=x.$async,n.sourceCode&&(S.source=x.source)),x}finally{mh.call(this,a,e,s)}function P(){var $=y.validate,k=$.apply(this,arguments);return P.errors=$.errors,k}function O($,k,F,le){var Y=!k||k&&k.schema==$;if(k.schema!=e.schema)return Qs.call(r,$,k,F,le);var re=$.$async===!0,W=Lo({isTop:!0,schema:$,isRoot:Y,baseId:le,root:k,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:Fo.MissingRef,RULES:v,validate:Lo,util:Fa,resolve:Na,resolveRef:A,usePattern:U,useDefault:M,useCustomRule:L,opts:n,formats:m,logger:r.logger,self:r});W=La(o,yh)+La(u,vh)+La(f,gh)+La(g,_h)+W,n.processCode&&(W=n.processCode(W,$));var Z;try{var me=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",W);Z=me(r,v,m,e,o,f,g,fh,dh,hh),o[0]=Z}catch(Oe){throw r.logger.error("Error compiling schema, function code:",W),Oe}return Z.schema=$,Z.errors=null,Z.refs=i,Z.refVal=o,Z.root=Y?Z:k,re&&(Z.$async=!0),n.sourceCode===!0&&(Z.source={code:W,patterns:u,defaults:f}),Z}function A($,k,F){k=Na.url($,k);var le=i[k],Y,re;if(le!==void 0)return Y=o[le],re="refVal["+le+"]",C(Y,re);if(!F&&e.refs){var W=e.refs[k];if(W!==void 0)return Y=e.refVal[W],re=I(k,Y),C(Y,re)}re=I(k);var Z=Na.call(r,O,e,k);if(Z===void 0){var me=t&&t[k];me&&(Z=Na.inlineRef(me,n.inlineRefs)?me:Qs.call(r,me,e,t,$))}if(Z===void 0)H(k);else return q(k,Z),C(Z,re)}function I($,k){var F=o.length;return o[F]=k,i[$]=F,"refVal"+F}function H($){delete i[$]}function q($,k){var F=i[$];o[F]=k}function C($,k){return typeof $=="object"||typeof $=="boolean"?{code:k,schema:$,inline:!0}:{code:k,$async:$&&!!$.$async}}function U($){var k=c[$];return k===void 0&&(k=c[$]=u.length,u[k]=$),"pattern"+k}function M($){switch(typeof $){case"boolean":case"number":return""+$;case"string":return Fa.toQuotedString($);case"object":if($===null)return"null";var k=uh($),F=p[k];return F===void 0&&(F=p[k]=f.length,f[F]=$),"default"+F}}function L($,k,F,le){if(r._opts.validateSchema!==!1){var Y=$.definition.dependencies;if(Y&&!Y.every(function(Ee){return Object.prototype.hasOwnProperty.call(F,Ee)}))throw new Error("parent schema must have all required keywords: "+Y.join(","));var re=$.definition.validateSchema;if(re){var W=re(k);if(!W){var Z="keyword schema is invalid: "+r.errorsText(re.errors);if(r._opts.validateSchema=="log")r.logger.error(Z);else throw new Error(Z)}}}var me=$.definition.compile,Oe=$.definition.inline,Ie=$.definition.macro,se;if(me)se=me.call(r,k,F,le);else if(Ie)se=Ie.call(r,k,F,le),n.validateSchema!==!1&&r.validateSchema(se,!0);else if(Oe)se=Oe.call(r,le,$.keyword,k,F);else if(se=$.definition.validate,!se)return;if(se===void 0)throw new Error('custom keyword "'+$.keyword+'"failed to compile');var ye=g.length;return g[ye]=se,{code:"customRule"+ye,validate:se}}}function ph(a,e,t){var s=Mo.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 mh(a,e,t){var s=Mo.call(this,a,e,t);s>=0&&this._compilations.splice(s,1)}function Mo(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 vh(a,e){return"var pattern"+a+" = new RegExp("+Fa.toQuotedString(e[a])+");"}function gh(a){return"var default"+a+" = defaults["+a+"];"}function yh(a,e){return e[a]===void 0?"":"var refVal"+a+" = refVal["+a+"];"}function _h(a){return"var customRule"+a+" = customRules["+a+"];"}function La(a,e){if(!a.length)return"";for(var t="",s=0;s<a.length;s++)t+=e(s,a);return t}});var Vo=z((Mv,zo)=>{"use strict";var Ma=zo.exports=function(){this._cache={}};Ma.prototype.put=function(e,t){this._cache[e]=t};Ma.prototype.get=function(e){return this._cache[e]};Ma.prototype.del=function(e){delete this._cache[e]};Ma.prototype.clear=function(){this._cache={}}});var ri=z((qv,ei)=>{"use strict";var bh=st(),xh=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,wh=[0,31,28,31,30,31,30,31,31,30,31,30,31],Eh=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,Ho=/^(?=.{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,Ph=/^(?:[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,Sh=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,Zo=/^(?:(?:[^\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,Bo=/^(?:(?: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,Jo=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,Qo=/^(?:\/(?:[^~/]|~0|~1)*)*$/,Ko=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,Go=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;ei.exports=qa;function qa(a){return a=a=="full"?"full":"fast",bh.copy(qa[a])}qa.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":Zo,url:Bo,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:Ho,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:Xo,uuid:Jo,"json-pointer":Qo,"json-pointer-uri-fragment":Ko,"relative-json-pointer":Go};qa.full={date:Wo,time:Yo,"date-time":Th,uri:Ah,"uri-reference":Sh,"uri-template":Zo,url:Bo,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:Ho,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:Xo,uuid:Jo,"json-pointer":Qo,"json-pointer-uri-fragment":Ko,"relative-json-pointer":Go};function Rh(a){return a%4===0&&(a%100!==0||a%400===0)}function Wo(a){var e=a.match(xh);if(!e)return!1;var t=+e[1],s=+e[2],r=+e[3];return s>=1&&s<=12&&r>=1&&r<=(s==2&&Rh(t)?29:wh[s])}function Yo(a,e){var t=a.match(Eh);if(!t)return!1;var s=t[1],r=t[2],n=t[3],o=t[5];return(s<=23&&r<=59&&n<=59||s==23&&r==59&&n==60)&&(!e||o)}var Oh=/t|\s/i;function Th(a){var e=a.split(Oh);return e.length==2&&Wo(e[0])&&Yo(e[1],!0)}var $h=/\/|:/;function Ah(a){return $h.test(a)&&Ph.test(a)}var Ih=/[^\\]\\Z/;function Xo(a){if(Ih.test(a))return!1;try{return new RegExp(a),!0}catch{return!1}}});var ai=z((Uv,ti)=>{"use strict";ti.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),p="valid"+n,g,d;if(i=="#"||i=="#/")e.isRoot?(g=e.async,d="validate"):(g=e.root.schema.$async===!0,d="root.refVal[0]");else{var y=e.resolveRef(e.baseId,i,e.isRoot);if(y===void 0){var m=e.MissingRefError.message(e.baseId,i);if(e.opts.missingRefs=="fail"){e.logger.error(m);var v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , 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: "+f+" "),r+=" } "):r+=" {} ";var x=r;r=v.pop(),!e.compositeRule&&c?e.async?r+=" throw new ValidationError(["+x+"]); ":r+=" validate.errors = ["+x+"]; return false; ":r+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c&&(r+=" if (false) { ")}else if(e.opts.missingRefs=="ignore")e.logger.warn(m),c&&(r+=" if (true) { ");else throw new e.MissingRefError(e.baseId,i,m)}else if(y.inline){var S=e.util.copy(e);S.level++;var P="valid"+S.level;S.schema=y.schema,S.schemaPath="",S.errSchemaPath=i;var O=e.validate(S).replace(/validate\.schema/g,y.code);r+=" "+O+" ",c&&(r+=" if ("+P+") { ")}else g=y.$async===!0||e.async&&y.$async!==!1,d=y.code}if(d){var v=v||[];v.push(r),r="",e.opts.passContext?r+=" "+d+".call(this, ":r+=" "+d+"( ",r+=" "+f+", (dataPath || '')",e.errorPath!='""'&&(r+=" + "+e.errorPath);var A=o?"data"+(o-1||""):"parentData",I=o?e.dataPathArr[o]:"parentDataProperty";r+=" , "+A+" , "+I+", rootData) ";var H=r;if(r=v.pop(),g){if(!e.async)throw new Error("async schema referenced by sync schema");c&&(r+=" var "+p+"; "),r+=" try { await "+H+"; ",c&&(r+=" "+p+" = 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; ",c&&(r+=" "+p+" = false; "),r+=" } ",c&&(r+=" if ("+p+") { ")}else r+=" if (!"+H+") { if (vErrors === null) vErrors = "+d+".errors; else vErrors = vErrors.concat("+d+".errors); errors = vErrors.length; } ",c&&(r+=" else { ")}return r}});var ni=z((zv,si)=>{"use strict";si.exports=function(e,t,s){var r=" ",n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),i=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c=e.util.copy(e),f="";c.level++;var p="valid"+c.level,g=c.baseId,d=!0,y=n;if(y)for(var m,v=-1,x=y.length-1;v<x;)m=y[v+=1],(e.opts.strictKeywords?typeof m=="object"&&Object.keys(m).length>0||m===!1:e.util.schemaHasRules(m,e.RULES.all))&&(d=!1,c.schema=m,c.schemaPath=o+"["+v+"]",c.errSchemaPath=i+"/"+v,r+=" "+e.validate(c)+" ",c.baseId=g,u&&(r+=" if ("+p+") { ",f+="}"));return u&&(d?r+=" if (true) { ":r+=" "+f.slice(0,-1)+" "),r}});var ii=z((Vv,oi)=>{"use strict";oi.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),g="valid"+n,d="errs__"+n,y=e.util.copy(e),m="";y.level++;var v="valid"+y.level,x=i.every(function(q){return e.opts.strictKeywords?typeof q=="object"&&Object.keys(q).length>0||q===!1:e.util.schemaHasRules(q,e.RULES.all)});if(x){var S=y.baseId;r+=" var "+d+" = errors; var "+g+" = false; ";var P=e.compositeRule;e.compositeRule=y.compositeRule=!0;var O=i;if(O)for(var A,I=-1,H=O.length-1;I<H;)A=O[I+=1],y.schema=A,y.schemaPath=u+"["+I+"]",y.errSchemaPath=c+"/"+I,r+=" "+e.validate(y)+" ",y.baseId=S,r+=" "+g+" = "+g+" || "+v+"; if (!"+g+") { ",m+="}";e.compositeRule=y.compositeRule=P,r+=" "+m+" if (!"+g+") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'should match some schema in anyOf' "),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&f&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+=" } else { errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } ",e.opts.allErrors&&(r+=" } ")}else f&&(r+=" if (true) { ");return r}});var ci=z((Hv,li)=>{"use strict";li.exports=function(e,t,s){var r=" ",n=e.schema[t],o=e.errSchemaPath+"/"+t,i=!e.opts.allErrors,u=e.util.toQuotedString(n);return e.opts.$comment===!0?r+=" console.log("+u+");":typeof e.opts.$comment=="function"&&(r+=" self._opts.$comment("+u+", "+e.util.toQuotedString(o)+", validate.root.schema);"),r}});var di=z((Zv,ui)=>{"use strict";ui.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),g="valid"+n,d=e.opts.$data&&i&&i.$data,y;d?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",y="schema"+n):y=i,d||(r+=" var schema"+n+" = validate.schema"+u+";"),r+="var "+g+" = equal("+p+", schema"+n+"); if (!"+g+") { ";var m=m||[];m.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { allowedValue: schema"+n+" } ",e.opts.messages!==!1&&(r+=" , message: 'should be equal to constant' "),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var v=r;return r=m.pop(),!e.compositeRule&&f?e.async?r+=" throw new ValidationError(["+v+"]); ":r+=" validate.errors = ["+v+"]; return false; ":r+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" }",f&&(r+=" else { "),r}});var hi=z((Bv,fi)=>{"use strict";fi.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),g="valid"+n,d="errs__"+n,y=e.util.copy(e),m="";y.level++;var v="valid"+y.level,x="i"+n,S=y.dataLevel=e.dataLevel+1,P="data"+S,O=e.baseId,A=e.opts.strictKeywords?typeof i=="object"&&Object.keys(i).length>0||i===!1:e.util.schemaHasRules(i,e.RULES.all);if(r+="var "+d+" = errors;var "+g+";",A){var I=e.compositeRule;e.compositeRule=y.compositeRule=!0,y.schema=i,y.schemaPath=u,y.errSchemaPath=c,r+=" var "+v+" = false; for (var "+x+" = 0; "+x+" < "+p+".length; "+x+"++) { ",y.errorPath=e.util.getPathExpr(e.errorPath,x,e.opts.jsonPointers,!0);var H=p+"["+x+"]";y.dataPathArr[S]=x;var q=e.validate(y);y.baseId=O,e.util.varOccurences(q,P)<2?r+=" "+e.util.varReplace(q,P,H)+" ":r+=" var "+P+" = "+H+"; "+q+" ",r+=" if ("+v+") break; } ",e.compositeRule=y.compositeRule=I,r+=" "+m+" if (!"+v+") {"}else r+=" if ("+p+".length == 0) {";var C=C||[];C.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'should contain a valid item' "),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var U=r;return r=C.pop(),!e.compositeRule&&f?e.async?r+=" throw new ValidationError(["+U+"]); ":r+=" validate.errors = ["+U+"]; return false; ":r+=" var err = "+U+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { ",A&&(r+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } "),e.opts.allErrors&&(r+=" } "),r}});var mi=z((Jv,pi)=>{"use strict";pi.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),g="errs__"+n,d=e.util.copy(e),y="";d.level++;var m="valid"+d.level,v={},x={},S=e.opts.ownProperties;for(I in i)if(I!="__proto__"){var P=i[I],O=Array.isArray(P)?x:v;O[I]=P}r+="var "+g+" = errors;";var A=e.errorPath;r+="var missing"+n+";";for(var I in x)if(O=x[I],O.length){if(r+=" if ( "+p+e.util.getProperty(I)+" !== undefined ",S&&(r+=" && Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(I)+"') "),f){r+=" && ( ";var H=O;if(H)for(var q,C=-1,U=H.length-1;C<U;){q=H[C+=1],C&&(r+=" || ");var M=e.util.getProperty(q),L=p+M;r+=" ( ( "+L+" === undefined ",S&&(r+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(q)+"') "),r+=") && (missing"+n+" = "+e.util.toQuotedString(e.opts.jsonPointers?q:M)+") ) "}r+=")) { ";var $="missing"+n,k="' + "+$+" + '";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(c)+" , params: { property: '"+e.util.escapeQuotes(I)+"', missingProperty: '"+k+"', depsCount: "+O.length+", deps: '"+e.util.escapeQuotes(O.length==1?O[0]:O.join(", "))+"' } ",e.opts.messages!==!1&&(r+=" , message: 'should have ",O.length==1?r+="property "+e.util.escapeQuotes(O[0]):r+="properties "+e.util.escapeQuotes(O.join(", ")),r+=" when property "+e.util.escapeQuotes(I)+" is present' "),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var le=r;r=F.pop(),!e.compositeRule&&f?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=O;if(Y)for(var q,re=-1,W=Y.length-1;re<W;){q=Y[re+=1];var M=e.util.getProperty(q),k=e.util.escapeQuotes(q),L=p+M;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(A,q,e.opts.jsonPointers)),r+=" if ( "+L+" === undefined ",S&&(r+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(q)+"') "),r+=") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { property: '"+e.util.escapeQuotes(I)+"', missingProperty: '"+k+"', depsCount: "+O.length+", deps: '"+e.util.escapeQuotes(O.length==1?O[0]:O.join(", "))+"' } ",e.opts.messages!==!1&&(r+=" , message: 'should have ",O.length==1?r+="property "+e.util.escapeQuotes(O[0]):r+="properties "+e.util.escapeQuotes(O.join(", ")),r+=" when property "+e.util.escapeQuotes(I)+" is present' "),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}r+=" } ",f&&(y+="}",r+=" else { ")}e.errorPath=A;var Z=d.baseId;for(var I in v){var P=v[I];(e.opts.strictKeywords?typeof P=="object"&&Object.keys(P).length>0||P===!1:e.util.schemaHasRules(P,e.RULES.all))&&(r+=" "+m+" = true; if ( "+p+e.util.getProperty(I)+" !== undefined ",S&&(r+=" && Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(I)+"') "),r+=") { ",d.schema=P,d.schemaPath=u+e.util.getProperty(I),d.errSchemaPath=c+"/"+e.util.escapeFragment(I),r+=" "+e.validate(d)+" ",d.baseId=Z,r+=" } ",f&&(r+=" if ("+m+") { ",y+="}"))}return f&&(r+=" "+y+" if ("+g+" == errors) {"),r}});var gi=z((Qv,vi)=>{"use strict";vi.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),g="valid"+n,d=e.opts.$data&&i&&i.$data,y;d?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",y="schema"+n):y=i;var m="i"+n,v="schema"+n;d||(r+=" var "+v+" = validate.schema"+u+";"),r+="var "+g+";",d&&(r+=" if (schema"+n+" === undefined) "+g+" = true; else if (!Array.isArray(schema"+n+")) "+g+" = false; else {"),r+=""+g+" = false;for (var "+m+"=0; "+m+"<"+v+".length; "+m+"++) if (equal("+p+", "+v+"["+m+"])) { "+g+" = true; break; }",d&&(r+=" } "),r+=" if (!"+g+") { ";var x=x||[];x.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , 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"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var S=r;return r=x.pop(),!e.compositeRule&&f?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+=" }",f&&(r+=" else { "),r}});var _i=z((Kv,yi)=>{"use strict";yi.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||"");if(e.opts.format===!1)return f&&(r+=" if (true) { "),r;var g=e.opts.$data&&i&&i.$data,d;g?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",d="schema"+n):d=i;var y=e.opts.unknownFormats,m=Array.isArray(y);if(g){var v="format"+n,x="isObject"+n,S="formatType"+n;r+=" var "+v+" = formats["+d+"]; var "+x+" = typeof "+v+" == 'object' && !("+v+" instanceof RegExp) && "+v+".validate; var "+S+" = "+x+" && "+v+".type || 'string'; if ("+x+") { ",e.async&&(r+=" var async"+n+" = "+v+".async; "),r+=" "+v+" = "+v+".validate; } if ( ",g&&(r+=" ("+d+" !== undefined && typeof "+d+" != 'string') || "),r+=" (",y!="ignore"&&(r+=" ("+d+" && !"+v+" ",m&&(r+=" && self._opts.unknownFormats.indexOf("+d+") == -1 "),r+=") || "),r+=" ("+v+" && "+S+" == '"+s+"' && !(typeof "+v+" == 'function' ? ",e.async?r+=" (async"+n+" ? await "+v+"("+p+") : "+v+"("+p+")) ":r+=" "+v+"("+p+") ",r+=" : "+v+".test("+p+"))))) {"}else{var v=e.formats[i];if(!v){if(y=="ignore")return e.logger.warn('unknown format "'+i+'" ignored in schema at path "'+e.errSchemaPath+'"'),f&&(r+=" if (true) { "),r;if(m&&y.indexOf(i)>=0)return f&&(r+=" if (true) { "),r;throw new Error('unknown format "'+i+'" is used in schema at path "'+e.errSchemaPath+'"')}var x=typeof v=="object"&&!(v instanceof RegExp)&&v.validate,S=x&&v.type||"string";if(x){var P=v.async===!0;v=v.validate}if(S!=s)return f&&(r+=" if (true) { "),r;if(P){if(!e.async)throw new Error("async format in sync schema");var O="formats"+e.util.getProperty(i)+".validate";r+=" if (!(await "+O+"("+p+"))) { "}else{r+=" if (! ";var O="formats"+e.util.getProperty(i);x&&(O+=".validate"),typeof v=="function"?r+=" "+O+"("+p+") ":r+=" "+O+".test("+p+") ",r+=") { "}}var A=A||[];A.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { format: ",g?r+=""+d:r+=""+e.util.toQuotedString(i),r+=" } ",e.opts.messages!==!1&&(r+=` , message: 'should match format "`,g?r+="' + "+d+" + '":r+=""+e.util.escapeQuotes(i),r+=`"' `),e.opts.verbose&&(r+=" , schema: ",g?r+="validate.schema"+u:r+=""+e.util.toQuotedString(i),r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var I=r;return r=A.pop(),!e.compositeRule&&f?e.async?r+=" throw new ValidationError(["+I+"]); ":r+=" validate.errors = ["+I+"]; return false; ":r+=" var err = "+I+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",f&&(r+=" else { "),r}});var xi=z((Gv,bi)=>{"use strict";bi.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),g="valid"+n,d="errs__"+n,y=e.util.copy(e);y.level++;var m="valid"+y.level,v=e.schema.then,x=e.schema.else,S=v!==void 0&&(e.opts.strictKeywords?typeof v=="object"&&Object.keys(v).length>0||v===!1:e.util.schemaHasRules(v,e.RULES.all)),P=x!==void 0&&(e.opts.strictKeywords?typeof x=="object"&&Object.keys(x).length>0||x===!1:e.util.schemaHasRules(x,e.RULES.all)),O=y.baseId;if(S||P){var A;y.createErrors=!1,y.schema=i,y.schemaPath=u,y.errSchemaPath=c,r+=" var "+d+" = errors; var "+g+" = true; ";var I=e.compositeRule;e.compositeRule=y.compositeRule=!0,r+=" "+e.validate(y)+" ",y.baseId=O,y.createErrors=!0,r+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } ",e.compositeRule=y.compositeRule=I,S?(r+=" if ("+m+") { ",y.schema=e.schema.then,y.schemaPath=e.schemaPath+".then",y.errSchemaPath=e.errSchemaPath+"/then",r+=" "+e.validate(y)+" ",y.baseId=O,r+=" "+g+" = "+m+"; ",S&&P?(A="ifClause"+n,r+=" var "+A+" = 'then'; "):A="'then'",r+=" } ",P&&(r+=" else { ")):r+=" if (!"+m+") { ",P&&(y.schema=e.schema.else,y.schemaPath=e.schemaPath+".else",y.errSchemaPath=e.errSchemaPath+"/else",r+=" "+e.validate(y)+" ",y.baseId=O,r+=" "+g+" = "+m+"; ",S&&P?(A="ifClause"+n,r+=" var "+A+" = 'else'; "):A="'else'",r+=" } "),r+=" if (!"+g+") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { failingKeyword: "+A+" } ",e.opts.messages!==!1&&(r+=` , message: 'should match "' + `+A+` + '" schema' `),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&f&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+=" } ",f&&(r+=" else { ")}else f&&(r+=" if (true) { ");return r}});var Ei=z((Wv,wi)=>{"use strict";wi.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),g="valid"+n,d="errs__"+n,y=e.util.copy(e),m="";y.level++;var v="valid"+y.level,x="i"+n,S=y.dataLevel=e.dataLevel+1,P="data"+S,O=e.baseId;if(r+="var "+d+" = errors;var "+g+";",Array.isArray(i)){var A=e.schema.additionalItems;if(A===!1){r+=" "+g+" = "+p+".length <= "+i.length+"; ";var I=c;c=e.errSchemaPath+"/additionalItems",r+=" if (!"+g+") { ";var H=H||[];H.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , 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: "+p+" "),r+=" } "):r+=" {} ";var q=r;r=H.pop(),!e.compositeRule&&f?e.async?r+=" throw new ValidationError(["+q+"]); ":r+=" validate.errors = ["+q+"]; return false; ":r+=" var err = "+q+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",c=I,f&&(m+="}",r+=" else { ")}var C=i;if(C){for(var U,M=-1,L=C.length-1;M<L;)if(U=C[M+=1],e.opts.strictKeywords?typeof U=="object"&&Object.keys(U).length>0||U===!1:e.util.schemaHasRules(U,e.RULES.all)){r+=" "+v+" = true; if ("+p+".length > "+M+") { ";var $=p+"["+M+"]";y.schema=U,y.schemaPath=u+"["+M+"]",y.errSchemaPath=c+"/"+M,y.errorPath=e.util.getPathExpr(e.errorPath,M,e.opts.jsonPointers,!0),y.dataPathArr[S]=M;var k=e.validate(y);y.baseId=O,e.util.varOccurences(k,P)<2?r+=" "+e.util.varReplace(k,P,$)+" ":r+=" var "+P+" = "+$+"; "+k+" ",r+=" } ",f&&(r+=" if ("+v+") { ",m+="}")}}if(typeof A=="object"&&(e.opts.strictKeywords?typeof A=="object"&&Object.keys(A).length>0||A===!1:e.util.schemaHasRules(A,e.RULES.all))){y.schema=A,y.schemaPath=e.schemaPath+".additionalItems",y.errSchemaPath=e.errSchemaPath+"/additionalItems",r+=" "+v+" = true; if ("+p+".length > "+i.length+") { for (var "+x+" = "+i.length+"; "+x+" < "+p+".length; "+x+"++) { ",y.errorPath=e.util.getPathExpr(e.errorPath,x,e.opts.jsonPointers,!0);var $=p+"["+x+"]";y.dataPathArr[S]=x;var k=e.validate(y);y.baseId=O,e.util.varOccurences(k,P)<2?r+=" "+e.util.varReplace(k,P,$)+" ":r+=" var "+P+" = "+$+"; "+k+" ",f&&(r+=" if (!"+v+") break; "),r+=" } } ",f&&(r+=" if ("+v+") { ",m+="}")}}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=u,y.errSchemaPath=c,r+=" for (var "+x+" = 0; "+x+" < "+p+".length; "+x+"++) { ",y.errorPath=e.util.getPathExpr(e.errorPath,x,e.opts.jsonPointers,!0);var $=p+"["+x+"]";y.dataPathArr[S]=x;var k=e.validate(y);y.baseId=O,e.util.varOccurences(k,P)<2?r+=" "+e.util.varReplace(k,P,$)+" ":r+=" var "+P+" = "+$+"; "+k+" ",f&&(r+=" if (!"+v+") break; "),r+=" }"}return f&&(r+=" "+m+" if ("+d+" == errors) {"),r}});var Ks=z((Yv,Pi)=>{"use strict";Pi.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,O,p="data"+(o||""),g=e.opts.$data&&i&&i.$data,d;g?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",d="schema"+n):d=i;var y=t=="maximum",m=y?"exclusiveMaximum":"exclusiveMinimum",v=e.schema[m],x=e.opts.$data&&v&&v.$data,S=y?"<":">",P=y?">":"<",O=void 0;if(!(g||typeof i=="number"||i===void 0))throw new Error(t+" must be number");if(!(x||v===void 0||typeof v=="number"||typeof v=="boolean"))throw new Error(m+" must be number or boolean");if(x){var A=e.util.getData(v.$data,o,e.dataPathArr),I="exclusive"+n,H="exclType"+n,q="exclIsNumber"+n,C="op"+n,U="' + "+C+" + '";r+=" var schemaExcl"+n+" = "+A+"; ",A="schemaExcl"+n,r+=" var "+I+"; var "+H+" = typeof "+A+"; if ("+H+" != 'boolean' && "+H+" != 'undefined' && "+H+" != 'number') { ";var O=m,M=M||[];M.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(O||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: '"+m+" should be boolean' "),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var L=r;r=M.pop(),!e.compositeRule&&f?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 ( ",g&&(r+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),r+=" "+H+" == 'number' ? ( ("+I+" = "+d+" === undefined || "+A+" "+S+"= "+d+") ? "+p+" "+P+"= "+A+" : "+p+" "+P+" "+d+" ) : ( ("+I+" = "+A+" === true) ? "+p+" "+P+"= "+d+" : "+p+" "+P+" "+d+" ) || "+p+" !== "+p+") { var op"+n+" = "+I+" ? '"+S+"' : '"+S+"='; ",i===void 0&&(O=m,c=e.errSchemaPath+"/"+m,d=A,g=x)}else{var q=typeof v=="number",U=S;if(q&&g){var C="'"+U+"'";r+=" if ( ",g&&(r+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),r+=" ( "+d+" === undefined || "+v+" "+S+"= "+d+" ? "+p+" "+P+"= "+v+" : "+p+" "+P+" "+d+" ) || "+p+" !== "+p+") { "}else{q&&i===void 0?(I=!0,O=m,c=e.errSchemaPath+"/"+m,d=v,P+="="):(q&&(d=Math[y?"min":"max"](v,i)),v===(q?d:!0)?(I=!0,O=m,c=e.errSchemaPath+"/"+m,P+="="):(I=!1,U+="="));var C="'"+U+"'";r+=" if ( ",g&&(r+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),r+=" "+p+" "+P+" "+d+" || "+p+" !== "+p+") { "}}O=O||t;var M=M||[];M.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(O||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { comparison: "+C+", limit: "+d+", exclusive: "+I+" } ",e.opts.messages!==!1&&(r+=" , message: 'should be "+U+" ",g?r+="' + "+d:r+=""+d+"'"),e.opts.verbose&&(r+=" , schema: ",g?r+="validate.schema"+u:r+=""+i,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var L=r;return r=M.pop(),!e.compositeRule&&f?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+=" } ",f&&(r+=" else { "),r}});var Gs=z((Xv,Si)=>{"use strict";Si.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,m,p="data"+(o||""),g=e.opts.$data&&i&&i.$data,d;if(g?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",d="schema"+n):d=i,!(g||typeof i=="number"))throw new Error(t+" must be number");var y=t=="maxItems"?">":"<";r+="if ( ",g&&(r+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),r+=" "+p+".length "+y+" "+d+") { ";var m=t,v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(m||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+d+" } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT have ",t=="maxItems"?r+="more":r+="fewer",r+=" than ",g?r+="' + "+d+" + '":r+=""+i,r+=" items' "),e.opts.verbose&&(r+=" , schema: ",g?r+="validate.schema"+u:r+=""+i,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var x=r;return r=v.pop(),!e.compositeRule&&f?e.async?r+=" throw new ValidationError(["+x+"]); ":r+=" validate.errors = ["+x+"]; return false; ":r+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",f&&(r+=" else { "),r}});var Ws=z((eg,Ri)=>{"use strict";Ri.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,m,p="data"+(o||""),g=e.opts.$data&&i&&i.$data,d;if(g?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",d="schema"+n):d=i,!(g||typeof i=="number"))throw new Error(t+" must be number");var y=t=="maxLength"?">":"<";r+="if ( ",g&&(r+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),e.opts.unicode===!1?r+=" "+p+".length ":r+=" ucs2length("+p+") ",r+=" "+y+" "+d+") { ";var m=t,v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(m||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+d+" } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT be ",t=="maxLength"?r+="longer":r+="shorter",r+=" than ",g?r+="' + "+d+" + '":r+=""+i,r+=" characters' "),e.opts.verbose&&(r+=" , schema: ",g?r+="validate.schema"+u:r+=""+i,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var x=r;return r=v.pop(),!e.compositeRule&&f?e.async?r+=" throw new ValidationError(["+x+"]); ":r+=" validate.errors = ["+x+"]; return false; ":r+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",f&&(r+=" else { "),r}});var Ys=z((rg,Oi)=>{"use strict";Oi.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,m,p="data"+(o||""),g=e.opts.$data&&i&&i.$data,d;if(g?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",d="schema"+n):d=i,!(g||typeof i=="number"))throw new Error(t+" must be number");var y=t=="maxProperties"?">":"<";r+="if ( ",g&&(r+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),r+=" Object.keys("+p+").length "+y+" "+d+") { ";var m=t,v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(m||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+d+" } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT have ",t=="maxProperties"?r+="more":r+="fewer",r+=" than ",g?r+="' + "+d+" + '":r+=""+i,r+=" properties' "),e.opts.verbose&&(r+=" , schema: ",g?r+="validate.schema"+u:r+=""+i,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var x=r;return r=v.pop(),!e.compositeRule&&f?e.async?r+=" throw new ValidationError(["+x+"]); ":r+=" validate.errors = ["+x+"]; return false; ":r+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",f&&(r+=" else { "),r}});var $i=z((tg,Ti)=>{"use strict";Ti.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),g=e.opts.$data&&i&&i.$data,d;if(g?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",d="schema"+n):d=i,!(g||typeof i=="number"))throw new Error(t+" must be number");r+="var division"+n+";if (",g&&(r+=" "+d+" !== undefined && ( typeof "+d+" != 'number' || "),r+=" (division"+n+" = "+p+" / "+d+", ",e.opts.multipleOfPrecision?r+=" Math.abs(Math.round(division"+n+") - division"+n+") > 1e-"+e.opts.multipleOfPrecision+" ":r+=" division"+n+" !== parseInt(division"+n+") ",r+=" ) ",g&&(r+=" ) "),r+=" ) { ";var y=y||[];y.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { multipleOf: "+d+" } ",e.opts.messages!==!1&&(r+=" , message: 'should be multiple of ",g?r+="' + "+d:r+=""+d+"'"),e.opts.verbose&&(r+=" , schema: ",g?r+="validate.schema"+u:r+=""+i,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var m=r;return r=y.pop(),!e.compositeRule&&f?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&&(r+=" else { "),r}});var Ii=z((ag,Ai)=>{"use strict";Ai.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),g="errs__"+n,d=e.util.copy(e);d.level++;var y="valid"+d.level;if(e.opts.strictKeywords?typeof i=="object"&&Object.keys(i).length>0||i===!1:e.util.schemaHasRules(i,e.RULES.all)){d.schema=i,d.schemaPath=u,d.errSchemaPath=c,r+=" var "+g+" = errors; ";var m=e.compositeRule;e.compositeRule=d.compositeRule=!0,d.createErrors=!1;var v;d.opts.allErrors&&(v=d.opts.allErrors,d.opts.allErrors=!1),r+=" "+e.validate(d)+" ",d.createErrors=!0,v&&(d.opts.allErrors=v),e.compositeRule=d.compositeRule=m,r+=" if ("+y+") { ";var x=x||[];x.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'should NOT be valid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var S=r;r=x.pop(),!e.compositeRule&&f?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+=" } else { errors = "+g+"; if (vErrors !== null) { if ("+g+") vErrors.length = "+g+"; 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(c)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'should NOT be valid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",f&&(r+=" if (false) { ");return r}});var ki=z((sg,Ci)=>{"use strict";Ci.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),g="valid"+n,d="errs__"+n,y=e.util.copy(e),m="";y.level++;var v="valid"+y.level,x=y.baseId,S="prevValid"+n,P="passingSchemas"+n;r+="var "+d+" = errors , "+S+" = false , "+g+" = false , "+P+" = null; ";var O=e.compositeRule;e.compositeRule=y.compositeRule=!0;var A=i;if(A)for(var I,H=-1,q=A.length-1;H<q;)I=A[H+=1],(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=u+"["+H+"]",y.errSchemaPath=c+"/"+H,r+=" "+e.validate(y)+" ",y.baseId=x):r+=" var "+v+" = true; ",H&&(r+=" if ("+v+" && "+S+") { "+g+" = false; "+P+" = ["+P+", "+H+"]; } else { ",m+="}"),r+=" if ("+v+") { "+g+" = "+S+" = true; "+P+" = "+H+"; }";return e.compositeRule=y.compositeRule=O,r+=""+m+"if (!"+g+") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { passingSchemas: "+P+" } ",e.opts.messages!==!1&&(r+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&f&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+="} else { errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; }",e.opts.allErrors&&(r+=" } "),r}});var ji=z((ng,Di)=>{"use strict";Di.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),g=e.opts.$data&&i&&i.$data,d;g?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",d="schema"+n):d=i;var y=g?"(new RegExp("+d+"))":e.usePattern(i);r+="if ( ",g&&(r+=" ("+d+" !== undefined && typeof "+d+" != 'string') || "),r+=" !"+y+".test("+p+") ) { ";var m=m||[];m.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { pattern: ",g?r+=""+d:r+=""+e.util.toQuotedString(i),r+=" } ",e.opts.messages!==!1&&(r+=` , message: 'should match pattern "`,g?r+="' + "+d+" + '":r+=""+e.util.escapeQuotes(i),r+=`"' `),e.opts.verbose&&(r+=" , schema: ",g?r+="validate.schema"+u:r+=""+e.util.toQuotedString(i),r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var v=r;return r=m.pop(),!e.compositeRule&&f?e.async?r+=" throw new ValidationError(["+v+"]); ":r+=" validate.errors = ["+v+"]; return false; ":r+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",f&&(r+=" else { "),r}});var Li=z((og,Ni)=>{"use strict";Ni.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),g="errs__"+n,d=e.util.copy(e),y="";d.level++;var m="valid"+d.level,v="key"+n,x="idx"+n,S=d.dataLevel=e.dataLevel+1,P="data"+S,O="dataProperties"+n,A=Object.keys(i||{}).filter(re),I=e.schema.patternProperties||{},H=Object.keys(I).filter(re),q=e.schema.additionalProperties,C=A.length||H.length,U=q===!1,M=typeof q=="object"&&Object.keys(q).length,L=e.opts.removeAdditional,$=U||M||L,k=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 "+g+" = errors;var "+m+" = true;",k&&(r+=" var "+O+" = undefined;"),$){if(k?r+=" "+O+" = "+O+" || Object.keys("+p+"); for (var "+x+"=0; "+x+"<"+O+".length; "+x+"++) { var "+v+" = "+O+"["+x+"]; ":r+=" for (var "+v+" in "+p+") { ",C){if(r+=" var isAdditional"+n+" = !(false ",A.length)if(A.length>8)r+=" || validate.schema"+u+".hasOwnProperty("+v+") ";else{var W=A;if(W)for(var Z,me=-1,Oe=W.length-1;me<Oe;)Z=W[me+=1],r+=" || "+v+" == "+e.util.toQuotedString(Z)+" "}if(H.length){var Ie=H;if(Ie)for(var se,ye=-1,Ee=Ie.length-1;ye<Ee;)se=Ie[ye+=1],r+=" || "+e.usePattern(se)+".test("+v+") "}r+=" ); if (isAdditional"+n+") { "}if(L=="all")r+=" delete "+p+"["+v+"]; ";else{var Ce=e.errorPath,wr="' + "+v+" + '";if(e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers)),U)if(L)r+=" delete "+p+"["+v+"]; ";else{r+=" "+m+" = false; ";var cr=c;c=e.errSchemaPath+"/additionalProperties";var _e=_e||[];_e.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { additionalProperty: '"+wr+"' } ",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: "+p+" "),r+=" } "):r+=" {} ";var ve=r;r=_e.pop(),!e.compositeRule&&f?e.async?r+=" throw new ValidationError(["+ve+"]); ":r+=" validate.errors = ["+ve+"]; return false; ":r+=" var err = "+ve+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c=cr,f&&(r+=" break; ")}else if(M)if(L=="failing"){r+=" var "+g+" = errors; ";var Dr=e.compositeRule;e.compositeRule=d.compositeRule=!0,d.schema=q,d.schemaPath=e.schemaPath+".additionalProperties",d.errSchemaPath=e.errSchemaPath+"/additionalProperties",d.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers);var Te=p+"["+v+"]";d.dataPathArr[S]=v;var oe=e.validate(d);d.baseId=F,e.util.varOccurences(oe,P)<2?r+=" "+e.util.varReplace(oe,P,Te)+" ":r+=" var "+P+" = "+Te+"; "+oe+" ",r+=" if (!"+m+") { errors = "+g+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+p+"["+v+"]; } ",e.compositeRule=d.compositeRule=Dr}else{d.schema=q,d.schemaPath=e.schemaPath+".additionalProperties",d.errSchemaPath=e.errSchemaPath+"/additionalProperties",d.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers);var Te=p+"["+v+"]";d.dataPathArr[S]=v;var oe=e.validate(d);d.baseId=F,e.util.varOccurences(oe,P)<2?r+=" "+e.util.varReplace(oe,P,Te)+" ":r+=" var "+P+" = "+Te+"; "+oe+" ",f&&(r+=" if (!"+m+") break; ")}e.errorPath=Ce}C&&(r+=" } "),r+=" } ",f&&(r+=" if ("+m+") { ",y+="}")}var Er=e.opts.useDefaults&&!e.compositeRule;if(A.length){var ur=A;if(ur)for(var Z,jr=-1,Nr=ur.length-1;jr<Nr;){Z=ur[jr+=1];var Se=i[Z];if(e.opts.strictKeywords?typeof Se=="object"&&Object.keys(Se).length>0||Se===!1:e.util.schemaHasRules(Se,e.RULES.all)){var Ve=e.util.getProperty(Z),Te=p+Ve,Ne=Er&&Se.default!==void 0;d.schema=Se,d.schemaPath=u+Ve,d.errSchemaPath=c+"/"+e.util.escapeFragment(Z),d.errorPath=e.util.getPath(e.errorPath,Z,e.opts.jsonPointers),d.dataPathArr[S]=e.util.toQuotedString(Z);var oe=e.validate(d);if(d.baseId=F,e.util.varOccurences(oe,P)<2){oe=e.util.varReplace(oe,P,Te);var ke=Te}else{var ke=P;r+=" var "+P+" = "+Te+"; "}if(Ne)r+=" "+oe+" ";else{if(Y&&Y[Z]){r+=" if ( "+ke+" === undefined ",k&&(r+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(Z)+"') "),r+=") { "+m+" = false; ";var Ce=e.errorPath,cr=c,tr=e.util.escapeQuotes(Z);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(Ce,Z,e.opts.jsonPointers)),c=e.errSchemaPath+"/required";var _e=_e||[];_e.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+tr+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+tr+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var ve=r;r=_e.pop(),!e.compositeRule&&f?e.async?r+=" throw new ValidationError(["+ve+"]); ":r+=" validate.errors = ["+ve+"]; return false; ":r+=" var err = "+ve+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c=cr,e.errorPath=Ce,r+=" } else { "}else f?(r+=" if ( "+ke+" === undefined ",k&&(r+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(Z)+"') "),r+=") { "+m+" = true; } else { "):(r+=" if ("+ke+" !== undefined ",k&&(r+=" && Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(Z)+"') "),r+=" ) { ");r+=" "+oe+" } "}}f&&(r+=" if ("+m+") { ",y+="}")}}if(H.length){var qe=H;if(qe)for(var se,oa=-1,is=qe.length-1;oa<is;){se=qe[oa+=1];var Se=I[se];if(e.opts.strictKeywords?typeof Se=="object"&&Object.keys(Se).length>0||Se===!1:e.util.schemaHasRules(Se,e.RULES.all)){d.schema=Se,d.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(se),d.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(se),k?r+=" "+O+" = "+O+" || Object.keys("+p+"); for (var "+x+"=0; "+x+"<"+O+".length; "+x+"++) { var "+v+" = "+O+"["+x+"]; ":r+=" for (var "+v+" in "+p+") { ",r+=" if ("+e.usePattern(se)+".test("+v+")) { ",d.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers);var Te=p+"["+v+"]";d.dataPathArr[S]=v;var oe=e.validate(d);d.baseId=F,e.util.varOccurences(oe,P)<2?r+=" "+e.util.varReplace(oe,P,Te)+" ":r+=" var "+P+" = "+Te+"; "+oe+" ",f&&(r+=" if (!"+m+") break; "),r+=" } ",f&&(r+=" else "+m+" = true; "),r+=" } ",f&&(r+=" if ("+m+") { ",y+="}")}}}return f&&(r+=" "+y+" if ("+g+" == errors) {"),r}});var Mi=z((ig,Fi)=>{"use strict";Fi.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),g="errs__"+n,d=e.util.copy(e),y="";d.level++;var m="valid"+d.level;if(r+="var "+g+" = errors;",e.opts.strictKeywords?typeof i=="object"&&Object.keys(i).length>0||i===!1:e.util.schemaHasRules(i,e.RULES.all)){d.schema=i,d.schemaPath=u,d.errSchemaPath=c;var v="key"+n,x="idx"+n,S="i"+n,P="' + "+v+" + '",O=d.dataLevel=e.dataLevel+1,A="data"+O,I="dataProperties"+n,H=e.opts.ownProperties,q=e.baseId;H&&(r+=" var "+I+" = undefined; "),H?r+=" "+I+" = "+I+" || Object.keys("+p+"); for (var "+x+"=0; "+x+"<"+I+".length; "+x+"++) { var "+v+" = "+I+"["+x+"]; ":r+=" for (var "+v+" in "+p+") { ",r+=" var startErrs"+n+" = errors; ";var C=v,U=e.compositeRule;e.compositeRule=d.compositeRule=!0;var M=e.validate(d);d.baseId=q,e.util.varOccurences(M,A)<2?r+=" "+e.util.varReplace(M,A,C)+" ":r+=" var "+A+" = "+C+"; "+M+" ",e.compositeRule=d.compositeRule=U,r+=" if (!"+m+") { for (var "+S+"=startErrs"+n+"; "+S+"<errors; "+S+"++) { vErrors["+S+"].propertyName = "+v+"; } var err = ",e.createErrors!==!1?(r+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { propertyName: '"+P+"' } ",e.opts.messages!==!1&&(r+=" , message: 'property name \\'"+P+"\\' is invalid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&f&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),f&&(r+=" break; "),r+=" } }"}return f&&(r+=" "+y+" if ("+g+" == errors) {"),r}});var Ui=z((lg,qi)=>{"use strict";qi.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),g="valid"+n,d=e.opts.$data&&i&&i.$data,y;d?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",y="schema"+n):y=i;var m="schema"+n;if(!d)if(i.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var v=[],x=i;if(x)for(var S,P=-1,O=x.length-1;P<O;){S=x[P+=1];var A=e.schema.properties[S];A&&(e.opts.strictKeywords?typeof A=="object"&&Object.keys(A).length>0||A===!1:e.util.schemaHasRules(A,e.RULES.all))||(v[v.length]=S)}}else var v=i;if(d||v.length){var I=e.errorPath,H=d||v.length>=e.opts.loopRequired,q=e.opts.ownProperties;if(f)if(r+=" var missing"+n+"; ",H){d||(r+=" var "+m+" = validate.schema"+u+"; ");var C="i"+n,U="schema"+n+"["+C+"]",M="' + "+U+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(I,U,e.opts.jsonPointers)),r+=" var "+g+" = true; ",d&&(r+=" if (schema"+n+" === undefined) "+g+" = true; else if (!Array.isArray(schema"+n+")) "+g+" = false; else {"),r+=" for (var "+C+" = 0; "+C+" < "+m+".length; "+C+"++) { "+g+" = "+p+"["+m+"["+C+"]] !== undefined ",q&&(r+=" && Object.prototype.hasOwnProperty.call("+p+", "+m+"["+C+"]) "),r+="; if (!"+g+") break; } ",d&&(r+=" } "),r+=" if (!"+g+") { ";var L=L||[];L.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+M+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+M+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var $=r;r=L.pop(),!e.compositeRule&&f?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+=" } else { "}else{r+=" if ( ";var k=v;if(k)for(var F,C=-1,le=k.length-1;C<le;){F=k[C+=1],C&&(r+=" || ");var Y=e.util.getProperty(F),re=p+Y;r+=" ( ( "+re+" === undefined ",q&&(r+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(F)+"') "),r+=") && (missing"+n+" = "+e.util.toQuotedString(e.opts.jsonPointers?F:Y)+") ) "}r+=") { ";var U="missing"+n,M="' + "+U+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(I,U,!0):I+" + "+U);var L=L||[];L.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+M+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+M+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var $=r;r=L.pop(),!e.compositeRule&&f?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+=" } else { "}else if(H){d||(r+=" var "+m+" = validate.schema"+u+"; ");var C="i"+n,U="schema"+n+"["+C+"]",M="' + "+U+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(I,U,e.opts.jsonPointers)),d&&(r+=" if ("+m+" && !Array.isArray("+m+")) { var err = ",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+M+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+M+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+m+" !== undefined) { "),r+=" for (var "+C+" = 0; "+C+" < "+m+".length; "+C+"++) { if ("+p+"["+m+"["+C+"]] === undefined ",q&&(r+=" || ! Object.prototype.hasOwnProperty.call("+p+", "+m+"["+C+"]) "),r+=") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+M+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+M+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",d&&(r+=" } ")}else{var W=v;if(W)for(var F,Z=-1,me=W.length-1;Z<me;){F=W[Z+=1];var Y=e.util.getProperty(F),M=e.util.escapeQuotes(F),re=p+Y;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(I,F,e.opts.jsonPointers)),r+=" if ( "+re+" === undefined ",q&&(r+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(F)+"') "),r+=") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+M+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+M+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=I}else f&&(r+=" if (true) {");return r}});var Vi=z((cg,zi)=>{"use strict";zi.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),g="valid"+n,d=e.opts.$data&&i&&i.$data,y;if(d?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",y="schema"+n):y=i,(i||d)&&e.opts.uniqueItems!==!1){d&&(r+=" var "+g+"; if ("+y+" === false || "+y+" === undefined) "+g+" = true; else if (typeof "+y+" != 'boolean') "+g+" = false; else { "),r+=" var i = "+p+".length , "+g+" = true , j; if (i > 1) { ";var m=e.schema.items&&e.schema.items.type,v=Array.isArray(m);if(!m||m=="object"||m=="array"||v&&(m.indexOf("object")>=0||m.indexOf("array")>=0))r+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+p+"[i], "+p+"[j])) { "+g+" = false; break outer; } } } ";else{r+=" var itemIndices = {}, item; for (;i--;) { var item = "+p+"[i]; ";var x="checkDataType"+(v?"s":"");r+=" if ("+e.util[x](m,"item",e.opts.strictNumbers,!0)+") continue; ",v&&(r+=` if (typeof item == 'string') item = '"' + item; `),r+=" if (typeof itemIndices[item] == 'number') { "+g+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}r+=" } ",d&&(r+=" } "),r+=" if (!"+g+") { ";var S=S||[];S.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , 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: ",d?r+="validate.schema"+u:r+=""+i,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var P=r;r=S.pop(),!e.compositeRule&&f?e.async?r+=" throw new ValidationError(["+P+"]); ":r+=" validate.errors = ["+P+"]; return false; ":r+=" var err = "+P+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",f&&(r+=" else { ")}else f&&(r+=" if (true) { ");return r}});var Zi=z((ug,Hi)=>{"use strict";Hi.exports={$ref:ai(),allOf:ni(),anyOf:ii(),$comment:ci(),const:di(),contains:hi(),dependencies:mi(),enum:gi(),format:_i(),if:xi(),items:Ei(),maximum:Ks(),minimum:Ks(),maxItems:Gs(),minItems:Gs(),maxLength:Ws(),minLength:Ws(),maxProperties:Ys(),minProperties:Ys(),multipleOf:$i(),not:Ii(),oneOf:ki(),pattern:ji(),properties:Li(),propertyNames:Mi(),required:Ui(),uniqueItems:Vi(),validate:Js()}});var Qi=z((dg,Ji)=>{"use strict";var Bi=Zi(),Xs=st().toHash;Ji.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=Xs(t),e.types=Xs(r),e.forEach(function(n){n.rules=n.rules.map(function(o){var i;if(typeof o=="object"){var u=Object.keys(o)[0];i=o[u],o=u,i.forEach(function(f){t.push(f),e.all[f]=!0})}t.push(o);var c=e.all[o]={keyword:o,code:Bi[o],implements:i};return c}),e.all.$comment={keyword:"$comment",code:Bi.$comment},n.type&&(e.types[n.type]=n)}),e.keywords=Xs(t.concat(s)),e.custom={},e}});var Wi=z((fg,Gi)=>{"use strict";var Ki=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];Gi.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<Ki.length;n++){var o=Ki[n],i=r[o];i&&(r[o]={anyOf:[i,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]})}}return a}});var el=z((hg,Xi)=>{"use strict";var Ch=ja().MissingRef;Xi.exports=Yi;function Yi(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||o(i)});return t&&r.then(function(i){t(null,i)},t),r;function n(i){var u=i.$schema;return u&&!s.getSchema(u)?Yi.call(s,{$ref:u},!0):Promise.resolve()}function o(i){try{return s._compile(i)}catch(c){if(c instanceof Ch)return u(c);throw c}function u(c){var f=c.missingSchema;if(d(f))throw new Error("Schema "+f+" is loaded but "+c.missingRef+" cannot be resolved");var p=s._loadingSchemas[f];return p||(p=s._loadingSchemas[f]=s._opts.loadSchema(f),p.then(g,g)),p.then(function(y){if(!d(f))return n(y).then(function(){d(f)||s.addSchema(y,f,void 0,e)})}).then(function(){return o(i)});function g(){delete s._loadingSchemas[f]}function d(y){return s._refs[y]||s._schemas[y]}}}}});var tl=z((pg,rl)=>{"use strict";rl.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p,g="data"+(o||""),d="valid"+n,y="errs__"+n,m=e.opts.$data&&i&&i.$data,v;m?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",v="schema"+n):v=i;var x=this,S="definition"+n,P=x.definition,O="",A,I,H,q,C;if(m&&P.$data){C="keywordValidate"+n;var U=P.validateSchema;r+=" var "+S+" = RULES.custom['"+t+"'].definition; var "+C+" = "+S+".validate;"}else{if(q=e.useCustomRule(x,i,e.schema,e),!q)return;v="validate.schema"+u,C=q.code,A=P.compile,I=P.inline,H=P.macro}var M=C+".errors",L="i"+n,$="ruleErr"+n,k=P.async;if(k&&!e.async)throw new Error("async keyword in sync schema");if(I||H||(r+=""+M+" = null;"),r+="var "+y+" = errors;var "+d+";",m&&P.$data&&(O+="}",r+=" if ("+v+" === undefined) { "+d+" = true; } else { ",U&&(O+="}",r+=" "+d+" = "+S+".validateSchema("+v+"); if ("+d+") { ")),I)P.statements?r+=" "+q.validate+" ":r+=" "+d+" = "+q.validate+"; ";else if(H){var F=e.util.copy(e),O="";F.level++;var le="valid"+F.level;F.schema=q.validate,F.schemaPath="";var Y=e.compositeRule;e.compositeRule=F.compositeRule=!0;var re=e.validate(F).replace(/validate\.schema/g,C);e.compositeRule=F.compositeRule=Y,r+=" "+re}else{var W=W||[];W.push(r),r="",r+=" "+C+".call( ",e.opts.passContext?r+="this":r+="self",A||P.schema===!1?r+=" , "+g+" ":r+=" , "+v+" , "+g+" , validate.schema"+e.schemaPath+" ",r+=" , (dataPath || '')",e.errorPath!='""'&&(r+=" + "+e.errorPath);var Z=o?"data"+(o-1||""):"parentData",me=o?e.dataPathArr[o]:"parentDataProperty";r+=" , "+Z+" , "+me+" , rootData ) ";var Oe=r;r=W.pop(),P.errors===!1?(r+=" "+d+" = ",k&&(r+="await "),r+=""+Oe+"; "):k?(M="customErrors"+n,r+=" var "+M+" = null; try { "+d+" = await "+Oe+"; } catch (e) { "+d+" = false; if (e instanceof ValidationError) "+M+" = e.errors; else throw e; } "):r+=" "+M+" = null; "+d+" = "+Oe+"; "}if(P.modifying&&(r+=" if ("+Z+") "+g+" = "+Z+"["+me+"];"),r+=""+O,P.valid)f&&(r+=" if (true) { ");else{r+=" if ( ",P.valid===void 0?(r+=" !",H?r+=""+le:r+=""+d):r+=" "+!P.valid+" ",r+=") { ",p=x.keyword;var W=W||[];W.push(r),r="";var W=W||[];W.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(p||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { keyword: '"+x.keyword+"' } ",e.opts.messages!==!1&&(r+=` , message: 'should pass "`+x.keyword+`" keyword validation' `),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+g+" "),r+=" } "):r+=" {} ";var Ie=r;r=W.pop(),!e.compositeRule&&f?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(),I?P.errors?P.errors!="full"&&(r+=" for (var "+L+"="+y+"; "+L+"<errors; "+L+"++) { var "+$+" = vErrors["+L+"]; if ("+$+".dataPath === undefined) "+$+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+$+".schemaPath === undefined) { "+$+'.schemaPath = "'+c+'"; } ',e.opts.verbose&&(r+=" "+$+".schema = "+v+"; "+$+".data = "+g+"; "),r+=" } "):P.errors===!1?r+=" "+se+" ":(r+=" if ("+y+" == errors) { "+se+" } else { for (var "+L+"="+y+"; "+L+"<errors; "+L+"++) { var "+$+" = vErrors["+L+"]; if ("+$+".dataPath === undefined) "+$+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+$+".schemaPath === undefined) { "+$+'.schemaPath = "'+c+'"; } ',e.opts.verbose&&(r+=" "+$+".schema = "+v+"; "+$+".data = "+g+"; "),r+=" } } "):H?(r+=" var err = ",e.createErrors!==!1?(r+=" { keyword: '"+(p||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { keyword: '"+x.keyword+"' } ",e.opts.messages!==!1&&(r+=` , message: 'should pass "`+x.keyword+`" keyword validation' `),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+g+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&f&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; ")):P.errors===!1?r+=" "+se+" ":(r+=" if (Array.isArray("+M+")) { if (vErrors === null) vErrors = "+M+"; else vErrors = vErrors.concat("+M+"); errors = vErrors.length; for (var "+L+"="+y+"; "+L+"<errors; "+L+"++) { var "+$+" = vErrors["+L+"]; if ("+$+".dataPath === undefined) "+$+".dataPath = (dataPath || '') + "+e.errorPath+"; "+$+'.schemaPath = "'+c+'"; ',e.opts.verbose&&(r+=" "+$+".schema = "+v+"; "+$+".data = "+g+"; "),r+=" } } else { "+se+" } "),r+=" } ",f&&(r+=" else { ")}return r}});var en=z((mg,kh)=>{kh.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 nl=z((vg,sl)=>{"use strict";var al=en();sl.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:al.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:al.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 il=z((gg,ol)=>{"use strict";var Dh=/^[a-z_$][a-z0-9_$-]*$/i,jh=tl(),Nh=nl();ol.exports={add:Lh,get:Fh,remove:Mh,validate:rn};function Lh(a,e){var t=this.RULES;if(t.keywords[a])throw new Error("Keyword "+a+" is already defined");if(!Dh.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++)o(a,s[r],e);else o(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 o(i,u,c){for(var f,p=0;p<t.length;p++){var g=t[p];if(g.type==u){f=g;break}}f||(f={type:u,rules:[]},t.push(f));var d={keyword:i,definition:c,custom:!0,code:jh,implements:c.implements};f.rules.push(d),t.custom[i]=d}return this}function Fh(a){var e=this.RULES.custom[a];return e?e.definition:this.RULES.keywords[a]||!1}function Mh(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 rn(a,e){rn.errors=null;var t=this._validateKeyword=this._validateKeyword||this.compile(Nh,!0);if(t(a))return!0;if(rn.errors=t.errors,e)throw new Error("custom keyword definition is invalid: "+this.errorsText(t.errors));return!1}});var ll=z((yg,qh)=>{qh.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 an=z((_g,gl)=>{"use strict";var ul=Uo(),nt=Da(),Uh=Vo(),dl=qs(),zh=Bs(),Vh=ri(),Hh=Qi(),fl=Wi(),hl=st();gl.exports=ge;ge.prototype.validate=Bh;ge.prototype.compile=Jh;ge.prototype.addSchema=Qh;ge.prototype.addMetaSchema=Kh;ge.prototype.validateSchema=Gh;ge.prototype.getSchema=Yh;ge.prototype.removeSchema=ep;ge.prototype.addFormat=lp;ge.prototype.errorsText=ip;ge.prototype._addSchema=rp;ge.prototype._compile=tp;ge.prototype.compileAsync=el();var Va=il();ge.prototype.addKeyword=Va.add;ge.prototype.getKeyword=Va.get;ge.prototype.removeKeyword=Va.remove;ge.prototype.validateKeyword=Va.validate;var pl=ja();ge.ValidationError=pl.Validation;ge.MissingRefError=pl.MissingRef;ge.$dataMetaSchema=fl;var za="http://json-schema.org/draft-07/schema",cl=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],Zh=["/properties"];function ge(a){if(!(this instanceof ge))return new ge(a);a=this._opts=hl.copy(a)||{},pp(this),this._schemas={},this._refs={},this._fragments={},this._formats=Vh(a.format),this._cache=a.cache||new Uh,this._loadingSchemas={},this._compilations=[],this.RULES=Hh(),this._getId=ap(a),a.loopRequired=a.loopRequired||1/0,a.errorDataPath=="property"&&(a._errorDataPathProperty=!0),a.serialize===void 0&&(a.serialize=zh),this._metaOpts=hp(this),a.formats&&dp(this),a.keywords&&fp(this),cp(this),typeof a.meta=="object"&&this.addMetaSchema(a.meta),a.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),up(this)}function Bh(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 Jh(a,e){var t=this._addSchema(a,void 0,e);return t.validate||this._compile(t)}function Qh(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=nt.normalizeId(e||n),vl(this,e),this._schemas[e]=this._addSchema(a,t,s,!0),this}function Kh(a,e,t){return this.addSchema(a,e,t,!0),this}function Gh(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||Wh(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 Wh(a){var e=a._opts.meta;return a._opts.defaultMeta=typeof e=="object"?a._getId(e)||e:a.getSchema(za)?za:void 0,a._opts.defaultMeta}function Yh(a){var e=ml(this,a);switch(typeof e){case"object":return e.validate||this._compile(e);case"string":return this.getSchema(e);case"undefined":return Xh(this,a)}}function Xh(a,e){var t=nt.schema.call(a,{schema:{}},e);if(t){var s=t.schema,r=t.root,n=t.baseId,o=ul.call(a,s,r,void 0,n);return a._fragments[e]=new dl({ref:e,fragment:!0,schema:s,root:r,baseId:n,validate:o}),o}}function ml(a,e){return e=nt.normalizeId(e),a._schemas[e]||a._refs[e]||a._fragments[e]}function ep(a){if(a instanceof RegExp)return Ua(this,this._schemas,a),Ua(this,this._refs,a),this;switch(typeof a){case"undefined":return Ua(this,this._schemas),Ua(this,this._refs),this._cache.clear(),this;case"string":var e=ml(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=nt.normalizeId(r),delete this._schemas[r],delete this._refs[r])}return this}function Ua(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 rp(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,o=this._cache.get(n);if(o)return o;s=s||this._opts.addUsedSchema!==!1;var i=nt.normalizeId(this._getId(a));i&&s&&vl(this,i);var u=this._opts.validateSchema!==!1&&!e,c;u&&!(c=i&&i==nt.normalizeId(a.$schema))&&this.validateSchema(a,!0);var f=nt.ids.call(this,a),p=new dl({id:i,schema:a,localRefs:f,cacheKey:n,meta:t});return i[0]!="#"&&s&&(this._refs[i]=p),this._cache.put(n,p),u&&c&&this.validateSchema(a,!0),p}function tp(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=ul.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,o=n.apply(this,arguments);return r.errors=n.errors,o}}function ap(a){switch(a.schemaId){case"auto":return op;case"id":return sp;default:return np}}function sp(a){return a.$id&&this.logger.warn("schema $id ignored",a.$id),a.id}function np(a){return a.id&&this.logger.warn("schema id ignored",a.id),a.$id}function op(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 ip(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 o=a[n];o&&(r+=s+o.dataPath+" "+o.message+t)}return r.slice(0,-t.length)}function lp(a,e){return typeof e=="string"&&(e=new RegExp(e)),this._formats[a]=e,this}function cp(a){var e;if(a._opts.$data&&(e=ll(),a.addMetaSchema(e,e.$id,!0)),a._opts.meta!==!1){var t=en();a._opts.$data&&(t=fl(t,Zh)),a.addMetaSchema(t,za,!0),a._refs["http://json-schema.org/schema"]=za}}function up(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 dp(a){for(var e in a._opts.formats){var t=a._opts.formats[e];a.addFormat(e,t)}}function fp(a){for(var e in a._opts.keywords){var t=a._opts.keywords[e];a.addKeyword(e,t)}}function vl(a,e){if(a._schemas[e]||a._refs[e])throw new Error('schema with key or id "'+e+'" already exists')}function hp(a){for(var e=hl.copy(a._opts),t=0;t<cl.length;t++)delete e[cl[t]];return e}function pp(a){var e=a._opts.logger;if(e===!1)a.logger={log:tn,warn:tn,error:tn};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 tn(){}});var wl=z((Rg,Ba)=>{"use strict";Ba.exports=yp;Ba.exports.format=bl;Ba.exports.parse=xl;var mp=/\B(?=(\d{3})+(?!\d))/g,vp=/(?:\.0*|(\.[^0]+)0+)$/,Cr={b:1,kb:1024,mb:1<<20,gb:1<<30,tb:Math.pow(1024,4),pb:Math.pow(1024,5)},gp=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function yp(a,e){return typeof a=="string"?xl(a):typeof a=="number"?bl(a,e):null}function bl(a,e){if(!Number.isFinite(a))return null;var t=Math.abs(a),s=e&&e.thousandsSeparator||"",r=e&&e.unitSeparator||"",n=e&&e.decimalPlaces!==void 0?e.decimalPlaces:2,o=!!(e&&e.fixedDecimals),i=e&&e.unit||"";(!i||!Cr[i.toLowerCase()])&&(t>=Cr.pb?i="PB":t>=Cr.tb?i="TB":t>=Cr.gb?i="GB":t>=Cr.mb?i="MB":t>=Cr.kb?i="KB":i="B");var u=a/Cr[i.toLowerCase()],c=u.toFixed(n);return o||(c=c.replace(vp,"$1")),s&&(c=c.split(".").map(function(f,p){return p===0?f.replace(mp,s):f}).join(".")),c+r+i}function xl(a){if(typeof a=="number"&&!isNaN(a))return a;if(typeof a!="string")return null;var e=gp.exec(a),t,s="b";return e?(t=parseFloat(e[1]),s=e[4].toLowerCase()):(t=parseInt(a,10),s="b"),isNaN(t)?null:Math.floor(Cr[s]*t)}});var nn=z(sn=>{"use strict";var Pl=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,_p=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,Sl=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,bp=/\\([\u000b\u0020-\u00ff])/g,xp=/([\\"])/g,Rl=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;sn.format=wp;sn.parse=Ep;function wp(a){if(!a||typeof a!="object")throw new TypeError("argument obj is required");var e=a.parameters,t=a.type;if(!t||!Rl.test(t))throw new TypeError("invalid type");var s=t;if(e&&typeof e=="object")for(var r,n=Object.keys(e).sort(),o=0;o<n.length;o++){if(r=n[o],!Sl.test(r))throw new TypeError("invalid parameter name");s+="; "+r+"="+Sp(e[r])}return s}function Ep(a){if(!a)throw new TypeError("argument string is required");var e=typeof a=="object"?Pp(a):a;if(typeof e!="string")throw new TypeError("argument string is required to be a string");var t=e.indexOf(";"),s=t!==-1?e.slice(0,t).trim():e.trim();if(!Rl.test(s))throw new TypeError("invalid media type");var r=new Rp(s.toLowerCase());if(t!==-1){var n,o,i;for(Pl.lastIndex=t;o=Pl.exec(e);){if(o.index!==t)throw new TypeError("invalid parameter format");t+=o[0].length,n=o[1].toLowerCase(),i=o[2],i.charCodeAt(0)===34&&(i=i.slice(1,-1),i.indexOf("\\")!==-1&&(i=i.replace(bp,"$1"))),r.parameters[n]=i}if(t!==e.length)throw new TypeError("invalid parameter format")}return r}function Pp(a){var e;if(typeof a.getHeader=="function"?e=a.getHeader("content-type"):typeof a.headers=="object"&&(e=a.headers&&a.headers["content-type"]),typeof e!="string")throw new TypeError("content-type header is missing from object");return e}function Sp(a){var e=String(a);if(Sl.test(e))return e;if(e.length>0&&!_p.test(e))throw new TypeError("invalid parameter value");return'"'+e.replace(xp,"\\$1")+'"'}function Rp(a){this.parameters=Object.create(null),this.type=a}});var Dl=z((Cg,kl)=>{kl.exports=Cl;Cl.sync=$p;var Al=require("fs");function Tp(a,e){var t=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!t||(t=t.split(";"),t.indexOf("")!==-1))return!0;for(var s=0;s<t.length;s++){var r=t[s].toLowerCase();if(r&&a.substr(-r.length).toLowerCase()===r)return!0}return!1}function Il(a,e,t){return!a.isSymbolicLink()&&!a.isFile()?!1:Tp(e,t)}function Cl(a,e,t){Al.stat(a,function(s,r){t(s,s?!1:Il(r,a,e))})}function $p(a,e){return Il(Al.statSync(a),a,e)}});var Ml=z((kg,Fl)=>{Fl.exports=Nl;Nl.sync=Ap;var jl=require("fs");function Nl(a,e,t){jl.stat(a,function(s,r){t(s,s?!1:Ll(r,e))})}function Ap(a,e){return Ll(jl.statSync(a),e)}function Ll(a,e){return a.isFile()&&Ip(a,e)}function Ip(a,e){var t=a.mode,s=a.uid,r=a.gid,n=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),o=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),i=parseInt("100",8),u=parseInt("010",8),c=parseInt("001",8),f=i|u,p=t&c||t&u&&r===o||t&i&&s===n||t&f&&n===0;return p}});var Ul=z((jg,ql)=>{var Dg=require("fs"),Qa;process.platform==="win32"||global.TESTING_WINDOWS?Qa=Dl():Qa=Ml();ql.exports=on;on.sync=Cp;function on(a,e,t){if(typeof e=="function"&&(t=e,e={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(s,r){on(a,e||{},function(n,o){n?r(n):s(o)})})}Qa(a,e||{},function(s,r){s&&(s.code==="EACCES"||e&&e.ignoreErrors)&&(s=null,r=!1),t(s,r)})}function Cp(a,e){try{return Qa.sync(a,e||{})}catch(t){if(e&&e.ignoreErrors||t.code==="EACCES")return!1;throw t}}});var Ql=z((Ng,Jl)=>{var Ot=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",zl=require("path"),kp=Ot?";":":",Vl=Ul(),Hl=a=>Object.assign(new Error(`not found: ${a}`),{code:"ENOENT"}),Zl=(a,e)=>{let t=e.colon||kp,s=a.match(/\//)||Ot&&a.match(/\\/)?[""]:[...Ot?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(t)],r=Ot?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",n=Ot?r.split(t):[""];return Ot&&a.indexOf(".")!==-1&&n[0]!==""&&n.unshift(""),{pathEnv:s,pathExt:n,pathExtExe:r}},Bl=(a,e,t)=>{typeof e=="function"&&(t=e,e={}),e||(e={});let{pathEnv:s,pathExt:r,pathExtExe:n}=Zl(a,e),o=[],i=c=>new Promise((f,p)=>{if(c===s.length)return e.all&&o.length?f(o):p(Hl(a));let g=s[c],d=/^".*"$/.test(g)?g.slice(1,-1):g,y=zl.join(d,a),m=!d&&/^\.[\\\/]/.test(a)?a.slice(0,2)+y:y;f(u(m,c,0))}),u=(c,f,p)=>new Promise((g,d)=>{if(p===r.length)return g(i(f+1));let y=r[p];Vl(c+y,{pathExt:n},(m,v)=>{if(!m&&v)if(e.all)o.push(c+y);else return g(c+y);return g(u(c,f,p+1))})});return t?i(0).then(c=>t(null,c),t):i(0)},Dp=(a,e)=>{e=e||{};let{pathEnv:t,pathExt:s,pathExtExe:r}=Zl(a,e),n=[];for(let o=0;o<t.length;o++){let i=t[o],u=/^".*"$/.test(i)?i.slice(1,-1):i,c=zl.join(u,a),f=!u&&/^\.[\\\/]/.test(a)?a.slice(0,2)+c:c;for(let p=0;p<s.length;p++){let g=f+s[p];try{if(Vl.sync(g,{pathExt:r}))if(e.all)n.push(g);else return g}catch{}}}if(e.all&&n.length)return n;if(e.nothrow)return null;throw Hl(a)};Jl.exports=Bl;Bl.sync=Dp});var Gl=z((Lg,ln)=>{"use strict";var Kl=(a={})=>{let e=a.env||process.env;return(a.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(s=>s.toUpperCase()==="PATH")||"Path"};ln.exports=Kl;ln.exports.default=Kl});var ec=z((Fg,Xl)=>{"use strict";var Wl=require("path"),jp=Ql(),Np=Gl();function Yl(a,e){let t=a.options.env||process.env,s=process.cwd(),r=a.options.cwd!=null,n=r&&process.chdir!==void 0&&!process.chdir.disabled;if(n)try{process.chdir(a.options.cwd)}catch{}let o;try{o=jp.sync(a.command,{path:t[Np({env:t})],pathExt:e?Wl.delimiter:void 0})}catch{}finally{n&&process.chdir(s)}return o&&(o=Wl.resolve(r?a.options.cwd:"",o)),o}function Lp(a){return Yl(a)||Yl(a,!0)}Xl.exports=Lp});var rc=z((Mg,un)=>{"use strict";var cn=/([()\][%!^"`<>&|;, *?])/g;function Fp(a){return a=a.replace(cn,"^$1"),a}function Mp(a,e){return a=`${a}`,a=a.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),a=a.replace(/(?=(\\+?)?)\1$/,"$1$1"),a=`"${a}"`,a=a.replace(cn,"^$1"),e&&(a=a.replace(cn,"^$1")),a}un.exports.command=Fp;un.exports.argument=Mp});var ac=z((qg,tc)=>{"use strict";tc.exports=/^#!(.*)/});var nc=z((Ug,sc)=>{"use strict";var qp=ac();sc.exports=(a="")=>{let e=a.match(qp);if(!e)return null;let[t,s]=e[0].replace(/#! ?/,"").split(" "),r=t.split("/").pop();return r==="env"?s:s?`${r} ${s}`:r}});var ic=z((zg,oc)=>{"use strict";var dn=require("fs"),Up=nc();function zp(a){let t=Buffer.alloc(150),s;try{s=dn.openSync(a,"r"),dn.readSync(s,t,0,150,0),dn.closeSync(s)}catch{}return Up(t.toString())}oc.exports=zp});var dc=z((Vg,uc)=>{"use strict";var Vp=require("path"),lc=ec(),cc=rc(),Hp=ic(),Zp=process.platform==="win32",Bp=/\.(?:com|exe)$/i,Jp=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Qp(a){a.file=lc(a);let e=a.file&&Hp(a.file);return e?(a.args.unshift(a.file),a.command=e,lc(a)):a.file}function Kp(a){if(!Zp)return a;let e=Qp(a),t=!Bp.test(e);if(a.options.forceShell||t){let s=Jp.test(e);a.command=Vp.normalize(a.command),a.command=cc.command(a.command),a.args=a.args.map(n=>cc.argument(n,s));let r=[a.command].concat(a.args).join(" ");a.args=["/d","/s","/c",`"${r}"`],a.command=process.env.comspec||"cmd.exe",a.options.windowsVerbatimArguments=!0}return a}function Gp(a,e,t){e&&!Array.isArray(e)&&(t=e,e=null),e=e?e.slice(0):[],t=Object.assign({},t);let s={command:a,args:e,options:t,file:void 0,original:{command:a,args:e}};return t.shell?s:Kp(s)}uc.exports=Gp});var pc=z((Hg,hc)=>{"use strict";var fn=process.platform==="win32";function hn(a,e){return Object.assign(new Error(`${e} ${a.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${a.command}`,path:a.command,spawnargs:a.args})}function Wp(a,e){if(!fn)return;let t=a.emit;a.emit=function(s,r){if(s==="exit"){let n=fc(r,e);if(n)return t.call(a,"error",n)}return t.apply(a,arguments)}}function fc(a,e){return fn&&a===1&&!e.file?hn(e.original,"spawn"):null}function Yp(a,e){return fn&&a===1&&!e.file?hn(e.original,"spawnSync"):null}hc.exports={hookChildProcess:Wp,verifyENOENT:fc,verifyENOENTSync:Yp,notFoundError:hn}});var gc=z((Zg,Tt)=>{"use strict";var mc=require("child_process"),pn=dc(),mn=pc();function vc(a,e,t){let s=pn(a,e,t),r=mc.spawn(s.command,s.args,s.options);return mn.hookChildProcess(r,s),r}function Xp(a,e,t){let s=pn(a,e,t),r=mc.spawnSync(s.command,s.args,s.options);return r.error=r.error||mn.verifyENOENTSync(r.status,s),r}Tt.exports=vc;Tt.exports.spawn=vc;Tt.exports.sync=Xp;Tt.exports._parse=pn;Tt.exports._enoent=mn});var Nm={};zn(Nm,{CallToolRequestSchema:()=>Rs,Client:()=>Ha,ListRootsRequestSchema:()=>Is,ListToolsRequestSchema:()=>Ps,PingRequestSchema:()=>St,SSEServerTransport:()=>Ja,Server:()=>Za,StdioClientTransport:()=>Ga,StdioServerTransport:()=>Wa,StreamableHTTPClientTransport:()=>ts,StreamableHTTPServerTransport:()=>Ya,z:()=>l,zodToJsonSchema:()=>$n});module.exports=Mu(Nm);var l={};zn(l,{BRAND:()=>dd,DIRTY:()=>qr,EMPTY_PATH:()=>Vu,INVALID:()=>B,NEVER:()=>Kd,OK:()=>$e,ParseStatus:()=>Re,Schema:()=>G,ZodAny:()=>Rr,ZodArray:()=>yr,ZodBigInt:()=>zr,ZodBoolean:()=>Vr,ZodBranded:()=>Ft,ZodCatch:()=>et,ZodDate:()=>Hr,ZodDefault:()=>Xr,ZodDiscriminatedUnion:()=>ha,ZodEffects:()=>Qe,ZodEnum:()=>Wr,ZodError:()=>Le,ZodFirstPartyTypeKind:()=>T,ZodFunction:()=>ma,ZodIntersection:()=>Qr,ZodIssueCode:()=>R,ZodLazy:()=>Kr,ZodLiteral:()=>Gr,ZodMap:()=>xt,ZodNaN:()=>Et,ZodNativeEnum:()=>Yr,ZodNever:()=>Ye,ZodNull:()=>Br,ZodNullable:()=>ir,ZodNumber:()=>Ur,ZodObject:()=>Fe,ZodOptional:()=>Be,ZodParsedType:()=>j,ZodPipeline:()=>Mt,ZodPromise:()=>Or,ZodReadonly:()=>rt,ZodRecord:()=>pa,ZodSchema:()=>G,ZodSet:()=>wt,ZodString:()=>Sr,ZodSymbol:()=>_t,ZodTransformer:()=>Qe,ZodTuple:()=>or,ZodType:()=>G,ZodUndefined:()=>Zr,ZodUnion:()=>Jr,ZodUnknown:()=>gr,ZodVoid:()=>bt,addIssueToContext:()=>D,any:()=>bd,array:()=>Pd,bigint:()=>md,boolean:()=>eo,coerce:()=>Qd,custom:()=>Wn,date:()=>vd,datetimeRegex:()=>Kn,defaultErrorMap:()=>mr,discriminatedUnion:()=>Td,effect:()=>qd,enum:()=>Ld,function:()=>Dd,getErrorMap:()=>vt,getParsedType:()=>nr,instanceof:()=>hd,intersection:()=>$d,isAborted:()=>da,isAsync:()=>gt,isDirty:()=>fa,isValid:()=>Pr,late:()=>fd,lazy:()=>jd,literal:()=>Nd,makeIssue:()=>Lt,map:()=>Cd,nan:()=>pd,nativeEnum:()=>Fd,never:()=>wd,null:()=>_d,nullable:()=>zd,number:()=>Xn,object:()=>Sd,objectUtil:()=>ds,oboolean:()=>Jd,onumber:()=>Bd,optional:()=>Ud,ostring:()=>Zd,pipeline:()=>Hd,preprocess:()=>Vd,promise:()=>Md,quotelessJson:()=>qu,record:()=>Id,set:()=>kd,setErrorMap:()=>zu,strictObject:()=>Rd,string:()=>Yn,symbol:()=>gd,transformer:()=>qd,tuple:()=>Ad,undefined:()=>yd,union:()=>Od,unknown:()=>xd,util:()=>X,void:()=>Ed});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 o of r)n[o]=o;return n},a.getValidEnumValues=r=>{let n=a.objectKeys(r).filter(i=>typeof r[r[i]]!="number"),o={};for(let i of n)o[i]=r[i];return a.objectValues(o)},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 o in r)Object.prototype.hasOwnProperty.call(r,o)&&n.push(o);return n},a.find=(r,n)=>{for(let o of r)if(n(o))return o},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(o=>typeof o=="string"?`'${o}'`:o).join(n)}a.joinValues=s,a.jsonStringifyReplacer=(r,n)=>typeof n=="bigint"?n.toString():n})(X||(X={}));var ds;(function(a){a.mergeShapes=(e,t)=>({...e,...t})})(ds||(ds={}));var j=X.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),nr=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!="undefined"&&a instanceof Map?j.map:typeof Set!="undefined"&&a instanceof Set?j.set:typeof Date!="undefined"&&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"]),qu=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 o of n.issues)if(o.code==="invalid_union")o.unionErrors.map(r);else if(o.code==="invalid_return_type")r(o.returnTypeError);else if(o.code==="invalid_arguments")r(o.argumentsError);else if(o.path.length===0)s._errors.push(t(o));else{let i=s,u=0;for(;u<o.path.length;){let c=o.path[u];u===o.path.length-1?(i[c]=i[c]||{_errors:[]},i[c]._errors.push(t(o))):i[c]=i[c]||{_errors:[]},i=i[c],u++}}};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 Uu=(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}},mr=Uu;var Hn=mr;function zu(a){Hn=a}function vt(){return Hn}var Lt=a=>{let{data:e,path:t,errorMaps:s,issueData:r}=a,n=[...t,...r.path||[]],o={...r,path:n};if(r.message!==void 0)return{...r,path:n,message:r.message};let i="",u=s.filter(c=>!!c).slice().reverse();for(let c of u)i=c(o,{data:e,defaultError:i}).message;return{...r,path:n,message:i}},Vu=[];function D(a,e){let t=vt(),s=Lt({issueData:e,data:a.data,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,t,t===mr?void 0:mr].filter(r=>!!r)});a.common.issues.push(s)}var Re=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 B;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,o=await r.value;s.push({key:n,value:o})}return a.mergeObjectSync(e,s)}static mergeObjectSync(e,t){let s={};for(let r of t){let{key:n,value:o}=r;if(n.status==="aborted"||o.status==="aborted")return B;n.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),n.value!=="__proto__"&&(typeof o.value!="undefined"||r.alwaysSet)&&(s[n.value]=o.value)}return{status:e.value,value:s}}},B=Object.freeze({status:"aborted"}),qr=a=>({status:"dirty",value:a}),$e=a=>({status:"valid",value:a}),da=a=>a.status==="aborted",fa=a=>a.status==="dirty",Pr=a=>a.status==="valid",gt=a=>typeof Promise!="undefined"&&a instanceof Promise;var V;(function(a){a.errToObj=e=>typeof e=="string"?{message:e}:e||{},a.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(V||(V={}));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}},Zn=(a,e)=>{if(Pr(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:(o,i)=>{var c,f;let{message:u}=a;return o.code==="invalid_enum_value"?{message:u!=null?u:i.defaultError}:typeof i.data=="undefined"?{message:(c=u!=null?u:s)!=null?c:i.defaultError}:o.code!=="invalid_type"?{message:i.defaultError}:{message:(f=u!=null?u:t)!=null?f:i.defaultError}},description:r}}var G=class{get description(){return this._def.description}_getType(e){return nr(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:nr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Re,ctx:{common:e.parent.common,data:e.data,parsedType:nr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(gt(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){var n;let s={common:{issues:[],async:(n=t==null?void 0:t.async)!=null?n:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:nr(e)},r=this._parseSync({data:e,path:s.path,parent:s});return Zn(s,r)}"~validate"(e){var s,r;let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:nr(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:t});return Pr(n)?{value:n.value}:{issues:t.common.issues}}catch(n){(r=(s=n==null?void 0:n.message)==null?void 0:s.toLowerCase())!=null&&r.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(n=>Pr(n)?{value:n.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==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:nr(e)},r=this._parse({data:e,path:s.path,parent:s}),n=await(gt(r)?r:Promise.resolve(r));return Zn(s,n)}refine(e,t){let s=r=>typeof t=="string"||typeof t=="undefined"?{message:t}:typeof t=="function"?t(r):t;return this._refinement((r,n)=>{let o=e(r),i=()=>n.addIssue({code:R.custom,...s(r)});return typeof Promise!="undefined"&&o instanceof Promise?o.then(u=>u?!0:(i(),!1)):o?!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 ir.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return yr.create(this)}promise(){return Or.create(this,this._def)}or(e){return Jr.create([this,e],this._def)}and(e){return Qr.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 Xr({...Q(this._def),innerType:this,defaultValue:t,typeName:T.ZodDefault})}brand(){return new Ft({typeName:T.ZodBranded,type:this,...Q(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new et({...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 Mt.create(this,e)}readonly(){return rt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Hu=/^c[^\s-]{8,}$/i,Zu=/^[0-9a-z]+$/,Bu=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ju=/^[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,Qu=/^[a-z0-9_-]{21}$/i,Ku=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Gu=/^[-+]?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)?)??$/,Wu=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Yu="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",fs,Xu=/^(?:(?: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])$/,ed=/^(?:(?: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])$/,rd=/^(([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]))$/,td=/^(([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])$/,ad=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,sd=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Jn="((\\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])))",nd=new RegExp(`^${Jn}$`);function Qn(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 od(a){return new RegExp(`^${Qn(a)}$`)}function Kn(a){let e=`${Jn}T${Qn(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 id(a,e){return!!((e==="v4"||!e)&&Xu.test(a)||(e==="v6"||!e)&&rd.test(a))}function ld(a,e){if(!Ku.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==null?void 0:r.typ)!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function cd(a,e){return!!((e==="v4"||!e)&&ed.test(a)||(e==="v6"||!e)&&td.test(a))}var Sr=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 D(n,{code:R.invalid_type,expected:j.string,received:n.parsedType}),B}let s=new Re,r;for(let n of this._def.checks)if(n.kind==="min")e.data.length<n.value&&(r=this._getOrReturnCtx(e,r),D(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),D(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 o=e.data.length>n.value,i=e.data.length<n.value;(o||i)&&(r=this._getOrReturnCtx(e,r),o?D(r,{code:R.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):i&&D(r,{code:R.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),s.dirty())}else if(n.kind==="email")Wu.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"email",code:R.invalid_string,message:n.message}),s.dirty());else if(n.kind==="emoji")fs||(fs=new RegExp(Yu,"u")),fs.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"emoji",code:R.invalid_string,message:n.message}),s.dirty());else if(n.kind==="uuid")Ju.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"uuid",code:R.invalid_string,message:n.message}),s.dirty());else if(n.kind==="nanoid")Qu.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"nanoid",code:R.invalid_string,message:n.message}),s.dirty());else if(n.kind==="cuid")Hu.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"cuid",code:R.invalid_string,message:n.message}),s.dirty());else if(n.kind==="cuid2")Zu.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"cuid2",code:R.invalid_string,message:n.message}),s.dirty());else if(n.kind==="ulid")Bu.test(e.data)||(r=this._getOrReturnCtx(e,r),D(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),D(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),D(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),D(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),D(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),D(r,{code:R.invalid_string,validation:{endsWith:n.value},message:n.message}),s.dirty()):n.kind==="datetime"?Kn(n).test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{code:R.invalid_string,validation:"datetime",message:n.message}),s.dirty()):n.kind==="date"?nd.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{code:R.invalid_string,validation:"date",message:n.message}),s.dirty()):n.kind==="time"?od(n).test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{code:R.invalid_string,validation:"time",message:n.message}),s.dirty()):n.kind==="duration"?Gu.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"duration",code:R.invalid_string,message:n.message}),s.dirty()):n.kind==="ip"?id(e.data,n.version)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"ip",code:R.invalid_string,message:n.message}),s.dirty()):n.kind==="jwt"?ld(e.data,n.alg)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"jwt",code:R.invalid_string,message:n.message}),s.dirty()):n.kind==="cidr"?cd(e.data,n.version)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"cidr",code:R.invalid_string,message:n.message}),s.dirty()):n.kind==="base64"?ad.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"base64",code:R.invalid_string,message:n.message}),s.dirty()):n.kind==="base64url"?sd.test(e.data)||(r=this._getOrReturnCtx(e,r),D(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,...V.errToObj(s)})}_addCheck(e){return new a({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...V.errToObj(e)})}url(e){return this._addCheck({kind:"url",...V.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...V.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...V.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...V.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...V.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...V.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...V.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...V.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...V.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...V.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...V.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...V.errToObj(e)})}datetime(e){var t,s;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!=null?t:!1,local:(s=e==null?void 0:e.local)!=null?s:!1,...V.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision,...V.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...V.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...V.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...V.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...V.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...V.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...V.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...V.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...V.errToObj(t)})}nonempty(e){return this.min(1,V.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}};Sr.create=a=>{var e;return new Sr({checks:[],typeName:T.ZodString,coerce:(e=a==null?void 0:a.coerce)!=null?e:!1,...Q(a)})};function ud(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(".","")),o=Number.parseInt(e.toFixed(r).replace(".",""));return n%o/10**r}var Ur=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 D(n,{code:R.invalid_type,expected:j.number,received:n.parsedType}),B}let s,r=new Re;for(let n of this._def.checks)n.kind==="int"?X.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),D(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),D(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),D(s,{code:R.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):n.kind==="multipleOf"?ud(e.data,n.value)!==0&&(s=this._getOrReturnCtx(e,s),D(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),D(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,V.toString(t))}gt(e,t){return this.setLimit("min",e,!1,V.toString(t))}lte(e,t){return this.setLimit("max",e,!0,V.toString(t))}lt(e,t){return this.setLimit("max",e,!1,V.toString(t))}setLimit(e,t,s,r){return new a({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:V.toString(r)}]})}_addCheck(e){return new a({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:V.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:V.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:V.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:V.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:V.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:V.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:V.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:V.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:V.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)}};Ur.create=a=>new Ur({checks:[],typeName:T.ZodNumber,coerce:(a==null?void 0:a.coerce)||!1,...Q(a)});var zr=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 Re;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),D(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),D(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),D(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 D(t,{code:R.invalid_type,expected:j.bigint,received:t.parsedType}),B}gte(e,t){return this.setLimit("min",e,!0,V.toString(t))}gt(e,t){return this.setLimit("min",e,!1,V.toString(t))}lte(e,t){return this.setLimit("max",e,!0,V.toString(t))}lt(e,t){return this.setLimit("max",e,!1,V.toString(t))}setLimit(e,t,s,r){return new a({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:V.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:V.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:V.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:V.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:V.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:V.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}};zr.create=a=>{var e;return new zr({checks:[],typeName:T.ZodBigInt,coerce:(e=a==null?void 0:a.coerce)!=null?e:!1,...Q(a)})};var Vr=class extends G{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==j.boolean){let s=this._getOrReturnCtx(e);return D(s,{code:R.invalid_type,expected:j.boolean,received:s.parsedType}),B}return $e(e.data)}};Vr.create=a=>new Vr({typeName:T.ZodBoolean,coerce:(a==null?void 0:a.coerce)||!1,...Q(a)});var Hr=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 D(n,{code:R.invalid_type,expected:j.date,received:n.parsedType}),B}if(Number.isNaN(e.data.getTime())){let n=this._getOrReturnCtx(e);return D(n,{code:R.invalid_date}),B}let s=new Re,r;for(let n of this._def.checks)n.kind==="min"?e.data.getTime()<n.value&&(r=this._getOrReturnCtx(e,r),D(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),D(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:V.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:V.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}};Hr.create=a=>new Hr({checks:[],coerce:(a==null?void 0:a.coerce)||!1,typeName:T.ZodDate,...Q(a)});var _t=class extends G{_parse(e){if(this._getType(e)!==j.symbol){let s=this._getOrReturnCtx(e);return D(s,{code:R.invalid_type,expected:j.symbol,received:s.parsedType}),B}return $e(e.data)}};_t.create=a=>new _t({typeName:T.ZodSymbol,...Q(a)});var Zr=class extends G{_parse(e){if(this._getType(e)!==j.undefined){let s=this._getOrReturnCtx(e);return D(s,{code:R.invalid_type,expected:j.undefined,received:s.parsedType}),B}return $e(e.data)}};Zr.create=a=>new Zr({typeName:T.ZodUndefined,...Q(a)});var Br=class extends G{_parse(e){if(this._getType(e)!==j.null){let s=this._getOrReturnCtx(e);return D(s,{code:R.invalid_type,expected:j.null,received:s.parsedType}),B}return $e(e.data)}};Br.create=a=>new Br({typeName:T.ZodNull,...Q(a)});var Rr=class extends G{constructor(){super(...arguments),this._any=!0}_parse(e){return $e(e.data)}};Rr.create=a=>new Rr({typeName:T.ZodAny,...Q(a)});var gr=class extends G{constructor(){super(...arguments),this._unknown=!0}_parse(e){return $e(e.data)}};gr.create=a=>new gr({typeName:T.ZodUnknown,...Q(a)});var Ye=class extends G{_parse(e){let t=this._getOrReturnCtx(e);return D(t,{code:R.invalid_type,expected:j.never,received:t.parsedType}),B}};Ye.create=a=>new Ye({typeName:T.ZodNever,...Q(a)});var bt=class extends G{_parse(e){if(this._getType(e)!==j.undefined){let s=this._getOrReturnCtx(e);return D(s,{code:R.invalid_type,expected:j.void,received:s.parsedType}),B}return $e(e.data)}};bt.create=a=>new bt({typeName:T.ZodVoid,...Q(a)});var yr=class a extends G{_parse(e){let{ctx:t,status:s}=this._processInputParams(e),r=this._def;if(t.parsedType!==j.array)return D(t,{code:R.invalid_type,expected:j.array,received:t.parsedType}),B;if(r.exactLength!==null){let o=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(o||i)&&(D(t,{code:o?R.too_big:R.too_small,minimum:i?r.exactLength.value:void 0,maximum:o?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&&(D(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&&(D(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((o,i)=>r.type._parseAsync(new Je(t,o,t.path,i)))).then(o=>Re.mergeArray(s,o));let n=[...t.data].map((o,i)=>r.type._parseSync(new Je(t,o,t.path,i)));return Re.mergeArray(s,n)}get element(){return this._def.type}min(e,t){return new a({...this._def,minLength:{value:e,message:V.toString(t)}})}max(e,t){return new a({...this._def,maxLength:{value:e,message:V.toString(t)}})}length(e,t){return new a({...this._def,exactLength:{value:e,message:V.toString(t)}})}nonempty(e){return this.min(1,e)}};yr.create=(a,e)=>new yr({type:a,minLength:null,maxLength:null,exactLength:null,typeName:T.ZodArray,...Q(e)});function yt(a){if(a instanceof Fe){let e={};for(let t in a.shape){let s=a.shape[t];e[t]=Be.create(yt(s))}return new Fe({...a._def,shape:()=>e})}else return a instanceof yr?new yr({...a._def,type:yt(a.element)}):a instanceof Be?Be.create(yt(a.unwrap())):a instanceof ir?ir.create(yt(a.unwrap())):a instanceof or?or.create(a.items.map(e=>yt(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 c=this._getOrReturnCtx(e);return D(c,{code:R.invalid_type,expected:j.object,received:c.parsedType}),B}let{status:s,ctx:r}=this._processInputParams(e),{shape:n,keys:o}=this._getCached(),i=[];if(!(this._def.catchall instanceof Ye&&this._def.unknownKeys==="strip"))for(let c in r.data)o.includes(c)||i.push(c);let u=[];for(let c of o){let f=n[c],p=r.data[c];u.push({key:{status:"valid",value:c},value:f._parse(new Je(r,p,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof Ye){let c=this._def.unknownKeys;if(c==="passthrough")for(let f of i)u.push({key:{status:"valid",value:f},value:{status:"valid",value:r.data[f]}});else if(c==="strict")i.length>0&&(D(r,{code:R.unrecognized_keys,keys:i}),s.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let f of i){let p=r.data[f];u.push({key:{status:"valid",value:f},value:c._parse(new Je(r,p,r.path,f)),alwaysSet:f in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let c=[];for(let f of u){let p=await f.key,g=await f.value;c.push({key:p,value:g,alwaysSet:f.alwaysSet})}return c}).then(c=>Re.mergeObjectSync(s,c)):Re.mergeObjectSync(s,u)}get shape(){return this._def.shape()}strict(e){return V.errToObj,new a({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{var n,o,i,u;let r=(i=(o=(n=this._def).errorMap)==null?void 0:o.call(n,t,s).message)!=null?i:s.defaultError;return t.code==="unrecognized_keys"?{message:(u=V.errToObj(e).message)!=null?u: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 yt(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 Gn(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 Jr=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 o=n.map(i=>new Le(i.ctx.common.issues));return D(t,{code:R.invalid_union,unionErrors:o}),B}if(t.common.async)return Promise.all(s.map(async n=>{let o={...t,common:{...t.common,issues:[]},parent:null};return{result:await n._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(r);{let n,o=[];for(let u of s){let c={...t,common:{...t.common,issues:[]},parent:null},f=u._parseSync({data:t.data,path:t.path,parent:c});if(f.status==="valid")return f;f.status==="dirty"&&!n&&(n={result:f,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(n)return t.common.issues.push(...n.ctx.common.issues),n.result;let i=o.map(u=>new Le(u));return D(t,{code:R.invalid_union,unionErrors:i}),B}}get options(){return this._def.options}};Jr.create=(a,e)=>new Jr({options:a,typeName:T.ZodUnion,...Q(e)});var vr=a=>a instanceof Kr?vr(a.schema):a instanceof Qe?vr(a.innerType()):a instanceof Gr?[a.value]:a instanceof Wr?a.options:a instanceof Yr?X.objectValues(a.enum):a instanceof Xr?vr(a._def.innerType):a instanceof Zr?[void 0]:a instanceof Br?[null]:a instanceof Be?[void 0,...vr(a.unwrap())]:a instanceof ir?[null,...vr(a.unwrap())]:a instanceof Ft||a instanceof rt?vr(a.unwrap()):a instanceof et?vr(a._def.innerType):[],ha=class a extends G{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==j.object)return D(t,{code:R.invalid_type,expected:j.object,received:t.parsedType}),B;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}):(D(t,{code:R.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),B)}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 o=vr(n.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of o){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 hs(a,e){let t=nr(a),s=nr(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),o={...a,...e};for(let i of n){let u=hs(a[i],e[i]);if(!u.valid)return{valid:!1};o[i]=u.data}return{valid:!0,data:o}}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 o=a[n],i=e[n],u=hs(o,i);if(!u.valid)return{valid:!1};r.push(u.data)}return{valid:!0,data:r}}else return t===j.date&&s===j.date&&+a==+e?{valid:!0,data:a}:{valid:!1}}var Qr=class extends G{_parse(e){let{status:t,ctx:s}=this._processInputParams(e),r=(n,o)=>{if(da(n)||da(o))return B;let i=hs(n.value,o.value);return i.valid?((fa(n)||fa(o))&&t.dirty(),{status:t.value,value:i.data}):(D(s,{code:R.invalid_intersection_types}),B)};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,o])=>r(n,o)):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}))}};Qr.create=(a,e,t)=>new Qr({left:a,right:e,typeName:T.ZodIntersection,...Q(t)});var or=class a extends G{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==j.array)return D(s,{code:R.invalid_type,expected:j.array,received:s.parsedType}),B;if(s.data.length<this._def.items.length)return D(s,{code:R.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),B;!this._def.rest&&s.data.length>this._def.items.length&&(D(s,{code:R.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let n=[...s.data].map((o,i)=>{let u=this._def.items[i]||this._def.rest;return u?u._parse(new Je(s,o,s.path,i)):null}).filter(o=>!!o);return s.common.async?Promise.all(n).then(o=>Re.mergeArray(t,o)):Re.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new a({...this._def,rest:e})}};or.create=(a,e)=>{if(!Array.isArray(a))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new or({items:a,typeName:T.ZodTuple,rest:null,...Q(e)})};var pa=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 D(s,{code:R.invalid_type,expected:j.object,received:s.parsedType}),B;let r=[],n=this._def.keyType,o=this._def.valueType;for(let i in s.data)r.push({key:n._parse(new Je(s,i,s.path,i)),value:o._parse(new Je(s,s.data[i],s.path,i)),alwaysSet:i in s.data});return s.common.async?Re.mergeObjectAsync(t,r):Re.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:Sr.create(),valueType:e,typeName:T.ZodRecord,...Q(t)})}},xt=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 D(s,{code:R.invalid_type,expected:j.map,received:s.parsedType}),B;let r=this._def.keyType,n=this._def.valueType,o=[...s.data.entries()].map(([i,u],c)=>({key:r._parse(new Je(s,i,s.path,[c,"key"])),value:n._parse(new Je(s,u,s.path,[c,"value"]))}));if(s.common.async){let i=new Map;return Promise.resolve().then(async()=>{for(let u of o){let c=await u.key,f=await u.value;if(c.status==="aborted"||f.status==="aborted")return B;(c.status==="dirty"||f.status==="dirty")&&t.dirty(),i.set(c.value,f.value)}return{status:t.value,value:i}})}else{let i=new Map;for(let u of o){let c=u.key,f=u.value;if(c.status==="aborted"||f.status==="aborted")return B;(c.status==="dirty"||f.status==="dirty")&&t.dirty(),i.set(c.value,f.value)}return{status:t.value,value:i}}}};xt.create=(a,e,t)=>new xt({valueType:e,keyType:a,typeName:T.ZodMap,...Q(t)});var wt=class a extends G{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==j.set)return D(s,{code:R.invalid_type,expected:j.set,received:s.parsedType}),B;let r=this._def;r.minSize!==null&&s.data.size<r.minSize.value&&(D(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&&(D(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 o(u){let c=new Set;for(let f of u){if(f.status==="aborted")return B;f.status==="dirty"&&t.dirty(),c.add(f.value)}return{status:t.value,value:c}}let i=[...s.data.values()].map((u,c)=>n._parse(new Je(s,u,s.path,c)));return s.common.async?Promise.all(i).then(u=>o(u)):o(i)}min(e,t){return new a({...this._def,minSize:{value:e,message:V.toString(t)}})}max(e,t){return new a({...this._def,maxSize:{value:e,message:V.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};wt.create=(a,e)=>new wt({valueType:a,minSize:null,maxSize:null,typeName:T.ZodSet,...Q(e)});var ma=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 D(t,{code:R.invalid_type,expected:j.function,received:t.parsedType}),B;function s(i,u){return Lt({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,vt(),mr].filter(c=>!!c),issueData:{code:R.invalid_arguments,argumentsError:u}})}function r(i,u){return Lt({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,vt(),mr].filter(c=>!!c),issueData:{code:R.invalid_return_type,returnTypeError:u}})}let n={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof Or){let i=this;return $e(async function(...u){let c=new Le([]),f=await i._def.args.parseAsync(u,n).catch(d=>{throw c.addIssue(s(u,d)),c}),p=await Reflect.apply(o,this,f);return await i._def.returns._def.type.parseAsync(p,n).catch(d=>{throw c.addIssue(r(p,d)),c})})}else{let i=this;return $e(function(...u){let c=i._def.args.safeParse(u,n);if(!c.success)throw new Le([s(u,c.error)]);let f=Reflect.apply(o,this,c.data),p=i._def.returns.safeParse(f,n);if(!p.success)throw new Le([r(f,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new a({...this._def,args:or.create(e).rest(gr.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||or.create([]).rest(gr.create()),returns:t||gr.create(),typeName:T.ZodFunction,...Q(s)})}},Kr=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})}};Kr.create=(a,e)=>new Kr({getter:a,typeName:T.ZodLazy,...Q(e)});var Gr=class extends G{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return D(t,{received:t.data,code:R.invalid_literal,expected:this._def.value}),B}return{status:"valid",value:e.data}}get value(){return this._def.value}};Gr.create=(a,e)=>new Gr({value:a,typeName:T.ZodLiteral,...Q(e)});function Gn(a,e){return new Wr({values:a,typeName:T.ZodEnum,...Q(e)})}var Wr=class a extends G{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),s=this._def.values;return D(t,{expected:X.joinValues(s),received:t.parsedType,code:R.invalid_type}),B}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 D(t,{received:t.data,code:R.invalid_enum_value,options:s}),B}return $e(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})}};Wr.create=Gn;var Yr=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 D(s,{expected:X.joinValues(r),received:s.parsedType,code:R.invalid_type}),B}if(this._cache||(this._cache=new Set(X.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let r=X.objectValues(t);return D(s,{received:s.data,code:R.invalid_enum_value,options:r}),B}return $e(e.data)}get enum(){return this._def.values}};Yr.create=(a,e)=>new Yr({values:a,typeName:T.ZodNativeEnum,...Q(e)});var Or=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 D(t,{code:R.invalid_type,expected:j.promise,received:t.parsedType}),B;let s=t.parsedType===j.promise?t.data:Promise.resolve(t.data);return $e(s.then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Or.create=(a,e)=>new Or({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:o=>{D(s,o),o.fatal?t.abort():t.dirty()},get path(){return s.path}};if(n.addIssue=n.addIssue.bind(n),r.type==="preprocess"){let o=r.transform(s.data,n);if(s.common.async)return Promise.resolve(o).then(async i=>{if(t.value==="aborted")return B;let u=await this._def.schema._parseAsync({data:i,path:s.path,parent:s});return u.status==="aborted"?B:u.status==="dirty"?qr(u.value):t.value==="dirty"?qr(u.value):u});{if(t.value==="aborted")return B;let i=this._def.schema._parseSync({data:o,path:s.path,parent:s});return i.status==="aborted"?B:i.status==="dirty"?qr(i.value):t.value==="dirty"?qr(i.value):i}}if(r.type==="refinement"){let o=i=>{let u=r.refinement(i,n);if(s.common.async)return Promise.resolve(u);if(u 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"?B:(i.status==="dirty"&&t.dirty(),o(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"?B:(i.status==="dirty"&&t.dirty(),o(i.value).then(()=>({status:t.value,value:i.value}))))}if(r.type==="transform")if(s.common.async===!1){let o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!Pr(o))return B;let i=r.transform(o.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(o=>Pr(o)?Promise.resolve(r.transform(o.value,n)).then(i=>({status:t.value,value:i})):B);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?$e(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 ir=class extends G{_parse(e){return this._getType(e)===j.null?$e(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ir.create=(a,e)=>new ir({innerType:a,typeName:T.ZodNullable,...Q(e)});var Xr=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}};Xr.create=(a,e)=>new Xr({innerType:a,typeName:T.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Q(e)});var et=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 gt(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}};et.create=(a,e)=>new et({innerType:a,typeName:T.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Q(e)});var Et=class extends G{_parse(e){if(this._getType(e)!==j.nan){let s=this._getOrReturnCtx(e);return D(s,{code:R.invalid_type,expected:j.nan,received:s.parsedType}),B}return{status:"valid",value:e.data}}};Et.create=a=>new Et({typeName:T.ZodNaN,...Q(a)});var dd=Symbol("zod_brand"),Ft=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}},Mt=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"?B:n.status==="dirty"?(t.dirty(),qr(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"?B: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})}},rt=class extends G{_parse(e){let t=this._def.innerType._parse(e),s=r=>(Pr(r)&&(r.value=Object.freeze(r.value)),r);return gt(t)?t.then(r=>s(r)):s(t)}unwrap(){return this._def.innerType}};rt.create=(a,e)=>new rt({innerType:a,typeName:T.ZodReadonly,...Q(e)});function Bn(a,e){let t=typeof a=="function"?a(e):typeof a=="string"?{message:a}:a;return typeof t=="string"?{message:t}:t}function Wn(a,e={},t){return a?Rr.create().superRefine((s,r)=>{var o,i;let n=a(s);if(n instanceof Promise)return n.then(u=>{var c,f;if(!u){let p=Bn(e,s),g=(f=(c=p.fatal)!=null?c:t)!=null?f:!0;r.addIssue({code:"custom",...p,fatal:g})}});if(!n){let u=Bn(e,s),c=(i=(o=u.fatal)!=null?o:t)!=null?i:!0;r.addIssue({code:"custom",...u,fatal:c})}}):Rr.create()}var fd={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 hd=(a,e={message:`Input not instance of ${a.name}`})=>Wn(t=>t instanceof a,e),Yn=Sr.create,Xn=Ur.create,pd=Et.create,md=zr.create,eo=Vr.create,vd=Hr.create,gd=_t.create,yd=Zr.create,_d=Br.create,bd=Rr.create,xd=gr.create,wd=Ye.create,Ed=bt.create,Pd=yr.create,Sd=Fe.create,Rd=Fe.strictCreate,Od=Jr.create,Td=ha.create,$d=Qr.create,Ad=or.create,Id=pa.create,Cd=xt.create,kd=wt.create,Dd=ma.create,jd=Kr.create,Nd=Gr.create,Ld=Wr.create,Fd=Yr.create,Md=Or.create,qd=Qe.create,Ud=Be.create,zd=ir.create,Vd=Qe.createWithPreprocess,Hd=Mt.create,Zd=()=>Yn().optional(),Bd=()=>Xn().optional(),Jd=()=>eo().optional(),Qd={string:a=>Sr.create({...a,coerce:!0}),number:a=>Ur.create({...a,coerce:!0}),boolean:a=>Vr.create({...a,coerce:!0}),bigint:a=>zr.create({...a,coerce:!0}),date:a=>Hr.create({...a,coerce:!0})};var Kd=B;var Tr="2025-06-18",ro="2025-03-26",tt=[Tr,"2025-03-26","2024-11-05","2024-10-07"],va="2.0",to=l.union([l.string(),l.number().int()]),ao=l.string(),Gd=l.object({progressToken:l.optional(to)}).passthrough(),Ke=l.object({_meta:l.optional(Gd)}).passthrough(),Me=l.object({method:l.string(),params:l.optional(Ke)}),qt=l.object({_meta:l.optional(l.object({}).passthrough())}).passthrough(),lr=l.object({method:l.string(),params:l.optional(qt)}),Ge=l.object({_meta:l.optional(l.object({}).passthrough())}).passthrough(),ga=l.union([l.string(),l.number().int()]),so=l.object({jsonrpc:l.literal(va),id:ga}).merge(Me).strict(),at=a=>so.safeParse(a).success,no=l.object({jsonrpc:l.literal(va)}).merge(lr).strict(),oo=a=>no.safeParse(a).success,io=l.object({jsonrpc:l.literal(va),id:ga,result:Ge}).strict(),_r=a=>io.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 lo=l.object({jsonrpc:l.literal(va),id:ga,error:l.object({code:l.number().int(),message:l.string(),data:l.optional(l.unknown())})}).strict(),Pt=a=>lo.safeParse(a).success,Xe=l.union([so,no,io,lo]),br=Ge.strict(),ya=lr.extend({method:l.literal("notifications/cancelled"),params:qt.extend({requestId:ga,reason:l.string().optional()})}),Ut=l.object({name:l.string(),title:l.optional(l.string())}).passthrough(),co=Ut.extend({version:l.string()}),Wd=l.object({experimental:l.optional(l.object({}).passthrough()),sampling:l.optional(l.object({}).passthrough()),elicitation:l.optional(l.object({}).passthrough()),roots:l.optional(l.object({listChanged:l.optional(l.boolean())}).passthrough())}).passthrough(),_a=Me.extend({method:l.literal("initialize"),params:Ke.extend({protocolVersion:l.string(),capabilities:Wd,clientInfo:co})}),uo=a=>_a.safeParse(a).success,Yd=l.object({experimental:l.optional(l.object({}).passthrough()),logging:l.optional(l.object({}).passthrough()),completions:l.optional(l.object({}).passthrough()),prompts:l.optional(l.object({listChanged:l.optional(l.boolean())}).passthrough()),resources:l.optional(l.object({subscribe:l.optional(l.boolean()),listChanged:l.optional(l.boolean())}).passthrough()),tools:l.optional(l.object({listChanged:l.optional(l.boolean())}).passthrough())}).passthrough(),ps=Ge.extend({protocolVersion:l.string(),capabilities:Yd,serverInfo:co,instructions:l.optional(l.string())}),ba=lr.extend({method:l.literal("notifications/initialized")}),fo=a=>ba.safeParse(a).success,St=Me.extend({method:l.literal("ping")}),Xd=l.object({progress:l.number(),total:l.optional(l.number()),message:l.optional(l.string())}).passthrough(),xa=lr.extend({method:l.literal("notifications/progress"),params:qt.merge(Xd).extend({progressToken:to})}),wa=Me.extend({params:Ke.extend({cursor:l.optional(ao)}).optional()}),Ea=Ge.extend({nextCursor:l.optional(ao)}),ho=l.object({uri:l.string(),mimeType:l.optional(l.string()),_meta:l.optional(l.object({}).passthrough())}).passthrough(),po=ho.extend({text:l.string()}),ms=l.string().refine(a=>{try{return atob(a),!0}catch{return!1}},{message:"Invalid Base64 string"}),mo=ho.extend({blob:ms}),vo=Ut.extend({uri:l.string(),description:l.optional(l.string()),mimeType:l.optional(l.string()),_meta:l.optional(l.object({}).passthrough())}),ef=Ut.extend({uriTemplate:l.string(),description:l.optional(l.string()),mimeType:l.optional(l.string()),_meta:l.optional(l.object({}).passthrough())}),rf=wa.extend({method:l.literal("resources/list")}),vs=Ea.extend({resources:l.array(vo)}),tf=wa.extend({method:l.literal("resources/templates/list")}),gs=Ea.extend({resourceTemplates:l.array(ef)}),af=Me.extend({method:l.literal("resources/read"),params:Ke.extend({uri:l.string()})}),ys=Ge.extend({contents:l.array(l.union([po,mo]))}),sf=lr.extend({method:l.literal("notifications/resources/list_changed")}),nf=Me.extend({method:l.literal("resources/subscribe"),params:Ke.extend({uri:l.string()})}),of=Me.extend({method:l.literal("resources/unsubscribe"),params:Ke.extend({uri:l.string()})}),lf=lr.extend({method:l.literal("notifications/resources/updated"),params:qt.extend({uri:l.string()})}),cf=l.object({name:l.string(),description:l.optional(l.string()),required:l.optional(l.boolean())}).passthrough(),uf=Ut.extend({description:l.optional(l.string()),arguments:l.optional(l.array(cf)),_meta:l.optional(l.object({}).passthrough())}),df=wa.extend({method:l.literal("prompts/list")}),_s=Ea.extend({prompts:l.array(uf)}),ff=Me.extend({method:l.literal("prompts/get"),params:Ke.extend({name:l.string(),arguments:l.optional(l.record(l.string()))})}),bs=l.object({type:l.literal("text"),text:l.string(),_meta:l.optional(l.object({}).passthrough())}).passthrough(),xs=l.object({type:l.literal("image"),data:ms,mimeType:l.string(),_meta:l.optional(l.object({}).passthrough())}).passthrough(),ws=l.object({type:l.literal("audio"),data:ms,mimeType:l.string(),_meta:l.optional(l.object({}).passthrough())}).passthrough(),hf=l.object({type:l.literal("resource"),resource:l.union([po,mo]),_meta:l.optional(l.object({}).passthrough())}).passthrough(),pf=vo.extend({type:l.literal("resource_link")}),go=l.union([bs,xs,ws,pf,hf]),mf=l.object({role:l.enum(["user","assistant"]),content:go}).passthrough(),Es=Ge.extend({description:l.optional(l.string()),messages:l.array(mf)}),vf=lr.extend({method:l.literal("notifications/prompts/list_changed")}),gf=l.object({title:l.optional(l.string()),readOnlyHint:l.optional(l.boolean()),destructiveHint:l.optional(l.boolean()),idempotentHint:l.optional(l.boolean()),openWorldHint:l.optional(l.boolean())}).passthrough(),yf=Ut.extend({description:l.optional(l.string()),inputSchema:l.object({type:l.literal("object"),properties:l.optional(l.object({}).passthrough()),required:l.optional(l.array(l.string()))}).passthrough(),outputSchema:l.optional(l.object({type:l.literal("object"),properties:l.optional(l.object({}).passthrough()),required:l.optional(l.array(l.string()))}).passthrough()),annotations:l.optional(gf),_meta:l.optional(l.object({}).passthrough())}),Ps=wa.extend({method:l.literal("tools/list")}),Ss=Ea.extend({tools:l.array(yf)}),Pa=Ge.extend({content:l.array(go).default([]),structuredContent:l.object({}).passthrough().optional(),isError:l.optional(l.boolean())}),_v=Pa.or(Ge.extend({toolResult:l.unknown()})),Rs=Me.extend({method:l.literal("tools/call"),params:Ke.extend({name:l.string(),arguments:l.optional(l.record(l.unknown()))})}),_f=lr.extend({method:l.literal("notifications/tools/list_changed")}),zt=l.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),Os=Me.extend({method:l.literal("logging/setLevel"),params:Ke.extend({level:zt})}),bf=lr.extend({method:l.literal("notifications/message"),params:qt.extend({level:zt,logger:l.optional(l.string()),data:l.unknown()})}),xf=l.object({name:l.string().optional()}).passthrough(),wf=l.object({hints:l.optional(l.array(xf)),costPriority:l.optional(l.number().min(0).max(1)),speedPriority:l.optional(l.number().min(0).max(1)),intelligencePriority:l.optional(l.number().min(0).max(1))}).passthrough(),Ef=l.object({role:l.enum(["user","assistant"]),content:l.union([bs,xs,ws])}).passthrough(),Pf=Me.extend({method:l.literal("sampling/createMessage"),params:Ke.extend({messages:l.array(Ef),systemPrompt:l.optional(l.string()),includeContext:l.optional(l.enum(["none","thisServer","allServers"])),temperature:l.optional(l.number()),maxTokens:l.number().int(),stopSequences:l.optional(l.array(l.string())),metadata:l.optional(l.object({}).passthrough()),modelPreferences:l.optional(wf)})}),Ts=Ge.extend({model:l.string(),stopReason:l.optional(l.enum(["endTurn","stopSequence","maxTokens"]).or(l.string())),role:l.enum(["user","assistant"]),content:l.discriminatedUnion("type",[bs,xs,ws])}),Sf=l.object({type:l.literal("boolean"),title:l.optional(l.string()),description:l.optional(l.string()),default:l.optional(l.boolean())}).passthrough(),Rf=l.object({type:l.literal("string"),title:l.optional(l.string()),description:l.optional(l.string()),minLength:l.optional(l.number()),maxLength:l.optional(l.number()),format:l.optional(l.enum(["email","uri","date","date-time"]))}).passthrough(),Of=l.object({type:l.enum(["number","integer"]),title:l.optional(l.string()),description:l.optional(l.string()),minimum:l.optional(l.number()),maximum:l.optional(l.number())}).passthrough(),Tf=l.object({type:l.literal("string"),title:l.optional(l.string()),description:l.optional(l.string()),enum:l.array(l.string()),enumNames:l.optional(l.array(l.string()))}).passthrough(),$f=l.union([Sf,Rf,Of,Tf]),Af=Me.extend({method:l.literal("elicitation/create"),params:Ke.extend({message:l.string(),requestedSchema:l.object({type:l.literal("object"),properties:l.record(l.string(),$f),required:l.optional(l.array(l.string()))}).passthrough()})}),$s=Ge.extend({action:l.enum(["accept","decline","cancel"]),content:l.optional(l.record(l.string(),l.unknown()))}),If=l.object({type:l.literal("ref/resource"),uri:l.string()}).passthrough();var Cf=l.object({type:l.literal("ref/prompt"),name:l.string()}).passthrough(),kf=Me.extend({method:l.literal("completion/complete"),params:Ke.extend({ref:l.union([Cf,If]),argument:l.object({name:l.string(),value:l.string()}).passthrough(),context:l.optional(l.object({arguments:l.optional(l.record(l.string(),l.string()))}))})}),As=Ge.extend({completion:l.object({values:l.array(l.string()).max(100),total:l.optional(l.number().int()),hasMore:l.optional(l.boolean())}).passthrough()}),Df=l.object({uri:l.string().startsWith("file://"),name:l.optional(l.string()),_meta:l.optional(l.object({}).passthrough())}).passthrough(),Is=Me.extend({method:l.literal("roots/list")}),Cs=Ge.extend({roots:l.array(Df)}),jf=lr.extend({method:l.literal("notifications/roots/list_changed")}),bv=l.union([St,_a,kf,Os,ff,df,rf,tf,af,nf,of,Rs,Ps]),xv=l.union([ya,xa,ba,jf]),wv=l.union([br,Ts,$s,Cs]),Ev=l.union([St,Pf,Af,Is]),Pv=l.union([ya,xa,bf,lf,sf,_f,vf]),Sv=l.union([br,ps,As,Es,_s,vs,gs,ys,Pa,Ss]),Ae=class extends Error{constructor(e,t,s){super(`MCP error ${e}: ${t}`),this.code=e,this.data=s,this.name="McpError"}};var Nf=6e4,Rt=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(ya,t=>{let s=this._requestHandlerAbortControllers.get(t.params.requestId);s==null||s.abort(t.params.reason)}),this.setNotificationHandler(xa,t=>{this._onprogress(t)}),this.setRequestHandler(St,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 Ae(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==null||n(),this._onclose()};let o=(s=this.transport)===null||s===void 0?void 0:s.onerror;this._transport.onerror=u=>{o==null||o(u),this._onerror(u)};let i=(r=this._transport)===null||r===void 0?void 0:r.onmessage;this._transport.onmessage=(u,c)=>{i==null||i(u,c),_r(u)||Pt(u)?this._onresponse(u):at(u)?this._onrequest(u,c):oo(u)?this._onnotification(u):this._onerror(new Error(`Unknown message type: ${JSON.stringify(u)}`))},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 Ae(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,o=this._transport;if(n===void 0){o==null||o.send({jsonrpc:"2.0",id:e.id,error:{code:De.MethodNotFound,message:"Method not found"}}).catch(c=>this._onerror(new Error(`Failed to send an error response: ${c}`)));return}let i=new AbortController;this._requestHandlerAbortControllers.set(e.id,i);let u={signal:i.signal,sessionId:o==null?void 0:o.sessionId,_meta:(r=e.params)===null||r===void 0?void 0:r._meta,sendNotification:c=>this.notification(c,{relatedRequestId:e.id}),sendRequest:(c,f,p)=>this.request(c,f,{...p,relatedRequestId:e.id}),authInfo:t==null?void 0:t.authInfo,requestId:e.id,requestInfo:t==null?void 0:t.requestInfo};Promise.resolve().then(()=>n(e,u)).then(c=>{if(!i.signal.aborted)return o==null?void 0:o.send({result:c,jsonrpc:"2.0",id:e.id})},c=>{var f;if(!i.signal.aborted)return o==null?void 0:o.send({jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(c.code)?c.code:De.InternalError,message:(f=c.message)!==null&&f!==void 0?f:"Internal error"}})}).catch(c=>this._onerror(new Error(`Failed to send response: ${c}`))).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 o=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&o&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){o(u);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),_r(e))s(e);else{let r=new Ae(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:o}=s!=null?s:{};return new Promise((i,u)=>{var c,f,p,g,d,y;if(!this._transport){u(new Error("Not connected"));return}((c=this._options)===null||c===void 0?void 0:c.enforceStrictCapabilities)===!0&&this.assertCapabilityForMethod(e.method),(f=s==null?void 0:s.signal)===null||f===void 0||f.throwIfAborted();let m=this._requestMessageId++,v={...e,jsonrpc:"2.0",id:m};s!=null&&s.onprogress&&(this._progressHandlers.set(m,s.onprogress),v.params={...e.params,_meta:{...((p=e.params)===null||p===void 0?void 0:p._meta)||{},progressToken:m}});let x=O=>{var A;this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),(A=this._transport)===null||A===void 0||A.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(O)}},{relatedRequestId:r,resumptionToken:n,onresumptiontoken:o}).catch(I=>this._onerror(new Error(`Failed to send cancellation: ${I}`))),u(O)};this._responseHandlers.set(m,O=>{var A;if(!(!((A=s==null?void 0:s.signal)===null||A===void 0)&&A.aborted)){if(O instanceof Error)return u(O);try{let I=t.parse(O.result);i(I)}catch(I){u(I)}}}),(g=s==null?void 0:s.signal)===null||g===void 0||g.addEventListener("abort",()=>{var O;x((O=s==null?void 0:s.signal)===null||O===void 0?void 0:O.reason)});let S=(d=s==null?void 0:s.timeout)!==null&&d!==void 0?d:Nf,P=()=>x(new Ae(De.RequestTimeout,"Request timed out",{timeout:S}));this._setupTimeout(m,S,s==null?void 0:s.maxTotalTimeout,P,(y=s==null?void 0:s.resetTimeoutOnProgress)!==null&&y!==void 0?y:!1),this._transport.send(v,{relatedRequestId:r,resumptionToken:n,onresumptiontoken:o}).catch(O=>{this._cleanupTimeout(m),u(O)})})}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!=null&&t.relatedRequestId)){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{var u;if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let c={...e,jsonrpc:"2.0"};(u=this._transport)===null||u===void 0||u.send(c,t).catch(f=>this._onerror(f))});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 Sa(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 yl=pr(an(),1),Ha=class extends Rt{constructor(e,t){var s;super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._capabilities=(s=t==null?void 0:t.capabilities)!==null&&s!==void 0?s:{},this._ajv=new yl.default}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Sa(this._capabilities,e)}assertCapability(e,t){var s;if(!(!((s=this._serverCapabilities)===null||s===void 0)&&s[e]))throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{let s=await this.request({method:"initialize",params:{protocolVersion:Tr,capabilities:this._capabilities,clientInfo:this._clientInfo}},ps,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!tt.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"})}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){var t,s,r,n,o;switch(e){case"logging/setLevel":if(!(!((t=this._serverCapabilities)===null||t===void 0)&&t.logging))throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!(!((s=this._serverCapabilities)===null||s===void 0)&&s.prompts))throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!(!((r=this._serverCapabilities)===null||r===void 0)&&r.resources))throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!(!((n=this._serverCapabilities)===null||n===void 0)&&n.tools))throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!(!((o=this._serverCapabilities)===null||o===void 0)&&o.completions))throw new Error(`Server does not support completions (required for ${e})`);break;case"initialize":break;case"ping":break}}assertNotificationCapability(e){var t;switch(e){case"notifications/roots/list_changed":if(!(!((t=this._capabilities.roots)===null||t===void 0)&&t.listChanged))throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break;case"notifications/initialized":break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"ping":break}}async ping(e){return this.request({method:"ping"},br,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},As,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},br,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},Es,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},_s,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},vs,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},gs,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},ys,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},br,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},br,t)}async callTool(e,t=Pa,s){let r=await this.request({method:"tools/call",params:e},t,s),n=this.getToolOutputValidator(e.name);if(n){if(!r.structuredContent&&!r.isError)throw new Ae(De.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{if(!n(r.structuredContent))throw new Ae(De.InvalidParams,`Structured content does not match the tool's output schema: ${this._ajv.errorsText(n.errors)}`)}catch(o){throw o instanceof Ae?o:new Ae(De.InvalidParams,`Failed to validate structured content: ${o instanceof Error?o.message:String(o)}`)}}return r}cacheToolOutputSchemas(e){this._cachedToolOutputValidators.clear();for(let t of e)if(t.outputSchema)try{let s=this._ajv.compile(t.outputSchema);this._cachedToolOutputValidators.set(t.name,s)}catch{}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){let s=await this.request({method:"tools/list",params:e},Ss,t);return this.cacheToolOutputSchemas(s.tools),s}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};var _l=pr(an(),1),Za=class extends Rt{constructor(e,t){var s;super(t),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(zt.options.map((r,n)=>[r,n])),this.isMessageIgnored=(r,n)=>{let o=this._loggingLevels.get(n);return o?this.LOG_LEVEL_SEVERITY.get(r)<this.LOG_LEVEL_SEVERITY.get(o):!1},this._capabilities=(s=t==null?void 0:t.capabilities)!==null&&s!==void 0?s:{},this._instructions=t==null?void 0:t.instructions,this.setRequestHandler(_a,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(Os,async(r,n)=>{var o;let i=n.sessionId||((o=n.requestInfo)===null||o===void 0?void 0:o.headers["mcp-session-id"])||void 0,{level:u}=r.params,c=zt.safeParse(u);return i&&c.success&&this._loggingLevels.set(i,c.data),{}})}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Sa(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:tt.includes(t)?t:Tr,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"},br)}async createMessage(e,t){return this.request({method:"sampling/createMessage",params:e},Ts,t)}async elicitInput(e,t){let s=await this.request({method:"elicitation/create",params:e},$s,t);if(s.action==="accept"&&s.content)try{let r=new _l.default,n=r.compile(e.requestedSchema);if(!n(s.content))throw new Ae(De.InvalidParams,`Elicitation response content does not match requested schema: ${r.errorsText(n.errors)}`)}catch(r){throw r instanceof Ae?r:new Ae(De.InternalError,`Error validating elicitation response: ${r}`)}return s}async listRoots(e,t){return this.request({method:"roots/list",params:e},Cs,t)}async sendLoggingMessage(e,t){if(this._capabilities.logging&&(!t||!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 Ol=require("node:crypto");var El=pr(wl());function Ht(a,{limit:e,encoding:t}){let s=El.default.parse(e);return new Promise((r,n)=>{let o=0,i=[];a.on("data",u=>{if(o+=u.length,o>s)return n(new Error(`Message size exceeds limit of ${e} bytes`));i.push(u)}),a.on("end",()=>{try{r(Buffer.concat(i).toString(t))}catch(u){n(u)}}),a.on("error",u=>{n(u)})})}var Tl=pr(nn(),1),$l=require("url"),Op="4mb",Ja=class{constructor(e,t,s){this._endpoint=e,this.res=t,this._sessionId=(0,Ol.randomUUID)(),this._options=s||{enableDnsRebindingProtection:!1}}validateRequestHeaders(e){if(this._options.enableDnsRebindingProtection){if(this._options.allowedHosts&&this._options.allowedHosts.length>0){let t=e.headers.host;if(!t||!this._options.allowedHosts.includes(t))return`Invalid Host header: ${t}`}if(this._options.allowedOrigins&&this._options.allowedOrigins.length>0){let t=e.headers.origin;if(!t||!this._options.allowedOrigins.includes(t))return`Invalid Origin header: ${t}`}}}async start(){if(this._sseResponse)throw new Error("SSEServerTransport already started! If using Server class, note that connect() calls start() automatically.");this.res.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive"});let e="http://localhost",t=new $l.URL(this._endpoint,e);t.searchParams.set("sessionId",this._sessionId);let s=t.pathname+t.search+t.hash;this.res.write(`event: endpoint
|
|
1
|
+
"use strict";var Du=Object.create;var ua=Object.defineProperty;var ju=Object.getOwnPropertyDescriptor;var Nu=Object.getOwnPropertyNames;var Lu=Object.getPrototypeOf,Fu=Object.prototype.hasOwnProperty;var z=(a,e)=>()=>(e||a((e={exports:{}}).exports,e),e.exports),zn=(a,e)=>{for(var t in e)ua(a,t,{get:e[t],enumerable:!0})},Vn=(a,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Nu(e))!Fu.call(a,r)&&r!==t&&ua(a,r,{get:()=>e[r],enumerable:!(s=ju(e,r))||s.enumerable});return a};var pr=(a,e,t)=>(t=a!=null?Du(Lu(a)):{},Vn(e||!a||!a.__esModule?ua(t,"default",{value:a,enumerable:!0}):t,a)),Mu=a=>Vn(ua({},"__esModule",{value:!0}),a);var _o=z((Ra,yo)=>{(function(a,e){typeof Ra=="object"&&typeof yo!="undefined"?e(Ra):typeof define=="function"&&define.amd?define(["exports"],e):e(a.URI=a.URI||{})})(Ra,(function(a){"use strict";function e(){for(var _=arguments.length,h=Array(_),b=0;b<_;b++)h[b]=arguments[b];if(h.length>1){h[0]=h[0].slice(0,-1);for(var w=h.length-1,E=1;E<w;++E)h[E]=h[E].slice(1,-1);return h[w]=h[w].slice(1),h.join("")}else return h[0]}function t(_){return"(?:"+_+")"}function s(_){return _===void 0?"undefined":_===null?"null":Object.prototype.toString.call(_).split(" ").pop().split("]").shift().toLowerCase()}function r(_){return _.toUpperCase()}function n(_){return _!=null?_ instanceof Array?_:typeof _.length!="number"||_.split||_.setInterval||_.call?[_]:Array.prototype.slice.call(_):[]}function o(_,h){var b=_;if(h)for(var w in h)b[w]=h[w];return b}function i(_){var h="[A-Za-z]",b="[\\x0D]",w="[0-9]",E="[\\x22]",N=e(w,"[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)),be="[\\:\\/\\?\\#\\[\\]\\@]",te="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",he=e(be,te),xe=_?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",de=_?"[\\uE000-\\uF8FF]":"[]",ne=e(h,w,"[\\-\\.\\_\\~]",xe),pe=t(h+e(h,w,"[\\+\\-\\.]")+"*"),ce=t(t(ie+"|"+e(ne,te,"[\\:]"))+"*"),Lr=t(t("25[0-5]")+"|"+t("2[0-4]"+w)+"|"+t("1"+w+w)+"|"+t("[1-9]"+w)+"|"+w),Ue=t(t("25[0-5]")+"|"+t("2[0-4]"+w)+"|"+t("1"+w+w)+"|"+t("0?[1-9]"+w)+"|0?0?"+w),He=t(Ue+"\\."+Ue+"\\."+Ue+"\\."+Ue),ue=t(N+"{1,4}"),ze=t(t(ue+"\\:"+ue)+"|"+He),Ze=t(t(ue+"\\:")+"{6}"+ze),sr=t("\\:\\:"+t(ue+"\\:")+"{5}"+ze),Fr=t(t(ue)+"?\\:\\:"+t(ue+"\\:")+"{4}"+ze),dr=t(t(t(ue+"\\:")+"{0,1}"+ue)+"?\\:\\:"+t(ue+"\\:")+"{3}"+ze),Ct=t(t(t(ue+"\\:")+"{0,2}"+ue)+"?\\:\\:"+t(ue+"\\:")+"{2}"+ze),ia=t(t(t(ue+"\\:")+"{0,3}"+ue)+"?\\:\\:"+ue+"\\:"+ze),la=t(t(t(ue+"\\:")+"{0,4}"+ue)+"?\\:\\:"+ze),ut=t(t(t(ue+"\\:")+"{0,5}"+ue)+"?\\:\\:"+ue),dt=t(t(t(ue+"\\:")+"{0,6}"+ue)+"?\\:\\:"),fr=t([Ze,sr,Fr,dr,Ct,ia,la,ut,dt].join("|")),ft=t(t(ne+"|"+ie)+"+"),cs=t(fr+"\\%25"+ft),Mr=t(fr+t("\\%25|\\%(?!"+N+"{2})")+ft),Ou=t("[vV]"+N+"+\\."+e(ne,te,"[\\:]")+"+"),Tu=t("\\["+t(Mr+"|"+fr+"|"+Ou)+"\\]"),Fn=t(t(ie+"|"+e(ne,te))+"*"),kt=t(Tu+"|"+He+"(?!"+Fn+")|"+Fn),Dt=t(w+"*"),Mn=t(t(ce+"@")+"?"+kt+t("\\:"+Dt)+"?"),jt=t(ie+"|"+e(ne,te,"[\\:\\@]")),$u=t(jt+"*"),qn=t(jt+"+"),Au=t(t(ie+"|"+e(ne,te,"[\\@]"))+"+"),hr=t(t("\\/"+$u)+"*"),ht=t("\\/"+t(qn+hr)+"?"),us=t(Au+hr),ca=t(qn+hr),pt="(?!"+jt+")",Lm=t(hr+"|"+ht+"|"+us+"|"+ca+"|"+pt),mt=t(t(jt+"|"+e("[\\/\\?]",de))+"*"),Nt=t(t(jt+"|[\\/\\?]")+"*"),Un=t(t("\\/\\/"+Mn+hr)+"|"+ht+"|"+ca+"|"+pt),Iu=t(pe+"\\:"+Un+t("\\?"+mt)+"?"+t("\\#"+Nt)+"?"),Cu=t(t("\\/\\/"+Mn+hr)+"|"+ht+"|"+us+"|"+pt),ku=t(Cu+t("\\?"+mt)+"?"+t("\\#"+Nt)+"?"),Fm=t(Iu+"|"+ku),Mm=t(pe+"\\:"+Un+t("\\?"+mt)+"?"),qm="^("+pe+")\\:"+t(t("\\/\\/("+t("("+ce+")@")+"?("+kt+")"+t("\\:("+Dt+")")+"?)")+"?("+hr+"|"+ht+"|"+ca+"|"+pt+")")+t("\\?("+mt+")")+"?"+t("\\#("+Nt+")")+"?$",Um="^(){0}"+t(t("\\/\\/("+t("("+ce+")@")+"?("+kt+")"+t("\\:("+Dt+")")+"?)")+"?("+hr+"|"+ht+"|"+us+"|"+pt+")")+t("\\?("+mt+")")+"?"+t("\\#("+Nt+")")+"?$",zm="^("+pe+")\\:"+t(t("\\/\\/("+t("("+ce+")@")+"?("+kt+")"+t("\\:("+Dt+")")+"?)")+"?("+hr+"|"+ht+"|"+ca+"|"+pt+")")+t("\\?("+mt+")")+"?$",Vm="^"+t("\\#("+Nt+")")+"?$",Hm="^"+t("("+ce+")@")+"?("+kt+")"+t("\\:("+Dt+")")+"?$";return{NOT_SCHEME:new RegExp(e("[^]",h,w,"[\\+\\-\\.]"),"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,"[\\:\\@\\/\\?]",de),"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,he),"g"),PCT_ENCODED:new RegExp(ie,"g"),IPV4ADDRESS:new RegExp("^("+He+")$"),IPV6ADDRESS:new RegExp("^\\[?("+fr+")"+t(t("\\%25|\\%(?!"+N+"{2})")+"("+ft+")")+"?\\]?$")}}var u=i(!1),c=i(!0),f=(function(){function _(h,b){var w=[],E=!0,N=!1,K=void 0;try{for(var ae=h[Symbol.iterator](),ie;!(E=(ie=ae.next()).done)&&(w.push(ie.value),!(b&&w.length===b));E=!0);}catch(be){N=!0,K=be}finally{try{!E&&ae.return&&ae.return()}finally{if(N)throw K}}return w}return function(h,b){if(Array.isArray(h))return h;if(Symbol.iterator in Object(h))return _(h,b);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),p=function(_){if(Array.isArray(_)){for(var h=0,b=Array(_.length);h<_.length;h++)b[h]=_[h];return b}else return Array.from(_)},g=2147483647,d=36,y=1,m=26,v=38,x=700,S=72,P=128,O="-",A=/^xn--/,I=/[^\0-\x7E]/,H=/[\x2E\u3002\uFF0E\uFF61]/g,q={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},C=d-y,U=Math.floor,M=String.fromCharCode;function L(_){throw new RangeError(q[_])}function $(_,h){for(var b=[],w=_.length;w--;)b[w]=h(_[w]);return b}function k(_,h){var b=_.split("@"),w="";b.length>1&&(w=b[0]+"@",_=b[1]),_=_.replace(H,".");var E=_.split("."),N=$(E,h).join(".");return w+N}function F(_){for(var h=[],b=0,w=_.length;b<w;){var E=_.charCodeAt(b++);if(E>=55296&&E<=56319&&b<w){var N=_.charCodeAt(b++);(N&64512)==56320?h.push(((E&1023)<<10)+(N&1023)+65536):(h.push(E),b--)}else h.push(E)}return h}var le=function(h){return String.fromCodePoint.apply(String,p(h))},Y=function(h){return h-48<10?h-22:h-65<26?h-65:h-97<26?h-97:d},re=function(h,b){return h+22+75*(h<26)-((b!=0)<<5)},W=function(h,b,w){var E=0;for(h=w?U(h/x):h>>1,h+=U(h/b);h>C*m>>1;E+=d)h=U(h/C);return U(E+(C+1)*h/(h+v))},Z=function(h){var b=[],w=h.length,E=0,N=P,K=S,ae=h.lastIndexOf(O);ae<0&&(ae=0);for(var ie=0;ie<ae;++ie)h.charCodeAt(ie)>=128&&L("not-basic"),b.push(h.charCodeAt(ie));for(var be=ae>0?ae+1:0;be<w;){for(var te=E,he=1,xe=d;;xe+=d){be>=w&&L("invalid-input");var de=Y(h.charCodeAt(be++));(de>=d||de>U((g-E)/he))&&L("overflow"),E+=de*he;var ne=xe<=K?y:xe>=K+m?m:xe-K;if(de<ne)break;var pe=d-ne;he>U(g/pe)&&L("overflow"),he*=pe}var ce=b.length+1;K=W(E-te,ce,te==0),U(E/ce)>g-N&&L("overflow"),N+=U(E/ce),E%=ce,b.splice(E++,0,N)}return String.fromCodePoint.apply(String,b)},me=function(h){var b=[];h=F(h);var w=h.length,E=P,N=0,K=S,ae=!0,ie=!1,be=void 0;try{for(var te=h[Symbol.iterator](),he;!(ae=(he=te.next()).done);ae=!0){var xe=he.value;xe<128&&b.push(M(xe))}}catch(Mr){ie=!0,be=Mr}finally{try{!ae&&te.return&&te.return()}finally{if(ie)throw be}}var de=b.length,ne=de;for(de&&b.push(O);ne<w;){var pe=g,ce=!0,Lr=!1,Ue=void 0;try{for(var He=h[Symbol.iterator](),ue;!(ce=(ue=He.next()).done);ce=!0){var ze=ue.value;ze>=E&&ze<pe&&(pe=ze)}}catch(Mr){Lr=!0,Ue=Mr}finally{try{!ce&&He.return&&He.return()}finally{if(Lr)throw Ue}}var Ze=ne+1;pe-E>U((g-N)/Ze)&&L("overflow"),N+=(pe-E)*Ze,E=pe;var sr=!0,Fr=!1,dr=void 0;try{for(var Ct=h[Symbol.iterator](),ia;!(sr=(ia=Ct.next()).done);sr=!0){var la=ia.value;if(la<E&&++N>g&&L("overflow"),la==E){for(var ut=N,dt=d;;dt+=d){var fr=dt<=K?y:dt>=K+m?m:dt-K;if(ut<fr)break;var ft=ut-fr,cs=d-fr;b.push(M(re(fr+ft%cs,0))),ut=U(ft/cs)}b.push(M(re(ut,0))),K=W(N,Ze,ne==de),N=0,++ne}}}catch(Mr){Fr=!0,dr=Mr}finally{try{!sr&&Ct.return&&Ct.return()}finally{if(Fr)throw dr}}++N,++E}return b.join("")},Oe=function(h){return k(h,function(b){return A.test(b)?Z(b.slice(4).toLowerCase()):b})},Ie=function(h){return k(h,function(b){return I.test(b)?"xn--"+me(b):b})},se={version:"2.1.0",ucs2:{decode:F,encode:le},decode:Z,encode:me,toASCII:Ie,toUnicode:Oe},ye={};function Ee(_){var h=_.charCodeAt(0),b=void 0;return h<16?b="%0"+h.toString(16).toUpperCase():h<128?b="%"+h.toString(16).toUpperCase():h<2048?b="%"+(h>>6|192).toString(16).toUpperCase()+"%"+(h&63|128).toString(16).toUpperCase():b="%"+(h>>12|224).toString(16).toUpperCase()+"%"+(h>>6&63|128).toString(16).toUpperCase()+"%"+(h&63|128).toString(16).toUpperCase(),b}function Ce(_){for(var h="",b=0,w=_.length;b<w;){var E=parseInt(_.substr(b+1,2),16);if(E<128)h+=String.fromCharCode(E),b+=3;else if(E>=194&&E<224){if(w-b>=6){var N=parseInt(_.substr(b+4,2),16);h+=String.fromCharCode((E&31)<<6|N&63)}else h+=_.substr(b,6);b+=6}else if(E>=224){if(w-b>=9){var K=parseInt(_.substr(b+4,2),16),ae=parseInt(_.substr(b+7,2),16);h+=String.fromCharCode((E&15)<<12|(K&63)<<6|ae&63)}else h+=_.substr(b,9);b+=9}else h+=_.substr(b,3),b+=3}return h}function wr(_,h){function b(w){var E=Ce(w);return E.match(h.UNRESERVED)?E:w}return _.scheme&&(_.scheme=String(_.scheme).replace(h.PCT_ENCODED,b).toLowerCase().replace(h.NOT_SCHEME,"")),_.userinfo!==void 0&&(_.userinfo=String(_.userinfo).replace(h.PCT_ENCODED,b).replace(h.NOT_USERINFO,Ee).replace(h.PCT_ENCODED,r)),_.host!==void 0&&(_.host=String(_.host).replace(h.PCT_ENCODED,b).toLowerCase().replace(h.NOT_HOST,Ee).replace(h.PCT_ENCODED,r)),_.path!==void 0&&(_.path=String(_.path).replace(h.PCT_ENCODED,b).replace(_.scheme?h.NOT_PATH:h.NOT_PATH_NOSCHEME,Ee).replace(h.PCT_ENCODED,r)),_.query!==void 0&&(_.query=String(_.query).replace(h.PCT_ENCODED,b).replace(h.NOT_QUERY,Ee).replace(h.PCT_ENCODED,r)),_.fragment!==void 0&&(_.fragment=String(_.fragment).replace(h.PCT_ENCODED,b).replace(h.NOT_FRAGMENT,Ee).replace(h.PCT_ENCODED,r)),_}function cr(_){return _.replace(/^0*(.*)/,"$1")||"0"}function _e(_,h){var b=_.match(h.IPV4ADDRESS)||[],w=f(b,2),E=w[1];return E?E.split(".").map(cr).join("."):_}function ve(_,h){var b=_.match(h.IPV6ADDRESS)||[],w=f(b,3),E=w[1],N=w[2];if(E){for(var K=E.toLowerCase().split("::").reverse(),ae=f(K,2),ie=ae[0],be=ae[1],te=be?be.split(":").map(cr):[],he=ie.split(":").map(cr),xe=h.IPV4ADDRESS.test(he[he.length-1]),de=xe?7:8,ne=he.length-de,pe=Array(de),ce=0;ce<de;++ce)pe[ce]=te[ce]||he[ne+ce]||"";xe&&(pe[de-1]=_e(pe[de-1],h));var Lr=pe.reduce(function(Ze,sr,Fr){if(!sr||sr==="0"){var dr=Ze[Ze.length-1];dr&&dr.index+dr.length===Fr?dr.length++:Ze.push({index:Fr,length:1})}return Ze},[]),Ue=Lr.sort(function(Ze,sr){return sr.length-Ze.length})[0],He=void 0;if(Ue&&Ue.length>1){var ue=pe.slice(0,Ue.index),ze=pe.slice(Ue.index+Ue.length);He=ue.join(":")+"::"+ze.join(":")}else He=pe.join(":");return N&&(He+="%"+N),He}else return _}var Dr=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,Te="".match(/(){0}/)[1]===void 0;function oe(_){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},b={},w=h.iri!==!1?c:u;h.reference==="suffix"&&(_=(h.scheme?h.scheme+":":"")+"//"+_);var E=_.match(Dr);if(E){Te?(b.scheme=E[1],b.userinfo=E[3],b.host=E[4],b.port=parseInt(E[5],10),b.path=E[6]||"",b.query=E[7],b.fragment=E[8],isNaN(b.port)&&(b.port=E[5])):(b.scheme=E[1]||void 0,b.userinfo=_.indexOf("@")!==-1?E[3]:void 0,b.host=_.indexOf("//")!==-1?E[4]:void 0,b.port=parseInt(E[5],10),b.path=E[6]||"",b.query=_.indexOf("?")!==-1?E[7]:void 0,b.fragment=_.indexOf("#")!==-1?E[8]:void 0,isNaN(b.port)&&(b.port=_.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?E[4]:void 0)),b.host&&(b.host=ve(_e(b.host,w),w)),b.scheme===void 0&&b.userinfo===void 0&&b.host===void 0&&b.port===void 0&&!b.path&&b.query===void 0?b.reference="same-document":b.scheme===void 0?b.reference="relative":b.fragment===void 0?b.reference="absolute":b.reference="uri",h.reference&&h.reference!=="suffix"&&h.reference!==b.reference&&(b.error=b.error||"URI is not a "+h.reference+" reference.");var N=ye[(h.scheme||b.scheme||"").toLowerCase()];if(!h.unicodeSupport&&(!N||!N.unicodeSupport)){if(b.host&&(h.domainHost||N&&N.domainHost))try{b.host=se.toASCII(b.host.replace(w.PCT_ENCODED,Ce).toLowerCase())}catch(K){b.error=b.error||"Host's domain name can not be converted to ASCII via punycode: "+K}wr(b,u)}else wr(b,w);N&&N.parse&&N.parse(b,h)}else b.error=b.error||"URI can not be parsed.";return b}function Er(_,h){var b=h.iri!==!1?c:u,w=[];return _.userinfo!==void 0&&(w.push(_.userinfo),w.push("@")),_.host!==void 0&&w.push(ve(_e(String(_.host),b),b).replace(b.IPV6ADDRESS,function(E,N,K){return"["+N+(K?"%25"+K:"")+"]"})),(typeof _.port=="number"||typeof _.port=="string")&&(w.push(":"),w.push(String(_.port))),w.length?w.join(""):void 0}var ur=/^\.\.?\//,jr=/^\/\.(\/|$)/,Nr=/^\/\.\.(\/|$)/,Se=/^\/?(?:.|\n)*?(?=\/|$)/;function Ve(_){for(var h=[];_.length;)if(_.match(ur))_=_.replace(ur,"");else if(_.match(jr))_=_.replace(jr,"/");else if(_.match(Nr))_=_.replace(Nr,"/"),h.pop();else if(_==="."||_==="..")_="";else{var b=_.match(Se);if(b){var w=b[0];_=_.slice(w.length),h.push(w)}else throw new Error("Unexpected dot segment condition")}return h.join("")}function Ne(_){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},b=h.iri?c:u,w=[],E=ye[(h.scheme||_.scheme||"").toLowerCase()];if(E&&E.serialize&&E.serialize(_,h),_.host&&!b.IPV6ADDRESS.test(_.host)){if(h.domainHost||E&&E.domainHost)try{_.host=h.iri?se.toUnicode(_.host):se.toASCII(_.host.replace(b.PCT_ENCODED,Ce).toLowerCase())}catch(ae){_.error=_.error||"Host's domain name can not be converted to "+(h.iri?"Unicode":"ASCII")+" via punycode: "+ae}}wr(_,b),h.reference!=="suffix"&&_.scheme&&(w.push(_.scheme),w.push(":"));var N=Er(_,h);if(N!==void 0&&(h.reference!=="suffix"&&w.push("//"),w.push(N),_.path&&_.path.charAt(0)!=="/"&&w.push("/")),_.path!==void 0){var K=_.path;!h.absolutePath&&(!E||!E.absolutePath)&&(K=Ve(K)),N===void 0&&(K=K.replace(/^\/\//,"/%2F")),w.push(K)}return _.query!==void 0&&(w.push("?"),w.push(_.query)),_.fragment!==void 0&&(w.push("#"),w.push(_.fragment)),w.join("")}function ke(_,h){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},w=arguments[3],E={};return w||(_=oe(Ne(_,b),b),h=oe(Ne(h,b),b)),b=b||{},!b.tolerant&&h.scheme?(E.scheme=h.scheme,E.userinfo=h.userinfo,E.host=h.host,E.port=h.port,E.path=Ve(h.path||""),E.query=h.query):(h.userinfo!==void 0||h.host!==void 0||h.port!==void 0?(E.userinfo=h.userinfo,E.host=h.host,E.port=h.port,E.path=Ve(h.path||""),E.query=h.query):(h.path?(h.path.charAt(0)==="/"?E.path=Ve(h.path):((_.userinfo!==void 0||_.host!==void 0||_.port!==void 0)&&!_.path?E.path="/"+h.path:_.path?E.path=_.path.slice(0,_.path.lastIndexOf("/")+1)+h.path:E.path=h.path,E.path=Ve(E.path)),E.query=h.query):(E.path=_.path,h.query!==void 0?E.query=h.query:E.query=_.query),E.userinfo=_.userinfo,E.host=_.host,E.port=_.port),E.scheme=_.scheme),E.fragment=h.fragment,E}function tr(_,h,b){var w=o({scheme:"null"},b);return Ne(ke(oe(_,w),oe(h,w),w,!0),w)}function qe(_,h){return typeof _=="string"?_=Ne(oe(_,h),h):s(_)==="object"&&(_=oe(Ne(_,h),h)),_}function oa(_,h,b){return typeof _=="string"?_=Ne(oe(_,b),b):s(_)==="object"&&(_=Ne(_,b)),typeof h=="string"?h=Ne(oe(h,b),b):s(h)==="object"&&(h=Ne(h,b)),_===h}function is(_,h){return _&&_.toString().replace(!h||!h.iri?u.ESCAPE:c.ESCAPE,Ee)}function We(_,h){return _&&_.toString().replace(!h||!h.iri?u.PCT_ENCODED:c.PCT_ENCODED,Ce)}var At={scheme:"http",domainHost:!0,parse:function(h,b){return h.host||(h.error=h.error||"HTTP URIs must have a host."),h},serialize:function(h,b){var w=String(h.scheme).toLowerCase()==="https";return(h.port===(w?443:80)||h.port==="")&&(h.port=void 0),h.path||(h.path="/"),h}},An={scheme:"https",domainHost:At.domainHost,parse:At.parse,serialize:At.serialize};function In(_){return typeof _.secure=="boolean"?_.secure:String(_.scheme).toLowerCase()==="wss"}var It={scheme:"ws",domainHost:!0,parse:function(h,b){var w=h;return w.secure=In(w),w.resourceName=(w.path||"/")+(w.query?"?"+w.query:""),w.path=void 0,w.query=void 0,w},serialize:function(h,b){if((h.port===(In(h)?443:80)||h.port==="")&&(h.port=void 0),typeof h.secure=="boolean"&&(h.scheme=h.secure?"wss":"ws",h.secure=void 0),h.resourceName){var w=h.resourceName.split("?"),E=f(w,2),N=E[0],K=E[1];h.path=N&&N!=="/"?N:void 0,h.query=K,h.resourceName=void 0}return h.fragment=void 0,h}},Cn={scheme:"wss",domainHost:It.domainHost,parse:It.parse,serialize:It.serialize},mu={},vu=!0,kn="[A-Za-z0-9\\-\\.\\_\\~"+(vu?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]",ar="[0-9A-Fa-f]",gu=t(t("%[EFef]"+ar+"%"+ar+ar+"%"+ar+ar)+"|"+t("%[89A-Fa-f]"+ar+"%"+ar+ar)+"|"+t("%"+ar+ar)),yu="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",_u="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",bu=e(_u,'[\\"\\\\]'),xu="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",wu=new RegExp(kn,"g"),ct=new RegExp(gu,"g"),Eu=new RegExp(e("[^]",yu,"[\\.]",'[\\"]',bu),"g"),Dn=new RegExp(e("[^]",kn,xu),"g"),Pu=Dn;function ls(_){var h=Ce(_);return h.match(wu)?h:_}var jn={scheme:"mailto",parse:function(h,b){var w=h,E=w.to=w.path?w.path.split(","):[];if(w.path=void 0,w.query){for(var N=!1,K={},ae=w.query.split("&"),ie=0,be=ae.length;ie<be;++ie){var te=ae[ie].split("=");switch(te[0]){case"to":for(var he=te[1].split(","),xe=0,de=he.length;xe<de;++xe)E.push(he[xe]);break;case"subject":w.subject=We(te[1],b);break;case"body":w.body=We(te[1],b);break;default:N=!0,K[We(te[0],b)]=We(te[1],b);break}}N&&(w.headers=K)}w.query=void 0;for(var ne=0,pe=E.length;ne<pe;++ne){var ce=E[ne].split("@");if(ce[0]=We(ce[0]),b.unicodeSupport)ce[1]=We(ce[1],b).toLowerCase();else try{ce[1]=se.toASCII(We(ce[1],b).toLowerCase())}catch(Lr){w.error=w.error||"Email address's domain name can not be converted to ASCII via punycode: "+Lr}E[ne]=ce.join("@")}return w},serialize:function(h,b){var w=h,E=n(h.to);if(E){for(var N=0,K=E.length;N<K;++N){var ae=String(E[N]),ie=ae.lastIndexOf("@"),be=ae.slice(0,ie).replace(ct,ls).replace(ct,r).replace(Eu,Ee),te=ae.slice(ie+1);try{te=b.iri?se.toUnicode(te):se.toASCII(We(te,b).toLowerCase())}catch(ne){w.error=w.error||"Email address's domain name can not be converted to "+(b.iri?"Unicode":"ASCII")+" via punycode: "+ne}E[N]=be+"@"+te}w.path=E.join(",")}var he=h.headers=h.headers||{};h.subject&&(he.subject=h.subject),h.body&&(he.body=h.body);var xe=[];for(var de in he)he[de]!==mu[de]&&xe.push(de.replace(ct,ls).replace(ct,r).replace(Dn,Ee)+"="+he[de].replace(ct,ls).replace(ct,r).replace(Pu,Ee));return xe.length&&(w.query=xe.join("&")),w}},Su=/^([^\:]+)\:(.*)/,Nn={scheme:"urn",parse:function(h,b){var w=h.path&&h.path.match(Su),E=h;if(w){var N=b.scheme||E.scheme||"urn",K=w[1].toLowerCase(),ae=w[2],ie=N+":"+(b.nid||K),be=ye[ie];E.nid=K,E.nss=ae,E.path=void 0,be&&(E=be.parse(E,b))}else E.error=E.error||"URN can not be parsed.";return E},serialize:function(h,b){var w=b.scheme||h.scheme||"urn",E=h.nid,N=w+":"+(b.nid||E),K=ye[N];K&&(h=K.serialize(h,b));var ae=h,ie=h.nss;return ae.path=(E||b.nid)+":"+ie,ae}},Ru=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Ln={scheme:"urn:uuid",parse:function(h,b){var w=h;return w.uuid=w.nss,w.nss=void 0,!b.tolerant&&(!w.uuid||!w.uuid.match(Ru))&&(w.error=w.error||"UUID is not valid."),w},serialize:function(h,b){var w=h;return w.nss=(h.uuid||"").toLowerCase(),w}};ye[At.scheme]=At,ye[An.scheme]=An,ye[It.scheme]=It,ye[Cn.scheme]=Cn,ye[jn.scheme]=jn,ye[Nn.scheme]=Nn,ye[Ln.scheme]=Ln,a.SCHEMES=ye,a.pctEncChar=Ee,a.pctDecChars=Ce,a.parse=oe,a.removeDotSegments=Ve,a.serialize=Ne,a.resolveComponents=ke,a.resolve=tr,a.normalize=qe,a.equal=oa,a.escapeComponent=is,a.unescapeComponent=We,Object.defineProperty(a,"__esModule",{value:!0})}))});var Oa=z(($v,bo)=>{"use strict";bo.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 o=n[r];if(!a(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}});var wo=z((Av,xo)=>{"use strict";xo.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 st=z((Iv,So)=>{"use strict";So.exports={copy:Lf,checkDataType:ks,checkDataTypes:Ff,coerceToTypes:Mf,toHash:js,getProperty:Ns,escapeQuotes:Ls,equal:Oa(),ucs2length:wo(),varOccurences:zf,varReplace:Vf,schemaHasRules:Hf,schemaHasRulesExcept:Zf,schemaUnknownRules:Bf,toQuotedString:Ds,getPathExpr:Jf,getPath:Qf,getData:Wf,unescapeFragment:Yf,unescapeJsonPointer:Ms,escapeFragment:Xf,escapeJsonPointer:Fs};function Lf(a,e){e=e||{};for(var t in a)e[t]=a[t];return e}function ks(a,e,t,s){var r=s?" !== ":" === ",n=s?" || ":" && ",o=s?"!":"",i=s?"":"!";switch(a){case"null":return e+r+"null";case"array":return o+"Array.isArray("+e+")";case"object":return"("+o+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+o+"isFinite("+e+")":"")+")";case"number":return"(typeof "+e+r+'"'+a+'"'+(t?n+o+"isFinite("+e+")":"")+")";default:return"typeof "+e+r+'"'+a+'"'}}function Ff(a,e,t){switch(a.length){case 1:return ks(a[0],e,t,!0);default:var s="",r=js(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?" && ":"")+ks(n,e,t,!0);return s}}var Eo=js(["string","number","integer","boolean","null"]);function Mf(a,e){if(Array.isArray(e)){for(var t=[],s=0;s<e.length;s++){var r=e[s];(Eo[r]||a==="array"&&r==="array")&&(t[t.length]=r)}if(t.length)return t}else{if(Eo[e])return[e];if(a==="array"&&e==="array")return["array"]}}function js(a){for(var e={},t=0;t<a.length;t++)e[a[t]]=!0;return e}var qf=/^[a-z$_][a-z$_0-9]*$/i,Uf=/'|\\/g;function Ns(a){return typeof a=="number"?"["+a+"]":qf.test(a)?"."+a:"['"+Ls(a)+"']"}function Ls(a){return a.replace(Uf,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function zf(a,e){e+="[^0-9]";var t=a.match(new RegExp(e,"g"));return t?t.length:0}function Vf(a,e,t){return e+="([^0-9])",t=t.replace(/\$/g,"$$$$"),a.replace(new RegExp(e,"g"),t+"$1")}function Hf(a,e){if(typeof a=="boolean")return!a;for(var t in a)if(e[t])return!0}function Zf(a,e,t){if(typeof a=="boolean")return!a&&t!="not";for(var s in a)if(s!=t&&e[s])return!0}function Bf(a,e){if(typeof a!="boolean"){for(var t in a)if(!e[t])return t}}function Ds(a){return"'"+Ls(a)+"'"}function Jf(a,e,t,s){var r=t?"'/' + "+e+(s?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):s?"'[' + "+e+" + ']'":"'[\\'' + "+e+" + '\\']'";return Po(a,r)}function Qf(a,e,t){var s=Ds(t?"/"+Fs(e):Ns(e));return Po(a,s)}var Kf=/^\/(?:[^~]|~0|~1)*$/,Gf=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Wf(a,e,t){var s,r,n,o;if(a==="")return"rootData";if(a[0]=="/"){if(!Kf.test(a))throw new Error("Invalid JSON-pointer: "+a);r=a,n="rootData"}else{if(o=a.match(Gf),!o)throw new Error("Invalid JSON-pointer: "+a);if(s=+o[1],r=o[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,u=r.split("/"),c=0;c<u.length;c++){var f=u[c];f&&(n+=Ns(Ms(f)),i+=" && "+n)}return i}function Po(a,e){return a=='""'?e:(a+" + "+e).replace(/([^\\])' \+ '/g,"$1")}function Yf(a){return Ms(decodeURIComponent(a))}function Xf(a){return encodeURIComponent(Fs(a))}function Fs(a){return a.replace(/~/g,"~0").replace(/\//g,"~1")}function Ms(a){return a.replace(/~1/g,"/").replace(/~0/g,"~")}});var qs=z((Cv,Ro)=>{"use strict";var eh=st();Ro.exports=rh;function rh(a){eh.copy(a,this)}});var To=z((kv,Oo)=>{"use strict";var $r=Oo.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(){};Ta(e,s,r,a,"",a)};$r.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0};$r.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};$r.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};$r.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 Ta(a,e,t,s,r,n,o,i,u,c){if(s&&typeof s=="object"&&!Array.isArray(s)){e(s,r,n,o,i,u,c);for(var f in s){var p=s[f];if(Array.isArray(p)){if(f in $r.arrayKeywords)for(var g=0;g<p.length;g++)Ta(a,e,t,p[g],r+"/"+f+"/"+g,n,r,f,s,g)}else if(f in $r.propsKeywords){if(p&&typeof p=="object")for(var d in p)Ta(a,e,t,p[d],r+"/"+f+"/"+th(d),n,r,f,s,d)}else(f in $r.keywords||a.allKeys&&!(f in $r.skipKeywords))&&Ta(a,e,t,p,r+"/"+f,n,r,f,s)}t(s,r,n,o,i,u,c)}}function th(a){return a.replace(/~/g,"~0").replace(/\//g,"~1")}});var Da=z((Dv,Co)=>{"use strict";var Vt=_o(),$o=Oa(),Ca=st(),$a=qs(),ah=To();Co.exports=Ir;Ir.normalizeId=Ar;Ir.fullPath=Aa;Ir.url=Ia;Ir.ids=lh;Ir.inlineRef=Us;Ir.schema=ka;function Ir(a,e,t){var s=this._refs[t];if(typeof s=="string")if(this._refs[s])s=this._refs[s];else return Ir.call(this,a,e,s);if(s=s||this._schemas[t],s instanceof $a)return Us(s.schema,this._opts.inlineRefs)?s.schema:s.validate||this._compile(s);var r=ka.call(this,e,t),n,o,i;return r&&(n=r.schema,e=r.root,i=r.baseId),n instanceof $a?o=n.validate||a.call(this,n.schema,e,void 0,i):n!==void 0&&(o=Us(n,this._opts.inlineRefs)?n:a.call(this,n,e,void 0,i)),o}function ka(a,e){var t=Vt.parse(e),s=Io(t),r=Aa(this._getId(a.schema));if(Object.keys(a.schema).length===0||s!==r){var n=Ar(s),o=this._refs[n];if(typeof o=="string")return sh.call(this,a,o,t);if(o instanceof $a)o.validate||this._compile(o),a=o;else if(o=this._schemas[n],o instanceof $a){if(o.validate||this._compile(o),n==Ar(e))return{schema:o,root:a,baseId:r};a=o}else return;if(!a.schema)return;r=Aa(this._getId(a.schema))}return Ao.call(this,t,r,a.schema,a)}function sh(a,e,t){var s=ka.call(this,a,e);if(s){var r=s.schema,n=s.baseId;a=s.root;var o=this._getId(r);return o&&(n=Ia(n,o)),Ao.call(this,t,n,r,a)}}var nh=Ca.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function Ao(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 o=r[n];if(o){if(o=Ca.unescapeFragment(o),t=t[o],t===void 0)break;var i;if(!nh[o]&&(i=this._getId(t),i&&(e=Ia(e,i)),t.$ref)){var u=Ia(e,t.$ref),c=ka.call(this,s,u);c&&(t=c.schema,s=c.root,e=c.baseId)}}}if(t!==void 0&&t!==s.schema)return{schema:t,root:s,baseId:e}}}var oh=Ca.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function Us(a,e){if(e===!1)return!1;if(e===void 0||e===!0)return zs(a);if(e)return Vs(a)<=e}function zs(a){var e;if(Array.isArray(a)){for(var t=0;t<a.length;t++)if(e=a[t],typeof e=="object"&&!zs(e))return!1}else for(var s in a)if(s=="$ref"||(e=a[s],typeof e=="object"&&!zs(e)))return!1;return!0}function Vs(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+=Vs(t)),e==1/0)return 1/0}else for(var r in a){if(r=="$ref")return 1/0;if(oh[r])e++;else if(t=a[r],typeof t=="object"&&(e+=Vs(t)+1),e==1/0)return 1/0}return e}function Aa(a,e){e!==!1&&(a=Ar(a));var t=Vt.parse(a);return Io(t)}function Io(a){return Vt.serialize(a).split("#")[0]+"#"}var ih=/#\/?$/;function Ar(a){return a?a.replace(ih,""):""}function Ia(a,e){return e=Ar(e),Vt.resolve(a,e)}function lh(a){var e=Ar(this._getId(a)),t={"":e},s={"":Aa(e,!1)},r={},n=this;return ah(a,{allKeys:!0},function(o,i,u,c,f,p,g){if(i!==""){var d=n._getId(o),y=t[c],m=s[c]+"/"+f;if(g!==void 0&&(m+="/"+(typeof g=="number"?g:Ca.escapeFragment(g))),typeof d=="string"){d=y=Ar(y?Vt.resolve(y,d):d);var v=n._refs[d];if(typeof v=="string"&&(v=n._refs[v]),v&&v.schema){if(!$o(o,v.schema))throw new Error('id "'+d+'" resolves to more than one schema')}else if(d!=Ar(m))if(d[0]=="#"){if(r[d]&&!$o(o,r[d]))throw new Error('id "'+d+'" resolves to more than one schema');r[d]=o}else n._refs[d]=m}t[i]=y,s[i]=m}}),r}});var ja=z((jv,Do)=>{"use strict";var Hs=Da();Do.exports={Validation:ko(ch),MissingRef:ko(Zs)};function ch(a){this.message="validation failed",this.errors=a,this.ajv=this.validation=!0}Zs.message=function(a,e){return"can't resolve reference "+e+" from id "+a};function Zs(a,e,t){this.message=t||Zs.message(a,e),this.missingRef=Hs.url(a,e),this.missingSchema=Hs.normalizeId(Hs.fullPath(this.missingRef))}function ko(a){return a.prototype=Object.create(Error.prototype),a.prototype.constructor=a,a}});var Bs=z((Nv,jo)=>{"use strict";jo.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(o){return function(i,u){var c={key:i,value:o[i]},f={key:u,value:o[u]};return n(c,f)}}})(e.cmp),r=[];return(function n(o){if(o&&o.toJSON&&typeof o.toJSON=="function"&&(o=o.toJSON()),o!==void 0){if(typeof o=="number")return isFinite(o)?""+o:"null";if(typeof o!="object")return JSON.stringify(o);var i,u;if(Array.isArray(o)){for(u="[",i=0;i<o.length;i++)i&&(u+=","),u+=n(o[i])||"null";return u+"]"}if(o===null)return"null";if(r.indexOf(o)!==-1){if(t)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var c=r.push(o)-1,f=Object.keys(o).sort(s&&s(o));for(u="",i=0;i<f.length;i++){var p=f[i],g=n(o[p]);g&&(u&&(u+=","),u+=JSON.stringify(p)+":"+g)}return r.splice(c,1),"{"+u+"}"}})(a)}});var Js=z((Lv,No)=>{"use strict";No.exports=function(e,t,s){var r="",n=e.schema.$async===!0,o=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),i=e.self._getId(e.schema);if(e.opts.strictKeywords){var u=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(u){var c="unknown keyword: "+u;if(e.opts.strictKeywords==="log")e.logger.warn(c);else throw new Error(c)}}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"||!(o||e.schema.$ref)){var t="false schema",f=e.level,p=e.dataLevel,g=e.schema[t],d=e.schemaPath+e.util.getProperty(t),y=e.errSchemaPath+"/"+t,A=!e.opts.allErrors,q,m="data"+(p||""),O="valid"+f;if(e.schema===!1){e.isTop?A=!0:r+=" var "+O+" = false; ";var v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(q||"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: "+m+" "),r+=" } "):r+=" {} ";var x=r;r=v.pop(),!e.compositeRule&&A?e.async?r+=" throw new ValidationError(["+x+"]); ":r+=" validate.errors = ["+x+"]; return false; ":r+=" var err = "+x+"; 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 "+O+" = true; ";return e.isTop&&(r+=" }; return validate; "),r}if(e.isTop){var S=e.isTop,f=e.level=0,p=e.dataLevel=0,m="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 P="default is ignored in the schema root";if(e.opts.strictDefaults==="log")e.logger.warn(P);else throw new Error(P)}r+=" var vErrors = null; ",r+=" var errors = 0; ",r+=" if (rootData === undefined) rootData = data; "}else{var f=e.level,p=e.dataLevel,m="data"+(p||"");if(i&&(e.baseId=e.resolve.url(e.baseId,i)),n&&!e.async)throw new Error("async schema in sync schema");r+=" var errs_"+f+" = errors;"}var O="valid"+f,A=!e.opts.allErrors,I="",H="",q,C=e.schema.type,U=Array.isArray(C);if(C&&e.opts.nullable&&e.schema.nullable===!0&&(U?C.indexOf("null")==-1&&(C=C.concat("null")):C!="null"&&(C=[C,"null"],U=!0)),U&&C.length==1&&(C=C[0],U=!1),e.schema.$ref&&o){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&&(o=!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")),C){if(e.opts.coerceTypes)var M=e.util.coerceToTypes(e.opts.coerceTypes,C);var L=e.RULES.types[C];if(M||U||L===!0||L&&!Se(L)){var d=e.schemaPath+".type",y=e.errSchemaPath+"/type",d=e.schemaPath+".type",y=e.errSchemaPath+"/type",$=U?"checkDataTypes":"checkDataType";if(r+=" if ("+e.util[$](C,m,e.opts.strictNumbers,!0)+") { ",M){var k="dataType"+f,F="coerced"+f;r+=" var "+k+" = typeof "+m+"; var "+F+" = undefined; ",e.opts.coerceTypes=="array"&&(r+=" if ("+k+" == 'object' && Array.isArray("+m+") && "+m+".length == 1) { "+m+" = "+m+"[0]; "+k+" = typeof "+m+"; if ("+e.util.checkDataType(e.schema.type,m,e.opts.strictNumbers)+") "+F+" = "+m+"; } "),r+=" if ("+F+" !== undefined) ; ";var le=M;if(le)for(var Y,re=-1,W=le.length-1;re<W;)Y=le[re+=1],Y=="string"?r+=" else if ("+k+" == 'number' || "+k+" == 'boolean') "+F+" = '' + "+m+"; else if ("+m+" === null) "+F+" = ''; ":Y=="number"||Y=="integer"?(r+=" else if ("+k+" == 'boolean' || "+m+" === null || ("+k+" == 'string' && "+m+" && "+m+" == +"+m+" ",Y=="integer"&&(r+=" && !("+m+" % 1)"),r+=")) "+F+" = +"+m+"; "):Y=="boolean"?r+=" else if ("+m+" === 'false' || "+m+" === 0 || "+m+" === null) "+F+" = false; else if ("+m+" === 'true' || "+m+" === 1) "+F+" = true; ":Y=="null"?r+=" else if ("+m+" === '' || "+m+" === 0 || "+m+" === false) "+F+" = null; ":e.opts.coerceTypes=="array"&&Y=="array"&&(r+=" else if ("+k+" == 'string' || "+k+" == 'number' || "+k+" == 'boolean' || "+m+" == null) "+F+" = ["+m+"]; ");r+=" else { ";var v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(q||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(y)+" , params: { type: '",U?r+=""+C.join(","):r+=""+C,r+="' } ",e.opts.messages!==!1&&(r+=" , message: 'should be ",U?r+=""+C.join(","):r+=""+C,r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var x=r;r=v.pop(),!e.compositeRule&&A?e.async?r+=" throw new ValidationError(["+x+"]); ":r+=" validate.errors = ["+x+"]; return false; ":r+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } if ("+F+" !== undefined) { ";var Z=p?"data"+(p-1||""):"parentData",me=p?e.dataPathArr[p]:"parentDataProperty";r+=" "+m+" = "+F+"; ",p||(r+="if ("+Z+" !== undefined)"),r+=" "+Z+"["+me+"] = "+F+"; } "}else{var v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(q||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(y)+" , params: { type: '",U?r+=""+C.join(","):r+=""+C,r+="' } ",e.opts.messages!==!1&&(r+=" , message: 'should be ",U?r+=""+C.join(","):r+=""+C,r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var x=r;r=v.pop(),!e.compositeRule&&A?e.async?r+=" throw new ValidationError(["+x+"]); ":r+=" validate.errors = ["+x+"]; return false; ":r+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}r+=" } "}}if(e.schema.$ref&&!o)r+=" "+e.RULES.all.$ref.code(e,"$ref")+" ",A&&(r+=" } if (errors === ",S?r+="0":r+="errs_"+f,r+=") { ",H+="}");else{var Oe=e.RULES;if(Oe){for(var L,Ie=-1,se=Oe.length-1;Ie<se;)if(L=Oe[Ie+=1],Se(L)){if(L.type&&(r+=" if ("+e.util.checkDataType(L.type,m,e.opts.strictNumbers)+") { "),e.opts.useDefaults){if(L.type=="object"&&e.schema.properties){var g=e.schema.properties,ye=Object.keys(g),Ee=ye;if(Ee)for(var Ce,wr=-1,cr=Ee.length-1;wr<cr;){Ce=Ee[wr+=1];var _e=g[Ce];if(_e.default!==void 0){var ve=m+e.util.getProperty(Ce);if(e.compositeRule){if(e.opts.strictDefaults){var P="default is ignored for: "+ve;if(e.opts.strictDefaults==="log")e.logger.warn(P);else throw new Error(P)}}else r+=" if ("+ve+" === undefined ",e.opts.useDefaults=="empty"&&(r+=" || "+ve+" === null || "+ve+" === '' "),r+=" ) "+ve+" = ",e.opts.useDefaults=="shared"?r+=" "+e.useDefault(_e.default)+" ":r+=" "+JSON.stringify(_e.default)+" ",r+="; "}}}else if(L.type=="array"&&Array.isArray(e.schema.items)){var Dr=e.schema.items;if(Dr){for(var _e,re=-1,Te=Dr.length-1;re<Te;)if(_e=Dr[re+=1],_e.default!==void 0){var ve=m+"["+re+"]";if(e.compositeRule){if(e.opts.strictDefaults){var P="default is ignored for: "+ve;if(e.opts.strictDefaults==="log")e.logger.warn(P);else throw new Error(P)}}else r+=" if ("+ve+" === undefined ",e.opts.useDefaults=="empty"&&(r+=" || "+ve+" === null || "+ve+" === '' "),r+=" ) "+ve+" = ",e.opts.useDefaults=="shared"?r+=" "+e.useDefault(_e.default)+" ":r+=" "+JSON.stringify(_e.default)+" ",r+="; "}}}}var oe=L.rules;if(oe){for(var Er,ur=-1,jr=oe.length-1;ur<jr;)if(Er=oe[ur+=1],Ve(Er)){var Nr=Er.code(e,Er.keyword,L.type);Nr&&(r+=" "+Nr+" ",A&&(I+="}"))}}if(A&&(r+=" "+I+" ",I=""),L.type&&(r+=" } ",C&&C===L.type&&!M)){r+=" else { ";var d=e.schemaPath+".type",y=e.errSchemaPath+"/type",v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(q||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(y)+" , params: { type: '",U?r+=""+C.join(","):r+=""+C,r+="' } ",e.opts.messages!==!1&&(r+=" , message: 'should be ",U?r+=""+C.join(","):r+=""+C,r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var x=r;r=v.pop(),!e.compositeRule&&A?e.async?r+=" throw new ValidationError(["+x+"]); ":r+=" validate.errors = ["+x+"]; return false; ":r+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } "}A&&(r+=" if (errors === ",S?r+="0":r+="errs_"+f,r+=") { ",H+="}")}}}A&&(r+=" "+H+" "),S?(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 "+O+" = errors === errs_"+f+";";function Se(ke){for(var tr=ke.rules,qe=0;qe<tr.length;qe++)if(Ve(tr[qe]))return!0}function Ve(ke){return e.schema[ke.keyword]!==void 0||ke.implements&&Ne(ke)}function Ne(ke){for(var tr=ke.implements,qe=0;qe<tr.length;qe++)if(e.schema[tr[qe]]!==void 0)return!0}return r}});var Uo=z((Fv,qo)=>{"use strict";var Na=Da(),Fa=st(),Fo=ja(),uh=Bs(),Lo=Js(),dh=Fa.ucs2length,fh=Oa(),hh=Fo.Validation;qo.exports=Qs;function Qs(a,e,t,s){var r=this,n=this._opts,o=[void 0],i={},u=[],c={},f=[],p={},g=[];e=e||{schema:a,refVal:o,refs:i};var d=ph.call(this,a,e,s),y=this._compilations[d.index];if(d.compiling)return y.callValidate=P;var m=this._formats,v=this.RULES;try{var x=O(a,e,t,s);y.validate=x;var S=y.callValidate;return S&&(S.schema=x.schema,S.errors=null,S.refs=x.refs,S.refVal=x.refVal,S.root=x.root,S.$async=x.$async,n.sourceCode&&(S.source=x.source)),x}finally{mh.call(this,a,e,s)}function P(){var $=y.validate,k=$.apply(this,arguments);return P.errors=$.errors,k}function O($,k,F,le){var Y=!k||k&&k.schema==$;if(k.schema!=e.schema)return Qs.call(r,$,k,F,le);var re=$.$async===!0,W=Lo({isTop:!0,schema:$,isRoot:Y,baseId:le,root:k,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:Fo.MissingRef,RULES:v,validate:Lo,util:Fa,resolve:Na,resolveRef:A,usePattern:U,useDefault:M,useCustomRule:L,opts:n,formats:m,logger:r.logger,self:r});W=La(o,yh)+La(u,vh)+La(f,gh)+La(g,_h)+W,n.processCode&&(W=n.processCode(W,$));var Z;try{var me=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",W);Z=me(r,v,m,e,o,f,g,fh,dh,hh),o[0]=Z}catch(Oe){throw r.logger.error("Error compiling schema, function code:",W),Oe}return Z.schema=$,Z.errors=null,Z.refs=i,Z.refVal=o,Z.root=Y?Z:k,re&&(Z.$async=!0),n.sourceCode===!0&&(Z.source={code:W,patterns:u,defaults:f}),Z}function A($,k,F){k=Na.url($,k);var le=i[k],Y,re;if(le!==void 0)return Y=o[le],re="refVal["+le+"]",C(Y,re);if(!F&&e.refs){var W=e.refs[k];if(W!==void 0)return Y=e.refVal[W],re=I(k,Y),C(Y,re)}re=I(k);var Z=Na.call(r,O,e,k);if(Z===void 0){var me=t&&t[k];me&&(Z=Na.inlineRef(me,n.inlineRefs)?me:Qs.call(r,me,e,t,$))}if(Z===void 0)H(k);else return q(k,Z),C(Z,re)}function I($,k){var F=o.length;return o[F]=k,i[$]=F,"refVal"+F}function H($){delete i[$]}function q($,k){var F=i[$];o[F]=k}function C($,k){return typeof $=="object"||typeof $=="boolean"?{code:k,schema:$,inline:!0}:{code:k,$async:$&&!!$.$async}}function U($){var k=c[$];return k===void 0&&(k=c[$]=u.length,u[k]=$),"pattern"+k}function M($){switch(typeof $){case"boolean":case"number":return""+$;case"string":return Fa.toQuotedString($);case"object":if($===null)return"null";var k=uh($),F=p[k];return F===void 0&&(F=p[k]=f.length,f[F]=$),"default"+F}}function L($,k,F,le){if(r._opts.validateSchema!==!1){var Y=$.definition.dependencies;if(Y&&!Y.every(function(Ee){return Object.prototype.hasOwnProperty.call(F,Ee)}))throw new Error("parent schema must have all required keywords: "+Y.join(","));var re=$.definition.validateSchema;if(re){var W=re(k);if(!W){var Z="keyword schema is invalid: "+r.errorsText(re.errors);if(r._opts.validateSchema=="log")r.logger.error(Z);else throw new Error(Z)}}}var me=$.definition.compile,Oe=$.definition.inline,Ie=$.definition.macro,se;if(me)se=me.call(r,k,F,le);else if(Ie)se=Ie.call(r,k,F,le),n.validateSchema!==!1&&r.validateSchema(se,!0);else if(Oe)se=Oe.call(r,le,$.keyword,k,F);else if(se=$.definition.validate,!se)return;if(se===void 0)throw new Error('custom keyword "'+$.keyword+'"failed to compile');var ye=g.length;return g[ye]=se,{code:"customRule"+ye,validate:se}}}function ph(a,e,t){var s=Mo.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 mh(a,e,t){var s=Mo.call(this,a,e,t);s>=0&&this._compilations.splice(s,1)}function Mo(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 vh(a,e){return"var pattern"+a+" = new RegExp("+Fa.toQuotedString(e[a])+");"}function gh(a){return"var default"+a+" = defaults["+a+"];"}function yh(a,e){return e[a]===void 0?"":"var refVal"+a+" = refVal["+a+"];"}function _h(a){return"var customRule"+a+" = customRules["+a+"];"}function La(a,e){if(!a.length)return"";for(var t="",s=0;s<a.length;s++)t+=e(s,a);return t}});var Vo=z((Mv,zo)=>{"use strict";var Ma=zo.exports=function(){this._cache={}};Ma.prototype.put=function(e,t){this._cache[e]=t};Ma.prototype.get=function(e){return this._cache[e]};Ma.prototype.del=function(e){delete this._cache[e]};Ma.prototype.clear=function(){this._cache={}}});var ri=z((qv,ei)=>{"use strict";var bh=st(),xh=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,wh=[0,31,28,31,30,31,30,31,31,30,31,30,31],Eh=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,Ho=/^(?=.{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,Ph=/^(?:[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,Sh=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,Zo=/^(?:(?:[^\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,Bo=/^(?:(?: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,Jo=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,Qo=/^(?:\/(?:[^~/]|~0|~1)*)*$/,Ko=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,Go=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;ei.exports=qa;function qa(a){return a=a=="full"?"full":"fast",bh.copy(qa[a])}qa.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":Zo,url:Bo,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:Ho,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:Xo,uuid:Jo,"json-pointer":Qo,"json-pointer-uri-fragment":Ko,"relative-json-pointer":Go};qa.full={date:Wo,time:Yo,"date-time":Th,uri:Ah,"uri-reference":Sh,"uri-template":Zo,url:Bo,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:Ho,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:Xo,uuid:Jo,"json-pointer":Qo,"json-pointer-uri-fragment":Ko,"relative-json-pointer":Go};function Rh(a){return a%4===0&&(a%100!==0||a%400===0)}function Wo(a){var e=a.match(xh);if(!e)return!1;var t=+e[1],s=+e[2],r=+e[3];return s>=1&&s<=12&&r>=1&&r<=(s==2&&Rh(t)?29:wh[s])}function Yo(a,e){var t=a.match(Eh);if(!t)return!1;var s=t[1],r=t[2],n=t[3],o=t[5];return(s<=23&&r<=59&&n<=59||s==23&&r==59&&n==60)&&(!e||o)}var Oh=/t|\s/i;function Th(a){var e=a.split(Oh);return e.length==2&&Wo(e[0])&&Yo(e[1],!0)}var $h=/\/|:/;function Ah(a){return $h.test(a)&&Ph.test(a)}var Ih=/[^\\]\\Z/;function Xo(a){if(Ih.test(a))return!1;try{return new RegExp(a),!0}catch{return!1}}});var ai=z((Uv,ti)=>{"use strict";ti.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),p="valid"+n,g,d;if(i=="#"||i=="#/")e.isRoot?(g=e.async,d="validate"):(g=e.root.schema.$async===!0,d="root.refVal[0]");else{var y=e.resolveRef(e.baseId,i,e.isRoot);if(y===void 0){var m=e.MissingRefError.message(e.baseId,i);if(e.opts.missingRefs=="fail"){e.logger.error(m);var v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , 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: "+f+" "),r+=" } "):r+=" {} ";var x=r;r=v.pop(),!e.compositeRule&&c?e.async?r+=" throw new ValidationError(["+x+"]); ":r+=" validate.errors = ["+x+"]; return false; ":r+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c&&(r+=" if (false) { ")}else if(e.opts.missingRefs=="ignore")e.logger.warn(m),c&&(r+=" if (true) { ");else throw new e.MissingRefError(e.baseId,i,m)}else if(y.inline){var S=e.util.copy(e);S.level++;var P="valid"+S.level;S.schema=y.schema,S.schemaPath="",S.errSchemaPath=i;var O=e.validate(S).replace(/validate\.schema/g,y.code);r+=" "+O+" ",c&&(r+=" if ("+P+") { ")}else g=y.$async===!0||e.async&&y.$async!==!1,d=y.code}if(d){var v=v||[];v.push(r),r="",e.opts.passContext?r+=" "+d+".call(this, ":r+=" "+d+"( ",r+=" "+f+", (dataPath || '')",e.errorPath!='""'&&(r+=" + "+e.errorPath);var A=o?"data"+(o-1||""):"parentData",I=o?e.dataPathArr[o]:"parentDataProperty";r+=" , "+A+" , "+I+", rootData) ";var H=r;if(r=v.pop(),g){if(!e.async)throw new Error("async schema referenced by sync schema");c&&(r+=" var "+p+"; "),r+=" try { await "+H+"; ",c&&(r+=" "+p+" = 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; ",c&&(r+=" "+p+" = false; "),r+=" } ",c&&(r+=" if ("+p+") { ")}else r+=" if (!"+H+") { if (vErrors === null) vErrors = "+d+".errors; else vErrors = vErrors.concat("+d+".errors); errors = vErrors.length; } ",c&&(r+=" else { ")}return r}});var ni=z((zv,si)=>{"use strict";si.exports=function(e,t,s){var r=" ",n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),i=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c=e.util.copy(e),f="";c.level++;var p="valid"+c.level,g=c.baseId,d=!0,y=n;if(y)for(var m,v=-1,x=y.length-1;v<x;)m=y[v+=1],(e.opts.strictKeywords?typeof m=="object"&&Object.keys(m).length>0||m===!1:e.util.schemaHasRules(m,e.RULES.all))&&(d=!1,c.schema=m,c.schemaPath=o+"["+v+"]",c.errSchemaPath=i+"/"+v,r+=" "+e.validate(c)+" ",c.baseId=g,u&&(r+=" if ("+p+") { ",f+="}"));return u&&(d?r+=" if (true) { ":r+=" "+f.slice(0,-1)+" "),r}});var ii=z((Vv,oi)=>{"use strict";oi.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),g="valid"+n,d="errs__"+n,y=e.util.copy(e),m="";y.level++;var v="valid"+y.level,x=i.every(function(q){return e.opts.strictKeywords?typeof q=="object"&&Object.keys(q).length>0||q===!1:e.util.schemaHasRules(q,e.RULES.all)});if(x){var S=y.baseId;r+=" var "+d+" = errors; var "+g+" = false; ";var P=e.compositeRule;e.compositeRule=y.compositeRule=!0;var O=i;if(O)for(var A,I=-1,H=O.length-1;I<H;)A=O[I+=1],y.schema=A,y.schemaPath=u+"["+I+"]",y.errSchemaPath=c+"/"+I,r+=" "+e.validate(y)+" ",y.baseId=S,r+=" "+g+" = "+g+" || "+v+"; if (!"+g+") { ",m+="}";e.compositeRule=y.compositeRule=P,r+=" "+m+" if (!"+g+") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'should match some schema in anyOf' "),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&f&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+=" } else { errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } ",e.opts.allErrors&&(r+=" } ")}else f&&(r+=" if (true) { ");return r}});var ci=z((Hv,li)=>{"use strict";li.exports=function(e,t,s){var r=" ",n=e.schema[t],o=e.errSchemaPath+"/"+t,i=!e.opts.allErrors,u=e.util.toQuotedString(n);return e.opts.$comment===!0?r+=" console.log("+u+");":typeof e.opts.$comment=="function"&&(r+=" self._opts.$comment("+u+", "+e.util.toQuotedString(o)+", validate.root.schema);"),r}});var di=z((Zv,ui)=>{"use strict";ui.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),g="valid"+n,d=e.opts.$data&&i&&i.$data,y;d?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",y="schema"+n):y=i,d||(r+=" var schema"+n+" = validate.schema"+u+";"),r+="var "+g+" = equal("+p+", schema"+n+"); if (!"+g+") { ";var m=m||[];m.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { allowedValue: schema"+n+" } ",e.opts.messages!==!1&&(r+=" , message: 'should be equal to constant' "),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var v=r;return r=m.pop(),!e.compositeRule&&f?e.async?r+=" throw new ValidationError(["+v+"]); ":r+=" validate.errors = ["+v+"]; return false; ":r+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" }",f&&(r+=" else { "),r}});var hi=z((Bv,fi)=>{"use strict";fi.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),g="valid"+n,d="errs__"+n,y=e.util.copy(e),m="";y.level++;var v="valid"+y.level,x="i"+n,S=y.dataLevel=e.dataLevel+1,P="data"+S,O=e.baseId,A=e.opts.strictKeywords?typeof i=="object"&&Object.keys(i).length>0||i===!1:e.util.schemaHasRules(i,e.RULES.all);if(r+="var "+d+" = errors;var "+g+";",A){var I=e.compositeRule;e.compositeRule=y.compositeRule=!0,y.schema=i,y.schemaPath=u,y.errSchemaPath=c,r+=" var "+v+" = false; for (var "+x+" = 0; "+x+" < "+p+".length; "+x+"++) { ",y.errorPath=e.util.getPathExpr(e.errorPath,x,e.opts.jsonPointers,!0);var H=p+"["+x+"]";y.dataPathArr[S]=x;var q=e.validate(y);y.baseId=O,e.util.varOccurences(q,P)<2?r+=" "+e.util.varReplace(q,P,H)+" ":r+=" var "+P+" = "+H+"; "+q+" ",r+=" if ("+v+") break; } ",e.compositeRule=y.compositeRule=I,r+=" "+m+" if (!"+v+") {"}else r+=" if ("+p+".length == 0) {";var C=C||[];C.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'should contain a valid item' "),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var U=r;return r=C.pop(),!e.compositeRule&&f?e.async?r+=" throw new ValidationError(["+U+"]); ":r+=" validate.errors = ["+U+"]; return false; ":r+=" var err = "+U+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { ",A&&(r+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } "),e.opts.allErrors&&(r+=" } "),r}});var mi=z((Jv,pi)=>{"use strict";pi.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),g="errs__"+n,d=e.util.copy(e),y="";d.level++;var m="valid"+d.level,v={},x={},S=e.opts.ownProperties;for(I in i)if(I!="__proto__"){var P=i[I],O=Array.isArray(P)?x:v;O[I]=P}r+="var "+g+" = errors;";var A=e.errorPath;r+="var missing"+n+";";for(var I in x)if(O=x[I],O.length){if(r+=" if ( "+p+e.util.getProperty(I)+" !== undefined ",S&&(r+=" && Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(I)+"') "),f){r+=" && ( ";var H=O;if(H)for(var q,C=-1,U=H.length-1;C<U;){q=H[C+=1],C&&(r+=" || ");var M=e.util.getProperty(q),L=p+M;r+=" ( ( "+L+" === undefined ",S&&(r+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(q)+"') "),r+=") && (missing"+n+" = "+e.util.toQuotedString(e.opts.jsonPointers?q:M)+") ) "}r+=")) { ";var $="missing"+n,k="' + "+$+" + '";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(c)+" , params: { property: '"+e.util.escapeQuotes(I)+"', missingProperty: '"+k+"', depsCount: "+O.length+", deps: '"+e.util.escapeQuotes(O.length==1?O[0]:O.join(", "))+"' } ",e.opts.messages!==!1&&(r+=" , message: 'should have ",O.length==1?r+="property "+e.util.escapeQuotes(O[0]):r+="properties "+e.util.escapeQuotes(O.join(", ")),r+=" when property "+e.util.escapeQuotes(I)+" is present' "),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var le=r;r=F.pop(),!e.compositeRule&&f?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=O;if(Y)for(var q,re=-1,W=Y.length-1;re<W;){q=Y[re+=1];var M=e.util.getProperty(q),k=e.util.escapeQuotes(q),L=p+M;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(A,q,e.opts.jsonPointers)),r+=" if ( "+L+" === undefined ",S&&(r+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(q)+"') "),r+=") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { property: '"+e.util.escapeQuotes(I)+"', missingProperty: '"+k+"', depsCount: "+O.length+", deps: '"+e.util.escapeQuotes(O.length==1?O[0]:O.join(", "))+"' } ",e.opts.messages!==!1&&(r+=" , message: 'should have ",O.length==1?r+="property "+e.util.escapeQuotes(O[0]):r+="properties "+e.util.escapeQuotes(O.join(", ")),r+=" when property "+e.util.escapeQuotes(I)+" is present' "),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}r+=" } ",f&&(y+="}",r+=" else { ")}e.errorPath=A;var Z=d.baseId;for(var I in v){var P=v[I];(e.opts.strictKeywords?typeof P=="object"&&Object.keys(P).length>0||P===!1:e.util.schemaHasRules(P,e.RULES.all))&&(r+=" "+m+" = true; if ( "+p+e.util.getProperty(I)+" !== undefined ",S&&(r+=" && Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(I)+"') "),r+=") { ",d.schema=P,d.schemaPath=u+e.util.getProperty(I),d.errSchemaPath=c+"/"+e.util.escapeFragment(I),r+=" "+e.validate(d)+" ",d.baseId=Z,r+=" } ",f&&(r+=" if ("+m+") { ",y+="}"))}return f&&(r+=" "+y+" if ("+g+" == errors) {"),r}});var gi=z((Qv,vi)=>{"use strict";vi.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),g="valid"+n,d=e.opts.$data&&i&&i.$data,y;d?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",y="schema"+n):y=i;var m="i"+n,v="schema"+n;d||(r+=" var "+v+" = validate.schema"+u+";"),r+="var "+g+";",d&&(r+=" if (schema"+n+" === undefined) "+g+" = true; else if (!Array.isArray(schema"+n+")) "+g+" = false; else {"),r+=""+g+" = false;for (var "+m+"=0; "+m+"<"+v+".length; "+m+"++) if (equal("+p+", "+v+"["+m+"])) { "+g+" = true; break; }",d&&(r+=" } "),r+=" if (!"+g+") { ";var x=x||[];x.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , 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"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var S=r;return r=x.pop(),!e.compositeRule&&f?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+=" }",f&&(r+=" else { "),r}});var _i=z((Kv,yi)=>{"use strict";yi.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||"");if(e.opts.format===!1)return f&&(r+=" if (true) { "),r;var g=e.opts.$data&&i&&i.$data,d;g?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",d="schema"+n):d=i;var y=e.opts.unknownFormats,m=Array.isArray(y);if(g){var v="format"+n,x="isObject"+n,S="formatType"+n;r+=" var "+v+" = formats["+d+"]; var "+x+" = typeof "+v+" == 'object' && !("+v+" instanceof RegExp) && "+v+".validate; var "+S+" = "+x+" && "+v+".type || 'string'; if ("+x+") { ",e.async&&(r+=" var async"+n+" = "+v+".async; "),r+=" "+v+" = "+v+".validate; } if ( ",g&&(r+=" ("+d+" !== undefined && typeof "+d+" != 'string') || "),r+=" (",y!="ignore"&&(r+=" ("+d+" && !"+v+" ",m&&(r+=" && self._opts.unknownFormats.indexOf("+d+") == -1 "),r+=") || "),r+=" ("+v+" && "+S+" == '"+s+"' && !(typeof "+v+" == 'function' ? ",e.async?r+=" (async"+n+" ? await "+v+"("+p+") : "+v+"("+p+")) ":r+=" "+v+"("+p+") ",r+=" : "+v+".test("+p+"))))) {"}else{var v=e.formats[i];if(!v){if(y=="ignore")return e.logger.warn('unknown format "'+i+'" ignored in schema at path "'+e.errSchemaPath+'"'),f&&(r+=" if (true) { "),r;if(m&&y.indexOf(i)>=0)return f&&(r+=" if (true) { "),r;throw new Error('unknown format "'+i+'" is used in schema at path "'+e.errSchemaPath+'"')}var x=typeof v=="object"&&!(v instanceof RegExp)&&v.validate,S=x&&v.type||"string";if(x){var P=v.async===!0;v=v.validate}if(S!=s)return f&&(r+=" if (true) { "),r;if(P){if(!e.async)throw new Error("async format in sync schema");var O="formats"+e.util.getProperty(i)+".validate";r+=" if (!(await "+O+"("+p+"))) { "}else{r+=" if (! ";var O="formats"+e.util.getProperty(i);x&&(O+=".validate"),typeof v=="function"?r+=" "+O+"("+p+") ":r+=" "+O+".test("+p+") ",r+=") { "}}var A=A||[];A.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { format: ",g?r+=""+d:r+=""+e.util.toQuotedString(i),r+=" } ",e.opts.messages!==!1&&(r+=` , message: 'should match format "`,g?r+="' + "+d+" + '":r+=""+e.util.escapeQuotes(i),r+=`"' `),e.opts.verbose&&(r+=" , schema: ",g?r+="validate.schema"+u:r+=""+e.util.toQuotedString(i),r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var I=r;return r=A.pop(),!e.compositeRule&&f?e.async?r+=" throw new ValidationError(["+I+"]); ":r+=" validate.errors = ["+I+"]; return false; ":r+=" var err = "+I+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",f&&(r+=" else { "),r}});var xi=z((Gv,bi)=>{"use strict";bi.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),g="valid"+n,d="errs__"+n,y=e.util.copy(e);y.level++;var m="valid"+y.level,v=e.schema.then,x=e.schema.else,S=v!==void 0&&(e.opts.strictKeywords?typeof v=="object"&&Object.keys(v).length>0||v===!1:e.util.schemaHasRules(v,e.RULES.all)),P=x!==void 0&&(e.opts.strictKeywords?typeof x=="object"&&Object.keys(x).length>0||x===!1:e.util.schemaHasRules(x,e.RULES.all)),O=y.baseId;if(S||P){var A;y.createErrors=!1,y.schema=i,y.schemaPath=u,y.errSchemaPath=c,r+=" var "+d+" = errors; var "+g+" = true; ";var I=e.compositeRule;e.compositeRule=y.compositeRule=!0,r+=" "+e.validate(y)+" ",y.baseId=O,y.createErrors=!0,r+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } ",e.compositeRule=y.compositeRule=I,S?(r+=" if ("+m+") { ",y.schema=e.schema.then,y.schemaPath=e.schemaPath+".then",y.errSchemaPath=e.errSchemaPath+"/then",r+=" "+e.validate(y)+" ",y.baseId=O,r+=" "+g+" = "+m+"; ",S&&P?(A="ifClause"+n,r+=" var "+A+" = 'then'; "):A="'then'",r+=" } ",P&&(r+=" else { ")):r+=" if (!"+m+") { ",P&&(y.schema=e.schema.else,y.schemaPath=e.schemaPath+".else",y.errSchemaPath=e.errSchemaPath+"/else",r+=" "+e.validate(y)+" ",y.baseId=O,r+=" "+g+" = "+m+"; ",S&&P?(A="ifClause"+n,r+=" var "+A+" = 'else'; "):A="'else'",r+=" } "),r+=" if (!"+g+") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { failingKeyword: "+A+" } ",e.opts.messages!==!1&&(r+=` , message: 'should match "' + `+A+` + '" schema' `),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&f&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+=" } ",f&&(r+=" else { ")}else f&&(r+=" if (true) { ");return r}});var Ei=z((Wv,wi)=>{"use strict";wi.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),g="valid"+n,d="errs__"+n,y=e.util.copy(e),m="";y.level++;var v="valid"+y.level,x="i"+n,S=y.dataLevel=e.dataLevel+1,P="data"+S,O=e.baseId;if(r+="var "+d+" = errors;var "+g+";",Array.isArray(i)){var A=e.schema.additionalItems;if(A===!1){r+=" "+g+" = "+p+".length <= "+i.length+"; ";var I=c;c=e.errSchemaPath+"/additionalItems",r+=" if (!"+g+") { ";var H=H||[];H.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , 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: "+p+" "),r+=" } "):r+=" {} ";var q=r;r=H.pop(),!e.compositeRule&&f?e.async?r+=" throw new ValidationError(["+q+"]); ":r+=" validate.errors = ["+q+"]; return false; ":r+=" var err = "+q+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",c=I,f&&(m+="}",r+=" else { ")}var C=i;if(C){for(var U,M=-1,L=C.length-1;M<L;)if(U=C[M+=1],e.opts.strictKeywords?typeof U=="object"&&Object.keys(U).length>0||U===!1:e.util.schemaHasRules(U,e.RULES.all)){r+=" "+v+" = true; if ("+p+".length > "+M+") { ";var $=p+"["+M+"]";y.schema=U,y.schemaPath=u+"["+M+"]",y.errSchemaPath=c+"/"+M,y.errorPath=e.util.getPathExpr(e.errorPath,M,e.opts.jsonPointers,!0),y.dataPathArr[S]=M;var k=e.validate(y);y.baseId=O,e.util.varOccurences(k,P)<2?r+=" "+e.util.varReplace(k,P,$)+" ":r+=" var "+P+" = "+$+"; "+k+" ",r+=" } ",f&&(r+=" if ("+v+") { ",m+="}")}}if(typeof A=="object"&&(e.opts.strictKeywords?typeof A=="object"&&Object.keys(A).length>0||A===!1:e.util.schemaHasRules(A,e.RULES.all))){y.schema=A,y.schemaPath=e.schemaPath+".additionalItems",y.errSchemaPath=e.errSchemaPath+"/additionalItems",r+=" "+v+" = true; if ("+p+".length > "+i.length+") { for (var "+x+" = "+i.length+"; "+x+" < "+p+".length; "+x+"++) { ",y.errorPath=e.util.getPathExpr(e.errorPath,x,e.opts.jsonPointers,!0);var $=p+"["+x+"]";y.dataPathArr[S]=x;var k=e.validate(y);y.baseId=O,e.util.varOccurences(k,P)<2?r+=" "+e.util.varReplace(k,P,$)+" ":r+=" var "+P+" = "+$+"; "+k+" ",f&&(r+=" if (!"+v+") break; "),r+=" } } ",f&&(r+=" if ("+v+") { ",m+="}")}}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=u,y.errSchemaPath=c,r+=" for (var "+x+" = 0; "+x+" < "+p+".length; "+x+"++) { ",y.errorPath=e.util.getPathExpr(e.errorPath,x,e.opts.jsonPointers,!0);var $=p+"["+x+"]";y.dataPathArr[S]=x;var k=e.validate(y);y.baseId=O,e.util.varOccurences(k,P)<2?r+=" "+e.util.varReplace(k,P,$)+" ":r+=" var "+P+" = "+$+"; "+k+" ",f&&(r+=" if (!"+v+") break; "),r+=" }"}return f&&(r+=" "+m+" if ("+d+" == errors) {"),r}});var Ks=z((Yv,Pi)=>{"use strict";Pi.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,O,p="data"+(o||""),g=e.opts.$data&&i&&i.$data,d;g?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",d="schema"+n):d=i;var y=t=="maximum",m=y?"exclusiveMaximum":"exclusiveMinimum",v=e.schema[m],x=e.opts.$data&&v&&v.$data,S=y?"<":">",P=y?">":"<",O=void 0;if(!(g||typeof i=="number"||i===void 0))throw new Error(t+" must be number");if(!(x||v===void 0||typeof v=="number"||typeof v=="boolean"))throw new Error(m+" must be number or boolean");if(x){var A=e.util.getData(v.$data,o,e.dataPathArr),I="exclusive"+n,H="exclType"+n,q="exclIsNumber"+n,C="op"+n,U="' + "+C+" + '";r+=" var schemaExcl"+n+" = "+A+"; ",A="schemaExcl"+n,r+=" var "+I+"; var "+H+" = typeof "+A+"; if ("+H+" != 'boolean' && "+H+" != 'undefined' && "+H+" != 'number') { ";var O=m,M=M||[];M.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(O||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: '"+m+" should be boolean' "),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var L=r;r=M.pop(),!e.compositeRule&&f?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 ( ",g&&(r+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),r+=" "+H+" == 'number' ? ( ("+I+" = "+d+" === undefined || "+A+" "+S+"= "+d+") ? "+p+" "+P+"= "+A+" : "+p+" "+P+" "+d+" ) : ( ("+I+" = "+A+" === true) ? "+p+" "+P+"= "+d+" : "+p+" "+P+" "+d+" ) || "+p+" !== "+p+") { var op"+n+" = "+I+" ? '"+S+"' : '"+S+"='; ",i===void 0&&(O=m,c=e.errSchemaPath+"/"+m,d=A,g=x)}else{var q=typeof v=="number",U=S;if(q&&g){var C="'"+U+"'";r+=" if ( ",g&&(r+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),r+=" ( "+d+" === undefined || "+v+" "+S+"= "+d+" ? "+p+" "+P+"= "+v+" : "+p+" "+P+" "+d+" ) || "+p+" !== "+p+") { "}else{q&&i===void 0?(I=!0,O=m,c=e.errSchemaPath+"/"+m,d=v,P+="="):(q&&(d=Math[y?"min":"max"](v,i)),v===(q?d:!0)?(I=!0,O=m,c=e.errSchemaPath+"/"+m,P+="="):(I=!1,U+="="));var C="'"+U+"'";r+=" if ( ",g&&(r+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),r+=" "+p+" "+P+" "+d+" || "+p+" !== "+p+") { "}}O=O||t;var M=M||[];M.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(O||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { comparison: "+C+", limit: "+d+", exclusive: "+I+" } ",e.opts.messages!==!1&&(r+=" , message: 'should be "+U+" ",g?r+="' + "+d:r+=""+d+"'"),e.opts.verbose&&(r+=" , schema: ",g?r+="validate.schema"+u:r+=""+i,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var L=r;return r=M.pop(),!e.compositeRule&&f?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+=" } ",f&&(r+=" else { "),r}});var Gs=z((Xv,Si)=>{"use strict";Si.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,m,p="data"+(o||""),g=e.opts.$data&&i&&i.$data,d;if(g?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",d="schema"+n):d=i,!(g||typeof i=="number"))throw new Error(t+" must be number");var y=t=="maxItems"?">":"<";r+="if ( ",g&&(r+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),r+=" "+p+".length "+y+" "+d+") { ";var m=t,v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(m||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+d+" } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT have ",t=="maxItems"?r+="more":r+="fewer",r+=" than ",g?r+="' + "+d+" + '":r+=""+i,r+=" items' "),e.opts.verbose&&(r+=" , schema: ",g?r+="validate.schema"+u:r+=""+i,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var x=r;return r=v.pop(),!e.compositeRule&&f?e.async?r+=" throw new ValidationError(["+x+"]); ":r+=" validate.errors = ["+x+"]; return false; ":r+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",f&&(r+=" else { "),r}});var Ws=z((eg,Ri)=>{"use strict";Ri.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,m,p="data"+(o||""),g=e.opts.$data&&i&&i.$data,d;if(g?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",d="schema"+n):d=i,!(g||typeof i=="number"))throw new Error(t+" must be number");var y=t=="maxLength"?">":"<";r+="if ( ",g&&(r+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),e.opts.unicode===!1?r+=" "+p+".length ":r+=" ucs2length("+p+") ",r+=" "+y+" "+d+") { ";var m=t,v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(m||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+d+" } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT be ",t=="maxLength"?r+="longer":r+="shorter",r+=" than ",g?r+="' + "+d+" + '":r+=""+i,r+=" characters' "),e.opts.verbose&&(r+=" , schema: ",g?r+="validate.schema"+u:r+=""+i,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var x=r;return r=v.pop(),!e.compositeRule&&f?e.async?r+=" throw new ValidationError(["+x+"]); ":r+=" validate.errors = ["+x+"]; return false; ":r+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",f&&(r+=" else { "),r}});var Ys=z((rg,Oi)=>{"use strict";Oi.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,m,p="data"+(o||""),g=e.opts.$data&&i&&i.$data,d;if(g?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",d="schema"+n):d=i,!(g||typeof i=="number"))throw new Error(t+" must be number");var y=t=="maxProperties"?">":"<";r+="if ( ",g&&(r+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),r+=" Object.keys("+p+").length "+y+" "+d+") { ";var m=t,v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(m||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+d+" } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT have ",t=="maxProperties"?r+="more":r+="fewer",r+=" than ",g?r+="' + "+d+" + '":r+=""+i,r+=" properties' "),e.opts.verbose&&(r+=" , schema: ",g?r+="validate.schema"+u:r+=""+i,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var x=r;return r=v.pop(),!e.compositeRule&&f?e.async?r+=" throw new ValidationError(["+x+"]); ":r+=" validate.errors = ["+x+"]; return false; ":r+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",f&&(r+=" else { "),r}});var $i=z((tg,Ti)=>{"use strict";Ti.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),g=e.opts.$data&&i&&i.$data,d;if(g?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",d="schema"+n):d=i,!(g||typeof i=="number"))throw new Error(t+" must be number");r+="var division"+n+";if (",g&&(r+=" "+d+" !== undefined && ( typeof "+d+" != 'number' || "),r+=" (division"+n+" = "+p+" / "+d+", ",e.opts.multipleOfPrecision?r+=" Math.abs(Math.round(division"+n+") - division"+n+") > 1e-"+e.opts.multipleOfPrecision+" ":r+=" division"+n+" !== parseInt(division"+n+") ",r+=" ) ",g&&(r+=" ) "),r+=" ) { ";var y=y||[];y.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { multipleOf: "+d+" } ",e.opts.messages!==!1&&(r+=" , message: 'should be multiple of ",g?r+="' + "+d:r+=""+d+"'"),e.opts.verbose&&(r+=" , schema: ",g?r+="validate.schema"+u:r+=""+i,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var m=r;return r=y.pop(),!e.compositeRule&&f?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&&(r+=" else { "),r}});var Ii=z((ag,Ai)=>{"use strict";Ai.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),g="errs__"+n,d=e.util.copy(e);d.level++;var y="valid"+d.level;if(e.opts.strictKeywords?typeof i=="object"&&Object.keys(i).length>0||i===!1:e.util.schemaHasRules(i,e.RULES.all)){d.schema=i,d.schemaPath=u,d.errSchemaPath=c,r+=" var "+g+" = errors; ";var m=e.compositeRule;e.compositeRule=d.compositeRule=!0,d.createErrors=!1;var v;d.opts.allErrors&&(v=d.opts.allErrors,d.opts.allErrors=!1),r+=" "+e.validate(d)+" ",d.createErrors=!0,v&&(d.opts.allErrors=v),e.compositeRule=d.compositeRule=m,r+=" if ("+y+") { ";var x=x||[];x.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'should NOT be valid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var S=r;r=x.pop(),!e.compositeRule&&f?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+=" } else { errors = "+g+"; if (vErrors !== null) { if ("+g+") vErrors.length = "+g+"; 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(c)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'should NOT be valid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",f&&(r+=" if (false) { ");return r}});var ki=z((sg,Ci)=>{"use strict";Ci.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),g="valid"+n,d="errs__"+n,y=e.util.copy(e),m="";y.level++;var v="valid"+y.level,x=y.baseId,S="prevValid"+n,P="passingSchemas"+n;r+="var "+d+" = errors , "+S+" = false , "+g+" = false , "+P+" = null; ";var O=e.compositeRule;e.compositeRule=y.compositeRule=!0;var A=i;if(A)for(var I,H=-1,q=A.length-1;H<q;)I=A[H+=1],(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=u+"["+H+"]",y.errSchemaPath=c+"/"+H,r+=" "+e.validate(y)+" ",y.baseId=x):r+=" var "+v+" = true; ",H&&(r+=" if ("+v+" && "+S+") { "+g+" = false; "+P+" = ["+P+", "+H+"]; } else { ",m+="}"),r+=" if ("+v+") { "+g+" = "+S+" = true; "+P+" = "+H+"; }";return e.compositeRule=y.compositeRule=O,r+=""+m+"if (!"+g+") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { passingSchemas: "+P+" } ",e.opts.messages!==!1&&(r+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&f&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+="} else { errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; }",e.opts.allErrors&&(r+=" } "),r}});var ji=z((ng,Di)=>{"use strict";Di.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),g=e.opts.$data&&i&&i.$data,d;g?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",d="schema"+n):d=i;var y=g?"(new RegExp("+d+"))":e.usePattern(i);r+="if ( ",g&&(r+=" ("+d+" !== undefined && typeof "+d+" != 'string') || "),r+=" !"+y+".test("+p+") ) { ";var m=m||[];m.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { pattern: ",g?r+=""+d:r+=""+e.util.toQuotedString(i),r+=" } ",e.opts.messages!==!1&&(r+=` , message: 'should match pattern "`,g?r+="' + "+d+" + '":r+=""+e.util.escapeQuotes(i),r+=`"' `),e.opts.verbose&&(r+=" , schema: ",g?r+="validate.schema"+u:r+=""+e.util.toQuotedString(i),r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var v=r;return r=m.pop(),!e.compositeRule&&f?e.async?r+=" throw new ValidationError(["+v+"]); ":r+=" validate.errors = ["+v+"]; return false; ":r+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",f&&(r+=" else { "),r}});var Li=z((og,Ni)=>{"use strict";Ni.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),g="errs__"+n,d=e.util.copy(e),y="";d.level++;var m="valid"+d.level,v="key"+n,x="idx"+n,S=d.dataLevel=e.dataLevel+1,P="data"+S,O="dataProperties"+n,A=Object.keys(i||{}).filter(re),I=e.schema.patternProperties||{},H=Object.keys(I).filter(re),q=e.schema.additionalProperties,C=A.length||H.length,U=q===!1,M=typeof q=="object"&&Object.keys(q).length,L=e.opts.removeAdditional,$=U||M||L,k=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 "+g+" = errors;var "+m+" = true;",k&&(r+=" var "+O+" = undefined;"),$){if(k?r+=" "+O+" = "+O+" || Object.keys("+p+"); for (var "+x+"=0; "+x+"<"+O+".length; "+x+"++) { var "+v+" = "+O+"["+x+"]; ":r+=" for (var "+v+" in "+p+") { ",C){if(r+=" var isAdditional"+n+" = !(false ",A.length)if(A.length>8)r+=" || validate.schema"+u+".hasOwnProperty("+v+") ";else{var W=A;if(W)for(var Z,me=-1,Oe=W.length-1;me<Oe;)Z=W[me+=1],r+=" || "+v+" == "+e.util.toQuotedString(Z)+" "}if(H.length){var Ie=H;if(Ie)for(var se,ye=-1,Ee=Ie.length-1;ye<Ee;)se=Ie[ye+=1],r+=" || "+e.usePattern(se)+".test("+v+") "}r+=" ); if (isAdditional"+n+") { "}if(L=="all")r+=" delete "+p+"["+v+"]; ";else{var Ce=e.errorPath,wr="' + "+v+" + '";if(e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers)),U)if(L)r+=" delete "+p+"["+v+"]; ";else{r+=" "+m+" = false; ";var cr=c;c=e.errSchemaPath+"/additionalProperties";var _e=_e||[];_e.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { additionalProperty: '"+wr+"' } ",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: "+p+" "),r+=" } "):r+=" {} ";var ve=r;r=_e.pop(),!e.compositeRule&&f?e.async?r+=" throw new ValidationError(["+ve+"]); ":r+=" validate.errors = ["+ve+"]; return false; ":r+=" var err = "+ve+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c=cr,f&&(r+=" break; ")}else if(M)if(L=="failing"){r+=" var "+g+" = errors; ";var Dr=e.compositeRule;e.compositeRule=d.compositeRule=!0,d.schema=q,d.schemaPath=e.schemaPath+".additionalProperties",d.errSchemaPath=e.errSchemaPath+"/additionalProperties",d.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers);var Te=p+"["+v+"]";d.dataPathArr[S]=v;var oe=e.validate(d);d.baseId=F,e.util.varOccurences(oe,P)<2?r+=" "+e.util.varReplace(oe,P,Te)+" ":r+=" var "+P+" = "+Te+"; "+oe+" ",r+=" if (!"+m+") { errors = "+g+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+p+"["+v+"]; } ",e.compositeRule=d.compositeRule=Dr}else{d.schema=q,d.schemaPath=e.schemaPath+".additionalProperties",d.errSchemaPath=e.errSchemaPath+"/additionalProperties",d.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers);var Te=p+"["+v+"]";d.dataPathArr[S]=v;var oe=e.validate(d);d.baseId=F,e.util.varOccurences(oe,P)<2?r+=" "+e.util.varReplace(oe,P,Te)+" ":r+=" var "+P+" = "+Te+"; "+oe+" ",f&&(r+=" if (!"+m+") break; ")}e.errorPath=Ce}C&&(r+=" } "),r+=" } ",f&&(r+=" if ("+m+") { ",y+="}")}var Er=e.opts.useDefaults&&!e.compositeRule;if(A.length){var ur=A;if(ur)for(var Z,jr=-1,Nr=ur.length-1;jr<Nr;){Z=ur[jr+=1];var Se=i[Z];if(e.opts.strictKeywords?typeof Se=="object"&&Object.keys(Se).length>0||Se===!1:e.util.schemaHasRules(Se,e.RULES.all)){var Ve=e.util.getProperty(Z),Te=p+Ve,Ne=Er&&Se.default!==void 0;d.schema=Se,d.schemaPath=u+Ve,d.errSchemaPath=c+"/"+e.util.escapeFragment(Z),d.errorPath=e.util.getPath(e.errorPath,Z,e.opts.jsonPointers),d.dataPathArr[S]=e.util.toQuotedString(Z);var oe=e.validate(d);if(d.baseId=F,e.util.varOccurences(oe,P)<2){oe=e.util.varReplace(oe,P,Te);var ke=Te}else{var ke=P;r+=" var "+P+" = "+Te+"; "}if(Ne)r+=" "+oe+" ";else{if(Y&&Y[Z]){r+=" if ( "+ke+" === undefined ",k&&(r+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(Z)+"') "),r+=") { "+m+" = false; ";var Ce=e.errorPath,cr=c,tr=e.util.escapeQuotes(Z);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(Ce,Z,e.opts.jsonPointers)),c=e.errSchemaPath+"/required";var _e=_e||[];_e.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+tr+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+tr+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var ve=r;r=_e.pop(),!e.compositeRule&&f?e.async?r+=" throw new ValidationError(["+ve+"]); ":r+=" validate.errors = ["+ve+"]; return false; ":r+=" var err = "+ve+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c=cr,e.errorPath=Ce,r+=" } else { "}else f?(r+=" if ( "+ke+" === undefined ",k&&(r+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(Z)+"') "),r+=") { "+m+" = true; } else { "):(r+=" if ("+ke+" !== undefined ",k&&(r+=" && Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(Z)+"') "),r+=" ) { ");r+=" "+oe+" } "}}f&&(r+=" if ("+m+") { ",y+="}")}}if(H.length){var qe=H;if(qe)for(var se,oa=-1,is=qe.length-1;oa<is;){se=qe[oa+=1];var Se=I[se];if(e.opts.strictKeywords?typeof Se=="object"&&Object.keys(Se).length>0||Se===!1:e.util.schemaHasRules(Se,e.RULES.all)){d.schema=Se,d.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(se),d.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(se),k?r+=" "+O+" = "+O+" || Object.keys("+p+"); for (var "+x+"=0; "+x+"<"+O+".length; "+x+"++) { var "+v+" = "+O+"["+x+"]; ":r+=" for (var "+v+" in "+p+") { ",r+=" if ("+e.usePattern(se)+".test("+v+")) { ",d.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers);var Te=p+"["+v+"]";d.dataPathArr[S]=v;var oe=e.validate(d);d.baseId=F,e.util.varOccurences(oe,P)<2?r+=" "+e.util.varReplace(oe,P,Te)+" ":r+=" var "+P+" = "+Te+"; "+oe+" ",f&&(r+=" if (!"+m+") break; "),r+=" } ",f&&(r+=" else "+m+" = true; "),r+=" } ",f&&(r+=" if ("+m+") { ",y+="}")}}}return f&&(r+=" "+y+" if ("+g+" == errors) {"),r}});var Mi=z((ig,Fi)=>{"use strict";Fi.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),g="errs__"+n,d=e.util.copy(e),y="";d.level++;var m="valid"+d.level;if(r+="var "+g+" = errors;",e.opts.strictKeywords?typeof i=="object"&&Object.keys(i).length>0||i===!1:e.util.schemaHasRules(i,e.RULES.all)){d.schema=i,d.schemaPath=u,d.errSchemaPath=c;var v="key"+n,x="idx"+n,S="i"+n,P="' + "+v+" + '",O=d.dataLevel=e.dataLevel+1,A="data"+O,I="dataProperties"+n,H=e.opts.ownProperties,q=e.baseId;H&&(r+=" var "+I+" = undefined; "),H?r+=" "+I+" = "+I+" || Object.keys("+p+"); for (var "+x+"=0; "+x+"<"+I+".length; "+x+"++) { var "+v+" = "+I+"["+x+"]; ":r+=" for (var "+v+" in "+p+") { ",r+=" var startErrs"+n+" = errors; ";var C=v,U=e.compositeRule;e.compositeRule=d.compositeRule=!0;var M=e.validate(d);d.baseId=q,e.util.varOccurences(M,A)<2?r+=" "+e.util.varReplace(M,A,C)+" ":r+=" var "+A+" = "+C+"; "+M+" ",e.compositeRule=d.compositeRule=U,r+=" if (!"+m+") { for (var "+S+"=startErrs"+n+"; "+S+"<errors; "+S+"++) { vErrors["+S+"].propertyName = "+v+"; } var err = ",e.createErrors!==!1?(r+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { propertyName: '"+P+"' } ",e.opts.messages!==!1&&(r+=" , message: 'property name \\'"+P+"\\' is invalid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&f&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),f&&(r+=" break; "),r+=" } }"}return f&&(r+=" "+y+" if ("+g+" == errors) {"),r}});var Ui=z((lg,qi)=>{"use strict";qi.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),g="valid"+n,d=e.opts.$data&&i&&i.$data,y;d?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",y="schema"+n):y=i;var m="schema"+n;if(!d)if(i.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var v=[],x=i;if(x)for(var S,P=-1,O=x.length-1;P<O;){S=x[P+=1];var A=e.schema.properties[S];A&&(e.opts.strictKeywords?typeof A=="object"&&Object.keys(A).length>0||A===!1:e.util.schemaHasRules(A,e.RULES.all))||(v[v.length]=S)}}else var v=i;if(d||v.length){var I=e.errorPath,H=d||v.length>=e.opts.loopRequired,q=e.opts.ownProperties;if(f)if(r+=" var missing"+n+"; ",H){d||(r+=" var "+m+" = validate.schema"+u+"; ");var C="i"+n,U="schema"+n+"["+C+"]",M="' + "+U+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(I,U,e.opts.jsonPointers)),r+=" var "+g+" = true; ",d&&(r+=" if (schema"+n+" === undefined) "+g+" = true; else if (!Array.isArray(schema"+n+")) "+g+" = false; else {"),r+=" for (var "+C+" = 0; "+C+" < "+m+".length; "+C+"++) { "+g+" = "+p+"["+m+"["+C+"]] !== undefined ",q&&(r+=" && Object.prototype.hasOwnProperty.call("+p+", "+m+"["+C+"]) "),r+="; if (!"+g+") break; } ",d&&(r+=" } "),r+=" if (!"+g+") { ";var L=L||[];L.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+M+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+M+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var $=r;r=L.pop(),!e.compositeRule&&f?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+=" } else { "}else{r+=" if ( ";var k=v;if(k)for(var F,C=-1,le=k.length-1;C<le;){F=k[C+=1],C&&(r+=" || ");var Y=e.util.getProperty(F),re=p+Y;r+=" ( ( "+re+" === undefined ",q&&(r+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(F)+"') "),r+=") && (missing"+n+" = "+e.util.toQuotedString(e.opts.jsonPointers?F:Y)+") ) "}r+=") { ";var U="missing"+n,M="' + "+U+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(I,U,!0):I+" + "+U);var L=L||[];L.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+M+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+M+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var $=r;r=L.pop(),!e.compositeRule&&f?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+=" } else { "}else if(H){d||(r+=" var "+m+" = validate.schema"+u+"; ");var C="i"+n,U="schema"+n+"["+C+"]",M="' + "+U+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(I,U,e.opts.jsonPointers)),d&&(r+=" if ("+m+" && !Array.isArray("+m+")) { var err = ",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+M+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+M+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+m+" !== undefined) { "),r+=" for (var "+C+" = 0; "+C+" < "+m+".length; "+C+"++) { if ("+p+"["+m+"["+C+"]] === undefined ",q&&(r+=" || ! Object.prototype.hasOwnProperty.call("+p+", "+m+"["+C+"]) "),r+=") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+M+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+M+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",d&&(r+=" } ")}else{var W=v;if(W)for(var F,Z=-1,me=W.length-1;Z<me;){F=W[Z+=1];var Y=e.util.getProperty(F),M=e.util.escapeQuotes(F),re=p+Y;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(I,F,e.opts.jsonPointers)),r+=" if ( "+re+" === undefined ",q&&(r+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(F)+"') "),r+=") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+M+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+M+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=I}else f&&(r+=" if (true) {");return r}});var Vi=z((cg,zi)=>{"use strict";zi.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),g="valid"+n,d=e.opts.$data&&i&&i.$data,y;if(d?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",y="schema"+n):y=i,(i||d)&&e.opts.uniqueItems!==!1){d&&(r+=" var "+g+"; if ("+y+" === false || "+y+" === undefined) "+g+" = true; else if (typeof "+y+" != 'boolean') "+g+" = false; else { "),r+=" var i = "+p+".length , "+g+" = true , j; if (i > 1) { ";var m=e.schema.items&&e.schema.items.type,v=Array.isArray(m);if(!m||m=="object"||m=="array"||v&&(m.indexOf("object")>=0||m.indexOf("array")>=0))r+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+p+"[i], "+p+"[j])) { "+g+" = false; break outer; } } } ";else{r+=" var itemIndices = {}, item; for (;i--;) { var item = "+p+"[i]; ";var x="checkDataType"+(v?"s":"");r+=" if ("+e.util[x](m,"item",e.opts.strictNumbers,!0)+") continue; ",v&&(r+=` if (typeof item == 'string') item = '"' + item; `),r+=" if (typeof itemIndices[item] == 'number') { "+g+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}r+=" } ",d&&(r+=" } "),r+=" if (!"+g+") { ";var S=S||[];S.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , 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: ",d?r+="validate.schema"+u:r+=""+i,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var P=r;r=S.pop(),!e.compositeRule&&f?e.async?r+=" throw new ValidationError(["+P+"]); ":r+=" validate.errors = ["+P+"]; return false; ":r+=" var err = "+P+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",f&&(r+=" else { ")}else f&&(r+=" if (true) { ");return r}});var Zi=z((ug,Hi)=>{"use strict";Hi.exports={$ref:ai(),allOf:ni(),anyOf:ii(),$comment:ci(),const:di(),contains:hi(),dependencies:mi(),enum:gi(),format:_i(),if:xi(),items:Ei(),maximum:Ks(),minimum:Ks(),maxItems:Gs(),minItems:Gs(),maxLength:Ws(),minLength:Ws(),maxProperties:Ys(),minProperties:Ys(),multipleOf:$i(),not:Ii(),oneOf:ki(),pattern:ji(),properties:Li(),propertyNames:Mi(),required:Ui(),uniqueItems:Vi(),validate:Js()}});var Qi=z((dg,Ji)=>{"use strict";var Bi=Zi(),Xs=st().toHash;Ji.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=Xs(t),e.types=Xs(r),e.forEach(function(n){n.rules=n.rules.map(function(o){var i;if(typeof o=="object"){var u=Object.keys(o)[0];i=o[u],o=u,i.forEach(function(f){t.push(f),e.all[f]=!0})}t.push(o);var c=e.all[o]={keyword:o,code:Bi[o],implements:i};return c}),e.all.$comment={keyword:"$comment",code:Bi.$comment},n.type&&(e.types[n.type]=n)}),e.keywords=Xs(t.concat(s)),e.custom={},e}});var Wi=z((fg,Gi)=>{"use strict";var Ki=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];Gi.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<Ki.length;n++){var o=Ki[n],i=r[o];i&&(r[o]={anyOf:[i,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]})}}return a}});var el=z((hg,Xi)=>{"use strict";var Ch=ja().MissingRef;Xi.exports=Yi;function Yi(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||o(i)});return t&&r.then(function(i){t(null,i)},t),r;function n(i){var u=i.$schema;return u&&!s.getSchema(u)?Yi.call(s,{$ref:u},!0):Promise.resolve()}function o(i){try{return s._compile(i)}catch(c){if(c instanceof Ch)return u(c);throw c}function u(c){var f=c.missingSchema;if(d(f))throw new Error("Schema "+f+" is loaded but "+c.missingRef+" cannot be resolved");var p=s._loadingSchemas[f];return p||(p=s._loadingSchemas[f]=s._opts.loadSchema(f),p.then(g,g)),p.then(function(y){if(!d(f))return n(y).then(function(){d(f)||s.addSchema(y,f,void 0,e)})}).then(function(){return o(i)});function g(){delete s._loadingSchemas[f]}function d(y){return s._refs[y]||s._schemas[y]}}}}});var tl=z((pg,rl)=>{"use strict";rl.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p,g="data"+(o||""),d="valid"+n,y="errs__"+n,m=e.opts.$data&&i&&i.$data,v;m?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",v="schema"+n):v=i;var x=this,S="definition"+n,P=x.definition,O="",A,I,H,q,C;if(m&&P.$data){C="keywordValidate"+n;var U=P.validateSchema;r+=" var "+S+" = RULES.custom['"+t+"'].definition; var "+C+" = "+S+".validate;"}else{if(q=e.useCustomRule(x,i,e.schema,e),!q)return;v="validate.schema"+u,C=q.code,A=P.compile,I=P.inline,H=P.macro}var M=C+".errors",L="i"+n,$="ruleErr"+n,k=P.async;if(k&&!e.async)throw new Error("async keyword in sync schema");if(I||H||(r+=""+M+" = null;"),r+="var "+y+" = errors;var "+d+";",m&&P.$data&&(O+="}",r+=" if ("+v+" === undefined) { "+d+" = true; } else { ",U&&(O+="}",r+=" "+d+" = "+S+".validateSchema("+v+"); if ("+d+") { ")),I)P.statements?r+=" "+q.validate+" ":r+=" "+d+" = "+q.validate+"; ";else if(H){var F=e.util.copy(e),O="";F.level++;var le="valid"+F.level;F.schema=q.validate,F.schemaPath="";var Y=e.compositeRule;e.compositeRule=F.compositeRule=!0;var re=e.validate(F).replace(/validate\.schema/g,C);e.compositeRule=F.compositeRule=Y,r+=" "+re}else{var W=W||[];W.push(r),r="",r+=" "+C+".call( ",e.opts.passContext?r+="this":r+="self",A||P.schema===!1?r+=" , "+g+" ":r+=" , "+v+" , "+g+" , validate.schema"+e.schemaPath+" ",r+=" , (dataPath || '')",e.errorPath!='""'&&(r+=" + "+e.errorPath);var Z=o?"data"+(o-1||""):"parentData",me=o?e.dataPathArr[o]:"parentDataProperty";r+=" , "+Z+" , "+me+" , rootData ) ";var Oe=r;r=W.pop(),P.errors===!1?(r+=" "+d+" = ",k&&(r+="await "),r+=""+Oe+"; "):k?(M="customErrors"+n,r+=" var "+M+" = null; try { "+d+" = await "+Oe+"; } catch (e) { "+d+" = false; if (e instanceof ValidationError) "+M+" = e.errors; else throw e; } "):r+=" "+M+" = null; "+d+" = "+Oe+"; "}if(P.modifying&&(r+=" if ("+Z+") "+g+" = "+Z+"["+me+"];"),r+=""+O,P.valid)f&&(r+=" if (true) { ");else{r+=" if ( ",P.valid===void 0?(r+=" !",H?r+=""+le:r+=""+d):r+=" "+!P.valid+" ",r+=") { ",p=x.keyword;var W=W||[];W.push(r),r="";var W=W||[];W.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(p||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { keyword: '"+x.keyword+"' } ",e.opts.messages!==!1&&(r+=` , message: 'should pass "`+x.keyword+`" keyword validation' `),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+g+" "),r+=" } "):r+=" {} ";var Ie=r;r=W.pop(),!e.compositeRule&&f?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(),I?P.errors?P.errors!="full"&&(r+=" for (var "+L+"="+y+"; "+L+"<errors; "+L+"++) { var "+$+" = vErrors["+L+"]; if ("+$+".dataPath === undefined) "+$+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+$+".schemaPath === undefined) { "+$+'.schemaPath = "'+c+'"; } ',e.opts.verbose&&(r+=" "+$+".schema = "+v+"; "+$+".data = "+g+"; "),r+=" } "):P.errors===!1?r+=" "+se+" ":(r+=" if ("+y+" == errors) { "+se+" } else { for (var "+L+"="+y+"; "+L+"<errors; "+L+"++) { var "+$+" = vErrors["+L+"]; if ("+$+".dataPath === undefined) "+$+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+$+".schemaPath === undefined) { "+$+'.schemaPath = "'+c+'"; } ',e.opts.verbose&&(r+=" "+$+".schema = "+v+"; "+$+".data = "+g+"; "),r+=" } } "):H?(r+=" var err = ",e.createErrors!==!1?(r+=" { keyword: '"+(p||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { keyword: '"+x.keyword+"' } ",e.opts.messages!==!1&&(r+=` , message: 'should pass "`+x.keyword+`" keyword validation' `),e.opts.verbose&&(r+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+g+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&f&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; ")):P.errors===!1?r+=" "+se+" ":(r+=" if (Array.isArray("+M+")) { if (vErrors === null) vErrors = "+M+"; else vErrors = vErrors.concat("+M+"); errors = vErrors.length; for (var "+L+"="+y+"; "+L+"<errors; "+L+"++) { var "+$+" = vErrors["+L+"]; if ("+$+".dataPath === undefined) "+$+".dataPath = (dataPath || '') + "+e.errorPath+"; "+$+'.schemaPath = "'+c+'"; ',e.opts.verbose&&(r+=" "+$+".schema = "+v+"; "+$+".data = "+g+"; "),r+=" } } else { "+se+" } "),r+=" } ",f&&(r+=" else { ")}return r}});var en=z((mg,kh)=>{kh.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 nl=z((vg,sl)=>{"use strict";var al=en();sl.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:al.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:al.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 il=z((gg,ol)=>{"use strict";var Dh=/^[a-z_$][a-z0-9_$-]*$/i,jh=tl(),Nh=nl();ol.exports={add:Lh,get:Fh,remove:Mh,validate:rn};function Lh(a,e){var t=this.RULES;if(t.keywords[a])throw new Error("Keyword "+a+" is already defined");if(!Dh.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++)o(a,s[r],e);else o(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 o(i,u,c){for(var f,p=0;p<t.length;p++){var g=t[p];if(g.type==u){f=g;break}}f||(f={type:u,rules:[]},t.push(f));var d={keyword:i,definition:c,custom:!0,code:jh,implements:c.implements};f.rules.push(d),t.custom[i]=d}return this}function Fh(a){var e=this.RULES.custom[a];return e?e.definition:this.RULES.keywords[a]||!1}function Mh(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 rn(a,e){rn.errors=null;var t=this._validateKeyword=this._validateKeyword||this.compile(Nh,!0);if(t(a))return!0;if(rn.errors=t.errors,e)throw new Error("custom keyword definition is invalid: "+this.errorsText(t.errors));return!1}});var ll=z((yg,qh)=>{qh.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 an=z((_g,gl)=>{"use strict";var ul=Uo(),nt=Da(),Uh=Vo(),dl=qs(),zh=Bs(),Vh=ri(),Hh=Qi(),fl=Wi(),hl=st();gl.exports=ge;ge.prototype.validate=Bh;ge.prototype.compile=Jh;ge.prototype.addSchema=Qh;ge.prototype.addMetaSchema=Kh;ge.prototype.validateSchema=Gh;ge.prototype.getSchema=Yh;ge.prototype.removeSchema=ep;ge.prototype.addFormat=lp;ge.prototype.errorsText=ip;ge.prototype._addSchema=rp;ge.prototype._compile=tp;ge.prototype.compileAsync=el();var Va=il();ge.prototype.addKeyword=Va.add;ge.prototype.getKeyword=Va.get;ge.prototype.removeKeyword=Va.remove;ge.prototype.validateKeyword=Va.validate;var pl=ja();ge.ValidationError=pl.Validation;ge.MissingRefError=pl.MissingRef;ge.$dataMetaSchema=fl;var za="http://json-schema.org/draft-07/schema",cl=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],Zh=["/properties"];function ge(a){if(!(this instanceof ge))return new ge(a);a=this._opts=hl.copy(a)||{},pp(this),this._schemas={},this._refs={},this._fragments={},this._formats=Vh(a.format),this._cache=a.cache||new Uh,this._loadingSchemas={},this._compilations=[],this.RULES=Hh(),this._getId=ap(a),a.loopRequired=a.loopRequired||1/0,a.errorDataPath=="property"&&(a._errorDataPathProperty=!0),a.serialize===void 0&&(a.serialize=zh),this._metaOpts=hp(this),a.formats&&dp(this),a.keywords&&fp(this),cp(this),typeof a.meta=="object"&&this.addMetaSchema(a.meta),a.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),up(this)}function Bh(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 Jh(a,e){var t=this._addSchema(a,void 0,e);return t.validate||this._compile(t)}function Qh(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=nt.normalizeId(e||n),vl(this,e),this._schemas[e]=this._addSchema(a,t,s,!0),this}function Kh(a,e,t){return this.addSchema(a,e,t,!0),this}function Gh(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||Wh(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 Wh(a){var e=a._opts.meta;return a._opts.defaultMeta=typeof e=="object"?a._getId(e)||e:a.getSchema(za)?za:void 0,a._opts.defaultMeta}function Yh(a){var e=ml(this,a);switch(typeof e){case"object":return e.validate||this._compile(e);case"string":return this.getSchema(e);case"undefined":return Xh(this,a)}}function Xh(a,e){var t=nt.schema.call(a,{schema:{}},e);if(t){var s=t.schema,r=t.root,n=t.baseId,o=ul.call(a,s,r,void 0,n);return a._fragments[e]=new dl({ref:e,fragment:!0,schema:s,root:r,baseId:n,validate:o}),o}}function ml(a,e){return e=nt.normalizeId(e),a._schemas[e]||a._refs[e]||a._fragments[e]}function ep(a){if(a instanceof RegExp)return Ua(this,this._schemas,a),Ua(this,this._refs,a),this;switch(typeof a){case"undefined":return Ua(this,this._schemas),Ua(this,this._refs),this._cache.clear(),this;case"string":var e=ml(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=nt.normalizeId(r),delete this._schemas[r],delete this._refs[r])}return this}function Ua(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 rp(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,o=this._cache.get(n);if(o)return o;s=s||this._opts.addUsedSchema!==!1;var i=nt.normalizeId(this._getId(a));i&&s&&vl(this,i);var u=this._opts.validateSchema!==!1&&!e,c;u&&!(c=i&&i==nt.normalizeId(a.$schema))&&this.validateSchema(a,!0);var f=nt.ids.call(this,a),p=new dl({id:i,schema:a,localRefs:f,cacheKey:n,meta:t});return i[0]!="#"&&s&&(this._refs[i]=p),this._cache.put(n,p),u&&c&&this.validateSchema(a,!0),p}function tp(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=ul.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,o=n.apply(this,arguments);return r.errors=n.errors,o}}function ap(a){switch(a.schemaId){case"auto":return op;case"id":return sp;default:return np}}function sp(a){return a.$id&&this.logger.warn("schema $id ignored",a.$id),a.id}function np(a){return a.id&&this.logger.warn("schema id ignored",a.id),a.$id}function op(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 ip(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 o=a[n];o&&(r+=s+o.dataPath+" "+o.message+t)}return r.slice(0,-t.length)}function lp(a,e){return typeof e=="string"&&(e=new RegExp(e)),this._formats[a]=e,this}function cp(a){var e;if(a._opts.$data&&(e=ll(),a.addMetaSchema(e,e.$id,!0)),a._opts.meta!==!1){var t=en();a._opts.$data&&(t=fl(t,Zh)),a.addMetaSchema(t,za,!0),a._refs["http://json-schema.org/schema"]=za}}function up(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 dp(a){for(var e in a._opts.formats){var t=a._opts.formats[e];a.addFormat(e,t)}}function fp(a){for(var e in a._opts.keywords){var t=a._opts.keywords[e];a.addKeyword(e,t)}}function vl(a,e){if(a._schemas[e]||a._refs[e])throw new Error('schema with key or id "'+e+'" already exists')}function hp(a){for(var e=hl.copy(a._opts),t=0;t<cl.length;t++)delete e[cl[t]];return e}function pp(a){var e=a._opts.logger;if(e===!1)a.logger={log:tn,warn:tn,error:tn};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 tn(){}});var wl=z((Rg,Ba)=>{"use strict";Ba.exports=yp;Ba.exports.format=bl;Ba.exports.parse=xl;var mp=/\B(?=(\d{3})+(?!\d))/g,vp=/(?:\.0*|(\.[^0]+)0+)$/,Cr={b:1,kb:1024,mb:1<<20,gb:1<<30,tb:Math.pow(1024,4),pb:Math.pow(1024,5)},gp=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function yp(a,e){return typeof a=="string"?xl(a):typeof a=="number"?bl(a,e):null}function bl(a,e){if(!Number.isFinite(a))return null;var t=Math.abs(a),s=e&&e.thousandsSeparator||"",r=e&&e.unitSeparator||"",n=e&&e.decimalPlaces!==void 0?e.decimalPlaces:2,o=!!(e&&e.fixedDecimals),i=e&&e.unit||"";(!i||!Cr[i.toLowerCase()])&&(t>=Cr.pb?i="PB":t>=Cr.tb?i="TB":t>=Cr.gb?i="GB":t>=Cr.mb?i="MB":t>=Cr.kb?i="KB":i="B");var u=a/Cr[i.toLowerCase()],c=u.toFixed(n);return o||(c=c.replace(vp,"$1")),s&&(c=c.split(".").map(function(f,p){return p===0?f.replace(mp,s):f}).join(".")),c+r+i}function xl(a){if(typeof a=="number"&&!isNaN(a))return a;if(typeof a!="string")return null;var e=gp.exec(a),t,s="b";return e?(t=parseFloat(e[1]),s=e[4].toLowerCase()):(t=parseInt(a,10),s="b"),isNaN(t)?null:Math.floor(Cr[s]*t)}});var nn=z(sn=>{"use strict";var Pl=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,_p=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,Sl=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,bp=/\\([\u000b\u0020-\u00ff])/g,xp=/([\\"])/g,Rl=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;sn.format=wp;sn.parse=Ep;function wp(a){if(!a||typeof a!="object")throw new TypeError("argument obj is required");var e=a.parameters,t=a.type;if(!t||!Rl.test(t))throw new TypeError("invalid type");var s=t;if(e&&typeof e=="object")for(var r,n=Object.keys(e).sort(),o=0;o<n.length;o++){if(r=n[o],!Sl.test(r))throw new TypeError("invalid parameter name");s+="; "+r+"="+Sp(e[r])}return s}function Ep(a){if(!a)throw new TypeError("argument string is required");var e=typeof a=="object"?Pp(a):a;if(typeof e!="string")throw new TypeError("argument string is required to be a string");var t=e.indexOf(";"),s=t!==-1?e.slice(0,t).trim():e.trim();if(!Rl.test(s))throw new TypeError("invalid media type");var r=new Rp(s.toLowerCase());if(t!==-1){var n,o,i;for(Pl.lastIndex=t;o=Pl.exec(e);){if(o.index!==t)throw new TypeError("invalid parameter format");t+=o[0].length,n=o[1].toLowerCase(),i=o[2],i.charCodeAt(0)===34&&(i=i.slice(1,-1),i.indexOf("\\")!==-1&&(i=i.replace(bp,"$1"))),r.parameters[n]=i}if(t!==e.length)throw new TypeError("invalid parameter format")}return r}function Pp(a){var e;if(typeof a.getHeader=="function"?e=a.getHeader("content-type"):typeof a.headers=="object"&&(e=a.headers&&a.headers["content-type"]),typeof e!="string")throw new TypeError("content-type header is missing from object");return e}function Sp(a){var e=String(a);if(Sl.test(e))return e;if(e.length>0&&!_p.test(e))throw new TypeError("invalid parameter value");return'"'+e.replace(xp,"\\$1")+'"'}function Rp(a){this.parameters=Object.create(null),this.type=a}});var Dl=z((Cg,kl)=>{kl.exports=Cl;Cl.sync=$p;var Al=require("fs");function Tp(a,e){var t=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!t||(t=t.split(";"),t.indexOf("")!==-1))return!0;for(var s=0;s<t.length;s++){var r=t[s].toLowerCase();if(r&&a.substr(-r.length).toLowerCase()===r)return!0}return!1}function Il(a,e,t){return!a.isSymbolicLink()&&!a.isFile()?!1:Tp(e,t)}function Cl(a,e,t){Al.stat(a,function(s,r){t(s,s?!1:Il(r,a,e))})}function $p(a,e){return Il(Al.statSync(a),a,e)}});var Ml=z((kg,Fl)=>{Fl.exports=Nl;Nl.sync=Ap;var jl=require("fs");function Nl(a,e,t){jl.stat(a,function(s,r){t(s,s?!1:Ll(r,e))})}function Ap(a,e){return Ll(jl.statSync(a),e)}function Ll(a,e){return a.isFile()&&Ip(a,e)}function Ip(a,e){var t=a.mode,s=a.uid,r=a.gid,n=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),o=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),i=parseInt("100",8),u=parseInt("010",8),c=parseInt("001",8),f=i|u,p=t&c||t&u&&r===o||t&i&&s===n||t&f&&n===0;return p}});var Ul=z((jg,ql)=>{var Dg=require("fs"),Qa;process.platform==="win32"||global.TESTING_WINDOWS?Qa=Dl():Qa=Ml();ql.exports=on;on.sync=Cp;function on(a,e,t){if(typeof e=="function"&&(t=e,e={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(s,r){on(a,e||{},function(n,o){n?r(n):s(o)})})}Qa(a,e||{},function(s,r){s&&(s.code==="EACCES"||e&&e.ignoreErrors)&&(s=null,r=!1),t(s,r)})}function Cp(a,e){try{return Qa.sync(a,e||{})}catch(t){if(e&&e.ignoreErrors||t.code==="EACCES")return!1;throw t}}});var Ql=z((Ng,Jl)=>{var Ot=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",zl=require("path"),kp=Ot?";":":",Vl=Ul(),Hl=a=>Object.assign(new Error(`not found: ${a}`),{code:"ENOENT"}),Zl=(a,e)=>{let t=e.colon||kp,s=a.match(/\//)||Ot&&a.match(/\\/)?[""]:[...Ot?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(t)],r=Ot?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",n=Ot?r.split(t):[""];return Ot&&a.indexOf(".")!==-1&&n[0]!==""&&n.unshift(""),{pathEnv:s,pathExt:n,pathExtExe:r}},Bl=(a,e,t)=>{typeof e=="function"&&(t=e,e={}),e||(e={});let{pathEnv:s,pathExt:r,pathExtExe:n}=Zl(a,e),o=[],i=c=>new Promise((f,p)=>{if(c===s.length)return e.all&&o.length?f(o):p(Hl(a));let g=s[c],d=/^".*"$/.test(g)?g.slice(1,-1):g,y=zl.join(d,a),m=!d&&/^\.[\\\/]/.test(a)?a.slice(0,2)+y:y;f(u(m,c,0))}),u=(c,f,p)=>new Promise((g,d)=>{if(p===r.length)return g(i(f+1));let y=r[p];Vl(c+y,{pathExt:n},(m,v)=>{if(!m&&v)if(e.all)o.push(c+y);else return g(c+y);return g(u(c,f,p+1))})});return t?i(0).then(c=>t(null,c),t):i(0)},Dp=(a,e)=>{e=e||{};let{pathEnv:t,pathExt:s,pathExtExe:r}=Zl(a,e),n=[];for(let o=0;o<t.length;o++){let i=t[o],u=/^".*"$/.test(i)?i.slice(1,-1):i,c=zl.join(u,a),f=!u&&/^\.[\\\/]/.test(a)?a.slice(0,2)+c:c;for(let p=0;p<s.length;p++){let g=f+s[p];try{if(Vl.sync(g,{pathExt:r}))if(e.all)n.push(g);else return g}catch{}}}if(e.all&&n.length)return n;if(e.nothrow)return null;throw Hl(a)};Jl.exports=Bl;Bl.sync=Dp});var Gl=z((Lg,ln)=>{"use strict";var Kl=(a={})=>{let e=a.env||process.env;return(a.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(s=>s.toUpperCase()==="PATH")||"Path"};ln.exports=Kl;ln.exports.default=Kl});var ec=z((Fg,Xl)=>{"use strict";var Wl=require("path"),jp=Ql(),Np=Gl();function Yl(a,e){let t=a.options.env||process.env,s=process.cwd(),r=a.options.cwd!=null,n=r&&process.chdir!==void 0&&!process.chdir.disabled;if(n)try{process.chdir(a.options.cwd)}catch{}let o;try{o=jp.sync(a.command,{path:t[Np({env:t})],pathExt:e?Wl.delimiter:void 0})}catch{}finally{n&&process.chdir(s)}return o&&(o=Wl.resolve(r?a.options.cwd:"",o)),o}function Lp(a){return Yl(a)||Yl(a,!0)}Xl.exports=Lp});var rc=z((Mg,un)=>{"use strict";var cn=/([()\][%!^"`<>&|;, *?])/g;function Fp(a){return a=a.replace(cn,"^$1"),a}function Mp(a,e){return a=`${a}`,a=a.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),a=a.replace(/(?=(\\+?)?)\1$/,"$1$1"),a=`"${a}"`,a=a.replace(cn,"^$1"),e&&(a=a.replace(cn,"^$1")),a}un.exports.command=Fp;un.exports.argument=Mp});var ac=z((qg,tc)=>{"use strict";tc.exports=/^#!(.*)/});var nc=z((Ug,sc)=>{"use strict";var qp=ac();sc.exports=(a="")=>{let e=a.match(qp);if(!e)return null;let[t,s]=e[0].replace(/#! ?/,"").split(" "),r=t.split("/").pop();return r==="env"?s:s?`${r} ${s}`:r}});var ic=z((zg,oc)=>{"use strict";var dn=require("fs"),Up=nc();function zp(a){let t=Buffer.alloc(150),s;try{s=dn.openSync(a,"r"),dn.readSync(s,t,0,150,0),dn.closeSync(s)}catch{}return Up(t.toString())}oc.exports=zp});var dc=z((Vg,uc)=>{"use strict";var Vp=require("path"),lc=ec(),cc=rc(),Hp=ic(),Zp=process.platform==="win32",Bp=/\.(?:com|exe)$/i,Jp=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Qp(a){a.file=lc(a);let e=a.file&&Hp(a.file);return e?(a.args.unshift(a.file),a.command=e,lc(a)):a.file}function Kp(a){if(!Zp)return a;let e=Qp(a),t=!Bp.test(e);if(a.options.forceShell||t){let s=Jp.test(e);a.command=Vp.normalize(a.command),a.command=cc.command(a.command),a.args=a.args.map(n=>cc.argument(n,s));let r=[a.command].concat(a.args).join(" ");a.args=["/d","/s","/c",`"${r}"`],a.command=process.env.comspec||"cmd.exe",a.options.windowsVerbatimArguments=!0}return a}function Gp(a,e,t){e&&!Array.isArray(e)&&(t=e,e=null),e=e?e.slice(0):[],t=Object.assign({},t);let s={command:a,args:e,options:t,file:void 0,original:{command:a,args:e}};return t.shell?s:Kp(s)}uc.exports=Gp});var pc=z((Hg,hc)=>{"use strict";var fn=process.platform==="win32";function hn(a,e){return Object.assign(new Error(`${e} ${a.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${a.command}`,path:a.command,spawnargs:a.args})}function Wp(a,e){if(!fn)return;let t=a.emit;a.emit=function(s,r){if(s==="exit"){let n=fc(r,e);if(n)return t.call(a,"error",n)}return t.apply(a,arguments)}}function fc(a,e){return fn&&a===1&&!e.file?hn(e.original,"spawn"):null}function Yp(a,e){return fn&&a===1&&!e.file?hn(e.original,"spawnSync"):null}hc.exports={hookChildProcess:Wp,verifyENOENT:fc,verifyENOENTSync:Yp,notFoundError:hn}});var gc=z((Zg,Tt)=>{"use strict";var mc=require("child_process"),pn=dc(),mn=pc();function vc(a,e,t){let s=pn(a,e,t),r=mc.spawn(s.command,s.args,s.options);return mn.hookChildProcess(r,s),r}function Xp(a,e,t){let s=pn(a,e,t),r=mc.spawnSync(s.command,s.args,s.options);return r.error=r.error||mn.verifyENOENTSync(r.status,s),r}Tt.exports=vc;Tt.exports.spawn=vc;Tt.exports.sync=Xp;Tt.exports._parse=pn;Tt.exports._enoent=mn});var Nm={};zn(Nm,{CallToolRequestSchema:()=>Rs,Client:()=>Ha,ListRootsRequestSchema:()=>Is,ListToolsRequestSchema:()=>Ps,PingRequestSchema:()=>St,SSEServerTransport:()=>Ja,Server:()=>Za,StdioClientTransport:()=>Ga,StdioServerTransport:()=>Wa,StreamableHTTPClientTransport:()=>ts,StreamableHTTPServerTransport:()=>Ya,z:()=>l,zodToJsonSchema:()=>$n});module.exports=Mu(Nm);var l={};zn(l,{BRAND:()=>dd,DIRTY:()=>qr,EMPTY_PATH:()=>Vu,INVALID:()=>B,NEVER:()=>Kd,OK:()=>$e,ParseStatus:()=>Re,Schema:()=>G,ZodAny:()=>Rr,ZodArray:()=>yr,ZodBigInt:()=>zr,ZodBoolean:()=>Vr,ZodBranded:()=>Ft,ZodCatch:()=>et,ZodDate:()=>Hr,ZodDefault:()=>Xr,ZodDiscriminatedUnion:()=>ha,ZodEffects:()=>Qe,ZodEnum:()=>Wr,ZodError:()=>Le,ZodFirstPartyTypeKind:()=>T,ZodFunction:()=>ma,ZodIntersection:()=>Qr,ZodIssueCode:()=>R,ZodLazy:()=>Kr,ZodLiteral:()=>Gr,ZodMap:()=>xt,ZodNaN:()=>Et,ZodNativeEnum:()=>Yr,ZodNever:()=>Ye,ZodNull:()=>Br,ZodNullable:()=>ir,ZodNumber:()=>Ur,ZodObject:()=>Fe,ZodOptional:()=>Be,ZodParsedType:()=>j,ZodPipeline:()=>Mt,ZodPromise:()=>Or,ZodReadonly:()=>rt,ZodRecord:()=>pa,ZodSchema:()=>G,ZodSet:()=>wt,ZodString:()=>Sr,ZodSymbol:()=>_t,ZodTransformer:()=>Qe,ZodTuple:()=>or,ZodType:()=>G,ZodUndefined:()=>Zr,ZodUnion:()=>Jr,ZodUnknown:()=>gr,ZodVoid:()=>bt,addIssueToContext:()=>D,any:()=>bd,array:()=>Pd,bigint:()=>md,boolean:()=>eo,coerce:()=>Qd,custom:()=>Wn,date:()=>vd,datetimeRegex:()=>Kn,defaultErrorMap:()=>mr,discriminatedUnion:()=>Td,effect:()=>qd,enum:()=>Ld,function:()=>Dd,getErrorMap:()=>vt,getParsedType:()=>nr,instanceof:()=>hd,intersection:()=>$d,isAborted:()=>da,isAsync:()=>gt,isDirty:()=>fa,isValid:()=>Pr,late:()=>fd,lazy:()=>jd,literal:()=>Nd,makeIssue:()=>Lt,map:()=>Cd,nan:()=>pd,nativeEnum:()=>Fd,never:()=>wd,null:()=>_d,nullable:()=>zd,number:()=>Xn,object:()=>Sd,objectUtil:()=>ds,oboolean:()=>Jd,onumber:()=>Bd,optional:()=>Ud,ostring:()=>Zd,pipeline:()=>Hd,preprocess:()=>Vd,promise:()=>Md,quotelessJson:()=>qu,record:()=>Id,set:()=>kd,setErrorMap:()=>zu,strictObject:()=>Rd,string:()=>Yn,symbol:()=>gd,transformer:()=>qd,tuple:()=>Ad,undefined:()=>yd,union:()=>Od,unknown:()=>xd,util:()=>X,void:()=>Ed});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 o of r)n[o]=o;return n},a.getValidEnumValues=r=>{let n=a.objectKeys(r).filter(i=>typeof r[r[i]]!="number"),o={};for(let i of n)o[i]=r[i];return a.objectValues(o)},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 o in r)Object.prototype.hasOwnProperty.call(r,o)&&n.push(o);return n},a.find=(r,n)=>{for(let o of r)if(n(o))return o},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(o=>typeof o=="string"?`'${o}'`:o).join(n)}a.joinValues=s,a.jsonStringifyReplacer=(r,n)=>typeof n=="bigint"?n.toString():n})(X||(X={}));var ds;(function(a){a.mergeShapes=(e,t)=>({...e,...t})})(ds||(ds={}));var j=X.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),nr=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!="undefined"&&a instanceof Map?j.map:typeof Set!="undefined"&&a instanceof Set?j.set:typeof Date!="undefined"&&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"]),qu=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 o of n.issues)if(o.code==="invalid_union")o.unionErrors.map(r);else if(o.code==="invalid_return_type")r(o.returnTypeError);else if(o.code==="invalid_arguments")r(o.argumentsError);else if(o.path.length===0)s._errors.push(t(o));else{let i=s,u=0;for(;u<o.path.length;){let c=o.path[u];u===o.path.length-1?(i[c]=i[c]||{_errors:[]},i[c]._errors.push(t(o))):i[c]=i[c]||{_errors:[]},i=i[c],u++}}};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 Uu=(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}},mr=Uu;var Hn=mr;function zu(a){Hn=a}function vt(){return Hn}var Lt=a=>{let{data:e,path:t,errorMaps:s,issueData:r}=a,n=[...t,...r.path||[]],o={...r,path:n};if(r.message!==void 0)return{...r,path:n,message:r.message};let i="",u=s.filter(c=>!!c).slice().reverse();for(let c of u)i=c(o,{data:e,defaultError:i}).message;return{...r,path:n,message:i}},Vu=[];function D(a,e){let t=vt(),s=Lt({issueData:e,data:a.data,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,t,t===mr?void 0:mr].filter(r=>!!r)});a.common.issues.push(s)}var Re=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 B;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,o=await r.value;s.push({key:n,value:o})}return a.mergeObjectSync(e,s)}static mergeObjectSync(e,t){let s={};for(let r of t){let{key:n,value:o}=r;if(n.status==="aborted"||o.status==="aborted")return B;n.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),n.value!=="__proto__"&&(typeof o.value!="undefined"||r.alwaysSet)&&(s[n.value]=o.value)}return{status:e.value,value:s}}},B=Object.freeze({status:"aborted"}),qr=a=>({status:"dirty",value:a}),$e=a=>({status:"valid",value:a}),da=a=>a.status==="aborted",fa=a=>a.status==="dirty",Pr=a=>a.status==="valid",gt=a=>typeof Promise!="undefined"&&a instanceof Promise;var V;(function(a){a.errToObj=e=>typeof e=="string"?{message:e}:e||{},a.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(V||(V={}));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}},Zn=(a,e)=>{if(Pr(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:(o,i)=>{var c,f;let{message:u}=a;return o.code==="invalid_enum_value"?{message:u!=null?u:i.defaultError}:typeof i.data=="undefined"?{message:(c=u!=null?u:s)!=null?c:i.defaultError}:o.code!=="invalid_type"?{message:i.defaultError}:{message:(f=u!=null?u:t)!=null?f:i.defaultError}},description:r}}var G=class{get description(){return this._def.description}_getType(e){return nr(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:nr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Re,ctx:{common:e.parent.common,data:e.data,parsedType:nr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(gt(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){var n;let s={common:{issues:[],async:(n=t==null?void 0:t.async)!=null?n:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:nr(e)},r=this._parseSync({data:e,path:s.path,parent:s});return Zn(s,r)}"~validate"(e){var s,r;let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:nr(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:t});return Pr(n)?{value:n.value}:{issues:t.common.issues}}catch(n){(r=(s=n==null?void 0:n.message)==null?void 0:s.toLowerCase())!=null&&r.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(n=>Pr(n)?{value:n.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==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:nr(e)},r=this._parse({data:e,path:s.path,parent:s}),n=await(gt(r)?r:Promise.resolve(r));return Zn(s,n)}refine(e,t){let s=r=>typeof t=="string"||typeof t=="undefined"?{message:t}:typeof t=="function"?t(r):t;return this._refinement((r,n)=>{let o=e(r),i=()=>n.addIssue({code:R.custom,...s(r)});return typeof Promise!="undefined"&&o instanceof Promise?o.then(u=>u?!0:(i(),!1)):o?!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 ir.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return yr.create(this)}promise(){return Or.create(this,this._def)}or(e){return Jr.create([this,e],this._def)}and(e){return Qr.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 Xr({...Q(this._def),innerType:this,defaultValue:t,typeName:T.ZodDefault})}brand(){return new Ft({typeName:T.ZodBranded,type:this,...Q(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new et({...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 Mt.create(this,e)}readonly(){return rt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Hu=/^c[^\s-]{8,}$/i,Zu=/^[0-9a-z]+$/,Bu=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ju=/^[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,Qu=/^[a-z0-9_-]{21}$/i,Ku=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Gu=/^[-+]?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)?)??$/,Wu=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Yu="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",fs,Xu=/^(?:(?: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])$/,ed=/^(?:(?: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])$/,rd=/^(([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]))$/,td=/^(([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])$/,ad=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,sd=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Jn="((\\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])))",nd=new RegExp(`^${Jn}$`);function Qn(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 od(a){return new RegExp(`^${Qn(a)}$`)}function Kn(a){let e=`${Jn}T${Qn(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 id(a,e){return!!((e==="v4"||!e)&&Xu.test(a)||(e==="v6"||!e)&&rd.test(a))}function ld(a,e){if(!Ku.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==null?void 0:r.typ)!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function cd(a,e){return!!((e==="v4"||!e)&&ed.test(a)||(e==="v6"||!e)&&td.test(a))}var Sr=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 D(n,{code:R.invalid_type,expected:j.string,received:n.parsedType}),B}let s=new Re,r;for(let n of this._def.checks)if(n.kind==="min")e.data.length<n.value&&(r=this._getOrReturnCtx(e,r),D(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),D(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 o=e.data.length>n.value,i=e.data.length<n.value;(o||i)&&(r=this._getOrReturnCtx(e,r),o?D(r,{code:R.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):i&&D(r,{code:R.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),s.dirty())}else if(n.kind==="email")Wu.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"email",code:R.invalid_string,message:n.message}),s.dirty());else if(n.kind==="emoji")fs||(fs=new RegExp(Yu,"u")),fs.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"emoji",code:R.invalid_string,message:n.message}),s.dirty());else if(n.kind==="uuid")Ju.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"uuid",code:R.invalid_string,message:n.message}),s.dirty());else if(n.kind==="nanoid")Qu.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"nanoid",code:R.invalid_string,message:n.message}),s.dirty());else if(n.kind==="cuid")Hu.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"cuid",code:R.invalid_string,message:n.message}),s.dirty());else if(n.kind==="cuid2")Zu.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"cuid2",code:R.invalid_string,message:n.message}),s.dirty());else if(n.kind==="ulid")Bu.test(e.data)||(r=this._getOrReturnCtx(e,r),D(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),D(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),D(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),D(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),D(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),D(r,{code:R.invalid_string,validation:{endsWith:n.value},message:n.message}),s.dirty()):n.kind==="datetime"?Kn(n).test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{code:R.invalid_string,validation:"datetime",message:n.message}),s.dirty()):n.kind==="date"?nd.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{code:R.invalid_string,validation:"date",message:n.message}),s.dirty()):n.kind==="time"?od(n).test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{code:R.invalid_string,validation:"time",message:n.message}),s.dirty()):n.kind==="duration"?Gu.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"duration",code:R.invalid_string,message:n.message}),s.dirty()):n.kind==="ip"?id(e.data,n.version)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"ip",code:R.invalid_string,message:n.message}),s.dirty()):n.kind==="jwt"?ld(e.data,n.alg)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"jwt",code:R.invalid_string,message:n.message}),s.dirty()):n.kind==="cidr"?cd(e.data,n.version)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"cidr",code:R.invalid_string,message:n.message}),s.dirty()):n.kind==="base64"?ad.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"base64",code:R.invalid_string,message:n.message}),s.dirty()):n.kind==="base64url"?sd.test(e.data)||(r=this._getOrReturnCtx(e,r),D(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,...V.errToObj(s)})}_addCheck(e){return new a({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...V.errToObj(e)})}url(e){return this._addCheck({kind:"url",...V.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...V.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...V.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...V.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...V.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...V.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...V.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...V.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...V.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...V.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...V.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...V.errToObj(e)})}datetime(e){var t,s;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!=null?t:!1,local:(s=e==null?void 0:e.local)!=null?s:!1,...V.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision,...V.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...V.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...V.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...V.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...V.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...V.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...V.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...V.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...V.errToObj(t)})}nonempty(e){return this.min(1,V.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}};Sr.create=a=>{var e;return new Sr({checks:[],typeName:T.ZodString,coerce:(e=a==null?void 0:a.coerce)!=null?e:!1,...Q(a)})};function ud(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(".","")),o=Number.parseInt(e.toFixed(r).replace(".",""));return n%o/10**r}var Ur=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 D(n,{code:R.invalid_type,expected:j.number,received:n.parsedType}),B}let s,r=new Re;for(let n of this._def.checks)n.kind==="int"?X.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),D(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),D(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),D(s,{code:R.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):n.kind==="multipleOf"?ud(e.data,n.value)!==0&&(s=this._getOrReturnCtx(e,s),D(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),D(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,V.toString(t))}gt(e,t){return this.setLimit("min",e,!1,V.toString(t))}lte(e,t){return this.setLimit("max",e,!0,V.toString(t))}lt(e,t){return this.setLimit("max",e,!1,V.toString(t))}setLimit(e,t,s,r){return new a({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:V.toString(r)}]})}_addCheck(e){return new a({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:V.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:V.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:V.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:V.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:V.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:V.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:V.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:V.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:V.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)}};Ur.create=a=>new Ur({checks:[],typeName:T.ZodNumber,coerce:(a==null?void 0:a.coerce)||!1,...Q(a)});var zr=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 Re;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),D(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),D(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),D(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 D(t,{code:R.invalid_type,expected:j.bigint,received:t.parsedType}),B}gte(e,t){return this.setLimit("min",e,!0,V.toString(t))}gt(e,t){return this.setLimit("min",e,!1,V.toString(t))}lte(e,t){return this.setLimit("max",e,!0,V.toString(t))}lt(e,t){return this.setLimit("max",e,!1,V.toString(t))}setLimit(e,t,s,r){return new a({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:V.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:V.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:V.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:V.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:V.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:V.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}};zr.create=a=>{var e;return new zr({checks:[],typeName:T.ZodBigInt,coerce:(e=a==null?void 0:a.coerce)!=null?e:!1,...Q(a)})};var Vr=class extends G{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==j.boolean){let s=this._getOrReturnCtx(e);return D(s,{code:R.invalid_type,expected:j.boolean,received:s.parsedType}),B}return $e(e.data)}};Vr.create=a=>new Vr({typeName:T.ZodBoolean,coerce:(a==null?void 0:a.coerce)||!1,...Q(a)});var Hr=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 D(n,{code:R.invalid_type,expected:j.date,received:n.parsedType}),B}if(Number.isNaN(e.data.getTime())){let n=this._getOrReturnCtx(e);return D(n,{code:R.invalid_date}),B}let s=new Re,r;for(let n of this._def.checks)n.kind==="min"?e.data.getTime()<n.value&&(r=this._getOrReturnCtx(e,r),D(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),D(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:V.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:V.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}};Hr.create=a=>new Hr({checks:[],coerce:(a==null?void 0:a.coerce)||!1,typeName:T.ZodDate,...Q(a)});var _t=class extends G{_parse(e){if(this._getType(e)!==j.symbol){let s=this._getOrReturnCtx(e);return D(s,{code:R.invalid_type,expected:j.symbol,received:s.parsedType}),B}return $e(e.data)}};_t.create=a=>new _t({typeName:T.ZodSymbol,...Q(a)});var Zr=class extends G{_parse(e){if(this._getType(e)!==j.undefined){let s=this._getOrReturnCtx(e);return D(s,{code:R.invalid_type,expected:j.undefined,received:s.parsedType}),B}return $e(e.data)}};Zr.create=a=>new Zr({typeName:T.ZodUndefined,...Q(a)});var Br=class extends G{_parse(e){if(this._getType(e)!==j.null){let s=this._getOrReturnCtx(e);return D(s,{code:R.invalid_type,expected:j.null,received:s.parsedType}),B}return $e(e.data)}};Br.create=a=>new Br({typeName:T.ZodNull,...Q(a)});var Rr=class extends G{constructor(){super(...arguments),this._any=!0}_parse(e){return $e(e.data)}};Rr.create=a=>new Rr({typeName:T.ZodAny,...Q(a)});var gr=class extends G{constructor(){super(...arguments),this._unknown=!0}_parse(e){return $e(e.data)}};gr.create=a=>new gr({typeName:T.ZodUnknown,...Q(a)});var Ye=class extends G{_parse(e){let t=this._getOrReturnCtx(e);return D(t,{code:R.invalid_type,expected:j.never,received:t.parsedType}),B}};Ye.create=a=>new Ye({typeName:T.ZodNever,...Q(a)});var bt=class extends G{_parse(e){if(this._getType(e)!==j.undefined){let s=this._getOrReturnCtx(e);return D(s,{code:R.invalid_type,expected:j.void,received:s.parsedType}),B}return $e(e.data)}};bt.create=a=>new bt({typeName:T.ZodVoid,...Q(a)});var yr=class a extends G{_parse(e){let{ctx:t,status:s}=this._processInputParams(e),r=this._def;if(t.parsedType!==j.array)return D(t,{code:R.invalid_type,expected:j.array,received:t.parsedType}),B;if(r.exactLength!==null){let o=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(o||i)&&(D(t,{code:o?R.too_big:R.too_small,minimum:i?r.exactLength.value:void 0,maximum:o?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&&(D(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&&(D(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((o,i)=>r.type._parseAsync(new Je(t,o,t.path,i)))).then(o=>Re.mergeArray(s,o));let n=[...t.data].map((o,i)=>r.type._parseSync(new Je(t,o,t.path,i)));return Re.mergeArray(s,n)}get element(){return this._def.type}min(e,t){return new a({...this._def,minLength:{value:e,message:V.toString(t)}})}max(e,t){return new a({...this._def,maxLength:{value:e,message:V.toString(t)}})}length(e,t){return new a({...this._def,exactLength:{value:e,message:V.toString(t)}})}nonempty(e){return this.min(1,e)}};yr.create=(a,e)=>new yr({type:a,minLength:null,maxLength:null,exactLength:null,typeName:T.ZodArray,...Q(e)});function yt(a){if(a instanceof Fe){let e={};for(let t in a.shape){let s=a.shape[t];e[t]=Be.create(yt(s))}return new Fe({...a._def,shape:()=>e})}else return a instanceof yr?new yr({...a._def,type:yt(a.element)}):a instanceof Be?Be.create(yt(a.unwrap())):a instanceof ir?ir.create(yt(a.unwrap())):a instanceof or?or.create(a.items.map(e=>yt(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 c=this._getOrReturnCtx(e);return D(c,{code:R.invalid_type,expected:j.object,received:c.parsedType}),B}let{status:s,ctx:r}=this._processInputParams(e),{shape:n,keys:o}=this._getCached(),i=[];if(!(this._def.catchall instanceof Ye&&this._def.unknownKeys==="strip"))for(let c in r.data)o.includes(c)||i.push(c);let u=[];for(let c of o){let f=n[c],p=r.data[c];u.push({key:{status:"valid",value:c},value:f._parse(new Je(r,p,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof Ye){let c=this._def.unknownKeys;if(c==="passthrough")for(let f of i)u.push({key:{status:"valid",value:f},value:{status:"valid",value:r.data[f]}});else if(c==="strict")i.length>0&&(D(r,{code:R.unrecognized_keys,keys:i}),s.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let f of i){let p=r.data[f];u.push({key:{status:"valid",value:f},value:c._parse(new Je(r,p,r.path,f)),alwaysSet:f in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let c=[];for(let f of u){let p=await f.key,g=await f.value;c.push({key:p,value:g,alwaysSet:f.alwaysSet})}return c}).then(c=>Re.mergeObjectSync(s,c)):Re.mergeObjectSync(s,u)}get shape(){return this._def.shape()}strict(e){return V.errToObj,new a({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{var n,o,i,u;let r=(i=(o=(n=this._def).errorMap)==null?void 0:o.call(n,t,s).message)!=null?i:s.defaultError;return t.code==="unrecognized_keys"?{message:(u=V.errToObj(e).message)!=null?u: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 yt(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 Gn(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 Jr=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 o=n.map(i=>new Le(i.ctx.common.issues));return D(t,{code:R.invalid_union,unionErrors:o}),B}if(t.common.async)return Promise.all(s.map(async n=>{let o={...t,common:{...t.common,issues:[]},parent:null};return{result:await n._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(r);{let n,o=[];for(let u of s){let c={...t,common:{...t.common,issues:[]},parent:null},f=u._parseSync({data:t.data,path:t.path,parent:c});if(f.status==="valid")return f;f.status==="dirty"&&!n&&(n={result:f,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(n)return t.common.issues.push(...n.ctx.common.issues),n.result;let i=o.map(u=>new Le(u));return D(t,{code:R.invalid_union,unionErrors:i}),B}}get options(){return this._def.options}};Jr.create=(a,e)=>new Jr({options:a,typeName:T.ZodUnion,...Q(e)});var vr=a=>a instanceof Kr?vr(a.schema):a instanceof Qe?vr(a.innerType()):a instanceof Gr?[a.value]:a instanceof Wr?a.options:a instanceof Yr?X.objectValues(a.enum):a instanceof Xr?vr(a._def.innerType):a instanceof Zr?[void 0]:a instanceof Br?[null]:a instanceof Be?[void 0,...vr(a.unwrap())]:a instanceof ir?[null,...vr(a.unwrap())]:a instanceof Ft||a instanceof rt?vr(a.unwrap()):a instanceof et?vr(a._def.innerType):[],ha=class a extends G{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==j.object)return D(t,{code:R.invalid_type,expected:j.object,received:t.parsedType}),B;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}):(D(t,{code:R.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),B)}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 o=vr(n.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of o){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 hs(a,e){let t=nr(a),s=nr(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),o={...a,...e};for(let i of n){let u=hs(a[i],e[i]);if(!u.valid)return{valid:!1};o[i]=u.data}return{valid:!0,data:o}}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 o=a[n],i=e[n],u=hs(o,i);if(!u.valid)return{valid:!1};r.push(u.data)}return{valid:!0,data:r}}else return t===j.date&&s===j.date&&+a==+e?{valid:!0,data:a}:{valid:!1}}var Qr=class extends G{_parse(e){let{status:t,ctx:s}=this._processInputParams(e),r=(n,o)=>{if(da(n)||da(o))return B;let i=hs(n.value,o.value);return i.valid?((fa(n)||fa(o))&&t.dirty(),{status:t.value,value:i.data}):(D(s,{code:R.invalid_intersection_types}),B)};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,o])=>r(n,o)):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}))}};Qr.create=(a,e,t)=>new Qr({left:a,right:e,typeName:T.ZodIntersection,...Q(t)});var or=class a extends G{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==j.array)return D(s,{code:R.invalid_type,expected:j.array,received:s.parsedType}),B;if(s.data.length<this._def.items.length)return D(s,{code:R.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),B;!this._def.rest&&s.data.length>this._def.items.length&&(D(s,{code:R.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let n=[...s.data].map((o,i)=>{let u=this._def.items[i]||this._def.rest;return u?u._parse(new Je(s,o,s.path,i)):null}).filter(o=>!!o);return s.common.async?Promise.all(n).then(o=>Re.mergeArray(t,o)):Re.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new a({...this._def,rest:e})}};or.create=(a,e)=>{if(!Array.isArray(a))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new or({items:a,typeName:T.ZodTuple,rest:null,...Q(e)})};var pa=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 D(s,{code:R.invalid_type,expected:j.object,received:s.parsedType}),B;let r=[],n=this._def.keyType,o=this._def.valueType;for(let i in s.data)r.push({key:n._parse(new Je(s,i,s.path,i)),value:o._parse(new Je(s,s.data[i],s.path,i)),alwaysSet:i in s.data});return s.common.async?Re.mergeObjectAsync(t,r):Re.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:Sr.create(),valueType:e,typeName:T.ZodRecord,...Q(t)})}},xt=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 D(s,{code:R.invalid_type,expected:j.map,received:s.parsedType}),B;let r=this._def.keyType,n=this._def.valueType,o=[...s.data.entries()].map(([i,u],c)=>({key:r._parse(new Je(s,i,s.path,[c,"key"])),value:n._parse(new Je(s,u,s.path,[c,"value"]))}));if(s.common.async){let i=new Map;return Promise.resolve().then(async()=>{for(let u of o){let c=await u.key,f=await u.value;if(c.status==="aborted"||f.status==="aborted")return B;(c.status==="dirty"||f.status==="dirty")&&t.dirty(),i.set(c.value,f.value)}return{status:t.value,value:i}})}else{let i=new Map;for(let u of o){let c=u.key,f=u.value;if(c.status==="aborted"||f.status==="aborted")return B;(c.status==="dirty"||f.status==="dirty")&&t.dirty(),i.set(c.value,f.value)}return{status:t.value,value:i}}}};xt.create=(a,e,t)=>new xt({valueType:e,keyType:a,typeName:T.ZodMap,...Q(t)});var wt=class a extends G{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==j.set)return D(s,{code:R.invalid_type,expected:j.set,received:s.parsedType}),B;let r=this._def;r.minSize!==null&&s.data.size<r.minSize.value&&(D(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&&(D(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 o(u){let c=new Set;for(let f of u){if(f.status==="aborted")return B;f.status==="dirty"&&t.dirty(),c.add(f.value)}return{status:t.value,value:c}}let i=[...s.data.values()].map((u,c)=>n._parse(new Je(s,u,s.path,c)));return s.common.async?Promise.all(i).then(u=>o(u)):o(i)}min(e,t){return new a({...this._def,minSize:{value:e,message:V.toString(t)}})}max(e,t){return new a({...this._def,maxSize:{value:e,message:V.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};wt.create=(a,e)=>new wt({valueType:a,minSize:null,maxSize:null,typeName:T.ZodSet,...Q(e)});var ma=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 D(t,{code:R.invalid_type,expected:j.function,received:t.parsedType}),B;function s(i,u){return Lt({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,vt(),mr].filter(c=>!!c),issueData:{code:R.invalid_arguments,argumentsError:u}})}function r(i,u){return Lt({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,vt(),mr].filter(c=>!!c),issueData:{code:R.invalid_return_type,returnTypeError:u}})}let n={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof Or){let i=this;return $e(async function(...u){let c=new Le([]),f=await i._def.args.parseAsync(u,n).catch(d=>{throw c.addIssue(s(u,d)),c}),p=await Reflect.apply(o,this,f);return await i._def.returns._def.type.parseAsync(p,n).catch(d=>{throw c.addIssue(r(p,d)),c})})}else{let i=this;return $e(function(...u){let c=i._def.args.safeParse(u,n);if(!c.success)throw new Le([s(u,c.error)]);let f=Reflect.apply(o,this,c.data),p=i._def.returns.safeParse(f,n);if(!p.success)throw new Le([r(f,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new a({...this._def,args:or.create(e).rest(gr.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||or.create([]).rest(gr.create()),returns:t||gr.create(),typeName:T.ZodFunction,...Q(s)})}},Kr=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})}};Kr.create=(a,e)=>new Kr({getter:a,typeName:T.ZodLazy,...Q(e)});var Gr=class extends G{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return D(t,{received:t.data,code:R.invalid_literal,expected:this._def.value}),B}return{status:"valid",value:e.data}}get value(){return this._def.value}};Gr.create=(a,e)=>new Gr({value:a,typeName:T.ZodLiteral,...Q(e)});function Gn(a,e){return new Wr({values:a,typeName:T.ZodEnum,...Q(e)})}var Wr=class a extends G{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),s=this._def.values;return D(t,{expected:X.joinValues(s),received:t.parsedType,code:R.invalid_type}),B}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 D(t,{received:t.data,code:R.invalid_enum_value,options:s}),B}return $e(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})}};Wr.create=Gn;var Yr=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 D(s,{expected:X.joinValues(r),received:s.parsedType,code:R.invalid_type}),B}if(this._cache||(this._cache=new Set(X.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let r=X.objectValues(t);return D(s,{received:s.data,code:R.invalid_enum_value,options:r}),B}return $e(e.data)}get enum(){return this._def.values}};Yr.create=(a,e)=>new Yr({values:a,typeName:T.ZodNativeEnum,...Q(e)});var Or=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 D(t,{code:R.invalid_type,expected:j.promise,received:t.parsedType}),B;let s=t.parsedType===j.promise?t.data:Promise.resolve(t.data);return $e(s.then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Or.create=(a,e)=>new Or({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:o=>{D(s,o),o.fatal?t.abort():t.dirty()},get path(){return s.path}};if(n.addIssue=n.addIssue.bind(n),r.type==="preprocess"){let o=r.transform(s.data,n);if(s.common.async)return Promise.resolve(o).then(async i=>{if(t.value==="aborted")return B;let u=await this._def.schema._parseAsync({data:i,path:s.path,parent:s});return u.status==="aborted"?B:u.status==="dirty"?qr(u.value):t.value==="dirty"?qr(u.value):u});{if(t.value==="aborted")return B;let i=this._def.schema._parseSync({data:o,path:s.path,parent:s});return i.status==="aborted"?B:i.status==="dirty"?qr(i.value):t.value==="dirty"?qr(i.value):i}}if(r.type==="refinement"){let o=i=>{let u=r.refinement(i,n);if(s.common.async)return Promise.resolve(u);if(u 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"?B:(i.status==="dirty"&&t.dirty(),o(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"?B:(i.status==="dirty"&&t.dirty(),o(i.value).then(()=>({status:t.value,value:i.value}))))}if(r.type==="transform")if(s.common.async===!1){let o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!Pr(o))return B;let i=r.transform(o.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(o=>Pr(o)?Promise.resolve(r.transform(o.value,n)).then(i=>({status:t.value,value:i})):B);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?$e(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 ir=class extends G{_parse(e){return this._getType(e)===j.null?$e(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ir.create=(a,e)=>new ir({innerType:a,typeName:T.ZodNullable,...Q(e)});var Xr=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}};Xr.create=(a,e)=>new Xr({innerType:a,typeName:T.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Q(e)});var et=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 gt(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}};et.create=(a,e)=>new et({innerType:a,typeName:T.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Q(e)});var Et=class extends G{_parse(e){if(this._getType(e)!==j.nan){let s=this._getOrReturnCtx(e);return D(s,{code:R.invalid_type,expected:j.nan,received:s.parsedType}),B}return{status:"valid",value:e.data}}};Et.create=a=>new Et({typeName:T.ZodNaN,...Q(a)});var dd=Symbol("zod_brand"),Ft=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}},Mt=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"?B:n.status==="dirty"?(t.dirty(),qr(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"?B: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})}},rt=class extends G{_parse(e){let t=this._def.innerType._parse(e),s=r=>(Pr(r)&&(r.value=Object.freeze(r.value)),r);return gt(t)?t.then(r=>s(r)):s(t)}unwrap(){return this._def.innerType}};rt.create=(a,e)=>new rt({innerType:a,typeName:T.ZodReadonly,...Q(e)});function Bn(a,e){let t=typeof a=="function"?a(e):typeof a=="string"?{message:a}:a;return typeof t=="string"?{message:t}:t}function Wn(a,e={},t){return a?Rr.create().superRefine((s,r)=>{var o,i;let n=a(s);if(n instanceof Promise)return n.then(u=>{var c,f;if(!u){let p=Bn(e,s),g=(f=(c=p.fatal)!=null?c:t)!=null?f:!0;r.addIssue({code:"custom",...p,fatal:g})}});if(!n){let u=Bn(e,s),c=(i=(o=u.fatal)!=null?o:t)!=null?i:!0;r.addIssue({code:"custom",...u,fatal:c})}}):Rr.create()}var fd={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 hd=(a,e={message:`Input not instance of ${a.name}`})=>Wn(t=>t instanceof a,e),Yn=Sr.create,Xn=Ur.create,pd=Et.create,md=zr.create,eo=Vr.create,vd=Hr.create,gd=_t.create,yd=Zr.create,_d=Br.create,bd=Rr.create,xd=gr.create,wd=Ye.create,Ed=bt.create,Pd=yr.create,Sd=Fe.create,Rd=Fe.strictCreate,Od=Jr.create,Td=ha.create,$d=Qr.create,Ad=or.create,Id=pa.create,Cd=xt.create,kd=wt.create,Dd=ma.create,jd=Kr.create,Nd=Gr.create,Ld=Wr.create,Fd=Yr.create,Md=Or.create,qd=Qe.create,Ud=Be.create,zd=ir.create,Vd=Qe.createWithPreprocess,Hd=Mt.create,Zd=()=>Yn().optional(),Bd=()=>Xn().optional(),Jd=()=>eo().optional(),Qd={string:(a=>Sr.create({...a,coerce:!0})),number:(a=>Ur.create({...a,coerce:!0})),boolean:(a=>Vr.create({...a,coerce:!0})),bigint:(a=>zr.create({...a,coerce:!0})),date:(a=>Hr.create({...a,coerce:!0}))};var Kd=B;var Tr="2025-06-18",ro="2025-03-26",tt=[Tr,"2025-03-26","2024-11-05","2024-10-07"],va="2.0",to=l.union([l.string(),l.number().int()]),ao=l.string(),Gd=l.object({progressToken:l.optional(to)}).passthrough(),Ke=l.object({_meta:l.optional(Gd)}).passthrough(),Me=l.object({method:l.string(),params:l.optional(Ke)}),qt=l.object({_meta:l.optional(l.object({}).passthrough())}).passthrough(),lr=l.object({method:l.string(),params:l.optional(qt)}),Ge=l.object({_meta:l.optional(l.object({}).passthrough())}).passthrough(),ga=l.union([l.string(),l.number().int()]),so=l.object({jsonrpc:l.literal(va),id:ga}).merge(Me).strict(),at=a=>so.safeParse(a).success,no=l.object({jsonrpc:l.literal(va)}).merge(lr).strict(),oo=a=>no.safeParse(a).success,io=l.object({jsonrpc:l.literal(va),id:ga,result:Ge}).strict(),_r=a=>io.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 lo=l.object({jsonrpc:l.literal(va),id:ga,error:l.object({code:l.number().int(),message:l.string(),data:l.optional(l.unknown())})}).strict(),Pt=a=>lo.safeParse(a).success,Xe=l.union([so,no,io,lo]),br=Ge.strict(),ya=lr.extend({method:l.literal("notifications/cancelled"),params:qt.extend({requestId:ga,reason:l.string().optional()})}),Ut=l.object({name:l.string(),title:l.optional(l.string())}).passthrough(),co=Ut.extend({version:l.string()}),Wd=l.object({experimental:l.optional(l.object({}).passthrough()),sampling:l.optional(l.object({}).passthrough()),elicitation:l.optional(l.object({}).passthrough()),roots:l.optional(l.object({listChanged:l.optional(l.boolean())}).passthrough())}).passthrough(),_a=Me.extend({method:l.literal("initialize"),params:Ke.extend({protocolVersion:l.string(),capabilities:Wd,clientInfo:co})}),uo=a=>_a.safeParse(a).success,Yd=l.object({experimental:l.optional(l.object({}).passthrough()),logging:l.optional(l.object({}).passthrough()),completions:l.optional(l.object({}).passthrough()),prompts:l.optional(l.object({listChanged:l.optional(l.boolean())}).passthrough()),resources:l.optional(l.object({subscribe:l.optional(l.boolean()),listChanged:l.optional(l.boolean())}).passthrough()),tools:l.optional(l.object({listChanged:l.optional(l.boolean())}).passthrough())}).passthrough(),ps=Ge.extend({protocolVersion:l.string(),capabilities:Yd,serverInfo:co,instructions:l.optional(l.string())}),ba=lr.extend({method:l.literal("notifications/initialized")}),fo=a=>ba.safeParse(a).success,St=Me.extend({method:l.literal("ping")}),Xd=l.object({progress:l.number(),total:l.optional(l.number()),message:l.optional(l.string())}).passthrough(),xa=lr.extend({method:l.literal("notifications/progress"),params:qt.merge(Xd).extend({progressToken:to})}),wa=Me.extend({params:Ke.extend({cursor:l.optional(ao)}).optional()}),Ea=Ge.extend({nextCursor:l.optional(ao)}),ho=l.object({uri:l.string(),mimeType:l.optional(l.string()),_meta:l.optional(l.object({}).passthrough())}).passthrough(),po=ho.extend({text:l.string()}),ms=l.string().refine(a=>{try{return atob(a),!0}catch{return!1}},{message:"Invalid Base64 string"}),mo=ho.extend({blob:ms}),vo=Ut.extend({uri:l.string(),description:l.optional(l.string()),mimeType:l.optional(l.string()),_meta:l.optional(l.object({}).passthrough())}),ef=Ut.extend({uriTemplate:l.string(),description:l.optional(l.string()),mimeType:l.optional(l.string()),_meta:l.optional(l.object({}).passthrough())}),rf=wa.extend({method:l.literal("resources/list")}),vs=Ea.extend({resources:l.array(vo)}),tf=wa.extend({method:l.literal("resources/templates/list")}),gs=Ea.extend({resourceTemplates:l.array(ef)}),af=Me.extend({method:l.literal("resources/read"),params:Ke.extend({uri:l.string()})}),ys=Ge.extend({contents:l.array(l.union([po,mo]))}),sf=lr.extend({method:l.literal("notifications/resources/list_changed")}),nf=Me.extend({method:l.literal("resources/subscribe"),params:Ke.extend({uri:l.string()})}),of=Me.extend({method:l.literal("resources/unsubscribe"),params:Ke.extend({uri:l.string()})}),lf=lr.extend({method:l.literal("notifications/resources/updated"),params:qt.extend({uri:l.string()})}),cf=l.object({name:l.string(),description:l.optional(l.string()),required:l.optional(l.boolean())}).passthrough(),uf=Ut.extend({description:l.optional(l.string()),arguments:l.optional(l.array(cf)),_meta:l.optional(l.object({}).passthrough())}),df=wa.extend({method:l.literal("prompts/list")}),_s=Ea.extend({prompts:l.array(uf)}),ff=Me.extend({method:l.literal("prompts/get"),params:Ke.extend({name:l.string(),arguments:l.optional(l.record(l.string()))})}),bs=l.object({type:l.literal("text"),text:l.string(),_meta:l.optional(l.object({}).passthrough())}).passthrough(),xs=l.object({type:l.literal("image"),data:ms,mimeType:l.string(),_meta:l.optional(l.object({}).passthrough())}).passthrough(),ws=l.object({type:l.literal("audio"),data:ms,mimeType:l.string(),_meta:l.optional(l.object({}).passthrough())}).passthrough(),hf=l.object({type:l.literal("resource"),resource:l.union([po,mo]),_meta:l.optional(l.object({}).passthrough())}).passthrough(),pf=vo.extend({type:l.literal("resource_link")}),go=l.union([bs,xs,ws,pf,hf]),mf=l.object({role:l.enum(["user","assistant"]),content:go}).passthrough(),Es=Ge.extend({description:l.optional(l.string()),messages:l.array(mf)}),vf=lr.extend({method:l.literal("notifications/prompts/list_changed")}),gf=l.object({title:l.optional(l.string()),readOnlyHint:l.optional(l.boolean()),destructiveHint:l.optional(l.boolean()),idempotentHint:l.optional(l.boolean()),openWorldHint:l.optional(l.boolean())}).passthrough(),yf=Ut.extend({description:l.optional(l.string()),inputSchema:l.object({type:l.literal("object"),properties:l.optional(l.object({}).passthrough()),required:l.optional(l.array(l.string()))}).passthrough(),outputSchema:l.optional(l.object({type:l.literal("object"),properties:l.optional(l.object({}).passthrough()),required:l.optional(l.array(l.string()))}).passthrough()),annotations:l.optional(gf),_meta:l.optional(l.object({}).passthrough())}),Ps=wa.extend({method:l.literal("tools/list")}),Ss=Ea.extend({tools:l.array(yf)}),Pa=Ge.extend({content:l.array(go).default([]),structuredContent:l.object({}).passthrough().optional(),isError:l.optional(l.boolean())}),_v=Pa.or(Ge.extend({toolResult:l.unknown()})),Rs=Me.extend({method:l.literal("tools/call"),params:Ke.extend({name:l.string(),arguments:l.optional(l.record(l.unknown()))})}),_f=lr.extend({method:l.literal("notifications/tools/list_changed")}),zt=l.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),Os=Me.extend({method:l.literal("logging/setLevel"),params:Ke.extend({level:zt})}),bf=lr.extend({method:l.literal("notifications/message"),params:qt.extend({level:zt,logger:l.optional(l.string()),data:l.unknown()})}),xf=l.object({name:l.string().optional()}).passthrough(),wf=l.object({hints:l.optional(l.array(xf)),costPriority:l.optional(l.number().min(0).max(1)),speedPriority:l.optional(l.number().min(0).max(1)),intelligencePriority:l.optional(l.number().min(0).max(1))}).passthrough(),Ef=l.object({role:l.enum(["user","assistant"]),content:l.union([bs,xs,ws])}).passthrough(),Pf=Me.extend({method:l.literal("sampling/createMessage"),params:Ke.extend({messages:l.array(Ef),systemPrompt:l.optional(l.string()),includeContext:l.optional(l.enum(["none","thisServer","allServers"])),temperature:l.optional(l.number()),maxTokens:l.number().int(),stopSequences:l.optional(l.array(l.string())),metadata:l.optional(l.object({}).passthrough()),modelPreferences:l.optional(wf)})}),Ts=Ge.extend({model:l.string(),stopReason:l.optional(l.enum(["endTurn","stopSequence","maxTokens"]).or(l.string())),role:l.enum(["user","assistant"]),content:l.discriminatedUnion("type",[bs,xs,ws])}),Sf=l.object({type:l.literal("boolean"),title:l.optional(l.string()),description:l.optional(l.string()),default:l.optional(l.boolean())}).passthrough(),Rf=l.object({type:l.literal("string"),title:l.optional(l.string()),description:l.optional(l.string()),minLength:l.optional(l.number()),maxLength:l.optional(l.number()),format:l.optional(l.enum(["email","uri","date","date-time"]))}).passthrough(),Of=l.object({type:l.enum(["number","integer"]),title:l.optional(l.string()),description:l.optional(l.string()),minimum:l.optional(l.number()),maximum:l.optional(l.number())}).passthrough(),Tf=l.object({type:l.literal("string"),title:l.optional(l.string()),description:l.optional(l.string()),enum:l.array(l.string()),enumNames:l.optional(l.array(l.string()))}).passthrough(),$f=l.union([Sf,Rf,Of,Tf]),Af=Me.extend({method:l.literal("elicitation/create"),params:Ke.extend({message:l.string(),requestedSchema:l.object({type:l.literal("object"),properties:l.record(l.string(),$f),required:l.optional(l.array(l.string()))}).passthrough()})}),$s=Ge.extend({action:l.enum(["accept","decline","cancel"]),content:l.optional(l.record(l.string(),l.unknown()))}),If=l.object({type:l.literal("ref/resource"),uri:l.string()}).passthrough();var Cf=l.object({type:l.literal("ref/prompt"),name:l.string()}).passthrough(),kf=Me.extend({method:l.literal("completion/complete"),params:Ke.extend({ref:l.union([Cf,If]),argument:l.object({name:l.string(),value:l.string()}).passthrough(),context:l.optional(l.object({arguments:l.optional(l.record(l.string(),l.string()))}))})}),As=Ge.extend({completion:l.object({values:l.array(l.string()).max(100),total:l.optional(l.number().int()),hasMore:l.optional(l.boolean())}).passthrough()}),Df=l.object({uri:l.string().startsWith("file://"),name:l.optional(l.string()),_meta:l.optional(l.object({}).passthrough())}).passthrough(),Is=Me.extend({method:l.literal("roots/list")}),Cs=Ge.extend({roots:l.array(Df)}),jf=lr.extend({method:l.literal("notifications/roots/list_changed")}),bv=l.union([St,_a,kf,Os,ff,df,rf,tf,af,nf,of,Rs,Ps]),xv=l.union([ya,xa,ba,jf]),wv=l.union([br,Ts,$s,Cs]),Ev=l.union([St,Pf,Af,Is]),Pv=l.union([ya,xa,bf,lf,sf,_f,vf]),Sv=l.union([br,ps,As,Es,_s,vs,gs,ys,Pa,Ss]),Ae=class extends Error{constructor(e,t,s){super(`MCP error ${e}: ${t}`),this.code=e,this.data=s,this.name="McpError"}};var Nf=6e4,Rt=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(ya,t=>{let s=this._requestHandlerAbortControllers.get(t.params.requestId);s==null||s.abort(t.params.reason)}),this.setNotificationHandler(xa,t=>{this._onprogress(t)}),this.setRequestHandler(St,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 Ae(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==null||n(),this._onclose()};let o=(s=this.transport)===null||s===void 0?void 0:s.onerror;this._transport.onerror=u=>{o==null||o(u),this._onerror(u)};let i=(r=this._transport)===null||r===void 0?void 0:r.onmessage;this._transport.onmessage=(u,c)=>{i==null||i(u,c),_r(u)||Pt(u)?this._onresponse(u):at(u)?this._onrequest(u,c):oo(u)?this._onnotification(u):this._onerror(new Error(`Unknown message type: ${JSON.stringify(u)}`))},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 Ae(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,o=this._transport;if(n===void 0){o==null||o.send({jsonrpc:"2.0",id:e.id,error:{code:De.MethodNotFound,message:"Method not found"}}).catch(c=>this._onerror(new Error(`Failed to send an error response: ${c}`)));return}let i=new AbortController;this._requestHandlerAbortControllers.set(e.id,i);let u={signal:i.signal,sessionId:o==null?void 0:o.sessionId,_meta:(r=e.params)===null||r===void 0?void 0:r._meta,sendNotification:c=>this.notification(c,{relatedRequestId:e.id}),sendRequest:(c,f,p)=>this.request(c,f,{...p,relatedRequestId:e.id}),authInfo:t==null?void 0:t.authInfo,requestId:e.id,requestInfo:t==null?void 0:t.requestInfo};Promise.resolve().then(()=>n(e,u)).then(c=>{if(!i.signal.aborted)return o==null?void 0:o.send({result:c,jsonrpc:"2.0",id:e.id})},c=>{var f;if(!i.signal.aborted)return o==null?void 0:o.send({jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(c.code)?c.code:De.InternalError,message:(f=c.message)!==null&&f!==void 0?f:"Internal error"}})}).catch(c=>this._onerror(new Error(`Failed to send response: ${c}`))).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 o=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&o&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){o(u);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),_r(e))s(e);else{let r=new Ae(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:o}=s!=null?s:{};return new Promise((i,u)=>{var c,f,p,g,d,y;if(!this._transport){u(new Error("Not connected"));return}((c=this._options)===null||c===void 0?void 0:c.enforceStrictCapabilities)===!0&&this.assertCapabilityForMethod(e.method),(f=s==null?void 0:s.signal)===null||f===void 0||f.throwIfAborted();let m=this._requestMessageId++,v={...e,jsonrpc:"2.0",id:m};s!=null&&s.onprogress&&(this._progressHandlers.set(m,s.onprogress),v.params={...e.params,_meta:{...((p=e.params)===null||p===void 0?void 0:p._meta)||{},progressToken:m}});let x=O=>{var A;this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),(A=this._transport)===null||A===void 0||A.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(O)}},{relatedRequestId:r,resumptionToken:n,onresumptiontoken:o}).catch(I=>this._onerror(new Error(`Failed to send cancellation: ${I}`))),u(O)};this._responseHandlers.set(m,O=>{var A;if(!(!((A=s==null?void 0:s.signal)===null||A===void 0)&&A.aborted)){if(O instanceof Error)return u(O);try{let I=t.parse(O.result);i(I)}catch(I){u(I)}}}),(g=s==null?void 0:s.signal)===null||g===void 0||g.addEventListener("abort",()=>{var O;x((O=s==null?void 0:s.signal)===null||O===void 0?void 0:O.reason)});let S=(d=s==null?void 0:s.timeout)!==null&&d!==void 0?d:Nf,P=()=>x(new Ae(De.RequestTimeout,"Request timed out",{timeout:S}));this._setupTimeout(m,S,s==null?void 0:s.maxTotalTimeout,P,(y=s==null?void 0:s.resetTimeoutOnProgress)!==null&&y!==void 0?y:!1),this._transport.send(v,{relatedRequestId:r,resumptionToken:n,onresumptiontoken:o}).catch(O=>{this._cleanupTimeout(m),u(O)})})}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!=null&&t.relatedRequestId)){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{var u;if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let c={...e,jsonrpc:"2.0"};(u=this._transport)===null||u===void 0||u.send(c,t).catch(f=>this._onerror(f))});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 Sa(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 yl=pr(an(),1),Ha=class extends Rt{constructor(e,t){var s;super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._capabilities=(s=t==null?void 0:t.capabilities)!==null&&s!==void 0?s:{},this._ajv=new yl.default}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Sa(this._capabilities,e)}assertCapability(e,t){var s;if(!(!((s=this._serverCapabilities)===null||s===void 0)&&s[e]))throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{let s=await this.request({method:"initialize",params:{protocolVersion:Tr,capabilities:this._capabilities,clientInfo:this._clientInfo}},ps,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!tt.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"})}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){var t,s,r,n,o;switch(e){case"logging/setLevel":if(!(!((t=this._serverCapabilities)===null||t===void 0)&&t.logging))throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!(!((s=this._serverCapabilities)===null||s===void 0)&&s.prompts))throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!(!((r=this._serverCapabilities)===null||r===void 0)&&r.resources))throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!(!((n=this._serverCapabilities)===null||n===void 0)&&n.tools))throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!(!((o=this._serverCapabilities)===null||o===void 0)&&o.completions))throw new Error(`Server does not support completions (required for ${e})`);break;case"initialize":break;case"ping":break}}assertNotificationCapability(e){var t;switch(e){case"notifications/roots/list_changed":if(!(!((t=this._capabilities.roots)===null||t===void 0)&&t.listChanged))throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break;case"notifications/initialized":break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"ping":break}}async ping(e){return this.request({method:"ping"},br,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},As,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},br,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},Es,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},_s,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},vs,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},gs,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},ys,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},br,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},br,t)}async callTool(e,t=Pa,s){let r=await this.request({method:"tools/call",params:e},t,s),n=this.getToolOutputValidator(e.name);if(n){if(!r.structuredContent&&!r.isError)throw new Ae(De.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{if(!n(r.structuredContent))throw new Ae(De.InvalidParams,`Structured content does not match the tool's output schema: ${this._ajv.errorsText(n.errors)}`)}catch(o){throw o instanceof Ae?o:new Ae(De.InvalidParams,`Failed to validate structured content: ${o instanceof Error?o.message:String(o)}`)}}return r}cacheToolOutputSchemas(e){this._cachedToolOutputValidators.clear();for(let t of e)if(t.outputSchema)try{let s=this._ajv.compile(t.outputSchema);this._cachedToolOutputValidators.set(t.name,s)}catch{}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){let s=await this.request({method:"tools/list",params:e},Ss,t);return this.cacheToolOutputSchemas(s.tools),s}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};var _l=pr(an(),1),Za=class extends Rt{constructor(e,t){var s;super(t),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(zt.options.map((r,n)=>[r,n])),this.isMessageIgnored=(r,n)=>{let o=this._loggingLevels.get(n);return o?this.LOG_LEVEL_SEVERITY.get(r)<this.LOG_LEVEL_SEVERITY.get(o):!1},this._capabilities=(s=t==null?void 0:t.capabilities)!==null&&s!==void 0?s:{},this._instructions=t==null?void 0:t.instructions,this.setRequestHandler(_a,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(Os,async(r,n)=>{var o;let i=n.sessionId||((o=n.requestInfo)===null||o===void 0?void 0:o.headers["mcp-session-id"])||void 0,{level:u}=r.params,c=zt.safeParse(u);return i&&c.success&&this._loggingLevels.set(i,c.data),{}})}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Sa(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:tt.includes(t)?t:Tr,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"},br)}async createMessage(e,t){return this.request({method:"sampling/createMessage",params:e},Ts,t)}async elicitInput(e,t){let s=await this.request({method:"elicitation/create",params:e},$s,t);if(s.action==="accept"&&s.content)try{let r=new _l.default,n=r.compile(e.requestedSchema);if(!n(s.content))throw new Ae(De.InvalidParams,`Elicitation response content does not match requested schema: ${r.errorsText(n.errors)}`)}catch(r){throw r instanceof Ae?r:new Ae(De.InternalError,`Error validating elicitation response: ${r}`)}return s}async listRoots(e,t){return this.request({method:"roots/list",params:e},Cs,t)}async sendLoggingMessage(e,t){if(this._capabilities.logging&&(!t||!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 Ol=require("node:crypto");var El=pr(wl());function Ht(a,{limit:e,encoding:t}){let s=El.default.parse(e);return new Promise((r,n)=>{let o=0,i=[];a.on("data",u=>{if(o+=u.length,o>s)return n(new Error(`Message size exceeds limit of ${e} bytes`));i.push(u)}),a.on("end",()=>{try{r(Buffer.concat(i).toString(t))}catch(u){n(u)}}),a.on("error",u=>{n(u)})})}var Tl=pr(nn(),1),$l=require("url"),Op="4mb",Ja=class{constructor(e,t,s){this._endpoint=e,this.res=t,this._sessionId=(0,Ol.randomUUID)(),this._options=s||{enableDnsRebindingProtection:!1}}validateRequestHeaders(e){if(this._options.enableDnsRebindingProtection){if(this._options.allowedHosts&&this._options.allowedHosts.length>0){let t=e.headers.host;if(!t||!this._options.allowedHosts.includes(t))return`Invalid Host header: ${t}`}if(this._options.allowedOrigins&&this._options.allowedOrigins.length>0){let t=e.headers.origin;if(!t||!this._options.allowedOrigins.includes(t))return`Invalid Origin header: ${t}`}}}async start(){if(this._sseResponse)throw new Error("SSEServerTransport already started! If using Server class, note that connect() calls start() automatically.");this.res.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive"});let e="http://localhost",t=new $l.URL(this._endpoint,e);t.searchParams.set("sessionId",this._sessionId);let s=t.pathname+t.search+t.hash;this.res.write(`event: endpoint
|
|
2
2
|
data: ${s}
|
|
3
3
|
|
|
4
4
|
`),this._sseResponse=this.res,this.res.on("close",()=>{var r;this._sseResponse=void 0,(r=this.onclose)===null||r===void 0||r.call(this)})}async handlePostMessage(e,t,s){var r,n,o,i;if(!this._sseResponse){let g="SSE connection not established";throw t.writeHead(500).end(g),new Error(g)}let u=this.validateRequestHeaders(e);if(u){t.writeHead(403).end(u),(r=this.onerror)===null||r===void 0||r.call(this,new Error(u));return}let c=e.auth,f={headers:e.headers},p;try{let g=Tl.default.parse((n=e.headers["content-type"])!==null&&n!==void 0?n:"");if(g.type!=="application/json")throw new Error(`Unsupported content-type: ${g.type}`);p=s!=null?s:await Ht(e,{limit:Op,encoding:(o=g.parameters.charset)!==null&&o!==void 0?o:"utf-8"})}catch(g){t.writeHead(400).end(String(g)),(i=this.onerror)===null||i===void 0||i.call(this,g);return}try{await this.handleMessage(typeof p=="string"?JSON.parse(p):p,{requestInfo:f,authInfo:c})}catch{t.writeHead(400).end(`Invalid message: ${p}`);return}t.writeHead(202).end("Accepted")}async handleMessage(e,t){var s,r;let n;try{n=Xe.parse(e)}catch(o){throw(s=this.onerror)===null||s===void 0||s.call(this,o),o}(r=this.onmessage)===null||r===void 0||r.call(this,n,t)}async close(){var e,t;(e=this._sseResponse)===null||e===void 0||e.end(),this._sseResponse=void 0,(t=this.onclose)===null||t===void 0||t.call(this)}async send(e){if(!this._sseResponse)throw new Error("Not connected");this._sseResponse.write(`event: message
|