@mcp-b/global 1.0.6 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.umd.js +11 -0
- package/dist/index.umd.js.map +1 -0
- package/package.json +1 -1
- package/dist/index.umd +0 -11
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var mcpBrowser=(function(exports){'use strict';// @mcp-b/global - MIT License
|
|
2
|
+
var dl=Object.create;var It=Object.defineProperty;var fl=Object.getOwnPropertyDescriptor;var hl=Object.getOwnPropertyNames;var pl=Object.getPrototypeOf,ml=Object.prototype.hasOwnProperty;var vl=(a,e,t)=>e in a?It(a,e,{enumerable:true,configurable:true,writable:true,value:t}):a[e]=t;var Q=(a,e)=>()=>(e||a((e={exports:{}}).exports,e),e.exports),gl=(a,e)=>{for(var t in e)It(a,t,{get:e[t],enumerable:true});},yl=(a,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of hl(e))!ml.call(a,r)&&r!==t&&It(a,r,{get:()=>e[r],enumerable:!(s=fl(e,r))||s.enumerable});return a};var _l=(a,e,t)=>(t=a!=null?dl(pl(a)):{},yl(It(t,"default",{value:a,enumerable:true}),a));var dr=(a,e,t)=>vl(a,typeof e!="symbol"?e+"":e,t);var cn=Q((Xt,ln)=>{(function(a,e){typeof Xt=="object"&&typeof ln!="undefined"?e(Xt):typeof define=="function"&&define.amd?define(["exports"],e):e(a.URI=a.URI||{});})(Xt,function(a){function e(){for(var m=arguments.length,f=Array(m),v=0;v<m;v++)f[v]=arguments[v];if(f.length>1){f[0]=f[0].slice(0,-1);for(var E=f.length-1,P=1;P<E;++P)f[P]=f[P].slice(1,-1);return f[E]=f[E].slice(1),f.join("")}else return f[0]}function t(m){return "(?:"+m+")"}function s(m){return m===void 0?"undefined":m===null?"null":Object.prototype.toString.call(m).split(" ").pop().split("]").shift().toLowerCase()}function r(m){return m.toUpperCase()}function n(m){return m!=null?m instanceof Array?m:typeof m.length!="number"||m.split||m.setInterval||m.call?[m]:Array.prototype.slice.call(m):[]}function o(m,f){var v=m;if(f)for(var E in f)v[E]=f[E];return v}function i(m){var f="[A-Za-z]",E="[0-9]",j=e(E,"[A-Fa-f]"),oe=t(t("%[EFef]"+j+"%"+j+j+"%"+j+j)+"|"+t("%[89A-Fa-f]"+j+"%"+j+j)+"|"+t("%"+j+j)),Ee="[\\:\\/\\?\\#\\[\\]\\@]",te="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",pe=e(Ee,te),Pe=m?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",he=m?"[\\uE000-\\uF8FF]":"[]",ne=e(f,E,"[\\-\\.\\_\\~]",Pe);t(f+e(f,E,"[\\+\\-\\.]")+"*");t(t(oe+"|"+e(ne,te,"[\\:]"))+"*");var Me=t(t("25[0-5]")+"|"+t("2[0-4]"+E)+"|"+t("1"+E+E)+"|"+t("0?[1-9]"+E)+"|0?0?"+E),He=t(Me+"\\."+Me+"\\."+Me+"\\."+Me),ue=t(j+"{1,4}"),qe=t(t(ue+"\\:"+ue)+"|"+He),Ve=t(t(ue+"\\:")+"{6}"+qe),rr=t("\\:\\:"+t(ue+"\\:")+"{5}"+qe),Ir=t(t(ue)+"?\\:\\:"+t(ue+"\\:")+"{4}"+qe),lr=t(t(t(ue+"\\:")+"{0,1}"+ue)+"?\\:\\:"+t(ue+"\\:")+"{3}"+qe),ht=t(t(t(ue+"\\:")+"{0,2}"+ue)+"?\\:\\:"+t(ue+"\\:")+"{2}"+qe),Rt=t(t(t(ue+"\\:")+"{0,3}"+ue)+"?\\:\\:"+ue+"\\:"+qe),Tt=t(t(t(ue+"\\:")+"{0,4}"+ue)+"?\\:\\:"+qe),Jr=t(t(t(ue+"\\:")+"{0,5}"+ue)+"?\\:\\:"+ue),Wr=t(t(t(ue+"\\:")+"{0,6}"+ue)+"?\\:\\:"),cr=t([Ve,rr,Ir,lr,ht,Rt,Tt,Jr,Wr].join("|")),Xr=t(t(ne+"|"+oe)+"+");t("[vV]"+j+"+\\."+e(ne,te,"[\\:]")+"+");t(t(oe+"|"+e(ne,te))+"*");var vt=t(oe+"|"+e(ne,te,"[\\:\\@]"));t(t(oe+"|"+e(ne,te,"[\\@]"))+"+");t(t(vt+"|"+e("[\\/\\?]",he))+"*");return {NOT_SCHEME:new RegExp(e("[^]",f,E,"[\\+\\-\\.]"),"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,"[\\:\\@\\/\\?]",he),"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,pe),"g"),PCT_ENCODED:new RegExp(oe,"g"),IPV4ADDRESS:new RegExp("^("+He+")$"),IPV6ADDRESS:new RegExp("^\\[?("+cr+")"+t(t("\\%25|\\%(?!"+j+"{2})")+"("+Xr+")")+"?\\]?$")}}var c=i(false),u=i(true),h=function(){function m(f,v){var E=[],P=true,j=false,J=void 0;try{for(var ae=f[Symbol.iterator](),oe;!(P=(oe=ae.next()).done)&&(E.push(oe.value),!(v&&E.length===v));P=!0);}catch(Ee){j=true,J=Ee;}finally{try{!P&&ae.return&&ae.return();}finally{if(j)throw J}}return E}return function(f,v){if(Array.isArray(f))return f;if(Symbol.iterator in Object(f))return m(f,v);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(m){if(Array.isArray(m)){for(var f=0,v=Array(m.length);f<m.length;f++)v[f]=m[f];return v}else return Array.from(m)},y=2147483647,d=36,_=1,b=26,g=38,x=700,I=72,S=128,R="-",$=/^xn--/,A=/[^\0-\x7E]/,V=/[\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-_,z=Math.floor,M=String.fromCharCode;function L(m){throw new RangeError(q[m])}function O(m,f){for(var v=[],E=m.length;E--;)v[E]=f(m[E]);return v}function k(m,f){var v=m.split("@"),E="";v.length>1&&(E=v[0]+"@",m=v[1]),m=m.replace(V,".");var P=m.split("."),j=O(P,f).join(".");return E+j}function F(m){for(var f=[],v=0,E=m.length;v<E;){var P=m.charCodeAt(v++);if(P>=55296&&P<=56319&&v<E){var j=m.charCodeAt(v++);(j&64512)==56320?f.push(((P&1023)<<10)+(j&1023)+65536):(f.push(P),v--);}else f.push(P);}return f}var le=function(f){return String.fromCodePoint.apply(String,p(f))},X=function(f){return f-48<10?f-22:f-65<26?f-65:f-97<26?f-97:d},re=function(f,v){return f+22+75*(f<26)-((v!=0)<<5)},W=function(f,v,E){var P=0;for(f=E?z(f/x):f>>1,f+=z(f/v);f>C*b>>1;P+=d)f=z(f/C);return z(P+(C+1)*f/(f+g))},U=function(f){var v=[],E=f.length,P=0,j=S,J=I,ae=f.lastIndexOf(R);ae<0&&(ae=0);for(var oe=0;oe<ae;++oe)f.charCodeAt(oe)>=128&&L("not-basic"),v.push(f.charCodeAt(oe));for(var Ee=ae>0?ae+1:0;Ee<E;){for(var te=P,pe=1,Pe=d;;Pe+=d){Ee>=E&&L("invalid-input");var he=X(f.charCodeAt(Ee++));(he>=d||he>z((y-P)/pe))&&L("overflow"),P+=he*pe;var ne=Pe<=J?_:Pe>=J+b?b:Pe-J;if(he<ne)break;var me=d-ne;pe>z(y/me)&&L("overflow"),pe*=me;}var ce=v.length+1;J=W(P-te,ce,te==0),z(P/ce)>y-j&&L("overflow"),j+=z(P/ce),P%=ce,v.splice(P++,0,j);}return String.fromCodePoint.apply(String,v)},ve=function(f){var v=[];f=F(f);var E=f.length,P=S,j=0,J=I,ae=true,oe=false,Ee=void 0;try{for(var te=f[Symbol.iterator](),pe;!(ae=(pe=te.next()).done);ae=!0){var Pe=pe.value;Pe<128&&v.push(M(Pe));}}catch($r){oe=true,Ee=$r;}finally{try{!ae&&te.return&&te.return();}finally{if(oe)throw Ee}}var he=v.length,ne=he;for(he&&v.push(R);ne<E;){var me=y,ce=true,Or=false,Me=void 0;try{for(var He=f[Symbol.iterator](),ue;!(ce=(ue=He.next()).done);ce=!0){var qe=ue.value;qe>=P&&qe<me&&(me=qe);}}catch($r){Or=true,Me=$r;}finally{try{!ce&&He.return&&He.return();}finally{if(Or)throw Me}}var Ve=ne+1;me-P>z((y-j)/Ve)&&L("overflow"),j+=(me-P)*Ve,P=me;var rr=true,Ir=false,lr=void 0;try{for(var ht=f[Symbol.iterator](),Rt;!(rr=(Rt=ht.next()).done);rr=!0){var Tt=Rt.value;if(Tt<P&&++j>y&&L("overflow"),Tt==P){for(var Jr=j,Wr=d;;Wr+=d){var cr=Wr<=J?_:Wr>=J+b?b:Wr-J;if(Jr<cr)break;var Xr=Jr-cr,Ra=d-cr;v.push(M(re(cr+Xr%Ra,0))),Jr=z(Xr/Ra);}v.push(M(re(Jr,0))),J=W(j,Ve,ne==he),j=0,++ne;}}}catch($r){Ir=true,lr=$r;}finally{try{!rr&&ht.return&&ht.return();}finally{if(Ir)throw lr}}++j,++P;}return v.join("")},Re=function(f){return k(f,function(v){return $.test(v)?U(v.slice(4).toLowerCase()):v})},Ie=function(f){return k(f,function(v){return A.test(v)?"xn--"+ve(v):v})},se={version:"2.1.0",ucs2:{decode:F,encode:le},decode:U,encode:ve,toASCII:Ie,toUnicode:Re},_e={};function xe(m){var f=m.charCodeAt(0),v=void 0;return f<16?v="%0"+f.toString(16).toUpperCase():f<128?v="%"+f.toString(16).toUpperCase():f<2048?v="%"+(f>>6|192).toString(16).toUpperCase()+"%"+(f&63|128).toString(16).toUpperCase():v="%"+(f>>12|224).toString(16).toUpperCase()+"%"+(f>>6&63|128).toString(16).toUpperCase()+"%"+(f&63|128).toString(16).toUpperCase(),v}function $e(m){for(var f="",v=0,E=m.length;v<E;){var P=parseInt(m.substr(v+1,2),16);if(P<128)f+=String.fromCharCode(P),v+=3;else if(P>=194&&P<224){if(E-v>=6){var j=parseInt(m.substr(v+4,2),16);f+=String.fromCharCode((P&31)<<6|j&63);}else f+=m.substr(v,6);v+=6;}else if(P>=224){if(E-v>=9){var J=parseInt(m.substr(v+4,2),16),ae=parseInt(m.substr(v+7,2),16);f+=String.fromCharCode((P&15)<<12|(J&63)<<6|ae&63);}else f+=m.substr(v,9);v+=9;}else f+=m.substr(v,3),v+=3;}return f}function vr(m,f){function v(E){var P=$e(E);return P.match(f.UNRESERVED)?P:E}return m.scheme&&(m.scheme=String(m.scheme).replace(f.PCT_ENCODED,v).toLowerCase().replace(f.NOT_SCHEME,"")),m.userinfo!==void 0&&(m.userinfo=String(m.userinfo).replace(f.PCT_ENCODED,v).replace(f.NOT_USERINFO,xe).replace(f.PCT_ENCODED,r)),m.host!==void 0&&(m.host=String(m.host).replace(f.PCT_ENCODED,v).toLowerCase().replace(f.NOT_HOST,xe).replace(f.PCT_ENCODED,r)),m.path!==void 0&&(m.path=String(m.path).replace(f.PCT_ENCODED,v).replace(m.scheme?f.NOT_PATH:f.NOT_PATH_NOSCHEME,xe).replace(f.PCT_ENCODED,r)),m.query!==void 0&&(m.query=String(m.query).replace(f.PCT_ENCODED,v).replace(f.NOT_QUERY,xe).replace(f.PCT_ENCODED,r)),m.fragment!==void 0&&(m.fragment=String(m.fragment).replace(f.PCT_ENCODED,v).replace(f.NOT_FRAGMENT,xe).replace(f.PCT_ENCODED,r)),m}function ir(m){return m.replace(/^0*(.*)/,"$1")||"0"}function be(m,f){var v=m.match(f.IPV4ADDRESS)||[],E=h(v,2),P=E[1];return P?P.split(".").map(ir).join("."):m}function ge(m,f){var v=m.match(f.IPV6ADDRESS)||[],E=h(v,3),P=E[1],j=E[2];if(P){for(var J=P.toLowerCase().split("::").reverse(),ae=h(J,2),oe=ae[0],Ee=ae[1],te=Ee?Ee.split(":").map(ir):[],pe=oe.split(":").map(ir),Pe=f.IPV4ADDRESS.test(pe[pe.length-1]),he=Pe?7:8,ne=pe.length-he,me=Array(he),ce=0;ce<he;++ce)me[ce]=te[ce]||pe[ne+ce]||"";Pe&&(me[he-1]=be(me[he-1],f));var Or=me.reduce(function(Ve,rr,Ir){if(!rr||rr==="0"){var lr=Ve[Ve.length-1];lr&&lr.index+lr.length===Ir?lr.length++:Ve.push({index:Ir,length:1});}return Ve},[]),Me=Or.sort(function(Ve,rr){return rr.length-Ve.length})[0],He=void 0;if(Me&&Me.length>1){var ue=me.slice(0,Me.index),qe=me.slice(Me.index+Me.length);He=ue.join(":")+"::"+qe.join(":");}else He=me.join(":");return j&&(He+="%"+j),He}else return m}var wr=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,Te="".match(/(){0}/)[1]===void 0;function ie(m){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},v={},E=f.iri!==false?u:c;f.reference==="suffix"&&(m=(f.scheme?f.scheme+":":"")+"//"+m);var P=m.match(wr);if(P){Te?(v.scheme=P[1],v.userinfo=P[3],v.host=P[4],v.port=parseInt(P[5],10),v.path=P[6]||"",v.query=P[7],v.fragment=P[8],isNaN(v.port)&&(v.port=P[5])):(v.scheme=P[1]||void 0,v.userinfo=m.indexOf("@")!==-1?P[3]:void 0,v.host=m.indexOf("//")!==-1?P[4]:void 0,v.port=parseInt(P[5],10),v.path=P[6]||"",v.query=m.indexOf("?")!==-1?P[7]:void 0,v.fragment=m.indexOf("#")!==-1?P[8]:void 0,isNaN(v.port)&&(v.port=m.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?P[4]:void 0)),v.host&&(v.host=ge(be(v.host,E),E)),v.scheme===void 0&&v.userinfo===void 0&&v.host===void 0&&v.port===void 0&&!v.path&&v.query===void 0?v.reference="same-document":v.scheme===void 0?v.reference="relative":v.fragment===void 0?v.reference="absolute":v.reference="uri",f.reference&&f.reference!=="suffix"&&f.reference!==v.reference&&(v.error=v.error||"URI is not a "+f.reference+" reference.");var j=_e[(f.scheme||v.scheme||"").toLowerCase()];if(!f.unicodeSupport&&(!j||!j.unicodeSupport)){if(v.host&&(f.domainHost||j&&j.domainHost))try{v.host=se.toASCII(v.host.replace(E.PCT_ENCODED,$e).toLowerCase());}catch(J){v.error=v.error||"Host's domain name can not be converted to ASCII via punycode: "+J;}vr(v,c);}else vr(v,E);j&&j.parse&&j.parse(v,f);}else v.error=v.error||"URI can not be parsed.";return v}function gr(m,f){var v=f.iri!==false?u:c,E=[];return m.userinfo!==void 0&&(E.push(m.userinfo),E.push("@")),m.host!==void 0&&E.push(ge(be(String(m.host),v),v).replace(v.IPV6ADDRESS,function(P,j,J){return "["+j+(J?"%25"+J:"")+"]"})),(typeof m.port=="number"||typeof m.port=="string")&&(E.push(":"),E.push(String(m.port))),E.length?E.join(""):void 0}var or=/^\.\.?\//,Rr=/^\/\.(\/|$)/,Tr=/^\/\.\.(\/|$)/,Se=/^\/?(?:.|\n)*?(?=\/|$)/;function ze(m){for(var f=[];m.length;)if(m.match(or))m=m.replace(or,"");else if(m.match(Rr))m=m.replace(Rr,"/");else if(m.match(Tr))m=m.replace(Tr,"/"),f.pop();else if(m==="."||m==="..")m="";else {var v=m.match(Se);if(v){var E=v[0];m=m.slice(E.length),f.push(E);}else throw new Error("Unexpected dot segment condition")}return f.join("")}function ke(m){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},v=f.iri?u:c,E=[],P=_e[(f.scheme||m.scheme||"").toLowerCase()];if(P&&P.serialize&&P.serialize(m,f),m.host&&!v.IPV6ADDRESS.test(m.host)){if(f.domainHost||P&&P.domainHost)try{m.host=f.iri?se.toUnicode(m.host):se.toASCII(m.host.replace(v.PCT_ENCODED,$e).toLowerCase());}catch(ae){m.error=m.error||"Host's domain name can not be converted to "+(f.iri?"Unicode":"ASCII")+" via punycode: "+ae;}}vr(m,v),f.reference!=="suffix"&&m.scheme&&(E.push(m.scheme),E.push(":"));var j=gr(m,f);if(j!==void 0&&(f.reference!=="suffix"&&E.push("//"),E.push(j),m.path&&m.path.charAt(0)!=="/"&&E.push("/")),m.path!==void 0){var J=m.path;!f.absolutePath&&(!P||!P.absolutePath)&&(J=ze(J)),j===void 0&&(J=J.replace(/^\/\//,"/%2F")),E.push(J);}return m.query!==void 0&&(E.push("?"),E.push(m.query)),m.fragment!==void 0&&(E.push("#"),E.push(m.fragment)),E.join("")}function Ae(m,f){var v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},E=arguments[3],P={};return E||(m=ie(ke(m,v),v),f=ie(ke(f,v),v)),v=v||{},!v.tolerant&&f.scheme?(P.scheme=f.scheme,P.userinfo=f.userinfo,P.host=f.host,P.port=f.port,P.path=ze(f.path||""),P.query=f.query):(f.userinfo!==void 0||f.host!==void 0||f.port!==void 0?(P.userinfo=f.userinfo,P.host=f.host,P.port=f.port,P.path=ze(f.path||""),P.query=f.query):(f.path?(f.path.charAt(0)==="/"?P.path=ze(f.path):((m.userinfo!==void 0||m.host!==void 0||m.port!==void 0)&&!m.path?P.path="/"+f.path:m.path?P.path=m.path.slice(0,m.path.lastIndexOf("/")+1)+f.path:P.path=f.path,P.path=ze(P.path)),P.query=f.query):(P.path=m.path,f.query!==void 0?P.query=f.query:P.query=m.query),P.userinfo=m.userinfo,P.host=m.host,P.port=m.port),P.scheme=m.scheme),P.fragment=f.fragment,P}function Ye(m,f,v){var E=o({scheme:"null"},v);return ke(Ae(ie(m,E),ie(f,E),E,true),E)}function Fe(m,f){return typeof m=="string"?m=ke(ie(m,f),f):s(m)==="object"&&(m=ie(ke(m,f),f)),m}function wt(m,f,v){return typeof m=="string"?m=ke(ie(m,v),v):s(m)==="object"&&(m=ke(m,v)),typeof f=="string"?f=ke(ie(f,v),v):s(f)==="object"&&(f=ke(f,v)),m===f}function Sa(m,f){return m&&m.toString().replace(!f||!f.iri?c.ESCAPE:u.ESCAPE,xe)}function Ge(m,f){return m&&m.toString().replace(!f||!f.iri?c.PCT_ENCODED:u.PCT_ENCODED,$e)}var dt={scheme:"http",domainHost:true,parse:function(f,v){return f.host||(f.error=f.error||"HTTP URIs must have a host."),f},serialize:function(f,v){var E=String(f.scheme).toLowerCase()==="https";return (f.port===(E?443:80)||f.port==="")&&(f.port=void 0),f.path||(f.path="/"),f}},gs={scheme:"https",domainHost:dt.domainHost,parse:dt.parse,serialize:dt.serialize};function ys(m){return typeof m.secure=="boolean"?m.secure:String(m.scheme).toLowerCase()==="wss"}var ft={scheme:"ws",domainHost:true,parse:function(f,v){var E=f;return E.secure=ys(E),E.resourceName=(E.path||"/")+(E.query?"?"+E.query:""),E.path=void 0,E.query=void 0,E},serialize:function(f,v){if((f.port===(ys(f)?443:80)||f.port==="")&&(f.port=void 0),typeof f.secure=="boolean"&&(f.scheme=f.secure?"wss":"ws",f.secure=void 0),f.resourceName){var E=f.resourceName.split("?"),P=h(E,2),j=P[0],J=P[1];f.path=j&&j!=="/"?j:void 0,f.query=J,f.resourceName=void 0;}return f.fragment=void 0,f}},_s={scheme:"wss",domainHost:ft.domainHost,parse:ft.parse,serialize:ft.serialize},Bo={},bs="[A-Za-z0-9\\-\\.\\_\\~"+("\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF")+"]",er="[0-9A-Fa-f]",Go=t(t("%[EFef]"+er+"%"+er+er+"%"+er+er)+"|"+t("%[89A-Fa-f]"+er+"%"+er+er)+"|"+t("%"+er+er)),Ko="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",Jo="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",Wo=e(Jo,'[\\"\\\\]'),Xo="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Yo=new RegExp(bs,"g"),Kr=new RegExp(Go,"g"),el=new RegExp(e("[^]",Ko,"[\\.]",'[\\"]',Wo),"g"),Es=new RegExp(e("[^]",bs,Xo),"g"),rl=Es;function wa(m){var f=$e(m);return f.match(Yo)?f:m}var Ps={scheme:"mailto",parse:function(f,v){var E=f,P=E.to=E.path?E.path.split(","):[];if(E.path=void 0,E.query){for(var j=false,J={},ae=E.query.split("&"),oe=0,Ee=ae.length;oe<Ee;++oe){var te=ae[oe].split("=");switch(te[0]){case "to":for(var pe=te[1].split(","),Pe=0,he=pe.length;Pe<he;++Pe)P.push(pe[Pe]);break;case "subject":E.subject=Ge(te[1],v);break;case "body":E.body=Ge(te[1],v);break;default:j=true,J[Ge(te[0],v)]=Ge(te[1],v);break}}j&&(E.headers=J);}E.query=void 0;for(var ne=0,me=P.length;ne<me;++ne){var ce=P[ne].split("@");if(ce[0]=Ge(ce[0]),v.unicodeSupport)ce[1]=Ge(ce[1],v).toLowerCase();else try{ce[1]=se.toASCII(Ge(ce[1],v).toLowerCase());}catch(Or){E.error=E.error||"Email address's domain name can not be converted to ASCII via punycode: "+Or;}P[ne]=ce.join("@");}return E},serialize:function(f,v){var E=f,P=n(f.to);if(P){for(var j=0,J=P.length;j<J;++j){var ae=String(P[j]),oe=ae.lastIndexOf("@"),Ee=ae.slice(0,oe).replace(Kr,wa).replace(Kr,r).replace(el,xe),te=ae.slice(oe+1);try{te=v.iri?se.toUnicode(te):se.toASCII(Ge(te,v).toLowerCase());}catch(ne){E.error=E.error||"Email address's domain name can not be converted to "+(v.iri?"Unicode":"ASCII")+" via punycode: "+ne;}P[j]=Ee+"@"+te;}E.path=P.join(",");}var pe=f.headers=f.headers||{};f.subject&&(pe.subject=f.subject),f.body&&(pe.body=f.body);var Pe=[];for(var he in pe)pe[he]!==Bo[he]&&Pe.push(he.replace(Kr,wa).replace(Kr,r).replace(Es,xe)+"="+pe[he].replace(Kr,wa).replace(Kr,r).replace(rl,xe));return Pe.length&&(E.query=Pe.join("&")),E}},tl=/^([^\:]+)\:(.*)/,xs={scheme:"urn",parse:function(f,v){var E=f.path&&f.path.match(tl),P=f;if(E){var j=v.scheme||P.scheme||"urn",J=E[1].toLowerCase(),ae=E[2],oe=j+":"+(v.nid||J),Ee=_e[oe];P.nid=J,P.nss=ae,P.path=void 0,Ee&&(P=Ee.parse(P,v));}else P.error=P.error||"URN can not be parsed.";return P},serialize:function(f,v){var E=v.scheme||f.scheme||"urn",P=f.nid,j=E+":"+(v.nid||P),J=_e[j];J&&(f=J.serialize(f,v));var ae=f,oe=f.nss;return ae.path=(P||v.nid)+":"+oe,ae}},al=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Ss={scheme:"urn:uuid",parse:function(f,v){var E=f;return E.uuid=E.nss,E.nss=void 0,!v.tolerant&&(!E.uuid||!E.uuid.match(al))&&(E.error=E.error||"UUID is not valid."),E},serialize:function(f,v){var E=f;return E.nss=(f.uuid||"").toLowerCase(),E}};_e[dt.scheme]=dt,_e[gs.scheme]=gs,_e[ft.scheme]=ft,_e[_s.scheme]=_s,_e[Ps.scheme]=Ps,_e[xs.scheme]=xs,_e[Ss.scheme]=Ss,a.SCHEMES=_e,a.pctEncChar=xe,a.pctDecChars=$e,a.parse=ie,a.removeDotSegments=ze,a.serialize=ke,a.resolveComponents=Ae,a.resolve=Ye,a.normalize=Fe,a.equal=wt,a.escapeComponent=Sa,a.unescapeComponent=Ge,Object.defineProperty(a,"__esModule",{value:true});});});var Yt=Q((hh,un)=>{un.exports=function a(e,t){if(e===t)return true;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return false;var s,r,n;if(Array.isArray(e)){if(s=e.length,s!=t.length)return false;for(r=s;r--!==0;)if(!a(e[r],t[r]))return false;return true}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 false;for(r=s;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,n[r]))return false;for(r=s;r--!==0;){var o=n[r];if(!a(e[o],t[o]))return false}return true}return e!==e&&t!==t};});var fn=Q((ph,dn)=>{dn.exports=function(e){for(var t=0,s=e.length,r=0,n;r<s;)t++,n=e.charCodeAt(r++),n>=55296&&n<=56319&&r<s&&(n=e.charCodeAt(r),(n&64512)==56320&&r++);return t};});var Qr=Q((mh,mn)=>{mn.exports={copy:Pu,checkDataType:za,checkDataTypes:xu,coerceToTypes:Su,toHash:Va,getProperty:Ua,escapeQuotes:Za,equal:Yt(),ucs2length:fn(),varOccurences:Tu,varReplace:Ou,schemaHasRules:Iu,schemaHasRulesExcept:$u,schemaUnknownRules:Au,toQuotedString:Ha,getPathExpr:Cu,getPath:ku,getData:ju,unescapeFragment:Lu,unescapeJsonPointer:Qa,escapeFragment:Fu,escapeJsonPointer:Ba};function Pu(a,e){e=e||{};for(var t in a)e[t]=a[t];return e}function za(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 xu(a,e,t){switch(a.length){case 1:return za(a[0],e,t,true);default:var s="",r=Va(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?" && ":"")+za(n,e,t,true);return s}}var hn=Va(["string","number","integer","boolean","null"]);function Su(a,e){if(Array.isArray(e)){for(var t=[],s=0;s<e.length;s++){var r=e[s];(hn[r]||a==="array"&&r==="array")&&(t[t.length]=r);}if(t.length)return t}else {if(hn[e])return [e];if(a==="array"&&e==="array")return ["array"]}}function Va(a){for(var e={},t=0;t<a.length;t++)e[a[t]]=true;return e}var wu=/^[a-z$_][a-z$_0-9]*$/i,Ru=/'|\\/g;function Ua(a){return typeof a=="number"?"["+a+"]":wu.test(a)?"."+a:"['"+Za(a)+"']"}function Za(a){return a.replace(Ru,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function Tu(a,e){e+="[^0-9]";var t=a.match(new RegExp(e,"g"));return t?t.length:0}function Ou(a,e,t){return e+="([^0-9])",t=t.replace(/\$/g,"$$$$"),a.replace(new RegExp(e,"g"),t+"$1")}function Iu(a,e){if(typeof a=="boolean")return !a;for(var t in a)if(e[t])return true}function $u(a,e,t){if(typeof a=="boolean")return !a&&t!="not";for(var s in a)if(s!=t&&e[s])return true}function Au(a,e){if(typeof a!="boolean"){for(var t in a)if(!e[t])return t}}function Ha(a){return "'"+Za(a)+"'"}function Cu(a,e,t,s){var r=t?"'/' + "+e+(s?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):s?"'[' + "+e+" + ']'":"'[\\'' + "+e+" + '\\']'";return pn(a,r)}function ku(a,e,t){var s=Ha(t?"/"+Ba(e):Ua(e));return pn(a,s)}var Du=/^\/(?:[^~]|~0|~1)*$/,Nu=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ju(a,e,t){var s,r,n,o;if(a==="")return "rootData";if(a[0]=="/"){if(!Du.test(a))throw new Error("Invalid JSON-pointer: "+a);r=a,n="rootData";}else {if(o=a.match(Nu),!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,c=r.split("/"),u=0;u<c.length;u++){var h=c[u];h&&(n+=Ua(Qa(h)),i+=" && "+n);}return i}function pn(a,e){return a=='""'?e:(a+" + "+e).replace(/([^\\])' \+ '/g,"$1")}function Lu(a){return Qa(decodeURIComponent(a))}function Fu(a){return encodeURIComponent(Ba(a))}function Ba(a){return a.replace(/~/g,"~0").replace(/\//g,"~1")}function Qa(a){return a.replace(/~1/g,"/").replace(/~0/g,"~")}});var Ga=Q((vh,vn)=>{var Mu=Qr();vn.exports=qu;function qu(a){Mu.copy(a,this);}});var yn=Q((gh,gn)=>{var Pr=gn.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(){};ea(e,s,r,a,"",a);};Pr.keywords={additionalItems:true,items:true,contains:true,additionalProperties:true,propertyNames:true,not:true};Pr.arrayKeywords={items:true,allOf:true,anyOf:true,oneOf:true};Pr.propsKeywords={definitions:true,properties:true,patternProperties:true,dependencies:true};Pr.skipKeywords={default:true,enum:true,const:true,required:true,maximum:true,minimum:true,exclusiveMaximum:true,exclusiveMinimum:true,multipleOf:true,maxLength:true,minLength:true,pattern:true,format:true,maxItems:true,minItems:true,uniqueItems:true,maxProperties:true,minProperties:true};function ea(a,e,t,s,r,n,o,i,c,u){if(s&&typeof s=="object"&&!Array.isArray(s)){e(s,r,n,o,i,c,u);for(var h in s){var p=s[h];if(Array.isArray(p)){if(h in Pr.arrayKeywords)for(var y=0;y<p.length;y++)ea(a,e,t,p[y],r+"/"+h+"/"+y,n,r,h,s,y);}else if(h in Pr.propsKeywords){if(p&&typeof p=="object")for(var d in p)ea(a,e,t,p[d],r+"/"+h+"/"+zu(d),n,r,h,s,d);}else (h in Pr.keywords||a.allKeys&&!(h in Pr.skipKeywords))&&ea(a,e,t,p,r+"/"+h,n,r,h,s);}t(s,r,n,o,i,c,u);}}function zu(a){return a.replace(/~/g,"~0").replace(/\//g,"~1")}});var ia=Q((yh,Pn)=>{var xt=cn(),_n=Yt(),sa=Qr(),ra=Ga(),Hu=yn();Pn.exports=Sr;Sr.normalizeId=xr;Sr.fullPath=ta;Sr.url=aa;Sr.ids=Qu;Sr.inlineRef=Ka;Sr.schema=na;function Sr(a,e,t){var s=this._refs[t];if(typeof s=="string")if(this._refs[s])s=this._refs[s];else return Sr.call(this,a,e,s);if(s=s||this._schemas[t],s instanceof ra)return Ka(s.schema,this._opts.inlineRefs)?s.schema:s.validate||this._compile(s);var r=na.call(this,e,t),n,o,i;return r&&(n=r.schema,e=r.root,i=r.baseId),n instanceof ra?o=n.validate||a.call(this,n.schema,e,void 0,i):n!==void 0&&(o=Ka(n,this._opts.inlineRefs)?n:a.call(this,n,e,void 0,i)),o}function na(a,e){var t=xt.parse(e),s=En(t),r=ta(this._getId(a.schema));if(Object.keys(a.schema).length===0||s!==r){var n=xr(s),o=this._refs[n];if(typeof o=="string")return Vu.call(this,a,o,t);if(o instanceof ra)o.validate||this._compile(o),a=o;else if(o=this._schemas[n],o instanceof ra){if(o.validate||this._compile(o),n==xr(e))return {schema:o,root:a,baseId:r};a=o;}else return;if(!a.schema)return;r=ta(this._getId(a.schema));}return bn.call(this,t,r,a.schema,a)}function Vu(a,e,t){var s=na.call(this,a,e);if(s){var r=s.schema,n=s.baseId;a=s.root;var o=this._getId(r);return o&&(n=aa(n,o)),bn.call(this,t,n,r,a)}}var Uu=sa.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function bn(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=sa.unescapeFragment(o),t=t[o],t===void 0)break;var i;if(!Uu[o]&&(i=this._getId(t),i&&(e=aa(e,i)),t.$ref)){var c=aa(e,t.$ref),u=na.call(this,s,c);u&&(t=u.schema,s=u.root,e=u.baseId);}}}if(t!==void 0&&t!==s.schema)return {schema:t,root:s,baseId:e}}}var Zu=sa.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function Ka(a,e){if(e===false)return false;if(e===void 0||e===true)return Ja(a);if(e)return Wa(a)<=e}function Ja(a){var e;if(Array.isArray(a)){for(var t=0;t<a.length;t++)if(e=a[t],typeof e=="object"&&!Ja(e))return false}else for(var s in a)if(s=="$ref"||(e=a[s],typeof e=="object"&&!Ja(e)))return false;return true}function Wa(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+=Wa(t)),e==1/0)return 1/0}else for(var r in a){if(r=="$ref")return 1/0;if(Zu[r])e++;else if(t=a[r],typeof t=="object"&&(e+=Wa(t)+1),e==1/0)return 1/0}return e}function ta(a,e){e!==false&&(a=xr(a));var t=xt.parse(a);return En(t)}function En(a){return xt.serialize(a).split("#")[0]+"#"}var Bu=/#\/?$/;function xr(a){return a?a.replace(Bu,""):""}function aa(a,e){return e=xr(e),xt.resolve(a,e)}function Qu(a){var e=xr(this._getId(a)),t={"":e},s={"":ta(e,false)},r={},n=this;return Hu(a,{allKeys:true},function(o,i,c,u,h,p,y){if(i!==""){var d=n._getId(o),_=t[u],b=s[u]+"/"+h;if(y!==void 0&&(b+="/"+(typeof y=="number"?y:sa.escapeFragment(y))),typeof d=="string"){d=_=xr(_?xt.resolve(_,d):d);var g=n._refs[d];if(typeof g=="string"&&(g=n._refs[g]),g&&g.schema){if(!_n(o,g.schema))throw new Error('id "'+d+'" resolves to more than one schema')}else if(d!=xr(b))if(d[0]=="#"){if(r[d]&&!_n(o,r[d]))throw new Error('id "'+d+'" resolves to more than one schema');r[d]=o;}else n._refs[d]=b;}t[i]=_,s[i]=b;}}),r}});var oa=Q((_h,Sn)=>{var Xa=ia();Sn.exports={Validation:xn(Gu),MissingRef:xn(Ya)};function Gu(a){this.message="validation failed",this.errors=a,this.ajv=this.validation=true;}Ya.message=function(a,e){return "can't resolve reference "+e+" from id "+a};function Ya(a,e,t){this.message=t||Ya.message(a,e),this.missingRef=Xa.url(a,e),this.missingSchema=Xa.normalizeId(Xa.fullPath(this.missingRef));}function xn(a){return a.prototype=Object.create(Error.prototype),a.prototype.constructor=a,a}});var es=Q((bh,wn)=>{wn.exports=function(a,e){e||(e={}),typeof e=="function"&&(e={cmp:e});var t=typeof e.cycles=="boolean"?e.cycles:false,s=e.cmp&&function(n){return function(o){return function(i,c){var u={key:i,value:o[i]},h={key:c,value:o[c]};return n(u,h)}}}(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,c;if(Array.isArray(o)){for(c="[",i=0;i<o.length;i++)i&&(c+=","),c+=n(o[i])||"null";return c+"]"}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 u=r.push(o)-1,h=Object.keys(o).sort(s&&s(o));for(c="",i=0;i<h.length;i++){var p=h[i],y=n(o[p]);y&&(c&&(c+=","),c+=JSON.stringify(p)+":"+y);}return r.splice(u,1),"{"+c+"}"}}(a)};});var rs=Q((Eh,Rn)=>{Rn.exports=function(e,t,s){var r="",n=e.schema.$async===true,o=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),i=e.self._getId(e.schema);if(e.opts.strictKeywords){var c=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(c){var u="unknown keyword: "+c;if(e.opts.strictKeywords==="log")e.logger.warn(u);else throw new Error(u)}}if(e.isTop&&(r+=" var validate = ",n&&(e.async=true,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",h=e.level,p=e.dataLevel,y=e.schema[t],d=e.schemaPath+e.util.getProperty(t),_=e.errSchemaPath+"/"+t,$=!e.opts.allErrors,q,b="data"+(p||""),R="valid"+h;if(e.schema===false){e.isTop?$=true:r+=" var "+R+" = false; ";var g=g||[];g.push(r),r="",e.createErrors!==false?(r+=" { keyword: '"+(q||"false schema")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(_)+" , params: {} ",e.opts.messages!==false&&(r+=" , message: 'boolean schema is false' "),e.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+b+" "),r+=" } "):r+=" {} ";var x=r;r=g.pop(),!e.compositeRule&&$?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 "+R+" = true; ";return e.isTop&&(r+=" }; return validate; "),r}if(e.isTop){var I=e.isTop,h=e.level=0,p=e.dataLevel=0,b="data";if(e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[""],e.schema.default!==void 0&&e.opts.useDefaults&&e.opts.strictDefaults){var S="default is ignored in the schema root";if(e.opts.strictDefaults==="log")e.logger.warn(S);else throw new Error(S)}r+=" var vErrors = null; ",r+=" var errors = 0; ",r+=" if (rootData === undefined) rootData = data; ";}else {var h=e.level,p=e.dataLevel,b="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_"+h+" = errors;";}var R="valid"+h,$=!e.opts.allErrors,A="",V="",q,C=e.schema.type,z=Array.isArray(C);if(C&&e.opts.nullable&&e.schema.nullable===true&&(z?C.indexOf("null")==-1&&(C=C.concat("null")):C!="null"&&(C=[C,"null"],z=true)),z&&C.length==1&&(C=C[0],z=false),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!==true&&(o=false,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||z||L===true||L&&!Se(L)){var d=e.schemaPath+".type",_=e.errSchemaPath+"/type",d=e.schemaPath+".type",_=e.errSchemaPath+"/type",O=z?"checkDataTypes":"checkDataType";if(r+=" if ("+e.util[O](C,b,e.opts.strictNumbers,true)+") { ",M){var k="dataType"+h,F="coerced"+h;r+=" var "+k+" = typeof "+b+"; var "+F+" = undefined; ",e.opts.coerceTypes=="array"&&(r+=" if ("+k+" == 'object' && Array.isArray("+b+") && "+b+".length == 1) { "+b+" = "+b+"[0]; "+k+" = typeof "+b+"; if ("+e.util.checkDataType(e.schema.type,b,e.opts.strictNumbers)+") "+F+" = "+b+"; } "),r+=" if ("+F+" !== undefined) ; ";var le=M;if(le)for(var X,re=-1,W=le.length-1;re<W;)X=le[re+=1],X=="string"?r+=" else if ("+k+" == 'number' || "+k+" == 'boolean') "+F+" = '' + "+b+"; else if ("+b+" === null) "+F+" = ''; ":X=="number"||X=="integer"?(r+=" else if ("+k+" == 'boolean' || "+b+" === null || ("+k+" == 'string' && "+b+" && "+b+" == +"+b+" ",X=="integer"&&(r+=" && !("+b+" % 1)"),r+=")) "+F+" = +"+b+"; "):X=="boolean"?r+=" else if ("+b+" === 'false' || "+b+" === 0 || "+b+" === null) "+F+" = false; else if ("+b+" === 'true' || "+b+" === 1) "+F+" = true; ":X=="null"?r+=" else if ("+b+" === '' || "+b+" === 0 || "+b+" === false) "+F+" = null; ":e.opts.coerceTypes=="array"&&X=="array"&&(r+=" else if ("+k+" == 'string' || "+k+" == 'number' || "+k+" == 'boolean' || "+b+" == null) "+F+" = ["+b+"]; ");r+=" else { ";var g=g||[];g.push(r),r="",e.createErrors!==false?(r+=" { keyword: '"+(q||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(_)+" , params: { type: '",z?r+=""+C.join(","):r+=""+C,r+="' } ",e.opts.messages!==false&&(r+=" , message: 'should be ",z?r+=""+C.join(","):r+=""+C,r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+b+" "),r+=" } "):r+=" {} ";var x=r;r=g.pop(),!e.compositeRule&&$?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 U=p?"data"+(p-1||""):"parentData",ve=p?e.dataPathArr[p]:"parentDataProperty";r+=" "+b+" = "+F+"; ",p||(r+="if ("+U+" !== undefined)"),r+=" "+U+"["+ve+"] = "+F+"; } ";}else {var g=g||[];g.push(r),r="",e.createErrors!==false?(r+=" { keyword: '"+(q||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(_)+" , params: { type: '",z?r+=""+C.join(","):r+=""+C,r+="' } ",e.opts.messages!==false&&(r+=" , message: 'should be ",z?r+=""+C.join(","):r+=""+C,r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+b+" "),r+=" } "):r+=" {} ";var x=r;r=g.pop(),!e.compositeRule&&$?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")+" ",$&&(r+=" } if (errors === ",I?r+="0":r+="errs_"+h,r+=") { ",V+="}");else {var Re=e.RULES;if(Re){for(var L,Ie=-1,se=Re.length-1;Ie<se;)if(L=Re[Ie+=1],Se(L)){if(L.type&&(r+=" if ("+e.util.checkDataType(L.type,b,e.opts.strictNumbers)+") { "),e.opts.useDefaults){if(L.type=="object"&&e.schema.properties){var y=e.schema.properties,_e=Object.keys(y),xe=_e;if(xe)for(var $e,vr=-1,ir=xe.length-1;vr<ir;){$e=xe[vr+=1];var be=y[$e];if(be.default!==void 0){var ge=b+e.util.getProperty($e);if(e.compositeRule){if(e.opts.strictDefaults){var S="default is ignored for: "+ge;if(e.opts.strictDefaults==="log")e.logger.warn(S);else throw new Error(S)}}else r+=" if ("+ge+" === undefined ",e.opts.useDefaults=="empty"&&(r+=" || "+ge+" === null || "+ge+" === '' "),r+=" ) "+ge+" = ",e.opts.useDefaults=="shared"?r+=" "+e.useDefault(be.default)+" ":r+=" "+JSON.stringify(be.default)+" ",r+="; ";}}}else if(L.type=="array"&&Array.isArray(e.schema.items)){var wr=e.schema.items;if(wr){for(var be,re=-1,Te=wr.length-1;re<Te;)if(be=wr[re+=1],be.default!==void 0){var ge=b+"["+re+"]";if(e.compositeRule){if(e.opts.strictDefaults){var S="default is ignored for: "+ge;if(e.opts.strictDefaults==="log")e.logger.warn(S);else throw new Error(S)}}else r+=" if ("+ge+" === undefined ",e.opts.useDefaults=="empty"&&(r+=" || "+ge+" === null || "+ge+" === '' "),r+=" ) "+ge+" = ",e.opts.useDefaults=="shared"?r+=" "+e.useDefault(be.default)+" ":r+=" "+JSON.stringify(be.default)+" ",r+="; ";}}}}var ie=L.rules;if(ie){for(var gr,or=-1,Rr=ie.length-1;or<Rr;)if(gr=ie[or+=1],ze(gr)){var Tr=gr.code(e,gr.keyword,L.type);Tr&&(r+=" "+Tr+" ",$&&(A+="}"));}}if($&&(r+=" "+A+" ",A=""),L.type&&(r+=" } ",C&&C===L.type&&!M)){r+=" else { ";var d=e.schemaPath+".type",_=e.errSchemaPath+"/type",g=g||[];g.push(r),r="",e.createErrors!==false?(r+=" { keyword: '"+(q||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(_)+" , params: { type: '",z?r+=""+C.join(","):r+=""+C,r+="' } ",e.opts.messages!==false&&(r+=" , message: 'should be ",z?r+=""+C.join(","):r+=""+C,r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+b+" "),r+=" } "):r+=" {} ";var x=r;r=g.pop(),!e.compositeRule&&$?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+=" } ";}$&&(r+=" if (errors === ",I?r+="0":r+="errs_"+h,r+=") { ",V+="}");}}}$&&(r+=" "+V+" "),I?(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 "+R+" = errors === errs_"+h+";";function Se(Ae){for(var Ye=Ae.rules,Fe=0;Fe<Ye.length;Fe++)if(ze(Ye[Fe]))return true}function ze(Ae){return e.schema[Ae.keyword]!==void 0||Ae.implements&&ke(Ae)}function ke(Ae){for(var Ye=Ae.implements,Fe=0;Fe<Ye.length;Fe++)if(e.schema[Ye[Fe]]!==void 0)return true}return r};});var An=Q((Ph,$n)=>{var la=ia(),ua=Qr(),On=oa(),Ku=es(),Tn=rs(),Ju=ua.ucs2length,Wu=Yt(),Xu=On.Validation;$n.exports=ts;function ts(a,e,t,s){var r=this,n=this._opts,o=[void 0],i={},c=[],u={},h=[],p={},y=[];e=e||{schema:a,refVal:o,refs:i};var d=Yu.call(this,a,e,s),_=this._compilations[d.index];if(d.compiling)return _.callValidate=S;var b=this._formats,g=this.RULES;try{var x=R(a,e,t,s);_.validate=x;var I=_.callValidate;return I&&(I.schema=x.schema,I.errors=null,I.refs=x.refs,I.refVal=x.refVal,I.root=x.root,I.$async=x.$async,n.sourceCode&&(I.source=x.source)),x}finally{ed.call(this,a,e,s);}function S(){var O=_.validate,k=O.apply(this,arguments);return S.errors=O.errors,k}function R(O,k,F,le){var X=!k||k&&k.schema==O;if(k.schema!=e.schema)return ts.call(r,O,k,F,le);var re=O.$async===true,W=Tn({isTop:true,schema:O,isRoot:X,baseId:le,root:k,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:On.MissingRef,RULES:g,validate:Tn,util:ua,resolve:la,resolveRef:$,usePattern:z,useDefault:M,useCustomRule:L,opts:n,formats:b,logger:r.logger,self:r});W=ca(o,ad)+ca(c,rd)+ca(h,td)+ca(y,sd)+W,n.processCode&&(W=n.processCode(W,O));var U;try{var ve=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",W);U=ve(r,g,b,e,o,h,y,Wu,Ju,Xu),o[0]=U;}catch(Re){throw r.logger.error("Error compiling schema, function code:",W),Re}return U.schema=O,U.errors=null,U.refs=i,U.refVal=o,U.root=X?U:k,re&&(U.$async=true),n.sourceCode===true&&(U.source={code:W,patterns:c,defaults:h}),U}function $(O,k,F){k=la.url(O,k);var le=i[k],X,re;if(le!==void 0)return X=o[le],re="refVal["+le+"]",C(X,re);if(!F&&e.refs){var W=e.refs[k];if(W!==void 0)return X=e.refVal[W],re=A(k,X),C(X,re)}re=A(k);var U=la.call(r,R,e,k);if(U===void 0){var ve=t&&t[k];ve&&(U=la.inlineRef(ve,n.inlineRefs)?ve:ts.call(r,ve,e,t,O));}if(U===void 0)V(k);else return q(k,U),C(U,re)}function A(O,k){var F=o.length;return o[F]=k,i[O]=F,"refVal"+F}function V(O){delete i[O];}function q(O,k){var F=i[O];o[F]=k;}function C(O,k){return typeof O=="object"||typeof O=="boolean"?{code:k,schema:O,inline:true}:{code:k,$async:O&&!!O.$async}}function z(O){var k=u[O];return k===void 0&&(k=u[O]=c.length,c[k]=O),"pattern"+k}function M(O){switch(typeof O){case "boolean":case "number":return ""+O;case "string":return ua.toQuotedString(O);case "object":if(O===null)return "null";var k=Ku(O),F=p[k];return F===void 0&&(F=p[k]=h.length,h[F]=O),"default"+F}}function L(O,k,F,le){if(r._opts.validateSchema!==false){var X=O.definition.dependencies;if(X&&!X.every(function(xe){return Object.prototype.hasOwnProperty.call(F,xe)}))throw new Error("parent schema must have all required keywords: "+X.join(","));var re=O.definition.validateSchema;if(re){var W=re(k);if(!W){var U="keyword schema is invalid: "+r.errorsText(re.errors);if(r._opts.validateSchema=="log")r.logger.error(U);else throw new Error(U)}}}var ve=O.definition.compile,Re=O.definition.inline,Ie=O.definition.macro,se;if(ve)se=ve.call(r,k,F,le);else if(Ie)se=Ie.call(r,k,F,le),n.validateSchema!==false&&r.validateSchema(se,true);else if(Re)se=Re.call(r,le,O.keyword,k,F);else if(se=O.definition.validate,!se)return;if(se===void 0)throw new Error('custom keyword "'+O.keyword+'"failed to compile');var _e=y.length;return y[_e]=se,{code:"customRule"+_e,validate:se}}}function Yu(a,e,t){var s=In.call(this,a,e,t);return s>=0?{index:s,compiling:true}:(s=this._compilations.length,this._compilations[s]={schema:a,root:e,baseId:t},{index:s,compiling:false})}function ed(a,e,t){var s=In.call(this,a,e,t);s>=0&&this._compilations.splice(s,1);}function In(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 rd(a,e){return "var pattern"+a+" = new RegExp("+ua.toQuotedString(e[a])+");"}function td(a){return "var default"+a+" = defaults["+a+"];"}function ad(a,e){return e[a]===void 0?"":"var refVal"+a+" = refVal["+a+"];"}function sd(a){return "var customRule"+a+" = customRules["+a+"];"}function ca(a,e){if(!a.length)return "";for(var t="",s=0;s<a.length;s++)t+=e(s,a);return t}});var kn=Q((xh,Cn)=>{var da=Cn.exports=function(){this._cache={};};da.prototype.put=function(e,t){this._cache[e]=t;};da.prototype.get=function(e){return this._cache[e]};da.prototype.del=function(e){delete this._cache[e];};da.prototype.clear=function(){this._cache={};};});var Zn=Q((Sh,Un)=>{var nd=Qr(),id=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,od=[0,31,28,31,30,31,30,31,31,30,31,30,31],ld=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,Dn=/^(?=.{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,cd=/^(?:[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,ud=/^(?:[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,Nn=/^(?:(?:[^\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,jn=/^(?:(?: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,Ln=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,Fn=/^(?:\/(?:[^~/]|~0|~1)*)*$/,Mn=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,qn=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;Un.exports=fa;function fa(a){return a=a=="full"?"full":"fast",nd.copy(fa[a])}fa.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":Nn,url:jn,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:Dn,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:Vn,uuid:Ln,"json-pointer":Fn,"json-pointer-uri-fragment":Mn,"relative-json-pointer":qn};fa.full={date:zn,time:Hn,"date-time":hd,uri:md,"uri-reference":ud,"uri-template":Nn,url:jn,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:Dn,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:Vn,uuid:Ln,"json-pointer":Fn,"json-pointer-uri-fragment":Mn,"relative-json-pointer":qn};function dd(a){return a%4===0&&(a%100!==0||a%400===0)}function zn(a){var e=a.match(id);if(!e)return false;var t=+e[1],s=+e[2],r=+e[3];return s>=1&&s<=12&&r>=1&&r<=(s==2&&dd(t)?29:od[s])}function Hn(a,e){var t=a.match(ld);if(!t)return false;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 fd=/t|\s/i;function hd(a){var e=a.split(fd);return e.length==2&&zn(e[0])&&Hn(e[1],true)}var pd=/\/|:/;function md(a){return pd.test(a)&&cd.test(a)}var vd=/[^\\]\\Z/;function Vn(a){if(vd.test(a))return false;try{return new RegExp(a),!0}catch(e){return false}}});var Qn=Q((wh,Bn)=>{Bn.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,h="data"+(o||""),p="valid"+n,y,d;if(i=="#"||i=="#/")e.isRoot?(y=e.async,d="validate"):(y=e.root.schema.$async===true,d="root.refVal[0]");else {var _=e.resolveRef(e.baseId,i,e.isRoot);if(_===void 0){var b=e.MissingRefError.message(e.baseId,i);if(e.opts.missingRefs=="fail"){e.logger.error(b);var g=g||[];g.push(r),r="",e.createErrors!==false?(r+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { ref: '"+e.util.escapeQuotes(i)+"' } ",e.opts.messages!==false&&(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: "+h+" "),r+=" } "):r+=" {} ";var x=r;r=g.pop(),!e.compositeRule&&u?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++; ",u&&(r+=" if (false) { ");}else if(e.opts.missingRefs=="ignore")e.logger.warn(b),u&&(r+=" if (true) { ");else throw new e.MissingRefError(e.baseId,i,b)}else if(_.inline){var I=e.util.copy(e);I.level++;var S="valid"+I.level;I.schema=_.schema,I.schemaPath="",I.errSchemaPath=i;var R=e.validate(I).replace(/validate\.schema/g,_.code);r+=" "+R+" ",u&&(r+=" if ("+S+") { ");}else y=_.$async===true||e.async&&_.$async!==false,d=_.code;}if(d){var g=g||[];g.push(r),r="",e.opts.passContext?r+=" "+d+".call(this, ":r+=" "+d+"( ",r+=" "+h+", (dataPath || '')",e.errorPath!='""'&&(r+=" + "+e.errorPath);var $=o?"data"+(o-1||""):"parentData",A=o?e.dataPathArr[o]:"parentDataProperty";r+=" , "+$+" , "+A+", rootData) ";var V=r;if(r=g.pop(),y){if(!e.async)throw new Error("async schema referenced by sync schema");u&&(r+=" var "+p+"; "),r+=" try { await "+V+"; ",u&&(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; ",u&&(r+=" "+p+" = false; "),r+=" } ",u&&(r+=" if ("+p+") { ");}else r+=" if (!"+V+") { if (vErrors === null) vErrors = "+d+".errors; else vErrors = vErrors.concat("+d+".errors); errors = vErrors.length; } ",u&&(r+=" else { ");}return r};});var Kn=Q((Rh,Gn)=>{Gn.exports=function(e,t,s){var r=" ",n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),i=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,u=e.util.copy(e),h="";u.level++;var p="valid"+u.level,y=u.baseId,d=true,_=n;if(_)for(var b,g=-1,x=_.length-1;g<x;)b=_[g+=1],(e.opts.strictKeywords?typeof b=="object"&&Object.keys(b).length>0||b===false:e.util.schemaHasRules(b,e.RULES.all))&&(d=false,u.schema=b,u.schemaPath=o+"["+g+"]",u.errSchemaPath=i+"/"+g,r+=" "+e.validate(u)+" ",u.baseId=y,c&&(r+=" if ("+p+") { ",h+="}"));return c&&(d?r+=" if (true) { ":r+=" "+h.slice(0,-1)+" "),r};});var Wn=Q((Th,Jn)=>{Jn.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,p="data"+(o||""),y="valid"+n,d="errs__"+n,_=e.util.copy(e),b="";_.level++;var g="valid"+_.level,x=i.every(function(q){return e.opts.strictKeywords?typeof q=="object"&&Object.keys(q).length>0||q===false:e.util.schemaHasRules(q,e.RULES.all)});if(x){var I=_.baseId;r+=" var "+d+" = errors; var "+y+" = false; ";var S=e.compositeRule;e.compositeRule=_.compositeRule=true;var R=i;if(R)for(var $,A=-1,V=R.length-1;A<V;)$=R[A+=1],_.schema=$,_.schemaPath=c+"["+A+"]",_.errSchemaPath=u+"/"+A,r+=" "+e.validate(_)+" ",_.baseId=I,r+=" "+y+" = "+y+" || "+g+"; if (!"+y+") { ",b+="}";e.compositeRule=_.compositeRule=S,r+=" "+b+" if (!"+y+") { var err = ",e.createErrors!==false?(r+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==false&&(r+=" , message: 'should match some schema in anyOf' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&h&&(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 h&&(r+=" if (true) { ");return r};});var Yn=Q((Oh,Xn)=>{Xn.exports=function(e,t,s){var r=" ",n=e.schema[t],o=e.errSchemaPath+"/"+t;!e.opts.allErrors;var c=e.util.toQuotedString(n);return e.opts.$comment===true?r+=" console.log("+c+");":typeof e.opts.$comment=="function"&&(r+=" self._opts.$comment("+c+", "+e.util.toQuotedString(o)+", validate.root.schema);"),r};});var ri=Q((Ih,ei)=>{ei.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,p="data"+(o||""),y="valid"+n,d=e.opts.$data&&i&&i.$data;d?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ","schema"+n):i,d||(r+=" var schema"+n+" = validate.schema"+c+";"),r+="var "+y+" = equal("+p+", schema"+n+"); if (!"+y+") { ";var b=b||[];b.push(r),r="",e.createErrors!==false?(r+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { allowedValue: schema"+n+" } ",e.opts.messages!==false&&(r+=" , message: 'should be equal to constant' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var g=r;return r=b.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+g+"]); ":r+=" validate.errors = ["+g+"]; return false; ":r+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" }",h&&(r+=" else { "),r};});var ai=Q(($h,ti)=>{ti.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,p="data"+(o||""),y="valid"+n,d="errs__"+n,_=e.util.copy(e),b="";_.level++;var g="valid"+_.level,x="i"+n,I=_.dataLevel=e.dataLevel+1,S="data"+I,R=e.baseId,$=e.opts.strictKeywords?typeof i=="object"&&Object.keys(i).length>0||i===false:e.util.schemaHasRules(i,e.RULES.all);if(r+="var "+d+" = errors;var "+y+";",$){var A=e.compositeRule;e.compositeRule=_.compositeRule=true,_.schema=i,_.schemaPath=c,_.errSchemaPath=u,r+=" var "+g+" = false; for (var "+x+" = 0; "+x+" < "+p+".length; "+x+"++) { ",_.errorPath=e.util.getPathExpr(e.errorPath,x,e.opts.jsonPointers,true);var V=p+"["+x+"]";_.dataPathArr[I]=x;var q=e.validate(_);_.baseId=R,e.util.varOccurences(q,S)<2?r+=" "+e.util.varReplace(q,S,V)+" ":r+=" var "+S+" = "+V+"; "+q+" ",r+=" if ("+g+") break; } ",e.compositeRule=_.compositeRule=A,r+=" "+b+" if (!"+g+") {";}else r+=" if ("+p+".length == 0) {";var C=C||[];C.push(r),r="",e.createErrors!==false?(r+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==false&&(r+=" , message: 'should contain a valid item' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var z=r;return r=C.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+z+"]); ":r+=" validate.errors = ["+z+"]; return false; ":r+=" var err = "+z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { ",$&&(r+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } "),e.opts.allErrors&&(r+=" } "),r};});var ni=Q((Ah,si)=>{si.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,p="data"+(o||""),y="errs__"+n,d=e.util.copy(e),_="";d.level++;var b="valid"+d.level,g={},x={},I=e.opts.ownProperties;for(A in i)if(A!="__proto__"){var S=i[A],R=Array.isArray(S)?x:g;R[A]=S;}r+="var "+y+" = errors;";var $=e.errorPath;r+="var missing"+n+";";for(var A in x)if(R=x[A],R.length){if(r+=" if ( "+p+e.util.getProperty(A)+" !== undefined ",I&&(r+=" && Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(A)+"') "),h){r+=" && ( ";var V=R;if(V)for(var q,C=-1,z=V.length-1;C<z;){q=V[C+=1],C&&(r+=" || ");var M=e.util.getProperty(q),L=p+M;r+=" ( ( "+L+" === undefined ",I&&(r+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(q)+"') "),r+=") && (missing"+n+" = "+e.util.toQuotedString(e.opts.jsonPointers?q:M)+") ) ";}r+=")) { ";var O="missing"+n,k="' + "+O+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr($,O,true):$+" + "+O);var F=F||[];F.push(r),r="",e.createErrors!==false?(r+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { property: '"+e.util.escapeQuotes(A)+"', missingProperty: '"+k+"', depsCount: "+R.length+", deps: '"+e.util.escapeQuotes(R.length==1?R[0]:R.join(", "))+"' } ",e.opts.messages!==false&&(r+=" , message: 'should have ",R.length==1?r+="property "+e.util.escapeQuotes(R[0]):r+="properties "+e.util.escapeQuotes(R.join(", ")),r+=" when property "+e.util.escapeQuotes(A)+" is present' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var le=r;r=F.pop(),!e.compositeRule&&h?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 X=R;if(X)for(var q,re=-1,W=X.length-1;re<W;){q=X[re+=1];var M=e.util.getProperty(q),k=e.util.escapeQuotes(q),L=p+M;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath($,q,e.opts.jsonPointers)),r+=" if ( "+L+" === undefined ",I&&(r+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(q)+"') "),r+=") { var err = ",e.createErrors!==false?(r+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { property: '"+e.util.escapeQuotes(A)+"', missingProperty: '"+k+"', depsCount: "+R.length+", deps: '"+e.util.escapeQuotes(R.length==1?R[0]:R.join(", "))+"' } ",e.opts.messages!==false&&(r+=" , message: 'should have ",R.length==1?r+="property "+e.util.escapeQuotes(R[0]):r+="properties "+e.util.escapeQuotes(R.join(", ")),r+=" when property "+e.util.escapeQuotes(A)+" is present' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } ";}}r+=" } ",h&&(_+="}",r+=" else { ");}e.errorPath=$;var U=d.baseId;for(var A in g){var S=g[A];(e.opts.strictKeywords?typeof S=="object"&&Object.keys(S).length>0||S===false:e.util.schemaHasRules(S,e.RULES.all))&&(r+=" "+b+" = true; if ( "+p+e.util.getProperty(A)+" !== undefined ",I&&(r+=" && Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(A)+"') "),r+=") { ",d.schema=S,d.schemaPath=c+e.util.getProperty(A),d.errSchemaPath=u+"/"+e.util.escapeFragment(A),r+=" "+e.validate(d)+" ",d.baseId=U,r+=" } ",h&&(r+=" if ("+b+") { ",_+="}"));}return h&&(r+=" "+_+" if ("+y+" == errors) {"),r};});var oi=Q((Ch,ii)=>{ii.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,p="data"+(o||""),y="valid"+n,d=e.opts.$data&&i&&i.$data;d?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ","schema"+n):i;var b="i"+n,g="schema"+n;d||(r+=" var "+g+" = validate.schema"+c+";"),r+="var "+y+";",d&&(r+=" if (schema"+n+" === undefined) "+y+" = true; else if (!Array.isArray(schema"+n+")) "+y+" = false; else {"),r+=""+y+" = false;for (var "+b+"=0; "+b+"<"+g+".length; "+b+"++) if (equal("+p+", "+g+"["+b+"])) { "+y+" = true; break; }",d&&(r+=" } "),r+=" if (!"+y+") { ";var x=x||[];x.push(r),r="",e.createErrors!==false?(r+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { allowedValues: schema"+n+" } ",e.opts.messages!==false&&(r+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var I=r;return r=x.pop(),!e.compositeRule&&h?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+=" }",h&&(r+=" else { "),r};});var ci=Q((kh,li)=>{li.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,p="data"+(o||"");if(e.opts.format===false)return h&&(r+=" if (true) { "),r;var y=e.opts.$data&&i&&i.$data,d;y?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",d="schema"+n):d=i;var _=e.opts.unknownFormats,b=Array.isArray(_);if(y){var g="format"+n,x="isObject"+n,I="formatType"+n;r+=" var "+g+" = formats["+d+"]; var "+x+" = typeof "+g+" == 'object' && !("+g+" instanceof RegExp) && "+g+".validate; var "+I+" = "+x+" && "+g+".type || 'string'; if ("+x+") { ",e.async&&(r+=" var async"+n+" = "+g+".async; "),r+=" "+g+" = "+g+".validate; } if ( ",y&&(r+=" ("+d+" !== undefined && typeof "+d+" != 'string') || "),r+=" (",_!="ignore"&&(r+=" ("+d+" && !"+g+" ",b&&(r+=" && self._opts.unknownFormats.indexOf("+d+") == -1 "),r+=") || "),r+=" ("+g+" && "+I+" == '"+s+"' && !(typeof "+g+" == 'function' ? ",e.async?r+=" (async"+n+" ? await "+g+"("+p+") : "+g+"("+p+")) ":r+=" "+g+"("+p+") ",r+=" : "+g+".test("+p+"))))) {";}else {var g=e.formats[i];if(!g){if(_=="ignore")return e.logger.warn('unknown format "'+i+'" ignored in schema at path "'+e.errSchemaPath+'"'),h&&(r+=" if (true) { "),r;if(b&&_.indexOf(i)>=0)return h&&(r+=" if (true) { "),r;throw new Error('unknown format "'+i+'" is used in schema at path "'+e.errSchemaPath+'"')}var x=typeof g=="object"&&!(g instanceof RegExp)&&g.validate,I=x&&g.type||"string";if(x){var S=g.async===true;g=g.validate;}if(I!=s)return h&&(r+=" if (true) { "),r;if(S){if(!e.async)throw new Error("async format in sync schema");var R="formats"+e.util.getProperty(i)+".validate";r+=" if (!(await "+R+"("+p+"))) { ";}else {r+=" if (! ";var R="formats"+e.util.getProperty(i);x&&(R+=".validate"),typeof g=="function"?r+=" "+R+"("+p+") ":r+=" "+R+".test("+p+") ",r+=") { ";}}var $=$||[];$.push(r),r="",e.createErrors!==false?(r+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { format: ",y?r+=""+d:r+=""+e.util.toQuotedString(i),r+=" } ",e.opts.messages!==false&&(r+=` , message: 'should match format "`,y?r+="' + "+d+" + '":r+=""+e.util.escapeQuotes(i),r+=`"' `),e.opts.verbose&&(r+=" , schema: ",y?r+="validate.schema"+c:r+=""+e.util.toQuotedString(i),r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var A=r;return r=$.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+A+"]); ":r+=" validate.errors = ["+A+"]; return false; ":r+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",h&&(r+=" else { "),r};});var di=Q((Dh,ui)=>{ui.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,p="data"+(o||""),y="valid"+n,d="errs__"+n,_=e.util.copy(e);_.level++;var b="valid"+_.level,g=e.schema.then,x=e.schema.else,I=g!==void 0&&(e.opts.strictKeywords?typeof g=="object"&&Object.keys(g).length>0||g===false:e.util.schemaHasRules(g,e.RULES.all)),S=x!==void 0&&(e.opts.strictKeywords?typeof x=="object"&&Object.keys(x).length>0||x===false:e.util.schemaHasRules(x,e.RULES.all)),R=_.baseId;if(I||S){var $;_.createErrors=false,_.schema=i,_.schemaPath=c,_.errSchemaPath=u,r+=" var "+d+" = errors; var "+y+" = true; ";var A=e.compositeRule;e.compositeRule=_.compositeRule=true,r+=" "+e.validate(_)+" ",_.baseId=R,_.createErrors=true,r+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } ",e.compositeRule=_.compositeRule=A,I?(r+=" if ("+b+") { ",_.schema=e.schema.then,_.schemaPath=e.schemaPath+".then",_.errSchemaPath=e.errSchemaPath+"/then",r+=" "+e.validate(_)+" ",_.baseId=R,r+=" "+y+" = "+b+"; ",I&&S?($="ifClause"+n,r+=" var "+$+" = 'then'; "):$="'then'",r+=" } ",S&&(r+=" else { ")):r+=" if (!"+b+") { ",S&&(_.schema=e.schema.else,_.schemaPath=e.schemaPath+".else",_.errSchemaPath=e.errSchemaPath+"/else",r+=" "+e.validate(_)+" ",_.baseId=R,r+=" "+y+" = "+b+"; ",I&&S?($="ifClause"+n,r+=" var "+$+" = 'else'; "):$="'else'",r+=" } "),r+=" if (!"+y+") { var err = ",e.createErrors!==false?(r+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { failingKeyword: "+$+" } ",e.opts.messages!==false&&(r+=` , message: 'should match "' + `+$+` + '" schema' `),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&h&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+=" } ",h&&(r+=" else { ");}else h&&(r+=" if (true) { ");return r};});var hi=Q((Nh,fi)=>{fi.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,p="data"+(o||""),y="valid"+n,d="errs__"+n,_=e.util.copy(e),b="";_.level++;var g="valid"+_.level,x="i"+n,I=_.dataLevel=e.dataLevel+1,S="data"+I,R=e.baseId;if(r+="var "+d+" = errors;var "+y+";",Array.isArray(i)){var $=e.schema.additionalItems;if($===false){r+=" "+y+" = "+p+".length <= "+i.length+"; ";var A=u;u=e.errSchemaPath+"/additionalItems",r+=" if (!"+y+") { ";var V=V||[];V.push(r),r="",e.createErrors!==false?(r+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i.length+" } ",e.opts.messages!==false&&(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=V.pop(),!e.compositeRule&&h?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+=" } ",u=A,h&&(b+="}",r+=" else { ");}var C=i;if(C){for(var z,M=-1,L=C.length-1;M<L;)if(z=C[M+=1],e.opts.strictKeywords?typeof z=="object"&&Object.keys(z).length>0||z===false:e.util.schemaHasRules(z,e.RULES.all)){r+=" "+g+" = true; if ("+p+".length > "+M+") { ";var O=p+"["+M+"]";_.schema=z,_.schemaPath=c+"["+M+"]",_.errSchemaPath=u+"/"+M,_.errorPath=e.util.getPathExpr(e.errorPath,M,e.opts.jsonPointers,true),_.dataPathArr[I]=M;var k=e.validate(_);_.baseId=R,e.util.varOccurences(k,S)<2?r+=" "+e.util.varReplace(k,S,O)+" ":r+=" var "+S+" = "+O+"; "+k+" ",r+=" } ",h&&(r+=" if ("+g+") { ",b+="}");}}if(typeof $=="object"&&(e.opts.strictKeywords?typeof $=="object"&&Object.keys($).length>0||$===false:e.util.schemaHasRules($,e.RULES.all))){_.schema=$,_.schemaPath=e.schemaPath+".additionalItems",_.errSchemaPath=e.errSchemaPath+"/additionalItems",r+=" "+g+" = true; if ("+p+".length > "+i.length+") { for (var "+x+" = "+i.length+"; "+x+" < "+p+".length; "+x+"++) { ",_.errorPath=e.util.getPathExpr(e.errorPath,x,e.opts.jsonPointers,true);var O=p+"["+x+"]";_.dataPathArr[I]=x;var k=e.validate(_);_.baseId=R,e.util.varOccurences(k,S)<2?r+=" "+e.util.varReplace(k,S,O)+" ":r+=" var "+S+" = "+O+"; "+k+" ",h&&(r+=" if (!"+g+") break; "),r+=" } } ",h&&(r+=" if ("+g+") { ",b+="}");}}else if(e.opts.strictKeywords?typeof i=="object"&&Object.keys(i).length>0||i===false:e.util.schemaHasRules(i,e.RULES.all)){_.schema=i,_.schemaPath=c,_.errSchemaPath=u,r+=" for (var "+x+" = 0; "+x+" < "+p+".length; "+x+"++) { ",_.errorPath=e.util.getPathExpr(e.errorPath,x,e.opts.jsonPointers,true);var O=p+"["+x+"]";_.dataPathArr[I]=x;var k=e.validate(_);_.baseId=R,e.util.varOccurences(k,S)<2?r+=" "+e.util.varReplace(k,S,O)+" ":r+=" var "+S+" = "+O+"; "+k+" ",h&&(r+=" if (!"+g+") break; "),r+=" }";}return h&&(r+=" "+b+" if ("+d+" == errors) {"),r};});var as=Q((jh,pi)=>{pi.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,R,p="data"+(o||""),y=e.opts.$data&&i&&i.$data,d;y?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",d="schema"+n):d=i;var _=t=="maximum",b=_?"exclusiveMaximum":"exclusiveMinimum",g=e.schema[b],x=e.opts.$data&&g&&g.$data,I=_?"<":">",S=_?">":"<",R=void 0;if(!(y||typeof i=="number"||i===void 0))throw new Error(t+" must be number");if(!(x||g===void 0||typeof g=="number"||typeof g=="boolean"))throw new Error(b+" must be number or boolean");if(x){var $=e.util.getData(g.$data,o,e.dataPathArr),A="exclusive"+n,V="exclType"+n,q="exclIsNumber"+n,C="op"+n,z="' + "+C+" + '";r+=" var schemaExcl"+n+" = "+$+"; ",$="schemaExcl"+n,r+=" var "+A+"; var "+V+" = typeof "+$+"; if ("+V+" != 'boolean' && "+V+" != 'undefined' && "+V+" != 'number') { ";var R=b,M=M||[];M.push(r),r="",e.createErrors!==false?(r+=" { keyword: '"+(R||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==false&&(r+=" , message: '"+b+" should be boolean' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var L=r;r=M.pop(),!e.compositeRule&&h?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 ( ",y&&(r+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),r+=" "+V+" == 'number' ? ( ("+A+" = "+d+" === undefined || "+$+" "+I+"= "+d+") ? "+p+" "+S+"= "+$+" : "+p+" "+S+" "+d+" ) : ( ("+A+" = "+$+" === true) ? "+p+" "+S+"= "+d+" : "+p+" "+S+" "+d+" ) || "+p+" !== "+p+") { var op"+n+" = "+A+" ? '"+I+"' : '"+I+"='; ",i===void 0&&(R=b,u=e.errSchemaPath+"/"+b,d=$,y=x);}else {var q=typeof g=="number",z=I;if(q&&y){var C="'"+z+"'";r+=" if ( ",y&&(r+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),r+=" ( "+d+" === undefined || "+g+" "+I+"= "+d+" ? "+p+" "+S+"= "+g+" : "+p+" "+S+" "+d+" ) || "+p+" !== "+p+") { ";}else {q&&i===void 0?(A=true,R=b,u=e.errSchemaPath+"/"+b,d=g,S+="="):(q&&(d=Math[_?"min":"max"](g,i)),g===(q?d:true)?(A=true,R=b,u=e.errSchemaPath+"/"+b,S+="="):(A=false,z+="="));var C="'"+z+"'";r+=" if ( ",y&&(r+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),r+=" "+p+" "+S+" "+d+" || "+p+" !== "+p+") { ";}}R=R||t;var M=M||[];M.push(r),r="",e.createErrors!==false?(r+=" { keyword: '"+(R||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+C+", limit: "+d+", exclusive: "+A+" } ",e.opts.messages!==false&&(r+=" , message: 'should be "+z+" ",y?r+="' + "+d:r+=""+d+"'"),e.opts.verbose&&(r+=" , schema: ",y?r+="validate.schema"+c:r+=""+i,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var L=r;return r=M.pop(),!e.compositeRule&&h?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+=" } ",h&&(r+=" else { "),r};});var ss=Q((Lh,mi)=>{mi.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,b,p="data"+(o||""),y=e.opts.$data&&i&&i.$data,d;if(y?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",d="schema"+n):d=i,!(y||typeof i=="number"))throw new Error(t+" must be number");var _=t=="maxItems"?">":"<";r+="if ( ",y&&(r+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),r+=" "+p+".length "+_+" "+d+") { ";var b=t,g=g||[];g.push(r),r="",e.createErrors!==false?(r+=" { keyword: '"+(b||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+d+" } ",e.opts.messages!==false&&(r+=" , message: 'should NOT have ",t=="maxItems"?r+="more":r+="fewer",r+=" than ",y?r+="' + "+d+" + '":r+=""+i,r+=" items' "),e.opts.verbose&&(r+=" , schema: ",y?r+="validate.schema"+c:r+=""+i,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var x=r;return r=g.pop(),!e.compositeRule&&h?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+="} ",h&&(r+=" else { "),r};});var ns=Q((Fh,vi)=>{vi.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,b,p="data"+(o||""),y=e.opts.$data&&i&&i.$data,d;if(y?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",d="schema"+n):d=i,!(y||typeof i=="number"))throw new Error(t+" must be number");var _=t=="maxLength"?">":"<";r+="if ( ",y&&(r+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),e.opts.unicode===false?r+=" "+p+".length ":r+=" ucs2length("+p+") ",r+=" "+_+" "+d+") { ";var b=t,g=g||[];g.push(r),r="",e.createErrors!==false?(r+=" { keyword: '"+(b||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+d+" } ",e.opts.messages!==false&&(r+=" , message: 'should NOT be ",t=="maxLength"?r+="longer":r+="shorter",r+=" than ",y?r+="' + "+d+" + '":r+=""+i,r+=" characters' "),e.opts.verbose&&(r+=" , schema: ",y?r+="validate.schema"+c:r+=""+i,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var x=r;return r=g.pop(),!e.compositeRule&&h?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+="} ",h&&(r+=" else { "),r};});var is=Q((Mh,gi)=>{gi.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,b,p="data"+(o||""),y=e.opts.$data&&i&&i.$data,d;if(y?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",d="schema"+n):d=i,!(y||typeof i=="number"))throw new Error(t+" must be number");var _=t=="maxProperties"?">":"<";r+="if ( ",y&&(r+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),r+=" Object.keys("+p+").length "+_+" "+d+") { ";var b=t,g=g||[];g.push(r),r="",e.createErrors!==false?(r+=" { keyword: '"+(b||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+d+" } ",e.opts.messages!==false&&(r+=" , message: 'should NOT have ",t=="maxProperties"?r+="more":r+="fewer",r+=" than ",y?r+="' + "+d+" + '":r+=""+i,r+=" properties' "),e.opts.verbose&&(r+=" , schema: ",y?r+="validate.schema"+c:r+=""+i,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var x=r;return r=g.pop(),!e.compositeRule&&h?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+="} ",h&&(r+=" else { "),r};});var _i=Q((qh,yi)=>{yi.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,p="data"+(o||""),y=e.opts.$data&&i&&i.$data,d;if(y?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",d="schema"+n):d=i,!(y||typeof i=="number"))throw new Error(t+" must be number");r+="var division"+n+";if (",y&&(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+=" ) ",y&&(r+=" ) "),r+=" ) { ";var _=_||[];_.push(r),r="",e.createErrors!==false?(r+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+d+" } ",e.opts.messages!==false&&(r+=" , message: 'should be multiple of ",y?r+="' + "+d:r+=""+d+"'"),e.opts.verbose&&(r+=" , schema: ",y?r+="validate.schema"+c:r+=""+i,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var b=r;return r=_.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+b+"]); ":r+=" validate.errors = ["+b+"]; return false; ":r+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",h&&(r+=" else { "),r};});var Ei=Q((zh,bi)=>{bi.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,p="data"+(o||""),y="errs__"+n,d=e.util.copy(e);d.level++;var _="valid"+d.level;if(e.opts.strictKeywords?typeof i=="object"&&Object.keys(i).length>0||i===false:e.util.schemaHasRules(i,e.RULES.all)){d.schema=i,d.schemaPath=c,d.errSchemaPath=u,r+=" var "+y+" = errors; ";var b=e.compositeRule;e.compositeRule=d.compositeRule=true,d.createErrors=false;var g;d.opts.allErrors&&(g=d.opts.allErrors,d.opts.allErrors=false),r+=" "+e.validate(d)+" ",d.createErrors=true,g&&(d.opts.allErrors=g),e.compositeRule=d.compositeRule=b,r+=" if ("+_+") { ";var x=x||[];x.push(r),r="",e.createErrors!==false?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==false&&(r+=" , message: 'should NOT be valid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var I=r;r=x.pop(),!e.compositeRule&&h?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+=" } else { errors = "+y+"; if (vErrors !== null) { if ("+y+") vErrors.length = "+y+"; else vErrors = null; } ",e.opts.allErrors&&(r+=" } ");}else r+=" var err = ",e.createErrors!==false?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==false&&(r+=" , message: 'should NOT be valid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",h&&(r+=" if (false) { ");return r};});var xi=Q((Hh,Pi)=>{Pi.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,p="data"+(o||""),y="valid"+n,d="errs__"+n,_=e.util.copy(e),b="";_.level++;var g="valid"+_.level,x=_.baseId,I="prevValid"+n,S="passingSchemas"+n;r+="var "+d+" = errors , "+I+" = false , "+y+" = false , "+S+" = null; ";var R=e.compositeRule;e.compositeRule=_.compositeRule=true;var $=i;if($)for(var A,V=-1,q=$.length-1;V<q;)A=$[V+=1],(e.opts.strictKeywords?typeof A=="object"&&Object.keys(A).length>0||A===false:e.util.schemaHasRules(A,e.RULES.all))?(_.schema=A,_.schemaPath=c+"["+V+"]",_.errSchemaPath=u+"/"+V,r+=" "+e.validate(_)+" ",_.baseId=x):r+=" var "+g+" = true; ",V&&(r+=" if ("+g+" && "+I+") { "+y+" = false; "+S+" = ["+S+", "+V+"]; } else { ",b+="}"),r+=" if ("+g+") { "+y+" = "+I+" = true; "+S+" = "+V+"; }";return e.compositeRule=_.compositeRule=R,r+=""+b+"if (!"+y+") { var err = ",e.createErrors!==false?(r+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { passingSchemas: "+S+" } ",e.opts.messages!==false&&(r+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&h&&(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 wi=Q((Vh,Si)=>{Si.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,p="data"+(o||""),y=e.opts.$data&&i&&i.$data,d;y?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",d="schema"+n):d=i;var _=y?"(new RegExp("+d+"))":e.usePattern(i);r+="if ( ",y&&(r+=" ("+d+" !== undefined && typeof "+d+" != 'string') || "),r+=" !"+_+".test("+p+") ) { ";var b=b||[];b.push(r),r="",e.createErrors!==false?(r+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { pattern: ",y?r+=""+d:r+=""+e.util.toQuotedString(i),r+=" } ",e.opts.messages!==false&&(r+=` , message: 'should match pattern "`,y?r+="' + "+d+" + '":r+=""+e.util.escapeQuotes(i),r+=`"' `),e.opts.verbose&&(r+=" , schema: ",y?r+="validate.schema"+c:r+=""+e.util.toQuotedString(i),r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var g=r;return r=b.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+g+"]); ":r+=" validate.errors = ["+g+"]; return false; ":r+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",h&&(r+=" else { "),r};});var Ti=Q((Uh,Ri)=>{Ri.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,p="data"+(o||""),y="errs__"+n,d=e.util.copy(e),_="";d.level++;var b="valid"+d.level,g="key"+n,x="idx"+n,I=d.dataLevel=e.dataLevel+1,S="data"+I,R="dataProperties"+n,$=Object.keys(i||{}).filter(re),A=e.schema.patternProperties||{},V=Object.keys(A).filter(re),q=e.schema.additionalProperties,C=$.length||V.length,z=q===false,M=typeof q=="object"&&Object.keys(q).length,L=e.opts.removeAdditional,O=z||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 X=e.util.toHash(le);function re(Ge){return Ge!=="__proto__"}if(r+="var "+y+" = errors;var "+b+" = true;",k&&(r+=" var "+R+" = undefined;"),O){if(k?r+=" "+R+" = "+R+" || Object.keys("+p+"); for (var "+x+"=0; "+x+"<"+R+".length; "+x+"++) { var "+g+" = "+R+"["+x+"]; ":r+=" for (var "+g+" in "+p+") { ",C){if(r+=" var isAdditional"+n+" = !(false ",$.length)if($.length>8)r+=" || validate.schema"+c+".hasOwnProperty("+g+") ";else {var W=$;if(W)for(var U,ve=-1,Re=W.length-1;ve<Re;)U=W[ve+=1],r+=" || "+g+" == "+e.util.toQuotedString(U)+" ";}if(V.length){var Ie=V;if(Ie)for(var se,_e=-1,xe=Ie.length-1;_e<xe;)se=Ie[_e+=1],r+=" || "+e.usePattern(se)+".test("+g+") ";}r+=" ); if (isAdditional"+n+") { ";}if(L=="all")r+=" delete "+p+"["+g+"]; ";else {var $e=e.errorPath,vr="' + "+g+" + '";if(e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers)),z)if(L)r+=" delete "+p+"["+g+"]; ";else {r+=" "+b+" = false; ";var ir=u;u=e.errSchemaPath+"/additionalProperties";var be=be||[];be.push(r),r="",e.createErrors!==false?(r+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { additionalProperty: '"+vr+"' } ",e.opts.messages!==false&&(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 ge=r;r=be.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+ge+"]); ":r+=" validate.errors = ["+ge+"]; return false; ":r+=" var err = "+ge+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u=ir,h&&(r+=" break; ");}else if(M)if(L=="failing"){r+=" var "+y+" = errors; ";var wr=e.compositeRule;e.compositeRule=d.compositeRule=true,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,g,e.opts.jsonPointers);var Te=p+"["+g+"]";d.dataPathArr[I]=g;var ie=e.validate(d);d.baseId=F,e.util.varOccurences(ie,S)<2?r+=" "+e.util.varReplace(ie,S,Te)+" ":r+=" var "+S+" = "+Te+"; "+ie+" ",r+=" if (!"+b+") { errors = "+y+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+p+"["+g+"]; } ",e.compositeRule=d.compositeRule=wr;}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,g,e.opts.jsonPointers);var Te=p+"["+g+"]";d.dataPathArr[I]=g;var ie=e.validate(d);d.baseId=F,e.util.varOccurences(ie,S)<2?r+=" "+e.util.varReplace(ie,S,Te)+" ":r+=" var "+S+" = "+Te+"; "+ie+" ",h&&(r+=" if (!"+b+") break; ");}e.errorPath=$e;}C&&(r+=" } "),r+=" } ",h&&(r+=" if ("+b+") { ",_+="}");}var gr=e.opts.useDefaults&&!e.compositeRule;if($.length){var or=$;if(or)for(var U,Rr=-1,Tr=or.length-1;Rr<Tr;){U=or[Rr+=1];var Se=i[U];if(e.opts.strictKeywords?typeof Se=="object"&&Object.keys(Se).length>0||Se===false:e.util.schemaHasRules(Se,e.RULES.all)){var ze=e.util.getProperty(U),Te=p+ze,ke=gr&&Se.default!==void 0;d.schema=Se,d.schemaPath=c+ze,d.errSchemaPath=u+"/"+e.util.escapeFragment(U),d.errorPath=e.util.getPath(e.errorPath,U,e.opts.jsonPointers),d.dataPathArr[I]=e.util.toQuotedString(U);var ie=e.validate(d);if(d.baseId=F,e.util.varOccurences(ie,S)<2){ie=e.util.varReplace(ie,S,Te);var Ae=Te;}else {var Ae=S;r+=" var "+S+" = "+Te+"; ";}if(ke)r+=" "+ie+" ";else {if(X&&X[U]){r+=" if ( "+Ae+" === undefined ",k&&(r+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(U)+"') "),r+=") { "+b+" = false; ";var $e=e.errorPath,ir=u,Ye=e.util.escapeQuotes(U);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath($e,U,e.opts.jsonPointers)),u=e.errSchemaPath+"/required";var be=be||[];be.push(r),r="",e.createErrors!==false?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+Ye+"' } ",e.opts.messages!==false&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+Ye+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var ge=r;r=be.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+ge+"]); ":r+=" validate.errors = ["+ge+"]; return false; ":r+=" var err = "+ge+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u=ir,e.errorPath=$e,r+=" } else { ";}else h?(r+=" if ( "+Ae+" === undefined ",k&&(r+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(U)+"') "),r+=") { "+b+" = true; } else { "):(r+=" if ("+Ae+" !== undefined ",k&&(r+=" && Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(U)+"') "),r+=" ) { ");r+=" "+ie+" } ";}}h&&(r+=" if ("+b+") { ",_+="}");}}if(V.length){var Fe=V;if(Fe)for(var se,wt=-1,Sa=Fe.length-1;wt<Sa;){se=Fe[wt+=1];var Se=A[se];if(e.opts.strictKeywords?typeof Se=="object"&&Object.keys(Se).length>0||Se===false: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+=" "+R+" = "+R+" || Object.keys("+p+"); for (var "+x+"=0; "+x+"<"+R+".length; "+x+"++) { var "+g+" = "+R+"["+x+"]; ":r+=" for (var "+g+" in "+p+") { ",r+=" if ("+e.usePattern(se)+".test("+g+")) { ",d.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers);var Te=p+"["+g+"]";d.dataPathArr[I]=g;var ie=e.validate(d);d.baseId=F,e.util.varOccurences(ie,S)<2?r+=" "+e.util.varReplace(ie,S,Te)+" ":r+=" var "+S+" = "+Te+"; "+ie+" ",h&&(r+=" if (!"+b+") break; "),r+=" } ",h&&(r+=" else "+b+" = true; "),r+=" } ",h&&(r+=" if ("+b+") { ",_+="}");}}}return h&&(r+=" "+_+" if ("+y+" == errors) {"),r};});var Ii=Q((Zh,Oi)=>{Oi.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,p="data"+(o||""),y="errs__"+n,d=e.util.copy(e),_="";d.level++;var b="valid"+d.level;if(r+="var "+y+" = errors;",e.opts.strictKeywords?typeof i=="object"&&Object.keys(i).length>0||i===false:e.util.schemaHasRules(i,e.RULES.all)){d.schema=i,d.schemaPath=c,d.errSchemaPath=u;var g="key"+n,x="idx"+n,I="i"+n,S="' + "+g+" + '",R=d.dataLevel=e.dataLevel+1,$="data"+R,A="dataProperties"+n,V=e.opts.ownProperties,q=e.baseId;V&&(r+=" var "+A+" = undefined; "),V?r+=" "+A+" = "+A+" || Object.keys("+p+"); for (var "+x+"=0; "+x+"<"+A+".length; "+x+"++) { var "+g+" = "+A+"["+x+"]; ":r+=" for (var "+g+" in "+p+") { ",r+=" var startErrs"+n+" = errors; ";var C=g,z=e.compositeRule;e.compositeRule=d.compositeRule=true;var M=e.validate(d);d.baseId=q,e.util.varOccurences(M,$)<2?r+=" "+e.util.varReplace(M,$,C)+" ":r+=" var "+$+" = "+C+"; "+M+" ",e.compositeRule=d.compositeRule=z,r+=" if (!"+b+") { for (var "+I+"=startErrs"+n+"; "+I+"<errors; "+I+"++) { vErrors["+I+"].propertyName = "+g+"; } var err = ",e.createErrors!==false?(r+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { propertyName: '"+S+"' } ",e.opts.messages!==false&&(r+=" , message: 'property name \\'"+S+"\\' is invalid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&h&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),h&&(r+=" break; "),r+=" } }";}return h&&(r+=" "+_+" if ("+y+" == errors) {"),r};});var Ai=Q((Bh,$i)=>{$i.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,p="data"+(o||""),y="valid"+n,d=e.opts.$data&&i&&i.$data;d?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ","schema"+n):i;var b="schema"+n;if(!d)if(i.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var g=[],x=i;if(x)for(var I,S=-1,R=x.length-1;S<R;){I=x[S+=1];var $=e.schema.properties[I];$&&(e.opts.strictKeywords?typeof $=="object"&&Object.keys($).length>0||$===false:e.util.schemaHasRules($,e.RULES.all))||(g[g.length]=I);}}else var g=i;if(d||g.length){var A=e.errorPath,V=d||g.length>=e.opts.loopRequired,q=e.opts.ownProperties;if(h)if(r+=" var missing"+n+"; ",V){d||(r+=" var "+b+" = validate.schema"+c+"; ");var C="i"+n,z="schema"+n+"["+C+"]",M="' + "+z+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(A,z,e.opts.jsonPointers)),r+=" var "+y+" = true; ",d&&(r+=" if (schema"+n+" === undefined) "+y+" = true; else if (!Array.isArray(schema"+n+")) "+y+" = false; else {"),r+=" for (var "+C+" = 0; "+C+" < "+b+".length; "+C+"++) { "+y+" = "+p+"["+b+"["+C+"]] !== undefined ",q&&(r+=" && Object.prototype.hasOwnProperty.call("+p+", "+b+"["+C+"]) "),r+="; if (!"+y+") break; } ",d&&(r+=" } "),r+=" if (!"+y+") { ";var L=L||[];L.push(r),r="",e.createErrors!==false?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+M+"' } ",e.opts.messages!==false&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+M+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var O=r;r=L.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+O+"]); ":r+=" validate.errors = ["+O+"]; return false; ":r+=" var err = "+O+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { ";}else {r+=" if ( ";var k=g;if(k)for(var F,C=-1,le=k.length-1;C<le;){F=k[C+=1],C&&(r+=" || ");var X=e.util.getProperty(F),re=p+X;r+=" ( ( "+re+" === undefined ",q&&(r+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(F)+"') "),r+=") && (missing"+n+" = "+e.util.toQuotedString(e.opts.jsonPointers?F:X)+") ) ";}r+=") { ";var z="missing"+n,M="' + "+z+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(A,z,true):A+" + "+z);var L=L||[];L.push(r),r="",e.createErrors!==false?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+M+"' } ",e.opts.messages!==false&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+M+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var O=r;r=L.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+O+"]); ":r+=" validate.errors = ["+O+"]; return false; ":r+=" var err = "+O+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { ";}else if(V){d||(r+=" var "+b+" = validate.schema"+c+"; ");var C="i"+n,z="schema"+n+"["+C+"]",M="' + "+z+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(A,z,e.opts.jsonPointers)),d&&(r+=" if ("+b+" && !Array.isArray("+b+")) { var err = ",e.createErrors!==false?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+M+"' } ",e.opts.messages!==false&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+M+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+b+" !== undefined) { "),r+=" for (var "+C+" = 0; "+C+" < "+b+".length; "+C+"++) { if ("+p+"["+b+"["+C+"]] === undefined ",q&&(r+=" || ! Object.prototype.hasOwnProperty.call("+p+", "+b+"["+C+"]) "),r+=") { var err = ",e.createErrors!==false?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+M+"' } ",e.opts.messages!==false&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+M+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , 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=g;if(W)for(var F,U=-1,ve=W.length-1;U<ve;){F=W[U+=1];var X=e.util.getProperty(F),M=e.util.escapeQuotes(F),re=p+X;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(A,F,e.opts.jsonPointers)),r+=" if ( "+re+" === undefined ",q&&(r+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(F)+"') "),r+=") { var err = ",e.createErrors!==false?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+M+"' } ",e.opts.messages!==false&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+M+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } ";}}e.errorPath=A;}else h&&(r+=" if (true) {");return r};});var ki=Q((Qh,Ci)=>{Ci.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,p="data"+(o||""),y="valid"+n,d=e.opts.$data&&i&&i.$data,_;if(d?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",_="schema"+n):_=i,(i||d)&&e.opts.uniqueItems!==false){d&&(r+=" var "+y+"; if ("+_+" === false || "+_+" === undefined) "+y+" = true; else if (typeof "+_+" != 'boolean') "+y+" = false; else { "),r+=" var i = "+p+".length , "+y+" = true , j; if (i > 1) { ";var b=e.schema.items&&e.schema.items.type,g=Array.isArray(b);if(!b||b=="object"||b=="array"||g&&(b.indexOf("object")>=0||b.indexOf("array")>=0))r+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+p+"[i], "+p+"[j])) { "+y+" = false; break outer; } } } ";else {r+=" var itemIndices = {}, item; for (;i--;) { var item = "+p+"[i]; ";var x="checkDataType"+(g?"s":"");r+=" if ("+e.util[x](b,"item",e.opts.strictNumbers,true)+") continue; ",g&&(r+=` if (typeof item == 'string') item = '"' + item; `),r+=" if (typeof itemIndices[item] == 'number') { "+y+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } ";}r+=" } ",d&&(r+=" } "),r+=" if (!"+y+") { ";var I=I||[];I.push(r),r="",e.createErrors!==false?(r+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",e.opts.messages!==false&&(r+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(r+=" , schema: ",d?r+="validate.schema"+c:r+=""+i,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var S=r;r=I.pop(),!e.compositeRule&&h?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+=" } ",h&&(r+=" else { ");}else h&&(r+=" if (true) { ");return r};});var Ni=Q((Gh,Di)=>{Di.exports={$ref:Qn(),allOf:Kn(),anyOf:Wn(),$comment:Yn(),const:ri(),contains:ai(),dependencies:ni(),enum:oi(),format:ci(),if:di(),items:hi(),maximum:as(),minimum:as(),maxItems:ss(),minItems:ss(),maxLength:ns(),minLength:ns(),maxProperties:is(),minProperties:is(),multipleOf:_i(),not:Ei(),oneOf:xi(),pattern:wi(),properties:Ti(),propertyNames:Ii(),required:Ai(),uniqueItems:ki(),validate:rs()};});var Fi=Q((Kh,Li)=>{var ji=Ni(),os=Qr().toHash;Li.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=os(t),e.types=os(r),e.forEach(function(n){n.rules=n.rules.map(function(o){var i;if(typeof o=="object"){var c=Object.keys(o)[0];i=o[c],o=c,i.forEach(function(h){t.push(h),e.all[h]=true;});}t.push(o);var u=e.all[o]={keyword:o,code:ji[o],implements:i};return u}),e.all.$comment={keyword:"$comment",code:ji.$comment},n.type&&(e.types[n.type]=n);}),e.keywords=os(t.concat(s)),e.custom={},e};});var zi=Q((Jh,qi)=>{var Mi=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];qi.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<Mi.length;n++){var o=Mi[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 Ui=Q((Wh,Vi)=>{var gd=oa().MissingRef;Vi.exports=Hi;function Hi(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 c=i.$schema;return c&&!s.getSchema(c)?Hi.call(s,{$ref:c},true):Promise.resolve()}function o(i){try{return s._compile(i)}catch(u){if(u instanceof gd)return c(u);throw u}function c(u){var h=u.missingSchema;if(d(h))throw new Error("Schema "+h+" is loaded but "+u.missingRef+" cannot be resolved");var p=s._loadingSchemas[h];return p||(p=s._loadingSchemas[h]=s._opts.loadSchema(h),p.then(y,y)),p.then(function(_){if(!d(h))return n(_).then(function(){d(h)||s.addSchema(_,h,void 0,e);})}).then(function(){return o(i)});function y(){delete s._loadingSchemas[h];}function d(_){return s._refs[_]||s._schemas[_]}}}}});var Bi=Q((Xh,Zi)=>{Zi.exports=function(e,t,s){var r=" ",n=e.level,o=e.dataLevel,i=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,p,y="data"+(o||""),d="valid"+n,_="errs__"+n,b=e.opts.$data&&i&&i.$data,g;b?(r+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",g="schema"+n):g=i;var x=this,I="definition"+n,S=x.definition,R="",$,A,V,q,C;if(b&&S.$data){C="keywordValidate"+n;var z=S.validateSchema;r+=" var "+I+" = RULES.custom['"+t+"'].definition; var "+C+" = "+I+".validate;";}else {if(q=e.useCustomRule(x,i,e.schema,e),!q)return;g="validate.schema"+c,C=q.code,$=S.compile,A=S.inline,V=S.macro;}var M=C+".errors",L="i"+n,O="ruleErr"+n,k=S.async;if(k&&!e.async)throw new Error("async keyword in sync schema");if(A||V||(r+=""+M+" = null;"),r+="var "+_+" = errors;var "+d+";",b&&S.$data&&(R+="}",r+=" if ("+g+" === undefined) { "+d+" = true; } else { ",z&&(R+="}",r+=" "+d+" = "+I+".validateSchema("+g+"); if ("+d+") { ")),A)S.statements?r+=" "+q.validate+" ":r+=" "+d+" = "+q.validate+"; ";else if(V){var F=e.util.copy(e),R="";F.level++;var le="valid"+F.level;F.schema=q.validate,F.schemaPath="";var X=e.compositeRule;e.compositeRule=F.compositeRule=true;var re=e.validate(F).replace(/validate\.schema/g,C);e.compositeRule=F.compositeRule=X,r+=" "+re;}else {var W=W||[];W.push(r),r="",r+=" "+C+".call( ",e.opts.passContext?r+="this":r+="self",$||S.schema===false?r+=" , "+y+" ":r+=" , "+g+" , "+y+" , validate.schema"+e.schemaPath+" ",r+=" , (dataPath || '')",e.errorPath!='""'&&(r+=" + "+e.errorPath);var U=o?"data"+(o-1||""):"parentData",ve=o?e.dataPathArr[o]:"parentDataProperty";r+=" , "+U+" , "+ve+" , rootData ) ";var Re=r;r=W.pop(),S.errors===false?(r+=" "+d+" = ",k&&(r+="await "),r+=""+Re+"; "):k?(M="customErrors"+n,r+=" var "+M+" = null; try { "+d+" = await "+Re+"; } catch (e) { "+d+" = false; if (e instanceof ValidationError) "+M+" = e.errors; else throw e; } "):r+=" "+M+" = null; "+d+" = "+Re+"; ";}if(S.modifying&&(r+=" if ("+U+") "+y+" = "+U+"["+ve+"];"),r+=""+R,S.valid)h&&(r+=" if (true) { ");else {r+=" if ( ",S.valid===void 0?(r+=" !",V?r+=""+le:r+=""+d):r+=" "+!S.valid+" ",r+=") { ",p=x.keyword;var W=W||[];W.push(r),r="";var W=W||[];W.push(r),r="",e.createErrors!==false?(r+=" { keyword: '"+(p||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { keyword: '"+x.keyword+"' } ",e.opts.messages!==false&&(r+=` , message: 'should pass "`+x.keyword+`" keyword validation' `),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+y+" "),r+=" } "):r+=" {} ";var Ie=r;r=W.pop(),!e.compositeRule&&h?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(),A?S.errors?S.errors!="full"&&(r+=" for (var "+L+"="+_+"; "+L+"<errors; "+L+"++) { var "+O+" = vErrors["+L+"]; if ("+O+".dataPath === undefined) "+O+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+O+".schemaPath === undefined) { "+O+'.schemaPath = "'+u+'"; } ',e.opts.verbose&&(r+=" "+O+".schema = "+g+"; "+O+".data = "+y+"; "),r+=" } "):S.errors===false?r+=" "+se+" ":(r+=" if ("+_+" == errors) { "+se+" } else { for (var "+L+"="+_+"; "+L+"<errors; "+L+"++) { var "+O+" = vErrors["+L+"]; if ("+O+".dataPath === undefined) "+O+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+O+".schemaPath === undefined) { "+O+'.schemaPath = "'+u+'"; } ',e.opts.verbose&&(r+=" "+O+".schema = "+g+"; "+O+".data = "+y+"; "),r+=" } } "):V?(r+=" var err = ",e.createErrors!==false?(r+=" { keyword: '"+(p||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { keyword: '"+x.keyword+"' } ",e.opts.messages!==false&&(r+=` , message: 'should pass "`+x.keyword+`" keyword validation' `),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+y+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&h&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; ")):S.errors===false?r+=" "+se+" ":(r+=" if (Array.isArray("+M+")) { if (vErrors === null) vErrors = "+M+"; else vErrors = vErrors.concat("+M+"); errors = vErrors.length; for (var "+L+"="+_+"; "+L+"<errors; "+L+"++) { var "+O+" = vErrors["+L+"]; if ("+O+".dataPath === undefined) "+O+".dataPath = (dataPath || '') + "+e.errorPath+"; "+O+'.schemaPath = "'+u+'"; ',e.opts.verbose&&(r+=" "+O+".schema = "+g+"; "+O+".data = "+y+"; "),r+=" } } else { "+se+" } "),r+=" } ",h&&(r+=" else { ");}return r};});var ls=Q((Yh,yd)=>{yd.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:true,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:true,readOnly:{type:"boolean",default:false},examples:{type:"array",items:true},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:true},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:false},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:true,enum:{type:"array",items:true,minItems:1,uniqueItems:true},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:true}]},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:true};});var Ki=Q((ep,Gi)=>{var Qi=ls();Gi.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:Qi.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:Qi.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 Wi=Q((rp,Ji)=>{var _d=/^[a-z_$][a-z0-9_$-]*$/i,bd=Bi(),Ed=Ki();Ji.exports={add:Pd,get:xd,remove:Sd,validate:cs};function Pd(a,e){var t=this.RULES;if(t.keywords[a])throw new Error("Keyword "+a+" is already defined");if(!_d.test(a))throw new Error("Keyword "+a+" is not a valid identifier");if(e){this.validateKeyword(e,true);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,true));}t.keywords[a]=t.all[a]=true;function o(i,c,u){for(var h,p=0;p<t.length;p++){var y=t[p];if(y.type==c){h=y;break}}h||(h={type:c,rules:[]},t.push(h));var d={keyword:i,definition:u,custom:true,code:bd,implements:u.implements};h.rules.push(d),t.custom[i]=d;}return this}function xd(a){var e=this.RULES.custom[a];return e?e.definition:this.RULES.keywords[a]||false}function Sd(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 cs(a,e){cs.errors=null;var t=this._validateKeyword=this._validateKeyword||this.compile(Ed,true);if(t(a))return true;if(cs.errors=t.errors,e)throw new Error("custom keyword definition is invalid: "+this.errorsText(t.errors));return false}});var Xi=Q((tp,wd)=>{wd.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:false};});var lo=Q((ap,oo)=>{var eo=An(),Gr=ia(),Rd=kn(),ro=Ga(),Td=es(),Od=Zn(),Id=Fi(),to=zi(),ao=Qr();oo.exports=ye;ye.prototype.validate=Ad;ye.prototype.compile=Cd;ye.prototype.addSchema=kd;ye.prototype.addMetaSchema=Dd;ye.prototype.validateSchema=Nd;ye.prototype.getSchema=Ld;ye.prototype.removeSchema=Md;ye.prototype.addFormat=Qd;ye.prototype.errorsText=Bd;ye.prototype._addSchema=qd;ye.prototype._compile=zd;ye.prototype.compileAsync=Ui();var ma=Wi();ye.prototype.addKeyword=ma.add;ye.prototype.getKeyword=ma.get;ye.prototype.removeKeyword=ma.remove;ye.prototype.validateKeyword=ma.validate;var so=oa();ye.ValidationError=so.Validation;ye.MissingRefError=so.MissingRef;ye.$dataMetaSchema=to;var pa="http://json-schema.org/draft-07/schema",Yi=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],$d=["/properties"];function ye(a){if(!(this instanceof ye))return new ye(a);a=this._opts=ao.copy(a)||{},Yd(this),this._schemas={},this._refs={},this._fragments={},this._formats=Od(a.format),this._cache=a.cache||new Rd,this._loadingSchemas={},this._compilations=[],this.RULES=Id(),this._getId=Hd(a),a.loopRequired=a.loopRequired||1/0,a.errorDataPath=="property"&&(a._errorDataPathProperty=true),a.serialize===void 0&&(a.serialize=Td),this._metaOpts=Xd(this),a.formats&&Jd(this),a.keywords&&Wd(this),Gd(this),typeof a.meta=="object"&&this.addMetaSchema(a.meta),a.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),Kd(this);}function Ad(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!==true&&(this.errors=t.errors),r}function Cd(a,e){var t=this._addSchema(a,void 0,e);return t.validate||this._compile(t)}function kd(a,e,t,s){if(Array.isArray(a)){for(var r=0;r<a.length;r++)this.addSchema(a[r],void 0,t,s);return this}var n=this._getId(a);if(n!==void 0&&typeof n!="string")throw new Error("schema id must be string");return e=Gr.normalizeId(e||n),io(this,e),this._schemas[e]=this._addSchema(a,t,s,true),this}function Dd(a,e,t){return this.addSchema(a,e,t,true),this}function Nd(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||jd(this),!t)return this.logger.warn("meta-schema not available"),this.errors=null,true;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 jd(a){var e=a._opts.meta;return a._opts.defaultMeta=typeof e=="object"?a._getId(e)||e:a.getSchema(pa)?pa:void 0,a._opts.defaultMeta}function Ld(a){var e=no(this,a);switch(typeof e){case "object":return e.validate||this._compile(e);case "string":return this.getSchema(e);case "undefined":return Fd(this,a)}}function Fd(a,e){var t=Gr.schema.call(a,{schema:{}},e);if(t){var s=t.schema,r=t.root,n=t.baseId,o=eo.call(a,s,r,void 0,n);return a._fragments[e]=new ro({ref:e,fragment:true,schema:s,root:r,baseId:n,validate:o}),o}}function no(a,e){return e=Gr.normalizeId(e),a._schemas[e]||a._refs[e]||a._fragments[e]}function Md(a){if(a instanceof RegExp)return ha(this,this._schemas,a),ha(this,this._refs,a),this;switch(typeof a){case "undefined":return ha(this,this._schemas),ha(this,this._refs),this._cache.clear(),this;case "string":var e=no(this,a);return e&&this._cache.del(e.cacheKey),delete this._schemas[a],delete this._refs[a],this;case "object":var t=this._opts.serialize,s=t?t(a):a;this._cache.del(s);var r=this._getId(a);r&&(r=Gr.normalizeId(r),delete this._schemas[r],delete this._refs[r]);}return this}function ha(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 qd(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!==false;var i=Gr.normalizeId(this._getId(a));i&&s&&io(this,i);var c=this._opts.validateSchema!==false&&!e,u;c&&!(u=i&&i==Gr.normalizeId(a.$schema))&&this.validateSchema(a,true);var h=Gr.ids.call(this,a),p=new ro({id:i,schema:a,localRefs:h,cacheKey:n,meta:t});return i[0]!="#"&&s&&(this._refs[i]=p),this._cache.put(n,p),c&&u&&this.validateSchema(a,true),p}function zd(a,e){if(a.compiling)return a.validate=r,r.schema=a.schema,r.errors=null,r.root=e||r,a.schema.$async===true&&(r.$async=true),r;a.compiling=true;var t;a.meta&&(t=this._opts,this._opts=this._metaOpts);var s;try{s=eo.call(this,a.schema,e,a.localRefs);}catch(n){throw delete a.validate,n}finally{a.compiling=false,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 Hd(a){switch(a.schemaId){case "auto":return Zd;case "id":return Vd;default:return Ud}}function Vd(a){return a.$id&&this.logger.warn("schema $id ignored",a.$id),a.id}function Ud(a){return a.id&&this.logger.warn("schema id ignored",a.id),a.$id}function Zd(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 Bd(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 Qd(a,e){return typeof e=="string"&&(e=new RegExp(e)),this._formats[a]=e,this}function Gd(a){var e;if(a._opts.$data&&(e=Xi(),a.addMetaSchema(e,e.$id,true)),a._opts.meta!==false){var t=ls();a._opts.$data&&(t=to(t,$d)),a.addMetaSchema(t,pa,true),a._refs["http://json-schema.org/schema"]=pa;}}function Kd(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 Jd(a){for(var e in a._opts.formats){var t=a._opts.formats[e];a.addFormat(e,t);}}function Wd(a){for(var e in a._opts.keywords){var t=a._opts.keywords[e];a.addKeyword(e,t);}}function io(a,e){if(a._schemas[e]||a._refs[e])throw new Error('schema with key or id "'+e+'" already exists')}function Xd(a){for(var e=ao.copy(a._opts),t=0;t<Yi.length;t++)delete e[Yi[t]];return e}function Yd(a){var e=a._opts.logger;if(e===false)a.logger={log:us,warn:us,error:us};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 us(){}});var l={};gl(l,{BRAND:()=>Zl,DIRTY:()=>Ar,EMPTY_PATH:()=>xl,INVALID:()=>Z,NEVER:()=>Ic,OK:()=>Oe,ParseStatus:()=>we,Schema:()=>K,ZodAny:()=>br,ZodArray:()=>mr,ZodBigInt:()=>kr,ZodBoolean:()=>Dr,ZodBranded:()=>_t,ZodCatch:()=>Zr,ZodDate:()=>Nr,ZodDefault:()=>Ur,ZodDiscriminatedUnion:()=>Ct,ZodEffects:()=>Ze,ZodEnum:()=>Hr,ZodError:()=>De,ZodFirstPartyTypeKind:()=>T,ZodFunction:()=>Dt,ZodIntersection:()=>Mr,ZodIssueCode:()=>w,ZodLazy:()=>qr,ZodLiteral:()=>zr,ZodMap:()=>ot,ZodNaN:()=>ct,ZodNativeEnum:()=>Vr,ZodNever:()=>Ke,ZodNull:()=>Lr,ZodNullable:()=>sr,ZodNumber:()=>Cr,ZodObject:()=>je,ZodOptional:()=>Ne,ZodParsedType:()=>N,ZodPipeline:()=>bt,ZodPromise:()=>Er,ZodReadonly:()=>Br,ZodRecord:()=>kt,ZodSchema:()=>K,ZodSet:()=>lt,ZodString:()=>_r,ZodSymbol:()=>nt,ZodTransformer:()=>Ze,ZodTuple:()=>ar,ZodType:()=>K,ZodUndefined:()=>jr,ZodUnion:()=>Fr,ZodUnknown:()=>pr,ZodVoid:()=>it,addIssueToContext:()=>D,any:()=>ec,array:()=>sc,bigint:()=>Kl,boolean:()=>Ms,coerce:()=>Oc,custom:()=>js,date:()=>Jl,datetimeRegex:()=>Ds,defaultErrorMap:()=>fr,discriminatedUnion:()=>lc,effect:()=>bc,enum:()=>gc,function:()=>pc,getErrorMap:()=>tt,getParsedType:()=>tr,instanceof:()=>Ql,intersection:()=>cc,isAborted:()=>$t,isAsync:()=>at,isDirty:()=>At,isValid:()=>yr,late:()=>Bl,lazy:()=>mc,literal:()=>vc,makeIssue:()=>yt,map:()=>fc,nan:()=>Gl,nativeEnum:()=>yc,never:()=>tc,null:()=>Yl,nullable:()=>Pc,number:()=>Fs,object:()=>nc,objectUtil:()=>Oa,oboolean:()=>Tc,onumber:()=>Rc,optional:()=>Ec,ostring:()=>wc,pipeline:()=>Sc,preprocess:()=>xc,promise:()=>_c,quotelessJson:()=>bl,record:()=>dc,set:()=>hc,setErrorMap:()=>Pl,strictObject:()=>ic,string:()=>Ls,symbol:()=>Wl,transformer:()=>bc,tuple:()=>uc,undefined:()=>Xl,union:()=>oc,unknown:()=>rc,util:()=>Y,void:()=>ac});var Y;(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;})(Y||(Y={}));var Oa;(function(a){a.mergeShapes=(e,t)=>({...e,...t});})(Oa||(Oa={}));var N=Y.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),tr=a=>{switch(typeof a){case "undefined":return N.undefined;case "string":return N.string;case "number":return Number.isNaN(a)?N.nan:N.number;case "boolean":return N.boolean;case "function":return N.function;case "bigint":return N.bigint;case "symbol":return N.symbol;case "object":return Array.isArray(a)?N.array:a===null?N.null:a.then&&typeof a.then=="function"&&a.catch&&typeof a.catch=="function"?N.promise:typeof Map!="undefined"&&a instanceof Map?N.map:typeof Set!="undefined"&&a instanceof Set?N.set:typeof Date!="undefined"&&a instanceof Date?N.date:N.object;default:return N.unknown}};var w=Y.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"]),bl=a=>JSON.stringify(a,null,2).replace(/"([^"]+)":/g,"$1:"),De=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,c=0;for(;c<o.path.length;){let u=o.path[c];c===o.path.length-1?(i[u]=i[u]||{_errors:[]},i[u]._errors.push(t(o))):i[u]=i[u]||{_errors:[]},i=i[u],c++;}}};return r(this),s}static assert(e){if(!(e instanceof a))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Y.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()}};De.create=a=>new De(a);var El=(a,e)=>{let t;switch(a.code){case w.invalid_type:a.received===N.undefined?t="Required":t=`Expected ${a.expected}, received ${a.received}`;break;case w.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(a.expected,Y.jsonStringifyReplacer)}`;break;case w.unrecognized_keys:t=`Unrecognized key(s) in object: ${Y.joinValues(a.keys,", ")}`;break;case w.invalid_union:t="Invalid input";break;case w.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${Y.joinValues(a.options)}`;break;case w.invalid_enum_value:t=`Invalid enum value. Expected ${Y.joinValues(a.options)}, received '${a.received}'`;break;case w.invalid_arguments:t="Invalid function arguments";break;case w.invalid_return_type:t="Invalid function return type";break;case w.invalid_date:t="Invalid date";break;case w.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}"`:Y.assertNever(a.validation):a.validation!=="regex"?t=`Invalid ${a.validation}`:t="Invalid";break;case w.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 w.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 w.custom:t="Invalid input";break;case w.invalid_intersection_types:t="Intersection results could not be merged";break;case w.not_multiple_of:t=`Number must be a multiple of ${a.multipleOf}`;break;case w.not_finite:t="Number must be finite";break;default:t=e.defaultError,Y.assertNever(a);}return {message:t}},fr=El;var Is=fr;function Pl(a){Is=a;}function tt(){return Is}var yt=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="",c=s.filter(u=>!!u).slice().reverse();for(let u of c)i=u(o,{data:e,defaultError:i}).message;return {...r,path:n,message:i}},xl=[];function D(a,e){let t=tt(),s=yt({issueData:e,data:a.data,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,t,t===fr?void 0:fr].filter(r=>!!r)});a.common.issues.push(s);}var we=class a{constructor(){this.value="valid";}dirty(){this.value==="valid"&&(this.value="dirty");}abort(){this.value!=="aborted"&&(this.value="aborted");}static mergeArray(e,t){let s=[];for(let r of t){if(r.status==="aborted")return Z;r.status==="dirty"&&e.dirty(),s.push(r.value);}return {status:e.value,value:s}}static async mergeObjectAsync(e,t){let s=[];for(let r of t){let n=await r.key,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 Z;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}}},Z=Object.freeze({status:"aborted"}),Ar=a=>({status:"dirty",value:a}),Oe=a=>({status:"valid",value:a}),$t=a=>a.status==="aborted",At=a=>a.status==="dirty",yr=a=>a.status==="valid",at=a=>typeof Promise!="undefined"&&a instanceof Promise;var H;(function(a){a.errToObj=e=>typeof e=="string"?{message:e}:e||{},a.toString=e=>typeof e=="string"?e:e==null?void 0:e.message;})(H||(H={}));var Ue=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}},$s=(a,e)=>{if(yr(e))return {success:true,data:e.value};if(!a.common.issues.length)throw new Error("Validation failed but no issues detected.");return {success:false,get error(){if(this._error)return this._error;let t=new De(a.common.issues);return this._error=t,this._error}}};function G(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 u,h;let{message:c}=a;return o.code==="invalid_enum_value"?{message:c!=null?c:i.defaultError}:typeof i.data=="undefined"?{message:(u=c!=null?c:s)!=null?u:i.defaultError}:o.code!=="invalid_type"?{message:i.defaultError}:{message:(h=c!=null?c:t)!=null?h:i.defaultError}},description:r}}var K=class{get description(){return this._def.description}_getType(e){return tr(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:tr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return {status:new we,ctx:{common:e.parent.common,data:e.data,parsedType:tr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(at(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:false,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:tr(e)},r=this._parseSync({data:e,path:s.path,parent:s});return $s(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:tr(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:t});return yr(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=true),t.common={issues:[],async:true};}return this._parseAsync({data:e,path:[],parent:t}).then(n=>yr(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:true},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:tr(e)},r=this._parse({data:e,path:s.path,parent:s}),n=await(at(r)?r:Promise.resolve(r));return $s(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:w.custom,...s(r)});return typeof Promise!="undefined"&&o instanceof Promise?o.then(c=>c?true:(i(),false)):o?true:(i(),false)})}refinement(e,t){return this._refinement((s,r)=>e(s)?true:(r.addIssue(typeof t=="function"?t(s,r):t),false))}_refinement(e){return new Ze({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 Ne.create(this,this._def)}nullable(){return sr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return mr.create(this)}promise(){return Er.create(this,this._def)}or(e){return Fr.create([this,e],this._def)}and(e){return Mr.create(this,e,this._def)}transform(e){return new Ze({...G(this._def),schema:this,typeName:T.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new Ur({...G(this._def),innerType:this,defaultValue:t,typeName:T.ZodDefault})}brand(){return new _t({typeName:T.ZodBranded,type:this,...G(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new Zr({...G(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 bt.create(this,e)}readonly(){return Br.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Sl=/^c[^\s-]{8,}$/i,wl=/^[0-9a-z]+$/,Rl=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Tl=/^[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,Ol=/^[a-z0-9_-]{21}$/i,Il=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,$l=/^[-+]?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)?)??$/,Al=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Cl="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ia,kl=/^(?:(?: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])$/,Dl=/^(?:(?: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])$/,Nl=/^(([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]))$/,jl=/^(([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])$/,Ll=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Fl=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Cs="((\\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])))",Ml=new RegExp(`^${Cs}$`);function ks(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 ql(a){return new RegExp(`^${ks(a)}$`)}function Ds(a){let e=`${Cs}T${ks(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 zl(a,e){return !!((e==="v4"||!e)&&kl.test(a)||(e==="v6"||!e)&&Nl.test(a))}function Hl(a,e){if(!Il.test(a))return false;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(t){return false}}function Vl(a,e){return !!((e==="v4"||!e)&&Dl.test(a)||(e==="v6"||!e)&&jl.test(a))}var _r=class a extends K{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==N.string){let n=this._getOrReturnCtx(e);return D(n,{code:w.invalid_type,expected:N.string,received:n.parsedType}),Z}let s=new we,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:w.too_small,minimum:n.value,type:"string",inclusive:true,exact:false,message:n.message}),s.dirty());else if(n.kind==="max")e.data.length>n.value&&(r=this._getOrReturnCtx(e,r),D(r,{code:w.too_big,maximum:n.value,type:"string",inclusive:true,exact:false,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:w.too_big,maximum:n.value,type:"string",inclusive:true,exact:true,message:n.message}):i&&D(r,{code:w.too_small,minimum:n.value,type:"string",inclusive:true,exact:true,message:n.message}),s.dirty());}else if(n.kind==="email")Al.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"email",code:w.invalid_string,message:n.message}),s.dirty());else if(n.kind==="emoji")Ia||(Ia=new RegExp(Cl,"u")),Ia.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"emoji",code:w.invalid_string,message:n.message}),s.dirty());else if(n.kind==="uuid")Tl.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"uuid",code:w.invalid_string,message:n.message}),s.dirty());else if(n.kind==="nanoid")Ol.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"nanoid",code:w.invalid_string,message:n.message}),s.dirty());else if(n.kind==="cuid")Sl.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"cuid",code:w.invalid_string,message:n.message}),s.dirty());else if(n.kind==="cuid2")wl.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"cuid2",code:w.invalid_string,message:n.message}),s.dirty());else if(n.kind==="ulid")Rl.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"ulid",code:w.invalid_string,message:n.message}),s.dirty());else if(n.kind==="url")try{new URL(e.data);}catch(o){r=this._getOrReturnCtx(e,r),D(r,{validation:"url",code:w.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:w.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:w.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:w.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:w.invalid_string,validation:{endsWith:n.value},message:n.message}),s.dirty()):n.kind==="datetime"?Ds(n).test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{code:w.invalid_string,validation:"datetime",message:n.message}),s.dirty()):n.kind==="date"?Ml.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{code:w.invalid_string,validation:"date",message:n.message}),s.dirty()):n.kind==="time"?ql(n).test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{code:w.invalid_string,validation:"time",message:n.message}),s.dirty()):n.kind==="duration"?$l.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"duration",code:w.invalid_string,message:n.message}),s.dirty()):n.kind==="ip"?zl(e.data,n.version)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"ip",code:w.invalid_string,message:n.message}),s.dirty()):n.kind==="jwt"?Hl(e.data,n.alg)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"jwt",code:w.invalid_string,message:n.message}),s.dirty()):n.kind==="cidr"?Vl(e.data,n.version)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"cidr",code:w.invalid_string,message:n.message}),s.dirty()):n.kind==="base64"?Ll.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"base64",code:w.invalid_string,message:n.message}),s.dirty()):n.kind==="base64url"?Fl.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"base64url",code:w.invalid_string,message:n.message}),s.dirty()):Y.assertNever(n);return {status:s.value,value:e.data}}_regex(e,t,s){return this.refinement(r=>e.test(r),{validation:t,code:w.invalid_string,...H.errToObj(s)})}_addCheck(e){return new a({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...H.errToObj(e)})}url(e){return this._addCheck({kind:"url",...H.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...H.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...H.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...H.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...H.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...H.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...H.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...H.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...H.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...H.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...H.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...H.errToObj(e)})}datetime(e){var t,s;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:false,local:false,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:false,local:(s=e==null?void 0:e.local)!=null?s:false,...H.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,...H.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...H.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...H.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...H.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...H.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...H.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...H.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...H.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...H.errToObj(t)})}nonempty(e){return this.min(1,H.errToObj(e))}trim(){return new a({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new a({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new a({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return !!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return !!this._def.checks.find(e=>e.kind==="date")}get isTime(){return !!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return !!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return !!this._def.checks.find(e=>e.kind==="email")}get isURL(){return !!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return !!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return !!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return !!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return !!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return !!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return !!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return !!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return !!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return !!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return !!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};_r.create=a=>{var e;return new _r({checks:[],typeName:T.ZodString,coerce:(e=a==null?void 0:a.coerce)!=null?e:false,...G(a)})};function Ul(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 Cr=class a extends K{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)!==N.number){let n=this._getOrReturnCtx(e);return D(n,{code:w.invalid_type,expected:N.number,received:n.parsedType}),Z}let s,r=new we;for(let n of this._def.checks)n.kind==="int"?Y.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),D(s,{code:w.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:w.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:false,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:w.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:false,message:n.message}),r.dirty()):n.kind==="multipleOf"?Ul(e.data,n.value)!==0&&(s=this._getOrReturnCtx(e,s),D(s,{code:w.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:w.not_finite,message:n.message}),r.dirty()):Y.assertNever(n);return {status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,true,H.toString(t))}gt(e,t){return this.setLimit("min",e,false,H.toString(t))}lte(e,t){return this.setLimit("max",e,true,H.toString(t))}lt(e,t){return this.setLimit("max",e,false,H.toString(t))}setLimit(e,t,s,r){return new a({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:H.toString(r)}]})}_addCheck(e){return new a({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:H.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:false,message:H.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:false,message:H.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:true,message:H.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:true,message:H.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:H.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:H.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:true,value:Number.MIN_SAFE_INTEGER,message:H.toString(e)})._addCheck({kind:"max",inclusive:true,value:Number.MAX_SAFE_INTEGER,message:H.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return !!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Y.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 true;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)}};Cr.create=a=>new Cr({checks:[],typeName:T.ZodNumber,coerce:(a==null?void 0:a.coerce)||false,...G(a)});var kr=class a extends K{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte;}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data);}catch(n){return this._getInvalidInput(e)}if(this._getType(e)!==N.bigint)return this._getInvalidInput(e);let s,r=new we;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:w.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:w.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:w.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):Y.assertNever(n);return {status:r.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return D(t,{code:w.invalid_type,expected:N.bigint,received:t.parsedType}),Z}gte(e,t){return this.setLimit("min",e,true,H.toString(t))}gt(e,t){return this.setLimit("min",e,false,H.toString(t))}lte(e,t){return this.setLimit("max",e,true,H.toString(t))}lt(e,t){return this.setLimit("max",e,false,H.toString(t))}setLimit(e,t,s,r){return new a({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:H.toString(r)}]})}_addCheck(e){return new a({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:false,message:H.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:false,message:H.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:true,message:H.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:true,message:H.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:H.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};kr.create=a=>{var e;return new kr({checks:[],typeName:T.ZodBigInt,coerce:(e=a==null?void 0:a.coerce)!=null?e:false,...G(a)})};var Dr=class extends K{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==N.boolean){let s=this._getOrReturnCtx(e);return D(s,{code:w.invalid_type,expected:N.boolean,received:s.parsedType}),Z}return Oe(e.data)}};Dr.create=a=>new Dr({typeName:T.ZodBoolean,coerce:(a==null?void 0:a.coerce)||false,...G(a)});var Nr=class a extends K{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==N.date){let n=this._getOrReturnCtx(e);return D(n,{code:w.invalid_type,expected:N.date,received:n.parsedType}),Z}if(Number.isNaN(e.data.getTime())){let n=this._getOrReturnCtx(e);return D(n,{code:w.invalid_date}),Z}let s=new we,r;for(let n of this._def.checks)n.kind==="min"?e.data.getTime()<n.value&&(r=this._getOrReturnCtx(e,r),D(r,{code:w.too_small,message:n.message,inclusive:true,exact:false,minimum:n.value,type:"date"}),s.dirty()):n.kind==="max"?e.data.getTime()>n.value&&(r=this._getOrReturnCtx(e,r),D(r,{code:w.too_big,message:n.message,inclusive:true,exact:false,maximum:n.value,type:"date"}),s.dirty()):Y.assertNever(n);return {status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new a({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:H.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:H.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};Nr.create=a=>new Nr({checks:[],coerce:(a==null?void 0:a.coerce)||false,typeName:T.ZodDate,...G(a)});var nt=class extends K{_parse(e){if(this._getType(e)!==N.symbol){let s=this._getOrReturnCtx(e);return D(s,{code:w.invalid_type,expected:N.symbol,received:s.parsedType}),Z}return Oe(e.data)}};nt.create=a=>new nt({typeName:T.ZodSymbol,...G(a)});var jr=class extends K{_parse(e){if(this._getType(e)!==N.undefined){let s=this._getOrReturnCtx(e);return D(s,{code:w.invalid_type,expected:N.undefined,received:s.parsedType}),Z}return Oe(e.data)}};jr.create=a=>new jr({typeName:T.ZodUndefined,...G(a)});var Lr=class extends K{_parse(e){if(this._getType(e)!==N.null){let s=this._getOrReturnCtx(e);return D(s,{code:w.invalid_type,expected:N.null,received:s.parsedType}),Z}return Oe(e.data)}};Lr.create=a=>new Lr({typeName:T.ZodNull,...G(a)});var br=class extends K{constructor(){super(...arguments),this._any=true;}_parse(e){return Oe(e.data)}};br.create=a=>new br({typeName:T.ZodAny,...G(a)});var pr=class extends K{constructor(){super(...arguments),this._unknown=true;}_parse(e){return Oe(e.data)}};pr.create=a=>new pr({typeName:T.ZodUnknown,...G(a)});var Ke=class extends K{_parse(e){let t=this._getOrReturnCtx(e);return D(t,{code:w.invalid_type,expected:N.never,received:t.parsedType}),Z}};Ke.create=a=>new Ke({typeName:T.ZodNever,...G(a)});var it=class extends K{_parse(e){if(this._getType(e)!==N.undefined){let s=this._getOrReturnCtx(e);return D(s,{code:w.invalid_type,expected:N.void,received:s.parsedType}),Z}return Oe(e.data)}};it.create=a=>new it({typeName:T.ZodVoid,...G(a)});var mr=class a extends K{_parse(e){let{ctx:t,status:s}=this._processInputParams(e),r=this._def;if(t.parsedType!==N.array)return D(t,{code:w.invalid_type,expected:N.array,received:t.parsedType}),Z;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?w.too_big:w.too_small,minimum:i?r.exactLength.value:void 0,maximum:o?r.exactLength.value:void 0,type:"array",inclusive:true,exact:true,message:r.exactLength.message}),s.dirty());}if(r.minLength!==null&&t.data.length<r.minLength.value&&(D(t,{code:w.too_small,minimum:r.minLength.value,type:"array",inclusive:true,exact:false,message:r.minLength.message}),s.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(D(t,{code:w.too_big,maximum:r.maxLength.value,type:"array",inclusive:true,exact:false,message:r.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((o,i)=>r.type._parseAsync(new Ue(t,o,t.path,i)))).then(o=>we.mergeArray(s,o));let n=[...t.data].map((o,i)=>r.type._parseSync(new Ue(t,o,t.path,i)));return we.mergeArray(s,n)}get element(){return this._def.type}min(e,t){return new a({...this._def,minLength:{value:e,message:H.toString(t)}})}max(e,t){return new a({...this._def,maxLength:{value:e,message:H.toString(t)}})}length(e,t){return new a({...this._def,exactLength:{value:e,message:H.toString(t)}})}nonempty(e){return this.min(1,e)}};mr.create=(a,e)=>new mr({type:a,minLength:null,maxLength:null,exactLength:null,typeName:T.ZodArray,...G(e)});function st(a){if(a instanceof je){let e={};for(let t in a.shape){let s=a.shape[t];e[t]=Ne.create(st(s));}return new je({...a._def,shape:()=>e})}else return a instanceof mr?new mr({...a._def,type:st(a.element)}):a instanceof Ne?Ne.create(st(a.unwrap())):a instanceof sr?sr.create(st(a.unwrap())):a instanceof ar?ar.create(a.items.map(e=>st(e))):a}var je=class a extends K{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=Y.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==N.object){let u=this._getOrReturnCtx(e);return D(u,{code:w.invalid_type,expected:N.object,received:u.parsedType}),Z}let{status:s,ctx:r}=this._processInputParams(e),{shape:n,keys:o}=this._getCached(),i=[];if(!(this._def.catchall instanceof Ke&&this._def.unknownKeys==="strip"))for(let u in r.data)o.includes(u)||i.push(u);let c=[];for(let u of o){let h=n[u],p=r.data[u];c.push({key:{status:"valid",value:u},value:h._parse(new Ue(r,p,r.path,u)),alwaysSet:u in r.data});}if(this._def.catchall instanceof Ke){let u=this._def.unknownKeys;if(u==="passthrough")for(let h of i)c.push({key:{status:"valid",value:h},value:{status:"valid",value:r.data[h]}});else if(u==="strict")i.length>0&&(D(r,{code:w.unrecognized_keys,keys:i}),s.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else {let u=this._def.catchall;for(let h of i){let p=r.data[h];c.push({key:{status:"valid",value:h},value:u._parse(new Ue(r,p,r.path,h)),alwaysSet:h in r.data});}}return r.common.async?Promise.resolve().then(async()=>{let u=[];for(let h of c){let p=await h.key,y=await h.value;u.push({key:p,value:y,alwaysSet:h.alwaysSet});}return u}).then(u=>we.mergeObjectSync(s,u)):we.mergeObjectSync(s,c)}get shape(){return this._def.shape()}strict(e){return H.errToObj,new a({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{var n,o,i,c;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:(c=H.errToObj(e).message)!=null?c: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 Y.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 Y.objectKeys(this.shape))e[s]||(t[s]=this.shape[s]);return new a({...this._def,shape:()=>t})}deepPartial(){return st(this)}partial(e){let t={};for(let s of Y.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 Y.objectKeys(this.shape))if(e&&!e[s])t[s]=this.shape[s];else {let n=this.shape[s];for(;n instanceof Ne;)n=n._def.innerType;t[s]=n;}return new a({...this._def,shape:()=>t})}keyof(){return Ns(Y.objectKeys(this.shape))}};je.create=(a,e)=>new je({shape:()=>a,unknownKeys:"strip",catchall:Ke.create(),typeName:T.ZodObject,...G(e)});je.strictCreate=(a,e)=>new je({shape:()=>a,unknownKeys:"strict",catchall:Ke.create(),typeName:T.ZodObject,...G(e)});je.lazycreate=(a,e)=>new je({shape:a,unknownKeys:"strip",catchall:Ke.create(),typeName:T.ZodObject,...G(e)});var Fr=class extends K{_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 De(i.ctx.common.issues));return D(t,{code:w.invalid_union,unionErrors:o}),Z}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 c of s){let u={...t,common:{...t.common,issues:[]},parent:null},h=c._parseSync({data:t.data,path:t.path,parent:u});if(h.status==="valid")return h;h.status==="dirty"&&!n&&(n={result:h,ctx:u}),u.common.issues.length&&o.push(u.common.issues);}if(n)return t.common.issues.push(...n.ctx.common.issues),n.result;let i=o.map(c=>new De(c));return D(t,{code:w.invalid_union,unionErrors:i}),Z}}get options(){return this._def.options}};Fr.create=(a,e)=>new Fr({options:a,typeName:T.ZodUnion,...G(e)});var hr=a=>a instanceof qr?hr(a.schema):a instanceof Ze?hr(a.innerType()):a instanceof zr?[a.value]:a instanceof Hr?a.options:a instanceof Vr?Y.objectValues(a.enum):a instanceof Ur?hr(a._def.innerType):a instanceof jr?[void 0]:a instanceof Lr?[null]:a instanceof Ne?[void 0,...hr(a.unwrap())]:a instanceof sr?[null,...hr(a.unwrap())]:a instanceof _t||a instanceof Br?hr(a.unwrap()):a instanceof Zr?hr(a._def.innerType):[],Ct=class a extends K{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==N.object)return D(t,{code:w.invalid_type,expected:N.object,received:t.parsedType}),Z;let s=this.discriminator,r=t.data[s],n=this.optionsMap.get(r);return n?t.common.async?n._parseAsync({data:t.data,path:t.path,parent:t}):n._parseSync({data:t.data,path:t.path,parent:t}):(D(t,{code:w.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),Z)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){let r=new Map;for(let n of t){let o=hr(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,...G(s)})}};function $a(a,e){let t=tr(a),s=tr(e);if(a===e)return {valid:true,data:a};if(t===N.object&&s===N.object){let r=Y.objectKeys(e),n=Y.objectKeys(a).filter(i=>r.indexOf(i)!==-1),o={...a,...e};for(let i of n){let c=$a(a[i],e[i]);if(!c.valid)return {valid:false};o[i]=c.data;}return {valid:true,data:o}}else if(t===N.array&&s===N.array){if(a.length!==e.length)return {valid:false};let r=[];for(let n=0;n<a.length;n++){let o=a[n],i=e[n],c=$a(o,i);if(!c.valid)return {valid:false};r.push(c.data);}return {valid:true,data:r}}else return t===N.date&&s===N.date&&+a==+e?{valid:true,data:a}:{valid:false}}var Mr=class extends K{_parse(e){let{status:t,ctx:s}=this._processInputParams(e),r=(n,o)=>{if($t(n)||$t(o))return Z;let i=$a(n.value,o.value);return i.valid?((At(n)||At(o))&&t.dirty(),{status:t.value,value:i.data}):(D(s,{code:w.invalid_intersection_types}),Z)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([n,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}))}};Mr.create=(a,e,t)=>new Mr({left:a,right:e,typeName:T.ZodIntersection,...G(t)});var ar=class a extends K{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==N.array)return D(s,{code:w.invalid_type,expected:N.array,received:s.parsedType}),Z;if(s.data.length<this._def.items.length)return D(s,{code:w.too_small,minimum:this._def.items.length,inclusive:true,exact:false,type:"array"}),Z;!this._def.rest&&s.data.length>this._def.items.length&&(D(s,{code:w.too_big,maximum:this._def.items.length,inclusive:true,exact:false,type:"array"}),t.dirty());let n=[...s.data].map((o,i)=>{let c=this._def.items[i]||this._def.rest;return c?c._parse(new Ue(s,o,s.path,i)):null}).filter(o=>!!o);return s.common.async?Promise.all(n).then(o=>we.mergeArray(t,o)):we.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new a({...this._def,rest:e})}};ar.create=(a,e)=>{if(!Array.isArray(a))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ar({items:a,typeName:T.ZodTuple,rest:null,...G(e)})};var kt=class a extends K{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!==N.object)return D(s,{code:w.invalid_type,expected:N.object,received:s.parsedType}),Z;let r=[],n=this._def.keyType,o=this._def.valueType;for(let i in s.data)r.push({key:n._parse(new Ue(s,i,s.path,i)),value:o._parse(new Ue(s,s.data[i],s.path,i)),alwaysSet:i in s.data});return s.common.async?we.mergeObjectAsync(t,r):we.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,s){return t instanceof K?new a({keyType:e,valueType:t,typeName:T.ZodRecord,...G(s)}):new a({keyType:_r.create(),valueType:e,typeName:T.ZodRecord,...G(t)})}},ot=class extends K{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!==N.map)return D(s,{code:w.invalid_type,expected:N.map,received:s.parsedType}),Z;let r=this._def.keyType,n=this._def.valueType,o=[...s.data.entries()].map(([i,c],u)=>({key:r._parse(new Ue(s,i,s.path,[u,"key"])),value:n._parse(new Ue(s,c,s.path,[u,"value"]))}));if(s.common.async){let i=new Map;return Promise.resolve().then(async()=>{for(let c of o){let u=await c.key,h=await c.value;if(u.status==="aborted"||h.status==="aborted")return Z;(u.status==="dirty"||h.status==="dirty")&&t.dirty(),i.set(u.value,h.value);}return {status:t.value,value:i}})}else {let i=new Map;for(let c of o){let u=c.key,h=c.value;if(u.status==="aborted"||h.status==="aborted")return Z;(u.status==="dirty"||h.status==="dirty")&&t.dirty(),i.set(u.value,h.value);}return {status:t.value,value:i}}}};ot.create=(a,e,t)=>new ot({valueType:e,keyType:a,typeName:T.ZodMap,...G(t)});var lt=class a extends K{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==N.set)return D(s,{code:w.invalid_type,expected:N.set,received:s.parsedType}),Z;let r=this._def;r.minSize!==null&&s.data.size<r.minSize.value&&(D(s,{code:w.too_small,minimum:r.minSize.value,type:"set",inclusive:true,exact:false,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&s.data.size>r.maxSize.value&&(D(s,{code:w.too_big,maximum:r.maxSize.value,type:"set",inclusive:true,exact:false,message:r.maxSize.message}),t.dirty());let n=this._def.valueType;function o(c){let u=new Set;for(let h of c){if(h.status==="aborted")return Z;h.status==="dirty"&&t.dirty(),u.add(h.value);}return {status:t.value,value:u}}let i=[...s.data.values()].map((c,u)=>n._parse(new Ue(s,c,s.path,u)));return s.common.async?Promise.all(i).then(c=>o(c)):o(i)}min(e,t){return new a({...this._def,minSize:{value:e,message:H.toString(t)}})}max(e,t){return new a({...this._def,maxSize:{value:e,message:H.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};lt.create=(a,e)=>new lt({valueType:a,minSize:null,maxSize:null,typeName:T.ZodSet,...G(e)});var Dt=class a extends K{constructor(){super(...arguments),this.validate=this.implement;}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==N.function)return D(t,{code:w.invalid_type,expected:N.function,received:t.parsedType}),Z;function s(i,c){return yt({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,tt(),fr].filter(u=>!!u),issueData:{code:w.invalid_arguments,argumentsError:c}})}function r(i,c){return yt({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,tt(),fr].filter(u=>!!u),issueData:{code:w.invalid_return_type,returnTypeError:c}})}let n={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof Er){let i=this;return Oe(async function(...c){let u=new De([]),h=await i._def.args.parseAsync(c,n).catch(d=>{throw u.addIssue(s(c,d)),u}),p=await Reflect.apply(o,this,h);return await i._def.returns._def.type.parseAsync(p,n).catch(d=>{throw u.addIssue(r(p,d)),u})})}else {let i=this;return Oe(function(...c){let u=i._def.args.safeParse(c,n);if(!u.success)throw new De([s(c,u.error)]);let h=Reflect.apply(o,this,u.data),p=i._def.returns.safeParse(h,n);if(!p.success)throw new De([r(h,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new a({...this._def,args:ar.create(e).rest(pr.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||ar.create([]).rest(pr.create()),returns:t||pr.create(),typeName:T.ZodFunction,...G(s)})}},qr=class extends K{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})}};qr.create=(a,e)=>new qr({getter:a,typeName:T.ZodLazy,...G(e)});var zr=class extends K{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return D(t,{received:t.data,code:w.invalid_literal,expected:this._def.value}),Z}return {status:"valid",value:e.data}}get value(){return this._def.value}};zr.create=(a,e)=>new zr({value:a,typeName:T.ZodLiteral,...G(e)});function Ns(a,e){return new Hr({values:a,typeName:T.ZodEnum,...G(e)})}var Hr=class a extends K{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),s=this._def.values;return D(t,{expected:Y.joinValues(s),received:t.parsedType,code:w.invalid_type}),Z}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),s=this._def.values;return D(t,{received:t.data,code:w.invalid_enum_value,options:s}),Z}return Oe(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})}};Hr.create=Ns;var Vr=class extends K{_parse(e){let t=Y.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==N.string&&s.parsedType!==N.number){let r=Y.objectValues(t);return D(s,{expected:Y.joinValues(r),received:s.parsedType,code:w.invalid_type}),Z}if(this._cache||(this._cache=new Set(Y.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let r=Y.objectValues(t);return D(s,{received:s.data,code:w.invalid_enum_value,options:r}),Z}return Oe(e.data)}get enum(){return this._def.values}};Vr.create=(a,e)=>new Vr({values:a,typeName:T.ZodNativeEnum,...G(e)});var Er=class extends K{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==N.promise&&t.common.async===false)return D(t,{code:w.invalid_type,expected:N.promise,received:t.parsedType}),Z;let s=t.parsedType===N.promise?t.data:Promise.resolve(t.data);return Oe(s.then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Er.create=(a,e)=>new Er({type:a,typeName:T.ZodPromise,...G(e)});var Ze=class extends K{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 Z;let c=await this._def.schema._parseAsync({data:i,path:s.path,parent:s});return c.status==="aborted"?Z:c.status==="dirty"?Ar(c.value):t.value==="dirty"?Ar(c.value):c});{if(t.value==="aborted")return Z;let i=this._def.schema._parseSync({data:o,path:s.path,parent:s});return i.status==="aborted"?Z:i.status==="dirty"?Ar(i.value):t.value==="dirty"?Ar(i.value):i}}if(r.type==="refinement"){let o=i=>{let c=r.refinement(i,n);if(s.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(s.common.async===false){let i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return i.status==="aborted"?Z:(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"?Z:(i.status==="dirty"&&t.dirty(),o(i.value).then(()=>({status:t.value,value:i.value}))))}if(r.type==="transform")if(s.common.async===false){let o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!yr(o))return Z;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=>yr(o)?Promise.resolve(r.transform(o.value,n)).then(i=>({status:t.value,value:i})):Z);Y.assertNever(r);}};Ze.create=(a,e,t)=>new Ze({schema:a,typeName:T.ZodEffects,effect:e,...G(t)});Ze.createWithPreprocess=(a,e,t)=>new Ze({schema:e,effect:{type:"preprocess",transform:a},typeName:T.ZodEffects,...G(t)});var Ne=class extends K{_parse(e){return this._getType(e)===N.undefined?Oe(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ne.create=(a,e)=>new Ne({innerType:a,typeName:T.ZodOptional,...G(e)});var sr=class extends K{_parse(e){return this._getType(e)===N.null?Oe(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};sr.create=(a,e)=>new sr({innerType:a,typeName:T.ZodNullable,...G(e)});var Ur=class extends K{_parse(e){let{ctx:t}=this._processInputParams(e),s=t.data;return t.parsedType===N.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Ur.create=(a,e)=>new Ur({innerType:a,typeName:T.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...G(e)});var Zr=class extends K{_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 at(r)?r.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new De(s.common.issues)},input:s.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new De(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}};Zr.create=(a,e)=>new Zr({innerType:a,typeName:T.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...G(e)});var ct=class extends K{_parse(e){if(this._getType(e)!==N.nan){let s=this._getOrReturnCtx(e);return D(s,{code:w.invalid_type,expected:N.nan,received:s.parsedType}),Z}return {status:"valid",value:e.data}}};ct.create=a=>new ct({typeName:T.ZodNaN,...G(a)});var Zl=Symbol("zod_brand"),_t=class extends K{_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}},bt=class a extends K{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return (async()=>{let n=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?Z:n.status==="dirty"?(t.dirty(),Ar(n.value)):this._def.out._parseAsync({data:n.value,path:s.path,parent:s})})();{let r=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return r.status==="aborted"?Z:r.status==="dirty"?(t.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:s.path,parent:s})}}static create(e,t){return new a({in:e,out:t,typeName:T.ZodPipeline})}},Br=class extends K{_parse(e){let t=this._def.innerType._parse(e),s=r=>(yr(r)&&(r.value=Object.freeze(r.value)),r);return at(t)?t.then(r=>s(r)):s(t)}unwrap(){return this._def.innerType}};Br.create=(a,e)=>new Br({innerType:a,typeName:T.ZodReadonly,...G(e)});function As(a,e){let t=typeof a=="function"?a(e):typeof a=="string"?{message:a}:a;return typeof t=="string"?{message:t}:t}function js(a,e={},t){return a?br.create().superRefine((s,r)=>{var o,i;let n=a(s);if(n instanceof Promise)return n.then(c=>{var u,h;if(!c){let p=As(e,s),y=(h=(u=p.fatal)!=null?u:t)!=null?h:true;r.addIssue({code:"custom",...p,fatal:y});}});if(!n){let c=As(e,s),u=(i=(o=c.fatal)!=null?o:t)!=null?i:true;r.addIssue({code:"custom",...c,fatal:u});}}):br.create()}var Bl={object:je.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 Ql=(a,e={message:`Input not instance of ${a.name}`})=>js(t=>t instanceof a,e),Ls=_r.create,Fs=Cr.create,Gl=ct.create,Kl=kr.create,Ms=Dr.create,Jl=Nr.create,Wl=nt.create,Xl=jr.create,Yl=Lr.create,ec=br.create,rc=pr.create,tc=Ke.create,ac=it.create,sc=mr.create,nc=je.create,ic=je.strictCreate,oc=Fr.create,lc=Ct.create,cc=Mr.create,uc=ar.create,dc=kt.create,fc=ot.create,hc=lt.create,pc=Dt.create,mc=qr.create,vc=zr.create,gc=Hr.create,yc=Vr.create,_c=Er.create,bc=Ze.create,Ec=Ne.create,Pc=sr.create,xc=Ze.createWithPreprocess,Sc=bt.create,wc=()=>Ls().optional(),Rc=()=>Fs().optional(),Tc=()=>Ms().optional(),Oc={string:a=>_r.create({...a,coerce:true}),number:a=>Cr.create({...a,coerce:true}),boolean:a=>Dr.create({...a,coerce:true}),bigint:a=>kr.create({...a,coerce:true}),date:a=>Nr.create({...a,coerce:true})};var Ic=Z;var Aa="2025-06-18";var qs=[Aa,"2025-03-26","2024-11-05","2024-10-07"],Nt="2.0",zs=l.union([l.string(),l.number().int()]),Hs=l.string(),$c=l.object({progressToken:l.optional(zs)}).passthrough(),Be=l.object({_meta:l.optional($c)}).passthrough(),Le=l.object({method:l.string(),params:l.optional(Be)}),Et=l.object({_meta:l.optional(l.object({}).passthrough())}).passthrough(),nr=l.object({method:l.string(),params:l.optional(Et)}),Qe=l.object({_meta:l.optional(l.object({}).passthrough())}).passthrough(),jt=l.union([l.string(),l.number().int()]),Vs=l.object({jsonrpc:l.literal(Nt),id:jt}).merge(Le).strict(),Us=a=>Vs.safeParse(a).success,Zs=l.object({jsonrpc:l.literal(Nt)}).merge(nr).strict(),Bs=a=>Zs.safeParse(a).success,Qs=l.object({jsonrpc:l.literal(Nt),id:jt,result:Qe}).strict(),Ca=a=>Qs.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 Gs=l.object({jsonrpc:l.literal(Nt),id:jt,error:l.object({code:l.number().int(),message:l.string(),data:l.optional(l.unknown())})}).strict(),Ks=a=>Gs.safeParse(a).success,Js=l.union([Vs,Zs,Qs,Gs]),Lt=Qe.strict(),Ft=nr.extend({method:l.literal("notifications/cancelled"),params:Et.extend({requestId:jt,reason:l.string().optional()})}),Pt=l.object({name:l.string(),title:l.optional(l.string())}).passthrough(),Ws=Pt.extend({version:l.string()}),Ac=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(),ka=Le.extend({method:l.literal("initialize"),params:Be.extend({protocolVersion:l.string(),capabilities:Ac,clientInfo:Ws})});var Cc=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(),kc=Qe.extend({protocolVersion:l.string(),capabilities:Cc,serverInfo:Ws,instructions:l.optional(l.string())}),Da=nr.extend({method:l.literal("notifications/initialized")});var Mt=Le.extend({method:l.literal("ping")}),Dc=l.object({progress:l.number(),total:l.optional(l.number()),message:l.optional(l.string())}).passthrough(),qt=nr.extend({method:l.literal("notifications/progress"),params:Et.merge(Dc).extend({progressToken:zs})}),zt=Le.extend({params:Be.extend({cursor:l.optional(Hs)}).optional()}),Ht=Qe.extend({nextCursor:l.optional(Hs)}),Xs=l.object({uri:l.string(),mimeType:l.optional(l.string()),_meta:l.optional(l.object({}).passthrough())}).passthrough(),Ys=Xs.extend({text:l.string()}),en=Xs.extend({blob:l.string().base64()}),rn=Pt.extend({uri:l.string(),description:l.optional(l.string()),mimeType:l.optional(l.string()),_meta:l.optional(l.object({}).passthrough())}),Nc=Pt.extend({uriTemplate:l.string(),description:l.optional(l.string()),mimeType:l.optional(l.string()),_meta:l.optional(l.object({}).passthrough())}),Vt=zt.extend({method:l.literal("resources/list")}),jc=Ht.extend({resources:l.array(rn)}),Ut=zt.extend({method:l.literal("resources/templates/list")}),Lc=Ht.extend({resourceTemplates:l.array(Nc)}),Zt=Le.extend({method:l.literal("resources/read"),params:Be.extend({uri:l.string()})}),Fc=Qe.extend({contents:l.array(l.union([Ys,en]))}),Mc=nr.extend({method:l.literal("notifications/resources/list_changed")}),qc=Le.extend({method:l.literal("resources/subscribe"),params:Be.extend({uri:l.string()})}),zc=Le.extend({method:l.literal("resources/unsubscribe"),params:Be.extend({uri:l.string()})}),Hc=nr.extend({method:l.literal("notifications/resources/updated"),params:Et.extend({uri:l.string()})}),Vc=l.object({name:l.string(),description:l.optional(l.string()),required:l.optional(l.boolean())}).passthrough(),Uc=Pt.extend({description:l.optional(l.string()),arguments:l.optional(l.array(Vc)),_meta:l.optional(l.object({}).passthrough())}),Bt=zt.extend({method:l.literal("prompts/list")}),Zc=Ht.extend({prompts:l.array(Uc)}),Qt=Le.extend({method:l.literal("prompts/get"),params:Be.extend({name:l.string(),arguments:l.optional(l.record(l.string()))})}),Na=l.object({type:l.literal("text"),text:l.string(),_meta:l.optional(l.object({}).passthrough())}).passthrough(),ja=l.object({type:l.literal("image"),data:l.string().base64(),mimeType:l.string(),_meta:l.optional(l.object({}).passthrough())}).passthrough(),La=l.object({type:l.literal("audio"),data:l.string().base64(),mimeType:l.string(),_meta:l.optional(l.object({}).passthrough())}).passthrough(),Bc=l.object({type:l.literal("resource"),resource:l.union([Ys,en]),_meta:l.optional(l.object({}).passthrough())}).passthrough(),Qc=rn.extend({type:l.literal("resource_link")}),tn=l.union([Na,ja,La,Qc,Bc]),Gc=l.object({role:l.enum(["user","assistant"]),content:tn}).passthrough(),Kc=Qe.extend({description:l.optional(l.string()),messages:l.array(Gc)}),Jc=nr.extend({method:l.literal("notifications/prompts/list_changed")}),Wc=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(),Xc=Pt.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(Wc),_meta:l.optional(l.object({}).passthrough())}),Gt=zt.extend({method:l.literal("tools/list")}),Yc=Ht.extend({tools:l.array(Xc)}),an=Qe.extend({content:l.array(tn).default([]),structuredContent:l.object({}).passthrough().optional(),isError:l.optional(l.boolean())});an.or(Qe.extend({toolResult:l.unknown()}));var Kt=Le.extend({method:l.literal("tools/call"),params:Be.extend({name:l.string(),arguments:l.optional(l.record(l.unknown()))})}),eu=nr.extend({method:l.literal("notifications/tools/list_changed")}),sn=l.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),ru=Le.extend({method:l.literal("logging/setLevel"),params:Be.extend({level:sn})}),tu=nr.extend({method:l.literal("notifications/message"),params:Et.extend({level:sn,logger:l.optional(l.string()),data:l.unknown()})}),au=l.object({name:l.string().optional()}).passthrough(),su=l.object({hints:l.optional(l.array(au)),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(),nu=l.object({role:l.enum(["user","assistant"]),content:l.union([Na,ja,La])}).passthrough(),iu=Le.extend({method:l.literal("sampling/createMessage"),params:Be.extend({messages:l.array(nu),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(su)})}),Fa=Qe.extend({model:l.string(),stopReason:l.optional(l.enum(["endTurn","stopSequence","maxTokens"]).or(l.string())),role:l.enum(["user","assistant"]),content:l.discriminatedUnion("type",[Na,ja,La])}),ou=l.object({type:l.literal("boolean"),title:l.optional(l.string()),description:l.optional(l.string()),default:l.optional(l.boolean())}).passthrough(),lu=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(),cu=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(),uu=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(),du=l.union([ou,lu,cu,uu]),fu=Le.extend({method:l.literal("elicitation/create"),params:Be.extend({message:l.string(),requestedSchema:l.object({type:l.literal("object"),properties:l.record(l.string(),du),required:l.optional(l.array(l.string()))}).passthrough()})}),Ma=Qe.extend({action:l.enum(["accept","decline","cancel"]),content:l.optional(l.record(l.string(),l.unknown()))}),hu=l.object({type:l.literal("ref/resource"),uri:l.string()}).passthrough();var pu=l.object({type:l.literal("ref/prompt"),name:l.string()}).passthrough(),Jt=Le.extend({method:l.literal("completion/complete"),params:Be.extend({ref:l.union([pu,hu]),argument:l.object({name:l.string(),value:l.string()}).passthrough(),context:l.optional(l.object({arguments:l.optional(l.record(l.string(),l.string()))}))})}),mu=Qe.extend({completion:l.object({values:l.array(l.string()).max(100),total:l.optional(l.number().int()),hasMore:l.optional(l.boolean())}).passthrough()}),vu=l.object({uri:l.string().startsWith("file://"),name:l.optional(l.string()),_meta:l.optional(l.object({}).passthrough())}).passthrough(),gu=Le.extend({method:l.literal("roots/list")}),qa=Qe.extend({roots:l.array(vu)}),yu=nr.extend({method:l.literal("notifications/roots/list_changed")});l.union([Mt,ka,Jt,ru,Qt,Bt,Vt,Ut,Zt,qc,zc,Kt,Gt]);l.union([Ft,qt,Da,yu]);l.union([Lt,Fa,Ma,qa]);l.union([Mt,iu,fu,gu]);l.union([Ft,qt,tu,Hc,Mc,eu,Jc]);l.union([Lt,kc,mu,Kc,Zc,jc,Lc,Fc,an,Yc]);var fe=class extends Error{constructor(e,t,s){super(`MCP error ${e}: ${t}`),this.code=e,this.data=s,this.name="McpError";}};var _u=(a=>(a.START="start",a.STARTED="started",a.STOP="stop",a.STOPPED="stopped",a.PING="ping",a.PONG="pong",a.ERROR="error",a.LIST_TOOLS="list_tools",a.CALL_TOOL="call_tool",a.TOOL_LIST_UPDATED="tool_list_updated",a.TOOL_LIST_UPDATED_ACK="tool_list_updated_ack",a.PROCESS_DATA="process_data",a.SERVER_STARTED="server_started",a.SERVER_STOPPED="server_stopped",a.ERROR_FROM_NATIVE_HOST="error_from_native_host",a.CONNECT_NATIVE="connectNative",a.PING_NATIVE="ping_native",a.DISCONNECT_NATIVE="disconnect_native",a))(_u||{});var nn=class{constructor(a){dr(this,"_started",false);dr(this,"_allowedOrigins");dr(this,"_channelId");dr(this,"_messageHandler");dr(this,"_clientOrigin");dr(this,"onclose");dr(this,"onerror");dr(this,"onmessage");if(!a.allowedOrigins||a.allowedOrigins.length===0)throw new Error("At least one allowed origin must be specified");this._allowedOrigins=a.allowedOrigins,this._channelId=a.channelId||"mcp-default";}async start(){if(this._started)throw new Error("Transport already started");this._messageHandler=a=>{var t,s,r,n,o;if(!this._allowedOrigins.includes(a.origin)&&!this._allowedOrigins.includes("*")||((t=a.data)==null?void 0:t.channel)!==this._channelId||((s=a.data)==null?void 0:s.type)!=="mcp"||((r=a.data)==null?void 0:r.direction)!=="client-to-server")return;this._clientOrigin=a.origin;let e=a.data.payload;if(typeof e=="string"&&e==="mcp-check-ready"){window.postMessage({channel:this._channelId,type:"mcp",direction:"server-to-client",payload:"mcp-server-ready"},this._clientOrigin);return}try{let i=Js.parse(e);(n=this.onmessage)==null||n.call(this,i);}catch(i){(o=this.onerror)==null||o.call(this,new Error(`Invalid message: ${i instanceof Error?i.message:String(i)}`));}},window.addEventListener("message",this._messageHandler),this._started=true,window.postMessage({channel:this._channelId,type:"mcp",direction:"server-to-client",payload:"mcp-server-ready"},"*");}async send(a){if(!this._started)throw new Error("Transport not started");if(!this._clientOrigin)throw new Error("No client connected");window.postMessage({channel:this._channelId,type:"mcp",direction:"server-to-client",payload:a},this._clientOrigin);}async close(){var a;this._messageHandler&&window.removeEventListener("message",this._messageHandler),this._started=false,(a=this.onclose)==null||a.call(this);}};var Eu=6e4,Wt=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.setNotificationHandler(Ft,t=>{let s=this._requestHandlerAbortControllers.get(t.params.requestId);s==null||s.abort(t.params.reason);}),this.setNotificationHandler(qt,t=>{this._onprogress(t);}),this.setRequestHandler(Mt,t=>({}));}_setupTimeout(e,t,s,r,n=false){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 false;let s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new fe(de.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:s});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),true}_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=c=>{o==null||o(c),this._onerror(c);};let i=(r=this._transport)===null||r===void 0?void 0:r.onmessage;this._transport.onmessage=(c,u)=>{i==null||i(c,u),Ca(c)||Ks(c)?this._onresponse(c):Us(c)?this._onrequest(c,u):Bs(c)?this._onnotification(c):this._onerror(new Error(`Unknown message type: ${JSON.stringify(c)}`));},await this._transport.start();}_onclose(){var e;let t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._transport=void 0,(e=this.onclose)===null||e===void 0||e.call(this);let s=new fe(de.ConnectionClosed,"Connection closed");for(let r of t.values())r(s);}_onerror(e){var t;(t=this.onerror)===null||t===void 0||t.call(this,e);}_onnotification(e){var t;let s=(t=this._notificationHandlers.get(e.method))!==null&&t!==void 0?t:this.fallbackNotificationHandler;s!==void 0&&Promise.resolve().then(()=>s(e)).catch(r=>this._onerror(new Error(`Uncaught error in notification handler: ${r}`)));}_onrequest(e,t){var s,r,n,o;let i=(s=this._requestHandlers.get(e.method))!==null&&s!==void 0?s:this.fallbackRequestHandler;if(i===void 0){(r=this._transport)===null||r===void 0||r.send({jsonrpc:"2.0",id:e.id,error:{code:de.MethodNotFound,message:"Method not found"}}).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}let c=new AbortController;this._requestHandlerAbortControllers.set(e.id,c);let u={signal:c.signal,sessionId:(n=this._transport)===null||n===void 0?void 0:n.sessionId,_meta:(o=e.params)===null||o===void 0?void 0:o._meta,sendNotification:h=>this.notification(h,{relatedRequestId:e.id}),sendRequest:(h,p,y)=>this.request(h,p,{...y,relatedRequestId:e.id}),authInfo:t==null?void 0:t.authInfo,requestId:e.id,requestInfo:t==null?void 0:t.requestInfo};Promise.resolve().then(()=>i(e,u)).then(h=>{var p;if(!c.signal.aborted)return (p=this._transport)===null||p===void 0?void 0:p.send({result:h,jsonrpc:"2.0",id:e.id})},h=>{var p,y;if(!c.signal.aborted)return (p=this._transport)===null||p===void 0?void 0:p.send({jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(h.code)?h.code:de.InternalError,message:(y=h.message)!==null&&y!==void 0?y:"Internal error"}})}).catch(h=>this._onerror(new Error(`Failed to send response: ${h}`))).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(c){o(c);return}n(s);}_onresponse(e){let t=Number(e.id),s=this._responseHandlers.get(t);if(s===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}if(this._responseHandlers.delete(t),this._progressHandlers.delete(t),this._cleanupTimeout(t),Ca(e))s(e);else {let r=new fe(e.error.code,e.error.message,e.error.data);s(r);}}get transport(){return this._transport}async close(){var e;await((e=this._transport)===null||e===void 0?void 0:e.close());}request(e,t,s){let{relatedRequestId:r,resumptionToken:n,onresumptiontoken:o}=s!=null?s:{};return new Promise((i,c)=>{var u,h,p,y,d,_;if(!this._transport){c(new Error("Not connected"));return}((u=this._options)===null||u===void 0?void 0:u.enforceStrictCapabilities)===true&&this.assertCapabilityForMethod(e.method),(h=s==null?void 0:s.signal)===null||h===void 0||h.throwIfAborted();let b=this._requestMessageId++,g={...e,jsonrpc:"2.0",id:b};s!=null&&s.onprogress&&(this._progressHandlers.set(b,s.onprogress),g.params={...e.params,_meta:{...((p=e.params)===null||p===void 0?void 0:p._meta)||{},progressToken:b}});let x=R=>{var $;this._responseHandlers.delete(b),this._progressHandlers.delete(b),this._cleanupTimeout(b),($=this._transport)===null||$===void 0||$.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:b,reason:String(R)}},{relatedRequestId:r,resumptionToken:n,onresumptiontoken:o}).catch(A=>this._onerror(new Error(`Failed to send cancellation: ${A}`))),c(R);};this._responseHandlers.set(b,R=>{var $;if(!(!(($=s==null?void 0:s.signal)===null||$===void 0)&&$.aborted)){if(R instanceof Error)return c(R);try{let A=t.parse(R.result);i(A);}catch(A){c(A);}}}),(y=s==null?void 0:s.signal)===null||y===void 0||y.addEventListener("abort",()=>{var R;x((R=s==null?void 0:s.signal)===null||R===void 0?void 0:R.reason);});let I=(d=s==null?void 0:s.timeout)!==null&&d!==void 0?d:Eu,S=()=>x(new fe(de.RequestTimeout,"Request timed out",{timeout:I}));this._setupTimeout(b,I,s==null?void 0:s.maxTotalTimeout,S,(_=s==null?void 0:s.resetTimeoutOnProgress)!==null&&_!==void 0?_:false),this._transport.send(g,{relatedRequestId:r,resumptionToken:n,onresumptiontoken:o}).catch(R=>{this._cleanupTimeout(b),c(R);});})}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let s={...e,jsonrpc:"2.0"};await this._transport.send(s,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 on(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 co=_l(lo()),va=class extends Wt{constructor(e,t){var s;super(t),this._serverInfo=e,this._capabilities=(s=t==null?void 0:t.capabilities)!==null&&s!==void 0?s:{},this._instructions=t==null?void 0:t.instructions,this.setRequestHandler(ka,r=>this._oninitialize(r)),this.setNotificationHandler(Da,()=>{var r;return (r=this.oninitialized)===null||r===void 0?void 0:r.call(this)});}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=on(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;}}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;}}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;}}async _oninitialize(e){let t=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:qs.includes(t)?t:Aa,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"},Lt)}async createMessage(e,t){return this.request({method:"sampling/createMessage",params:e},Fa,t)}async elicitInput(e,t){let s=await this.request({method:"elicitation/create",params:e},Ma,t);if(s.action==="accept"&&s.content)try{let r=new co.default,n=r.compile(e.requestedSchema);if(!n(s.content))throw new fe(de.InvalidParams,`Elicitation response content does not match requested schema: ${r.errorsText(n.errors)}`)}catch(r){throw r instanceof fe?r:new fe(de.InternalError,`Error validating elicitation response: ${r}`)}return s}async listRoots(e,t){return this.request({method:"roots/list",params:e},qa,t)}async sendLoggingMessage(e){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 fo=Symbol("Let zodToJsonSchema decide on which parser to use");var uo={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:true,rejectedAdditionalProperties:false,definitionPath:"definitions",target:"jsonSchema7",strictUnions:false,definitions:{},errorMessages:false,markdownDescription:false,patternStrategy:"escape",applyRegexFlags:false,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},ho=a=>typeof a=="string"?{...uo,name:a}:{...uo,...a};var po=a=>{let e=ho(a),t=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return {...e,currentPath:t,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([s,r])=>[r._def,{def:r._def,path:[...e.basePath,e.definitionPath,s],jsonSchema:void 0}]))}};function ds(a,e,t,s){s!=null&&s.errorMessages&&t&&(a.errorMessage={...a.errorMessage,[e]:t});}function ee(a,e,t,s,r){a[e]=t,ds(a,e,s,r);}function mo(){return {}}function vo(a,e){var s,r,n;let t={type:"array"};return (s=a.type)!=null&&s._def&&((n=(r=a.type)==null?void 0:r._def)==null?void 0:n.typeName)!==T.ZodAny&&(t.items=B(a.type._def,{...e,currentPath:[...e.currentPath,"items"]})),a.minLength&&ee(t,"minItems",a.minLength.value,a.minLength.message,e),a.maxLength&&ee(t,"maxItems",a.maxLength.value,a.maxLength.message,e),a.exactLength&&(ee(t,"minItems",a.exactLength.value,a.exactLength.message,e),ee(t,"maxItems",a.exactLength.value,a.exactLength.message,e)),t}function go(a,e){let t={type:"integer",format:"int64"};if(!a.checks)return t;for(let s of a.checks)switch(s.kind){case "min":e.target==="jsonSchema7"?s.inclusive?ee(t,"minimum",s.value,s.message,e):ee(t,"exclusiveMinimum",s.value,s.message,e):(s.inclusive||(t.exclusiveMinimum=true),ee(t,"minimum",s.value,s.message,e));break;case "max":e.target==="jsonSchema7"?s.inclusive?ee(t,"maximum",s.value,s.message,e):ee(t,"exclusiveMaximum",s.value,s.message,e):(s.inclusive||(t.exclusiveMaximum=true),ee(t,"maximum",s.value,s.message,e));break;case "multipleOf":ee(t,"multipleOf",s.value,s.message,e);break}return t}function yo(){return {type:"boolean"}}function ga(a,e){return B(a.type._def,e)}var _o=(a,e)=>B(a.innerType._def,e);function fs(a,e,t){let s=t!=null?t:e.dateStrategy;if(Array.isArray(s))return {anyOf:s.map((r,n)=>fs(a,e,r))};switch(s){case "string":case "format:date-time":return {type:"string",format:"date-time"};case "format:date":return {type:"string",format:"date"};case "integer":return ef(a,e)}}var ef=(a,e)=>{let t={type:"integer",format:"unix-time"};if(e.target==="openApi3")return t;for(let s of a.checks)switch(s.kind){case "min":ee(t,"minimum",s.value,s.message,e);break;case "max":ee(t,"maximum",s.value,s.message,e);break}return t};function bo(a,e){return {...B(a.innerType._def,e),default:a.defaultValue()}}function Eo(a,e){return e.effectStrategy==="input"?B(a.schema._def,e):{}}function Po(a){return {type:"string",enum:Array.from(a.values)}}var rf=a=>"type"in a&&a.type==="string"?false:"allOf"in a;function xo(a,e){let t=[B(a.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),B(a.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(n=>!!n),s=e.target==="jsonSchema2019-09"?{unevaluatedProperties:false}:void 0,r=[];return t.forEach(n=>{if(rf(n))r.push(...n.allOf),n.unevaluatedProperties===void 0&&(s=void 0);else {let o=n;if("additionalProperties"in n&&n.additionalProperties===false){let{additionalProperties:i,...c}=n;o=c;}else s=void 0;r.push(o);}}),r.length?{allOf:r,...s}:void 0}function So(a,e){let t=typeof a.value;return t!=="bigint"&&t!=="number"&&t!=="boolean"&&t!=="string"?{type:Array.isArray(a.value)?"array":"object"}:e.target==="openApi3"?{type:t==="bigint"?"integer":t,enum:[a.value]}:{type:t==="bigint"?"integer":t,const:a.value}}var hs,Je={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(hs===void 0&&(hs=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),hs),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function ya(a,e){let t={type:"string"};if(a.checks)for(let s of a.checks)switch(s.kind){case "min":ee(t,"minLength",typeof t.minLength=="number"?Math.max(t.minLength,s.value):s.value,s.message,e);break;case "max":ee(t,"maxLength",typeof t.maxLength=="number"?Math.min(t.maxLength,s.value):s.value,s.message,e);break;case "email":switch(e.emailStrategy){case "format:email":We(t,"email",s.message,e);break;case "format:idn-email":We(t,"idn-email",s.message,e);break;case "pattern:zod":Ce(t,Je.email,s.message,e);break}break;case "url":We(t,"uri",s.message,e);break;case "uuid":We(t,"uuid",s.message,e);break;case "regex":Ce(t,s.regex,s.message,e);break;case "cuid":Ce(t,Je.cuid,s.message,e);break;case "cuid2":Ce(t,Je.cuid2,s.message,e);break;case "startsWith":Ce(t,RegExp(`^${ps(s.value,e)}`),s.message,e);break;case "endsWith":Ce(t,RegExp(`${ps(s.value,e)}$`),s.message,e);break;case "datetime":We(t,"date-time",s.message,e);break;case "date":We(t,"date",s.message,e);break;case "time":We(t,"time",s.message,e);break;case "duration":We(t,"duration",s.message,e);break;case "length":ee(t,"minLength",typeof t.minLength=="number"?Math.max(t.minLength,s.value):s.value,s.message,e),ee(t,"maxLength",typeof t.maxLength=="number"?Math.min(t.maxLength,s.value):s.value,s.message,e);break;case "includes":{Ce(t,RegExp(ps(s.value,e)),s.message,e);break}case "ip":{s.version!=="v6"&&We(t,"ipv4",s.message,e),s.version!=="v4"&&We(t,"ipv6",s.message,e);break}case "base64url":Ce(t,Je.base64url,s.message,e);break;case "jwt":Ce(t,Je.jwt,s.message,e);break;case "cidr":{s.version!=="v6"&&Ce(t,Je.ipv4Cidr,s.message,e),s.version!=="v4"&&Ce(t,Je.ipv6Cidr,s.message,e);break}case "emoji":Ce(t,Je.emoji(),s.message,e);break;case "ulid":{Ce(t,Je.ulid,s.message,e);break}case "base64":{switch(e.base64Strategy){case "format:binary":{We(t,"binary",s.message,e);break}case "contentEncoding:base64":{ee(t,"contentEncoding","base64",s.message,e);break}case "pattern:zod":{Ce(t,Je.base64,s.message,e);break}}break}case "nanoid":Ce(t,Je.nanoid,s.message,e);}return t}function ps(a,e){return e.patternStrategy==="escape"?af(a):a}var tf=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function af(a){let e="";for(let t=0;t<a.length;t++)tf.has(a[t])||(e+="\\"),e+=a[t];return e}function We(a,e,t,s){var r;a.format||(r=a.anyOf)!=null&&r.some(n=>n.format)?(a.anyOf||(a.anyOf=[]),a.format&&(a.anyOf.push({format:a.format,...a.errorMessage&&s.errorMessages&&{errorMessage:{format:a.errorMessage.format}}}),delete a.format,a.errorMessage&&(delete a.errorMessage.format,Object.keys(a.errorMessage).length===0&&delete a.errorMessage)),a.anyOf.push({format:e,...t&&s.errorMessages&&{errorMessage:{format:t}}})):ee(a,"format",e,t,s);}function Ce(a,e,t,s){var r;a.pattern||(r=a.allOf)!=null&&r.some(n=>n.pattern)?(a.allOf||(a.allOf=[]),a.pattern&&(a.allOf.push({pattern:a.pattern,...a.errorMessage&&s.errorMessages&&{errorMessage:{pattern:a.errorMessage.pattern}}}),delete a.pattern,a.errorMessage&&(delete a.errorMessage.pattern,Object.keys(a.errorMessage).length===0&&delete a.errorMessage)),a.allOf.push({pattern:wo(e,s),...t&&s.errorMessages&&{errorMessage:{pattern:t}}})):ee(a,"pattern",wo(e,s),t,s);}function wo(a,e){var c;if(!e.applyRegexFlags||!a.flags)return a.source;let t={i:a.flags.includes("i"),m:a.flags.includes("m"),s:a.flags.includes("s")},s=t.i?a.source.toLowerCase():a.source,r="",n=false,o=false,i=false;for(let u=0;u<s.length;u++){if(n){r+=s[u],n=false;continue}if(t.i){if(o){if(s[u].match(/[a-z]/)){i?(r+=s[u],r+=`${s[u-2]}-${s[u]}`.toUpperCase(),i=false):s[u+1]==="-"&&((c=s[u+2])!=null&&c.match(/[a-z]/))?(r+=s[u],i=true):r+=`${s[u]}${s[u].toUpperCase()}`;continue}}else if(s[u].match(/[a-z]/)){r+=`[${s[u]}${s[u].toUpperCase()}]`;continue}}if(t.m){if(s[u]==="^"){r+=`(^|(?<=[\r
|
|
3
|
+
]))`;continue}else if(s[u]==="$"){r+=`($|(?=[\r
|
|
4
|
+
]))`;continue}}if(t.s&&s[u]==="."){r+=o?`${s[u]}\r
|
|
5
|
+
`:`[${s[u]}\r
|
|
6
|
+
]`;continue}r+=s[u],s[u]==="\\"?n=true:o&&s[u]==="]"?o=false:!o&&s[u]==="["&&(o=true);}try{new RegExp(r);}catch(u){return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),a.source}return r}function _a(a,e){var s,r,n,o,i,c,u;if(e.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),e.target==="openApi3"&&((s=a.keyType)==null?void 0:s._def.typeName)===T.ZodEnum)return {type:"object",required:a.keyType._def.values,properties:a.keyType._def.values.reduce((h,p)=>{var y;return {...h,[p]:(y=B(a.valueType._def,{...e,currentPath:[...e.currentPath,"properties",p]}))!=null?y:{}}},{}),additionalProperties:e.rejectedAdditionalProperties};let t={type:"object",additionalProperties:(r=B(a.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]}))!=null?r:e.allowedAdditionalProperties};if(e.target==="openApi3")return t;if(((n=a.keyType)==null?void 0:n._def.typeName)===T.ZodString&&((o=a.keyType._def.checks)!=null&&o.length)){let{type:h,...p}=ya(a.keyType._def,e);return {...t,propertyNames:p}}else {if(((i=a.keyType)==null?void 0:i._def.typeName)===T.ZodEnum)return {...t,propertyNames:{enum:a.keyType._def.values}};if(((c=a.keyType)==null?void 0:c._def.typeName)===T.ZodBranded&&a.keyType._def.type._def.typeName===T.ZodString&&((u=a.keyType._def.type._def.checks)!=null&&u.length)){let{type:h,...p}=ga(a.keyType._def,e);return {...t,propertyNames:p}}}return t}function Ro(a,e){if(e.mapStrategy==="record")return _a(a,e);let t=B(a.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||{},s=B(a.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||{};return {type:"array",maxItems:125,items:{type:"array",items:[t,s],minItems:2,maxItems:2}}}function To(a){let e=a.values,s=Object.keys(a.values).filter(n=>typeof e[e[n]]!="number").map(n=>e[n]),r=Array.from(new Set(s.map(n=>typeof n)));return {type:r.length===1?r[0]==="string"?"string":"number":["string","number"],enum:s}}function Oo(){return {not:{}}}function Io(a){return a.target==="openApi3"?{enum:["null"],nullable:true}:{type:"null"}}var St={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Ao(a,e){if(e.target==="openApi3")return $o(a,e);let t=a.options instanceof Map?Array.from(a.options.values()):a.options;if(t.every(s=>s._def.typeName in St&&(!s._def.checks||!s._def.checks.length))){let s=t.reduce((r,n)=>{let o=St[n._def.typeName];return o&&!r.includes(o)?[...r,o]:r},[]);return {type:s.length>1?s:s[0]}}else if(t.every(s=>s._def.typeName==="ZodLiteral"&&!s.description)){let s=t.reduce((r,n)=>{let o=typeof n._def.value;switch(o){case "string":case "number":case "boolean":return [...r,o];case "bigint":return [...r,"integer"];case "object":if(n._def.value===null)return [...r,"null"];case "symbol":case "undefined":case "function":default:return r}},[]);if(s.length===t.length){let r=s.filter((n,o,i)=>i.indexOf(n)===o);return {type:r.length>1?r:r[0],enum:t.reduce((n,o)=>n.includes(o._def.value)?n:[...n,o._def.value],[])}}}else if(t.every(s=>s._def.typeName==="ZodEnum"))return {type:"string",enum:t.reduce((s,r)=>[...s,...r._def.values.filter(n=>!s.includes(n))],[])};return $o(a,e)}var $o=(a,e)=>{let t=(a.options instanceof Map?Array.from(a.options.values()):a.options).map((s,r)=>B(s._def,{...e,currentPath:[...e.currentPath,"anyOf",`${r}`]})).filter(s=>!!s&&(!e.strictUnions||typeof s=="object"&&Object.keys(s).length>0));return t.length?{anyOf:t}:void 0};function Co(a,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(a.innerType._def.typeName)&&(!a.innerType._def.checks||!a.innerType._def.checks.length))return e.target==="openApi3"?{type:St[a.innerType._def.typeName],nullable:true}:{type:[St[a.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let s=B(a.innerType._def,{...e,currentPath:[...e.currentPath]});return s&&"$ref"in s?{allOf:[s],nullable:true}:s&&{...s,nullable:true}}let t=B(a.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return t&&{anyOf:[t,{type:"null"}]}}function ko(a,e){let t={type:"number"};if(!a.checks)return t;for(let s of a.checks)switch(s.kind){case "int":t.type="integer",ds(t,"type",s.message,e);break;case "min":e.target==="jsonSchema7"?s.inclusive?ee(t,"minimum",s.value,s.message,e):ee(t,"exclusiveMinimum",s.value,s.message,e):(s.inclusive||(t.exclusiveMinimum=true),ee(t,"minimum",s.value,s.message,e));break;case "max":e.target==="jsonSchema7"?s.inclusive?ee(t,"maximum",s.value,s.message,e):ee(t,"exclusiveMaximum",s.value,s.message,e):(s.inclusive||(t.exclusiveMaximum=true),ee(t,"maximum",s.value,s.message,e));break;case "multipleOf":ee(t,"multipleOf",s.value,s.message,e);break}return t}function Do(a,e){let t=e.target==="openAi",s={type:"object",properties:{}},r=[],n=a.shape();for(let i in n){let c=n[i];if(c===void 0||c._def===void 0)continue;let u=nf(c);u&&t&&(c instanceof Ne&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),u=false);let h=B(c._def,{...e,currentPath:[...e.currentPath,"properties",i],propertyPath:[...e.currentPath,"properties",i]});h!==void 0&&(s.properties[i]=h,u||r.push(i));}r.length&&(s.required=r);let o=sf(a,e);return o!==void 0&&(s.additionalProperties=o),s}function sf(a,e){if(a.catchall._def.typeName!=="ZodNever")return B(a.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(a.unknownKeys){case "passthrough":return e.allowedAdditionalProperties;case "strict":return e.rejectedAdditionalProperties;case "strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function nf(a){try{return a.isOptional()}catch(e){return true}}var No=(a,e)=>{var s;if(e.currentPath.toString()===((s=e.propertyPath)==null?void 0:s.toString()))return B(a.innerType._def,e);let t=B(a.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return t?{anyOf:[{not:{}},t]}:{}};var jo=(a,e)=>{if(e.pipeStrategy==="input")return B(a.in._def,e);if(e.pipeStrategy==="output")return B(a.out._def,e);let t=B(a.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),s=B(a.out._def,{...e,currentPath:[...e.currentPath,"allOf",t?"1":"0"]});return {allOf:[t,s].filter(r=>r!==void 0)}};function Lo(a,e){return B(a.type._def,e)}function Fo(a,e){let s={type:"array",uniqueItems:true,items:B(a.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return a.minSize&&ee(s,"minItems",a.minSize.value,a.minSize.message,e),a.maxSize&&ee(s,"maxItems",a.maxSize.value,a.maxSize.message,e),s}function Mo(a,e){return a.rest?{type:"array",minItems:a.items.length,items:a.items.map((t,s)=>B(t._def,{...e,currentPath:[...e.currentPath,"items",`${s}`]})).reduce((t,s)=>s===void 0?t:[...t,s],[]),additionalItems:B(a.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:a.items.length,maxItems:a.items.length,items:a.items.map((t,s)=>B(t._def,{...e,currentPath:[...e.currentPath,"items",`${s}`]})).reduce((t,s)=>s===void 0?t:[...t,s],[])}}function qo(){return {not:{}}}function zo(){return {}}var Ho=(a,e)=>B(a.innerType._def,e);var Vo=(a,e,t)=>{switch(e){case T.ZodString:return ya(a,t);case T.ZodNumber:return ko(a,t);case T.ZodObject:return Do(a,t);case T.ZodBigInt:return go(a,t);case T.ZodBoolean:return yo();case T.ZodDate:return fs(a,t);case T.ZodUndefined:return qo();case T.ZodNull:return Io(t);case T.ZodArray:return vo(a,t);case T.ZodUnion:case T.ZodDiscriminatedUnion:return Ao(a,t);case T.ZodIntersection:return xo(a,t);case T.ZodTuple:return Mo(a,t);case T.ZodRecord:return _a(a,t);case T.ZodLiteral:return So(a,t);case T.ZodEnum:return Po(a);case T.ZodNativeEnum:return To(a);case T.ZodNullable:return Co(a,t);case T.ZodOptional:return No(a,t);case T.ZodMap:return Ro(a,t);case T.ZodSet:return Fo(a,t);case T.ZodLazy:return ()=>a.getter()._def;case T.ZodPromise:return Lo(a,t);case T.ZodNaN:case T.ZodNever:return Oo();case T.ZodEffects:return Eo(a,t);case T.ZodAny:return mo();case T.ZodUnknown:return zo();case T.ZodDefault:return bo(a,t);case T.ZodBranded:return ga(a,t);case T.ZodReadonly:return Ho(a,t);case T.ZodCatch:return _o(a,t);case T.ZodPipeline:return jo(a,t);case T.ZodFunction:case T.ZodVoid:case T.ZodSymbol:return;default:return (s=>{})()}};function B(a,e,t=false){var i;let s=e.seen.get(a);if(e.override){let c=(i=e.override)==null?void 0:i.call(e,a,e,s,t);if(c!==fo)return c}if(s&&!t){let c=of(s,e);if(c!==void 0)return c}let r={def:a,path:e.currentPath,jsonSchema:void 0};e.seen.set(a,r);let n=Vo(a,a.typeName,e),o=typeof n=="function"?B(n(),e):n;if(o&&cf(a,e,o),e.postProcess){let c=e.postProcess(o,a,e);return r.jsonSchema=o,c}return r.jsonSchema=o,o}var of=(a,e)=>{switch(e.$refStrategy){case "root":return {$ref:a.path.join("/")};case "relative":return {$ref:lf(e.currentPath,a.path)};case "none":case "seen":return a.path.length<e.currentPath.length&&a.path.every((t,s)=>e.currentPath[s]===t)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),{}):e.$refStrategy==="seen"?{}:void 0}},lf=(a,e)=>{let t=0;for(;t<a.length&&t<e.length&&a[t]===e[t];t++);return [(a.length-t).toString(),...e.slice(t)].join("/")},cf=(a,e,t)=>(a.description&&(t.description=a.description,e.markdownDescription&&(t.markdownDescription=a.description)),t);var ba=(a,e)=>{var c;let t=po(e),s=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((u,[h,p])=>{var y;return {...u,[h]:(y=B(p._def,{...t,currentPath:[...t.basePath,t.definitionPath,h]},true))!=null?y:{}}},{}):void 0,r=typeof e=="string"?e:(e==null?void 0:e.nameStrategy)==="title"||e==null?void 0:e.name,n=(c=B(a._def,r===void 0?t:{...t,currentPath:[...t.basePath,t.definitionPath,r]},false))!=null?c:{},o=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;o!==void 0&&(n.title=o);let i=r===void 0?s?{...n,[t.definitionPath]:s}:n:{$ref:[...t.$refStrategy==="relative"?[]:t.basePath,t.definitionPath,r].join("/"),[t.definitionPath]:{...s,[r]:n}};return t.target==="jsonSchema7"?i.$schema="http://json-schema.org/draft-07/schema#":(t.target==="jsonSchema2019-09"||t.target==="openAi")&&(i.$schema="https://json-schema.org/draft/2019-09/schema#"),t.target==="openAi"&&("anyOf"in i||"oneOf"in i||"allOf"in i||"type"in i&&Array.isArray(i.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),i};var ms;(function(a){a.Completable="McpCompletable";})(ms||(ms={}));var ut=class extends K{_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}};ut.create=(a,e)=>new ut({type:a,typeName:ms.Completable,complete:e.complete,...uf(e)});function uf(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,u;let{message:h}=a;return o.code==="invalid_enum_value"?{message:h!=null?h:i.defaultError}:typeof i.data=="undefined"?{message:(c=h!=null?h:s)!==null&&c!==void 0?c:i.defaultError}:o.code!=="invalid_type"?{message:i.defaultError}:{message:(u=h!=null?h:t)!==null&&u!==void 0?u:i.defaultError}},description:r}}var Pa=class{constructor(e,t){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=false,this._completionHandlerInitialized=false,this._resourceHandlersInitialized=false,this._promptHandlersInitialized=false,this.server=new va(e,t);}async connect(e){return await this.server.connect(e)}async close(){await this.server.close();}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(Gt.shape.method.value),this.server.assertCanSetRequestHandler(Kt.shape.method.value),this.server.registerCapabilities({tools:{listChanged:true}}),this.server.setRequestHandler(Gt,()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,t])=>{let s={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?ba(t.inputSchema,{strictUnions:true}):df,annotations:t.annotations};return t.outputSchema&&(s.outputSchema=ba(t.outputSchema,{strictUnions:true})),s})})),this.server.setRequestHandler(Kt,async(e,t)=>{let s=this._registeredTools[e.params.name];if(!s)throw new fe(de.InvalidParams,`Tool ${e.params.name} not found`);if(!s.enabled)throw new fe(de.InvalidParams,`Tool ${e.params.name} disabled`);let r;if(s.inputSchema){let n=await s.inputSchema.safeParseAsync(e.params.arguments);if(!n.success)throw new fe(de.InvalidParams,`Invalid arguments for tool ${e.params.name}: ${n.error.message}`);let o=n.data,i=s.callback;try{r=await Promise.resolve(i(o,t));}catch(c){r={content:[{type:"text",text:c instanceof Error?c.message:String(c)}],isError:true};}}else {let n=s.callback;try{r=await Promise.resolve(n(t));}catch(o){r={content:[{type:"text",text:o instanceof Error?o.message:String(o)}],isError:true};}}if(s.outputSchema&&!r.isError){if(!r.structuredContent)throw new fe(de.InvalidParams,`Tool ${e.params.name} has an output schema but no structured content was provided`);let n=await s.outputSchema.safeParseAsync(r.structuredContent);if(!n.success)throw new fe(de.InvalidParams,`Invalid structured content for tool ${e.params.name}: ${n.error.message}`)}return r}),this._toolHandlersInitialized=true);}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(Jt.shape.method.value),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(Jt,async e=>{switch(e.params.ref.type){case "ref/prompt":return this.handlePromptCompletion(e,e.params.ref);case "ref/resource":return this.handleResourceCompletion(e,e.params.ref);default:throw new fe(de.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=true);}async handlePromptCompletion(e,t){let s=this._registeredPrompts[t.name];if(!s)throw new fe(de.InvalidParams,`Prompt ${t.name} not found`);if(!s.enabled)throw new fe(de.InvalidParams,`Prompt ${t.name} disabled`);if(!s.argsSchema)return Ea;let r=s.argsSchema.shape[e.params.argument.name];if(!(r instanceof ut))return Ea;let o=await r._def.complete(e.params.argument.value,e.params.context);return Zo(o)}async handleResourceCompletion(e,t){let s=Object.values(this._registeredResourceTemplates).find(o=>o.resourceTemplate.uriTemplate.toString()===t.uri);if(!s){if(this._registeredResources[t.uri])return Ea;throw new fe(de.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let r=s.resourceTemplate.completeCallback(e.params.argument.name);if(!r)return Ea;let n=await r(e.params.argument.value,e.params.context);return Zo(n)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(Vt.shape.method.value),this.server.assertCanSetRequestHandler(Ut.shape.method.value),this.server.assertCanSetRequestHandler(Zt.shape.method.value),this.server.registerCapabilities({resources:{listChanged:true}}),this.server.setRequestHandler(Vt,async(e,t)=>{let s=Object.entries(this._registeredResources).filter(([n,o])=>o.enabled).map(([n,o])=>({uri:n,name:o.name,...o.metadata})),r=[];for(let n of Object.values(this._registeredResourceTemplates)){if(!n.resourceTemplate.listCallback)continue;let o=await n.resourceTemplate.listCallback(t);for(let i of o.resources)r.push({...n.metadata,...i});}return {resources:[...s,...r]}}),this.server.setRequestHandler(Ut,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([t,s])=>({name:t,uriTemplate:s.resourceTemplate.uriTemplate.toString(),...s.metadata}))})),this.server.setRequestHandler(Zt,async(e,t)=>{let s=new URL(e.params.uri),r=this._registeredResources[s.toString()];if(r){if(!r.enabled)throw new fe(de.InvalidParams,`Resource ${s} disabled`);return r.readCallback(s,t)}for(let n of Object.values(this._registeredResourceTemplates)){let o=n.resourceTemplate.uriTemplate.match(s.toString());if(o)return n.readCallback(s,o,t)}throw new fe(de.InvalidParams,`Resource ${s} not found`)}),this.setCompletionRequestHandler(),this._resourceHandlersInitialized=true);}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(Bt.shape.method.value),this.server.assertCanSetRequestHandler(Qt.shape.method.value),this.server.registerCapabilities({prompts:{listChanged:true}}),this.server.setRequestHandler(Bt,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,t])=>({name:e,title:t.title,description:t.description,arguments:t.argsSchema?hf(t.argsSchema):void 0}))})),this.server.setRequestHandler(Qt,async(e,t)=>{let s=this._registeredPrompts[e.params.name];if(!s)throw new fe(de.InvalidParams,`Prompt ${e.params.name} not found`);if(!s.enabled)throw new fe(de.InvalidParams,`Prompt ${e.params.name} disabled`);if(s.argsSchema){let r=await s.argsSchema.safeParseAsync(e.params.arguments);if(!r.success)throw new fe(de.InvalidParams,`Invalid arguments for prompt ${e.params.name}: ${r.error.message}`);let n=r.data,o=s.callback;return await Promise.resolve(o(n,t))}else {let r=s.callback;return await Promise.resolve(r(t))}}),this.setCompletionRequestHandler(),this._promptHandlersInitialized=true);}resource(e,t,...s){let r;typeof s[0]=="object"&&(r=s.shift());let n=s[0];if(typeof t=="string"){if(this._registeredResources[t])throw new Error(`Resource ${t} is already registered`);let o=this._createRegisteredResource(e,void 0,t,r,n);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}else {if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let o=this._createRegisteredResourceTemplate(e,void 0,t,r,n);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}}registerResource(e,t,s,r){if(typeof t=="string"){if(this._registeredResources[t])throw new Error(`Resource ${t} is already registered`);let n=this._createRegisteredResource(e,s.title,t,s,r);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),n}else {if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let n=this._createRegisteredResourceTemplate(e,s.title,t,s,r);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),n}}_createRegisteredResource(e,t,s,r,n){let o={name:e,title:t,metadata:r,readCallback:n,enabled:true,disable:()=>o.update({enabled:false}),enable:()=>o.update({enabled:true}),remove:()=>o.update({uri:null}),update:i=>{typeof i.uri!="undefined"&&i.uri!==s&&(delete this._registeredResources[s],i.uri&&(this._registeredResources[i.uri]=o)),typeof i.name!="undefined"&&(o.name=i.name),typeof i.title!="undefined"&&(o.title=i.title),typeof i.metadata!="undefined"&&(o.metadata=i.metadata),typeof i.callback!="undefined"&&(o.readCallback=i.callback),typeof i.enabled!="undefined"&&(o.enabled=i.enabled),this.sendResourceListChanged();}};return this._registeredResources[s]=o,o}_createRegisteredResourceTemplate(e,t,s,r,n){let o={resourceTemplate:s,title:t,metadata:r,readCallback:n,enabled:true,disable:()=>o.update({enabled:false}),enable:()=>o.update({enabled:true}),remove:()=>o.update({name:null}),update:i=>{typeof i.name!="undefined"&&i.name!==e&&(delete this._registeredResourceTemplates[e],i.name&&(this._registeredResourceTemplates[i.name]=o)),typeof i.title!="undefined"&&(o.title=i.title),typeof i.template!="undefined"&&(o.resourceTemplate=i.template),typeof i.metadata!="undefined"&&(o.metadata=i.metadata),typeof i.callback!="undefined"&&(o.readCallback=i.callback),typeof i.enabled!="undefined"&&(o.enabled=i.enabled),this.sendResourceListChanged();}};return this._registeredResourceTemplates[e]=o,o}_createRegisteredPrompt(e,t,s,r,n){let o={title:t,description:s,argsSchema:r===void 0?void 0:l.object(r),callback:n,enabled:true,disable:()=>o.update({enabled:false}),enable:()=>o.update({enabled:true}),remove:()=>o.update({name:null}),update:i=>{typeof i.name!="undefined"&&i.name!==e&&(delete this._registeredPrompts[e],i.name&&(this._registeredPrompts[i.name]=o)),typeof i.title!="undefined"&&(o.title=i.title),typeof i.description!="undefined"&&(o.description=i.description),typeof i.argsSchema!="undefined"&&(o.argsSchema=l.object(i.argsSchema)),typeof i.callback!="undefined"&&(o.callback=i.callback),typeof i.enabled!="undefined"&&(o.enabled=i.enabled),this.sendPromptListChanged();}};return this._registeredPrompts[e]=o,o}_createRegisteredTool(e,t,s,r,n,o,i){let c={title:t,description:s,inputSchema:r===void 0?void 0:l.object(r),outputSchema:n===void 0?void 0:l.object(n),annotations:o,callback:i,enabled:true,disable:()=>c.update({enabled:false}),enable:()=>c.update({enabled:true}),remove:()=>c.update({name:null}),update:u=>{typeof u.name!="undefined"&&u.name!==e&&(delete this._registeredTools[e],u.name&&(this._registeredTools[u.name]=c)),typeof u.title!="undefined"&&(c.title=u.title),typeof u.description!="undefined"&&(c.description=u.description),typeof u.paramsSchema!="undefined"&&(c.inputSchema=l.object(u.paramsSchema)),typeof u.callback!="undefined"&&(c.callback=u.callback),typeof u.annotations!="undefined"&&(c.annotations=u.annotations),typeof u.enabled!="undefined"&&(c.enabled=u.enabled),this.sendToolListChanged();}};return this._registeredTools[e]=c,this.setToolRequestHandlers(),this.sendToolListChanged(),c}tool(e,...t){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let s,r,n,o;if(typeof t[0]=="string"&&(s=t.shift()),t.length>1){let c=t[0];Uo(c)?(r=t.shift(),t.length>1&&typeof t[0]=="object"&&t[0]!==null&&!Uo(t[0])&&(o=t.shift())):typeof c=="object"&&c!==null&&(o=t.shift());}let i=t[0];return this._createRegisteredTool(e,void 0,s,r,n,o,i)}registerTool(e,t,s){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let{title:r,description:n,inputSchema:o,outputSchema:i,annotations:c}=t;return this._createRegisteredTool(e,r,n,o,i,c,s)}prompt(e,...t){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let s;typeof t[0]=="string"&&(s=t.shift());let r;t.length>1&&(r=t.shift());let n=t[0],o=this._createRegisteredPrompt(e,void 0,s,r,n);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),o}registerPrompt(e,t,s){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let{title:r,description:n,argsSchema:o}=t,i=this._createRegisteredPrompt(e,r,n,o,s);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),i}isConnected(){return this.server.transport!==void 0}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged();}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged();}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged();}};var df={type:"object",properties:{}};function Uo(a){return typeof a!="object"||a===null?false:Object.keys(a).length===0||Object.values(a).some(ff)}function ff(a){return a!==null&&typeof a=="object"&&"parse"in a&&typeof a.parse=="function"&&"safeParse"in a&&typeof a.safeParse=="function"}function hf(a){return Object.entries(a.shape).map(([e,t])=>({name:e,description:t.description,required:!t.isOptional()}))}function Zo(a){return {completion:{values:a.slice(0,100),total:a.length,hasMore:a.length>100}}}var Ea={completion:{values:[],hasMore:false}};var Xe=null,vs=false;function pf(){if(!Xe)try{let a=window.location.hostname||"localhost";Xe=new Pa({name:a,version:"1.0.0"},{capabilities:{tools:{listChanged:!0},debouncedNotificationMethods:["notifications/tools/list_changed"]}}),Xe.registerTool("get_current_website_title",{description:"Get the title of the current website"},async()=>{try{return {content:[{type:"text",text:document.title||"Untitled"}]}}catch(t){return console.error("Error in get_current_website_title tool:",t),{content:[{type:"text",text:`Error getting website title ${t instanceof Error?t.message:String(t)}`}],isError:!0}}});let e=new nn({allowedOrigins:["*"]});Xe.connect(e);}catch(a){Xe=null;let e=a instanceof Error?a.message:"Unknown error";throw new Error(`Failed to initialize MCP server: ${e}`)}}function xa(){if(typeof window=="undefined"){console.warn("initializeGlobalMCP called in non-browser environment; skipping.");return}if(!(vs&&window.mcp&&Xe))try{pf(),Xe&&(window.mcp=Xe,vs=!0);}catch(a){throw console.error("Failed to initialize global MCP:",a),a}}function mf(){if(Xe)try{Xe.close();}catch(a){console.warn("Error closing MCP server:",a);}finally{Xe=null;}typeof window!="undefined"&&"mcp"in window&&delete window.mcp,vs=false;}if(typeof window!="undefined"&&typeof document!="undefined"){let a=()=>{try{xa();}catch(e){console.error("Auto-initialization of global MCP failed:",e);}};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",a):a();}var rg=xa;/*! Bundled license information:
|
|
7
|
+
|
|
8
|
+
uri-js/dist/es5/uri.all.js:
|
|
9
|
+
(** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js *)
|
|
10
|
+
*/exports.cleanupGlobalMCP=mf;exports.default=rg;exports.initializeGlobalMCP=xa;Object.defineProperty(exports,'__esModule',{value:true});return exports;})({});//# sourceMappingURL=index.umd.js.map
|
|
11
|
+
//# sourceMappingURL=index.umd.js.map
|